mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
delete duplicated invoice
This commit is contained in:
+2
-4
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user