From 35ca254cac1055c62b3b6f9d5d9365e080f110bc Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 24 Feb 2023 16:45:49 +0800 Subject: [PATCH] add customisation for suppliers pi export --- routes/web.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index 053c500e..2656043c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -252,8 +252,18 @@ Route::get('/transactions/supplier/{id}/mock_up', 'Transactions\DownloadMockUpWh Route::get('/notifications/list', 'Notifications\ListNotificationsController@list')->name('notifications.list'); -Route::get('/supplier/pi/export', function(){ - $groups = \App\Models\Group::where('issuer', 2729)->whereMonth('created_at', 9)->whereYear('created_at', 2022)->get(); +Route::get('/supplier/pi/export/{month}/{year}/{?id}', function($month, $year, $id){ + + if(!$id){ + foreach (Company::where('business_type', \App\Classes\ValueObjects\Constants\BusinessType::CURRENCY_VENDOR) as $supplier) { + echo '

'.$supplier->name.'

'; + } + + return; + } + echo '

Back to suppliers list

'; + + $groups = \App\Models\Group::where('issuer', $id)->whereMonth('created_at', $month)->whereYear('created_at', $year)->get(); echo ''; $i = 0;