[jira] Created: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

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

[jira] Created: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

Nicolas Malin (Jira)
BigDecimal to Double precision problem in PaymentGatewayServices
----------------------------------------------------------------

                 Key: OFBIZ-1066
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1066
             Project: OFBiz
          Issue Type: Bug
          Components: accounting
            Reporter: Andrew Sykes
            Priority: Minor
         Attachments: PaymentGatewayServices.java.patch

We encountered a error where amountToCapture was not the same as the authorisation amount due to the decimal place precision.

This is because amountToCapture is populated from captureAmountBd, which is instantiated like this...
BigDecimal captureAmountBd = new BigDecimal( captureAmount.doubleValue());

This can be resolved by rounding up when we assign to amountToCapture.


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Sykes updated OFBIZ-1066:
--------------------------------

    Attachment: PaymentGatewayServices.java.patch

> BigDecimal to Double precision problem in PaymentGatewayServices
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-1066
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1066
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Andrew Sykes
>            Priority: Minor
>         Attachments: PaymentGatewayServices.java.patch
>
>
> We encountered a error where amountToCapture was not the same as the authorisation amount due to the decimal place precision.
> This is because amountToCapture is populated from captureAmountBd, which is instantiated like this...
> BigDecimal captureAmountBd = new BigDecimal( captureAmount.doubleValue());
> This can be resolved by rounding up when we assign to amountToCapture.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

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

     [ https://issues.apache.org/jira/browse/OFBIZ-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nicolas malin updated OFBIZ-1066:
---------------------------------

    Attachment: PaymentGatewayServices.java

> BigDecimal to Double precision problem in PaymentGatewayServices
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-1066
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1066
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Andrew Sykes
>            Priority: Minor
>         Attachments: PaymentGatewayServices.java, PaymentGatewayServices.java.patch
>
>
> We encountered a error where amountToCapture was not the same as the authorisation amount due to the decimal place precision.
> This is because amountToCapture is populated from captureAmountBd, which is instantiated like this...
> BigDecimal captureAmountBd = new BigDecimal( captureAmount.doubleValue());
> This can be resolved by rounding up when we assign to amountToCapture.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501846 ]

nicolas malin commented on OFBIZ-1066:
--------------------------------------

Hi Andrew,

Your patch is rejected in my ofbiz environment. Do you create it from svn trunk ?

I create new patch to use decimals and rounding on BigDecimal scale.

Nicolas

> BigDecimal to Double precision problem in PaymentGatewayServices
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-1066
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1066
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Andrew Sykes
>            Priority: Minor
>         Attachments: PaymentGatewayServices.java, PaymentGatewayServices.java.patch
>
>
> We encountered a error where amountToCapture was not the same as the authorisation amount due to the decimal place precision.
> This is because amountToCapture is populated from captureAmountBd, which is instantiated like this...
> BigDecimal captureAmountBd = new BigDecimal( captureAmount.doubleValue());
> This can be resolved by rounding up when we assign to amountToCapture.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

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

     [ https://issues.apache.org/jira/browse/OFBIZ-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nicolas malin updated OFBIZ-1066:
---------------------------------

    Attachment: PaymentGatewayServices-ofbiz.java.patch

> BigDecimal to Double precision problem in PaymentGatewayServices
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-1066
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1066
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Andrew Sykes
>            Priority: Minor
>         Attachments: PaymentGatewayServices-ofbiz.java.patch, PaymentGatewayServices.java.patch
>
>
> We encountered a error where amountToCapture was not the same as the authorisation amount due to the decimal place precision.
> This is because amountToCapture is populated from captureAmountBd, which is instantiated like this...
> BigDecimal captureAmountBd = new BigDecimal( captureAmount.doubleValue());
> This can be resolved by rounding up when we assign to amountToCapture.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

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

     [ https://issues.apache.org/jira/browse/OFBIZ-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nicolas malin updated OFBIZ-1066:
---------------------------------

    Attachment:     (was: PaymentGatewayServices.java)

> BigDecimal to Double precision problem in PaymentGatewayServices
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-1066
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1066
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Andrew Sykes
>            Priority: Minor
>         Attachments: PaymentGatewayServices-ofbiz.java.patch, PaymentGatewayServices.java.patch
>
>
> We encountered a error where amountToCapture was not the same as the authorisation amount due to the decimal place precision.
> This is because amountToCapture is populated from captureAmountBd, which is instantiated like this...
> BigDecimal captureAmountBd = new BigDecimal( captureAmount.doubleValue());
> This can be resolved by rounding up when we assign to amountToCapture.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

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

     [ https://issues.apache.org/jira/browse/OFBIZ-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacopo Cappellato reassigned OFBIZ-1066:
----------------------------------------

    Assignee: Jacopo Cappellato

> BigDecimal to Double precision problem in PaymentGatewayServices
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-1066
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1066
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Andrew Sykes
>            Assignee: Jacopo Cappellato
>            Priority: Minor
>         Attachments: PaymentGatewayServices-ofbiz.java.patch, PaymentGatewayServices.java.patch
>
>
> We encountered a error where amountToCapture was not the same as the authorisation amount due to the decimal place precision.
> This is because amountToCapture is populated from captureAmountBd, which is instantiated like this...
> BigDecimal captureAmountBd = new BigDecimal( captureAmount.doubleValue());
> This can be resolved by rounding up when we assign to amountToCapture.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

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

     [ https://issues.apache.org/jira/browse/OFBIZ-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacopo Cappellato closed OFBIZ-1066.
------------------------------------

    Resolution: Fixed

Nicolas, thanks for the patch; it is in rev. 544783
Andrew, I think that your patch was for an older revision (I very recently updated that class): could you please test if the same happens in the current version?



> BigDecimal to Double precision problem in PaymentGatewayServices
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-1066
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1066
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Andrew Sykes
>            Assignee: Jacopo Cappellato
>            Priority: Minor
>         Attachments: PaymentGatewayServices-ofbiz.java.patch, PaymentGatewayServices.java.patch
>
>
> We encountered a error where amountToCapture was not the same as the authorisation amount due to the decimal place precision.
> This is because amountToCapture is populated from captureAmountBd, which is instantiated like this...
> BigDecimal captureAmountBd = new BigDecimal( captureAmount.doubleValue());
> This can be resolved by rounding up when we assign to amountToCapture.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501918 ]

Andrew Sykes commented on OFBIZ-1066:
-------------------------------------

Jacopo,

Yes, my patch was a real mess, I made it on a recent revision then modified it on an older rev by mistake, so the bug was right, but the patch was a real mess!

Thanks for fixing Nicolas.

> BigDecimal to Double precision problem in PaymentGatewayServices
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-1066
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1066
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Andrew Sykes
>            Assignee: Jacopo Cappellato
>            Priority: Minor
>         Attachments: PaymentGatewayServices-ofbiz.java.patch, PaymentGatewayServices.java.patch
>
>
> We encountered a error where amountToCapture was not the same as the authorisation amount due to the decimal place precision.
> This is because amountToCapture is populated from captureAmountBd, which is instantiated like this...
> BigDecimal captureAmountBd = new BigDecimal( captureAmount.doubleValue());
> This can be resolved by rounding up when we assign to amountToCapture.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1066) BigDecimal to Double precision problem in PaymentGatewayServices

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501923 ]

nicolas malin commented on OFBIZ-1066:
--------------------------------------

It a pleasure for me ;)

Thanks jacopo for commit it and thanks androw for your jira.

> BigDecimal to Double precision problem in PaymentGatewayServices
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-1066
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1066
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>            Reporter: Andrew Sykes
>            Assignee: Jacopo Cappellato
>            Priority: Minor
>         Attachments: PaymentGatewayServices-ofbiz.java.patch, PaymentGatewayServices.java.patch
>
>
> We encountered a error where amountToCapture was not the same as the authorisation amount due to the decimal place precision.
> This is because amountToCapture is populated from captureAmountBd, which is instantiated like this...
> BigDecimal captureAmountBd = new BigDecimal( captureAmount.doubleValue());
> This can be resolved by rounding up when we assign to amountToCapture.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.