mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
debug invoice pdf
This commit is contained in:
@@ -206,28 +206,4 @@ class CreateInvoiceTransactionProcessor
|
||||
// CreatePerfexCRMInvoice::dispatch($invoice_transaction, $purchaseOrder, $supplier);
|
||||
// }
|
||||
}
|
||||
|
||||
public function calculateSubtotal($po_order_transaction, $currencyRate) {
|
||||
$subtotal = "0";
|
||||
foreach ($po_order_transaction->transactionDetails as $transaction_detail) {
|
||||
$unitPrice = bcdiv((string)$transaction_detail->price, (string)$currencyRate, 5);
|
||||
$itemTotal = bcmul($unitPrice, (string)$transaction_detail->quantity, 5);
|
||||
$subtotal = bcadd($subtotal, $itemTotal, 5);
|
||||
}
|
||||
return $subtotal;
|
||||
}
|
||||
|
||||
public function getVoucherDiscount($voucher_redemption) {
|
||||
return $voucher_redemption ? bcmul((string)$voucher_redemption->value, "-1", 2) : "0";
|
||||
}
|
||||
|
||||
public function roundUp($number, $decimals)
|
||||
{
|
||||
$factor = pow(10, $decimals);
|
||||
if ($number > 0) {
|
||||
return ceil($number * $factor) / $factor;
|
||||
} else {
|
||||
return floor($number * $factor) / $factor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,4 +160,28 @@
|
||||
Account Name: CIEF Worldwide Sdn Bhd<br>
|
||||
Account No: 564892103405<br>
|
||||
</div>
|
||||
@php
|
||||
function calculateSubtotal($po_order_transaction, $currencyRate) {
|
||||
$subtotal = "0";
|
||||
foreach ($po_order_transaction->transactionDetails as $transaction_detail) {
|
||||
$unitPrice = bcdiv((string)$transaction_detail->price, (string)$currencyRate, 5);
|
||||
$itemTotal = bcmul($unitPrice, (string)$transaction_detail->quantity, 5);
|
||||
$subtotal = bcadd($subtotal, $itemTotal, 5);
|
||||
}
|
||||
return $subtotal;
|
||||
}
|
||||
|
||||
function getVoucherDiscount($voucher_redemption) {
|
||||
return $voucher_redemption ? bcmul((string)$voucher_redemption->value, "-1", 2) : "0";
|
||||
}
|
||||
function roundUp($number, $decimals) {
|
||||
$factor = pow(10, $decimals);
|
||||
if ($number > 0) {
|
||||
return ceil($number * $factor) / $factor;
|
||||
} else {
|
||||
return floor($number * $factor) / $factor;
|
||||
}
|
||||
}
|
||||
|
||||
@endphp
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user