From eeb7bb77bbc7f6bb56fe27363611dbe3d0e3e737 Mon Sep 17 00:00:00 2001 From: edmondlang Date: Thu, 9 Mar 2023 12:46:00 +0800 Subject: [PATCH] delete duplicated invoice --- routes/web.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/routes/web.php b/routes/web.php index 2297d68f..a4619efc 100644 --- a/routes/web.php +++ b/routes/web.php @@ -845,7 +845,6 @@ Route::get('/invoices/show-duplicated', function(Request $request){ Route::get('/invoices/delete-duplicated', function(Request $request){ $duplicatedInvoices = DB::table('transactions') ->where('type', TransactionType::SHIPPING_INVOICE) - // ->where('status', '!=' , ApprovalStatus::COMPLETED) ->where('status', '!=' , ApprovalStatus::EXPIRED) ->where('deleted_at', null) ->select('owner_id', DB::raw('count(*) as count')) @@ -863,9 +862,8 @@ Route::get('/invoices/delete-duplicated', function(Request $request){ // if have completed invoice (verified payment) if (count($paidInvoice)) { - // $packingList->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->where('status', '!=', ApprovalStatus::COMPLETED)->delete(); - // continue; - dump($order->reference . ' -has payment'); + $packingList->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->where('status', '!=', ApprovalStatus::COMPLETED)->delete(); + continue; } else { dump($order->reference . ' -no'); }