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


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Release Branch 14.12, Trunk
    • Fix Version/s: 14.12.01, 12.04.06, 13.07.02, 16.11.01
    • Component/s: order
    • Labels:



      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.


      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.


      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.


          Issue Links



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


                • Created: