From c884c64d279a652840df8f18c974fd2f32c402e6 Mon Sep 17 00:00:00 2001 From: Varun Date: Fri, 3 Jan 2025 12:17:30 +0530 Subject: [PATCH] changes in consumption --- src/controllers/tanksController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index a2dff378..f0eccdf0 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -4110,7 +4110,7 @@ const updatetotalConsumptiontillmidnight = async () => { const formattedDate = moment().tz('Asia/Kolkata').format('DD-MMM-YYYY - HH:mm'); // Check if the record already exists - const existingRecord = await TankConsumptionSchema.findOne({ + const existingRecord = await TankConsumptionOriginalSchema.findOne({ customerId: tank.customerId, tankName: tank.tankName, tankLocation: tank.tankLocation, @@ -4119,7 +4119,7 @@ const updatetotalConsumptiontillmidnight = async () => { if (!existingRecord) { // Create and save the new document if it doesn't exist - const newTankConsumption = new TankConsumptionSchema({ + const newTankConsumption = new TankConsumptionOriginalSchema({ customerId: tank.customerId, tankName: tank.tankName, tankLocation: tank.tankLocation,