|
|
|
@ -1425,16 +1425,14 @@ exports.getbatchnumbers = async (req, reply) => {
|
|
|
|
|
exports.getbatquotationsforparticularstore = async (req, reply) => {
|
|
|
|
|
try {
|
|
|
|
|
const storeId = req.params.storeId;
|
|
|
|
|
let type = req.params.type ? req.params.type.toLowerCase() : null; // Convert type to uppercase
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let query = { storeId: storeId };
|
|
|
|
|
|
|
|
|
|
if (type !== "ALL") {
|
|
|
|
|
query.type = type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Fetch data based on the query
|
|
|
|
|
const result = await Insensors.find(query);
|
|
|
|
|
const result = await SensorQuotation.find(query);
|
|
|
|
|
|
|
|
|
|
if (!result ) {
|
|
|
|
|
return reply.send({ status_code: 404, error: "not found" });
|
|
|
|
@ -1544,7 +1542,7 @@ exports.createquotationforSensor = async (req, reply) => {
|
|
|
|
|
quatationId,
|
|
|
|
|
customerId,
|
|
|
|
|
surveyId,
|
|
|
|
|
quote_status: "sentfrominstaller",
|
|
|
|
|
quote_status: "sentfromsurvey",
|
|
|
|
|
masters,
|
|
|
|
|
slaves,
|
|
|
|
|
sensors,
|
|
|
|
|