Tax Included misleading - Hide (was "We need to have a charge with taxes included in price")

Description

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:
calculateInvoiceTaxTotal
calculateOrderTaxTotal
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

Environment

I think all environments need to be updated

Activity

Show:
Carlos Ruiz
October 3, 2015, 10:12 PM

Hi , please attach a patch here for development branch in order to see the impact.

Jorbi Garcia
October 6, 2015, 5:46 PM


Attached You will find the pacth file with the changes.

Carlos Ruiz
February 22, 2019, 2:44 PM

Note: The patch is incomplete - it requires migration script

Carlos Ruiz
April 5, 2020, 4:47 PM

Hi, as per this ticket and this forum thread:
https://groups.google.com/d/msg/idempiere/YSw-h9f1cVg/r5zoJ61-AAAJ

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.

Regards,

Carlos Ruiz

Assignee

Carlos Ruiz

Reporter

Jorbi Garcia

Labels

Tested By

None

Components

Affects versions

Priority

Minor
Configure