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;