auto generate invoices

This commit is contained in:
Omair Saleh
2023-02-17 12:53:10 +08:00
parent 598ca3807e
commit a23e0b35a2
+4 -1
View File
@@ -739,7 +739,10 @@ Route::get('/generate/invoices', function(){
$packingLists = (App()->make(ListsPackingLists::class))->execute(['does_not_have_transaction_type' => 1, 'type' => 2]);
foreach ($packingLists as $packingList){
$order = $packingList->owner;
if(!($order instanceof Order)) echo '<span style="color: red;">failed to generate...</span>'; continue;
if(!($order instanceof Order)) {
echo '<span style="color: red;">failed to generate...</span>';
continue;
}
$companyModule = $order->companyModule;
$billingAddress = $companyModule->addresses()->where('type', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first();