From 90aaa80f0c8dab41be9f8f20ea34a638e97ffe0d Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 26 Oct 2022 17:02:45 +0800 Subject: [PATCH] hck purchase orders --- routes/web.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index dfc19924..4ec38f09 100644 --- a/routes/web.php +++ b/routes/web.php @@ -208,17 +208,19 @@ 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', 2210)->whereMonth('created_at', 7)->whereYear('created_at', 2022)->get(); + $groups = \App\Models\Group::where('issuer', 2956)->whereMonth('created_at', 9)->whereYear('created_at', 2022)->get(); echo ''; $i = 0; foreach ($groups as $group){ foreach ($group->transactions as $transaction){ $booking = $purchaseOrder = $transaction->owner->owner; + $bill = $booking->transactions()->where('type', TransactionType::PAYMENT)->first()->transactions()->first(); $purchaseOrder = $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->where('status', ApprovalStatus::APPROVED)->first(); if(!$purchaseOrder) { echo ''; echo ''; + echo ''; echo ''; echo ''; echo ''; @@ -231,6 +233,7 @@ Route::get('/supplier/pi/export', function(){ $i++; echo ''; echo ''; + echo ''; echo ''; echo ''; echo '';
-'.$bill->created_at.'warning, booking ref.'.$booking->marking.' doesn\'t have purchase order00
'.$i.''.$bill->created_at.''.$item->product_name.''.$item->quantity.''.$item->price * (1/$group->currency_rate).'