<?php

Route::group(['middleware' => 'pos', ['auth'], 'namespace' => 'report'], function () {
    route::GET('report-sale-request', 'ReportSaleController@sale_request')->name('report-sale-request');
    route::GET('get-report-sale', 'ReportSaleController@get_sale')->name('get-report-sale');
    route::GET('report-sale', 'ReportSaleController@index')->name('report-sale');
    route::GET('report-sale-detail', 'ReportSaleController@sale_detail')->name('report-sale-detail');
    route::GET('sold-product-by-seller-report', 'ReportSaleController@sale_by_seller')->name('sold-product-by-seller-report');

    route::GET('report-income-by-sale', 'ReportSaleController@report_income')->name('report-income-by-sale');

    route::GET('report-sale-income', 'ReportIncomeController@sale_income')->name('report-sale-income');
    route::GET('report-operation-expense', 'ReportIncomeController@operation_expense')->name('report-operation-expense');
    route::GET('report-cross-income', 'ReportIncomeController@cross_income')->name('report-cross-income');
});
Route::group(['middleware' => 'Administrator', ['auth'], 'namespace' => 'report'], function () {
    //sale
    Route::resource('/payment-report', 'PaymentReportController');
    Route::resource('report-customer-payment', 'ReportCustomerPaymentController');
    Route::resource('report-production', 'ReportProductionController');

    route::GET('balances', 'BalanceController@index')->name('balances.index');
    route::match(['GET', 'POST'], 'datatable-balances', 'BalanceController@datatable_balances_list')->name('datatable_balances');


    route::GET('report-delivery', 'ReportDeliveryController@index')->name('report-delivery');

    route::GET('report-purchase-payment', 'ReportPurchasePaymentController@index')->name('report-purchase-payment');

    Route::match(['GET', 'POST'], '/datatable-payment-report', 'PaymentReportController@get_payment_report')->name('datatable.payment-report');

});

// Stock Report

Route::group(['middleware' => 'pos', ['auth'], 'namespace' => 'report'], function () {
    route::GET('report-stock-item', 'StockReportController@report_stock_item')->name('report.stock-item');
    route::GET('report-stock-material', 'StockReportController@report_stock_material')->name('report.stock-material');
    route::GET('report-stock-fabric', 'StockReportController@report_stock_fabric')->name('report.stock-fabric');
    route::GET('report-stock-cut-piece', 'StockReportController@report_stock_cut_piece')->name('report.stock-cut-piece');
    route::GET('get-item-stock-purchase-history', 'StockReportController@get_item_detail')->name('get-item-stock-purchase-history');
    route::GET('get-item-stock-sale-history', 'StockReportController@get_sale_detail')->name('get-item-stock-sale-history');
    route::GET('get-item-transfer-stock-in-out-history', 'StockReportController@get_transfer_stock')->name('get-item-transfer-stock-in-out-history');
    route::GET('report-stock-item-by-date', 'StockReportController@stock_report_by_date')->name('report-stock-item-by-date');

    route::GET('report-stock-in-by-branch', 'StockReportController@stock_by_branch')->name('report-stock-in-by-branch');
    route::GET('report-stock-out-by-branch', 'StockReportController@stock_out_by_branch')->name('report-stock-out-by-branch');

    route::GET('report-stock-in-daily', 'StockReportController@stock_in_daily')->name('report-stock-in-daily');
    route::GET('report-stock-out-daily', 'StockReportController@stock_out_daily')->name('report-stock-out-daily');

    route::GET('report-stock-v1', 'StockReportController@laolin_stock_item')->name('report-stock-v1');

    Route::match(['GET', 'POST'], 'dt-search-report-reportpurchases', 'ReportPurchaseController@dt_seach_reportpurchases')->name('dt_seach_reportpurchases');
    route::GET('report-purchases-detail', 'ReportPurchaseDetailController@index')->name('report-purchases-detail');
    route::GET('report-purchases', 'ReportPurchaseController@index')->name('reportpurchases.index');
    route::GET('report-transfer-stock-to-warehouse', 'ReportTransferStockController@index')->name('report-transfer-stock-to-warehouse.index');

    route::GET('report-sale-payment', 'ReportPaymentController@index')->name('report-sale-payment');
    route::GET('report-sale-request-payment', 'ReportPaymentController@index')->name('report-sale-request-payment');
});
