feat(dashboard): filter quotes by clicking status cards in StatsBar
This commit is contained in:
@@ -288,8 +288,13 @@ export function filterQuotes(
|
||||
"پیشنهاد شده": "offered",
|
||||
"پذیرفته شده": "accepted",
|
||||
"رسیده": "arrived",
|
||||
"باز": "offered",
|
||||
"پذیرفته": "accepted",
|
||||
"offered": "offered",
|
||||
"accepted": "accepted",
|
||||
"arrived": "arrived",
|
||||
};
|
||||
const stKey = STATUS_BY_LABEL[stVal] || "";
|
||||
const stKey = STATUS_BY_LABEL[stVal] || stVal;
|
||||
|
||||
return store.quotes.filter((quote) => {
|
||||
const supObj = supplierById(store.suppliers, quote.supplier_id);
|
||||
@@ -313,11 +318,16 @@ export function filterQuotes(
|
||||
export function isExpired(q: Quote): boolean {
|
||||
return (
|
||||
q.status === "offered" &&
|
||||
!quoteHasArrivedOrAccepted(q) &&
|
||||
!!q.expiry_date &&
|
||||
new Date(q.expiry_date) < new Date(new Date().toDateString())
|
||||
);
|
||||
}
|
||||
|
||||
function quoteHasArrivedOrAccepted(q: Quote): boolean {
|
||||
return q.status === "accepted" || q.status === "arrived";
|
||||
}
|
||||
|
||||
// آمادهسازی نمایش ترمشیت در حالت expanded
|
||||
export function termSheetBlocks(
|
||||
store: Store,
|
||||
@@ -347,4 +357,4 @@ export function termSheetBlocks(
|
||||
});
|
||||
return { ts, isAccepted, isUsed, itemsDesc, milestones };
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user