mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
hck purchase orders
This commit is contained in:
+4
-1
@@ -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 '<table>';
|
||||
$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 '<tr>';
|
||||
echo '<td>-</td>';
|
||||
echo '<td>'.$bill->created_at.'</td>';
|
||||
echo '<td style="color: red">warning, booking ref.'.$booking->marking.' doesn\'t have purchase order</td>';
|
||||
echo '<td>0</td>';
|
||||
echo '<td>0</td>';
|
||||
@@ -231,6 +233,7 @@ Route::get('/supplier/pi/export', function(){
|
||||
$i++;
|
||||
echo '<tr>';
|
||||
echo '<td>'.$i.'</td>';
|
||||
echo '<td>'.$bill->created_at.'</td>';
|
||||
echo '<td>'.$item->product_name.'</td>';
|
||||
echo '<td>'.$item->quantity.'</td>';
|
||||
echo '<td>'.$item->price * (1/$group->currency_rate).'</td>';
|
||||
|
||||
Reference in New Issue
Block a user