diff --git a/app/Console/Commands/RegenerateInvoice.php b/app/Console/Commands/RegenerateInvoice.php index cf4a1751..aa017d29 100644 --- a/app/Console/Commands/RegenerateInvoice.php +++ b/app/Console/Commands/RegenerateInvoice.php @@ -107,13 +107,11 @@ class RegenerateInvoice extends Command $existing_invoice_bill_no->forceDelete(); } - $invoiceProcessor = App()->make(CreateInvoiceTransactionProcessorWithInvoiceNo::class); - $invoiceProcessor->execute($booking, $bill_no); + $this->createInvoiceTransactionProcessorWithInvoiceNo->execute($booking, $bill_no); $logMessage = 'Regenerated invoice. Booking Marking - ' . $booking->marking . '. Bill_no - ' . $bill_no . '. Old bill_no - ' . $deletedInvoice->bill_no; $this->printAndLog($logMessage); } else { - $invoiceProcessor = App()->make(CreateInvoiceTransactionProcessor::class); - $invoiceProcessor->execute($booking); + $this->createInvoiceTransactionProcessor->execute($booking); $logMessage = 'Regenerated new invoice. Booking Marking - ' . $booking->marking; $this->printAndLog($logMessage); }