mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-09-01 19:04:00 +00:00
E-Invoice - Update in export and import of Credit Note report with update of 'Ref' column
This commit is contained in:
@@ -15,6 +15,7 @@ use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Models\Booking;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
|
||||
@@ -71,19 +72,29 @@ class ProcessCreditNoteReportV2CommandJob implements ShouldQueue
|
||||
'EInvoiceValidationLink' => $eInvoiceValidationLink,
|
||||
]);
|
||||
|
||||
$booking = Booking::where('marking', $ref)->first();
|
||||
if($booking){
|
||||
// $booking = Booking::where('marking', $ref)->first();
|
||||
// if($booking){
|
||||
// if($docNo != "" && $docNo != "<<New>>"){
|
||||
// $payments = $booking->transactions()->payments()->get();
|
||||
// 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);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
$transaction = Transaction::where('bill_no', $ref)->first();
|
||||
if($transaction){
|
||||
if($docNo != "" && $docNo != "<<New>>"){
|
||||
$payments = $booking->transactions()->payments()->get();
|
||||
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);
|
||||
}
|
||||
break;
|
||||
}
|
||||
$this->updateOrCreateKeyValuePair($transaction, KVPKey::AUTOCOUNT_DOCNO_CREDIT_NOTE, $docNo);
|
||||
if($eInvoiceValidationLink){
|
||||
$this->updateOrCreateKeyValuePair($transaction, KVPKey::AUTOCOUNT_EINVOICE_VALIDATION_LINK_CREDIT_NOTE, $eInvoiceValidationLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user