Skip to content

Commit a5c307b

Browse files
author
vikasrohit
authored
Merge pull request #3083 from appirio-tech/hotfix/handling_formula_in_price_field_of_a_building_block
Trying to handle formula in the price field of the building block
2 parents 1731323 + 02a740d commit a5c307b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/config/projectWizard/index.js

+7
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,13 @@ export function getProductEstimate(projectTemplate, projectData) {
618618
if (isNaN(bbPrice)) { // if we are unable to parse price as numeric value, set it as ZERO
619619
bbPrice = 0
620620
}
621+
// stores back the evaluated price, if the price field contains the formula
622+
if (_.isString(bb.price)) {
623+
// stores the original formula in metadata
624+
bb.metadata.priceFormula = bb.price
625+
// updates the price with evaluated price
626+
bb.price = bbPrice
627+
}
621628
price += (bbPrice * (bb.quantity ? bb.quantity : 1))
622629
minTime += bb.minTime
623630
maxTime += bb.maxTime

0 commit comments

Comments
 (0)