Change to Line Item calculation -

Line items are currently calculated by a derived value of 

math:roundAmount(/fixedAmount - /details/discount + /quantity * /unitAmount)"

would it not be more appropriate to use:

math:roundAmount(number(boolean(/quantity))*/fixedAmount - /details/discount + /quantity * /unitAmount)

my xpath makes any value greater than 0 return a 1 for 

number(boolean(/quantity))

and a 0 if it is 0.

effectively this means that the fixed price is 0 if the qty is 0 rather than the current which sets the fixed price despite qty being 0.

Of course - I am not sure - but archetype changes like this might affect past finalized transactions - if it recalculates the value on the fly so perhaps it cant be changed.

 

Ben

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Change to Line Item calculation -

Sorry that is incorrect...

it would be 

math:roundAmount(compare(0,/quantity)*/fixedAmount - /details/discount + /quantity * /unitAmount)
Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Change to Line Item calculation -

Can you stick this in a JIRA please?

Thanks,

-Tim

Re: Change to Line Item calculation -

https://openvpms.atlassian.net/browse/OVPMS-1521

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au
Syndicate content