add customisation for suppliers pi export

This commit is contained in:
Omair Saleh
2023-02-24 16:45:49 +08:00
parent 764a4c4b84
commit 35ca254cac
+12 -2
View File
@@ -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 '<a href="/supplier/pi/export/'.$month.'/'.$year.'/'.$supplier->id.'"><p>'.$supplier->name.'</p></a>';
}
return;
}
echo '<a href="/supplier/pi/export/'.$month.'/'.$year.'"><p>Back to suppliers list</p></a>';
$groups = \App\Models\Group::where('issuer', $id)->whereMonth('created_at', $month)->whereYear('created_at', $year)->get();
echo '<table>';
$i = 0;