At the first time I saw the taxes included in the price in the charge window (but it was disabled) I tried enabling and testing and this doesn't work. We make initial few changes and testing and also this doesn't work. After some time of analysis we found the needed changes that must be made to work fine: it can be explained in short as:
1. Enabling taxes included field in the charge window.
2. Modifying MInvoiceLine and MOrderLine isTaxIncluded method to consider charge in adition to pricelists.
3. Modify MOrderTax and MInvoiceTax (method calculateTaxFromLines) .
4. Create a new field taxAmt in the C_OrderLine Table, with properties:
taxamt numeric DEFAULT 0.
5. Add the setTax() method to MOrderLine Class, and add the method invocation in the beforeSave() method.
6. Modify StandardTaxProvider class methods:
updateHeaderTax(MTaxProvider provider, MInvoiceLine line)
updateHeaderTax(MTaxProvider provider, MOrderLine line)
Before that changes the improvement is work fine, We test it with many cases and all works fine, but We can be sure we test all the cases.
We think about release this improvement as a plugin, but before think about that We believe the best option is to merge or include in the main branch, because this change doesn't change the original behavior it only add the mix (in the same document an invoice or an order) products and charges with and without taxes included.
We can send the changes We made if you agree to include in the main branch.
I am waiting your your comments
I think all environments need to be updated
Hi , please attach a patch here for development branch in order to see the impact.
Attached You will find the pacth file with the changes.
Note: The patch is incomplete - it requires migration script
Hi, as per this ticket and this forum thread:
The IsTaxIncluded in C_Charge is not necessary, it works in price list, not in charge.
So, solution committed for this ticket is to disable the fields IsTaxIncluded and SameTax that were useless in the Charge window.