small update in get SUB

This commit is contained in:
ROSHAN GARG 2024-09-24 14:31:58 +05:30
parent 2968131835
commit a6d632e663
8 changed files with 22 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -824,9 +824,11 @@ export const getProcessingInvoices = async (req, res) => {
});
if (orderId) {
const filteredInvoices = invoices.filter(invoice =>
invoice.orderId && invoice.orderId.uniqueId &&
invoice.orderId.uniqueId.toLowerCase().includes(orderId.toLowerCase())
const filteredInvoices = invoices.filter(
(invoice) =>
invoice.orderId &&
invoice.orderId.uniqueId &&
invoice.orderId.uniqueId.toLowerCase().includes(orderId.toLowerCase())
);
res.status(200).json({
totalCount: filteredInvoices.length,
@ -858,7 +860,7 @@ export const getInvoiceDetailsById = async (req, res) => {
populate: {
path: "addedBy",
model: "User",
select: "name email phone", // Select only specific fields
select: "name email phone SBU", // Select only specific fields
},
});
@ -1026,9 +1028,11 @@ export const getDispatchedInvoices = async (req, res) => {
});
if (orderId) {
const filteredInvoices = invoices.filter(invoice =>
invoice.orderId && invoice.orderId.uniqueId &&
invoice.orderId.uniqueId.toLowerCase().includes(orderId.toLowerCase())
const filteredInvoices = invoices.filter(
(invoice) =>
invoice.orderId &&
invoice.orderId.uniqueId &&
invoice.orderId.uniqueId.toLowerCase().includes(orderId.toLowerCase())
);
res.status(200).json({
totalCount: filteredInvoices.length,
@ -1211,9 +1215,11 @@ export const getDeliveredInvoices = async (req, res) => {
});
if (orderId) {
const filteredInvoices = invoices.filter(invoice =>
invoice.orderId && invoice.orderId.uniqueId &&
invoice.orderId.uniqueId.toLowerCase().includes(orderId.toLowerCase())
const filteredInvoices = invoices.filter(
(invoice) =>
invoice.orderId &&
invoice.orderId.uniqueId &&
invoice.orderId.uniqueId.toLowerCase().includes(orderId.toLowerCase())
);
res.status(200).json({
totalCount: filteredInvoices.length,