fix: fixed warehouse inventory numbers and some button verbage

This commit is contained in:
2026-04-21 04:38:07 +00:00
parent c94de8198f
commit 5194d0e21e
29 changed files with 835 additions and 575 deletions
+11 -5
View File
@@ -45,13 +45,19 @@ type CwOpportunityWithMembers = CwOpportunity & {
"memberRecId" | "primarySalesFlag" | "secondarySalesFlag"
>[];
soOppStatus?: Pick<CwSoOppStatus, "closedFlag"> | null;
soInterest?: { description: string | null } | null;
};
const toInterest = (value: number | null): OpportunityInterest | null => {
const toInterest = (
value: { description: string | null } | null
): OpportunityInterest | null => {
if (value == null) return null;
if (value <= 1) return OpportunityInterest.COLD;
if (value === 2) return OpportunityInterest.WARM;
return OpportunityInterest.HOT;
const desc = value.description?.toLowerCase() ?? "";
if (desc.includes("cold")) return OpportunityInterest.COLD;
if (desc.includes("warm") || desc.includes("medium"))
return OpportunityInterest.WARM;
if (desc.includes("hot")) return OpportunityInterest.HOT;
return null;
};
export const opportunityTranslation: Translation<
@@ -85,7 +91,7 @@ export const opportunityTranslation: Translation<
{ from: "soOppStatusRecId", to: "statusId" },
{ from: "taxCodeRecId", to: "taxCodeId" },
{
from: "soInterestRecId",
from: "soInterest",
to: "interest",
process: toInterest,
},