When adding line items with different currencies, the total price calculated in the line items overview does not take into account different currencies per line.
This happens in Purchase and in Sales orders. 10 yen are only about 8 cents - 20 USD is way off the correct value.
These were both created on the demo server. The total cost, calculated at the top of the order, is correct in both cases (10.08 USD)
One could argue that it makes no sense to use different currencies for each line item. I was trying to use this in a sales order to calculate a total cost of an idea, with parts purchased from different vendors, in different countries.
Regardless of which, it is currently possible to do this, and the sum is wrong. Something must be changed. Options:
InvenTree-Version: 0.10.0 dev
Django Version: 3.2.16
Commit Hash: e730b5c
Commit Date: 2023-01-10
Database: postgresql
Debug-Mode: False
Deployed using Docker: True
Active plugins: False
No response
@miggland you can disable the total price column footer of the purchase/sale order tables by commenting out the footer-formatter code:
InvenTree/InvenTree/templates/js/translated/order.js
Lines 2373 to 2385 in e730b5c
InvenTree/InvenTree/templates/js/translated/order.js
Lines 2560 to 2572 in e730b5c
InvenTree/InvenTree/templates/js/translated/order.js
Lines 3885 to 3897 in e730b5c
InvenTree/InvenTree/templates/js/translated/order.js
Lines 4377 to 4388 in e730b5c
At first glance it seems to be doing some currency conversion... but not on individual rows. Will investigate if I can get it working
@miggland still looking to see if I'm able to fix it. Tried a few things, but I was to focused on adding data to the order lines. Having read the recommendation of @matmair, and re-thinking my strategy. I'm now thinking on adding two more fields to the api/order/so/ and api/order/po/ endpoints that represent the sub_total for the order lines and the extra lines.
Total price and sub-total prices will then all be shown in the base currency.
I've made a draft PR #4245 which is an initial solution to this problem, but it needs further refinement as for some reason the bootstrap table is firing the onPostFooter twice per table. So that's 4 times on page load.
I'm thinking to have the sub total values present in the normal GET call to the template, so I can pass them to the javascript routines without a callback to the API.
Owner Name | inventree |
Repo Name | InvenTree |
Full Name | inventree/InvenTree |
Language | Python |
Created Date | 2017-03-23 |
Updated Date | 2023-03-31 |
Star Count | 2586 |
Watcher Count | 61 |
Fork Count | 411 |
Issue Count | 141 |
Issue Title | Created Date | Updated Date |
---|