mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-09-01 10:54:00 +00:00
E-Invoice - Automapping Issues, Credit Note Report (Import) Partial Completion
This commit is contained in:
@@ -314,9 +314,21 @@ class ImportExcelLogic extends AbstractControllerLogic
|
||||
$booking = Booking::where('marking', $ref)->first();
|
||||
if($booking){
|
||||
if($docNo != "" && $docNo != "<<New>>"){
|
||||
$this->updateOrCreateKeyValuePair($booking, KVPKey::AUTOCOUNT_DOCNO_CREDIT_NOTE, $docNo);
|
||||
if($eInvoiceValidationLink){
|
||||
$this->updateOrCreateKeyValuePair($booking, KVPKey::AUTOCOUNT_EINVOICE_VALIDATION_LINK_CREDIT_NOTE, $eInvoiceValidationLink);
|
||||
$payments = $booking->transactions()->payments()->get();
|
||||
$processed = false;
|
||||
foreach ($payments as $payment) {
|
||||
$refundTransaction = $payment->transactions()->refunds()->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->latest()->first();
|
||||
if($refundTransaction){
|
||||
$this->updateOrCreateKeyValuePair($refundTransaction, KVPKey::AUTOCOUNT_DOCNO_CREDIT_NOTE, $docNo);
|
||||
if($eInvoiceValidationLink){
|
||||
$this->updateOrCreateKeyValuePair($refundTransaction, KVPKey::AUTOCOUNT_EINVOICE_VALIDATION_LINK_CREDIT_NOTE, $eInvoiceValidationLink);
|
||||
}
|
||||
$processed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$processed){
|
||||
$unprocessedDocNos[] = $docNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user