[jira] Created: (OFBIZ-405) Showing invoice total with and without tax

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-405?page=comments#action_12455241 ]
           
Jacopo Cappellato commented on OFBIZ-405:
-----------------------------------------

WARNING:

the fo.ftl code in the patch will break the invoice PDF (now that we have moved to the new FOP version); in fact, each table-row element must contain at least one table-cell element, and each table-cell element must contain at least one block element.



> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-405?page=comments#action_12458277 ]
           
Jacques Le Roux commented on OFBIZ-405:
---------------------------------------

Eriks,

If you have a chance to look at this issue. According to Jacopo it needs a new patch...

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-405?page=comments#action_12458391 ]
           
Eriks Dobelis commented on OFBIZ-405:
-------------------------------------

I am working on this know. I hope there will be a patch within few days or so.

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-405?page=all ]

Eriks Dobelis updated OFBIZ-405:
--------------------------------

    Attachment: invoicenotax.diff

New version of the patch. Please, remove the previous version.

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax.diff, invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-405?page=comments#action_12458774 ]
           
Eriks Dobelis commented on OFBIZ-405:
-------------------------------------

I changed the interface according to Si's suggestion. Label is "Total excl. tax", which is more or less what Iain and Jacopo suggested. Also, FOP code know works on the current svn version.

Configurability of tax related labels based on TaxAuthority is beyond scope of this patch and if needed (I personally support it) should be created as a separate issue. This also would relate to more general question of configurability of invoices, etc.

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax.diff, invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-405?page=comments#action_12458776 ]
           
Eriks Dobelis commented on OFBIZ-405:
-------------------------------------

Sorry for typos. End of the year - too much work :)

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax.diff, invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-405?page=all ]

Jacques Le Roux updated OFBIZ-405:
----------------------------------

    Attachment:     (was: invoicenotax.diff)

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-405?page=comments#action_12458791 ]
           
Jacques Le Roux commented on OFBIZ-405:
---------------------------------------

Eriks,

Remove done, thanks for the patch. I agree with you for a new issue on "Configurability of tax related labels based on TaxAuthority "

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-405?page=comments#action_12460311 ]
           
Si Chen commented on OFBIZ-405:
-------------------------------

This patch looks OK, except for a couple of modifications which we'll make for you:

1.  You should use the pre-defined ZERO instead of your own BigDecimal("0")

2.  When using BigDecimal during additions, do not round down to decimals immediately.  Round down to decimals+1 during intermediate looping and then round down to decimals after you are done.  This means that:
invoiceTaxTotal = invoiceTaxTotal.add( amount.multiply(quantity)).setScale(decimals,rounding);

should be:
invoiceTaxTotal = invoiceTaxTotal.add( amount.multiply(quantity)).setScale(decimals+1, rounding);

Then you should have a
invoiceTaxTotal = invoiceTaxTotal.setScale(decimals, rounding)

Otherwise, you will have a problem where these two values
1.08423465
1.08358239

would be rounded to 1.08 and 1.08 and added to 1.16 instead of being rounded to 1.084 and 1.083 and added to 1.17.

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-405?page=all ]

Leon Torres updated OFBIZ-405:
------------------------------

    Attachment: invoicenotax-2.diff

I tested the patch and found that it doesn't work at all.  The problem is that the getInvoiceTaxTotal() method only checks for INV_SALES_TAX and ignores the other InvoiceItemTypes that are taxes.  Hence, it returns the wrong results for purchase invoices, return invoices and even sales invoices.

I fixed it so it will include all tax types currently defined in InvoiceItemType.  Here's a patch with my fixes and Si's recommended improvements.  (invoicenotax-2.diff)

This version works ok, however it relies on a static List in InvoiceWorker to identify the tax types.  Perhaps it would be better to include an extra column InvoiceItemType.isTax instead?

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax-2.diff, invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-405?page=comments#action_12460962 ]
           
Eriks Dobelis commented on OFBIZ-405:
-------------------------------------

Thanks Si and Leon for improvements!

I checked only INV_SALES_TAX, because this was initial purpose. I agree that static list is not the best way, but I don't think that including extra column is worth the overhead it creates. May be we should make this list configurable using an entry in property file?

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax-2.diff, invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-405) Showing invoice total with and without tax

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ http://issues.apache.org/jira/browse/OFBIZ-405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461635 ]

Jacques Le Roux commented on OFBIZ-405:
---------------------------------------

I guess that entries in a properties file should be fine, but why are these types not defined in an enum in the DB BTW ?

Thanks

> Showing invoice total with and without tax
> ------------------------------------------
>
>                 Key: OFBIZ-405
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-405
>             Project: Apache OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: accounting
>            Reporter: Eriks Dobelis
>         Assigned To: Si Chen
>            Priority: Minor
>         Attachments: invoicenotax-2.diff, invoicenotax.diff
>
>
> This is one more from the series of making invoice usable for countries using VAT. Of course this might be used by others too.
> Attached diff adds a line in the invoice showing total without tax (i.e. currently without amount of items of Invoice Sales Tax type) and the corresponding function to calculate that.
> From my understanding by using this (together with previous diffs on showing Tax ID in the invoice), the invoice becomes usable in EU countries.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
12