From 810bca98a234e48e0161341e55352fbff73dafaf Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 10 Nov 2025 14:17:46 +0800 Subject: [PATCH] Manual Invoice / BA --- routes/web.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/routes/web.php b/routes/web.php index 5c98f87a..cc13fc90 100644 --- a/routes/web.php +++ b/routes/web.php @@ -240,13 +240,17 @@ Route::post('/support', function (Request $request) { if($billNo) { $transaction = Transaction::where('bill_no', $billNo)->first(); - $booking = $transaction->booking; + if($transaction){ + $booking = $transaction->booking; + } } if($autocountDocNoInvoice) { $kvp = KeyValuePair::where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE)->where('value', $autocountDocNoInvoice)->first(); - $transaction = $kvp->owner()->withTrashed()->first(); - $booking = $transaction ? $transaction->booking : null; + if($kvp){ + $transaction = $kvp->owner()->withTrashed()->first(); + $booking = $transaction ? $transaction->booking : null; + } } return view('pages.customer_support', [