mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
auto generate invoices
This commit is contained in:
@@ -65,7 +65,7 @@ class CreateInvoiceTransactionProcessor
|
||||
$this->createsTransactionDetail = $createsTransactionDetail;
|
||||
}
|
||||
|
||||
public function execute(PackingList $packingList) : JsonResponse
|
||||
public function execute(PackingList $packingList)
|
||||
{
|
||||
$packing_list = PackingList::where('reference', $packingList->reference)->where('type', PackingListType::SHIPPING_PACKING_LIST)->first();
|
||||
|
||||
|
||||
+3
-2
@@ -741,7 +741,7 @@ Route::get('/generate/invoices', function(){
|
||||
foreach ($packingLists as $packingList){
|
||||
$order = $packingList->owner;
|
||||
if(!($order instanceof Order)) {
|
||||
echo '<span style="color: red;">failed to generate...</span>';
|
||||
echo '<span style="color: red;">failed to generate...</span><br>';
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -753,8 +753,9 @@ Route::get('/generate/invoices', function(){
|
||||
|
||||
if(!!$billingAddress && in_array($deliveryAddress->postcode, $postCodes->toArray())){
|
||||
(App()->make(CreateInvoiceTransactionProcessor::class))->execute($packingList);
|
||||
echo '<span style="color: green;">Invoice Generated...</span><br>';
|
||||
}
|
||||
echo '<span style="color: red;">failed to generate...</span>';
|
||||
echo '<span style="color: red;">failed to generate...</span><br>';
|
||||
}
|
||||
})->name('generate.invoices');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user