test delete duplicated invoice

This commit is contained in:
edmondlang
2023-03-09 12:44:36 +08:00
parent c8a2ce71e1
commit 2de60c8262
+4 -2
View File
@@ -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