changes in consumption

master
Varun 9 months ago
parent 9a510b0bff
commit c884c64d27

@ -4110,7 +4110,7 @@ const updatetotalConsumptiontillmidnight = async () => {
const formattedDate = moment().tz('Asia/Kolkata').format('DD-MMM-YYYY - HH:mm'); const formattedDate = moment().tz('Asia/Kolkata').format('DD-MMM-YYYY - HH:mm');
// Check if the record already exists // Check if the record already exists
const existingRecord = await TankConsumptionSchema.findOne({ const existingRecord = await TankConsumptionOriginalSchema.findOne({
customerId: tank.customerId, customerId: tank.customerId,
tankName: tank.tankName, tankName: tank.tankName,
tankLocation: tank.tankLocation, tankLocation: tank.tankLocation,
@ -4119,7 +4119,7 @@ const updatetotalConsumptiontillmidnight = async () => {
if (!existingRecord) { if (!existingRecord) {
// Create and save the new document if it doesn't exist // Create and save the new document if it doesn't exist
const newTankConsumption = new TankConsumptionSchema({ const newTankConsumption = new TankConsumptionOriginalSchema({
customerId: tank.customerId, customerId: tank.customerId,
tankName: tank.tankName, tankName: tank.tankName,
tankLocation: tank.tankLocation, tankLocation: tank.tankLocation,

Loading…
Cancel
Save