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