auto generate invoices

This commit is contained in:
Omair Saleh
2023-02-17 12:51:15 +08:00
parent e4610e1a53
commit 0654f0335b
+1 -1
View File
@@ -745,7 +745,7 @@ Route::get('/generate/invoices', function(){
$billingAddress = $companyModule->addresses()->where('type', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first();
$deliveryAddress = $order->addresses()->where('status', ApprovalStatus::APPROVED)->first();
$postCodes = \App\Models\SegmentConstant::whereIn('reference', ['CENTER_POSTCODE', 'OUTSTATION_POSTCODE'])->get()->pluck('value');
$postCodes = \App\Models\SegmentConstant::whereIn('reference', ['CENTER_POSTCODE', 'OUTSTATION_POSTCODE'])->get()->pluck('value')->flatten();
dump($deliveryAddress->postcode, $postCodes->toArray());
if(!!$billingAddress && in_array($deliveryAddress->postcode, $postCodes->toArray())){