Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

untitled notebook

node v18.11.0
version: 1.0.0
endpointsharetweet
// calculating the agBasePrice const amicAmount = 1; const amicFactor = 0.2; const amicPrice = 31.5; const agAmount = 10; const amicQuantity = amicAmount / amicFactor; const agBasePrice = (amicQuantity * amicPrice) * agAmount / amicQuantity;  // this should be recaclucated if the agrantisAmount changes via connect/disconnect from article! console.log('agBasePrice', agBasePrice); // 157.50 // calculating amicPrice for line using agBasePrice: // const amicPrice2 = (agBasePrice / amicFactor * amicAmount / agAmount) * amicFactor / amicAmount;   // happens in agrantis const agQuantity = 2; const agLineTotal = agAmount * agQuantity * agBasePrice; // calculate amicPrice for line using agQuantity, agAmount and agLineTotal // const amicLinePrice = ((agLineTotal / (agAmount * agQuantity)) / amicFactor * amicAmount / agAmount) * amicFactor / amicAmount; const amicLinePrice = ((agLineTotal / (agAmount * agQuantity)) / agAmount); const amicLineQuantity = (agAmount * agQuantity) / amicQuantity; const amicTotalLineQuantity = amicLineQuantity * amicQuantity; console.dir({ agBasePrice, amicQuantity, agLineTotal, agAmount, agQuantity, amicLinePrice, amicLineQuantity, amicTotalLineQuantity }) // console.log('amicLinePrice', amicLinePrice) // console.log('amicLineQuantity', amicLineQuantity) // console.log('amicTotalLineQuantity', amicTotalLineQuantity)
Loading…

no comments

    sign in to comment