task-fix
This commit is contained in:
@@ -47,6 +47,17 @@ type ProjectPartyTableAvailability = {
|
||||
|
||||
let projectPartyTableAvailability: ProjectPartyTableAvailability | null = null;
|
||||
|
||||
const outcomeOpportunitySelect = {
|
||||
id: crmOpportunities.id,
|
||||
customerId: crmOpportunities.customerId,
|
||||
branchId: crmOpportunities.branchId,
|
||||
productType: crmOpportunities.productType,
|
||||
assignedToUserId: crmOpportunities.assignedToUserId,
|
||||
poAmount: crmOpportunities.poAmount,
|
||||
closedWonAt: crmOpportunities.closedWonAt,
|
||||
closedLostAt: crmOpportunities.closedLostAt
|
||||
} as const;
|
||||
|
||||
function splitFilterValue(value?: string) {
|
||||
return value
|
||||
?.split(',')
|
||||
@@ -412,7 +423,7 @@ async function getOutcomeRevenueRecords(
|
||||
): Promise<OutcomeRevenueRecord[]> {
|
||||
const whereFilters = buildOutcomeRevenueFilters(organizationId, stage, filters);
|
||||
const where = whereFilters.length === 1 ? whereFilters[0] : and(...whereFilters);
|
||||
const opportunities = await db.select().from(crmOpportunities).where(where);
|
||||
const opportunities = await db.select(outcomeOpportunitySelect).from(crmOpportunities).where(where);
|
||||
|
||||
if (!opportunities.length) {
|
||||
return [];
|
||||
@@ -556,4 +567,3 @@ export async function getWinRate(
|
||||
|
||||
return Math.round((wonRows.length / denominator) * 10000) / 100;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user