Write, Bureaucrats, Administrators
4,332
edits
mNo edit summary |
mNo edit summary |
||
Line 53: | Line 53: | ||
; Add these fields to Orders: | ; Add these fields to Orders: | ||
:* '''Product margin''' — [[Calculation field]] | :* '''Product margin''' — [[Calculation field]] | ||
:: | :: Either using the '''+Field''' button or by just typing, enter this script: | ||
<source lang="JavaScript"> | <source lang="JavaScript"> | ||
#{product.std price} - #{product.cost} | #{product.std price} - #{product.cost} | ||
</source> | </source> | ||
:* '''Product margin %''' — [[Calculation field]] | :* '''Product margin %''' — [[Calculation field]] | ||
:: | :: Enter this script: | ||
<source lang="JavaScript"> | <source lang="JavaScript"> | ||
( #{product.std price} - #{product.cost} ) * 100 / #{product.cost} | ( #{product.std price} - #{product.cost} ) * 100 / #{product.cost} | ||
</source> | </source> | ||
:* '''Order margin''' — [[Calculation field]] | :* '''Order margin''' — [[Calculation field]] | ||
:: | :: Enter this script: | ||
<source lang="JavaScript"> | <source lang="JavaScript"> | ||
#{price} - #{product.cost} | #{price} - #{product.cost} | ||
</source> | </source> | ||
:* '''Order margin %''' — [[Calculation field]] | :* '''Order margin %''' — [[Calculation field]] | ||
:: | :: Enter this script: | ||
<source lang="JavaScript"> | <source lang="JavaScript"> | ||
( #{price} - #{product.cost} ) * 100 / #{product.cost} | ( #{price} - #{product.cost} ) * 100 / #{product.cost} |