I have some complex tax situations that makes necessary some modifications on the way that the system calculates/updates tax from lines and document headers.
I always did the job with validators and overriding some native classes, but now with the ITaxProvider i'm trying to get a better way to do that, avoiding a internal fork (or at least reducing that).
Attached there is a patch with some modifications that I did:
1 - created the recalculateTax method for MOrderLine and MRMALine at ITaxProvider; 2 - created updateHeaderTax method for MOrderLine, MInvoiceLine and MRMALine at ITaxProvider; 3 - Moved related codes from MOrderLine, MInvoiceLine and MRMALine to StandardTaxProvider.
with this, i finally got all my tax logic inside custom Tax Providers without touching the native code.
Thanks Murilo, I integrated your patch with a minor change (clearParent instead of setParent), also dropped all the spacing changes to ease peer review.
萩原秀明 December 29, 2013 at 3:07 AM
I think this improvement is very important for Japan too. Now, I am developing tax plugin for Japan. I also met same problem. Please tell me if there is anything that I can help with.
Carlos Ruiz December 23, 2013 at 5:38 PM
Merging TaxProvider needs visibility changes on some methods opened by Antonio Cañaveral
I have a problem to extend a "TaxProvider", I'm creating from a plug-in to manage taxes and taxation, functionality and operation is perfect, the problem is that I need access to methods that are protected, I suggest to be public in order to extended without problem. The methods are getTax () and setPrecision (int) of all documents. example Org.compiere.model.MOrderTax.getTax () Org.compiere.model.MOrderTax.setPrecision (int) Should be usefull also the updateDOCTax(boolean) methods.
I have some complex tax situations that makes necessary some modifications on the way that the system calculates/updates tax from lines and document headers.
I always did the job with validators and overriding some native classes, but now with the ITaxProvider i'm trying to get a better way to do that, avoiding a internal fork (or at least reducing that).
Attached there is a patch with some modifications that I did:
1 - created the recalculateTax method for MOrderLine and MRMALine at ITaxProvider;
2 - created updateHeaderTax method for MOrderLine, MInvoiceLine and MRMALine at ITaxProvider;
3 - Moved related codes from MOrderLine, MInvoiceLine and MRMALine to StandardTaxProvider.
with this, i finally got all my tax logic inside custom Tax Providers without touching the native code.
WDYT ?
Related to: