auto generate invoices

This commit is contained in:
Omair Saleh
2023-02-17 13:06:52 +08:00
parent f4f8c34cb9
commit ee575c21ea
+7 -2
View File
@@ -752,8 +752,13 @@ Route::get('/generate/invoices', function(){
$postCodes = \App\Models\SegmentConstant::whereIn('reference', ['CENTER_POSTCODE', 'OUTSTATION_POSTCODE'])->get()->pluck('value')->flatten();
if(!!$billingAddress && in_array($deliveryAddress->postcode, $postCodes->toArray())){
(App()->make(CreateInvoiceTransactionProcessor::class))->execute($packingList);
echo '<span style="color: green;">Invoice Generated...</span><br>';
try {
(App()->make(CreateInvoiceTransactionProcessor::class))->execute($packingList);
echo '<span style="color: green;">Invoice Generated...</span><br>';
} catch (Exception $exception){
echo '<span style="color: red;">failed to generate...</span><br>';
}
}
echo '<span style="color: red;">failed to generate...</span><br>';
}