fix: use salesOrder.customer path in DeliveryNote dispatch notification
This commit is contained in:
1 parent
a1f6e765e1
commit
fddfb2aaff
1 file changed
+4
-2
@@ -146,8 +146,10 @@ class DeliveryNoteController extends Controller
|
||||
}
|
||||
});
|
||||
|
||||
if ($deliveryNote->customer && $deliveryNote->customer->whatsapp_number) {
|
||||
$deliveryNote->customer->notify(new DeliveryDispatchedNotification($deliveryNote));
|
||||
$deliveryNote->loadMissing('salesOrder.customer');
|
||||
$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.');
|
||||
|
||||
Reference in new issue
Block a user