delete duplicated invoice

This commit is contained in:
edmondlang
2023-02-27 19:18:43 +08:00
parent d03e34a1f4
commit 4058456797
+2 -2
View File
@@ -869,10 +869,10 @@ Route::get('/invoices/delete-duplicated', function(Request $request){
$order = $packingList->owner;
$order_marking = $order->reference;
$paidInvoice = $packingList->transactions->where('type', TransactionType::SHIPPING_INVOICE)->where('status', ApprovalStatus::COMPLETED)->get();
$paidInvoice = $packingList->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->where('status', ApprovalStatus::COMPLETED)->get();
// check inside packingList has how many unpaid invoice
$unpaidInvoices = $packingList->transactions->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED])->sortByDesc('created_at')->get();
$unpaidInvoices = $packingList->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED])->sortByDesc('created_at')->get();
dump($unpaidInvoices);