Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-6269

Pro-rate shipping calculation is generating incorrect invoice in case of order with subtotal $0.00

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Release Branch 14.12, Trunk
    • 14.12.01, 12.04.06, 13.07.02, 16.11.01
    • order
    • None

    Description

      Scenario:

      I have finished products with price $0.00 in my system. There is a requirement to place an order with $0.00 price product. As I also need to fulfill this order, I need to have Shipping method applied here (Other than No Shipping method). So what I am doing is place the order with $0.00 subtotal and Shipping lets say of $20.00 so that order total is $20.00. The order gets placed successfully in Ofbiz OOTB.

      Now in order to make the order total $0.00 (requirement of not charging any amount for the order) I apply manual discount of $20.00 from order view page to cancel the shipping charges of $20.00.

      Issue:

      The issue comes when fulfilling the order. The invoice created on quick shipping the order is not correct. Shipping amount and discount are not included in invoice.

      Reason:

      The issue is coming in 'createInvoiceForOrder' service. Here in this service, invoice items corresponding to all the order items and adjustments are created. At time of invoicing adjustment of type 'SHIPPING_CHARGES' (approx. line no. 712 of InvoiceServices.java), calculation of pro-rate shipping is done. This is where we are having issue in our scenario. The shippable total in our case is 0. This in turn make the 'divisor' and 'multiplier' used for pro-rate shipping 0. That is why the Shipping Adjustment is not getting invoiced in our case.

      Attachments

        Issue Links

          Activity

            People

              jacopoc Jacopo Cappellato
              Mohammad K Mohammad Kathawala
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: