mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-24 15:04:19 +00:00
fix regenerate invoice
This commit is contained in:
+7
-2
@@ -484,8 +484,6 @@ Route::get('/payments/manual', function(){
|
||||
echo '</table>';
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::get('/invoice/fix', function(){
|
||||
|
||||
set_time_limit(14400);
|
||||
@@ -522,6 +520,13 @@ Route::get('/invoice/fix', function(){
|
||||
$deletedInvoice->bill_no = $bill_no . '-deleted';
|
||||
$deletedInvoice->save();
|
||||
|
||||
$existing_invoice_bill_no = Transaction::where('bill_no', $bill_no)->first();
|
||||
|
||||
if ($existing_invoice_bill_no) {
|
||||
Log::channel('regenerateInvoice')->info('Delete existing bill_no: ' . json_encode($existing_invoice_bill_no));
|
||||
$existing_invoice_bill_no->forceDelete();
|
||||
}
|
||||
|
||||
(App()->make(CreateInvoiceTransactionProcessorWithInvoiceNo::class))->execute($booking, $bill_no);
|
||||
dump('regenerated invoice. Booking Marking - ' . $booking->marking . '. Bill_no - ' . $bill_no . '. Old bill_no - ' . $deletedInvoice->bill_no);
|
||||
Log::channel('regenerateInvoice')->info('regenerated invoice. Booking Marking - ' . $booking->marking . '. Bill_no - ' . $bill_no . '. Old bill_no - ' . $deletedInvoice->bill_no);
|
||||
|
||||
Reference in New Issue
Block a user