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

Coupons discount full service price not considering proration

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.3
    • Fix Version/s: 3.5.2
    • Component/s: None
    • Labels:
      None

      Description

      TL;DR
      Invoice creation must use the blesta/pricing library.


      When a coupon line item is generated for a service, the coupon calculates its discount from the full service price. However, the full service price may not be the actual price billed.

      For example, if proration is enabled, the service price being billed may be less than the full service price. The coupon will then discount from the full price rather than the prorated price, causing too large of a discount, which may even lead to an invoice for a negative amount.

      e.g.
      $10.00 service
      $0.50 prorated cost of the service
      10% discount

      Line Item Cost $0.50
      Discount Amount $1.00 ($10 * 0.1)
      Total: -$0.50


      This issue applies to the coupon line item price when it is generated for an invoice. The totals displayed before the invoice is created appear to be correct as-is because they come from a separate calculation. When this issue is updated to support proration, we should consider the possibility of adding two line items for the coupons. One for the prorated amount over the prorated date range, and one for the full amount after the cut off day (if after the cut off day). Note that we must also consider whether the coupon recurs, and if not, it can only be applied to the prorated amount, and not the full amount after proration.

        Issue Links

          Activity

          tyson Tyson Phillips (Inactive) created issue -
          tyson Tyson Phillips (Inactive) made changes -
          Field Original Value New Value
          Rank Ranked higher
          tyson Tyson Phillips (Inactive) made changes -
          Description When a coupon line item is generated for a service, the coupon calculates its discount from the full service price. However, the full service price may not be the actual price billed.

          For example, if proration is enabled, the service price being billed may be less than the full service price. The coupon will then discount from the full price rather than the prorated price, causing too large of a discount, which may even lead to an invoice for a negative amount.

          e.g.
          $10.00 service
          $0.50 prorated cost of the service
          10% discount

          Line Item Cost $0.50
          Discount Amount $1.00 ($10 * 0.1)
          Total: -$0.50
          When a coupon line item is generated for a service, the coupon calculates its discount from the full service price. However, the full service price may not be the actual price billed.

          For example, if proration is enabled, the service price being billed may be less than the full service price. The coupon will then discount from the full price rather than the prorated price, causing too large of a discount, which may even lead to an invoice for a negative amount.

          e.g.
          $10.00 service
          $0.50 prorated cost of the service
          10% discount

          Line Item Cost $0.50
          Discount Amount $1.00 ($10 * 0.1)
          Total: -$0.50

          -----
          This issue applies to the coupon line item price when it is generated for an invoice. The totals displayed before the invoice is created appear to be correct as-is because they come from a separate calculation. When this issue is updated to support proration, we should consider the possibility of adding two line items for the coupons. One for the prorated amount over the prorated date range, and one for the full amount after the cut off day (if after the cut off day). Note that we must also consider whether the coupon recurs, and if not, it can only be applied to the prorated amount, and not the full amount after proration.
          tyson Tyson Phillips (Inactive) made changes -
          Link This issue relates to CORE-1541 [ CORE-1541 ]
          tyson Tyson Phillips (Inactive) made changes -
          Link This issue relates to CORE-1450 [ CORE-1450 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.5.0-b2 [ 10701 ]
          Fix Version/s 3.5.0-b1 [ 10401 ]
          tyson Tyson Phillips (Inactive) made changes -
          Link This issue is blocked by CORE-1638 [ CORE-1638 ]
          cody Cody Phillips (Inactive) made changes -
          Sprint 3.5.0 Sprint 5 [ 13 ]
          cody Cody Phillips (Inactive) made changes -
          Rank Ranked higher
          cody Cody Phillips (Inactive) made changes -
          Sprint 3.5.0 Sprint 5 [ 13 ] 3.5.0 Sprint 6 [ 14 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.5.0-b3 [ 10703 ]
          Fix Version/s 3.5.0-b2 [ 10701 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.5.0-b4 [ 10704 ]
          Fix Version/s 3.5.0-b3 [ 10703 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.5.0-b5 [ 10705 ]
          Fix Version/s 3.5.0-b4 [ 10704 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.5.0 [ 10702 ]
          Fix Version/s 3.5.0-b5 [ 10705 ]
          admin Paul Phillips made changes -
          Fix Version/s 3.5.1 [ 10706 ]
          Fix Version/s 3.5.0 [ 10702 ]
          admin Paul Phillips made changes -
          Sprint 3.5.0 Sprint 6 [ 14 ]
          admin Paul Phillips made changes -
          Rank Ranked lower
          cody Cody Phillips (Inactive) made changes -
          Description When a coupon line item is generated for a service, the coupon calculates its discount from the full service price. However, the full service price may not be the actual price billed.

          For example, if proration is enabled, the service price being billed may be less than the full service price. The coupon will then discount from the full price rather than the prorated price, causing too large of a discount, which may even lead to an invoice for a negative amount.

          e.g.
          $10.00 service
          $0.50 prorated cost of the service
          10% discount

          Line Item Cost $0.50
          Discount Amount $1.00 ($10 * 0.1)
          Total: -$0.50

          -----
          This issue applies to the coupon line item price when it is generated for an invoice. The totals displayed before the invoice is created appear to be correct as-is because they come from a separate calculation. When this issue is updated to support proration, we should consider the possibility of adding two line items for the coupons. One for the prorated amount over the prorated date range, and one for the full amount after the cut off day (if after the cut off day). Note that we must also consider whether the coupon recurs, and if not, it can only be applied to the prorated amount, and not the full amount after proration.
          *TL;DR*
          Invoice creation must use the *blesta/pricing* library.

          ----

          When a coupon line item is generated for a service, the coupon calculates its discount from the full service price. However, the full service price may not be the actual price billed.

          For example, if proration is enabled, the service price being billed may be less than the full service price. The coupon will then discount from the full price rather than the prorated price, causing too large of a discount, which may even lead to an invoice for a negative amount.

          e.g.
          $10.00 service
          $0.50 prorated cost of the service
          10% discount

          Line Item Cost $0.50
          Discount Amount $1.00 ($10 * 0.1)
          Total: -$0.50

          -----
          This issue applies to the coupon line item price when it is generated for an invoice. The totals displayed before the invoice is created appear to be correct as-is because they come from a separate calculation. When this issue is updated to support proration, we should consider the possibility of adding two line items for the coupons. One for the prorated amount over the prorated date range, and one for the full amount after the cut off day (if after the cut off day). Note that we must also consider whether the coupon recurs, and if not, it can only be applied to the prorated amount, and not the full amount after proration.
          admin Paul Phillips made changes -
          Fix Version/s 3.5.2 [ 10707 ]
          Fix Version/s 3.5.1 [ 10706 ]
          tyson Tyson Phillips (Inactive) made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          tyson Tyson Phillips (Inactive) made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              tyson Tyson Phillips (Inactive)
              Reporter:
              tyson Tyson Phillips (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                4/Aug/15