mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
E-Invoice - Enhancement to allow EInvoice to be generated for cases with refund
This commit is contained in:
@@ -105,6 +105,22 @@
|
||||
<tfoot>
|
||||
@php
|
||||
$subtotalWithDiscount = bcsub($subtotal, $voucherDiscount, 5);
|
||||
if (!$totalPayment) {
|
||||
$serviceCharge = $transaction->service_charge;
|
||||
}
|
||||
else {
|
||||
$serviceCharge = $booking->transactions()
|
||||
->where('type', TransactionType::PAYMENT)
|
||||
->where('status', ApprovalStatus::COMPLETED)
|
||||
->get()
|
||||
->sum(function ($transaction) {
|
||||
return $transaction->service_charge;
|
||||
});
|
||||
}
|
||||
if ($paymentSumRefund && $displayedSubtotal === 0){
|
||||
$subtotal = bcsub($paymentSumRefund, $serviceCharge, 5);
|
||||
$displayedSubtotal = bcsub($paymentSumRefund, $serviceCharge, 2);
|
||||
}
|
||||
@endphp
|
||||
<tr class="subtotal">
|
||||
<td colspan="4"></td>
|
||||
@@ -114,20 +130,6 @@
|
||||
<tr class="billingcharges">
|
||||
<td colspan="4"></td>
|
||||
<td class="right">Service Charges</td>
|
||||
<?php
|
||||
if (!$totalPayment) {
|
||||
$serviceCharge = $transaction->service_charge;
|
||||
}
|
||||
else {
|
||||
$serviceCharge = $booking->transactions()
|
||||
->where('type', TransactionType::PAYMENT)
|
||||
->where('status', ApprovalStatus::COMPLETED)
|
||||
->get()
|
||||
->sum(function ($transaction) {
|
||||
return $transaction->service_charge;
|
||||
});
|
||||
}
|
||||
?>
|
||||
<td class="right">{{ number_format($serviceCharge, 2) }}</td>
|
||||
</tr>
|
||||
@if($totalPayment && $refundedServiceCharge)
|
||||
|
||||
Reference in New Issue
Block a user