Currently, all product prices are stored inclusive of tax. This makes it difficult to update prices if a tax rate changes. All prices must be manually updated to incorporate the rate change
This project will:
- store all product prices tax-exclusive
- calculate tax-inc prices when a product is charged
- display products with both tax-inc and tax-ex prices
A new flag "Display Prices Tax-Inclusive", set at the Practice level, will determine how prices are displayed.
In the Product browser, this will determine if fixed and unit prices are displayed tax-inclusive or tax-exclusive.
When viewing products, both tax-inclusive and tax-exclusive prices will be displayed.
Price Editing
When editing products, both tax-inclusive and tax-exclusive prices will be editable.
If the tax-inclusive price is changed, the tax-exclusive price will be derived, and vice-versa. Only the tax-exclusive price will be stored.
Where Display Prices Tax-Inclusive is true, this allows tax-inc prices to be assigned a round amount.
Report Changes
The following reports need to be updated to display prices based on the Display Prices Tax-Inclusive flag:
- Product List
- Product Price List
These will need:
- new JXPath extension functions that calculate the tax-inclusive price
- support to invoke JXPath extension functions from within an SQL report.
Data Migration
Product fixed and unit prices must be updated to remove the tax component.
Prices are currently calculated using:
price = (cost * (1 + markup/100) ) * (1 + tax/100)
and then rounded to the no. of decimal places specified by the currency.
The migration script will recalculate the price using
price = round(price/(1 + tax/100),3)
This is required for practices that loaded historical price data without the cost information.
The migration script cannot determine the number of decimal places to use, so will default to 3 decimal places.
NOTE: due to rounding, the calculated tax-inc price may be different to that prior to migration. The difference will be a fraction of a cent.
Related project: http://www.openvpms.org/project/add-support-invoice-level-taxation
Price Description
The productPrice.unitPrice and productPrice.fixedPrice archetypes have derived description nodes:
concat('$ ',/price, ' ',openvpms:lookup(.,'uom'),' (',date:formatDate(/fromDate), ' - ',date:formatDate(/toDate),')')
i.e. they contain text like:
$ 8.37 Ampoules(13/07/2006 - )
These will be migrated to contain the tax exclusive price. This description will not be displayed in the user interface, as it won't necessarily reflect the current practice configuration.