Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-3321

Coupons may cause negative invoices to be generated

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.8.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      To reproduce:

      • Create a coupon for 100%
      • Start ordering an item in the order form
      • Apply 100% coupon
      • Finish order and see negative invoice is created

        Activity

        Hide
        jonathan Jonathan Reissmueller added a comment -

        Looks like this is caused by a package not being taxable. Tax will be applied to the coupon but not the service.

        Show
        jonathan Jonathan Reissmueller added a comment - Looks like this is caused by a package not being taxable. Tax will be applied to the coupon but not the service.
        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        If some line items are not taxable (e.g. setup fees), then this will still result in a negative invoice. Additionally, any proration that occurs may also cause a positive or negative value on a 100% coupon because the sum of the rounded line item prices may be slightly above or below the rounded coupon amount.

        I don't see a suitable way to avoid this behavior without integrating updates to the way invoice data is stored. That is, tax rules would need to be stored for each line item and the amounts would have to rounded to the currency's precision prior to storage.

        Show
        tyson Tyson Phillips (Inactive) added a comment - If some line items are not taxable (e.g. setup fees), then this will still result in a negative invoice. Additionally, any proration that occurs may also cause a positive or negative value on a 100% coupon because the sum of the rounded line item prices may be slightly above or below the rounded coupon amount. I don't see a suitable way to avoid this behavior without integrating updates to the way invoice data is stored. That is, tax rules would need to be stored for each line item and the amounts would have to rounded to the currency's precision prior to storage.

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              23/Dec/19

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 40 minutes
              40m

                Agile