<?php

use App\Permission;
use App\Http\Middleware\CheckProjectType;
use App\Http\Middleware\CheckProjectExistence;
use App\Inventory;


 

/*
|--------------------------------------------------------------------------
| 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::get('createpermission',function(){
//1
// $createPost = new Permission();
// $createPost->name         = 'create-noc';
// $createPost->display_name = 'Create NOC'; // optional
// $createPost->description  = 'Create New NOC'; // optional
// $createPost->department = 1;
// $createPost->save();
//2
// $createPost = new Permission();
// $createPost->name         = 'edit-noc';
// $createPost->display_name = 'Edit NOC'; // optional
// $createPost->department = 1;
// $createPost->save();
//3
// $createPost = new Permission();
// $createPost->name         = 'delete-noc';
// $createPost->display_name = 'Delete NOC'; // optional
// $createPost->department = 1;
// $createPost->save();
//4
// $createPost = new Permission();
// $createPost->name         = 'view-noc';
// $createPost->display_name = 'View NOC'; // optional
// $createPost->department = 1;
// $createPost->save();
//5
// $createPost = new Permission();
// $createPost->name         = 'download-noc';
// $createPost->display_name = 'Download NOC'; // optional
// $createPost->department = 1;
// $createPost->save();


// });

Route::get('createpermission', function () {
    //1
    // $createPost = new Permission();
    // $createPost->name         = 'create-cancellation';
    // $createPost->display_name = 'Create Cancellation Property'; // optional
    // $createPost->description  = 'Create New Cancellation Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();
    // //2

    // $createPost = new Permission();
    // $createPost->name         = 'edit-cancellation';
    // $createPost->display_name = 'Edit Cancellation Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();
    // //3
    // $createPost = new Permission();
    // $createPost->name         = 'delete-cancellation';
    // $createPost->display_name = 'Delete Cancellation Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();
    // //4
    // $createPost = new Permission();
    // $createPost->name         = 'view-cancellation';
    // $createPost->display_name = 'View Cancellation Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'approve-cancellation';
    // $createPost->display_name = 'Approve Cancellation Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();





    //refunded permissions
    // $createPost = new Permission();
    // $createPost->name         = 'edit-refund';
    // $createPost->display_name = 'Edit Property Refund'; // optional
    // $createPost->description  = 'Edit New Property Refund'; // optional
    // $createPost->department = 1;
    // $createPost->save();




    // $createPost = new Permission();
    // $createPost->name         = 'view-refund';
    // $createPost->display_name = 'View refund Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();







    // $createPost = new Permission();
    // $createPost->name         = 'create-cancellation';
    // $createPost->display_name = 'Create Cancellation Property'; // optional
    // $createPost->description  = 'Create New Cancellation Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();
    // // 2

    // $createPost = new Permission();
    // $createPost->name         = 'edit-cancellation';
    // $createPost->display_name = 'Edit Cancellation Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();
    // // 3
    // $createPost = new Permission();
    // $createPost->name         = 'delete-cancellation';
    // $createPost->display_name = 'Delete Cancellation Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();
    // // 4
    // $createPost = new Permission();
    // $createPost->name         = 'view-block';
    // $createPost->display_name = 'View block Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'edit-block';
    // $createPost->display_name = 'Edit Block Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();






    // $createPost = new Permission();
    // $createPost->name         = 'create-block';
    // $createPost->display_name = 'Create Block Property '; // optional
    // $createPost->description  = 'Create Block'; // optional
    // $createPost->department = 1;
    // $createPost->save();



    // $createPost = new Permission();
    // $createPost->name         = 'delete-block';
    // $createPost->display_name = 'Delete block Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();


    // $createPost = new Permission();
    // $createPost->name         = 'view-adjust';
    // $createPost->display_name = 'View Adjust Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'edit-adjust';
    // $createPost->display_name = 'Edit Adjust Property'; // optional
    // $createPost->department = 1;
    // $createPost->save();


    // $createPost = new Permission();
    // $createPost->name         = 'edit-openfile';
    // $createPost->display_name = 'Edit Open File'; // optional
    // $createPost->department = 1;
    // $createPost->save();


    // $createPost = new Permission();
    // $createPost->name         = 'view-openfile';
    // $createPost->display_name = 'View Open File'; // optional
    // $createPost->department = 1;
    // $createPost->save();


    // $createPost = new Permission();
    // $createPost->name         = 'delete-openfile';
    // $createPost->display_name = 'Delete Open File'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'issue-openfile';
    // $createPost->display_name = 'Issue Open File'; // optional
    // $createPost->department = 1;
    // $createPost->save();



    // $createPost = new Permission();
    // $createPost->name         = 'create-pricelist';
    // $createPost->display_name = 'Create Price List'; // optional
    // $createPost->department = 1;
    // $createPost->save();


    // $createPost = new Permission();
    // $createPost->name         = 'delete-pricelist';
    // $createPost->display_name = 'Delete Price List'; // optional
    // $createPost->department = 1;
    // $createPost->save();


    // $createPost = new Permission();
    // $createPost->name         = 'view-pricelist';
    // $createPost->display_name = 'View Price List'; // optional
    // $createPost->department = 1;
    // $createPost->save();
    // $createPost = new Permission();
    // $createPost->name         = 'edit-pricelist';
    // $createPost->display_name = 'Edit Price List'; // optional
    // $createPost->department = 1;
    // $createPost->save();



    // $createPost = new Permission();
    // $createPost->name         = 'create-package';
    // $createPost->display_name = 'Create Open File Package'; // optional
    // $createPost->department = 1;
    // $createPost->save();


    // $createPost = new Permission();
    // $createPost->name         = 'delete-package';
    // $createPost->display_name = 'Delete Open File Package'; // optional
    // $createPost->department = 1;
    // $createPost->save();


    // $createPost = new Permission();
    // $createPost->name         = 'view-package';
    // $createPost->display_name = 'View Open File Package'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'edit-package';
    // $createPost->display_name = 'Edit Open File Package'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'approve-openfile-package';
    // $createPost->display_name = 'Approve Open File Package'; // optional
    // $createPost->department = 1;
    // $createPost->save();


    // $createPost = new Permission();
    // $createPost->name         = 'view-balloting';
    // $createPost->display_name = 'View Balloting'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'edit-balloting';
    // $createPost->display_name = 'Edit Balloting'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'create-balloting';
    // $createPost->display_name = 'Create Balloting'; // optional
    // $createPost->department = 1;
    // $createPost->save();



    // $createPost = new Permission();
    // $createPost->name         = 'delete-balloting';
    // $createPost->display_name = 'Delete Balloting'; // optional
    // $createPost->department = 1;
    // $createPost->save();
    
    // $createPost = new Permission();
    // $createPost->name         = 'view-transfer';
    // $createPost->display_name = 'View Transfer'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'edit-transfer';
    // $createPost->display_name = 'Edit Transfer'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'create-transfer';
    // $createPost->display_name = 'Create Transfer'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'delete-transfer';
    // $createPost->display_name = 'Delete Transfer'; // optional
    // $createPost->department = 1;
    // $createPost->save();


    // $createPost = new Permission();
    // $createPost->name         = 'view-unit-block-criteria';
    // $createPost->display_name = 'View Unit Block Criteria'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'edit-unit-block-criteria';
    // $createPost->display_name = 'Edit Unit Block Criteria'; // optional
    // $createPost->department = 1;
    // $createPost->save();
   
    // $createPost = new Permission();
    // $createPost->name         = 'create-unit-block-criteria';
    // $createPost->display_name = 'Create Unit Block Criteria'; // optional
    // $createPost->department = 1;
    // $createPost->save();

    // $createPost = new Permission();
    // $createPost->name         = 'import-data';
    // $createPost->display_name = 'Import Legacy Data'; // optional
    // $createPost->department = 1;
    // $createPost->save();

   
});

use Illuminate\Support\Facades\DB;

Route::get('/insertnumbers', function () {
    // Set pricelist_id column to 1 for a range of rows
    DB::table('inventories')
        ->whereBetween('id', [96, 134]) // Assuming 'id' is the primary key column
        ->update(['multi_project_id' => 26]);

    return "DONE";
});

// use Illuminate\Support\Facades\DB;

// Route::get('/insert-random-number', function () {
//     for ($i = 1; $i <= 75; $i++) {
//         $existing_number = DB::table('customer_properties')->where('id', $i)->value('nfc_no');
//         if (empty($existing_number)) {
//             $random_number = str_pad(mt_rand(1, 99999999999999), 14, '0', STR_PAD_LEFT);
//             DB::table('customer_properties')->where('id', $i)->update(['nfc_no' => $random_number]);
//         }
//     }
//     return "Number inserted successfully!";
// });





// Route::get('fingerscan', function () {
//     return view('demo');
//     });





Route::get('/us-clear', function () {
    Artisan::call('cache:clear');
    Artisan::call('config:clear');
    // Artisan::call('config:cache');
    Artisan::call('view:clear');
    Artisan::call('route:clear');
    Artisan::call('storage:link');

    return "Cleared!";
});


Route::get('/surchargescronjob', 'Auth\ResetPasswordController@applySurcharge')->name('apply.surcharge');

Route::get('/database-backup-mail', 'Auth\ResetPasswordController@backupMail')->name('backup.mail');

Route::get('/hello', function () {
    return view('openfile/proof-of-registration');
});


Auth::routes();
Route::middleware(['auth', CheckProjectType::class,CheckProjectExistence::class])->group(function () {

    Route::get('/test', 'Auth\LoginController@test')->name('test');

    Route::get('/recover-user-password', 'ForgetPasswordController@validateUser')->name('forget.password');

    Route::get('/auth/requestOTP', 'UserController@requestOTP');

    Route::get('/auth/login', 'UserController@login');

    Route::middleware(['auth', CheckProjectType::class])->group(function () {

        Route::get('/', 'HomeController@index')->name('home');

        Route::get('/home', 'HomeController@index')->name('home');
        Route::get('/getBackup', 'BackupController@index')->name('backup');

        Route::get('/dnfbp', 'HomeController@dnfbp')->name('dnfbp');

        Route::get('/database-backup', 'HomeController@backup')->name('backup');

        Route::get('/getBackup/new', 'BackupController@create')->name('backup.create');

        Route::get('/backup/download/{file_name}', 'BackupController@download')->name('backup.download');

        Route::get('/backup/delete/{file_name}', 'BackupController@delete')->name('backup.delete');

        Route::post('/schedule', 'HomeController@generateSchedule')->name('schedule.generate');

        Route::post('/validate-dnfbp-cnic', 'HomeController@dnfbpValidateCnic')->name('validate.dnfbp.cnic');

        //Profile
        Route::get('/admin/profile', 'HomeController@adminProfile')->name('admin.profile');

        Route::get('/admin/profile/{id}/edit', 'HomeController@editAdminProfile')->name('admin.edit');

        Route::post('/admin/profile/edit', 'HomeController@updateAdminProfile')->name('admin.update');

        Route::get('/getInfoByFloor', 'HomeController@getInfoByFloor');

        Route::get('/activitylog', ['middleware' => ['permission:view-activity-log'], 'uses' => 'HomeController@getActivityLog'])->name('log');

        Route::get('/download-activity-log', ['middleware' => ['permission:view-activity-download-log'], 'uses' => 'HomeController@getDownloadActivityLog'])->name('download.log');

        ////////////////////Inventory CONTROLLER////////////////////////////////////////

        Route::get('/inventory/all', ['middleware' => ['permission:list-inventory'], 'uses' => 'InventoryController@allInventories'])->name('inventory.all');


        Route::get('/update/inventory/all', ['middleware' => ['permission:list-inventory'], 'uses' => 'InventoryController@updateAllInventories'])->name('inventory.all.update');

        Route::get('/inventory/open', ['middleware' => ['permission:list-inventory'], 'uses' => 'InventoryController@allOpenInventories'])->name('inventory.open');

        Route::get('add/before-inventory', ['middleware' => ['permission:create-inventory'], 'uses' => 'InventoryController@beforeAddInventoryFormAdmin'])->name('inventory.add.before');

        Route::get('add/inventory', ['middleware' => ['permission:create-inventory'], 'uses' => 'InventoryController@addInventoryForm'])->name('inventory.add');

        Route::post('add/inventory', ['middleware' => ['permission:create-inventory'], 'uses' => 'InventoryController@insertInventory'])->name('inventory.insert');

        // Route::get('get/inventory-related-info', ['middleware' => ['permission:create-inventory'], 'uses' => 'InventoryController@getUnitTypeAndPriceList'])->name('inventory.get.related-info');



        Route::get('/inventory/view/{id}', ['middleware' => ['permission:view-inventory'], 'uses' => 'InventoryController@detailInventory'])->name('inventory.detail');

        Route::get('/inventory/edit/{id}', ['middleware' => ['permission:edit-inventory'], 'uses' => 'InventoryController@editInventoryForm'])->name('inventory.editView');

        Route::post('/inventory/edit', ['middleware' => ['permission:edit-inventory'], 'uses' => 'InventoryController@updateInventory'])->name('inventory.update');

        Route::get('/inventory/delete/{id}', ['middleware' => ['permission:delete-inventory'], 'uses' => 'InventoryController@deleteInventory'])->name('inventory.delete');

        Route::get('/getRateByFloor', 'InventoryController@getRateByFloor');

        Route::get('/getFloorByPrice', 'InventoryController@getFloorByPricelist');

        Route::get('/getTypeByFloor', 'InventoryController@getTypeByFloor');

        Route::get('/getNillFloor', 'InventoryController@getNillFloor');

        Route::get('/getFloorByBlock', 'InventoryController@getFloorByBlock');

        Route::get('/getFloorByUnitNumber', 'InventoryController@getFloorByUnitNumber');

        Route::get('/inventory/updateTable', ['middleware' => ['permission:list-inventory'], 'uses' => 'InventoryController@updateTable']);

        Route::get('/inventory-status-sheet', ['middleware' => ['permission:list-inventory'], 'uses' => 'InventoryController@inventoryStatusSheet'])->name('inventory.sheet');

        Route::get('/search/inventory-status-sheet', ['middleware' => ['permission:list-inventory'], 'uses' => 'InventoryController@updateInventoryStatusSheet'])->name('inventory.sheet.search');

        Route::get('/inventory-status-sheet/modal', ['middleware' => ['permission:list-inventory'], 'uses' => 'InventoryController@getInventoryInfo'])->name('inventory.sheet.modal');

        Route::get('/sales/dashboard',['middleware' => ['permission:manage-sales-dashboard'], 'uses' => 'InventoryController@getSalesDashboard'])->name('sales.dashboard');

        Route::get('/recovery/due', ['middleware' => ['permission:view-recovery-report'], 'uses' =>'HomeController@getRecoveryDue'])->name('recovery.due');

        
        Route::get('/sales/detail/dashboard',['middleware' => ['permission:manage-sales-dashboard'], 'uses' => 'InventoryController@getSalesDetailDashboard'])->name('sales.detail.dashboard');

        Route::get('pdfview', array('as' => 'pdfview', 'uses' => 'InventoryController@getSalesDetailDashboard'));


        Route::get('/user/activitylog', 'HomeController@getUserActivityLog')->name('user.log');


        ////////////////////Cusotmer CONTROLLER////////////////////////////////////////

        Route::get('/customer/all',  ['middleware' => ['permission:list-customer'], 'uses' => 'CustomerController@allCustomers'])->name('customer.all');

        Route::get('/add/customer',  ['middleware' => ['permission:create-customer'], 'uses' => 'CustomerController@addCustomerForm'])->name('customer.addView');

        Route::post('/add/customer',  ['middleware' => ['permission:create-customer'], 'uses' => 'CustomerController@insertCustomer'])->name('customer.insert');

        Route::get('/customer/view/{id}',  ['middleware' => ['permission:view-customer'], 'uses' => 'CustomerController@detailCustomer'])->name('customer.detail');


        Route::get('/add/nominee',  ['middleware' => ['permission:create-customer'], 'uses' => 'NomineeController@create'])->name('nominee.addView');
        Route::post('/add/nominee',  ['middleware' => ['permission:create-customer'], 'uses' => 'NomineeController@store'])->name('nominee.insert');
        Route::get('/nominee/all',  ['middleware' => ['permission:list-customer'], 'uses' => 'NomineeController@index'])->name('nominee.all');
        Route::get('/nominee/updateTable', ['middleware' => ['permission:list-customer'], 'uses' => 'NomineeController@updateTable'])->name('nominee.updatetable');

        Route::get('/nominee/edit/{id}',  ['middleware' => ['permission:edit-customer'], 'uses' => 'NomineeController@edit'])->name('nominee.editView');

        Route::post('/nominee/edit',  ['middleware' => ['permission:edit-customer'], 'uses' => 'NomineeController@update'])->name('nominee.update');
        
        Route::post('/nominee/delete',  ['middleware' => ['permission:delete-customer'], 'uses' => 'NomineeController@deleteNominee'])->name('nominee.delete');

        Route::get('/nominee/view/{id}',  ['middleware' => ['permission:view-customer'], 'uses' => 'NomineeController@detailNominee'])->name('nominee.detail');


        Route::get('/customer/edit/{id}',  ['middleware' => ['permission:edit-customer'], 'uses' => 'CustomerController@editCustomerForm'])->name('customer.editView');

        Route::post('/customer/edit',  ['middleware' => ['permission:edit-customer'], 'uses' => 'CustomerController@updateCustomer'])->name('customer.update');

        Route::get('/customer/delete/{id}',  ['middleware' => ['permission:delete-customer'], 'uses' => 'CustomerController@deleteCustomer'])->name('customer.delete');

        Route::get('/getCitiesByCountry', 'CustomerController@getCitiesByCountry');

        Route::get('/customer/download/{id}', ['middleware' => ['permission:download-membership'], 'uses' => 'CustomerController@downloadData'])->name('customer.download');

        Route::get('/customer/updateTable', ['middleware' => ['permission:list-customer'], 'uses' => 'CustomerController@updateTable']);

        Route::get('/customer/document/delete/{id}', ['middleware' => ['permission:view-customer'], 'uses' => 'CustomerController@deleteCustomerDocument'])->name('customer.delete.document');

        Route::post('/customer/document/add', ['middleware' => ['permission:edit-customer'], 'uses' => 'CustomerController@addCustomerDocument'])->name('customer.document.upload');

        Route::get('/update_document_name', 'CustomerController@renameDocumentModal');

        Route::post('/customer/document/rename', ['middleware' => ['permission:edit-customer'], 'uses' => 'CustomerController@renameCustomerDocument'])->name('customer.document.rename');

        /////////////////////////////// Customer Transfer History /////////
        Route::get('/customer/transferProperty/{id}',  ['middleware' => ['permission:view-customer'], 'uses' => 'CustomerController@customerTransferStatementHistory'])->name('customer.transfer.property.history');



        ///////////////////////////////FOLLOW UP//////////////////////////

        Route::get('/follow-up/upcoming', 'HomeController@getUpComingFollowUp')->name('followup.upcoming');

        Route::get('/follow-up/expired', 'HomeController@getExpiredFollowUp')->name('followup.expired');

        Route::get('/show_followup_history', 'HomeController@showFollowUpHistory');

        Route::get('/delete_followup', 'HomeController@deleteFollowUp');

        Route::get('/today', 'HomeController@todayFollowUp')->name('followup.today');



        ////////////////////SALES MODULE////////////////////////////////////////

        ///////////////////////REGISTRATIONS//////////////////////////////////



        Route::get('/registrations', ['middleware' => ['permission:list-registration'], 'uses' => 'CustomerRegistrationController@allRegistrations'])->name('registration.all');

        Route::get('/cancel-registrations', ['middleware' => ['permission:list-registration'], 'uses' => 'CustomerRegistrationController@allCancelRegistrations'])->name('registration.cancel');

        Route::get('/registrations/add', ['middleware' => ['permission:create-registration'], 'uses' => 'CustomerRegistrationController@addRegistrationForm'])->name('registration.addView');

        Route::get('/registrations/add/{id}', ['middleware' => ['permission:create-registration'], 'uses' => 'CustomerRegistrationController@addRegistrationFormCustomer'])->name('registration.addViewCustomer');

        Route::post('/registrations/add', ['middleware' => ['permission:create-registration'], 'uses' => 'CustomerRegistrationController@insertRegistration'])->name('registration.insert');

        Route::get('/registrations/edit/{id}', ['middleware' => ['permission:edit-registration'], 'uses' => 'CustomerRegistrationController@editRegistrationForm'])->name('registration.editView');

        Route::post('/registrations/edit', ['middleware' => ['permission:edit-registration'], 'uses' => 'CustomerRegistrationController@updateRegistration'])->name('registration.update');

        Route::get('/registrations/delete/{id}', ['middleware' => ['permission:delete-registration'], 'uses' => 'CustomerRegistrationController@deleteRegistration'])->name('registration.delete');

        Route::get('/registrations/detail/{id}', ['middleware' => ['permission:print-registration'], 'uses' => 'CustomerRegistrationController@detailRegistration'])->name('registration.detail');

        Route::get('/registrations/detail/back/{id}', ['middleware' => ['permission:print-registration'], 'uses' => 'CustomerRegistrationController@printBackRegistration'])->name('registration.detail.back');

        Route::get('/registration/download/{id}', ['middleware' => ['permission:download-registration'], 'uses' => 'CustomerRegistrationController@downloadForm'])->name('registration.download');

        Route::get('/registration/updateTable', ['middleware' => ['permission:list-registration'], 'uses' => 'CustomerRegistrationController@updateTable']);


        ///////////////////////MEMBERSHIPS//////////////////////////////////

        Route::get('/memberships', 'CustomerStatementController@allMemberships')->name('membership.all');

        Route::get('/statement/all', ['middleware' => ['permission:list-membership'], 'uses' => 'CustomerStatementController@getAllStatements'])->name('statement.all');

        Route::post('/statement/date-update', ['middleware' => ['permission:edit-membership'], 'uses' => 'CustomerStatementController@updateStatementDate'])->name('statement.date.update');


        Route::post('/statement/single-delete', ['middleware' => ['permission:delete-membership'], 'uses' => 'CustomerStatementController@deleteSingleStatement'])->name('statement.single.delete');

        Route::post('/statement/single-update', ['middleware' => ['permission:edit-membership'], 'uses' => 'CustomerStatementController@updateNewSaleStatement'])->name('statement.single.update');
        
        Route::post('/statement/single-development-update', ['middleware' => ['permission:edit-membership'], 'uses' => 'CustomerStatementController@updateNewSaleStatementDevelopmentCharges'])->name('statement.single.develpment.update');
        
        

        // create-cancellation
        // edit-cancellation
        // delete-cancellation
        // view-cancellation

        Route::get('/cancel-statements', ['middleware' => ['permission:view-cancellation'], 'uses' => 'CustomerStatementController@getAllCancelStatements'])->name('statement.cancel');


        // Route::get('/cancel-statements/updatetable', ['middleware' => ['permission:view-cancellation'], 'uses' => 'CustomerStatementController@getAllCancelStatements'])->name('statement.cancel-updatetable');


        Route::post('/reopen-cancel-statement', ['middleware' => ['permission:approve-cancellation'], 'uses' => 'CustomerStatementController@reopenCancelStatement'])->name('reopen.cancel');

        Route::get('/cancel-statements/new', ['middleware' => ['permission:create-cancellation'], 'uses' => 'CustomerStatementController@getCancelStatementForm'])->name('statement.cancel.add');

        Route::post('/cancel-statements/new', ['middleware' => ['permission:create-cancellation'], 'uses' => 'CustomerStatementController@cancelNewStatement'])->name('statement.cancel.new');

        Route::post('/cancel-openfile/new', ['middleware' => ['permission:create-cancellation'], 'uses' => 'OpenFileController@cancelNewOpenFile'])->name('openfile.cancel.new');


        Route::get('/cancel-statements/edit/{id}', ['middleware' => ['permission:edit-cancellation'], 'uses' => 'CustomerStatementController@editCancelStatementForm'])->name('statement.cancel.edit');

        Route::post('/cancel-statements/update', ['middleware' => ['permission:edit-cancellation'], 'uses' => 'CustomerStatementController@updateCancelStatementForm'])->name('statement.cancel.update');

        Route::delete('/cancel-statements/delete/{id}', ['middleware' => ['permission:delete-cancellation'], 'uses' => 'CustomerStatementController@deleteCancelStatementForm'])->name('statement.cancel.delete');


        Route::get('/cancel-openfile/edit/{id}', ['middleware' => ['permission:edit-cancellation'], 'uses' => 'OpenFileController@editCancelOpenFileForm'])->name('openfile.cancel.edit');

        Route::post('/cancel-openfile/update', ['middleware' => ['permission:edit-cancellation'], 'uses' => 'OpenFileController@updateCancelOpenfileForm'])->name('openfile.cancel.update');




        //Refund Unit
        //view-refund
        // edit-refund
        Route::get('/refund-units', ['middleware' => ['permission:view-refund'], 'uses' => 'RefundPropertyController@index'])->name('property.refund');
        Route::get('/refund-units/edit/{id}', ['middleware' => ['permission:edit-refund'], 'uses' => 'RefundPropertyController@edit'])->name('property.refund.edit');
        Route::post('/refund-units/update', ['middleware' => ['permission:edit-refund'], 'uses' => 'RefundPropertyController@update'])->name('property.refund.update');
        
        Route::get('/refund-unit/history/{id}', ['middleware' => ['permission:view-refund'], 'uses' => 'RefundPropertyController@detailRefundStatementHistory'])->where(['id' => '[0-9]+'])->name('property.refund.history');

        Route::get('/receipt/refund-unit', ['middleware' => ['permission:create-receipt'], 'uses' => 'RefundPropertyController@createCustomerRefundUnitReceipt'])->name('property.refund.receipt');
       
        Route::get('/receipt/refund-openfile', ['middleware' => ['permission:create-receipt'], 'uses' => 'RefundPropertyController@createDealerRefundOpenFileReceipt'])->name('property.refund-openfile.receipt');
       

        Route::get('/validate/refund-unit',['middleware' => ['permission:create-receipt'], 'uses' => 'RefundPropertyController@getRefundedUnitData'])->name('validate.refund-unit');


        Route::get('/validate/refund-openfile',['middleware' => ['permission:create-receipt'], 'uses' => 'RefundPropertyController@getRefundedOpenFileData'])->name('validate.refund-openfile');

        Route::post('/refund-units/insertReceipt', ['middleware' => ['permission:edit-refund'], 'uses' => 'RefundPropertyController@insertReceipt'])->name('property.refund.insertReceipt');

        Route::post('/refund-openfile/insertReceipt', ['middleware' => ['permission:edit-refund'], 'uses' => 'RefundPropertyController@insertOpenFileRefundReceipt'])->name('property.refund-openfile.insertReceipt');

        Route::get('/refund-receipt/view/{id}', ['middleware' => ['permission:view-receipt'], 'uses' => 'RefundPropertyController@detailReceipt'])->name('receipt.refund.detail');

        Route::get('/refund-openfile-receipt/view/{id}', ['middleware' => ['permission:view-receipt'], 'uses' => 'RefundPropertyController@detailOpenFileReceipt'])->name('receipt.refund-openfile.detail');

        Route::post('/receipt-refund/document', 'RefundPropertyController@uploadReceiptDocument')->name('receipt-refund.document');
        

        // Route::post('/receipt-refund-openfile/document', 'RefundPropertyController@uploadReceiptDocument')->name('receipt-refund-openfile.document');
        

        Route::get('/receipt-refund/document-delete/{id}', 'RefundPropertyController@deleteDocument')->name('receipt-refund.document.delete');


        Route::get('/receipt-refund-openfile/document-delete/{id}', 'RefundPropertyController@deleteOpenfileDocument')->name('receipt-refundopenfile.document.delete');

        Route::get('/receipt-refund/edit/{id}', ['middleware' => ['permission:edit-receipt'], 'uses' => 'RefundPropertyController@editReceiptForm'])->name('receipt-refund.editView');

        Route::get('/receipt-refund-openfile/edit/{id}', ['middleware' => ['permission:edit-receipt'], 'uses' => 'RefundPropertyController@editOpenfileReceiptForm'])->name('receipt-refund-openfile.editView');


        Route::get('/add/receipt-refund/update-properties-edit',['middleware' => ['permission:edit-receipt'], 'uses' => 'RefundPropertyController@editUpdatePropertyForm'])->name('receipt-refund.updatetable');



        Route::get('/add/receipt-refund-openfile/update-table-edit',['middleware' => ['permission:edit-receipt'], 'uses' => 'RefundPropertyController@editUpdateOpenfileForm'])->name('receipt-refund-openfile.updatetable');



         Route::post('/receipt-refund/edit', ['middleware' => ['permission:edit-receipt'], 'uses' => 'RefundPropertyController@updateReceipt'])->name('receipt-refund.update');

         Route::post('/receipt-refund-openfile/edit', ['middleware' => ['permission:edit-receipt'], 'uses' => 'RefundPropertyController@updateOpenFileReceipt'])->name('receipt-refund-openfile.update');

       
       
         Route::get('/receipt-refund/delete/{id}', ['middleware' => ['permission:delete-receipt'], 'uses' => 'RefundPropertyController@deleteReceipt'])->name('receipt-refund.delete');

         Route::get('/receipt-refund-openfile/delete/{id}', ['middleware' => ['permission:delete-receipt'], 'uses' => 'RefundPropertyController@deleteOpenFileReceipt'])->name('receipt-refund-openfile.delete');


         Route::get('/receipt-refund/approved/{id}', ['middleware' => ['permission:approve-receipt'], 'uses' => 'RefundPropertyController@approvedReceipt'])->name('receipt-refund.approved');


         Route::get('/receipt-refund-openfile/approved/{id}', ['middleware' => ['permission:approve-receipt'], 'uses' => 'RefundPropertyController@approvedOpenfileReceipt'])->name('receipt-refund-openfile.approved');



         //Cancel Unit REceipts

         Route::get('/receipt/cancel-unit', ['middleware' => ['permission:create-receipt'], 'uses' => 'CancelUnitController@createCloseUnitCancelReceipt'])->name('property.cancel.receipt');
       
         Route::get('/receipt/cancel-openfile', ['middleware' => ['permission:create-receipt'], 'uses' => 'CancelUnitController@createOpenFileCancelReceipt'])->name('property.cancel-openfile.receipt');
         
         Route::get('/add/receipt/cancel-units', ['middleware' => ['permission:create-receipt'], 'uses' => 'CancelUnitController@updatePropertyForm'])->name('receipt.update-cancel-unit');
         Route::get('/add/receipt/cancel-openfile', ['middleware' => ['permission:create-receipt'], 'uses' => 'CancelUnitController@updateOpenFileForm'])->name('receipt.update-cancel-openfile');
         
         Route::get('/validate/cancel-unit',['middleware' => ['permission:create-receipt'], 'uses' => 'CancelUnitController@getCanceledUnitData'])->name('validate.cancel-unit');
         Route::get('/validate/cancel-openfile',['middleware' => ['permission:create-receipt'], 'uses' => 'CancelUnitController@getCanceledOpenfileData'])->name('validate.cancel-openfile');
         Route::post('/cancel-units/insertReceipt', ['middleware' => ['permission:edit-refund'], 'uses' => 'CancelUnitController@insertReceipt'])->name('property.cancel.insertReceipt');
         Route::post('/cancel-openfile/insertReceipt', ['middleware' => ['permission:edit-refund'], 'uses' => 'CancelUnitController@insertOpenFileRefundReceipt'])->name('property.cancel-openfile.insertReceipt');

         Route::get('/receipt/cancel-pendings', ['middleware' => ['permission:approve-receipt'], 'uses' => 'CancelUnitController@getPendingReceipts'])->name('receipt.cancel.pending');

         Route::get('/receipt-cancel-close/edit/{id}', ['middleware' => ['permission:edit-receipt'], 'uses' => 'CancelUnitController@editReceiptForm'])->name('receipt-cancel-closefile.editView');


         Route::get('/add/receipt-cancel/update-properties-edit',['middleware' => ['permission:edit-receipt'], 'uses' => 'CancelUnitController@editUpdatePropertyForm'])->name('receipt-cancel-closefile.updatetable');

         Route::post('/receipt-cancel-close/edit', ['middleware' => ['permission:edit-receipt'], 'uses' => 'CancelUnitController@updateReceipt'])->name('receipt-cancel-closefile.update');

        //  Route::get('/receipt-cancel-openfile/edit/{id}', ['middleware' => ['permission:edit-receipt'], 'uses' => 'RefundPropertyController@editOpenfileReceiptForm'])->name('receipt-refund-openfile.editView');

        Route::get('/receipt/cancel-openfile/edit/{id}', ['middleware' => ['permission:create-receipt'], 'uses' => 'CancelUnitController@editOpenfileReceiptForm'])->name('property.cancel-openfile-edit.receipt');
        
         Route::get('/add/receipt-cancel-openfile/update-table-edit',['middleware' => ['permission:edit-receipt'], 'uses' => 'CancelUnitController@editUpdateOpenfileForm'])->name('receipt-cancel-openfile.updatetable');

         Route::post('/receipt-cancel-open/edit', ['middleware' => ['permission:edit-receipt'], 'uses' => 'CancelUnitController@updateOpenFileReceipt'])->name('receipt-cancel-openfile.update');

         Route::get('/cancel-receipt-closeunit/view/{id}', ['middleware' => ['permission:view-receipt'], 'uses' => 'CancelUnitController@detailReceipt'])->name('receipt.cancel-closeunit.detail');

         Route::get('/cancel-receipt-openunit/view/{id}', ['middleware' => ['permission:view-receipt'], 'uses' => 'CancelUnitController@detailOpenFileReceipt'])->name('receipt.cancel-openunit.detail');
        
         Route::get('/receipt-cancel-closeunit/approved/{id}', ['middleware' => ['permission:approve-receipt'], 'uses' => 'CancelUnitController@approvedReceipt'])->name('receipt-cancel-closeunit.approved');

         Route::get('/receipt-cancel-openfile/approved/{id}', ['middleware' => ['permission:approve-receipt'], 'uses' => 'CancelUnitController@approvedOpenfileReceipt'])->name('receipt-cancel-openfile.approved');

        Route::post('/receipt-cancel/document', 'CancelPropertyController@uploadReceiptDocument')->name('receipt-cancel.document');

        Route::get('/receipt-cancel/document-delete/{id}', 'CancelPropertyController@deleteDocument')->name('receipt-cancel.document.delete');      

        Route::get('/cancel-receipt/list', ['middleware' => ['permission:approve-receipt'], 'uses' => 'CancelUnitController@receiptList'])->name('receipt.cancel.list');

        Route::get('/receipt-cancel/delete/{id}', ['middleware' => ['permission:delete-receipt'], 'uses' => 'CancelUnitController@deleteReceipt'])->name('receipt-cancel.delete');

         Route::get('/receipt-cancel-openfile/delete/{id}', ['middleware' => ['permission:delete-receipt'], 'uses' => 'CancelUnitController@deleteOpenFileReceipt'])->name('receipt-cancel-openfile.delete');





        //openfile refund
        Route::get('/refund-openfile/edit/{id}', ['middleware' => ['permission:edit-refund'], 'uses' => 'OpenFileController@editOpenFileRefund'])->name('openfile.refund.edit');
        Route::post('/refund-openfile/update', ['middleware' => ['permission:edit-refund'], 'uses' => 'OpenFileController@updateOpenFileRefund'])->name('openfile.refund.update');

        // 'refund-pending', 'adjust-pending', 'pending','refunded','adjusted' 



        //Block Unit
        // edit-block view-block  create-block delete-block 
        Route::get('/block-units/all', ['middleware' => ['permission:view-block'], 'uses' => 'CustomerStatementController@viewBlockProperty'])->name('property.block.view');
        // Route::get('/block-units/create', ['middleware' => ['permission:create-block'], 'uses' => 'CustomerStatementController@createBlockProperty'])->name('property.block.create');
        // Route::post('/block-units/store', ['middleware' => ['permission:create-block'], 'uses' => 'CustomerStatementController@storeBlockProperty'])->name('property.block.store');
        Route::post('/block-units/reopen', ['middleware' => ['permission:create-block'], 'uses' => 'CustomerStatementController@updateBlockProperty'])->name('property.block.update');
        Route::get('/block-units/history', ['middleware' => ['permission:view-block'], 'uses' => 'UnitBlockageController@blockUnitHistory'])->name('property.block.history');
      
        
        //end block unit



        //adjust Unit
        //permissions view-adjust edit-adjust
        Route::get('/adjust-units/all', ['middleware' => ['permission:view-adjust'], 'uses' => 'AdjustUnitController@index'])->name('property.adjust.view');
        Route::get('/adjust-units/edit/{id}', ['middleware' => ['permission:edit-adjust'], 'uses' => 'AdjustUnitController@edit'])->name('property.adjust.edit');
        Route::post('/adjust-units/update', ['middleware' => ['permission:edit-adjust'], 'uses' => 'AdjustUnitController@update'])->name('property.adjust.update');
        Route::get('/adjust-unit/history/{id}', ['middleware' => ['permission:view-adjust'], 'uses' => 'AdjustUnitController@detailAdjustStatementHistory'])->where(['id' => '[0-9]+'])->name('property.adjust.history');
     
        Route::get('/adjust-packagefile/edit/{id}', ['middleware' => ['permission:edit-adjust'], 'uses' => 'AdjustUnitController@editPackageFile'])->name('property.adjust.edit-package-file');
     
        //end Adjust Unit



        

        //open file
        Route::get('/issue/open-file', ['middleware' => ['permission:view-adjust'], 'uses' => 'OpenFileController@index'])->name('openfile.view');
        Route::get('/issue/open-file/create', ['middleware' => ['permission:issue-openfile'], 'uses' => 'OpenFileController@create'])->name('openfile.create');
        Route::post('/issue/open-file/store', ['middleware' => ['permission:issue-openfile'], 'uses' => 'OpenFileController@store'])->name('openfile.store');
        Route::get('/issue/open-file/package', ['middleware' => ['permission:issue-openfile'], 'uses' => 'OpenFileController@getOpenFilePackage'])->name('openfile.package');
        Route::get('/issue/open-file/view/{id}', ['middleware' => ['permission:view-openfile'], 'uses' => 'OpenFileController@detailOpenFilePackage'])->name('openfile.detail');
        Route::delete('issue/open-file/delete/{id}', ['middleware' => ['permission:delete-openfile'], 'uses' => 'OpenFileController@destroy'])->name('openfile.delete');
        Route::get('/issue/open-file/view/form/{id}', ['middleware' => ['permission:view-openfile'], 'uses' => 'OpenFileController@registrationForm'])->name('openfile.form');
        Route::get('/pending/open-file/all-packages', ['middleware' => ['permission:approve-openfile-package'], 'uses' => 'OpenFileController@approveOpenFilePackages'])->name('openfile.pending.package');
        Route::get('/pending/open-file/package/{id}', ['middleware' => ['permission:approve-openfile-package'], 'uses' => 'OpenFileController@viewOpenFilePackages'])->where(['id' => '[0-9]+'])->name('openfile.pending.package.view');

        Route::get('/create/open-file/package-inventory/{id}', ['middleware' => ['permission:approve-openfile-package'], 'uses' => 'OpenFileController@createOpenFilePackagesInventory'])->where(['id' => '[0-9]+'])->name('openfile.create.package.inventory');



        Route::get('/issue/open-file-update-table/', ['middleware' => ['permission:view-adjust'], 'uses' => 'OpenFileController@updateTable'])->name('openfile.updateTable');


        Route::post('/pending/open-file/package/store', ['middleware' => ['permission:approve-openfile-package'], 'uses' => 'OpenFileController@storeOpenFilePackagesDecision'])->name('openfile.pending.package.store');

        Route::post('/pending/open-file/package/approved', ['middleware' => ['permission:approve-openfile-package'], 'uses' => 'OpenFileController@storeOpenFilePackagesDecisionApproved'])->name('openfile.approve.package.store');

        Route::post('/store/open-file/package-inventory/', ['middleware' => ['permission:approve-openfile-package'], 'uses' => 'OpenFileController@storeOpenFilePackageInventory'])->name('openfile.store.package.inventory');



        Route::get('/package/payments/{id}', ['middleware' => ['permission:issue-openfile'], 'uses' => 'OpenFileController@viewPendingAmount'])->where(['id' => '[0-9]+'])->name('openfile.package.payments');
        // Route::post('/package/payment-store',['middleware' => ['permission:issue-openfile'], 'uses'=> 'OpenFileController@storePendingAmount'])->name('openfile.package.payment.store');

        Route::get('/issue/open-file/view/createdetails/{id}', ['middleware =' > ['permission:issue-openfile'], 'uses' => 'OpenFileController@createEndUser'])->name('openfile.create.enduser');

        Route::post('/issue/open-file/view/enduserdetails', ['middleware =' > ['permission:issue-openfile'], 'uses' => 'OpenFileController@endUserStore'])->name('openfile.enduser.store');

        Route::get('/issue/open-file/end-user-form/{id}', ['middleware =' > ['permission:issue-openfile'], 'uses' => 'OpenFileController@endUserForm'])->name('openfile.get.enduser');
        Route::post('/issue/open-file/store-registration-count', ['middleware =' > ['permission:issue-openfile'], 'uses' => 'OpenFileController@storeRegistrationLetterCount'])->name('openfile.enduser-registrationletter.store-count');
        Route::post('/issue/open-file/store-registration-form-count', ['middleware =' > ['permission:issue-openfile'], 'uses' => 'OpenFileController@storeRegistrationFormCount'])->name('openfile.enduser-registrationform.store-count');




        Route::get('/package/payment/{id}', ['middleware' => ['permission:issue-openfile'], 'uses' => 'OpenFileController@addReceiptForm'])->where(['id' => '[0-9]+'])->name('openfile.package.receipt');

        Route::get('/package/detailReceipt/{id}', ['middleware' => ['permission:view-openfile'], 'uses' => 'OpenFileController@detailReceipt'])->where(['id' => '[0-9]+'])->name('openfile.package.detailReceipt');




        //end open file








        Route::get('/pending-statement', ['middleware' => ['permission:approve-membership'], 'uses' => 'CustomerStatementController@getPendingStatements'])->name('statement.pending');

        
        Route::get('/before-add/statement', ['middleware' => ['permission:create-membership'], 'uses' => 'CustomerStatementController@beforeAddStatementFormAdmin'])->name('statement.add.before-admin');

        Route::get('/add/statement', ['middleware' => ['permission:create-membership'], 'uses' => 'CustomerStatementController@addStatementForm'])->name('statement.addView');
      
        Route::get('/get/nominee-against-customer', ['middleware' => ['permission:create-membership'], 'uses' => 'CustomerStatementController@getNomineAgainstCustomer'])->name('statement.get-nomine-against-customer');
      
        Route::get('/pending-development-charges', ['middleware' => ['permission:approve-membership'], 'uses' => 'CustomerStatementController@pendingDevelopmentCharges'])->name('development-charges.pending');

        Route::get('/add/development-charges', ['middleware' => ['permission:create-membership'], 'uses' => 'CustomerStatementController@addDevelopmentCharges'])->name('statement.addDevelopmentCharges');

        Route::get('/edit/statement/{id}', ['middleware' => ['permission:create-membership'], 'uses' => 'CustomerStatementController@updateStatementForm'])->name('statement.editViewCustomer');

        Route::get('/statement/letter/{id}', ['middleware' => ['permission:create-package'], 'uses' => 'CustomerStatementController@registrationLetter'])->name('statement.letter');

        Route::get('/add/statement/{id}', ['middleware' => ['permission:create-membership'], 'uses' => 'CustomerStatementController@addStatementFormCustomer'])->name('statement.addViewCustomer');

        Route::post('/add/statement', ['middleware' => ['permission:create-membership'], 'uses' => 'CustomerStatementController@insertStatement'])->name('statement.insert');

        Route::post('/store/development-charges', ['middleware' => ['permission:create-membership'], 'uses' => 'CustomerStatementController@storeDevelopmentCharges'])->name('statement.insert-developmentcharges');

        Route::get('/pending-development-charges/edit/{id}', 'CustomerStatementController@approvedDevelopmentCharges')->where(['id' => '[0-9]+'])->name('development-charges.editPendingView');

        Route::post('/pending-development-charges/edit', ['middleware' => ['permission:approve-membership'], 'uses' => 'CustomerStatementController@updateApprovedDevelopmentCharges'])->name('development-charges.updatePending');

        Route::get('/list/development-charges', ['middleware' => ['permission:view-membership'], 'uses' =>'CustomerStatementController@listDevelopementCharges'])->name('development-charges.list');

        Route::get('/list/edit-development-charges/{id}',['middleware' => ['permission:edit-membership'], 'uses' => 'CustomerStatementController@editDevelopmentCharges'])->where(['id' => '[0-9]+'])->name('development-charges.edit-charges');
        
        Route::post('/list/update-development-charges', ['middleware' => ['permission:edit-membership'], 'uses' => 'CustomerStatementController@updateDevelopmentCharges'])->name('development-charges.update-charges');

        Route::post('/statements/edit', ['middleware' => ['permission:create-schedule'], 'uses' => 'CustomerStatementController@updateStatements'])->name('statement.schedule.update');

        Route::get('/statement/edit/{id}', ['middleware' => ['permission:create-schedule'], 'uses' => 'CustomerStatementController@editStatementForm'])->name('statement.editView');

        Route::post('/statement/update', ['middleware' => ['permission:create-schedule'], 'uses' => 'CustomerStatementController@updateStatement'])->name('statement.update');

        Route::post('/statement/edit/', ['middleware' => ['permission:edit-membership'], 'uses' => 'CustomerStatementController@updateInstallmentStatement'])->name('statement.update.installment');

        Route::get('/pending-statement/edit/{id}', 'CustomerStatementController@editPendingStatementForm')->name('statement.editPendingView');

        Route::post('/pending-statement/edit', ['middleware' => ['permission:approve-membership'], 'uses' => 'CustomerStatementController@updatePendingStatement'])->name('statement.updatePending');

        Route::get('/statement/view/{id}', ['middleware' => ['permission:view-membership'], 'uses' => 'CustomerStatementController@detailStatement'])->name('statement.detail');

        Route::get('/statement/delete/{id}', ['middleware' => ['permission:delete-membership'], 'uses' => 'CustomerStatementController@deleteStatement'])->name('statement.delete');

        Route::get('/statement/updateSchedule', ['middleware' => ['permission:edit-membership'], 'uses' => 'CustomerStatementController@updateSchedule'])->name('statement.updateSchedule');

        Route::get('/getUnitsByCustomer', 'CustomerStatementController@getUnitsByCustomer');

        Route::get('/getInformationByUnit', 'CustomerStatementController@getInformationByUnit');

        Route::get('/getInformationByInventory', 'CustomerStatementController@getInformationByInventoryNumber');

        Route::get('/getInformationByUnitEdit', 'CustomerStatementController@getInformationByUnitEdit');

        Route::get('/getUnitDetail', 'CustomerStatementController@getUnitDetail')->name('getUnitDetail');

        Route::get('/statement/booking-form/{id}', ['middleware' => ['permission:print-membership'], 'uses' => 'CustomerStatementController@getBookingForm'])->name('statement.booking');

        Route::get('/statement/allotment/{id}', ['middleware' => ['permission:print-membership'], 'uses' => 'CustomerStatementController@getAllotmentForm'])->name('statement.allotment');

        Route::get('/statement/sale-agreement/{id}', ['middleware' => ['permission:print-membership'], 'uses' => 'CustomerStatementController@getSaleAgreementForm'])->name('statement.sale-agreement');
        
        Route::get('/statement/provisional/{id}', ['middleware' => ['permission:print-membership'], 'uses' => 'CustomerStatementController@getProvisionalLetter'])->name('statement.provisional');

        Route::get('/statement/term-conditions/{id}', ['middleware' => ['permission:print-membership'], 'uses' => 'CustomerStatementController@getTermConditionForm'])->name('statement.term-condition');

        Route::get('/membership/edit/{id}', ['middleware' => ['permission:edit-membership'], 'uses' => 'CustomerStatementController@editMembershipForm'])->name('membership.edit');

        Route::get('/membership/download/{id}', ['middleware' => ['permission:download-membership'], 'uses' => 'CustomerStatementController@downloadForm'])->name('membership.download');

        Route::get('/statement/download/{id}', ['middleware' => ['permission:download-membership'], 'uses' => 'CustomerStatementController@downloadStatement'])->name('statement.download');

        Route::get('/update_sms_modal', 'CustomerStatementController@smsForm');

        Route::get('/update_sms_modal/customer', 'CustomerRequestController@smsForm');

        Route::post('/update_sms_modal', ['middleware' => ['permission:sms-membership'], 'uses' => 'CustomerStatementController@sendSMSForm'])->name('sms.send');

        Route::get('/update_reminder_modal', ['middleware' => ['permission:reminder-membership'], 'uses' => 'CustomerStatementController@reminderForm']);

        Route::post('/update_reminder_modal', ['middleware' => ['permission:reminder-membership'], 'uses' => 'CustomerStatementController@updateReminder'])->name('reminder.update');

        Route::get('/properties/due', ['middleware' => ['permission:due-payments'], 'uses' => 'CustomerStatementController@getDueAmtProperties'])->name('properties.due');

        Route::get('/statement/updateTable', ['middleware' => ['permission:list-membership'], 'uses' => 'CustomerStatementController@updateTable']);

        Route::get('/pending-statement/updateTable', ['middleware' => ['permission:approve-membership'], 'uses' => 'CustomerStatementController@updatePendingTable']);

        Route::get('/customer-requests', 'CustomerRequestController@index')->name('customer-request');

        ////////////////////Statement CONTROLLER////////////////////////////////////////

        // view-transfer
        // edit-transfer
        // create-transfer
        // delete-transfer

        Route::get('/transfer/all',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@getAllTransfers'])->name('transfer.all');

        Route::get('/transfer/add',  ['middleware' => ['permission:create-transfer'], 'uses' =>'TransferPropertyController@addTransferForm'])->name('transfer.addView');

        Route::post('/transfer/add',  ['middleware' => ['permission:create-transfer'], 'uses' =>'TransferPropertyController@insertTransfer'])->name('transfer.insert');

        Route::get('/transfer/edit/{id}',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@editTransferForm'])->name('transfer.editView');

        Route::post('/transfer/edit',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@updateTransfer'])->name('transfer.update');

        Route::get('/transfer/view/{id}',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@detailTransfer'])->name('transfer.detail');

        Route::get('/transfer/updateInfo',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@updateInfo'])->name('transfer.updateInfo');

        Route::get('/transfer/document/{id}',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@transferDocument'])->name('transfer.document');

       
        Route::get('/receipt/transfer',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@allReceiptList'])->name('transfer.receipt');

        Route::get('receipt-add/transfer',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@addReceipt'])->name('transfer.receipt.add');

        Route::post('receipt-add/transfer',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@storeReceipt'])->name('transfer.storeReceipt');

        Route::post('receipt-approve/transfer',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@approveReceipt'])->name('transfer.receipt.approve');

        Route::get('/receipt/transfer-information',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@getTransferInformtion'])->name('transfer.get.info');

        Route::get('/transfer/approve/{id}',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@approveTransfer'])->name('transfer.approve');

        Route::post('/transfer/approve',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@storeApproveTransfer'])->name('transfer.approve.store');

 
        Route::post('/transfer/store-document',  ['middleware' => ['permission:edit-transfer'], 'uses' =>'TransferPropertyController@storeTransferDocumentFile'])->name('transfer.approve.tore.document');
        


        Route::get('/transfer/gift-affidivat/{id}',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@getGiftDeclaration'])->name('transfer.gift');

        Route::get('/transfer/normal-transfer-form/{id}',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@getNormalTransfer'])->name('transfer.normal');

        Route::get('/transfer/deed-death-transfer-form/{id}',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@getDeathTransfer'])->name('transfer.deed.of.relinquishment');
 
        Route::get('/transfer/undertaking-death-transfer-form/{id}',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@getUndertakingDeathTransfer'])->name('transfer.undertaking.death');

        Route::get('/transfer/affidavit-family-transfer-form/{id}',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@getFamilyTransfer'])->name('transfer.affidavit.family');

        Route::get('/transfer/undertaking-family-transfer-form/{id}',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@getUndertakingFamilyTransfer'])->name('transfer.undertaking.family');

        Route::get('/transfer/agreement-normal-transfer-form/{id}',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@getAgreementNormalTransfer'])->name('transfer.sale.agreement-normal');

        Route::get('/transfer/undertaking-normal-transfer-form/{id}',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@getUndertakingNormalTransfer'])->name('transfer.undertaking.normal');

        Route::get('/transfer/affidavit-normal-transfer-form/{id}',  ['middleware' => ['permission:view-transfer'], 'uses' =>'TransferPropertyController@getAffidavitNormalTransfer'])->name('transfer.affidavit.normal');

        //Receipt

        Route::get('/receipt/registration/all', ['middleware' => ['permission:list-receipt'], 'uses' => 'CustomerStatementController@getRegistrationReceipts'])->name('receipt.registration.all');

        Route::get('/receipt/downpayment/all', ['middleware' => ['permission:list-receipt'], 'uses' => 'CustomerStatementController@getDownpaymentReceipts'])->name('receipt.downpayment.all');

        Route::get('/receipt/surcharge', ['middleware' => ['permission:list-receipt'], 'uses' => 'CustomerStatementController@getSurchargeReceipts'])->name('receipt.surcharge');

        Route::get('/receipt/customer/tax/all', 'CustomerStatementController@getCustomerTaxReceipts')->name('receipt.customer.tax.all');

        Route::get('/customer/tax', 'CustomerStatementController@getCustomerTax')->name('customer.tax');

        Route::get('/receipt/company/tax/all', 'CustomerStatementController@getCompanyTaxReceipts')->name('receipt.company.tax.all');

        Route::get('/receipt/installment/all', ['middleware' => ['permission:list-receipt'], 'uses' => 'CustomerStatementController@getInstallmentReceipts'])->name('receipt.installment.all');

        Route::get('/add/receipt', ['middleware' => ['permission:create-receipt'], 'uses' => 'CustomerStatementController@addReceiptForm'])->name('receipt.addView');

        Route::get('/add/dealer-receipt', ['middleware' => ['permission:create-receipt'], 'uses' => 'CustomerStatementController@addDealerPackageReceiptForm'])->name('receipt.addView.dealerproperty');




        Route::get('/add/receipt/update-properties', 'CustomerStatementController@updatePropertyForm');

        Route::get('/add/receipt/refund-units', ['middleware' => ['permission:create-receipt'], 'uses' => 'RefundPropertyController@updatePropertyForm'])->name('receipt.update-refund-unit');

        Route::get('/add/receipt/refund-openfile', ['middleware' => ['permission:create-receipt'], 'uses' => 'RefundPropertyController@updateOpenFileForm'])->name('receipt.update-refund-openfile');



        Route::get('/add/receipt/update-properties-edit', 'CustomerStatementController@editUpdatePropertyForm');


        Route::get('/add/receipt/update-package', 'CustomerStatementController@updatePackageForm');



        Route::get('/update-merging-properties', 'CustomerStatementController@updateMergingProperty');


        Route::post('/add/receipt', ['middleware' => ['permission:create-receipt'], 'uses' => 'CustomerStatementController@insertReceipt'])->name('receipt.insert');

        Route::get('/receipt/view/{id}', ['middleware' => ['permission:view-receipt'], 'uses' => 'CustomerStatementController@detailReceipt'])->name('receipt.detail');




        Route::get('/surcharge-receipt/view/{id}', ['middleware' => ['permission:view-receipt'], 'uses' => 'CustomerStatementController@detailSurchargeReceipt'])->name('surcharge.receipt.detail');

        Route::get('/receipt/customer/view/{id}', 'CustomerStatementController@detailCustomerReceipt')->name('receipt.tax.detail');

        Route::get('/receipt/company/view/{id}', 'CustomerStatementController@detailCompanyReceipt')->name('receipt.company.tax.detail');

        Route::get('/receipt/edit/{id}', ['middleware' => ['permission:edit-receipt'], 'uses' => 'CustomerStatementController@editReceiptForm'])->name('receipt.editView');

        Route::post('/receipt/edit', ['middleware' => ['permission:edit-receipt'], 'uses' => 'CustomerStatementController@updateReceipt'])->name('receipt.update');

        Route::get('/receipt/delete/{id}', ['middleware' => ['permission:delete-receipt'], 'uses' => 'CustomerStatementController@deleteReceipt'])->name('receipt.delete');

        Route::get('/surcharge-receipt/delete/{id}', ['middleware' => ['permission:delete-receipt'], 'uses' => 'CustomerStatementController@deleteSurchargeReceipt'])->name('surcharge.receipt.delete');


        Route::get('/receipt/print/{id}', ['middleware' => ['permission:print-receipt'], 'uses' => 'CustomerStatementController@printReceipt'])->name('receipt.print');

        Route::get('/receipt/download/{id}', ['middleware' => ['permission:download-receipt'], 'uses' => 'CustomerStatementController@downloadReceipt'])->name('receipt.download');

        Route::get('/receipt/updateTable', ['middleware' => ['permission:list-receipt'], 'uses' => 'CustomerStatementController@updateReceiptTable']);

        Route::get('/surcharge-receipt/updateTable', ['middleware' => ['permission:list-receipt'], 'uses' => 'CustomerStatementController@updateSurchargeReceiptTable']);

        Route::get('/receipt/pendings', ['middleware' => ['permission:approve-receipt'], 'uses' => 'CustomerStatementController@getPendingReceipts'])->name('receipt.pending');

        Route::get('/receipt/package-pendings', ['middleware' => ['permission:approve-receipt'], 'uses' => 'OpenFileController@getPendingReceipts'])->name('receipt.package.pending');

        Route::get('/receipt/refund-pendings', ['middleware' => ['permission:approve-receipt'], 'uses' => 'RefundPropertyController@getPendingReceipts'])->name('receipt.refund.pending');



        Route::get('/refund-receipt/list', ['middleware' => ['permission:approve-receipt'], 'uses' => 'RefundPropertyController@receiptList'])->name('receipt.refund.list');



        Route::get('/receipt/approved/{id}', ['middleware' => ['permission:approve-receipt'], 'uses' => 'CustomerStatementController@approvedReceipt'])->name('receipt.approved');

        Route::get('/receipt/package-approved/all', ['middleware' => ['permission:approve-receipt'], 'uses' => 'OpenFileController@approveAllReceipt'])->name('receipt.package-approved.all');

        Route::get('/receipt/dealer/package-approved', ['middleware' => ['permission:list-receipt'], 'uses' => 'OpenFileController@viewApprovedReceipt'])->name('receipt.package-approved.get');

        Route::delete('/receipt/dealer/delete/{id}', ['middleware' => ['permission:list-receipt'], 'uses' => 'OpenFileController@destroyDealerReceipt'])->name('dealer-receipt.delete');




        Route::get('/receipt/package-approval/{id}', ['middleware' => ['permission:approve-receipt'], 'uses' => 'OpenFileController@viewPendingReceipt'])->where(['id' => '[0-9]+'])->name('receipt.package-payment.view');

        Route::post('/receipt/package-approved', 'OpenFileController@approvedReceipt')->name('receipt.package.payment.approved');



        Route::get('/receipt/cancelled/{id}', ['middleware' => ['role:admin'], 'uses' => 'CustomerStatementController@cancelledReceipt'])->name('receipt.cancelled');


        Route::get('/receipt/cheaque/cancel', 'CustomerStatementController@getCancelReceipts')->name('receipt.cancel.cheaque');

        Route::post('/receipt/document', 'CustomerStatementController@uploadReceiptDocument')->name('receipt.document');

       
        

        Route::get('/receipt/document-delete/{id}', 'CustomerStatementController@deleteDocument')->name('receipt.document.delete');


      




        ////////////////////Dealer CONTROLLER////////////////////////////////////////

        ///////////////////////REGISTRATIONS//////////////////////////////////

        Route::get('/registration-dealer', 'DealerRegistrationController@allRegistrations')->name('dealer.registration.all');

        Route::get('/registration-dealer/add', 'DealerRegistrationController@addRegistrationForm')->name('dealer.registration.addView');

        Route::get('/registration-dealer/add/{id}', 'DealerRegistrationController@addRegistrationFormCustomer')->name('dealer.registration.addViewCustomer');

        Route::post('/registration-dealer/add', 'DealerRegistrationController@insertRegistration')->name('dealer.registration.insert');

        Route::get('/registration-dealer/edit/{id}', 'DealerRegistrationController@editRegistrationForm')->name('dealer.registration.editView');

        Route::post('/registration-dealer/edit', 'DealerRegistrationController@updateRegistration')->name('dealer.registration.update');

        Route::get('/registration-dealer/delete/{id}', 'DealerRegistrationController@deleteRegistration')->name('dealer.registration.delete');

        Route::get('/registration-dealer/detail/{id}', 'DealerRegistrationController@detailRegistration')->name('dealer.registration.detail');

        //////////////////////////////////////////////////////////////////



        Route::get('/dealer/all', ['middleware' => ['permission:list-dealer'], 'uses' => 'DealerController@allDealers'])->name('dealer.all');

        Route::get('/add/dealer', ['middleware' => ['permission:create-dealer'], 'uses' => 'DealerController@addDealerForm'])->name('dealer.addView');

        Route::post('/add/dealer', ['middleware' => ['permission:create-dealer'], 'uses' => 'DealerController@insertDealer'])->name('dealer.insert');

        Route::get('/dealer/view/{id}', ['middleware' => ['permission:view-dealer'], 'uses' => 'DealerController@detailDealer'])->name('dealer.detail');

        Route::get('/dealer/edit/{id}', ['middleware' => ['permission:edit-dealer'], 'uses' => 'DealerController@editDealerForm'])->name('dealer.editView');

        Route::post('/dealer/edit', ['middleware' => ['permission:edit-dealer'], 'uses' => 'DealerController@updateDealer'])->name('dealer.update');

        Route::get('/dealer/delete/{id}', ['middleware' => ['permission:delete-dealer'], 'uses' => 'DealerController@deleteDealer'])->name('dealer.delete');

        Route::get('/getDealerById', 'DealerController@getDealerInfo');

        Route::get('/dealer/payment/add', ['middleware' => ['permission:dealer-payment'], 'uses' => 'DealerController@addDealerPayment'])->name('dealer.payment.add');

        Route::get('/dealer/payment/delete/{id}', ['middleware' => ['permission:dealer-payment'], 'uses' => 'DealerController@deleteDealerPayment'])->name('dealer.payment.delete');

        Route::post('/dealer/payment/add', ['middleware' => ['permission:dealer-payment'], 'uses' => 'DealerController@createDealerPayment'])->name('dealer.payment.create');

        Route::get('/dealer/payment/update-properties', 'DealerController@getDealerProperties');

        Route::get('/update_dealer_transfer_modal', 'DealerController@dealerTransferForm');

        Route::post('/update_dealer_transfer', 'DealerController@transferDealer')->name('dealer.transfer');



        Route::get('/dealer/package/{id}', ['middleware' => ['permission:view-dealer'], 'uses' => 'DealerController@getDealerPackageDetail'])->name('dealer.package.detail');




        ////////////////////PAYROLL MANAGEMENT//////////////////////////////////////

        ////////////////////Employee CONTROLLER////////////////////////////////////////

        Route::get('/employees/all', ['middleware' => ['permission:list-employee'], 'uses' => 'EmployeeController@allEmployees'])->name('employee.all');

        Route::get('/employees/add', ['middleware' => ['permission:create-employee'], 'uses' => 'EmployeeController@addEmployeeForm'])->name('employee.addView');

        Route::post('/employees/add', ['middleware' => ['permission:create-employee'], 'uses' => 'EmployeeController@insertEmployee'])->name('employee.insert');

        Route::get('/employees/view/{id}', ['middleware' => ['permission:view-employee'], 'uses' => 'EmployeeController@detailEmployee'])->name('employee.detail');

        Route::get('/employees/edit/{id}', ['middleware' => ['permission:edit-employee'], 'uses' => 'EmployeeController@editEmployeeForm'])->name('employee.editView');

        Route::post('/employees/edit', ['middleware' => ['permission:edit-employee'], 'uses' => 'EmployeeController@updateEmployee'])->name('employee.update');

        Route::get('/employees/delete/{id}', ['middleware' => ['permission:delete-employee'], 'uses' => 'EmployeeController@deleteEmployee'])->name('employee.delete');

        ////////////////////POLICY CONTROLLER////////////////////////////////////////

        Route::get('/policy/all', ['middleware' => ['permission:manage-policy'], 'uses' => 'PolicyController@allPolicies'])->name('policy.all');

        Route::get('/policy/add', ['middleware' => ['permission:manage-policy'], 'uses' => 'PolicyController@addPolicyForm'])->name('policy.addView');

        Route::post('/policy/add', ['middleware' => ['permission:manage-policy'], 'uses' => 'PolicyController@insertPolicy'])->name('policy.insert');

        Route::get('/policy/edit/{id}', ['middleware' => ['permission:manage-policy'], 'uses' => 'PolicyController@editPolicyForm'])->name('policy.editView');

        Route::post('/policy/edit', ['middleware' => ['permission:manage-policy'], 'uses' => 'PolicyController@updatePolicy'])->name('policy.update');

        Route::get('/policy/delete/{id}', ['middleware' => ['permission:manage-policy'], 'uses' => 'PolicyController@deletePolicy'])->name('policy.delete');

        //////////

        Route::get('/employee/payrolls', ['middleware' => ['permission:manage-payroll'], 'uses' => 'EmployeeController@getPayrollSheet'])->name('employee.payroll.sheet');

        Route::get('/employee/payroll-history', ['middleware' => ['permission:manage-payroll'], 'uses' => 'EmployeeController@getPayrollHistory'])->name('employee.payroll.history');

        Route::get('/employee/payroll/run/{id}', ['middleware' => ['permission:manage-payroll'], 'uses' => 'EmployeeController@runPayrollByEmployee'])->name('employee.payroll.run');

        Route::get('account/hrm/employee/payroll', 'HrmSetsalaryController@getEmployeePayroll')->name('employee.payroll');


        Route::get('hrm/sample/download', 'HrmAttendanceController@hrmSampleDownload')->name('hrmsample.download');


        /////////////////////TRANSACTIONS///////////////////////////////////////////

        ////////////////////Customer Adjustments//////////////////////////////////

        Route::get('/adjustments/all', ['middleware' => ['permission:list-customer-adjustment'], 'uses' => 'CustomerAdjustmentController@alladjustments'])->name('adjustment.all');

        Route::get('/adjustment/view/{id}', ['middleware' => ['permission:view-customer-adjustment'], 'uses' => 'CustomerAdjustmentController@getAdjustmentDetial'])->name('adjustment.detail');

        Route::get('/adjustment/edit/{id}', ['middleware' => ['permission:edit-customer-adjustment'], 'uses' => 'CustomerAdjustmentController@editAdjustmentForm'])->name('adjustment.editView');

        Route::post('/adjustment/edit', ['middleware' => ['permission:edit-customer-adjustment'], 'uses' => 'CustomerAdjustmentController@updateAdjustment'])->name('adjustment.update');

        /////////////////////EXPENSES///////////////////////////////////////////////

        Route::get('/expense/all', ['middleware' => ['permission:list-expense'], 'uses' => 'ExpenseController@allExpenses'])->name('expense.all');

        Route::get('/expense/add', ['middleware' => ['permission:create-expense'], 'uses' => 'ExpenseController@addExpenseForm'])->name('expense.addView');

        Route::post('/expense/add', ['middleware' => ['permission:create-expense'], 'uses' => 'ExpenseController@insertExpense'])->name('expense.insert');

        Route::get('/expense/view/{id}', ['middleware' => ['permission:view-expense'], 'uses' => 'ExpenseController@detailExpense'])->name('expense.detail');

        Route::get('/expense/edit/{id}', ['middleware' => ['permission:edit-expense'], 'uses' => 'ExpenseController@editExpenseForm'])->name('expense.editView');

        Route::post('/expense/edit', ['middleware' => ['permission:edit-expense'], 'uses' => 'ExpenseController@updateExpense'])->name('expense.update');

        Route::get('/expense/delete/{id}', ['middleware' => ['permission:delete-expense'], 'uses' => 'ExpenseController@deleteExpense'])->name('expense.delete');

        Route::get('/expense/updateTable', ['middleware' => ['permission:list-expense'], 'uses' => 'ExpenseController@updateTable']);

        /////////////////////////////PAYMENT////////////////////////////////////////////

        Route::get('/payment/all', ['middleware' => ['permission:list-expense'], 'uses' => 'ExpenseController@allPayments'])->name('payment.all');

        Route::get('/payment/add', ['middleware' => ['permission:create-expense'], 'uses' => 'ExpenseController@addPaymentForm'])->name('payment.addView');

        Route::get('/payment/add/getVendorBills', ['middleware' => ['permission:create-expense'], 'uses' => 'ExpenseController@getVendorOpenBill']);

        Route::post('/payment/add', ['middleware' => ['permission:create-expense'], 'uses' => 'ExpenseController@insertPayment'])->name('payment.insert');

        Route::get('/payment/view/{id}', ['middleware' => ['permission:view-expense'], 'uses' => 'ExpenseController@detailPayment'])->name('payment.detail');

        Route::get('/payment/edit/{id}', ['middleware' => ['permission:edit-expense'], 'uses' => 'ExpenseController@editPaymentForm'])->name('payment.editView');

        Route::post('/payment/edit', ['middleware' => ['permission:edit-expense'], 'uses' => 'ExpenseController@updatePayment'])->name('payment.update');

        Route::get('/payment/delete/{id}', ['middleware' => ['permission:delete-expense'], 'uses' => 'ExpenseController@deletePayment'])->name('payment.delete');

        Route::get('/payment/updateTable', ['middleware' => ['permission:list-expense'], 'uses' => 'ExpenseController@updatePaymentTable']);

        Route::get('/payment/print/{id}', ['middleware' => ['permission:list-expense'], 'uses' => 'ExpenseController@printVoucher'])->name('payment.print');


        /////////////////////Paid Inventory Rebates///////////////////////////////////////////////

        Route::get('/dealer-rebate/all', ['middleware' => ['permission:list-dealer-rebate'], 'uses' => 'DealerPaidRebateController@allRebates'])->name('rebate.all');

        Route::get('/dealer-rebate/add', ['middleware' => ['permission:create-dealer-rebate'], 'uses' => 'DealerPaidRebateController@addRebateForm'])->name('rebate.addView');

        Route::get('/dealer-rebate/update-amount', 'DealerPaidRebateController@updateDealerAmount')->name('rebate.updateAmount');

        Route::post('/dealer-rebate/add', ['middleware' => ['permission:create-dealer-rebate'], 'uses' => 'DealerPaidRebateController@insertRebate'])->name('rebate.insert');

        Route::get('/dealer-rebate/view/{id}', ['middleware' => ['permission:view-dealer-rebate'], 'uses' => 'DealerPaidRebateController@detailRebate'])->name('rebate.detail');

        Route::get('/dealer-rebate/edit/{id}', ['middleware' => ['permission:edit-dealer-rebate'], 'uses' => 'DealerPaidRebateController@editRebateForm'])->name('rebate.editView');

        Route::post('/dealer-rebate/edit', ['middleware' => ['permission:edit-dealer-rebate'], 'uses' => 'DealerPaidRebateController@updateRebate'])->name('rebate.update');

        Route::get('/dealer-rebate/delete/{id}', ['middleware' => ['permission:delete-dealer-rebate'], 'uses' => 'DealerPaidRebateController@deleteRebate'])->name('rebate.delete');


        /////////////////////Paid Package Rebates///////////////////////////////////////////////

        Route::get('/dealer-package-rebate/all', ['middleware' => ['permission:list-dealer-rebate'], 'uses' => 'DealerPaidRebateController@allPackageRebates'])->name('rebate.package.all');

        Route::get('/dealer-package-rebate/add', ['middleware' => ['permission:create-dealer-rebate'], 'uses' => 'DealerPaidRebateController@addPackageRebateForm'])->name('rebate.package.addView');

        Route::get('/dealer-package-rebate/update-amount', 'DealerPaidRebateController@updateDealerPackageAmount')->name('rebate.package.updateAmount');

        Route::post('/dealer-package-rebate/add', ['middleware' => ['permission:create-dealer-rebate'], 'uses' => 'DealerPaidRebateController@insertPackageRebate'])->name('rebate.package.insert');

        Route::get('/dealer-package-rebate/get', ['middleware' => ['permission:list-dealer-rebate'], 'uses' => 'DealerController@getDealerPackageRebate'])->name('rebate.package.getDealerPackageRebate');





        Route::get('/dealer-package-rebate/view/{id}', ['middleware' => ['permission:view-dealer-rebate'], 'uses' => 'DealerPaidRebateController@detailPackageRebate'])->name('rebate.package.detail');

        // Route::get('/dealer-rebate/edit/{id}',['middleware' => ['permission:edit-dealer-rebate'], 'uses'=> 'DealerPaidRebateController@editRebateForm'])->name('rebate.editView');

        // Route::post('/dealer-rebate/edit',['middleware' => ['permission:edit-dealer-rebate'], 'uses'=> 'DealerPaidRebateController@updateRebate'])->name('rebate.update');

        // Route::get('/dealer-rebate/delete/{id}',['middleware' => ['permission:delete-dealer-rebate'], 'uses'=> 'DealerPaidRebateController@deleteRebate'])->name('rebate.delete');











        /////////////////////COMPANY BANKS///////////////////////////////////////////////

        Route::get('/bank-account/all', ['middleware' => ['permission:list-bank-account'], 'uses' => 'CompanyBankController@allBanks'])->name('bank.all');

        Route::get('/bank-account/add', ['middleware' => ['permission:create-bank-account'], 'uses' => 'CompanyBankController@addBankForm'])->name('bank.addView');

        Route::post('/bank-account/add', ['middleware' => ['permission:create-bank-account'], 'uses' => 'CompanyBankController@insertBank'])->name('bank.insert');

        Route::get('/bank-account/view/{id}', ['middleware' => ['permission:view-bank-account'], 'uses' => 'CompanyBankController@detailBank'])->name('bank.detail');

        Route::get('/bank-account/edit/{id}', ['middleware' => ['permission:edit-bank-account'], 'uses' => 'CompanyBankController@editBankForm'])->name('bank.editView');

        Route::post('/bank-account/edit', ['middleware' => ['permission:edit-bank-account'], 'uses' => 'CompanyBankController@updateBank'])->name('bank.update');

        Route::get('/bank-account/delete/{id}', ['middleware' => ['permission:delete-bank-account'], 'uses' => 'CompanyBankController@deleteBank'])->name('bank.delete');



        /////////////////////REPORT CONTROLLER//////////////////////////////////////


        Route::get('report/month-wise-recovery', ['middleware' => ['permission:view-recovery-report'], 'uses' => 'ReportController@getMonthWiseRecoveryForm'])->name('report.month-wise-recovery');

        Route::post('report/month-wise-recovery', ['middleware' => ['permission:view-recovery-report'], 'uses' => 'ReportController@getMonthWiseRecoveryStatement'])->name('report.month-wise-recovery.generate');


        Route::get('report/account-statement', ['middleware' => ['permission:view-recovery-report'], 'uses' => 'ReportController@getAccountStatementForm'])->name('report.account-statement');

        Route::post('report/account-statement', ['middleware' => ['permission:view-recovery-report'], 'uses' => 'ReportController@getAccountStatement'])->name('report.account-statement.generate');

        Route::get('report/by-vendorexpense', ['middleware' => ['permission:view-recovery-report'], 'uses' => 'ReportController@getVendorExpenseForm'])->name('report.vendor-expense');

        Route::post('report/expense-vendor', ['middleware' => ['permission:view-recovery-report'], 'uses' => 'ReportController@getVendorExpense'])->name('report.vendor-expense.generate');


        Route::get('report/profit-loss-statement', ['middleware' => ['permission:view-profit-loss-report'], 'uses' => 'ReportController@getProfitLossStatementForm'])->name('report.profit-loss-statement');

        Route::get('report/profit-loss-statement/all', ['middleware' => ['permission:view-profit-loss-report'], 'uses' => 'ReportController@getAllProfitLossStatement'])->name('report.profit-loss-statement-all');

        Route::post('report/profit-loss-statement', ['middleware' => ['permission:view-profit-loss-report'], 'uses' => 'ReportController@getProfitLossStatement'])->name('report.profit-loss-statement.generate');

        Route::get('report/sold-inventory', ['middleware' => ['permission:view-sold-inventory'], 'uses' => 'ReportController@getSoldInventoryForm'])->name('report.sold-inventory');

        Route::get('report/sold-inventory/all', ['middleware' => ['permission:view-sold-inventory'], 'uses' => 'ReportController@getAllSoldInventory'])->name('report.sold-inventory-all');

        Route::post('report/sold-inventory', ['middleware' => ['permission:view-sold-inventory'], 'uses' => 'ReportController@getSoldInventory'])->name('report.sold-inventory-generate');

        Route::get('report/received-amount', ['middleware' => ['permission:view-received-amount'], 'uses' => 'ReportController@getReceivedAmountForm'])->name('report.received-amount');

        Route::get('report/received-amount/all', ['middleware' => ['permission:view-received-amount'], 'uses' => 'ReportController@getAllReceivedAmount'])->name('report.received-amount-all');

        Route::post('report/received-amount', ['middleware' => ['permission:view-received-amount'], 'uses' => 'ReportController@getReceivedAmount'])->name('report.received-amount-generate');

        Route::get('report/commission-amount', ['middleware' => ['permission:view-dealer-commission'], 'uses' => 'ReportController@getCommissionAmountForm'])->name('report.commission-amount');

        Route::post('report/commission-amount', ['middleware' => ['permission:view-dealer-commission'], 'uses' => 'ReportController@getCommissionAmount'])->name('report.commission-amount-generate');

        Route::get('report/paid-rebate', ['middleware' => ['permission:view-rebate-report'], 'uses' => 'ReportController@getPaidRebateForm'])->name('report.paid-rebate');

        Route::post('report/paid-rebate', ['middleware' => ['permission:view-rebate-report'], 'uses' => 'ReportController@getPaidRebate'])->name('report.paid-rebate-generate');

        Route::get('report/aging', ['middleware' => ['permission:view-aging-report'], 'uses' => 'ReportController@generateAgingReport'])->name('report.aging');

        Route::get('report/balance-sheet', ['middleware' => ['permission:view-balance-sheet'], 'uses' => 'ReportController@getBalanceSheetForm'])->name('report.balance-sheet');

        Route::post('report/balance-sheet', ['middleware' => ['permission:view-balance-sheet'], 'uses' => 'ReportController@getBalanceSheet'])->name('report.balance-sheet.generate');

        Route::get('/update_chat_history', ['middleware' => ['permission:view-recovery-report'], 'uses' => 'ReportController@chatHistoryForm']);

        Route::get('/update_chat_historyy', ['middleware' => ['permission:view-recovery-report'], 'uses' => 'ReportController@chatHistoryForm2']);

        Route::get('/update_history', ['middleware' => ['permission:view-recovery-report'], 'uses' => 'ReportController@updateChatHistory'])->name('chat.update');

        Route::get('report/trial-balance', ['middleware' => ['permission:view-trial-balance'], 'uses' => 'ReportController@getTrialBalanceForm'])->name('report.trial-balance');

        Route::post('report/trial-balance', ['middleware' => ['permission:view-trial-balance'], 'uses' => 'ReportController@getTrialBalanceReport'])->name('report.trial-balance.generate');

        Route::get('report/trial-balance-detail/{id}', ['middleware' => ['permission:view-trial-balance'], 'uses' => 'ReportController@getTrialBalanceDetailReport'])->name('report.trial-balance-detail');

        Route::get('report/update-trial-balance-detail', ['middleware' => ['permission:view-trial-balance'], 'uses' => 'ReportController@updateTrialBalanceDetailReport']);

        Route::get('report/update-trial-balance', ['middleware' => ['permission:view-trial-balance'], 'uses' => 'ReportController@updateTrialBalanceReport']);

        Route::get('report/cash-flow-statement', ['middleware' => ['permission:view-cash-flow-statement'], 'uses' => 'ReportController@getCashFlowStatementForm'])->name('report.cash-flow-statement');



        Route::post('report/cash-flow-statement', ['middleware' => ['permission:view-cash-flow-statement'], 'uses' => 'ReportController@getCashFlowStatementReport'])->name('report.cash-flow-statement.generate');

        Route::get('report/update-cash-flow-statement', ['middleware' => ['permission:view-cash-flow-statement'], 'uses' => 'ReportController@updateCashFlowStatementReport']);


        Route::get('report/itme-in-out', ['middleware' => ['permission:item-in-out-report'], 'uses' => 'ReportController@getItemInOutReport'])->name('report.item-in-out');

        Route::get('report/update-item-in-out', ['middleware' => ['permission:item-in-out-report'], 'uses' => 'ReportController@updateItemInOutReport']);


        Route::get('report/inventory', ['middleware' => ['permission:inventory-report'], 'uses' => 'ReportController@getInventoryReport'])->name('report.inventory');

        Route::get('report/update-inventory', ['middleware' => ['permission:inventory-report'], 'uses' => 'ReportController@updateInventoryReport']);


        Route::get('report/item-valuation', ['middleware' => ['permission:item-valuation-report'], 'uses' => 'ReportController@getItemValuationReport'])->name('report.item-valuation');


        Route::get('report/general-ledger', ['middleware' => ['permission:view-general-ledger'], 'uses' => 'ReportController@getGeneralLedgerForm'])->name('report.general-ledger');

        Route::post('report/general-ledger', ['middleware' => ['permission:view-general-ledger'], 'uses' => 'ReportController@getGeneralLedger'])->name('report.general-ledger.generate');




        ////////////////////SETTINGS////////////////////////////////////////

        ////////////////////unit SIZE CONTROLLER////////////////////////////////////////

        Route::get('/unit-size/all', ['middleware' => ['permission:view-unit-size'], 'uses' =>  'UnitSizeController@allUnitSizes'])->name('unit.size.all');

        Route::get('/unit-size/add', ['middleware' => ['permission:create-unit-size'], 'uses' => 'UnitSizeController@addUnitSizeForm'])->name('unit.size.addView');

        Route::post('/unit-size/add', ['middleware' => ['permission:create-unit-size'], 'uses' => 'UnitSizeController@insertUnitSize'])->name('unit.size.insert');

        Route::get('/unit-size/view/{id}', ['middleware' => ['permission:view-unit-size'], 'uses' => 'UnitSizeController@detailUnitSize'])->name('unit.size.detail');

        Route::get('/unit-size/edit/{id}', ['middleware' => ['permission:edit-unit-size'], 'uses' => 'UnitSizeController@editUnitSizeForm'])->name('unit.size.editView');

        Route::post('/unit-size/edit', ['middleware' => ['permission:edit-unit-size'], 'uses' => 'UnitSizeController@updateUnitSize'])->name('unit.size.update');

        Route::get('/unit-size/delete/{id}', ['middleware' => ['permission:delete-unit-size'], 'uses' => 'UnitSizeController@deleteUnitSize'])->name('unit.size.delete');

        ////////////////////Registration no CONTROLLER////////////////////////////////////////

        Route::get('/registration-no/all', ['middleware' => ['permission:view-reg-no'], 'uses' => 'RegistrationNoController@allRegistrationNos'])->name('registration_no.all');

        Route::get('/registration-no/add', ['middleware' => ['permission:create-reg-no'], 'uses' => 'RegistrationNoController@addRegistrationNoForm'])->name('registration_no.addView');

        Route::post('/registration-no/add', ['middleware' => ['permission:create-reg-no'], 'uses' => 'RegistrationNoController@insertRegistrationNo'])->name('registration_no.insert');

        Route::get('/registration-no/edit/{id}', ['middleware' => ['permission:edit-reg-no'], 'uses' => 'RegistrationNoController@editRegistrationNoForm'])->name('registration_no.editView');

        Route::post('/registration-no/edit', ['middleware' => ['permission:edit-reg-no'], 'uses' => 'RegistrationNoController@updateRegistrationNo'])->name('registration_no.update');

        Route::get('/registration-no/delete/{id}', ['middleware' => ['permission:delete-reg-no'], 'uses' => 'RegistrationNoController@deleteRegistrationNo'])->name('registration_no.delete');

        Route::get('/registration-no/updateTable', ['middleware' => ['permission:view-reg-no'], 'uses' => 'RegistrationNoController@updateTable']);

        ////////////////////Incentive Type CONTROLLER////////////////////////////////////////

        Route::get('/dealer-type/all', ['middleware' => ['permission:view-dealer-type'], 'uses' => 'DealerTypeController@allDealerTypes'])->name('dealer.type.all');

        Route::get('/dealer-type/add', ['middleware' => ['permission:create-dealer-type'], 'uses' => 'DealerTypeController@addDealerTypeForm'])->name('dealer.type.addView');

        Route::post('/dealer-type/add', ['middleware' => ['permission:create-dealer-type'], 'uses' => 'DealerTypeController@insertDealerType'])->name('dealer.type.insert');

        Route::get('/dealer-type/view/{id}', ['middleware' => ['permission:view-dealer-type'], 'uses' => 'DealerTypeController@detailDealerType'])->name('dealer.type.detail');

        Route::get('/dealer-type/edit/{id}', ['middleware' => ['permission:edit-dealer-type'], 'uses' => 'DealerTypeController@editDealerTypeForm'])->name('dealer.type.editView');

        Route::post('/dealer-type/edit', ['middleware' => ['permission:edit-dealer-type'], 'uses' => 'DealerTypeController@updateDealerType'])->name('dealer.type.update');

        Route::get('/dealer-type/delete/{id}', ['middleware' => ['permission:delete-dealer-type'], 'uses' => 'DealerTypeController@deleteDealerType'])->name('dealer.type.delete');

        ///////////////////unit Type CONTROLLER////////////////////////////////////////
        Route::get('/unit-type/all', ['middleware' => ['permission:view-unit-type'], 'uses' => 'UnitTypeController@allUnitTypes'])->name('unit.type.all');

        Route::get('/unit-type/add', ['middleware' => ['permission:create-unit-type'], 'uses' => 'UnitTypeController@addUnitTypeForm'])->name('unit.type.addView');

        Route::post('/unit-type/add', ['middleware' => ['permission:create-unit-type'], 'uses' => 'UnitTypeController@insertUnitType'])->name('unit.type.insert');

        Route::get('/unit-type/view/{id}', ['middleware' => ['permission:view-unit-type'], 'uses' => 'UnitTypeController@detailUnitType'])->name('unit.type.detail');

        Route::get('/unit-type/edit/{id}', ['middleware' => ['permission:edit-unit-type'], 'uses' => 'UnitTypeController@editUnitTypeForm'])->name('unit.type.editView');

        Route::post('/unit-type/edit', ['middleware' => ['permission:edit-unit-type'], 'uses' => 'UnitTypeController@updateUnitType'])->name('unit.type.update');

        Route::get('/unit-type/delete/{id}', ['middleware' => ['permission:delete-unit-type'], 'uses' => 'UnitTypeController@deleteUnitType'])->name('unit.type.delete');

        ////////////////////unit Category CONTROLLER////////////////////////////////////////

        Route::get('/unit-category/all', ['middleware' => ['permission:view-unit-category'], 'uses' => 'UnitCategoryController@allUnitCategories'])->name('unitCategory.all');

        Route::get('/unit-category/add', ['middleware' => ['permission:create-unit-category'], 'uses' => 'UnitCategoryController@addUnitCategoryForm'])->name('unitCategory.addView');

        Route::post('/unit-category/add', ['middleware' => ['permission:create-unit-category'], 'uses' => 'UnitCategoryController@insertUnitCategory'])->name('unitCategory.insert');

        Route::get('/unit-category/view/{id}', ['middleware' => ['permission:view-unit-category'], 'uses' => 'UnitCategoryController@detailUnitCategory'])->name('unitCategory.detail');

        Route::get('/unit-category/edit/{id}', ['middleware' => ['permission:edit-unit-category'], 'uses' => 'UnitCategoryController@editUnitCategoryForm'])->name('unitCategory.editView');

        Route::post('/unit-category/edit', ['middleware' => ['permission:edit-unit-category'], 'uses' => 'UnitCategoryController@updateUnitCategory'])->name('unitCategory.update');

        Route::get('/unit-category/delete/{id}', ['middleware' => ['permission:delete-unit-category'], 'uses' => 'UnitCategoryController@deleteUnitCategory'])->name('unitCategory.delete');

        ////////////////////unit floor CONTROLLER////////////////////////////////////////

        Route::get('/unit-floor/all', ['middleware' => ['permission:view-unit-floor'], 'uses' => 'UnitFloorController@allUnitFloors'])->name('unitFloor.all');

        Route::get('/unit-floor/old-rates', ['middleware' => ['permission:view-unit-floor'], 'uses' => 'UnitFloorController@getOldRates'])->name('unitFloor.oldRates');

        Route::get('/unit-floor/add', ['middleware' => ['permission:create-unit-floor'], 'uses' => 'UnitFloorController@addUnitFloorForm'])->name('unitFloor.addView');


        Route::get('/unit-floor/get-type', ['middleware' => ['permission:create-unit-floor'], 'uses' => 'UnitFloorController@getUnitFloorData'])->name('unitFloor.get-type');


        Route::post('/unit-floor/add', ['middleware' => ['permission:create-unit-floor'], 'uses' => 'UnitFloorController@insertUnitFloor'])->name('unitFloor.insert');

        Route::get('/unit-floor/edit/{id}', ['middleware' => ['permission:edit-unit-floor'], 'uses' => 'UnitFloorController@editUnitFloorForm'])->name('unitFloor.editView');

        Route::post('/unit-floor/edit', ['middleware' => ['permission:edit-unit-floor'], 'uses' => 'UnitFloorController@updateUnitFloor'])->name('unitFloor.update');

        Route::get('/unit-floor/delete/{id}', ['middleware' => ['permission:delete-unit-floor'], 'uses' => 'UnitFloorController@deleteUnitFloor'])->name('unitFloor.delete');

        ////////////////////Department CONTROLLER////////////////////////////////////////

        // Route::get('/department/all',['middleware' => ['permission:view-department'], 'uses'=> 'DepartmentController@allDepartments'])->name('department.all');

        // Route::get('/department/add',['middleware' => ['permission:create-department'], 'uses'=> 'DepartmentController@addDepartmentForm'])->name('department.addView');

        // Route::post('/department/add',['middleware' => ['permission:create-department'], 'uses'=> 'DepartmentController@insertDepartment'])->name('department.insert');

        // Route::get('/department/view/{id}',['middleware' => ['permission:view-department'], 'uses'=> 'DepartmentController@detailDepartment'])->name('department.detail');

        // Route::get('/department/edit/{id}',['middleware' => ['permission:edit-department'], 'uses'=> 'DepartmentController@editDepartmentForm'])->name('department.editView');

        // Route::post('/department/edit',['middleware' => ['permission:edit-department'], 'uses'=> 'DepartmentController@updateDepartment'])->name('department.update');

        // Route::get('/department/delete/{id}',['middleware' => ['permission:delete-department'], 'uses'=> 'DepartmentController@deleteDepartment'])->name('department.delete');


        ////////////////////Designation CONTROLLER////////////////////////////////////////

        Route::get('/designation/all', ['middleware' => ['permission:view-designation'], 'uses' => 'DesignationController@allDesignations'])->name('designation.all');

        Route::get('/designation/add', ['middleware' => ['permission:create-designation'], 'uses' => 'DesignationController@addDesignationForm'])->name('designation.addView');

        Route::post('/designation/add', ['middleware' => ['permission:create-designation'], 'uses' => 'DesignationController@insertDesignation'])->name('designation.insert');

        Route::get('/designation/view/{id}', ['middleware' => ['permission:view-designation'], 'uses' => 'DesignationController@detailDesignation'])->name('designation.detail');

        Route::get('/designation/edit/{id}', ['middleware' => ['permission:edit-designation'], 'uses' => 'DesignationController@editDesignationForm'])->name('designation.editView');

        Route::post('/designation/edit', ['middleware' => ['permission:edit-designation'], 'uses' => 'DesignationController@updateDesignation'])->name('designation.update');

        Route::get('/designation/delete/{id}', ['middleware' => ['permission:delete-designation'], 'uses' => 'DesignationController@deleteDesignation'])->name('designation.delete');


        ///////////////////Payment Schedule////////////////////////////////////
        // Route::get('/payment-schedule/all', ['middleware' => ['role:admin'], 'uses' => 'SchedulePlanController@getSchedulePlan'])->name('schedule.all');

        Route::get('/payment-schedule/all', ['middleware' => ['role:admin'], 'uses' => 'SchedulePlanController@getAllSchedulePlans'])->name('schedule.all');

        Route::get('/payment-schedule/{id}', ['middleware' => ['role:admin'], 'uses' => 'SchedulePlanController@getSchedulePlan'])->where(['id' => '[0-9]+'])->name('specific.schedule');

        Route::get('/payment-schedule/create', ['middleware' => ['role:admin'], 'uses' => 'SchedulePlanController@createNewSchedulePlan'])->name('schedule.create');
        Route::post('/payment-schedule/store', ['middleware' => ['role:admin'], 'uses' => 'SchedulePlanController@storeNewSchedulePlan'])->name('schedule.store');

        

        Route::get('/voucher-valid-date', ['middleware' => ['permission:voucher-valid-date'], 'uses' => 'SchedulePlanController@getVoucherValidDate'])->name('voucher.valid.date');

        Route::get('/payment-schedule/edit/{id}', ['middleware' => ['role:admin'], 'uses' => 'SchedulePlanController@editSchedulePlanForm'])->name('schedule.editView');

        Route::get('/voucher-valid-date/edit/{id}', ['middleware' => ['permission:voucher-valid-date'], 'uses' => 'SchedulePlanController@editVoucherValidDate'])->name('update.voucher.valid.date');

        Route::post('/payment-schedule/edit', ['middleware' => ['role:admin'], 'uses' => 'SchedulePlanController@updateSchedulePlan'])->name('schedule.update');

        Route::post('/update-voucher-valid-date/edit', ['middleware' => ['permission:voucher-valid-date'], 'uses' => 'SchedulePlanController@updateVoucherValidDate'])->name('update.voucher.date');

        Route::post('/payment-head/update', 'SchedulePlanController@updatePaymentHead')->name('payment.head.update');

        /////////////////////////Account//////////////////////////////////////

        Route::get('/account/all', ['middleware' => ['role:admin'], 'uses' => 'HomeController@allAccounts'])->name('account.all');

        Route::get('/account/add', ['middleware' => ['role:admin'], 'uses' => 'HomeController@addAccountForm'])->name('account.addView');

        Route::post('/account/add', ['middleware' => ['role:admin'], 'uses' => 'HomeController@insertAccount'])->name('account.insert');

        Route::get('/account/edit/{id}', ['middleware' => ['role:admin'], 'uses' => 'HomeController@editAccountForm'])->name('account.edit');

        Route::post('/account/edit', ['middleware' => ['role:admin'], 'uses' => 'HomeController@updateAccount'])->name('account.update');

        Route::get('/account/delete/{id}', ['middleware' => ['role:admin'], 'uses' => 'HomeController@deleteAccount'])->name('account.delete');



        ////////////////////////////TRASH CONTROLLER///////////////////////////////////

        Route::group(['middleware' => ['role:admin']], function () {

            Route::get('/trash', 'TrashController@getAllTrashItem')->name('trash.all');

            Route::get('/trash/customer/revert/{id}', 'TrashController@revertCustomer')->name('trash.customer.revert');

            Route::get('/trash/customer/delete/{id}', 'TrashController@deleteCustomer')->name('trash.customer.delete');

            Route::get('/trash/inventory/revert/{id}', 'TrashController@revertInventory')->name('trash.inventory.revert');

            Route::get('/trash/inventory/delete/{id}', 'TrashController@deleteInventory')->name('trash.inventory.delete');

            Route::get('/trash/registration/revert/{id}', 'TrashController@revertRegistration')->name('trash.registration.revert');

            Route::get('/trash/registration/delete/{id}', 'TrashController@deleteRegistration')->name('trash.registration.delete');

            Route::get('/trash/membership/revert/{id}', 'TrashController@revertMembership')->name('trash.membership.revert');

            Route::get('/trash/membership/delete/{id}', 'TrashController@deleteMembership')->name('trash.membership.delete');

            Route::get('/trash/receipt/revert/{id}', 'TrashController@revertReceipt')->name('trash.receipt.revert');

            Route::get('/trash/receipt/delete/{id}', 'TrashController@deleteReceipt')->name('trash.receipt.delete');

            Route::get('/trash/dealer/revert/{id}', 'TrashController@revertDealer')->name('trash.dealer.revert');

            Route::get('/trash/dealer/delete/{id}', 'TrashController@deleteDealer')->name('trash.dealer.delete');

            Route::get('/trash/reg/revert/{id}', 'TrashController@revertRegNo')->name('trash.regno.revert');

            Route::get('/trash/reg/delete/{id}', 'TrashController@deleteRegNo')->name('trash.regno.delete');

            Route::get('/trash/dealer-rebate/revert/{id}', 'TrashController@revertDealerRebate')->name('trash.dealerRebate.revert');

            Route::get('/trash/dealer-rebate/delete/{id}', 'TrashController@deleteDealerRebate')->name('trash.dealerRebate.delete');

            Route::get('/trash/unit-floor/revert/{id}', 'TrashController@revertUnitFloor')->name('trash.unitFloor.revert');

            Route::get('/trash/unit-floor/delete/{id}', 'TrashController@deleteUnitFloor')->name('trash.unitFloor.delete');

            Route::get('/trash/unit-size/revert/{id}', 'TrashController@revertUnitSize')->name('trash.unitSize.revert');

            Route::get('/trash/unit-size/delete/{id}', 'TrashController@deleteUnitSize')->name('trash.unitSize.delete');

            Route::get('/trash/unit-type/revert/{id}', 'TrashController@revertUnitType')->name('trash.unitType.revert');

            Route::get('/trash/unit-type/delete/{id}', 'TrashController@deleteUnitType')->name('trash.unitType.delete');

            Route::get('/trash/unit-category/revert/{id}', 'TrashController@revertUnitCategory')->name('trash.unitCategory.revert');

            Route::get('/trash/unit-category/delete/{id}', 'TrashController@deleteUnitCategory')->name('trash.unitCategory.delete');

            Route::get('/trash/package/revert/{id}', 'TrashController@revertPackage')->name('trash.package.revert');

            Route::get('/trash/package/delete/{id}', 'TrashController@deletePackage')->name('trash.package.delete');

            Route::get('/trash/price/revert/{id}', 'TrashController@revertPrice')->name('trash.price.revert');

            Route::get('/trash/price/delete/{id}', 'TrashController@deletePrice')->name('trash.price.delete');

            Route::get('/trash/issue/revert/{id}', 'TrashController@revertOpenFile')->name('trash.issue.revert');

            Route::get('/trash/issue/delete/{id}', 'TrashController@deleteOpenFile')->name('trash.issue.delete');

            Route::get('/trash/dealer/receipt/revert/{id}', 'TrashController@revertDealerReceipt')->name('trash.dealer_receipt.revert');


            Route::get('/trash/dealer/receipt/revert/{id}', 'TrashController@revertDealerReceipt')->name('trash.dealer_receipt.delete');

            
            Route::get('/trash/refund-unit/receipt/revert/{id}', 'TrashController@revertRefundUnitReceipt')->name('trash.refund_unitreceipt.revert');

            Route::get('/trash/refund-unit/receipt/delete/{id}', 'TrashController@deleteRefundUnitReceipt')->name('trash.refund_unit_receipt.delete');

            Route::get('/trash/refund-unit/receipt/delete-all', 'TrashController@deleteAllRefundUnitReceipts')->name('trash.refund_unit_receipt.delete-all');


            Route::get('/trash/refund-open-unit/receipt/revert/{id}', 'TrashController@revertRefundOpenFileReceipt')->name('trash.refund_open_file_receipt.revert');

            Route::get('/trash/refund-open-unit/receipt/delete/{id}', 'TrashController@deleteRefundOpenFileReceipt')->name('trash.refund_open_file_receipt.delete');

            Route::get('/trash/refund-open-unit/receipt/delete-all', 'TrashController@deleteAllRefundOpenFileReceipts')->name('trash.refund_open_file_receipt.delete-all');


            Route::get('/trash/cancel-unit/receipt/revert/{id}', 'TrashController@revertCancelUnitReceipt')->name('trash.cancel_unitreceipt.revert');

            Route::get('/trash/cancel-unit/receipt/delete/{id}', 'TrashController@deleteCancelUnitReceipt')->name('trash.cancel_unit_receipt.delete');

            Route::get('/trash/cancel-unit/receipt/delete-all', 'TrashController@deleteAllCancelUnitReceipts')->name('trash.cancel_unit_receipt.delete-all');   

            
            Route::get('/trash/cancel-open-unit/receipt/revert/{id}', 'TrashController@revertCancelOpenFileReceipt')->name('trash.cancel_open_file_receipt.revert');

            Route::get('/trash/cancel-open-unit/receipt/delete/{id}', 'TrashController@deleteCancelOpenFileReceipt')->name('trash.cancel_open_file_receipt.delete');

            Route::get('/trash/cancel-open-unit/receipt/delete-all', 'TrashController@deleteAllCancelOpenFileReceipts')->name('trash.cancel_open_file_receipt.delete-all');            
            
            

            Route::get('/trash/nominee/revert/{id}', 'TrashController@revertNominee')->name('trash.nominee.revert');

            Route::get('/trash/nominee/delete/{id}', 'TrashController@deleteNominee')->name('trash.nominee.delete');

            Route::get('/trash/nominee/delete-all', 'TrashController@deleteAllNominee')->name('trash.nominee.delete-all');            
            



            Route::get('/trash/inventory/deleteallcustomer', 'TrashController@deleteAllCustomers')->name('trash.inventory.alldeletecustomer');

            Route::get('/trash/inventory/deleteallinventory', 'TrashController@deleteAllInventories')->name('trash.inventory.alldeleteinventory');

            Route::get('/trash/inventory/deleteallmembership', 'TrashController@deleteAllMemberships')->name('trash.inventory.alldeletemembership');

            Route::get('/trash/inventory/deletealldealer', 'TrashController@deleteAllDealers')->name('trash.inventory.alldeletedealer');

            Route::get('/trash/inventory/deleteallrebate', 'TrashController@deleteAllRebates')->name('trash.inventory.alldeleterebate');

            Route::get('/trash/inventory/deletealltype', 'TrashController@deleteAllTypes')->name('trash.inventory.alldeletetype');

            Route::get('/trash/inventory/deleteallreceipt', 'TrashController@deleteAllReceipts')->name('trash.inventory.alldeletereceipt');

            Route::get('/trash/inventory/deleteallsize', 'TrashController@deleteAllSizes')->name('trash.inventory.alldeletesize');

            Route::get('/trash/inventory/deleteallfloor', 'TrashController@deleteAllFloors')->name('trash.inventory.alldeletefloor');

            Route::get('/trash/inventory/deleteallcategory', 'TrashController@deleteAllCategories')->name('trash.inventory.alldeletecategory');

            Route::get('/trash/inventory/deleteallpackage', 'TrashController@deleteAllPackages')->name('trash.inventory.alldeletepackage');

            Route::get('/trash/inventory/deleteallprice', 'TrashController@deleteAllPrices')->name('trash.inventory.alldeleteprice');

            Route::get('/trash/inventory/deleteallopenfile', 'TrashController@deleteAllOpenFiles')->name('trash.inventory.alldeleteopenfile');

            Route::get('/trash/inventory/deletealldealerpackagereceipt', 'TrashController@deleteAllDealerPackageReceipts')->name('trash.inventory.alldeletedealerpackagereceipt');


            ////////////////////////////////Role Managment/////////////////////////////////////

            Route::get('/role-management', 'RoleController@getRoles')->name('role.view');
            Route::get('/role-management/add', 'RoleController@addRole')->name('role.add');
            Route::post('/role-management/add', 'RoleController@createRole')->name('role.create');
            Route::get('/role-management/edit/{id}', 'RoleController@editRole')->name('role.edit');
            Route::post('/role-management/edit/', 'RoleController@updateRole')->name('role.update');
            Route::get('/role-management/delete/{id}', 'RoleController@deleteRole')->name('role.delete');
            Route::get('/role-management/permissions/{id}', 'RoleController@permissionForm')->name('role.permission');
            Route::post('/role-management/permissions', 'RoleController@updatePermission')->name('role.permission.update');

            // Route::get('/account/access','RoleController@getRoleAccess')->name('account.role');
            // Route::post('/account/access','RoleController@updateRoleAccess')->name('role.permission');


            ////////////////////Department CONTROLLER////////////////////////////////////////

            Route::get('/vendor/all', ['middleware' => ['permission:view-vendor'], 'uses' => 'VendorController@allVendors'])->name('vendor1.all');

            Route::get('/vendor/add', ['middleware' => ['permission:create-vendor'], 'uses' => 'VendorController@addVendorForm'])->name('vendor1.addView');

            Route::post('/vendor/add', ['middleware' => ['permission:create-vendor'], 'uses' => 'VendorController@insertVendor'])->name('vendor1.insert');

            Route::get('/vendor/view/{id}', ['middleware' => ['permission:view-vendor'], 'uses' => 'VendorController@detailVendor'])->name('vendor1.detail');

            Route::get('/vendor/edit/{id}', ['middleware' => ['permission:edit-vendor'], 'uses' => 'VendorController@editVendorForm'])->name('vendor1.editView');

            Route::post('/vendor/edit', ['middleware' => ['permission:edit-vendor'], 'uses' => 'VendorController@updateVendor'])->name('vendor1.update');

            Route::get('/vendor/delete/{id}', ['middleware' => ['permission:delete-vendor'], 'uses' => 'VendorController@deleteVendor'])->name('vendor1.delete');

            /////////////////////Account Transfers///////////////////////////////////////////////

            Route::get('/account-transfers/all', ['middleware' => ['permission:list-bank-account'], 'uses' => 'AccountTransferController@allAccountTransfers'])->name('account.transfer.all');

            Route::get('/account-transfers/add', ['middleware' => ['permission:create-bank-account'], 'uses' => 'AccountTransferController@addAccountTransferForm'])->name('account.transfer.addView');

            Route::post('/account-transfers/add', ['middleware' => ['permission:create-bank-account'], 'uses' => 'AccountTransferController@insertAccountTransfer'])->name('account.transfer.insert');

            Route::get('/account-transfers/edit/{id}', ['middleware' => ['permission:edit-bank-account'], 'uses' => 'AccountTransferController@editAccountTransferForm'])->name('account.transfer.editView');

            Route::post('/account-transfers/edit', ['middleware' => ['permission:edit-bank-account'], 'uses' => 'AccountTransferController@updateAccountTransfer'])->name('account.transfer.update');

            Route::get('/account-transfers/delete/{id}', ['middleware' => ['permission:delete-bank-account'], 'uses' => 'AccountTransferController@deleteAccountTransfer'])->name('account.transfer.delete');
        });

        ///////////////////////////////Messages////////////////////////////////////////
        Route::get('/message/new', ['middleware' => ['permission:manage-messages'], 'uses' => 'HomeController@sendMessageForm'])->name('message.add');

        Route::get('/sendMessage', ['middleware' => ['permission:manage-messages'], 'uses' => 'HomeController@sendMessage']);

        Route::get('/messages/History', ['middleware' => ['permission:manage-messages'], 'uses' => 'HomeController@smsHistory'])->name('message.history');


        ////////////////////////////EXPENSE CATEGORY///////////////////////////

        Route::get('/expense-category/all', ['middleware' => ['permission:view-expense'], 'uses' => 'ExpenseCategoryController@allExpenseCategories'])->name('expense.category.all');

        Route::get('/expense-category/add', ['middleware' => ['permission:create-expense'], 'uses' => 'ExpenseCategoryController@addExpenseCategoryForm'])->name('expense.category.addView');

        Route::post('/expense-category/add', ['middleware' => ['permission:create-expense'], 'uses' => 'ExpenseCategoryController@insertExpenseCategory'])->name('expense.category.insert');

        Route::get('/expense-category/edit/{id}', ['middleware' => ['permission:edit-expense'], 'uses' => 'ExpenseCategoryController@editExpenseCategoryForm'])->name('expense.category.editView');

        Route::post('/expense-category/edit', ['middleware' => ['permission:edit-expense'], 'uses' => 'ExpenseCategoryController@updateExpenseCategory'])->name('expense.category.update');

        Route::get('/expense-category/delete/{id}', ['middleware' => ['permission:delete-expense'], 'uses' => 'ExpenseCategoryController@deleteExpenseCategory'])->name('expense.category.delete');


        ///////////////////////RECONCILATIONS/////////////////////////////////

        Route::get('/reconciliations', 'ReconciliationController@allReconciliations')->name('reconcile.all');

        Route::get('/reconciliations/new', 'ReconciliationController@reconcileForm')->name('reconcile.new');

        Route::post('/reconciliations/new', 'ReconciliationController@showReconciliations')->name('reconcile.new.show');

        Route::post('/reconciliations/add', 'ReconciliationController@addReconciliations')->name('reconcile.add');


        ////////////////////Chart of Accounts CONTROLLER////////////////////////////////////////

        Route::get('/chart-of-accounts/all', ['middleware' => ['permission:view-chart-of-account'], 'uses' => 'ChartOfAccountController@allAccounts'])->name('chart-of-account.all');

        Route::get('/chart-of-accounts/update-record', ['middleware' => ['permission:view-chart-of-account'], 'uses' => 'ChartOfAccountController@updateTable']);

        Route::get('/chart-of-accounts/add', ['middleware' => ['permission:create-chart-of-account'], 'uses' => 'ChartOfAccountController@addAccountForm'])->name('chart-of-account.addView');

        Route::post('/chart-of-accounts/add', ['middleware' => ['permission:create-chart-of-account'], 'uses' => 'ChartOfAccountController@insertAccount'])->name('chart-of-account.insert');

        Route::get('/chart-of-accounts/view/{id}', ['middleware' => ['permission:view-chart-of-account'], 'uses' => 'ChartOfAccountController@detailAccount'])->name('chart-of-account.detail');

        Route::get('/chart-of-accounts/edit/{id}', ['middleware' => ['permission:edit-chart-of-account'], 'uses' => 'ChartOfAccountController@editAccountForm'])->name('chart-of-account.editView');

        Route::post('/chart-of-accounts/edit', ['middleware' => ['permission:edit-chart-of-account'], 'uses' => 'ChartOfAccountController@updateAccount'])->name('chart-of-account.update');

        Route::get('/chart-of-accounts/delete/{id}', ['middleware' => ['permission:delete-chart-of-account'], 'uses' => 'ChartOfAccountController@deleteAccount'])->name('chart-of-account.delete');

        Route::get('/chart-of-account/get-account-description', 'ChartOfAccountController@getAccountDescription');

        Route::get('/chart-of-account/get-account-no', 'ChartOfAccountController@getChartOfAccountNo')->name('chart-of-account.getNumber');;

        Route::get('/chart-of-account/get-sub-account-no', 'ChartOfAccountController@getSubChartOfAccountNo')->name('chart-of-account.SubgetNumber');;




        ////////////////////////////////////General Journal Entries////////////////////////////

        Route::get('/general-journal-entries/all', 'GeneralJournalEntryController@getAllEntries')->name('entry.all');

        Route::get('/general-journal-entries/update-entries', 'GeneralJournalEntryController@updateEntries');

        Route::get('/general-journal-entries/update-query', 'GeneralJournalEntryController@updateQuery');

        Route::get('/general-journal-entries/add', 'GeneralJournalEntryController@addNewEntry')->name('entry.add');

        Route::get('/general-journal-entries/update', 'GeneralJournalEntryController@updateEntry')->name('entry.update');

        Route::get('/general-journal-entries/show', 'GeneralJournalEntryController@showEntry')->name('entry.show');

        Route::get('/general-journal-entries/approve-modal', 'GeneralJournalEntryController@approveEntryModal');

        Route::get('/general-journal-entries/approve-entry', 'GeneralJournalEntryController@approvedEntry')->name('entry.approve');

        Route::get('/general-journal-entries/delete', 'GeneralJournalEntryController@deleteEntry')->name('entry.delete');

        //////////////////////////////////Account Class//////////////////////////////////

        ////////////////////Department CONTROLLER////////////////////////////////////////

        Route::get('/account-class/all', ['middleware' => ['permission:view-chart-of-account'], 'uses' => 'AccountClassController@allAccountClasses'])->name('account-class.all');

        Route::get('/account-class/add', ['middleware' => ['permission:create-chart-of-account'], 'uses' => 'AccountClassController@addAccountClassForm'])->name('account-class.addView');

        Route::post('/account-class/add', ['middleware' => ['permission:create-chart-of-account'], 'uses' => 'AccountClassController@insertAccountClass'])->name('account-class.insert');

        Route::get('/account-class/edit/{id}', ['middleware' => ['permission:edit-chart-of-account'], 'uses' => 'AccountClassController@editAccountClassForm'])->name('account-class.editView');

        Route::post('/account-class/edit', ['middleware' => ['permission:edit-chart-of-account'], 'uses' => 'AccountClassController@updateAccountClass'])->name('account-class.update');

        Route::get('/account-class/delete/{id}', ['middleware' => ['permission:delete-chart-of-account'], 'uses' => 'AccountClassController@deleteAccountClass'])->name('account-class.delete');

        ////////////////////Control Account CONTROLLER////////////////////////////////////////


        Route::get('/control-account/add/{id}', ['middleware' => ['permission:create-chart-of-account'], 'uses' => 'ControlAccountController@addControlAccountForm'])->name('control-account.addView');

        Route::post('/control-account/add', ['middleware' => ['permission:create-chart-of-account'], 'uses' => 'ControlAccountController@insertControlAccount'])->name('control-account.insert');

        Route::get('/control-account/edit/{id}', ['middleware' => ['permission:edit-chart-of-account'], 'uses' => 'ControlAccountController@editControlAccountForm'])->name('control-account.editView');

        Route::post('/control-account/edit', ['middleware' => ['permission:edit-chart-of-account'], 'uses' => 'ControlAccountController@updateControlAccount'])->name('control-account.update');

        Route::get('/control-account/detail/{id}', ['middleware' => ['permission:edit-chart-of-account'], 'uses' => 'ControlAccountController@detailControlAccount'])->name('control-account.detail');
    });

    Route::post('/image-upload', 'CustomerController@uploadImage');

    Route::get('ProfitLoss', function () {
        return view('profit-loss-statement');
    })->name('profit-loss-statement');
    Route::get('BalanceSheet', function () {
        return view('balance-sheet');
    })->name('balance-sheet');


    Route::get('DrawingsList', function () {
        return view('drawing-list');
    })->name('drawing-list');

    Route::get('AddDrawing', function () {
        return view('add-drawing-list');
    })->name('add-drawing-list');

    Route::get('m', function () {
        return view('membership');
    });
    Route::get('r', function () {
        return view('registration');
    });

    Route::get('booking', function () {
        return view('booking');
    });

    Route::get('allotment', function () {
        return view('allotment');
    });
    Route::get('agreement', function () {
        return view('agreement');
    });
    Route::get('receipt-new', function () {
        return view('receipt-new');
    });
    Route::get('application-form', function () {
        return view('application-form');
    });
    Route::get('payment-request', function () {
        return view('payment-request');
    });
    Route::get('paymentRequest', function () {
        return view('paymentRequest');
    });
});

// update prices_types_company1 
//     set date=DATE_ADD(date,INTERVAL 1 year)
// order by date desc;

////////////////////////PROCUREMENT/////////////////////////////////


/////////////Projects////////////////////////////
Route::get('/projects/add-project', 'ProjectController@create')->name('project.add');

Route::post('/projects/add-project', 'ProjectController@store')->name('project.insert');

Route::get('/projects/list', 'ProjectController@index')->name('project.list');

Route::get('/projects/delete-project/{id}', 'ProjectController@destroy')->name('project.delete');

Route::get('/projects/edit-project/{id}', 'ProjectController@edit')->name('project.edit');

Route::post('/projects/update-project', 'ProjectController@update')->name('project.update');

/////////////Departments////////////////////////////
Route::middleware(['auth', CheckProjectType::class,CheckProjectExistence::class])->group(function () {

    Route::get('/departments/add-department', ['middleware' => ['permission:create-department'], 'uses' => 'DepartmentController@create'])->name('department.add');

    Route::post('/departments/add-department', ['middleware' => ['permission:create-department'], 'uses' => 'DepartmentController@store'])->name('department.insert');

    Route::get('/departments/department-list', ['middleware' => ['permission:view-department'], 'uses' => 'DepartmentController@index'])->name('department.list');

    //                                          
    // Route::get('/departments/department-list',['middleware' => ['permission:view-department'], 'uses'=> 'DepartmentController@index'])->name('department.list');

    Route::delete('/departments/delete-department/{id}', ['middleware' => ['permission:delete-department'], 'uses' => 'DepartmentController@destroy'])->name('department.delete');

    Route::get('/departments/edit-department/{id}', ['middleware' => ['permission:edit-department'], 'uses' => 'DepartmentController@edit'])->name('department.edit');

    Route::post('/departments/update-department', ['middleware' => ['permission:edit-department'], 'uses' => 'DepartmentController@update'])->name('department.update');

    Route::get('/departments/dashboard/{id}', ['middleware' => ['permission:edit-department'], 'uses' => 'DepartmentController@dashboard'])->name('department.dashboard');


    /////////////CategoryController////////////////////////////

    Route::get('categories/add-category', ['middleware' => ['permission:create-item-category'], 'uses' => 'CategoryController@create'])->name('category.add');

    Route::post('/categories/add-category', ['middleware' => ['permission:create-item-category'], 'uses' => 'CategoryController@store'])->name('category.insert');

    Route::get('/categories/category-list', ['middleware' => ['permission:list-item-category'], 'uses' => 'CategoryController@index'])->name('category.list');

    // Route::get('/categories/delete-category/{id}',['middleware' => ['permission:delete-item-category'], 'uses' => 'CategoryController@destroy'])->name('category.delete');

    Route::delete('/categories/delete-category/{id}', ['middleware' => ['permission:delete-item-category'], 'uses' => 'CategoryController@destroy'])->name('category.delete');

    Route::get('/categories/edit-category/{id}', ['middleware' => ['permission:edit-item-category'], 'uses' => 'CategoryController@edit'])->name('category.edit');

    Route::post('/categories/update-category', ['middleware' => ['permission:edit-item-category'], 'uses' => 'CategoryController@update'])->name('category.update');


    /////////////Item////////////////////////////

    Route::get('/items/add-item', ['middleware' => ['permission:create-item'], 'uses' => 'ItemController@create'])->name('item.add');

    Route::post('/items/add-item', ['middleware' => ['permission:create-item'], 'uses' => 'ItemController@store'])->name('item.insert');

    Route::get('/items/item-list', ['middleware' => ['permission:list-item'], 'uses' => 'ItemController@index'])->name('item.list');

    // Route::get('/items/delete-item/{id}',['middleware' =>['permission:delete-item'], 'uses'=> 'ItemController@destroy'])->name('item.delete');

    Route::delete('/items/delete-item/{id}', ['middleware' => ['permission:delete-item'], 'uses' => 'ItemController@destroy'])->name('item.delete');

    Route::get('/items/edit-item/{id}', ['middleware' => ['permission:edit-item'], 'uses' => 'ItemController@edit'])->name('item.edit');

    Route::post('/items/item-update', ['middleware' => ['permission:edit-item'], 'uses' => 'ItemController@update'])->name('item.update');

    Route::get('/items/view/{id}', ['middleware' => ['permission:view-item'], 'uses' => 'ItemController@view'])->name('item.view');

    Route::post('/items/releasing', ['middleware' => ['permission:releasing-item'], 'uses' => 'ItemController@releasing'])->name('item.releasing');

    Route::get('/items/releasing-list', ['middleware' => ['permission:releasing-item-view'], 'uses' => 'ItemController@releasingItemView'])->name('item.releasing-list');

    Route::get('/items/returning-list', ['middleware' => ['permission:returning-item-view'], 'uses' => 'ItemController@returningItemView'])->name('item.returning-list');

    Route::get('/items/releasing-details/{id}', ['middleware' => ['permission:releasing-item-view'], 'uses' => 'ItemController@releasingDetail'])->name('item.releasing-details');

    Route::get('/items/returning-details/{id}', ['middleware' => ['permission:returning-item-view'], 'uses' => 'ItemController@returningDetail'])->name('item.returning-details');

    Route::get('/items/get-item-for-releasing', 'ItemController@itemForReleasing')->name('item.get-item-for-releasing');

    Route::get('/items/get-item-for-release', 'ItemController@itemForRelease')->name('item.get-item-for-release');

    Route::get('/items/aging-report', ['middleware' => ['permission:item-aging-report'], 'uses' => 'ItemController@aging_report'])->name('item.aging-report');

    Route::get('/items/variance-report', ['middleware' => ['permission:item-variance-report'], 'uses' => 'ItemController@varianceReport'])->name('item.variance-report');

    Route::post('/items/variance-report', ['middleware' => ['permission:item-variance-report'], 'uses' => 'ItemController@varianceReportItem'])->name('item.variance-report');

    ///////////////Fixed assets//////////////////////////////////////////////////////////

    Route::get('/fixed-asset/dashboard', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@Dashboard'])->name('fixed.asset.dashboard');

    Route::get('/items/fixed-assets', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@fixedAssetItems'])->name('fixed.assets');

    Route::get('/items/fixed-assets/sold', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@fixedAssetForSale'])->name('fixed.assets.sold');

    Route::get('/fixed-assets/sale-revert/{id}', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@fixedAssetSaleRevert'])->name('fixed.asset.sale.revert');

    Route::get('/fixed-assets/add-sale', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@createFixedAssetSale'])->name('fixed.assets.add.sale');

    Route::get('/get-asset-data',  'ItemController@getAssetData')->name('get.asset.data');


    Route::get('/items/add-fixed-asset', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@createFixedAsset'])->name('item.fixed.assets.add');

    Route::post('/fixed-assets/insert-sale', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@fixedAssetSalaInsert'])->name('fixed.assets.sale.insert');

    Route::post('/items/insert-fixed-assets', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@storeFixedAsset'])->name('fixed.assets.insert');

    Route::get('/items/edit-fixed-assets/{id}', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@editFixedAsset'])->name('fixed.assets.edit');

    Route::post('/items/update-fixed-assets', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@updateFixedAsset'])->name('fixed.assets.update');


    Route::post('/get-employees',  'ItemController@getEmployeeList')->name('get_employees');

    Route::post('/update_asset_with_employee',  'ItemController@assignAssetWithEmploye')->name('update_asset_with_employee');

    Route::post('/get-assign-employee',  'ItemController@getAssignEmployeeList')->name('get_assign_employee');

    Route::post('/update_re_asset_with_employee',  'ItemController@assignReAssetWithEmploye')->name('update_re_asset_with_employee');

    Route::get('/items/delete-fixed-assets/{id}', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@destroyFixedAsset'])->name('item.fixed.assets.delete');


    Route::get('/items/view-fixed-assets/{id}', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@viewFixedAsset'])->name('item.fixed.assets.view');

    Route::get('/fixed-asset/ledger', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@fixedAssetLegder'])->name('fixed.asset.ledger');

    Route::get('/fixed-asset/depreciation-report', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@fixedAssetDepreciationReport'])->name('depreciation.report');


    Route::get('/filter-asset/ledger', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@filterAssetLegder'])->name('filter.asset.ledger');

    Route::get('/filter-asset/sent-to-accounts', ['middleware' => ['permission:fixed-assets'], 'uses' => 'ItemController@sentToAccounts'])->name('sent.to.accounts');

    Route::get('/accounts/fixed-assets', ['middleware' => ['permission:fixed-assets'], 'uses' => 'GeneralJournalEntryController@sentToAccounts'])->name('fixed.assets.accounts');

    /////////////////////HRM///////////////////////////////

    Route::get('/hrm/dashboard', 'HrmEmployeeController@getHrmDashboard')->name('hrm.dashboard');

    Route::get('/hrm/appointment/letter', 'HrmEmployeeController@getAppointmentLetter')->name('hrm.appointment.letter');

    Route::get('/hrm/add-employee', 'HrmEmployeeController@create')->name('employee.add');

    Route::get('/hrm/employee-sheet', 'HrmEmployeeController@index')->name('employee.sheet');

    Route::post('/hrm/add-hrm-employee', 'HrmEmployeeController@store')->name('hrmemployee.store');

    Route::get('/hrm/employee/edit/{id}', 'HrmEmployeeController@edit')->name('hrmemployee.edit');

    Route::get('/hrm/employee/view/{id}', 'HrmEmployeeController@detailhrmemployee')->name('hrmemployee.detail');

    Route::post('/hrm/employee/update/{id}', 'HrmEmployeeController@update')->name('hrmemployee.update');

    Route::get('/hrm/employee-delete/{id}', 'HrmEmployeeController@destroy')->name('hrmemployee.delete');

    Route::post('/hrm/add-hrm-employee/document', 'HrmEmployeeController@documentInsert')->name('hrmemployee.document.insert');

    Route::get('/hrm/employee/document/delete/{id}', 'HrmEmployeeController@deleteEmployeeDocument')->name('employee.delete.document');

    Route::get('/hrm/employee/status/update/', 'HrmEmployeeController@updateStatus')->name('status.update');

    ////////////////Attendance////////////////////////////////////////////////////////////

    Route::get('/hrm/add-attendance', 'HrmAttendanceController@index')->name('add.attendance');

    Route::get('/hrm/details/employee-attendance/{id}', 'HrmAttendanceController@DetailofEmployeeAttendance')->name('detail.employee.attendance');

    Route::get('/hrm/edit/hrm-setting/', 'HrmAttendanceController@edithrmsetting')->name('edit.hrm.setting.attendance');

    Route::post('/hrm/create/hrm-setting/', 'HrmAttendanceController@createinitialhrmsetting')->name('create.hrm.setting.attendance');


    Route::post('/hrm/update/hrm-setting{id}', 'HrmAttendanceController@updatehrmsetting')->name('hrm.setting.update');


    Route::post('/hrm/store-attendance', 'HrmAttendanceController@store')->name('store.attendance');


    ////////////////// payroll///////////////////////////////////////////////////////////////

    Route::get('/hrm/employee-salary', 'HrmSetsalaryController@index')->name('employee.setsalary');

    Route::get('/hrm/employee/salary-edit/{id}', 'HrmSetsalaryController@edit')->name('employeesalary.edit');

    Route::post('/hrm/employee/salary-update/{id}', 'HrmSetsalaryController@update')->name('hrmemployeesalary.update');


    Route::get('/hrm/employee/setsalary/{id}', 'HrmSetsalaryController@sethrmemployeesalary')->name('hrmemployee.salary');

    Route::post('/hrm/employee/salary-store/', 'HrmSetsalaryController@employeesalary')->name('employeesalary.add');

    Route::get('/hrm/employee/allownce-show/{id}', 'HrmSetsalaryController@showemployeesalary')->name('employeesalary.show');



    Route::get('/hrm/allownce-delete/{id}', 'HrmSetsalaryController@allowncedelete')->name('hrmemployeeallownce.delete');

    Route::post('/hrm/employee/commission-store/', 'HrmSetsalaryController@employeecommission')->name('employeecommission.add');

    Route::get('/hrm/employee/commission-show/{id}', 'HrmSetsalaryController@showemployeecommission')->name('employeecommission.show');
    Route::get('/hrm/commission-delete/{id}', 'HrmSetsalaryController@commissiondelete')->name('hrmemployeecommission.delete');

    Route::post('/hrm/employee/loan-store/', 'HrmSetsalaryController@employeeloan')->name('employeeloan.add');

    Route::post('/hrm/employee/deduction-store/', 'HrmSetsalaryController@employeededuction')->name('employeededuction.add');

    Route::get('/hrm/employee/deduction-show/{id}', 'HrmSetsalaryController@showemployeededuction')->name('employeededuction.show');

    Route::get('/hrm/deduction-delete/{id}', 'HrmSetsalaryController@deductiondelete')->name('hrmemployeededuction.delete');

    Route::get('/hrm/employee/setsalary-show/{id}', 'HrmSetsalaryController@showemployeeovertime')->name('employeesetsalary.show');

    Route::post('/hrm/employee/earning-deduction-show/', 'HrmSetsalaryController@earningDeduction')->name('earningdeduction.show');

    Route::post('/hrm/employee/earning-deduction-update/', 'HrmSetsalaryController@earningDeductionUpdate')->name('earningdeduction-update');

    Route::get('/hrm/employee-payslip', 'HrmPayslipController@index')->name('employee.payslip');

    Route::get('/hrm/generate-employee-payslip', 'HrmPayslipController@payslipDetail')->name('hrmemployee-payslip.detail');

    Route::post('/hrm/earning-edit', 'HrmSetsalaryController@earningEdit')->name('get_earning');

    Route::post('/hrm/deduction-edit', 'HrmSetsalaryController@deductionEdit')->name('get_deduction');

    Route::post('/hrm/employee/earning-update/', 'HrmSetsalaryController@employeeEarningUpdate')->name('employee_earning.update');

    Route::post('/hrm/employee/deduction-update/', 'HrmSetsalaryController@employeeDeductionUpdate')->name('employee_deduction.update');

    Route::get('/hrm/add-attendance/schedual-plan', 'HrmEmployeeAttendanceSchedualController@create')->name('schedual-plan.add');

    Route::post('/hrm/set-attendance/schedual-plan', 'HrmEmployeeAttendanceSchedualController@store')->name('schedual-plan.insert');

    Route::get('/hrm/list-attendance/schedual-plan', 'HrmEmployeeAttendanceSchedualController@index')->name('schedual-plan.list');

    Route::get('/hrm/edit-attendance/schedual-plan{id}', 'HrmEmployeeAttendanceSchedualController@edit')->name('schedual-plan.edit');

    Route::Post('/hrm/update-attendance/schedual-plan{id}', 'HrmEmployeeAttendanceSchedualController@update')->name('schedual-plan.update');

    Route::get('/hrm/all-employee-salary/list', 'HrmSetsalaryController@getAllEmployeesSalary')->name('all-employee.salary.list');

    Route::get('/hrm/payslip/view', 'HrmSetsalaryController@earningDeductionUpdate')->name('view.payslip');

    Route::get('/hrm/texcition/add', 'HrmSetsalaryController@addTaxcition')->name('add.texcition');

    Route::post('/hrm/texcition/store', 'HrmSetsalaryController@storeTaxcition')->name('store.texcition');

    Route::get('/hrm/texcition/show', 'HrmSetsalaryController@showTaxcition')->name('show.texcition')->middleware('auth');

    Route::get('/hrm/texcition/edit/{id}', 'HrmSetsalaryController@editTaxcition')->name('edit.texcition');

    Route::post('/hrm/taxcition/update/{id}', 'HrmSetsalaryController@updateTaxcition')->name('update.taxcition');

    Route::get('/hrm/taxcition/delete/{id}', 'HrmSetsalaryController@deleteTaxcition')->name('delete.taxcition');


    ///////////////////////////Designation/////////////////////////////////////////////////////

    Route::get('/designation/add-designation', 'hrmEmployeeDesignationController@create')->name('designation.add');

    Route::post('/designation/store-designation', 'hrmEmployeeDesignationController@store')->name('designation.insert');

    Route::get('/designation/list-designation', 'hrmEmployeeDesignationController@index')->name('designation.list');

    Route::get('/designation/edit/{id}', 'hrmEmployeeDesignationController@edit')->name('designation.edit');

    Route::post('/designation/update/{id}', 'hrmEmployeeDesignationController@update')->name('designation.update');

    Route::get('/designation/delete/{id}', 'hrmEmployeeDesignationController@destroy')->name('designation.delete');

    ///////////////////////Reports//////////////////////////////////////////////////////////////////////

    Route::get('/employees/list/report', 'hrmReportController@employeeListReport')->name('employee.list.report');

    Route::get('/employees/tax/report', 'hrmReportController@taxReport')->name('employee.tax.report');

    Route::get('/employees/salary/report', 'hrmReportController@salaryDetailsReport')->name('employee.salary.report');

    Route::get('/employees/benevolent/fund/report', 'hrmReportController@benevolentFundReport')->name('employee.benevolent.fund.report');

    ///////////////////////benevolent Fund/////////////////////////////

    Route::get('/hrmemployee/add-benevolent-fund', 'hrmBenevolentFundSettingController@create')->name('add.benevolent.fund');

    Route::post('/hrmemployee/store-benevolent-fund', 'hrmBenevolentFundSettingController@store')->name('benevolent.fund.insert');

    Route::get('/hrmemployee/show-benevolent-fund', 'hrmBenevolentFundSettingController@index')->name('benevolent-fund.show');

    Route::get('/hrmemployee/benevolent-fund/edit/{id}', 'hrmBenevolentFundSettingController@edit')->name('benevolent-fund.edit');

    Route::post('/hrmemployee/benevolent-fund/update/{id}', 'hrmBenevolentFundSettingController@update')->name('benevolent-fund.update');

    Route::get('/hrmemployee/benevolent-fund/delete/{id}', 'hrmBenevolentFundSettingController@destroy')->name('benevolent-fund.delete');

    Route::get('/hrm/employee/bf/status/update/', 'hrmBenevolentFundSettingController@updateStatus')->name('bf.status.update');

    //////////////////// Transper Letter/////////////////////////////////

    Route::get('/hrm/transfer/letter', 'HrmEmployeeController@gettransperLetter')->name('hrm.transper.letter');

    //////////////////// Allowances/////////////////////////////////

    Route::get('/hrmemployee/add-allowance-title', 'HrmSetsalaryController@showForm')->name('add.Allowance.title');

    Route::post('/hrmemployee/store-allowance-title', 'HrmSetsalaryController@insertAllowanceTittle')->name('Insert.Allowance.title');

    Route::get('/hrmemployee/edit-allowance-title/{id}', 'HrmSetsalaryController@edittAllowanceTittle')->name('edit.Allowance.title');

    Route::post('/hrmemployee/update-allowance-title/{id}', 'HrmSetsalaryController@updatetAllowanceTittle')->name('update.Allowance.title');

    Route::get('/hrmemployee/list-allowance-title', 'HrmSetsalaryController@getAllowanceTittle')->name('list.Allowance.title');

    Route::get('/hrmemployee/delete-allowance-title/{id}', 'HrmSetsalaryController@deleteAllowanceTittle')->name('delete.Allowance.title');

    //////////////////// Deduction /////////////////////////////////

    Route::get('/hrmemployee/add-deduction-title', 'HrmSetsalaryController@showDeductionTittleForm')->name('add.deduction.title');

    Route::post('/hrmemployee/store-deduction-title', 'HrmSetsalaryController@insertDeductionTittle')->name('Insert.deduction.title');

    Route::get('/hrmemployee/edit-deduction-title/{id}', 'HrmSetsalaryController@edittDeductionTittle')->name('edit.deduction.title');

    Route::post('/hrmemployee/update-deduction-title/{id}', 'HrmSetsalaryController@updatetDeductionTittle')->name('update.deduction.title');

    Route::get('/hrmemployee/list-deduction-title', 'HrmSetsalaryController@getDeductionTittle')->name('list.deduction.title');

    Route::get('/hrmemployee/delete-deduction-title/{id}', 'HrmSetsalaryController@deleteDeductionTittle')->name('delete.deduction.title');

    Route::post('/hrm/employee/earning-deduction-get/', 'HrmEmployeeController@earningDeductionGetByAjax')->name('earningdeduction.getByAjax');

    //////////////////// Loan ////////////////////////////////

    Route::get('/hrm/employee/add-loan', 'HrmLoanController@create')->name('add.loan');

    Route::get('/hrm/employee/list-loan', 'HrmLoanController@index')->name('list.loan');

    Route::post('/hrm/employee/store-loan', 'HrmLoanController@store')->name('store.loan');

    Route::get('/hrm/employee-loan/delete-loan/{id}', 'HrmLoanController@destroy')->name('delete.loan');

    Route::get('/hrm/employee-loan/detail-loan/{id}', 'HrmLoanController@detailsLoan')->name('detail.loan');

    Route::get('/hrm/employee/adjustment-loan/{id}', 'HrmLoanController@adjustmentLoan')->name('adjustment.loan');

    Route::post('/hrm/employee-loan/Add/adjustment-loan', 'HrmLoanController@adjustmentLoanInsert')->name('adjustment.insert.loan');

    Route::get('/hrm/employee/loan/report', 'HrmLoanController@loanReport')->name('loan.report');

    Route::get('/hrm/employee/loan/letter', 'HrmLoanController@requestLetter')->name('loan.letter');

    Route::post('/hrm/add-hrm-employee/loan/advance/document', 'HrmLoanController@documentInsert')->name('hrmemployee.loan.advance.document.insert');

    Route::get('/hrm/delete/hrm-employee/loan/advance/document/{id}', 'HrmLoanController@deleteDocument')->name('delete.document');

    Route::get('/employees/salary/for/approve', 'HrmSetsalaryController@salaryApprove')->name('employee.salary.approve');

    Route::get('/employees/pending/payroll/edit/{year}/{month}/{id}', 'HrmSetsalaryController@pendingPayrollEdit')->name('edit-pending-payroll');

    Route::post('/employees/pending/payroll/update/{id}/', 'HrmSetsalaryController@pendingPayrollUpdate')->name('update-pending-payroll');

    Route::get('/employees/pending/payroll/approved/', 'HrmSetsalaryController@pendingPayrollapproved')->name('approved-pending-payroll');

    Route::get('/employees/total/pending/payroll/', 'HrmSetsalaryController@getPendingPayroll')->name('total-pending-payroll');

    Route::get('/employees/loan/advance/receipt/{id}', 'HrmLoanController@getReceipt')->name('employee.receipt');

    Route::get('/employees/total/loan/advance', 'HrmLoanController@remaningLoanAdvance')->name('show.remaning.loan.advance');

    Route::get('/employees/loan/advance/edit/{id}/', 'HrmLoanController@edit')->name('edit.loan.advance');

    Route::post('/employees/loan/advance/update/{id}/', 'HrmLoanController@update')->name('update.loan.advance');

    Route::get('/employees/loan/advance/approved/', 'HrmLoanController@loanAdvanceApproved')->name('approved-loan-advance');

    Route::get('/hrm/employee-loan-advance/detail/{id}/{employ_id}', 'HrmLoanController@detailsLoanAdvance')->name('detail.loan.advance');

    Route::post('/hrm/employee-attendance/file/import', 'HrmAttendanceController@attendanceFileImport')->name('attendance.file.import');

    Route::post('/hrm/employee/attendance/update', 'HrmAttendanceController@attendanceEdit')->name('get_attendance');

    Route::post('/hrm/employee/attendance-update/', 'HrmAttendanceController@attendanceUpdate')->name('employee_attendance.update');

    Route::get('/hrm/employee/attendance-delete/{id}', 'HrmAttendanceController@attendanceDelete')->name('employee-attendance.delete');

    //////////////////Asset Types //////////////////////////////

    Route::get('/fixed-assets/type', ['middleware' => ['permission:fixed-asset-types'], 'uses' => 'FixedAssetTypeController@index'])->name('fixed.asset.type');

    Route::get('/fixed-assets/create', ['middleware' => ['permission:fixed-asset-types'], 'uses' => 'FixedAssetTypeController@create'])->name('create.fixed.asset.type');

    Route::post('/fixed-assets/insert', ['middleware' => ['permission:fixed-asset-types'], 'uses' => 'FixedAssetTypeController@insert'])->name('insert.fixed.asset.type');

    Route::get('/fixed-assets/delete/{id}', ['middleware' => ['permission:fixed-asset-types'], 'uses' => 'FixedAssetTypeController@destroy'])->name('delete.fixed.asset.type');

    Route::get('/fixed-assets/edit/{id}', ['middleware' => ['permission:fixed-asset-types'], 'uses' => 'FixedAssetTypeController@edit'])->name('edit.fixed.asset.type');

    Route::post('/fixed-assets/update', ['middleware' => ['permission:fixed-asset-types'], 'uses' => 'FixedAssetTypeController@update'])->name('update.fixed.asset.type');


    //////////////////Asset Location //////////////////////////////

    Route::get('/assets/locations', ['middleware' => ['permission:asset-location'], 'uses' => 'AssetLocationController@index'])->name('asset.location');

    Route::get('/asset-location/create', ['middleware' => ['permission:asset-location'], 'uses' => 'AssetLocationController@create'])->name('create.asset.location');

    Route::post('/asset-location/insert', ['middleware' => ['permission:asset-location'], 'uses' => 'AssetLocationController@insert'])->name('insert.asset.location');

    Route::get('/asset-location/delete/{id}', ['middleware' => ['permission:asset-location'], 'uses' => 'AssetLocationController@destroy'])->name('delete.asset.location');

    Route::get('/asset-location/edit/{id}', ['middleware' => ['permission:asset-location'], 'uses' => 'AssetLocationController@edit'])->name('edit.asset.location');

    Route::post('/asset-location/update', ['middleware' => ['permission:asset-location'], 'uses' => 'AssetLocationController@update'])->name('update.asset.location');

    //////////////////Asset Maintaince //////////////////////////////

    Route::get('/assets/maintainance', ['middleware' => ['permission:fixed-assets-maintainance'], 'uses' => 'AssetMaintainanceController@index'])->name('asset.maintainance');

    Route::get('/asset-maintainance/create', ['middleware' => ['permission:fixed-assets-maintainance'], 'uses' => 'AssetMaintainanceController@create'])->name('create.asset.maintainance');

    Route::post('/asset-maintainance/insert', ['middleware' => ['permission:fixed-assets-maintainance'], 'uses' => 'AssetMaintainanceController@insert'])->name('insert.asset.maintainance');

    Route::get('/asset-maintainance/delete/{id}', ['middleware' => ['permission:fixed-assets-maintainance'], 'uses' => 'AssetMaintainanceController@destroy'])->name('delete.asset.maintainance');

    Route::get('/asset-maintainance/edit/{id}', ['middleware' => ['permission:fixed-assets-maintainance'], 'uses' => 'AssetMaintainanceController@edit'])->name('edit.asset.maintainance');

    Route::post('/asset-maintainance/update', ['middleware' => ['permission:fixed-assets-maintainance'], 'uses' => 'AssetMaintainanceController@update'])->name('update.asset.maintainance');

    /////////////Store Keeper////////////////////////////


    // Route::get('/items/item-list',['middleware' =>['permission:list-item'], 'uses'=> 'ItemController@index'])->name('item.list');

    /////////////Vendors////////////////////////////

    Route::get('/vendors/add-vendor', ['middleware' => ['permission:create-vendor'], 'uses' => 'PurchaseRequestVendorController@create'])->name('vendor.add');

    Route::post('/vendors/add-vendor', ['middleware' => ['permission:create-vendor'], 'uses' => 'PurchaseRequestVendorController@store'])->name('vendor.insert');

    Route::get('/vendors/vendor-list', ['middleware' => ['permission:view-vendor'], 'uses' => 'PurchaseRequestVendorController@index'])->name('vendor.list');

    Route::delete('/vendors/delete-vendor/{id}', ['middleware' => ['permission:delete-vendor'], 'uses' => 'PurchaseRequestVendorController@destroy'])->name('vendor.delete');

    Route::get('/vendors/edit-vendor/{id}', ['middleware' => ['permission:edit-vendor'], 'uses' => 'PurchaseRequestVendorController@edit'])->name('vendor.edit');

    Route::post('/vendors/update-vendor',  ['middleware' => ['permission:edit-vendor'], 'uses' => 'PurchaseRequestVendorController@update'])->name('vendor.update');

    Route::get('/vendors/view/{id}', ['middleware' => ['permission:view-vendor'], 'uses' => 'PurchaseRequestVendorController@view'])->name('vendor.view');

    Route::get('/vendors/item-detail/vendor/{vendor_id?}/item/{item_id?}', 'PurchaseRequestVendorController@itemDetail')->name('vendor.item-detail');

    /////////////Purchase Request////////////////////////////

    Route::get('/purchase-requests/add', ['middleware' => ['permission:create-purchase-request'], 'uses' => 'PurchaseRequestController@create'])->name('purchase-requests.add');

    Route::get('/purchase-requests/add-cash', ['middleware' => ['permission:create-purchase-request'], 'uses' => 'PurchaseRequestController@createCashPr'])->name('purchase-requests.add.cash');


    Route::post('/purchase-requests/add-purchase-requests', ['middleware' => ['permission:create-purchase-request'], 'uses' => 'PurchaseRequestController@store'])->name('purchase-requests.insert');

    Route::get('/purchase-requests/list', ['middleware' => ['permission:list-purchase-request'], 'uses' => 'PurchaseRequestController@index'])->name('purchase-requests.list');


    Route::get('/purchase-requests/edit-purchase-request/{id}', ['middleware' => ['permission:edit-purchase-request'], 'uses' => 'PurchaseRequestController@edit'])->name('purchase-requests.edit');

    Route::post('/purchase-requests/update-purchase-request', ['middleware' => ['permission:edit-purchase-request'], 'uses' => 'PurchaseRequestController@update'])->name('purchase-requests.update');
    Route::delete('/purchase-requests/delete-purchase-requests/{id}', ['middleware' => ['permission:delete-purchase-request'], 'uses' => 'PurchaseRequestController@destroy'])->name('purchase-requests.delete');

    // Route::get('/purchase-requests/delete-purchase-requests/{id}',['middleware' =>['permission:delete-purchase-request'], 'uses'=> 'PurchaseRequestController@destroy'])->name('purchase-requests.delete');

    Route::get('/purchase-requests/view/{id}', ['middleware' => ['permission:view-purchase-request'], 'uses' => 'PurchaseRequestController@view'])->name('purchase-requests.view');

    Route::get('/get-dynamic-item/list', 'PurchaseRequestController@fetchNewItems')->name('get-dynamic-items.fetch');

    Route::get('/purchase-requests/pr-list', ['middleware' => ['permission:list-purchase-request'], 'uses' => 'PurchaseRequestController@detail'])->name('purchase-requests.detail');

    Route::post('/purchase-requests/get-department', 'PurchaseRequestController@getDepartment')->name('purchase-requests.get-department');

    Route::post('/purchase-requests/get-prs', 'PurchaseRequestController@getPr')->name('purchase-requests.get');

    Route::get('/purchase-requests/print-approval/{view}/user/{user}', ['middleware' => ['permission:view-purchase-request'], 'uses' => 'PurchaseRequestController@print'])->name('purchase-requests.print');

    Route::post('/purchase-requests/add-person', 'PurchaseRequestController@addPerson')->name('purchase-requests.add-person');

    Route::post('/purchase-requests/get-item-latest-price', 'PurchaseRequestController@getItemLatestPrice')->name('purchase-requests.get-item-latest-price');


    Route::post('/purchase-requests/get-latest-pr-for-approval', 'PurchaseRequestController@getLatestPrForApproval')->name('purchase-requests.get-latest-pr-for-approval');


    Route::post('/purchase-requests/return-or-relese-mir', 'PurchaseRequestController@getRelseasOrReturnMir')->name('purchase-requests.return.or.reles.mir');

    ///////////////MIR/////////////////////////////////////////////

    Route::get('/material-issue-request/list', ['middleware' => ['permission:mir'], 'uses' => 'MaterialIssueRequestController@index'])->name('material.issue.request.list');

    Route::post('/material-issue-request/create', ['middleware' => ['permission:mir'], 'uses' => 'MaterialIssueRequestController@requesting'])->name('material.issue.request.create');

    Route::delete('/material-issue-request/delete/{id}', ['middleware' => ['permission:mir'], 'uses' => 'MaterialIssueRequestController@destroy'])->name('mir.delete');

    // Route::get('/material-issue-request/delete/{id}',['middleware' =>['permission:mir'], 'uses'=> 'MaterialIssueRequestController@destroy'])->name('mir.delete');

    Route::post('/material-issue-request/get-item', ['middleware' => ['permission:store-keeper'], 'uses' => 'MaterialIssueRequestController@getMirItem'])->name('mir.get-item');

    Route::get('/material-issue-request/approve/{id}', ['middleware' => ['permission:mir'], 'uses' => 'MaterialIssueRequestController@approveMir'])->name('material.issue.request.approve');

    Route::get('/material-issue-request/cancel/{id}', ['middleware' => ['permission:mir'], 'uses' => 'MaterialIssueRequestController@cancelMir'])->name('material.issue.request.cancel');


    /////////////////////////////STORE KEEPER/////////////////////////////////////////////

    Route::get('/store-keeper/dashboard', ['middleware' => ['permission:store-keeper'], 'uses' => 'StoreKeeperController@index'])->name('manage.store.keeper.dashboard');

    Route::get('/store-keeper/purchase-order', ['middleware' => ['permission:store-keeper'], 'uses' => 'StoreKeeperController@purchaseOrder'])->name('store.keeper.purchase.order');

    /////////////////request-for-quotations statement///////////////////////////////////



    Route::post('/request-for-quotations/send-rfq', ['middleware' => ['permission:send-request-for-quotation'], 'uses' =>  'RequestForQuotationController@sendRfq'])->name('request-for-quotations.sendRfq');

    Route::get('/request-for-quotations/rfq', ['middleware' => ['permission:list-request-for-quotation'], 'uses' =>  'RequestForQuotationController@detail'])->name('request-for-quotations.getRfq');

    Route::get('/request-for-quotations/view/{id}', ['middleware' => ['permission:view-request-for-quotation'], 'uses' =>   'RequestForQuotationController@view'])->name('request-for-quotations.view');

    Route::get('/request-for-quotations/detail', ['middleware' => ['permission:list-request-for-quotation'], 'uses' =>  'RequestForQuotationController@detail'])->name('request-for-quotations.detail');

    Route::get('/request-for-quotations/list', ['middleware' => ['permission:list-request-for-quotation'], 'uses' =>  'RequestForQuotationController@index'])->name('request-for-quotations.list');

    Route::post('/request-for-quotations/change-date',  ['middleware' => ['permission:edit-request-for-quotation'], 'uses' =>  'RequestForQuotationController@changeDate'])->name('request-for-quotations.change-date');

    Route::post('/request-for-quotations/get-vendor-for-rfq', 'RequestForQuotationController@getVendorForRfq')->name('request-for-quotations.get-vendor-for-rfq');

    Route::get('/request-for-quotations/all', ['middleware' => ['permission:list-request-for-quotation'], 'uses' =>  'RequestForQuotationController@all'])->name('request-for-quotations.all');

    Route::get('/request-for-quotations/delete-cs-docs/{id}', ['middleware' => ['permission:list-request-for-quotation'], 'uses' =>  'RequestForQuotationController@deleteCsDocument'])->name('delete.cs.docs');

    /////////////////Comparative statement/////////////////////////////////////////


    Route::post('/comparative-statements/cs', ['middleware' => ['permission:send-comparative-statement'], 'uses' =>  'ComparativeStatementController@send'])->name('comparative-statements.send');

    Route::get('/comparative-statements/view/{id}', ['middleware' => ['permission:view-comparative-statement'], 'uses' => 'ComparativeStatementController@view'])->name('comparative-statements.view');

    Route::get('/comparative-statements-view/approval-pending/{id?}', ['middleware' => ['permission:approval-pending-comparative-statement'], 'uses' => 'ComparativeStatementController@comparativeStatementViewApprovalPending'])->name('comparative-statements-view-approval-pending');

    Route::get('/comparative-statements/detail', ['middleware' => ['permission:list-comparative-statement'], 'uses' => 'ComparativeStatementController@detail'])->name('comparative-statements.detail');

    Route::get('/comparative-statements/list', ['middleware' => ['permission:list-comparative-statement'], 'uses' => 'ComparativeStatementController@index'])->name('comparative-statements.list');

    /////////////////purchase-orders statement/////////////////////////////////////////


    Route::post('/purchase-orders/create', ['middleware' => ['permission:create-purchase-order'], 'uses' => 'PurchaseOrderController@create'])->name('purchase-orders.create');

    Route::post('/purchase-orders/register-vendor', ['middleware' => ['permission:create-purchase-order'], 'uses' =>  'PurchaseOrderController@registerNewVendorAndSendRfq'])->name('purchase-orders.register-vendor');

    Route::get('/purchase-orders/view/{id}', ['middleware' => ['permission:view-purchase-order'], 'uses' =>  'PurchaseOrderController@view'])->name('purchase-orders.view');

    Route::get('/purchase-orders/detail', ['middleware' => ['permission:list-purchase-order|store-keeper'], 'uses' =>  'PurchaseOrderController@detail'])->name('purchase-orders.detail');

    Route::post('/purchase-orders/validate', ['middleware' => ['permission:create-purchase-order|store-keeper'], 'uses' =>  'PurchaseOrderController@validatePurchaseOrder'])->name('purchase-orders.validate');

    Route::post('/purchase-orders/remaining-po-qty', ['middleware' => ['permission:create-purchase-order|store-keeper'], 'uses' =>  'PurchaseOrderController@validateRemainingPurchaseOrder'])->name('purchase-orders.validate-remaining-po-qty');

    Route::get('/purchase-orders/list', ['middleware' => ['permission:list-purchase-order'], 'uses' =>  'PurchaseOrderController@index'])->name('purchase-orders.list');

    Route::get('/purchase-orders/cancel', ['middleware' => ['permission:delete-purchase-order'], 'uses' =>  'PurchaseOrderController@cancelPurchaseOrder'])->name('purchase-orders.cancel');

    Route::get('/purchase-orders/vendor', ['middleware' => ['permission:list-purchase-order'], 'uses' =>  'PurchaseOrderController@vendorPurchaseOrder'])->name('purchase-orders.vendor');

    Route::get('/purchase-orders/all', ['middleware' => ['permission:list-purchase-order'], 'uses' =>  'PurchaseOrderController@listPurchaseOrder'])->name('purchase-orders.lists');

    Route::post('/purchase-orders/quanlity-test', 'PurchaseOrderController@quanlityTest')->name('purchase-orders.quanlity-test');

    Route::post('/purchase-orders/upload-quanlity-test-docs', 'PurchaseOrderController@uploadQuanlityTestDocs')->name('purchase-orders.upload-quanlity-test-docs');

    Route::post('/purchase-orders/add_mir_details', 'PurchaseOrderController@addMirDetail')->name('purchase-orders.add_mir_details');

    Route::post('/purchase-orders/add_cs_officers', 'PurchaseOrderController@add_cs_officers')->name('purchase-orders.add_cs_officers');

    Route::post('/purchase-orders/update_po_description', 'PurchaseOrderController@update_po_description')->name('purchase-orders.update_po_description');

    Route::post('/purchase-orders/get-latest-po-for-approval', 'PurchaseRequestController@getLatestCSForApproval')->name('purchase-orders.get-latest-po-for-approval');

    /////////////////Receipts /////////////////////////////////////////


    Route::get('/purchase-order-receipts/view/{id}', ['middleware' => ['permission:view-po-receipt'], 'uses' =>  'PurchaseOrderReceiptController@view'])->name('purchase-order-receipts.view');

    Route::get('/purchase-order-receipts/detail', ['middleware' => ['permission:list-po-receipt'], 'uses' => 'PurchaseOrderReceiptController@detail'])->name('purchase-order-receipts.detail');

    Route::post('/purchase-order-receipts/pay', ['middleware' => ['permission:pay-po-receipt'], 'uses' => 'PurchaseOrderReceiptController@payReceipt'])->name('purchase-order-receipts.pay');

    Route::get('/purchase-order-receipts/list', ['middleware' => ['permission:list-po-receipt'], 'uses' => 'PurchaseOrderReceiptController@index'])->name('purchase-order-receipts.list');

    Route::get('/purchase-order-receipts/vendor', ['middleware' => ['permission:list-po-receipt'], 'uses' => 'PurchaseOrderReceiptController@vendorReceipt'])->name('purchase-order-receipts.vendor');

    Route::get('/purchase-order-receipts/all', ['middleware' => ['permission:list-po-receipt'], 'uses' => 'PurchaseOrderReceiptController@listReceipt'])->name('purchase-order-receipts.lists');

    Route::post('/purchase-orders-receipts/add_account_officer', 'PurchaseOrderReceiptController@add_account_officer')->name('purchase-orders-receipts.add_account_officer');

    /////////////////////////////////////////////////////////////////

});


//procurment--routes//
Route::middleware(['auth', CheckProjectType::class,CheckProjectExistence::class])->group(function () {

    Route::get('/dashboard/{id}', 'PurchaseRequestController@notify')->name('dashboard1');

    Route::get('/pr-approval-pending/{id}', 'PurchaseRequestController@prApprovalPending')->name('pr-approval-pending');

    Route::get('/cs-approval-pending/{id}', 'PurchaseRequestController@csApprovalPending')->name('cs-approval-pending');

    Route::post('purchase-request-approvals', 'PurchaseRequestController@changeStatus')->name('purchase-request-approvals.changeStatus');

    Route::post('purchase-order-approvals', 'PurchaseRequestController@changeCsStatus')->name('purchase-order-approvals.change-cs-status');

    //////////////////Item Manufacture //////////////////////////////


    Route::get('/items/item-manufacture-list', ['middleware' => ['permission:item-manufacture'], 'uses' => 'ItemManufactureController@index'])->name('item.manufacture.list');

    Route::get('/items/create-manufacture', ['middleware' => ['permission:create-item-manufacture'], 'uses' => 'ItemManufactureController@create'])->name('create.manufacture');

    Route::post('/items/insert-manufacture', ['middleware' => ['permission:create-item-manufacture'], 'uses' => 'ItemManufactureController@insert'])->name('insert.manufacture');
    Route::delete('/items/delete-manufacture/{id}', ['middleware' => ['permission:delete-item-manufacture'], 'uses' => 'ItemManufactureController@destroy'])->name('delete.manufacture');

    // Route::get('/items/delete-manufacture/{id}',['middleware' =>['permission:delete-item-manufacture'], 'uses'=> 'ItemManufactureController@destroy'])->name('delete.manufacture');

    Route::get('/items/edit-manufacture/{id}', ['middleware' => ['permission:edit-item-manufacture'], 'uses' => 'ItemManufactureController@edit'])->name('edit.manufacture');

    Route::post('/items/update-manufacture', ['middleware' => ['permission:edit-item-manufacture'], 'uses' => 'ItemManufactureController@update'])->name('update.manufacture');



    //////////////////Item Unit //////////////////////////////

    Route::get('/items/unit-list', ['middleware' => ['permission:item-unit'], 'uses' => 'ItemUnitController@index'])->name('item.unit.list');

    Route::get('/items/create-unit', ['middleware' => ['permission:item-unit'], 'uses' => 'ItemUnitController@create'])->name('create.item.unit');

    Route::post('/items/insert-unit', ['middleware' => ['permission:item-unit'], 'uses' => 'ItemUnitController@insert'])->name('insert.item.unit');

    // Route::get('/items/delete-unit/{id}',['middleware' =>['permission:item-unit'], 'uses'=> 'ItemUnitController@destroy'])->name('delete.unit');
    Route::delete('/items/delete-unit/{id}', ['middleware' => ['permission:item-unit'], 'uses' => 'ItemUnitController@destroy'])->name('delete.unit');

    Route::get('/items/edit-unit/{id}', ['middleware' => ['permission:item-unit'], 'uses' => 'ItemUnitController@edit'])->name('edit.unit');

    Route::post('/items/update-unit', ['middleware' => ['permission:item-unit'], 'uses' => 'ItemUnitController@update'])->name('update.unit');


    ////////////////////////////Work Order Routes/////////////////////////////////

    Route::get('/work-order/dashboard', ['middleware' => ['permission:work-order'], 'uses' => 'TaskController@viewWorkOrder'])->name('work-order.gannt-chart');

    Route::get('/work-order/create', ['middleware' => ['permission:work-order'], 'uses' => 'TaskController@create'])->name('work-order.create');

    Route::post('/work-order/store', ['middleware' => ['permission:work-order'], 'uses' => 'TaskController@store'])->name('store.work-order');

    Route::get('/work-order/list', ['middleware' => ['permission:work-order'], 'uses' => 'TaskController@index'])->name('work-order.list');

    Route::get('/work-order/edit/{id}', ['middleware' => ['permission:work-order'], 'uses' => 'TaskController@edit'])->name('work-order.edit');

    Route::post('/work-order/update', ['middleware' => ['permission:work-order'], 'uses' => 'TaskController@update'])->name('update.work-order');

    // Route::get('/work-order/delete/{id}',['middleware' =>['permission:work-order'], 'uses'=> 'TaskController@destroy'])->name('work-order.delete');
    Route::delete('/work-order/delete/{id}', ['middleware' => ['permission:work-order'], 'uses' => 'TaskController@destroy'])->name('work-order.delete');

    Route::get('/work-order/boq/view', ['middleware' => ['permission:work-order'], 'uses' => 'TaskController@boqView'])->name('work-order.boq.view');
});
/////////////////////Purchase Request Boq Quantity Valid////////////////////////

Route::get('/purchase-requests/search', 'PurchaseRequestController@search')->name('purchase-requests.search');

Route::get('/purchase-requests/get-vendor-items', 'PurchaseRequestController@getVendorItems')->name('purchase-requests.getVendorItems');

//////////////CUSTOMER DISCOUNT PAYMENT/////////////////////////////

// Route::get('/customer-discount-payment/all',['middleware' =>['permission:view-customer-discount-payment'], 'uses'=> 'PaymentController@getAllPayments'])->name('customer-payment.all');

// Route::get('/add/customer-discount-payment',['middleware' =>['permission:create-customer-discount-payment'], 'uses'=> 'PaymentController@addPaymentForm'])->name('customer-payment.addView');

// Route::get('/add/customer-discount-payment/update-properties','PaymentController@updatePropertyForm');

// Route::post('/add/customer-discount-payment',['middleware' =>['permission:create-customer-discount-payment'], 'uses'=> 'PaymentController@insertPayment'])->name('customer-payment.insert');

// Route::get('/customer-discount-payment/view/{id}',['middleware' =>['permission:view-customer-discount-payment'], 'uses'=> 'PaymentController@detailPayment'])->name('customer-payment.detail');

// Route::get('/customer-discount-payment/edit/{id}',['middleware' =>['permission:edit-customer-discount-payment'], 'uses'=> 'PaymentController@editPaymentForm'])->name('customer-payment.editView');

// Route::post('/customer-discount-payment/edit',['middleware' =>['permission:edit-customer-discount-payment'], 'uses'=> 'PaymentController@updatePayment'])->name('customer-payment.update');

// Route::get('/customer-discount-payment/delete/{id}',['middleware' =>['permission:delete-customer-discount-payment'], 'uses'=> 'PaymentController@deletePayment'])->name('customer-payment.delete');


//////////////////////ACCOUNT Pendings //////////////////////////////
Route::middleware(['auth', CheckProjectType::class,CheckProjectExistence::class])->group(function () {
    Route::get('/accounts/customer-vouchers', ['middleware' => ['permission:manage-customer-voucher'], 'uses' => 'GeneralJournalEntryController@getCustomerVouchers'])->name('customer-vouchers');

    Route::get('/accounts/vendor-vouchers', ['middleware' => ['permission:manage-vendor-voucher'], 'uses' => 'GeneralJournalEntryController@getVendorVouchers'])->name('vendor-vouchers');

    Route::get('/accounts/dealer-vouchers', ['middleware' => ['permission:manage-dealer-voucher'], 'uses' => 'GeneralJournalEntryController@getDealerVouchers'])->name('dealer-vouchers');

    Route::get('/accounts/employee-vouchers', ['middleware' => ['permission:manage-employee-voucher'], 'uses' => 'GeneralJournalEntryController@getEmployeeVouchers'])->name('employee-vouchers');

    Route::get('/pending-receipts/detail/{id}', ['middleware' => ['permission:manage-customer-voucher'], 'uses' => 'GeneralJournalEntryController@getReceiptDetail'])->name('pending-receipts.detail');

    Route::get('/pending-customer-tax-receipts/detail/{id}', ['middleware' => ['permission:manage-customer-voucher'], 'uses' => 'GeneralJournalEntryController@getCustomerTaxReceiptDetail'])->name('pending-customer-tax-receipts.detail');

    Route::get('/pending-bills/detail/{id}', ['middleware' => ['permission:manage-vendor-voucher'], 'uses' => 'GeneralJournalEntryController@getBillDetail'])->name('pending-bills.detail');

    Route::get('/pending-procurement-bills/detail/{id}', ['middleware' => ['permission:manage-vendor-voucher'], 'uses' => 'GeneralJournalEntryController@getProcurementBillDetail'])->name('pending-procurement-bills.detail');

    Route::post('/general-journal-entries/create-voucher', ['middleware' => ['permission:create-voucher'], 'uses' => 'GeneralJournalEntryController@createVoucherForm'])->name('create-voucher');

    Route::get('/general-journal-entries/create-reversal-voucher/{entry_no}', ['middleware' => ['permission:reversal-voucher'], 'uses' => 'GeneralJournalEntryController@createReversalVoucherForm'])->name('create-reversal-voucher');

    Route::post('/general-journal-entries/create-vouchers', ['middleware' => ['permission:create-voucher'], 'uses' => 'GeneralJournalEntryController@createVoucher'])->name('create-voucher.submit');

    Route::get('/general-journal-entries/voucher-detail/{id}', ['middleware' => ['permission:view-voucher'], 'uses' => 'GeneralJournalEntryController@voucherDetail'])->name('voucher-detail');

    Route::get('/general-journal-entries/voucher-delete/{id}', ['middleware' => ['permission:delete-voucher'], 'uses' => 'GeneralJournalEntryController@voucherDelete'])->name('voucher-delete');

    Route::get('/general-journal-entries/voucher-edit/{id}', ['middleware' => ['permission:edit-voucher'], 'uses' => 'GeneralJournalEntryController@voucherEdit'])->name('voucher-edit');

    Route::post('/general-journal-entries/update-vouchers', ['middleware' => ['permission:create-voucher'], 'uses' => 'GeneralJournalEntryController@UpdateVoucher'])->name('update-voucher.submit');

    Route::get('/general-journal-entries/voucher-check/{id}', ['middleware' => ['permission:voucher-check'], 'uses' => 'GeneralJournalEntryController@voucherChecked'])->name('voucher-check');

    Route::get('/general-journal-entries/voucher-post/{id}', ['middleware' => ['permission:voucher-post'], 'uses' => 'GeneralJournalEntryController@voucherPosted'])->name('voucher-post');

    Route::get('/general-journal-entries/add-bill', ['middleware' => ['permission:create-voucher'], 'uses' => 'GeneralJournalEntryController@addBillForm'])->name('add-bill-form');

    Route::post('/general-journal-entries/create-bill', ['middleware' => ['permission:create-voucher'], 'uses' => 'GeneralJournalEntryController@createBill'])->name('create-bill');

    Route::get('/account-dashboard', ['middleware' => ['permission:manage-account-dashboard'], 'uses' => 'ChartOfAccountController@dashboard'])->name('account-dashboard');

    Route::post('/closing-report', ['middleware' => ['permission:manage-account-dashboard'], 'uses' => 'ChartOfAccountController@getClosingReport'])->name('account-closing-report');

    Route::get('/update-account-detail', ['middleware' => ['permission:view-chart-of-account'], 'uses' => 'ChartOfAccountController@updateDetailAccount']);

    Route::get('/update-control-account-detail', ['middleware' => ['permission:view-chart-of-account'], 'uses' => 'ControlAccountController@updateDetailControlAccount']);
    Route::get('get-certificate-details', 'ControlAccountController@getCertificateDetail')
        ->name('get-certificate-details');

    Route::post('certificate-detail/add', 'ControlAccountController@insertVendorCertificate')
        ->name('certificate-detail.add');

    Route::get('get-certificate-detail/{id}', 'ControlAccountController@getVendorCertificateDetail')
        ->name('get-certificate-detail');




    Route::get('dashboard-sales', function () {
        return view('dashboard-sales');
    });
    Route::get('overall', function () {
        return view('overall');
    });

    Route::post('customer-tax-paid', 'CustomerController@taxPaid')->name('customer.tax.paid');

    Route::post('customer-tax-amount-paid', 'CustomerController@taxAmountPaid')->name('customer.tax.amount.paid');

    ////////////////////unit Block CONTROLLER////////////////////////////////////////

    Route::get('/unit-block/all', ['middleware' => ['permission:view-unit-size'], 'uses' =>  'UnitBlockController@allUnitBlocks'])->name('unit.block.all');

    Route::get('/unit-block/add', ['middleware' => ['permission:create-unit-size'], 'uses' => 'UnitBlockController@addUnitBlockForm'])->name('unit.block.addView');

    Route::post('/unit-block/add', ['middleware' => ['permission:create-unit-size'], 'uses' => 'UnitBlockController@insertUnitBlock'])->name('unit.block.insert');

    Route::get('/unit-block/view/{id}', ['middleware' => ['permission:view-unit-size'], 'uses' => 'UnitBlockController@detailUnitBlock'])->name('unit.block.detail');

    Route::get('/unit-block/edit/{id}', ['middleware' => ['permission:edit-unit-size'], 'uses' => 'UnitBlockController@editUnitBlockForm'])->name('unit.block.editView');

    Route::post('/unit-block/edit', ['middleware' => ['permission:edit-unit-size'], 'uses' => 'UnitBlockController@updateUnitBlock'])->name('unit.block.update');

    Route::get('/unit-block/delete/{id}', ['middleware' => ['permission:delete-unit-size'], 'uses' => 'UnitBlockController@deleteUnitBlock'])->name('unit.block.delete');


    //Approve All Receipts

    Route::get('/receipt/approve-all', 'CustomerStatementController@approveAllReceipt')->name('receipt.approve.all');

    Route::get('/validate/receipt/amount', 'CustomerStatementController@validateReceiptAmount')->name('validate.receipt.amount');

    Route::get('/get/payment_head/amount', 'CustomerStatementController@getPaymentHeadAmount')->name('get.paymenthead.amount');

    Route::get('/get/edit_payment_head/amount', 'CustomerStatementController@editGetPaymentHeadAmount')->name('get.editpaymenthead.amount');

   

    Route::get('/purchase-order/payment', 'CustomerStatementController@getPurchaseOrderPayment')->name('purchase-order.payment');

    Route::get('/unit-token', 'CustomerStatementController@getUnitToken')->name('unit.token');


    Route::get('/validate/purchase-order/amount', 'CustomerStatementController@validatePurchaseOrderAmount')->name('validate.purchase-order.amount');


    Route::get('/customer/receipt/delete/{id}', 'CustomerController@deleteCustomerReceipt')->name('customer.receipt.delete');

    //Token Receipt

    Route::get('/add/token/receipt', 'CustomerStatementController@addTokenReceiptForm')->name('token.receipt.addView');

    Route::post('/insert/token/receipt', 'CustomerStatementController@insertTokenReceipt')->name('insert.token.receipt');

    Route::get('/add/token/receipt/update-properties', 'CustomerStatementController@updateTokenPropertyForm');

    Route::get('/token/receipt/all', 'CustomerStatementController@getTokenReceipts')->name('token.receipt.all');

    Route::get('/token/receipt/view/{id}', 'CustomerStatementController@detailTokenReceipt')->name('token.receipt.detail');

    Route::get('/token/receipt/delete/{id}', 'CustomerStatementController@deleteTokenReceipt')->name('token.receipt.delete');

    Route::get('/token/receipt/pendings', 'CustomerStatementController@getTokenPendingReceipts')->name('token.receipt.pending');

    Route::get('/token/receipt/approved/{id}', 'CustomerStatementController@approvedTokenReceipt')->name('token.receipt.approved');

    Route::get('/token/receipt/approved-all', 'CustomerStatementController@approvedAllTokenReceipt')->name('all.tokenreceipt.approved');

    Route::get('/token/receipt/updateTable', 'CustomerStatementController@updateTokenReceiptTable');

    Route::get('/refend-token', 'CustomerStatementController@getAllRefendToken')->name('refend.token');

    Route::get('/refend-token/add', 'CustomerStatementController@getRefendTokenForm')->name('token.refend.add');

    Route::post('/refend-token/status', 'CustomerStatementController@refendTokenStatus')->name('token.refend.status');

    Route::get('/pending-token-receipts/detail/{id}', ['middleware' => ['permission:manage-customer-voucher'], 'uses' => 'GeneralJournalEntryController@getTokenReceiptDetail'])->name('pending-token-receipts.detail');

    Route::get('/pending-refund-token-receipts/detail/{id}', ['middleware' => ['permission:manage-customer-voucher'], 'uses' => 'GeneralJournalEntryController@getRefundTokenReceiptDetail'])->name('pending-refund-token-receipts.detail');

    ///////////////////////////////Merging Section Routes///////////////////////////////////////////////////////////


    Route::get('/merging-properties/add-requisition', ['middleware' => ['permission:merging-properties-requisition'], 'uses' => 'MergingPropertyController@addRequisition'])->name('merging.properties.requisition');

    Route::post('/merging-properties/add-requisition', ['middleware' => ['permission:merging-properties-requisition'], 'uses' => 'MergingPropertyController@insertRequisition']);

    Route::get('/merging-properties/list-requisition', ['middleware' => ['permission:merging-properties-requisition'], 'uses' => 'MergingPropertyController@indexRequisition'])->name('merging.properties.list.requisition');

    Route::get('/merging-properties-requisition/form/{id}', ['middleware' => ['permission:merging-properties-requisition'], 'uses' => 'MergingPropertyController@formRequisition'])->name('merging.properties.form.requisition');

    Route::get('/merging-properties/get-requisition', ['middleware' => ['permission:merging-properties-requisition'], 'uses' => 'MergingPropertyController@getRequitionData'])->name('get.requisition');


    Route::get('/merging-properties/add', ['middleware' => ['permission:merging-properties'], 'uses' => 'MergingPropertyController@add'])->name('merging.properties');

    Route::post('/merging-properties/add', ['middleware' => ['permission:merging-properties'], 'uses' => 'MergingPropertyController@insert']);

    Route::get('/merging-properties/list', ['middleware' => ['permission:merging-properties'], 'uses' => 'MergingPropertyController@index'])->name('merging.properties.list');

    Route::get('/merging-properties/property-list', ['middleware' => ['permission:merging-properties'], 'uses' => 'MergingPropertyController@indexMergingProperty'])->name('merging.property.list');

    Route::get('/merging-properties/form/{id}', ['middleware' => ['permission:merging-properties'], 'uses' => 'MergingPropertyController@form'])->name('merging.properties.form');

    Route::get('/merging-properties/pending-approval', ['middleware' => ['permission:merging-properties-approval'], 'uses' => 'MergingPropertyController@pendingApproval'])->name('merging.properties.pending.approval');

    Route::get('/merging-properties/pending-approval/{id}', ['middleware' => ['permission:merging-properties-approval'], 'uses' => 'MergingPropertyController@pendingApprovalStatus'])->name('pending.approval');


    // /////////////// buy back section////////////////////////////////

    Route::get('/buy-back/add-requisition', ['middleware' => ['permission:buy-back-requisition'], 'uses' => 'BuyBackController@addBuyBack'])->name('buy.back.requisition');
    Route::post('/buy-back/add-requisition', ['middleware' => ['permission:buy-back-requisition'], 'uses' => 'BuyBackController@insertBuyBack']);
    Route::get('/buy-back/list-requisition', ['middleware' => ['permission:buy-back-requisition'], 'uses' => 'BuyBackController@indexBuyBack'])->name('buy.back.list.requisition');

    Route::get('/buy-back-requisition/form/{id}', ['middleware' => ['permission:buy-back-requisition'], 'uses' => 'BuyBackController@formBuyBack'])->name('buy.back.form.requisition');


    Route::get('/buy-back/pending-approval', ['middleware' => ['permission:buy-back-approval'], 'uses' => 'BuyBackController@pendingApproval'])->name('buy.back.pending.approval.tab');
    Route::get('/buy-back/pending-approval/{id}', ['middleware' => ['permission:buy-back-approval'], 'uses' => 'BuyBackController@pendingApprovalStatus'])->name('buy.back.pending.approval');


    Route::get('/buy-back/add', ['middleware' => ['permission:buyback-properties'], 'uses' => 'BuyBackController@add'])->name('buy.back.properties');

    Route::post('/buy-back/add', ['middleware' => ['permission:buyback-properties'], 'uses' => 'BuyBackController@insert']);

    Route::get('/buy-back/list', ['middleware' => ['permission:buyback-properties'], 'uses' => 'BuyBackController@index'])->name('buy.back.properties.list');

    Route::get('/buy-back/form/{id}', ['middleware' => ['permission:buyback-properties'], 'uses' => 'BuyBackController@form'])->name('buy.back.properties.form');

    Route::get('/getBBRequisiData', 'BuyBackController@getBBRequisiData')->name('getBBRequisiData');


    Route::get('/buy-back/add-payment', ['middleware' => ['permission:buyback-payment'], 'uses' => 'BuyBackController@addPayment'])->name('buy.back.payment');

    Route::post('/buy-back/add-payment', ['middleware' => ['permission:buyback-payment'], 'uses' => 'BuyBackController@insertPayment']);

    Route::get('/buy-back/list-payment', ['middleware' => ['permission:buyback-payment'], 'uses' => 'BuyBackController@indexPayment'])->name('buy.back.payment.list');

    Route::get('/buy-back/form-payment/{id}', ['middleware' => ['permission:buyback-payment'], 'uses' => 'BuyBackController@formPayment'])->name('buy.back.payment.form');
});
///////////////////Reset DataBase ////////////////////////////////////
Route::prefix('reset-database')->middleware(['auth', 'password.confirm', 'role:admin'])->group(function () {

    Route::get('/', ['uses' => 'ResetDatabaseController@restDataBase'])->name('reset.database');
    Route::post('/update', ['uses' => 'ResetDatabaseController@postRestDataBase'])->name('reset.database.update');
    Route::post('/download', ['uses' => 'ResetDatabaseController@postDownloadDataBase'])->name('reset.database.download');
});



Route::prefix('noc')->middleware(['auth', CheckProjectType::class,CheckProjectExistence::class])->group(function () {

    Route::get('/', ['middleware' => ['permission:view-noc'], 'uses' => 'NOCController@index'])->name('noc_req');
    Route::get('/add',['middleware' => ['permission:create-noc'], 'uses' => 'NOCController@create'])->name('noc_add');
    Route::get('/getcustomerinfo',['middleware' => ['permission:create-noc'],'uses' =>  'NOCController@getCustomerInfo'])->name('noc_cus_info');
    Route::get('/getunitinfo',['middleware' => ['permission:create-noc'],'uses' => 'NOCController@getUnitInfo'])->name('noc_unit_info');
    Route::post('/insert', ['middleware' => ['permission:create-noc'], 'uses' => 'NOCController@store'])->name('noc.insert');
    Route::delete('/delete/{id}', ['middleware' => ['permission:delete-noc'], 'uses' => 'NOCController@destroy'])->name('noc.delete');
    Route::get('/edit/{id}', ['middleware' => ['permission:edit-noc'], 'uses' => 'NOCController@edit'])->name('noc.edit');
    Route::put('/update', ['middleware' => ['permission:edit-noc'], 'uses' => 'NOCController@update'])->name('noc.update');
    Route::get('/download/{id}', ['middleware' => ['permission:download-noc'], 'uses' => 'NOCController@downloadNOC'])->name('noc.download');
    Route::get('/approve/download/{id}', ['middleware' => ['permission:download-noc'], 'uses' => 'NOCController@approvedownloadNOC'])->name('noc.approvedownload');
});

 
 

Route::prefix('package')->middleware(['auth', CheckProjectType::class,CheckProjectExistence::class])->group(function () {

   
    // Route::get('/', ['middleware' => ['custom-entrust:view-package'], 'uses' => 'PackageController@index'])->name('packge.index');
  
  
    Route::get('/', ['middleware' => ['permission:view-package'], 'uses' => 'PackageController@index'])->name('packge.index');
  
    Route::get('/create', ['middleware' => ['permission:create-package'], 'uses' => 'PackageController@create'])->name('packge.create');
    Route::post('/store', ['middleware' => ['permission:create-package'], 'uses' => 'PackageController@store'])->name('packge.store');
    Route::get('/getPrice', ['middleware' => ['permission:create-package'], 'uses' => 'PackageController@getDownPayment']);
    Route::delete('/delete/{id}', ['middleware' => ['permission:delete-package'], 'uses' => 'PackageController@destroy'])->name('packge.delete');
    Route::get('/view/{id}', ['middleware' => ['permission:create-package'], 'uses' => 'PackageController@show'])->name('packge.detail');
});





Route::prefix('pricelist')->middleware(['auth', CheckProjectType::class,CheckProjectExistence::class])->group(function () {
    Route::get('/', ['middleware' => ['permission:view-pricelist'], 'uses' => 'PriceListController@index'])->name('pricelist.index');
    Route::get('/create', ['middleware' => ['permission:create-pricelist'], 'uses' => 'PriceListController@create'])->name('pricelist.create');
    Route::post('/store', ['middleware' => ['permission:create-pricelist'], 'uses' => 'PriceListController@store'])->name('pricelist.store');
    Route::delete('/delete/{id}', ['middleware' => ['permission:delete-pricelist'], 'uses' => 'PriceListController@destroy'])->name('pricelist.delete');
    Route::get('/edit/{id}', ['middleware' => ['permission:edit-pricelist'], 'uses' => 'PriceListController@edit'])->name('pricelist.edit');
    Route::post('/edit', ['middleware' => ['permission:edit-pricelist'], 'uses' => 'PriceListController@update'])->name('pricelist.update');

    Route::get('/view/{id}', ['middleware' => ['permission:view-pricelist'], 'uses' => 'PriceListController@show'])->name('pricelist.view');






    // edit-pricelist 
});
Route::prefix('import-legacy-data')->middleware(['auth', CheckProjectType::class,CheckProjectExistence::class])->group(function () {
    Route::get('/', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@importDataType'])->name('importdata.chartofaccount');
   
    Route::get('/account-type', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@importAccountType'])->name('importdata.accounttype');
   
    Route::post('/account-type', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@submitImportAccountType'])->name('importdata.store.accounttype');
   
    Route::get('/account-type-formate', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@downloadAccountTypeFormate'])->name('importdata.accounttype-formate');
   
    Route::get('/charts-account-type-formate', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@downloadChartsOfAccountFormate'])->name('importdata.chartaccount-format');
   
    Route::get('/charts-of-accounts', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@importChartOfAccount'])->name('importdata.chartsofaccount');
   
    Route::post('/store-charts-of-accounts', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@submitImportChartOfAccount'])->name('importdata.store.chartsofaccount');
    
    Route::get('/trial-balance', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@importTrialBalance'])->name('importdata.trialbalance');
   
    
    Route::get('/trial-balance-formate', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@downloadTrialBalanceFormat'])->name('importdata.trialbalance-formate');
   
    Route::post('/import-trial-balance', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@storeTrialBalance'])->name('importdata.trialbalanc.submit');
   
    Route::get('/customers', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@customerImport'])->name('importdata.customerimport');
   
    Route::get('/customer-formate', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@downloadCustomerFormat'])->name('importdata.customerformate');
   
    Route::post('/import-customers', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@storeCustomerimport'])->name('importdata.store.customer');
   
    
    Route::get('/general-voucher', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@importGeneralVouchers'])->name('importdata.generalvoucher');
   
    
    Route::get('/general-voucher-formate', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@downloadGeneralVoucherFormate'])->name('importdata.generalvoucher-formate');
   
    Route::post('/store-general-voucher', ['middleware' => ['permission:import-data'], 'uses' => 'ImportLegacyDataController@storeGeneralVoucher'])->name('importdata.store.generalvoucher');
   

});



// view-balloting
// edit-balloting
// create-balloting
// delete-balloting



Route::prefix('balloting')->middleware(['auth', CheckProjectType::class,CheckProjectExistence::class])->group(function () {

    Route::get('/setting-map-files', ['middleware' => ['permission:view-balloting'], 'uses' => 'BallotingController@settingIndex'])->name('balloting.setting.files');
    Route::get('/setting-map-files/add', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@settingAddFile'])->name('balloting.setting.file.add');
    Route::get('/setting-map-files/download-file-format/{filename}', ['middleware' => ['permission:view-balloting'], 'uses' => 'BallotingController@downloadFileFormate'])->name('balloting.setting.file.format');
    Route::get('/setting-map-files/download-file-format', ['middleware' => ['permission:view-balloting'], 'uses' => 'BallotingController@downloadFileFormate'])->name('balloting.setting.file.format');

    Route::post('/setting-map-files/store', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@storeMapFile'])->name('balloting.setting.file.store');


    Route::get('/setting-map-files/view/{id}', ['middleware' => ['permission:view-balloting'], 'uses' => 'BallotingController@viewMapFile'])->name('balloting.setting.file.view');

    Route::get('/setting-map-files/publish-view/{id}', ['middleware' => ['permission:view-balloting'], 'uses' => 'BallotingController@viewPublishedMapFile'])->name('balloting.setting.publish.file.view');
   
    

    Route::get('/setting-map-files/download-file-format/{id}', ['middleware' => ['permission:view-balloting'], 'uses' => 'BallotingController@downloadFileFormate2'])->name('balloting.setting.file.format.map');


    Route::get('/pre-conditions', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@ballotingPreConditions'])->name('balloting.start.preconditions');
    Route::post('/start-balloting', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@startBalloting'])->name('balloting.start.store');

    Route::post('/start-balloting-store', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@startBallotingMap'])->name('balloting.start.store.data');



    Route::post('/import-data', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@importBallotingMapFileData'])->name('balloting.data.import');


    Route::get('/publish-map/{id}', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@publishMap'])->where(['id' => '[0-9]+'])->name('balloting.publish.map');;


    Route::get('/map-inventory/{id}', ['middleware' => ['permission:view-balloting'], 'uses' => 'BallotingController@publishMapInventory'])->where(['id' => '[0-9]+'])->name('balloting.map.inventory');;


    Route::get('/all-map-files', ['middleware' => ['permission:view-balloting'], 'uses' => 'BallotingController@mapListIndex'])->name('balloting.map.list');;

    Route::get('/map-inventory-edit/{id}', ['middleware' => ['permission:edit-balloting'], 'uses' => 'BallotingController@editMapInventory'])->where(['id' => '[0-9]+'])->name('balloting.map.inventory.edit');;


    Route::post('/map-inventory-update', ['middleware' => ['permission:edit-balloting'], 'uses' => 'BallotingController@updateMapInventory'])->name('balloting.map.inventory.update');

    Route::get('/get-map-data', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@getMapFileInformation'])->name('balloting.get.map.data');;


    Route::post('/map-inventory-remove', ['middleware' => ['permission:edit-balloting'], 'uses' => 'BallotingController@removeMapFileInventory'])->name('balloting.map.inventory.remove');



    Route::get('/get-inventory-list', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@getInventoryList'])->name('balloting.get.inventory');;

    Route::get('/get-inventory-unit', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@getInventoryUnitNumberList'])->name('balloting.get.inventory-unit');;


    Route::get('/get-inventory-info', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@getInventoryInfo'])->name('balloting.get.inventory-info');

    Route::post('/store-pre-condition', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@storePreConditionFiles'])->name('balloting.store.pre.condition');



    Route::get('/get-inventory-unit/{id}', ['middleware' => ['permission:create-balloting'], 'uses' => 'BallotingController@preConditionBallotingListForBalloting'])->name('balloting.start.balloting.index');


    Route::get('/pre-condition-list', ['middleware' => ['permission:view-balloting'], 'uses' => 'BallotingController@preConditionList'])->name('balloting.precondition.list');

    Route::get('/view/pre-condition-list/{id}', ['middleware' => ['permission:view-balloting'], 'uses' => 'BallotingController@viewPreConditionBallotingListForBalloting'])->name('balloting.precondition.view');

    Route::get('approve/result/{id}', ['middleware' => ['permission:edit-balloting'], 'uses' => 'BallotingController@approveBalloting'])->name('balloting.approve');

    Route::post('submit-approve/result/', ['middleware' => ['permission:edit-balloting'], 'uses' => 'BallotingController@storeApproveBalloting'])->name('balloting.approve.submit');




    //Direct Balloting
    Route::get('/direct', ['middleware' => ['permission:create-balloting'], 'uses' => 'DirectBallotingController@directBalloting'])->name('balloting.direct.index');
    Route::get('/direct/setting-map-files/add', ['middleware' => ['permission:create-balloting'], 'uses' => 'DirectBallotingController@directSettingAddFile'])->name('balloting.direct.file.add');
    Route::get('/direct/setting-map-files/download-file-format', ['middleware' => ['permission:view-balloting'], 'uses' => 'DirectBallotingController@downloadDirectBallotingFormate'])->name('balloting.direct.file.format');
    Route::post('/direct/setting-map-files/store', ['middleware' => ['permission:create-balloting'], 'uses' => 'DirectBallotingController@storeDirectMapFile'])->name('balloting.direct.file.store');
    Route::get('/direct/publish-map/{id}', ['middleware' => ['permission:create-balloting'], 'uses' => 'DirectBallotingController@directBallotingPublishMap'])->where(['id' => '[0-9]+'])->name('balloting.direct.publish.map');;
    Route::post('/direct/import-data', ['middleware' => ['permission:create-balloting'], 'uses' => 'DirectBallotingController@importDirectBallotingMapFileData'])->name('balloting.direct.data.import');
    Route::get('/direct/setting-map-files/view/{id}', ['middleware' => ['permission:view-balloting'], 'uses' => 'DirectBallotingController@viewMapFile'])->name('balloting.direct.file.view');
    Route::get('/direct/start-balloting/{id}', ['middleware' => ['permission:create-balloting'], 'uses' => 'DirectBallotingController@startBalloting'])->where(['id' => '[0-9]+'])->name('balloting.direct.start');;
    Route::post('/direct/start-balloting-store', ['middleware' => ['permission:create-balloting'], 'uses' => 'DirectBallotingController@startBallotingMap'])->name('balloting.direct.start.store.data');
    Route::get('/direct/map-inventory/{id}', ['middleware' => ['permission:view-balloting'], 'uses' => 'DirectBallotingController@publishMapInventory'])->where(['id' => '[0-9]+'])->name('balloting.direct.map.inventory');;
    Route::get('/direct/setting-map-files/download-file-format/{id}', ['middleware' => ['permission:view-balloting'], 'uses' => 'DirectBallotingController@downloadFileFormate2'])->name('balloting.direct.setting.file.format.map');
    Route::get('/direct/map-inventory-edit/{id}', ['middleware' => ['permission:edit-balloting'], 'uses' => 'DirectBallotingController@editMapInventory'])->where(['id' => '[0-9]+'])->name('balloting.direct.map.inventory.edit');;


    Route::post('/direct/map-inventory-update', ['middleware' => ['permission:edit-balloting'], 'uses' => 'DirectBallotingController@updateMapInventory'])->name('balloting.direct.map.inventory.update');
    Route::get('/direct/approve/result/{id}', ['middleware' => ['permission:edit-balloting'], 'uses' => 'DirectBallotingController@approveBalloting'])->name('balloting.direct.approve');

    Route::post('/direct/submit-approve/result/', ['middleware' => ['permission:edit-balloting'], 'uses' => 'DirectBallotingController@storeApproveBalloting'])->name('balloting.direct.approve.submit');
    Route::post('/direct/approve/all', ['middleware' => ['permission:edit-balloting'], 'uses' => 'DirectBallotingController@approveAllBallotingResult'])->name('balloting.direct.approve.all');
    Route::post('/direct/map-inventory-remove', ['middleware' => ['permission:edit-balloting'], 'uses' => 'DirectBallotingController@removeMapFileInventory'])->name('balloting.direct.map.inventory.remove');

    

    Route::get('/get-progress', function () {
        return response()->json(['progress' => session('progress')]);
    })->name('balloting.setting.progress');
    Route::get('/get-balloting-progress', function () {
        // session()->flush();
        // dd(session('balloting_progress'),Session::forget('balloting_progress'));
        return response()->json(['progress' => session('balloting_progress_')]);
    })->name('balloting.progress');
    Route::get('/get-cnic-list', 'BallotingController@getCnicList')->name('get-session');

});

// view-unit-block-criteria
// edit-unit-block-criteria
// create-unit-block-criteria
Route::prefix('unit-blockage')->middleware(['auth', CheckProjectType::class,CheckProjectExistence::class])->group(function () {
    Route::get('/', ['middleware' => ['permission:view-unit-block-criteria'], 'uses' => 'UnitBlockageController@index'])->name('unitblockage.index');
   

    Route::get('/create-criteria', ['middleware' => ['permission:create-unit-block-criteria'], 'uses' => 'UnitBlockageController@create'])->name('unitblockage.create');
    Route::post('/create-criteria', ['middleware' => ['permission:create-unit-block-criteria'], 'uses' => 'UnitBlockageController@store'])->name('unitblockage.store');
    Route::post('/active-criteria', ['middleware' => ['permission:edit-unit-block-criteria'], 'uses' => 'UnitBlockageController@activeCriteria'])->name('unitblockage.active');
    Route::get('/edit-criteria/{id}', ['middleware' => ['permission:edit-unit-block-criteria'], 'uses' => 'UnitBlockageController@edit'])->name('unitblockage.edit');
   
    Route::post('/edit-criteria', ['middleware' => ['permission:edit-unit-block-criteria'], 'uses' => 'UnitBlockageController@update'])->name('unitblockage.update');
   



    // edit-pricelist 
});



Route::prefix('setting')->middleware(['auth', 'role:admin', CheckProjectType::class, CheckProjectExistence::class])->group(function () {

    Route::get('/email-sms/type', ['uses' => 'EmailSmsController@index'])->name('email-sms.index');

    Route::get('/email-sms/view-type/{id}', ['uses' => 'EmailSmsController@viewType'])->where(['id' => '[0-9]+'])->name('email-sms.view-type');
    Route::get('/email-sms/edit-detail/{id}', ['uses' => 'EmailSmsController@editDetail'])->where(['id' => '[0-9]+'])->name('email-sms.edit-detail');


    Route::post('/email-sms/store-detail', ['uses' => 'EmailSmsController@storeDetail'])->name('email-sms.store-detail');


    Route::get('/email-sms/create-detail/{id}', ['uses' => 'EmailSmsController@createDetail'])->where(['id' => '[0-9]+'])->name('email-sms.create-detail');
    Route::post('/email-sms/store-typedetail', ['uses' => 'EmailSmsController@storeTypeDetail'])->name('email-sms.store-type-detail');
});

Route::prefix('setting')->middleware(['auth', 'role:admin', CheckProjectType::class, CheckProjectExistence::class])->group(function () {
    Route::get('/stmp', ['uses' => 'SmtpSettingController@index'])->name('stmp.index');
    Route::get('/stmp/add', ['uses' => 'SmtpSettingController@add'])->name('stmp.add');
    Route::post('/stmp/store', ['uses' => 'SmtpSettingController@store'])->name('stmp.store');
    Route::get('/stmp/test/{id}', ['uses' => 'SmtpSettingController@testSmtpSetting'])->where(['id' => '[0-9]+'])->name('stmp.testSmtpSetting');
    Route::post('/stmp/test', ['uses' => 'SmtpSettingController@sendTestSmtpSetting'])->name('stmp.testSmtpSetting.send');


    Route::get('/stmp/edit/{id}', ['uses' => 'SmtpSettingController@edit'])->where(['id' => '[0-9]+'])->name('stmp.edit');
    Route::post('/stmp/update', ['uses' => 'SmtpSettingController@update'])->name('stmp.update');
    Route::get('/email-log', ['uses' => 'EmailLogController@index'])->name('emaillog.index');

    Route::get('/email-log/update-table', ['uses' => 'EmailLogController@updateTable'])->name('emaillog.index.updateTable');

    Route::post('/resend/email-log', ['uses' => 'EmailLogController@resendMail'])->name('emaillog.resend-email');


    Route::get('/sms-log', ['uses' => 'SMSLogController@index'])->name('smslog.index');

    Route::post('/resend/sms-log', ['uses' => 'SMSLogController@resendSms'])->name('smslog.resend-sms');
    Route::get('/sms-log/update-table', ['uses' => 'SMSLogController@updateTable'])->name('smslog.index.updateTable');

    
});


Route::prefix('setting')->middleware(['auth', 'role:admin', CheckProjectType::class])->group(function () {

    Route::get('/multiproject-list', ['uses' => 'MultiProjectController@index'])->name('multi.index');

    Route::get('/create/project', ['uses' => 'MultiProjectController@create'])->name('multi.create');

    Route::post('/create/project', ['uses' => 'MultiProjectController@store'])->name('multi.store');



    Route::get('/edit/project/{id}', ['uses' => 'MultiProjectController@edit'])->name('multi.edit');

    Route::post('/update/project', ['uses' => 'MultiProjectController@update'])->name('multi.update');
});


Route::prefix('switch-project')->middleware(['auth'])->group(function () {
    Route::get('/', ['uses' => 'ProjectSwitchController@index'])->name('projectswitch.index');
    Route::post('/create', ['uses' => 'ProjectSwitchController@switchProject'])->name('projectswitch.create');
   
});

/*NFC API*/
Route::get('verify', 'CustomerStatementController@verifyNfc');

// Route::get('/configure', ['middleware' => ['auth', 'role:admin'], 'uses' => 'ProjectConfigureController@create'])->name('project.configure.create');
// Route::post('/configure/store', ['middleware' => ['auth', 'role:admin'], 'uses' => 'ProjectConfigureController@store'])->name('project.configure.store');
// Route::get('/not-configured-yet', ['middleware' => ['auth'], 'uses' => 'ProjectConfigureController@projectNotConfigured'])->name('project.configure.not');
Auth::routes();

// Route::get('/multiprofile',function(){
//     return view('multiproject.multiproject');
// });

// Route::get('/tt', ['middleware' => ['auth'], 'uses' => 'EmailSmsController@testDue']);


// Route::get('lara-livewire-file-upload', function () {
//     return view('live');
// });

Route::get('ballot-result', 'BallotingController@getResultForm');
