fix: use salesOrder.customer path in DeliveryNote dispatch notification
This commit is contained in:
parent
a1f6e765e1
commit
fddfb2aaff
@ -146,8 +146,10 @@ class DeliveryNoteController extends Controller
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($deliveryNote->customer && $deliveryNote->customer->whatsapp_number) {
|
$deliveryNote->loadMissing('salesOrder.customer');
|
||||||
$deliveryNote->customer->notify(new DeliveryDispatchedNotification($deliveryNote));
|
$customer = $deliveryNote->salesOrder?->customer;
|
||||||
|
if ($customer && $customer->whatsapp_number) {
|
||||||
|
$customer->notify(new DeliveryDispatchedNotification($deliveryNote));
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->back()->with('success', 'Delivery note dispatched and stock decremented.');
|
return redirect()->back()->with('success', 'Delivery note dispatched and stock decremented.');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user