From e34e27658b0affd082aa939360df822df6d5fc64 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Wed, 16 Aug 2023 15:40:48 +0800 Subject: [PATCH] regenerate invoices for 2023 --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 72860b3f..51ce8e15 100644 --- a/routes/web.php +++ b/routes/web.php @@ -469,7 +469,7 @@ Route::get('/invoice/fix', function(){ $bookings = Booking::where('status', ApprovalStatus::COMPLETED)->whereDate('updated_at', '>=', Carbon::parse('01-01-2023'))->get(); foreach($bookings as $booking){ - $booking->transactions()->whereIn('type', [TransactionType::INVOICE, TransactionType::SUPPLIER_DELIVER])->delete(); + $booking->transactions()->whereIn('transactions.type', [TransactionType::INVOICE, TransactionType::SUPPLIER_DELIVER])->delete(); $booking->documents()->whereIn('type', [DocumentType::INVOICE, DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::SUPPLIER_DELIVER_ORDER])->delete(); $booking->status = ApprovalStatus::APPROVED; $booking->save();