Negative numbers (discounts)

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2061
    Fuquar7
    Participant

    In older versions I was able to input negative numbers in the price box when editing/creating an invoice OR when processing a payment. Now when I try, I get an error message “Invalid number entered”

    Is there anyway to change this?

    #2062
    RRowley
    Participant

    Please give me examples of what happens in your transactions that requires a negative number?

    #2078
    Fuquar7
    Participant

    When I used to issue a credit to a customer all I had to do was put -10.00 (or whatever amount) and it would work out great. Now I get the error pictured and am unable to do so.
    I am not sure what is controlling the input to that text field.

    #2081
    RRowley
    Participant

    The field validation routine obviously doesn’t allow you to type in a negative value. You can create a product for the credit with a negative amount. This will set the field to the negative value when you select that product. This works for fixed value credits but not so much for credits that are arbitrary, set based on the particular situation.

    For example, I have a product, “Labor”, that is $30.00 per hour and one for “Labor (Credit)” for -$30.00 per hour. This works for me because my labor cost is fixed and hence a credit is similarly fixed.

    Let me know if this work around addresses your need not just for this circumstance but on going for future situations.

    #2082
    Fuquar7
    Participant

    I chased down the form validation script. It’s located in /include/js/globalizedNumberValidator.js

    I made it fast and simple, I commented lines 72-76

    It may not be the correct way to do it, but it works. I am now able to enter negative values like “-109.53” as a credit.

    #2084
    RRowley
    Participant

    Refer to the Extensions topic on left menu. This should explain how to make changes to your local copy of code in such a way that future updates don’t load over them.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.