filter quote by recalcwithoutrevision
This commit is contained in:
parent
dae0765b57
commit
89ccbf40bd
@ -1241,11 +1241,9 @@ const reactionEffects: IReactionEffect[] = [
|
||||
if (recalcWithRevision === true) {
|
||||
calculationStore.setStatus('selectLead', ElementStatus.Disabled);
|
||||
calculationStore.setStatus('selectOpportunity', ElementStatus.Disabled);
|
||||
calculationStore.setStatus('selectQuote', ElementStatus.Disabled);
|
||||
} else {
|
||||
calculationStore.setStatus('selectLead', ElementStatus.Default);
|
||||
calculationStore.setStatus('selectOpportunity', ElementStatus.Default);
|
||||
calculationStore.setStatus('selectQuote', ElementStatus.Default);
|
||||
}
|
||||
},
|
||||
options: {
|
||||
@ -1253,6 +1251,29 @@ const reactionEffects: IReactionEffect[] = [
|
||||
},
|
||||
}),
|
||||
|
||||
calculationStore => ({
|
||||
expression: () => {
|
||||
const { recalcWithRevision } = calculationStore.values;
|
||||
return recalcWithRevision;
|
||||
},
|
||||
effect: recalcWithRevision => {
|
||||
if (recalcWithRevision === true) {
|
||||
calculationStore.setFilter('selectQuote', quotes =>
|
||||
quotes.filter(
|
||||
quote =>
|
||||
quote.evo_recalc_limit &&
|
||||
quote.evo_recalc_limit > 0 &&
|
||||
quote.evo_statuscode &&
|
||||
quote.evo_statuscode.evo_id &&
|
||||
quote.evo_statuscode.evo_id === '2.3',
|
||||
),
|
||||
);
|
||||
} else {
|
||||
calculationStore.setFilter('selectQuote', undefined);
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
||||
calculationStore => ({
|
||||
expression: () => {
|
||||
const {
|
||||
@ -1336,34 +1357,6 @@ const reactionEffects: IReactionEffect[] = [
|
||||
},
|
||||
}),
|
||||
|
||||
calculationStore => ({
|
||||
expression: () => {
|
||||
const { quote } = calculationStore.values;
|
||||
return quote;
|
||||
},
|
||||
effect: quoteId => {
|
||||
calculationStore.setStatus(
|
||||
'cbxRecalcWithRevision',
|
||||
ElementStatus.Disabled,
|
||||
);
|
||||
if (quoteId) {
|
||||
const quote = calculationStore.options.selectQuote?.find(
|
||||
x => x.quoteid === quoteId,
|
||||
);
|
||||
if (quote) {
|
||||
if (quote.evo_recalc_limit && quote.evo_recalc_limit > 0) {
|
||||
if (quote.evo_statuscode?.evo_id === '2.3') {
|
||||
calculationStore.setStatus(
|
||||
'cbxRecalcWithRevision',
|
||||
ElementStatus.Default,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
||||
calculationStore => ({
|
||||
expression: () => {
|
||||
const { firstPaymentPerc } = calculationStore.values;
|
||||
|
||||
Reference in New Issue
Block a user