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:
@@ -0,0 +1,24 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
@include('InvoiceHelpers')
|
||||
@extends('layouts.base_pdf')
|
||||
@section('inner_content')
|
||||
<br>
|
||||
@@ -167,28 +168,4 @@
|
||||
</tr>
|
||||
</table>
|
||||
</htmlpagefooter>
|
||||
@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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@include('InvoiceHelpers')
|
||||
@extends('layouts.base_pdf')
|
||||
|
||||
@section('inner_content')
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@include('InvoiceHelpers')
|
||||
@extends('layouts.base_pdf')
|
||||
@section('inner_content')
|
||||
<br>
|
||||
@@ -175,28 +176,4 @@
|
||||
</tr>
|
||||
</table>
|
||||
</htmlpagefooter>
|
||||
@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