|
|
@ -1280,7 +1280,13 @@ exports.getusersofParticularInstaller = async (req, reply) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dayjs = require('dayjs'); // Install this library using npm install dayjs
|
|
|
|
const dayjs = require('dayjs');
|
|
|
|
|
|
|
|
const utc = require('dayjs/plugin/utc');
|
|
|
|
|
|
|
|
const timezone = require('dayjs/plugin/timezone');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Extend dayjs with UTC and timezone plugins
|
|
|
|
|
|
|
|
dayjs.extend(utc);
|
|
|
|
|
|
|
|
dayjs.extend(timezone);
|
|
|
|
|
|
|
|
|
|
|
|
exports.createquotationforSensor = async (req, reply) => {
|
|
|
|
exports.createquotationforSensor = async (req, reply) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -1297,21 +1303,21 @@ exports.createquotationforSensor = async (req, reply) => {
|
|
|
|
text: item.text || "",
|
|
|
|
text: item.text || "",
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
// Format current date and time
|
|
|
|
// Format current date and time in IST
|
|
|
|
const formattedDateTime = dayjs().format('DD-MMM-YYYY - HH:mm');
|
|
|
|
const formattedDateTime = dayjs().tz("Asia/Kolkata").format('DD-MMM-YYYY - HH:mm');
|
|
|
|
|
|
|
|
|
|
|
|
// Create a new SensorQuotation document
|
|
|
|
// Create a new SensorQuotation document
|
|
|
|
const newQuotation = new SensorQuotation({
|
|
|
|
const newQuotation = new SensorQuotation({
|
|
|
|
quatationId,
|
|
|
|
quatationId,
|
|
|
|
customerId: customerId,
|
|
|
|
customerId: customerId,
|
|
|
|
installationId: installationId,
|
|
|
|
installationId: installationId,
|
|
|
|
quote_status: "Installer Ki pampina,Vaadu reply ivvale inka",
|
|
|
|
quote_status: "sentfrominstaller",
|
|
|
|
masters,
|
|
|
|
masters,
|
|
|
|
slaves,
|
|
|
|
slaves,
|
|
|
|
sensors,
|
|
|
|
sensors,
|
|
|
|
motor_switches,
|
|
|
|
motor_switches,
|
|
|
|
electricals: formattedElectricals,
|
|
|
|
electricals: formattedElectricals,
|
|
|
|
datetime: formattedDateTime, // Add the formatted date and time
|
|
|
|
datetime: formattedDateTime, // Add the formatted IST date and time
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const savedQuotation = await newQuotation.save();
|
|
|
|
const savedQuotation = await newQuotation.save();
|
|
|
|