update call wac webhook

This commit is contained in:
edmondlang
2024-07-18 23:59:23 +08:00
parent e5d6f3f581
commit 09ede52ecf
@@ -75,6 +75,8 @@ class CreateInvoiceTransactionProcessor
*/
public function execute(PackingList $packingList)
{
$ori_packing_list = $packingList;
$packing_list = PackingList::where('reference', $packingList->reference)->where('type', PackingListType::SHIPPING_PACKING_LIST)->first();
$billable_packing_list = $packing_list->packingLists()->first();
@@ -244,13 +246,13 @@ class CreateInvoiceTransactionProcessor
$hasInvoiceCreated = Transaction::withTrashed()
->where('type', TransactionType::SHIPPING_INVOICE)
->where('owner_type', PackingList::class)
->where('owner_id', $packingList->id)
->where('owner_id', $ori_packing_list->id)
->exists();
Log::channel('wac_webhook')->info('Regenerating Invoice for PackingList: ' . $packingList->id . '. No call wac api.');
Log::channel('wac_webhook')->info('Regenerating Invoice for PackingList: ' . $ori_packing_list->id . '. No call wac api.');
if (app()->environment('production') && !$hasInvoiceCreated) {
$order = $packingList->owner;
$order = $ori_packing_list->owner;
$companyModule = $order->companyModule;
$company = $companyModule->company;
$companyContact = $company->contacts()->first();