mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
E-Invoice - Fix some transfer E-Invoice cannot be generated
This commit is contained in:
+11
-12
@@ -138,19 +138,18 @@ class CreateInvoiceTransactionV2Processor
|
||||
// return;
|
||||
}
|
||||
|
||||
$purchaseOrder = null;
|
||||
if($generateEInvoiceRefund){
|
||||
$purchaseOrder = $booking->transactions()
|
||||
->where('type', TransactionType::PURCHASE_ORDER)
|
||||
->complete()
|
||||
->first();
|
||||
|
||||
if(!$purchaseOrder){
|
||||
//was use for $generateEInvoiceRefund true
|
||||
$purchaseOrder = $booking->transactions()
|
||||
->where('type', TransactionType::PURCHASE_ORDER)
|
||||
->where('status', ApprovalStatus::PENDING_SUBMISSION)
|
||||
->first();
|
||||
}
|
||||
else{
|
||||
$purchaseOrder = $booking->transactions()
|
||||
->where('type', TransactionType::PURCHASE_ORDER)
|
||||
->complete()
|
||||
->first();
|
||||
}
|
||||
|
||||
$constants = SegmentConstant::where('reference', SegmentConstants::SERVICE_TYPE)->where('detail->id', $booking->service->id)->first();
|
||||
// if ($constants->detail->is_billable && !$purchaseOrder && !$generateEInvoiceRefund) {
|
||||
@@ -330,14 +329,14 @@ class CreateInvoiceTransactionV2Processor
|
||||
}
|
||||
}
|
||||
|
||||
//if(!$generateEInvoiceRefund){
|
||||
$this->updatesBookingStatus->execute($booking, $bookingOriginalStatus);
|
||||
//}
|
||||
|
||||
// update perfex crm
|
||||
// if(config('perfexcrm.is_enabled') == 'true'){
|
||||
// CreatePerfexCRMInvoice::dispatch($invoice_transaction, $purchaseOrder, $supplier);
|
||||
// }
|
||||
}
|
||||
|
||||
//if(!$generateEInvoiceRefund){
|
||||
$this->updatesBookingStatus->execute($booking, $bookingOriginalStatus);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user