<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
 */

Route::middleware(['auth'])->group(function () {

		Route::get('/', function () {
				return view('index');
			});
		Route::get('report', function () {
				return view('report.index');
			});

		Route::resource('customer-category', 'CustomerCategoryController');

		Route::resource('employee-position', 'EmployeePossitionController');

		Route::resource('product-category', 'ProductCategoryController');

		Route::resource('transaction-terms', 'TransectionTermsController');

		Route::resource('supplier-category', 'SupplierCategoryController');
		Route::resource('vat', 'VatTaxController');
		//product_tax;
		Route::resource('employee', 'EmployeeProfileController');
		Route::post('employee-update', 'EmployeeProfileController@updateProfile');

		Route::resource('store-house-location', 'StoreHouseLocationController');
		Route::resource('shipper-profile', 'ShipperProfileController');
		Route::resource('measurment', 'ProductMeasurementController');

		Route::resource('product-profile', 'ProductProfileController');
		Route::resource('product-price-list', 'ProductPricelistController');
		Route::get('owner', 'OwnerProfileController@index');
		Route::post('owner-store', 'OwnerProfileController@store');
		Route::get('owner-edit/{id}', 'OwnerProfileController@edit');
		Route::post('owner-update/{id}', 'OwnerProfileController@update');

		Route::get('expense', 'ExpenseController@index');
		Route::post('expense-store', 'ExpenseController@store');
		Route::get('expense-edit/{id}', 'ExpenseController@edit');
		Route::post('expense-update/{id}', 'ExpenseController@update');
		Route::get('cash-expense', 'ExpenseController@cashExpense');
		Route::get('fetch_expense_account', 'ExpenseController@fetch_expense_account');
		Route::get('reverse-expense', 'ExpenseController@reverseExpense');
		Route::post('expense-reverse-details', 'ExpenseController@reverseItemFetch');

		Route::resource('customer', 'CustomerProfileController');
		Route::post('customer/store', 'CustomerProfileController@store');
		Route::get('customer-report', 'CustomerProfileController@CustomerReport');
		Route::get('customer-report/{id}', 'CustomerProfileController@GetCustomerReportIndivisual');

		Route::resource('supplier', 'SupplierProfileController');

		Route::get('search-product', 'ProductOrderController@search');
		Route::get('product_find', 'ProductOrderController@purchse_preorder');
		Route::get('product_add', 'ProductOrderController@product_add');

		Route::get('purchase-order', 'ProductOrderController@index');
		Route::get('supplier_for_purchase', 'ProductOrderController@supplier_for_purchase');

		Route::get('opening-item', 'ProductOrderController@opening_inventory');
		Route::post('process-order', 'ProductOrderController@process_order');
		Route::get('purchase-preorder', 'ProductOrderController@purchasePreorder');
		Route::get('preorder-receive/{id}', 'ProductOrderController@preorder_receive');
		Route::get('preorder-delete/{id}', 'ProductOrderController@preorder_delete');
		Route::post('preorder-receive_confirm', 'ProductOrderController@preorder_receive_confirm');

		Route::get('purchase-invoice', 'ProductOrderController@PurchaseInvoice');
		Route::get('preorder-invoice', 'ProductOrderController@preorder_invoice');
		Route::get('cash-purchase', 'ProductOrderController@CashPurchaseInvoice');
		Route::get('credit-purchase', 'ProductOrderController@CreditPurchaseInvoice');
		Route::get('credit-purchase-invoice', 'ProductOrderController@PurchaseDueInvoice');
		Route::get('purchase-invoice/{id}', 'ProductOrderController@PurchaseInvoiceDetails');
		Route::get('insert-into-temp', 'ProductOrderController@insert_into_temp');
		Route::post('add-single-pre-order', 'ProductOrderController@addSinglePreOrder');
		Route::get('delete_temp/{id}', 'ProductOrderController@deleteTemp');
		Route::get('user-purchase', 'ProductOrderController@UserbasePurchase');
		Route::post('pre-order', 'ProductOrderController@pre_order');

		Route::get('sales', 'SalesController@index');
		Route::get('customer_for_sales', 'SalesController@customer_for_sales');
		Route::get('empty_temp_table', 'SalesController@empty_temp_table');
		Route::get('preorder-details/{id}', 'SalesController@preorder_details');
		Route::post('preorder-sales', 'SalesController@preorderSalesConfirm');
		Route::get('sales-return', 'SalesController@sales_return');
		Route::post('sales-return-confirm', 'SalesController@salesReturnConfirm');

		Route::get('sales-price', 'SalesPriceController@index');
		Route::get('sales-price/edit/{id}', 'SalesPriceController@edit');
		Route::post('sales-price/update/{id}', 'SalesPriceController@update');
		Route::get('sales-price/destroy/{id}', 'SalesPriceController@destroy');
		Route::get('search-unset-price', 'SalesPriceController@search_unset_price');
		Route::post('set-sales-price', 'SalesPriceController@store');

		//sales report Controller
		Route::get('sales-preorder-invoice', 'SalesReportController@preorder_invoice');
		Route::get('delete-park-sales/{id}', 'SalesReportController@delete_park_sales');
		Route::get('park_invoice_details', 'SalesReportController@park_invoice_details');
		Route::get('sales-invoices', 'SalesReportController@GetSalesOrderReport');
		Route::get('sales-invoices/{id}', 'SalesReportController@salesReportIndivisual');
		Route::get('cash-sales', 'SalesReportController@cashsalesReport');
		Route::get('credit-invoice', 'SalesReportController@CreditInvoiceReport');
		Route::get('credit-sales', 'SalesReportController@CreditSalesReport');
		Route::get('profit', 'SalesReportController@Tprofit');
		Route::get('user-sales', 'SalesReportController@UserwiseTsales');
		Route::get('return-list', 'SalesReportController@SalesReturnList');

		Route::get('due-sales-invoice', 'SalesReportController@due_sales_invoice');

		Route::get('sales-search', 'SalesController@search');
		Route::get('fetch_product', 'SalesController@fetch_product');
		Route::get('fetch_product_with_barcode', 'SalesController@fetch_product_with_barcode');
		Route::post('sales-process', 'SalesController@sales_process');

		Route::get('park_sales_process', 'SalesController@park_sales_process');
		Route::get('update_inventory', 'SalesController@update_inventory');
		Route::post('return-invoice', 'SalesController@findReturnInvoice');

		//inventory management
		Route::get('reorder', 'InventoryManagementController@ReorderReport');
		Route::get('single-reorder/{id}', 'InventoryManagementController@single_reorder');
		Route::get('available-item', 'InventoryManagementController@AvailableProduct');
		Route::get('srinkage-item', 'InventoryManagementController@SrinkageProduct');
		Route::get('all-item-report', 'InventoryManagementController@InventoryFullProduct');
		Route::get('all-item-cost-report', 'InventoryManagementController@InventoryCost');
		Route::get('reorder/edit/{id}', 'InventoryManagementController@reorderEdit');
		Route::post('reorder/update/{id}', 'InventoryManagementController@reorderUpdate');
		//inventory management

		//cash Management
		/*Route::post('auto-cash-receive', 'CashManagementController@auto_cash_receive');
		Route::get('auto-receive', 'CashManagementController@auto_cash_receive_form');*/
		Route::get('cash-received', 'CashManagementController@index');
		Route::get('fetch_account_number', 'CashManagementController@fetch_account_number');
		Route::get('cash-report', 'CashManagementController@cash_report');
		Route::get('capital-history', 'CashManagementController@capitalHistory');
		Route::get('sales-history', 'CashManagementController@salesHistory');
		Route::get('purchase-history', 'CashManagementController@purchaseHistory');
		Route::get('expense-history', 'CashManagementController@expenseHistory');
		Route::get('singleHistory/{id}', 'CashManagementController@singleHistory');
		Route::get('singleSalesHistory/{id}', 'CashManagementController@singleSalesHistory');
		Route::get('singlePurchaseHistory/{id}', 'CashManagementController@singlePurchaseHistory');
		Route::get('singleExpenseHistory/{id}', 'CashManagementController@singleExpenseHistory');

		Route::post('cash_received_done', 'CashManagementController@cash_received_done');
		Route::get('cash-payment', 'CashManagementController@cash_payment');
		Route::post('cash_payment_done', 'CashManagementController@cash_payment_done');
		Route::post('expense_paid', 'CashManagementController@expense_paid');
		Route::get('customerWiseDueInvoiceNumber', 'CashManagementController@customerWiseDueInvoiceNumber');
		Route::get('cash-recieve-from-owner', 'CashManagementController@cashReceiveFromCustomer');
		Route::get('withdrow-by-owner', 'CashManagementController@withdrowByOwner');
		Route::get('fetch_owner', 'CashManagementController@fetch_owner');
		Route::get('ownerWiseHistory', 'CashManagementController@ownerWiseHistory');
		Route::post('capitalReceive', 'CashManagementController@capitalReceive');
		Route::post('withdrow', 'CashManagementController@withdrow');
		Route::post('expenseTransectionReverse', 'CashManagementController@expenseTransectionReverse');
		/***********************
		 ***********role controller start*************
		 *********************/
		Route::resource('role', 'Role_controller');
		Route::resource('module', 'ModuleController');

		Route::get('user', function () {
				return view('user.index');
			});

		//farhad sales Controller
		Route::get('item-sales', 'FarhadSalesController@index');
		Route::get('item-purchase', 'FarhadPurchaseController@index');

	});

Auth::routes();

Route::get('/home', 'SalesController@index')->name('home');
Route::get('daily-report', function () {
		return view('daily-report.daily-report');
	});
