mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-24 06:54:02 +00:00
Merge branch 'dillon/90-e-invoice-e-2' into vapor/development
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Classes\Modules\Bookings\ControllersLogic;
|
||||
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Bookings\Services\FetchesBooking;
|
||||
use App\Classes\Modules\Bookings\Standards\Rules\CanFetchBooking;
|
||||
@@ -73,7 +74,7 @@ class RegenerateInvoiceBookingLogic extends AbstractControllerLogic
|
||||
$booking = $this->fetchesBooking->execute(
|
||||
[
|
||||
'id' => $request->route('id'),
|
||||
// 'status' => ApprovalStatus::COMPLETED, //cief todo: 90 - must have completed to avoid generate invoice inaccurately
|
||||
// 'status' => ApprovalStatus::COMPLETED,
|
||||
'with_transactions' => true
|
||||
]
|
||||
);
|
||||
@@ -81,6 +82,12 @@ class RegenerateInvoiceBookingLogic extends AbstractControllerLogic
|
||||
$eInvoiceWithNormalInvoiceTemplate = $request->input('normal_invoice', false);
|
||||
$eInvoiceRefund = $request->input('e_invoice_refund', false);
|
||||
|
||||
if(!$eInvoiceRefund){
|
||||
if($booking->status !== ApprovalStatus::COMPLETED){
|
||||
throw new MalformedRequestException('Booking incomplete.');
|
||||
}
|
||||
}
|
||||
|
||||
// if($eInvoiceRefund){
|
||||
$this->regenerateInvoiceBookingV2Processor->execute($booking, $eInvoiceWithNormalInvoiceTemplate, $eInvoiceRefund);
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user