Untitled

mail@pastecode.io avatar
unknown
plain_text
16 days ago
53 kB
1
Indexable
Never
<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\GlobalController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\StockSalesmanPerBatch;
use App\Http\Controllers\Report\Stock\StockCard;
use App\Http\Controllers\Setting\MenuController;
use App\Http\Controllers\Setting\UserController;
use App\Http\Controllers\Finance\JournalController;
use App\Http\Controllers\Logistic\PID\PIDController;
use App\Http\Controllers\Report\Stock\StockMutation;
use App\Http\Controllers\Report\Stock\StockPosition;
use App\Http\Controllers\Finance\PaymentInController;
use App\Http\Controllers\Setting\GroupUserController;
use App\Http\Controllers\Logistic\Stock\MigoController;
use App\Http\Controllers\MasterData\Item\UomController;
use App\Http\Controllers\Report\Stock\StockCardPerBatch;
use App\Http\Controllers\Commercial\SalesOrderController;
use App\Http\Controllers\Finance\BankStatementController;
use App\Http\Controllers\Logistic\Load\OOTLoadController;
use App\Http\Controllers\Logistic\Preorder\EZDController;
use App\Http\Controllers\Logistic\Preorder\OOTController;
use App\Http\Controllers\Log\UserAccessLoginLogController;
use App\Http\Controllers\MasterData\Finance\PphController;
use App\Http\Controllers\MasterData\Finance\BankController;
use App\Http\Controllers\MasterData\General\AreaController;
use App\Http\Controllers\MasterData\General\CityController;
use App\Http\Controllers\MasterData\Item\ProductController;
use App\Http\Controllers\Commercial\ConsentLetterController;
use App\Http\Controllers\Commercial\ProductReturnController;
use App\Http\Controllers\Finance\ARReconciliationController;
use App\Http\Controllers\Logistic\Load\RetailLoadController;
use App\Http\Controllers\Logistic\Stock\GoodIssueController;
use App\Http\Controllers\Report\Stock\StockMutationPerBatch;
use App\Http\Controllers\Report\Stock\StockPositionPerBatch;
use App\Http\Controllers\Finance\NewCreditLimitTopController;
use App\Http\Controllers\MasterData\Item\BrandItemController;
use App\Http\Controllers\MasterData\Item\GroupItemController;
use App\Http\Controllers\MasterData\Item\SalesTypeController;
use App\Http\Controllers\Finance\FundReconciliationController;
use App\Http\Controllers\Logistic\Finance\StockTakeController;
use App\Http\Controllers\MasterData\Finance\AccountController;
use App\Http\Controllers\MasterData\General\CountryController;
use App\Http\Controllers\MasterData\General\CourierController;
use App\Http\Controllers\Report\Finance\CancelationController;
use App\Http\Controllers\Commercial\CustomerApprovalController;
use App\Http\Controllers\Log\AccountConfigurationLogController;
use App\Http\Controllers\Logistic\Load\RetailInvoiceController;
use App\Http\Controllers\Logistic\Preorder\WholesaleController;
use App\Http\Controllers\Logistic\Return\StockReturnController;
use App\Http\Controllers\MasterData\Finance\CurrencyController;
use App\Http\Controllers\MasterData\General\CustomerController;
use App\Http\Controllers\MasterData\General\DistrictController;
use App\Http\Controllers\MasterData\General\EmployeeController;
use App\Http\Controllers\MasterData\General\ProvinceController;
use App\Http\Controllers\MasterData\General\SupplierController;
use App\Http\Controllers\Report\Finance\CancellationController;
use App\Http\Controllers\Commercial\CustomerThresholdController;
use App\Http\Controllers\Finance\ChequeClearingBounceController;
use App\Http\Controllers\Logistic\Inbound\GoodReceiveController;
use App\Http\Controllers\MasterData\Finance\PricelistController;
use App\Http\Controllers\MasterData\General\SalesTreeController;
use App\Http\Controllers\MasterData\Item\CategoryItemController;
use App\Http\Controllers\MasterData\Item\PurchaseTypeController;
use App\Http\Controllers\Setting\AccountConfigurationController;
use App\Http\Controllers\Logistic\Return\ReturnFromOOTController;
use App\Http\Controllers\Logistic\Stock\StockConditionController;
use App\Http\Controllers\Logistic\Stock\WDPGoodReceiveController;
use App\Http\Controllers\MasterData\General\CompanySclController;
use App\Http\Controllers\MasterData\General\CostCenterController;
use App\Http\Controllers\MasterData\General\SalespointController;
use App\Http\Controllers\MasterData\Logistic\WarehouseController;
use App\Http\Controllers\Finance\DirectDebitInstructionController;
use App\Http\Controllers\Logistic\Inbound\PurchaseOrderController;
use App\Http\Controllers\Logistic\Load\RetailCreditNoteController;
use App\Http\Controllers\MasterData\General\BankAccountController;
use App\Http\Controllers\MasterData\General\SubdistrictController;
use App\Http\Controllers\MasterData\Item\ProductMappingController;
use App\Http\Controllers\Logistic\Preorder\EzdCreditNoteController;
use App\Http\Controllers\Logistic\Preorder\OOTCreditNoteController;
use App\Http\Controllers\MasterData\Finance\ExchangeRateController;
use App\Http\Controllers\Report\Accounting\GeneralLedgerController;
use App\Http\Controllers\MasterData\Finance\CustomerLimitController;
use App\Http\Controllers\MasterData\Finance\PaymentMethodController;
use App\Http\Controllers\Logistic\PID\NonDisposalScrappingController;
use App\Http\Controllers\Logistic\ReverseLogistic\DisposalController;
use App\Http\Controllers\Logistic\Stock\StockTransferOrderController;
use App\Http\Controllers\MasterData\Finance\BankSourceTypeController;
use App\Http\Controllers\MasterData\Finance\SettingAccountController;
use App\Http\Controllers\Report\Stock\StockCourierPerBatchController;
use App\Http\Controllers\Report\AccountReceivableCardReportController;
use App\Http\Controllers\Report\Stock\StockSalesmanPerBatchController;
use App\Http\Controllers\Commercial\ReceiptPaymentCollectionController;
use App\Http\Controllers\MasterData\Finance\PricelistRequestController;
use App\Http\Controllers\Finance\AccountPayable\APPaymentListController;
use App\Http\Controllers\Log\UserAccessUpdateLog\UserGroupLogController;
use App\Http\Controllers\Logistic\Inbound\ReturnPurchaseOrderController;
use App\Http\Controllers\MasterData\Finance\PricelistCategoryController;
use App\Http\Controllers\Logistic\Preorder\WholesaleCreditNoteController;
use App\Http\Controllers\MasterData\Finance\CustomCustomerLimitController;
use App\Http\Controllers\Report\AccountReceivablePositionReportController;
use App\Http\Controllers\Finance\DirectDebitClearingConfirmationController;
use App\Http\Controllers\Report\AccountReceivable\CreditLimitTopController;
use App\Http\Controllers\Log\UserAccessUpdateLog\UserPriviledgeLogController;
use App\Http\Controllers\Logistic\ReverseLogistic\DisposalScrappingController;
use App\Http\Controllers\Finance\AccountPayable\GoodReceiveNonTradingController;
use App\Http\Controllers\Finance\AccountPayable\PurchaseOrderNonTradingController;
use App\Http\Controllers\Finance\AccountPayable\PurchaseRequestNonTradingController;
use App\Http\Controllers\Report\Accounting\JournalController as AccountingJournalController;
use App\Http\Controllers\Commercial\DownloadFileController;
use App\Http\Controllers\Finance\AccountPayable\APClearingController;
use App\Http\Controllers\Finance\AccountPayable\PurchaseInvoiceNonTradingController;
use App\Http\Controllers\Finance\AccountPayable\PurchaseInvoiceTradingController;
use App\Http\Controllers\Finance\AccountPayable\SupplierDebitNoteController;
use App\Http\Controllers\Setting\SettingApprovalSoPrController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::group(['middleware' => ['web']], function () {
    Route::middleware(['auth:sanctum', 'checkTokenValidity'])->group(function () {
        Route::get('/', [DashboardController::class, 'dashboard'])->name('dashboard');

        Route::controller(GlobalController::class)->group(function () {
            Route::get('generate-excel', 'generateExcel')->name('generate-excel');
            Route::get('download-excel', 'downloadExcel')->name('download-excel');
            Route::get('autocomplete', 'autoComplete')->name('autocomplete');
            Route::get('ajax-data-table', 'getAjaxDataTable')->name('ajax-data-table');
            Route::get('get-browse-data', 'getBrowseData')->name('get-browse-data');
            Route::post('upload-file-data', 'upload')->name('upload-file-data');
            Route::delete('delete-file-db/{delete_file_db}', 'deleteFileDb')->name('delete-file-db');
            Route::post('get-value-product-purchase', 'getValueDetailPurchase')->name('get-value-product-purchase');
        });

        Route::middleware('checkUserGroupPermission')->group(function () {
            Route::controller(UserController::class)->group(function () {
                Route::get('/profile', 'seeProfile')->name('seeprofile');
                Route::post('/profile/send', 'updateProfileSend');
            });

            Route::prefix('/setting/')->group(function () {
                Route::resource('group-user', GroupUserController::class);
                Route::resource('user', UserController::class);
                Route::resource('menu', MenuController::class);
                Route::resource('account-configuration', AccountConfigurationController::class);
                Route::get('get-user', [UserController::class, 'getData'])->name('user-data');
                Route::post('get-user-sloc/get-grid-sloc/{id}', [UserController::class, 'getGridSloc'])->name('get-grid-sloc');
                Route::get('group-user/menu-permission/{id}', [GroupUserController::class, 'showMenuPermission']);
                Route::post('group-user/menu-permission', [GroupUserController::class, 'saveAccessMenuPermission'])->name('menu-permission');
                Route::get('setting-approval-so-pr', [SettingApprovalSoPrController::class, 'index'])->name('setting-approval-so-pr.index');
                Route::post('setting-approval-so-pr', [SettingApprovalSoPrController::class, 'update'])->name('setting-approval-so-pr.update');
            });


            Route::prefix('/log/')->group(function () {
                Route::prefix('/user-access-update-log/')->group(function () {
                    Route::resource('user-group-log', UserGroupLogController::class);
                    Route::resource('user-priviledge-log', UserPriviledgeLogController::class);

                });
                Route::resource('user-access-login-log', UserAccessLoginLogController::class);
                Route::resource('account-configuration-log', AccountConfigurationLogController::class);
            });

            Route::prefix('/master-data/')->group(function () {
                Route::prefix('/general/')->group(function () {
                    Route::resource('subdistrict', SubdistrictController::class);
                    Route::resource('district', DistrictController::class);
                    Route::resource('city', CityController::class);
                    Route::resource('country', CountryController::class);
                    Route::resource('province', ProvinceController::class);
                    Route::resource('supplier', SupplierController::class);
                    Route::resource('customer', CustomerController::class);
                    Route::resource('area', AreaController::class);
                    Route::resource('salespoint', SalespointController::class);
                    Route::resource('sales-tree', SalesTreeController::class);
                    Route::resource('bank-account', BankAccountController::class);
                    Route::get('courier/download-template', [CourierController::class, 'downloadTemplate'])->name('get-courier-template');
                    Route::resource('courier', CourierController::class);
                    Route::resource('company', CompanySclController::class);
                    Route::post('courier/import', [CourierController::class, 'import'])->name('courier-import');
                    Route::resource('cost-center', CostCenterController::class);
                    Route::resource('employee', EmployeeController::class);
                });

                Route::prefix('/finance/')->group(function () {
                    Route::resource('currency', CurrencyController::class);
                    Route::resource('exchange-rate', ExchangeRateController::class);
                    Route::resource('account', AccountController::class);
                    Route::resource('setting-account', SettingAccountController::class);
                    Route::resource('payment-method', PaymentMethodController::class);
                    Route::resource('pricelist-category', PricelistCategoryController::class);
                    Route::resource('pricelist', PricelistController::class);
                    Route::controller(PricelistRequestController::class)->group(function () {
                        Route::get('pricelist-request/send', [PricelistRequestController::class, 'send'])->name('pricelist-request.send');
                        Route::post('pricelist-request/store-send', [PricelistRequestController::class, 'store_send'])->name('pricelist-request.store_send');
                        Route::resource('pricelist-request', PricelistRequestController::class);

                    });
                    Route::resource('bank-source-type', BankSourceTypeController::class);
                    Route::resource('bank', BankController::class);
                    Route::controller(CustomerLimitController::class)->group(function () {
                        Route::resource('customer-limit', CustomerLimitController::class);
                        Route::put('customer-limit/approve/{id}', [CustomerLimitController::class, 'approveStatus'])->name('approve-customer-limit');
                        Route::put('customer-limit/disapprove/{id}', [CustomerLimitController::class, 'disapproveStatus'])->name('disapprove-customer-limit');
                    });

                    Route::controller(CustomCustomerLimitController::class)->group(function () {
                        Route::resource('custom-customer-limit', CustomCustomerLimitController::class);
                        Route::put('custom-customer-limit/approve/{id}', [CustomCustomerLimitController::class, 'approveStatus'])->name('approve-custom-customer-limit');
                        Route::put('custom-customer-limit/disapprove/{id}', [CustomCustomerLimitController::class, 'disapproveStatus'])->name('disapprove-custom-customer-limit');
                    });

                    Route::resource('pph', PphController::class);
                });

                Route::prefix('/item/')->group(function () {
                    Route::resource('item-group', GroupItemController::class);
                    Route::resource('sales-type', SalesTypeController::class);
                    Route::resource('item-brand', BrandItemController::class);
                    Route::resource('uom', UomController::class);
                    Route::resource('item-category', CategoryItemController::class);
                    Route::resource('purchase-type', PurchaseTypeController::class);
                    Route::controller(ProductMappingController::class)->group(function () {
                        Route::resource('product-mapping', ProductMappingController::class);
                        Route::post('product/get-grid-item/{id}', [ProductMappingController::class, 'getGridItem'])->name('get-grid-item-product');
                    });
                    Route::controller(ProductController::class)->group(function () {
                        Route::resource('product', ProductController::class);
                        Route::post('product/get-grid-item/{id}', [ProductController::class, 'getGridItem'])->name('get-grid-item-product');
                    });
                });

                Route::prefix('/logistic/')->group(function () {
                    Route::controller(WarehouseController::class)->group(function () {
                        Route::get('warehouse/get-grid-details', [WarehouseController::class, 'getGridDetails'])->name('get-grid-details');
                        Route::resource('warehouse', WarehouseController::class);
                    });
                });
            });

            Route::prefix('/commercial/')->group(function (){
                Route::resource('consent-letter', ConsentLetterController::class);
                Route::resource('customer-threshold', CustomerThresholdController::class);
                Route::resource('download-file', DownloadFileController::class)->only(['index']);
                Route::get('download-file/download', [DownloadFileController::class, 'downloadS3'])->name('download-file.download');
                Route::resource('receipt-payment-collection', ReceiptPaymentCollectionController::class)->only(['index', 'show']);
                Route::controller(SalesOrderController::class)->group(function () {
                    Route::resource('sales-order', SalesOrderController::class)->only(['index', 'show']);
                    Route::put('sales-order/approve/{id}', [SalesOrderController::class, 'approveStatus'])->name('approve-sales-order');
                    Route::put('sales-order/disapprove/{id}', [SalesOrderController::class, 'disapproveStatus'])->name('disapprove-sales-order');
                    Route::put('sales-order/end/{id}', [SalesOrderController::class, 'endedStatus'])->name('end-sales-order');
                });
                Route::controller(ProductReturnController::class)->group(function () {
                    Route::resource('product-return', ProductReturnController::class);
                    Route::put('product-return/approve/{id}', [ProductReturnController::class, 'approveStatus'])->name('approve-product-return');
                    Route::put('product-return/disapprove/{id}', [ProductReturnController::class, 'disapproveStatus'])->name('disapprove-product-return');
                    Route::put('product-return/end/{id}', [ProductReturnController::class, 'endedStatus'])->name('end-product-return');
                });
                Route::controller(CustomerApprovalController::class)->group(function () {
                    Route::get('customer-approval/mass-approve', [CustomerApprovalController::class, 'massApproveStatus'])->name('customer-approval.mass-approve');
                    Route::get('customer-approval/mass-reject', [CustomerApprovalController::class, 'massRejectStatus'])->name('customer-approval.mass-reject');
                    Route::post('customer-approval/update-status', [CustomerApprovalController::class, 'updateStatus'])->name('customer-approval.update-status');
                    Route::get('customer-approval/multiple-approve', [CustomerApprovalController::class, 'send'])->name('customer-approval.multiple-approve');
                    Route::post('customer-approval/multiple-approve-send', [CustomerApprovalController::class, 'store_send'])->name('customer-approval.multiple-approve-send');
                    Route::resource('customer-approval', CustomerApprovalController::class)->only(['index', 'show']);
                    Route::put('customer-approval/approve/{id}', [CustomerApprovalController::class, 'approveStatus'])->name('approve-customer-approval');
                    Route::put('customer-approval/disapprove/{id}', [CustomerApprovalController::class, 'disapproveStatus'])->name('disapprove-customer-approval');
                });
                
            });

            Route::prefix('/logistic/')->group(function () {
                Route::prefix('/inbound/')->group(function () {
                    Route::controller(PurchaseOrderController::class)->group(function () {
                        Route::get('purchase-order/{id},{action}', [PurchaseOrderController::class, 'showApproved']);
                        Route::resource('purchase-order', PurchaseOrderController::class);
                        Route::get('purchase-order/print/{purchase_order}', [PurchaseOrderController::class, 'print'])->name('purchase-order.print');
                        Route::put('purchase-order/approve/{id}', [PurchaseOrderController::class, 'approveStatus'])->name('approve-purchase-order');
                        Route::put('purchase-order/disapprove/{id}', [PurchaseOrderController::class, 'disapproveStatus'])->name('disapprove-purchase-order');
                        Route::put('purchase-order/send-email/{id}', [PurchaseOrderController::class, 'sendEmail'])->name('send-email-purchase-order');
                        Route::put('purchase-order/publish/{id}', [PurchaseOrderController::class, 'publish'])->name('purchase-order.publish');
                    });
                    Route::controller(GoodReceiveController::class)->group(function () {
                        Route::resource('good-receive', GoodReceiveController::class);
                        Route::put('good-receive/approve/{id}', [GoodReceiveController::class, 'approveStatus'])->name('approve-good-receive');
                        Route::put('good-receive/disapprove/{id}', [GoodReceiveController::class, 'disapproveStatus'])->name('disapprove-good-receive');
                        Route::post('good-receive/get-grid-item/{id}', [GoodReceiveController::class, 'getGridItem'])->name('get-grid-item-good-receive');
                    });

                    Route::controller(ReturnPurchaseOrderController::class)->group(function () {
                        Route::resource('return-purchase-order', ReturnPurchaseOrderController::class);
                        Route::put('return-purchase-order/approve/{id}', [ReturnPurchaseOrderController::class, 'approveStatus'])->name('approve-return-purchase-order');
                        Route::put('return-purchase-order/disapprove/{id}', [ReturnPurchaseOrderController::class, 'disapproveStatus'])->name('disapprove-return-purchase-order');
                        Route::post('return-purchase-order/get-grid-item/{id}', [ReturnPurchaseOrderController::class, 'getGridItem'])->name('get-grid-item-return-purchase-order');
                    });
                });

                Route::prefix('/stock/')->group(function () {
                    Route::controller(StockTransferOrderController::class)->group(function () {
                        Route::resource('stock-transfer-order', StockTransferOrderController::class);
                        Route::get('stock-transfer-order/print/{stock_transfer_order}', [StockTransferOrderController::class, 'print'])->name('stock-transfer-order.print');
                        Route::put('stock-transfer-order/approve/{id}', [StockTransferOrderController::class, 'approveStatus'])->name('approve-stock-transfer-order');
                        Route::put('stock-transfer-order/disapprove/{id}', [StockTransferOrderController::class, 'disapproveStatus'])->name('disapprove-stock-transfer-order');
                        Route::post('stock-transfer-order/import', [StockTransferOrderController::class, 'import'])->name('stock-transfer-order-import');
                    });
                    Route::controller(GoodIssueController::class)->group(function () {
                        Route::resource('good-issue', GoodIssueController::class);
                        Route::get('good-issue/print/{good_issue}', [GoodIssueController::class, 'print'])->name('good-issue.print');
                        Route::get('good-issue/{id}', [GoodIssueController::class, 'show'])->name('logistic.stock.good_issue.show');
                        Route::put('good-issue/approve/{id}', [GoodIssueController::class, 'approveStatus'])->name('approve-good-issue');
                        Route::put('good-issue/disapprove/{id}', [GoodIssueController::class, 'disapproveStatus'])->name('disapprove-good-issue');

                    });
                    Route::controller(WDPGoodReceiveController::class)->group(function () {
                        Route::resource('wdp-good-receive', WDPGoodReceiveController::class);
                        Route::put('wdp-good-receive/approve/{id}', [WDPGoodReceiveController::class, 'approveStatus'])->name('approve-wdp-good-receive');
                        Route::put('wdp-good-receive/reject/{id}', [WDPGoodReceiveController::class, 'rejectStatus'])->name('reject-wdp-good-receive');
                    });
                    Route::controller(MigoController::class)->group(function () {
                        Route::resource('migo', MigoController::class);
                        Route::put('migo/approve/{id}', [MigoController::class, 'approveStatus'])->name('approve-migo');
                        Route::put('migo/disapprove/{id}', [MigoController::class, 'disapproveStatus'])->name('disapprove-migo');
                    });
                    Route::controller(StockConditionController::class)->group(function () {
                        Route::get('stock-condition/get-grid-details', [StockConditionController::class, 'getGridDetails'])->name('get-grid-detail-stock-conditions');
                        Route::post('stock-condition/get-stock-conditions', [StockConditionController::class, 'getStockConditionDetail'])->name('stock-condition-detail');
                        Route::resource('stock-condition', StockConditionController::class);
                        Route::put('stock-condition/approve/{id}', [StockConditionController::class, 'approveStatus'])->name('approve-stock-condition');
                    });
                });

                Route::prefix('/reverse-logistic/')->group(function () {
                    Route::controller(DisposalController::class)->group(function () {
                        Route::put('disposal/approve/{id}', [DisposalController::class, 'approveStatus'])->name('approve-disposal');
                        Route::put('disposal/approve2/{id}', [DisposalController::class, 'approveStatus2'])->name('approve2-disposal');
                        Route::put('disposal/disapprove/{id}', [DisposalController::class, 'disapproveStatus'])->name('disapprove-disposal');
                        Route::put('disposal/publish/{id}', [DisposalController::class, 'publish'])->name('disposal.publish');
                        Route::resource('disposal', DisposalController::class);
                    });

                    Route::controller(DisposalScrappingController::class)->group(function () {
                        Route::resource('disposal-scrapping', DisposalScrappingController::class);
                        Route::put('disposal-scrapping/approve/{id}', [DisposalScrappingController::class, 'approveStatus'])->name('approve-disposal-scrapping');
                        Route::put('disposal-scrapping/disapprove/{id}', [DisposalScrappingController::class, 'disapproveStatus'])->name('disapprove-disposal-scrapping');
                    });
                });

                Route::prefix('/pid/')->group(function () {
                    Route::controller(NonDisposalScrappingController::class)->group(function () {
                        Route::put('non-disposal-scrapping/approve/{id}', [NonDisposalScrappingController::class, 'approveStatus'])->name('approve-non-disposal-scrapping');
                        Route::put('non-disposal-scrapping/approve2/{id}', [NonDisposalScrappingController::class, 'approveStatus2'])->name('approve2-non-disposal-scrapping');
                        Route::put('non-disposal-scrapping/disapprove/{id}', [NonDisposalScrappingController::class, 'disapproveStatus'])->name('disapprove-non-disposal-scrapping');
                        Route::put('non-disposal-scrapping/publish/{id}', [NonDisposalScrappingController::class, 'publish'])->name('non-disposal-scrapping.publish');
                        Route::resource('non-disposal-scrapping', NonDisposalScrappingController::class);
                    });

                    Route::controller(PIDController::class)->group(function () {
                        Route::put('pid/approve/{id}', [PIDController::class, 'approveStatus'])->name('approve-pid');
                        Route::put('pid/approve2/{id}', [PIDController::class, 'approveStatus2'])->name('approve2-pid');
                        Route::put('pid/disapprove/{id}', [PIDController::class, 'disapproveStatus'])->name('disapprove-pid');
                        Route::put('pid/publish/{id}', [PIDController::class, 'publish'])->name('pid.publish');
                        Route::resource('pid', PIDController::class);
                    });
                });
            });

            Route::prefix('/logistic/')->group(function () {
                Route::prefix('/preorder/')->group(function () {
                    Route::post('read-stock', [WholesaleController::class, 'readDataStock'])->name('preorder-read-stock');
                    Route::post('get-stock-load-detail-by-header-id', [OOTController::class, 'getStockLoadGridByHeaderId'])->name('get-stock-load-detail-by-header-id');

                    Route::put('preorder-wholesale/approve/{id}', [WholesaleController::class, 'approveStatus'])->name('approve-preorder-wholesale');
                    Route::put('preorder-oot/approve/{id}', [OOTController::class, 'approveStatus'])->name('approve-preorder-oot');
                    Route::put('preorder-ezd/approve/{id}', [EZDController::class, 'approveStatus'])->name('approve-preorder-ezd');

                    Route::put('preorder-wholesale/disapprove/{id}', [WholesaleController::class, 'disapproveStatus'])->name('disapprove-preorder-wholesale');
                    Route::put('preorder-oot/disapprove/{id}', [OOTController::class, 'disapproveStatus'])->name('disapprove-preorder-oot');
                    Route::put('preorder-ezd/disapprove/{id}', [EZDController::class, 'disapproveStatus'])->name('disapprove-preorder-ezd');

                    Route::put('preorder-wholesale/status-journey/{id}', [WholesaleController::class, 'statusJourney'])->name('update-status-journey-preorder-wholesale');
                    Route::put('preorder-ezd/status-journey/{id}', [EZDController::class, 'statusJourney'])->name('update-status-journey-preorder-ezd');
                    Route::put('preorder-oot/status-journey/{id}', [OOTController::class, 'statusJourney'])->name('update-status-journey-preorder-oot');

                    // sold
                    Route::put('preorder-oot/status-sold/{id}', [OOTController::class, 'statusSold'])->name('update-status-sold-preorder-oot');

                    Route::resource('wholesale', WholesaleController::class);
                    Route::get('preorder-transaction/print/wholesale/{preorder_transaction}', [WholesaleController::class, 'print'])->name('preorder-transaction-print-wholesale');

                    Route::resource('wholesale-credit-note', WholesaleCreditNoteController::class)->only(['index', 'show']);

                    Route::resource('oot', OOTController::class);
                    Route::get('preorder-transaction/print/oot/{preorder_transaction}', [OOTController::class, 'print'])->name('preorder-transaction-print-oot');

                    Route::post('preorder-oot/get-1050', [OOTController::class, 'getSlocByParentWarehouseId'])->name('preorder-oot-1050-sloc');

                    Route::resource('ezd-credit-note', EzdCreditNoteController::class)->only(['index', 'show']);


                    Route::resource('ezd', EZDController::class);
                    Route::get('preorder-transaction/print/ezd/{preorder_transaction}', [EZDController::class, 'print'])->name('preorder-transaction-print-ezd');
                });

                Route::prefix('/finance/')->group(function () {
                    Route::resource('stock-take', StockTakeController::class);

                    Route::post('stock-take/read-stock', [StockTakeController::class, 'readDataStock'])->name('stock-take-read-stock');

                    Route::put('stock-take/approve/{id}', [StockTakeController::class, 'approveStatus'])->name('approve-stock-take');
                    Route::put('stock-take/approve2/{id}', [StockTakeController::class, 'approveStatus2'])->name('approve2-stock-take');
                    Route::put('stock-take/disapprove/{id}', [StockTakeController::class, 'disapproveStatus'])->name('disapprove-stock-take');


                    Route::get('stock-take/print-stock-reconcile/{stock_take}', [StockTakeController::class, 'printStockReconcile'])->name('stock-take-print-reconcile');

                    Route::get('stock-take/print-stock-manual/{stock_take}', [StockTakeController::class, 'printStockManual'])->name('stock-take-print-manual');
                });

                Route::prefix('/load/')->group(function () {
                    Route::get('retail-load/get-grid-details', [RetailLoadController::class, 'getGridDetails'])->name('get-grid-detail-retail-load');
                    Route::post('retail-load/get-slocs', [RetailLoadController::class, 'getSlocByParentWarehouseId'])->name('retail-get-sloc-list');
                    Route::resource('retail-load', RetailLoadController::class);
                    Route::put('retail-load/approve/{id}', [RetailLoadController::class, 'approveStatus'])->name('approve-retail-load');
                    Route::put('retail-load/journey/{id}', [RetailLoadController::class, 'journeyStatus'])->name('journey-retail-load');
                    Route::put('retail-load/cancel-journey/{id}', [RetailLoadController::class, 'cancelJourneyStatus'])->name('cancel-journey-retail-load');
                    Route::post('retail-load/get-1040', [RetailLoadController::class, 'getSlocByParentWarehouseId'])->name('retail-load-1040-sloc');


                    // OOT LOAD
                    Route::controller(OOTLoadController::class)->group(function(){
                        Route::get('oot-load/get-grid-details', [OOTLoadController::class, 'getGridDetails'])->name('get-grid-detail-oot-load');
                        Route::get('oot-load/download-template', [OOTLoadController::class, 'downloadTemplate'])->name('get-oot-load-template');
                        Route::post('oot-load/import', [OOTLoadController::class, 'import'])->name('oot-load-import');
                        Route::get('oot-load/print/{oot_load}', [OOTLoadController::class, 'print'])->name('oot-load.print');
                        Route::get('oot-load/print2/{oot_load}', [OOTLoadController::class, 'print2'])->name('oot-load.print2');
                        Route::get('oot-load/print3/{oot_load}', [OOTLoadController::class, 'print3'])->name('oot-load.print3');
                        Route::put('oot-load/approve/{id}', [OOTLoadController::class, 'approveStatus'])->name('approve-oot-load');
                        Route::put('oot-load/disapprove/{id}', [OOTLoadController::class, 'disapproveStatus'])->name('disapprove-oot-load');
                        Route::put('oot-load/journey/{id}', [OOTLoadController::class, 'journeyStatus'])->name('journey-oot-load');
                        Route::put('oot-load/cancel-journey/{id}', [OOTLoadController::class, 'cancelJourneyStatus'])->name('cancel-journey-oot-load');
                        Route::post('oot-load/get-1050', [OOTLoadController::class, 'getSlocByParentWarehouseId'])->name('oot-load-1050-sloc');
                        Route::get('oot-load/in-journey', [OOTLoadController::class, 'send'])->name('oot-load.in-journey');
                        Route::post('oot-load/store-in-journey', [OOTLoadController::class, 'store_send'])->name('oot-load.in-journey-send');
                        Route::resource('oot-load', OOTLoadController::class);
                    });

                    // Route::controller(PricelistRequestController::class)->group(function () {
                    //     Route::get('pricelist-request/send', [PricelistRequestController::class, 'send'])->name('pricelist-request.send');
                    //     Route::post('pricelist-request/store-send', [PricelistRequestController::class, 'store_send'])->name('pricelist-request.store_send');
                    //     Route::resource('pricelist-request', PricelistRequestController::class);
                        
                    // });

                    Route::controller(OOTCreditNoteController::class)->group(function() {
                        Route::resource('credit-note-oot', OOTCreditNoteController::class)->only(['index', 'show', 'edit', 'update']);
                        Route::put('credit-note-oot/approve/{id}', [OOTCreditNoteController::class, 'approveStatus'])->name('approve-credit-note-oot');
                        Route::put('credit-note-oot/disapprove/{id}', [OOTCreditNoteController::class, 'disapproveStatus'])->name('disapprove-credit-note-oot');
                    });

                    Route::resource('retail-invoice', RetailInvoiceController::class);
                    Route::resource('retail-credit-note', RetailCreditNoteController::class)->only(['index', 'show']);
                });

                Route::prefix('/return/')->group(function () {
                    Route::resource('stock-return', StockReturnController::class);
                    Route::post('stock-return-grid', [StockReturnController::class, 'fetchGridDetail'])->name('fetch-stock-return-grid');

                    Route::put('stock-return/approve/{id}', [StockReturnController::class, 'approveStatus'])->name('approve-stock-return');
                    Route::put('stock-return/approve2/{id}', [StockReturnController::class, 'approveStatus2'])->name('approve2-stock-return');
                    Route::put('stock-return/disapprove/{id}', [StockReturnController::class, 'disapproveStatus'])->name('disapprove-stock-return');

                    Route::resource('return-from-oot', ReturnFromOOTController::class);
                    Route::post('return-from-oot-grid', [ReturnFromOOTController::class, 'fetchGridDetail'])->name('fetch-return-from-oot-grid');

                    Route::put('return-from-oot/approve/{id}', [ReturnFromOOTController::class, 'approveStatus'])->name('approve-return-from-oot');
                    Route::put('return-from-oot/approve2/{id}', [ReturnFromOOTController::class, 'approveStatus2'])->name('approve2-return-from-oot');
                    Route::put('return-from-oot/disapprove/{id}', [ReturnFromOOTController::class, 'disapproveStatus'])->name('disapprove-return-from-oot');
                    Route::get('return-from-oot/print/{return_from_oot}', [ReturnFromOOTController::class, 'print'])->name('return-from-oot.print');
                    Route::put('return-from-oot/end-journey/{id}', [ReturnFromOOTController::class, 'endJourney'])->name('return-from-oot.end-journey');
                });
            });

            Route::prefix('/report/')->group(function () {
                Route::prefix('/stock/')->group(function () {
                    Route::resource('stock-position', StockPosition::class);
                    Route::post('stock-position/print', [StockPosition::class, 'indexPrint'])->name('stock-position.print');
                    Route::resource('stock-position-per-batch', StockPositionPerBatch::class);

                    Route::resource('stock-card', StockCard::class);
                    Route::resource('stock-card-per-batch', StockCardPerBatch::class);

                    Route::resource('stock-mutation', StockMutation::class);
                    Route::resource('stock-mutation-per-batch', StockMutationPerBatch::class);
                    Route::resource('stock-salesman-per-batch', StockSalesmanPerBatchController::class);
                    Route::resource('stock-courier-per-batch', StockCourierPerBatchController::class);
                });

                Route::prefix('/accounting/')->group(function () {
                    Route::resource('journal-report', AccountingJournalController::class)->only('index');
                    Route::resource('general-ledger', GeneralLedgerController::class)->only('index');
                });

                Route::prefix('/account-receivable/')->group(function () {
                    Route::resource('card', AccountReceivableCardReportController::class)->only('index');
                    Route::resource('position', AccountReceivablePositionReportController::class)->only('index');
                    Route::resource('credit-limit-top', CreditLimitTopController::class)->only('index');
                });

                Route::prefix('/finance/')->group(function () {
                    Route::resource('payment_cancelation', CancelationController::class)->only('index');
                    Route::post('payment_cancelation/cancel', [CancelationController::class, 'cancel'])->name('cancel-cancelation');
                });
            });

            Route::prefix('/finance/')->group(function () {
                Route::controller(BankStatementController::class)->group(function () {
                    Route::resource('bank-statement', BankStatementController::class);
                    Route::put('bank-statement/approve/{id}', [BankStatementController::class, 'approveStatus'])->name('approve-bank-statement');
                    Route::put('bank-statement/disapprove/{id}', [BankStatementController::class, 'disapproveStatus'])->name('disapprove-bank-statement');

                    Route::post('bank-statement/import', [BankStatementController::class, 'import'])->name('bank-statement-import');
                    Route::post('bank-statement/export', [BankStatementController::class, 'export'])->name('bank-statement-export');
                    Route::post('bank-statement/upload-update', [BankStatementController::class, 'uploadToUpdate'])->name('bank-statement-upload-update');

                });
                Route::controller(JournalController::class)->group(function () {
                    Route::resource('journal', JournalController::class);
                    Route::put('journal/approve/{id}', [JournalController::class, 'approveStatus'])->name('approve-journal');
                    Route::put('journal/disapprove/{id}', [JournalController::class, 'disapproveStatus'])->name('disapprove-journal');
                });
                Route::controller(FundReconciliationController::class)->group(function () {
                    Route::resource('fund-reconciliation', FundReconciliationController::class)->only('index');
                    Route::post('fund-reconciliation/match', [FundReconciliationController::class, 'matchFundReconciliation'])->name('match-fund-reconciliation');
                    Route::post('fund-reconciliation/clear', [FundReconciliationController::class, 'clearFundReconciliation'])->name('clear-fund-reconciliation');
                    Route::post('fund-reconciliation/open', [FundReconciliationController::class, 'openFundReconciliation'])->name('open-fund-reconciliation');
                    Route::post('fund-reconciliation/unclear', [FundReconciliationController::class, 'unclearFundReconciliation'])->name('unclear-fund-reconciliation');
                    Route::post('fund-reconciliation/upload-update', [FundReconciliationController::class, 'uploadToUpdate'])->name('fund-reconciliation-upload-update');
                });

                Route::controller(ARReconciliationController::class)->group(function () {
                    Route::resource('ar-reconciliation', ARReconciliationController::class)->only('index');
                    Route::post('ar-reconciliation/match', [ARReconciliationController::class, 'matchARReconciliation'])->name('match-ar-reconciliation');
                    Route::post('ar-reconciliation/clear', [ARReconciliationController::class, 'clearARReconciliation'])->name('clear-ar-reconciliation');
                    Route::post('ar-reconciliation/open', [ARReconciliationController::class, 'openARReconciliation'])->name('open-ar-reconciliation');
                    Route::post('ar-reconciliation/unclear', [ARReconciliationController::class, 'unclearARReconciliation'])->name('unclear-ar-reconciliation');
                    Route::post('ar-reconciliation/upload-update', [ARReconciliationController::class, 'uploadToUpdate'])->name('ar-reconciliation-upload-update');
                });

                Route::controller(PaymentInController::class)->group(function () {
                    Route::resource('payment-in', PaymentInController::class);
                    Route::post('load-grid-payment-in/{customer_id}/{date}', [PaymentInController::class, 'loadGridDetail'])->name('load-grid-payment-in');
                    Route::put('approve-payment-out/{id}', [PaymentInController::class, 'approve'])->name('payment-in-approve');
                    Route::put('disapprove-payment-in/{id}', [PaymentInController::class, 'disapprove'])->name('payment-in-disapprove');
                    Route::post('payment-in/upload-data', [PaymentInController::class, 'uploadData'])->name('payment-in-upload-data');
                });

                Route::controller(DirectDebitInstructionController::class)->group(function () {
                    Route::resource('direct-debit-instruction', DirectDebitInstructionController::class);
                    Route::post('direct-debit-instruction/generate', [DirectDebitInstructionController::class, 'generate'])->name('generate-direct-debit-instruction');

                    Route::post('direct-debit-instruction/export', [DirectDebitInstructionController::class, 'export'])->name('direct-debit-instruction-export');
                });

                Route::controller(ChequeClearingBounceController::class)->group(function () {
                    Route::resource('cheque-clearing-bounce', ChequeClearingBounceController::class);
                    Route::post('cheque-clearing-bounce/bounce', [ChequeClearingBounceController::class, 'bounce'])->name('bounce-cheque-clearing-bounce');
                });

                Route::controller(DirectDebitClearingConfirmationController::class)->group(function () {
                    Route::resource('dd-clearing-confirmation', DirectDebitClearingConfirmationController::class);
                    Route::put('dd-clearing-confirmation/approve/{id}', [DirectDebitClearingConfirmationController::class, 'approveStatus'])->name('approve-dd-clearing-confirmation');
                    Route::put('dd-clearing-confirmation/disapprove/{id}', [DirectDebitClearingConfirmationController::class, 'disapproveStatus'])->name('disapprove-dd-clearing-confirmation');
                    Route::post('dd-clearing-confirmation/get-grid', [DirectDebitClearingConfirmationController::class, 'fetchGridDetail'])->name('get-detail-direct-debit-instruction');
                    Route::post('dd-clearing-confirmation/upload-file', [DirectDebitClearingConfirmationController::class, 'uploadFile'])->name('direct-debit-clearing-confirmation-upload-file');
                });

                Route::controller(NewCreditLimitTopController::class)->group(function () {
                    Route::resource('new-credit-limit-top', NewCreditLimitTopController::class);
                    Route::put('new-credit-limit-top/approve/{id}', [NewCreditLimitTopController::class, 'approveStatus'])->name('approve-new-credit-limit-top');
                    Route::put('new-credit-limit-top/disapprove/{id}', [NewCreditLimitTopController::class, 'disapproveStatus'])->name('disapprove-new-credit-limit-top');
                    Route::post('new-credit-limit-top/upload-file', [NewCreditLimitTopController::class, 'uploadFile'])->name('new-credit-limit-top-upload-file');
                });

                Route::prefix('/account-payable/')->group(function () {
                    Route::controller(PurchaseRequestNonTradingController::class)->group(function () {
                        Route::resource('pr-non-trading', PurchaseRequestNonTradingController::class);                     
                    });
                    Route::controller(PurchaseOrderNonTradingController::class)->group(function () {
                        Route::resource('po-non-trading', PurchaseOrderNonTradingController::class);                     
                    });
                    Route::controller(GoodReceiveNonTradingController::class)->group(function () {
                        Route::resource('gr-non-trading', GoodReceiveNonTradingController::class);
                        Route::post('gr-non-trading/read-detail-data-po/{id}', [GoodReceiveNonTradingController::class, 'readDataDetailOutstandingPO'])->name('gr-non-trading-read-detail-data-po');
                    });
                    Route::controller(APPaymentListController::class)->group(function () {
                        Route::resource('ap-payment-list', APPaymentListController::class);
                    });
                    Route::controller(PurchaseInvoiceNonTradingController::class)->group(function () {
                        Route::resource('pi-non-trading', PurchaseInvoiceNonTradingController::class);                     
                    });     
                    Route::controller(PurchaseInvoiceTradingController::class)->group(function () {
                        Route::resource('pi-trading', PurchaseInvoiceTradingController::class);  
                        Route::post('pi-trading/get-grid-item/{id}', [PurchaseInvoiceTradingController::class, 'getGridItem'])->name('get-grid-item-pi-trading');                   
                    });                                           
                    Route::controller(SupplierDebitNoteController::class)->group(function () {
                        Route::resource('supplier-debit-note', SupplierDebitNoteController::class);
                        Route::put('approve-supplier-debit-note/{id}',[SupplierDebitNoteController::class, 'approve'])->name('supplier-debit-note-approve');
                        Route::put('disapprove-supplier-debit-note/{id}',[SupplierDebitNoteController::class, 'disapprove'])->name('supplier-debit-note-disapprove');
                    });
                    Route::controller(APClearingController::class)->group(function () {
                        Route::resource('ap-clearing', APClearingController::class)->only('index');
                        Route::post('ap-clearing/match', [APClearingController::class, 'matchARReconciliation'])->name('match-ap-clearing');
                        Route::post('ap-clearing/clear', [APClearingController::class, 'clearARReconciliation'])->name('clear-ap-clearing');
                        Route::post('ap-clearing/open', [APClearingController::class, 'openARReconciliation'])->name('open-ap-clearing');
                        Route::post('ap-clearing/unclear', [APClearingController::class, 'unclearARReconciliation'])->name('unclear-ap-clearing');
                        Route::post('ap-clearing/upload-update', [APClearingController::class, 'uploadToUpdate'])->name('ap-clearing-upload-update');
                    });
                });
            });
        });
    });

    Route::controller(DashboardController::class)->group(function () {
        Route::get('login', 'loginpage')->name('login');
        Route::post('/login/send', 'loginSend');
        Route::get('/logout/send', 'sendLogout')->name('logout');
        Route::get('/autoLogout/send', 'sendAutoLogout')->name('autoLogout');

        // switch branch
        Route::put('/switch-branch/{branch}', 'switchBranch')->name('switch.branch');

        // switch companies
        Route::put('/switch-company/{company}', 'switchCompany')->name('switch.company');
    });

    Route::controller(GlobalController::class)->group(function () {
        Route::get('/render-warn', 'renderWarn');
        Route::get('/call-helper-function', 'callRenderBody')->name('call-helper-function');
        Route::get('lang/{lang}', ['as' => 'lang.switch', 'uses' => 'switchLang']);
        Route::get('/warning', 'showWarning')->name('warning');
    });
});
Leave a Comment