small update in get SUB
BIN
public/temp/tmp-1-1726740645735
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
public/temp/tmp-2-1726740645736
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
public/temp/tmp-3-1726740697903
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
public/temp/tmp-4-1726740697904
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
public/temp/tmp-5-1726740697905
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
public/temp/tmp-6-1726740697908
Normal file
After Width: | Height: | Size: 53 KiB |
BIN
public/temp/tmp-7-1726740697911
Normal file
After Width: | Height: | Size: 53 KiB |
@ -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,
|
||||
|