Error on Tender amount >999.99

indokely
2010-03-09
2014-03-20
  • indokely
    indokely
    2010-03-09

    If you try to made a payment more than 999.99 means for 1,000.00 or greater, you will get an error ( nothing as popup but in logs numberFormatException)

    Reason is

    1st
    com.floreantpos.ui.views.payment.CashPaymentView
    in private void doFinish(java.awt.event.ActionEvent evt)
    in the above funtion u are send the amonut (1,000.00) in   Double.parseDouble with  ",". It will throw an error( number format exception)
    soln:
                    String sAmount = tfAmountTendered.getText();
                    String sComaRemovedAmount = null;
                    sComaRemovedAmount = sAmount.replaceAll(",", "");              

                    double tenderedAmount = Double.parseDouble(sComaRemovedAmount);

    Please send in proper format

    2nd , Once u dont with 1st 
    com.floreantpos.ui.views.PaymentView
    in public void settleTickets function
    You again doing formating
    double totalAmount = Double.parseDouble(Application.formatNumber(getTotalAmount()));
    double dueAmountBeforePaid = Double.parseDouble(Application.formatNumber(getDueAmount()));
    this not required. We reuire the formation only for dispay purpose but when we send the data in DB , we dont send with ","

    3rd…. after remove the 2nd bud
    com.floreantpos.services.PosTransactionService
    in public void settleTickets function
    You again doing formating
    double paidAmount = Double.parseDouble(Application.formatNumber(ticket.getPaidAmount()));
    double dueAmount = Double.parseDouble(Application.formatNumber(ticket.getDueAmount()));
    this is also not required.

    Please remove these this from files and enjoy the payment more than 999.99

    Cheers!!!
    Indokely.

     
  • indokely
    indokely
    2010-03-09

    **  2nd , Once u done with 1st

     
  • genrom0
    genrom0
    2010-03-26

    Hi Indokely,

    Thanks, I needed this code.
    Do you have other codes which may be useful to florantpos?

    have nice day

     
  • Is this fix implemented in version 1.0.2?

     
  • Floreant POS
    Floreant POS
    2010-04-08

    >>>
    1st
    com.floreantpos.ui.views.payment.CashPaymentView
    in private void doFinish(java.awt.event.ActionEvent evt)
    in the above funtion u are send the amonut (1,000.00) in Double.parseDouble with ",". It will throw an error( number format exception)
    soln:
    String sAmount = tfAmountTendered.getText();
    String sComaRemovedAmount = null;
    sComaRemovedAmount = sAmount.replaceAll(",", "");

    double tenderedAmount = Double.parseDouble(sComaRemovedAmount);
    >>>

    What problem did you find in this code? This is not throwing any exception. We may try by changing locale. What is your locale?

     
  • indokely
    indokely
    2010-04-08

    this is ur code.
    private void doFinish(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_doFinish
    double tenderedAmount = Double.parseDouble(tfAmountTendered.getText());
    settleTickets(tenderedAmount, 0, new CashTransaction(), null, null);
    }//GEN-LAST:event_doFinish

    so when the amount is 1,000.00, the double.parseDouble throws an error because this function has cant parse the ",".

    so i wrote this code
    String sAmount = tfAmountTendered.getText();
    String sComaRemovedAmount = null;
    sComaRemovedAmount = sAmount.replaceAll(",", "");
    double tenderedAmount = Double.parseDouble(sComaRemovedAmount);

    I am from india.

     
  • Arnd
    Arnd
    2010-05-14

    Hi,

    could you release a new build with the above fixes included? I am currently evaluating the software and this bug makes evaluation impossible for me.

    cheers,

       Arnd

     
  • devdrone19
    devdrone19
    2010-08-25

    I independently found this error as did another poster Cannot print the bill in a different locale than yours.

    It is still there as of v1.0_3 sources.

    I have fixed it and uploaded a patch of all code using Double.parseDouble(). This call should be changed to a cleverer function. I have added such a function to Application.java. It will work for all locales. The solution (removing the commas) proposed above will not work for all locales since some locales use comma as decimal separator

    The patch  is uploaded in the Tracker/Patches menu of this sourceforge website.

    Thanks again for a great piece of software.

    MfG

     
  • monk
    monk
    2011-03-16

    @devdrone19, in what folder of the source folder will the patch be in. thank you.

     
  • monk
    monk
    2011-03-16

    i was able to apply in the IDE enviroment but came with a error, "patch cannot be applied in the selected context" please help.

     
  • Andy Kiloh
    Andy Kiloh
    2011-05-24

    Hi All,  I am not a technical person so am having problems sorting out the settling of bills greater than 999.99
    Can anyone help me with the patch and how to install it - in very simple english please !

    Thanks

     
  • bravehurts
    bravehurts
    2011-06-26

    I applied this patch. This didn't solve the problem for countries where the decimal separator is a semicolon (not decimal point). German number/currency format  -> 999.999,99€.
    If I apply the english currency format to my system every thing works fine.

     
  • Altai
    Altai
    2011-10-23

    hello guys
    i need your help
    i can not use number format code
    can you give me fixed version.

    Help ME

     
  • indokely
    indokely
    2011-10-23

    @altaimn

    contact me @
    indokely@gmail.com
    +91-9552509869

     
  • Altai
    Altai
    2011-10-23

    Hi all
    Help me Help me

     
  • Altai
    Altai
    2011-10-28

    I was use"numberformat-bug.patch"
    this is good fix

    Good luck Asian Users

     
    • kelechibg
      kelechibg
      2014-03-20

      hi Altai, Can you send this patch? thanks. to kelechimicheals@gmail.com

       
  • jaggatw
    jaggatw
    2012-10-10

    how do I aply numberformat-bug.patch?
    this is my problem
    thanks a lot!

     
  • I am facing the same issue… i can not finished ticket GREATER than amount 999. I am from INDIA. I Have got your patch but there isn't any help on How to apply PATCH.. so please provide just a short information on Forum for How to Apply Patch….

     
  • viafrica
    viafrica
    2013-03-30

    I am also trying to inherit the patch, but how can I do so? Please help as with this error the software becomes not really usable. Thanks!

     
  • viafrica
    viafrica
    2013-03-30

    Or better, can I download a version that already has this patch? Thanks!
    By the way, great software!

     
  • MShahriar
    MShahriar
    2013-08-30

    The bug is fixed in version 1.4-SNAPSHOT, which is the current version. You can checkout the code. It will be shipped with 1.4 final version.

     
  • kelechibg
    kelechibg
    2014-03-20

    Hello I am facing this same problem with an implementation for our small food joint. How do I get this patch. or apply it?