mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-24 15:04:19 +00:00
E-Invoice - Partial Code revert for 'E-Invoice - Updated business logic for refund / return (credit note) without updating booking amount'
This commit is contained in:
@@ -75,6 +75,9 @@ class UpdateBookingAmountWithPOLogic extends AbstractControllerLogic
|
||||
$booking = $this->fetchesBooking->execute(['id' => $request->route('id') ?? $id]);
|
||||
$outstandingAmount = $this->calculatesBookingOutstanding->execute($booking);
|
||||
$bookingAttribute = $booking->attributesKVP()->where('key', "BOOKING_AMOUNT_UPDATE")->first();
|
||||
|
||||
|
||||
/* cief todo: 90 - BEFORE REVERT
|
||||
$refundAmount = $this->calculatesBookingRefundAmount->execute($booking, $booking->fix_currency_id);
|
||||
$paidAmount = floatval($this->calculatesBookingPayableAmount->execute($booking, $booking->fix_currency_id)) - floatval($refundAmount);
|
||||
|
||||
@@ -83,6 +86,15 @@ class UpdateBookingAmountWithPOLogic extends AbstractControllerLogic
|
||||
throw new MalformedRequestException('Purchase Order at this point can only be edited after editing the booking amount');
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// cief todo: 90 - REVERTED STARTS
|
||||
$paidAmount = floatval($this->calculatesBookingPayableAmount->execute($booking, $booking->fix_currency_id)) - floatval($this->calculatesBookingRefundAmount->execute($booking, $booking->fix_currency_id));
|
||||
|
||||
if($paidAmount > 0 && $outstandingAmount > 0 && !$bookingAttribute){
|
||||
throw new MalformedRequestException('Purchase Order at this point can only be edited after editing the booking amount');
|
||||
}
|
||||
// cief todo: 90 - REVERTED ENDS
|
||||
|
||||
if($bookingAttribute){
|
||||
$total = collect($request->input('products'))->sum(function($product){
|
||||
|
||||
+5
-3
@@ -125,9 +125,11 @@ class UpdateRefundTransactionStatusLogic extends AbstractControllerLogic
|
||||
$this->updatesTransactionStatus->execute($po_transaction, (float) number_format($po_transaction->amount, 2, '.', '') === (float) number_format((float)$booking->fix_amount - $refundTransaction->original_amount, 2, '.', '') ? ApprovalStatus::PENDING_VERIFICATION : ApprovalStatus::PENDING_SUBMISSION);
|
||||
}
|
||||
|
||||
// $request['fix_amount'] = $booking->fix_amount - $refundTransaction->original_amount;
|
||||
// $request->route()->setParameter('id', $booking->id);
|
||||
// $this->updateBookingAmountLogic->execute($request);
|
||||
// cief todo: 90 - REVERTED STARTS (commented before revert)
|
||||
$request['fix_amount'] = $booking->fix_amount - $refundTransaction->original_amount;
|
||||
$request->route()->setParameter('id', $booking->id);
|
||||
$this->updateBookingAmountLogic->execute($request);
|
||||
// cief todo: 90 - REVERTED ENDS (commented before revert)
|
||||
}
|
||||
|
||||
if ($supplierRefundTransaction) {
|
||||
|
||||
Reference in New Issue
Block a user