mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
fix po
This commit is contained in:
@@ -15,11 +15,12 @@
|
||||
$subtotal = "0";
|
||||
$voucherDiscount = $voucher_redemption ? bcmul((string)$voucher_redemption->value, "-1", 2) : "0";
|
||||
$displayedSubtotal = 0;
|
||||
$currency_id = $transaction->currency_id
|
||||
@endphp
|
||||
|
||||
@foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail)
|
||||
@php
|
||||
$exactUnitPrice = bcdiv($transaction_detail->price, $transaction->currency_rate, 7);
|
||||
$exactUnitPrice = ($currency_id) === 1 : $transaction_detail->price : bcdiv($transaction_detail->price, $transaction->currency_rate, 7);
|
||||
$displayUnitPrice = round($exactUnitPrice, 2);
|
||||
$itemTotal = bcmul($exactUnitPrice, $transaction_detail->quantity, 5);
|
||||
$displayedItemTotal = round(bcmul($displayUnitPrice, $transaction_detail->quantity, 7), 2);
|
||||
|
||||
+18
-2
@@ -112,7 +112,7 @@ Route::get('/transfer/{marking}', function ($marking) {
|
||||
return view('pages.bookings.profile', ['marking' => $marking]);
|
||||
})->name('booking.details');
|
||||
|
||||
Route::get('/transfer/{marking}/latest-invoice', function ($marking) {
|
||||
Route::get('/transfer/{marking}/latest/{document_type}', function ($marking, $document_type) {
|
||||
$booking= Booking::where('marking', $marking)->first();
|
||||
|
||||
$purchaseOrder = $booking->transactions()
|
||||
@@ -126,7 +126,23 @@ Route::get('/transfer/{marking}/latest-invoice', function ($marking) {
|
||||
|
||||
$supplier = Company::where('id', $transaction->receiver)->first();
|
||||
|
||||
$lowercaseDocumentType = strtolower(DocumentType::INVOICE);
|
||||
$lowercaseDocumentType = null;
|
||||
switch ($document_type) {
|
||||
case 'po':
|
||||
$lowercaseDocumentType = DocumentType::PURCHASE_ORDER;
|
||||
break;
|
||||
case 'do':
|
||||
$lowercaseDocumentType = DocumentType::DELIVER_ORDER;
|
||||
break;
|
||||
case 'sdo':
|
||||
$lowercaseDocumentType = DocumentType::SUPPLIER_DELIVER_ORDER;
|
||||
break;
|
||||
default:
|
||||
$lowercaseDocumentType = DocumentType::INVOICE;
|
||||
break;
|
||||
}
|
||||
|
||||
$lowercaseDocumentType = strtolower($lowercaseDocumentType);
|
||||
|
||||
$voucherRedemption = $transaction->voucherRedemption;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user