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