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

    Details

    • 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:
      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.

        Issue Links

          Activity

          Hide
          pfm.smits Pierre Smits added a comment -

          You state:

          (approx. line no. 712 of InvoiceServices.java in hotwax commerce)

          Does that mean that is a different solution than the one in OOTB OFBiz?

          OFBiz != Hotwax Commerce

          Show
          pfm.smits Pierre Smits added a comment - You state: (approx. line no. 712 of InvoiceServices.java in hotwax commerce) Does that mean that is a different solution than the one in OOTB OFBiz? OFBiz != Hotwax Commerce
          Hide
          jacopoc Jacopo Cappellato added a comment -

          Pierre, that is the name of the platform we use in most of our projects (ootb OFBiz + some other goodies).
          The bug reported by Mohammad and his great analysis were based on it but are also valid for OFBiz, this is the reason he reported it here.
          I will update the text that slipped in by error and will commit a fix soon.

          Show
          jacopoc Jacopo Cappellato added a comment - Pierre, that is the name of the platform we use in most of our projects (ootb OFBiz + some other goodies). The bug reported by Mohammad and his great analysis were based on it but are also valid for OFBiz, this is the reason he reported it here. I will update the text that slipped in by error and will commit a fix soon.
          Hide
          pfm.smits Pierre Smits added a comment -

          Thanks for the clarification, Jacopo.

          Show
          pfm.smits Pierre Smits added a comment - Thanks for the clarification, Jacopo.
          Hide
          jacopoc Jacopo Cappellato added a comment -

          Thanks to you for spotting it!

          Show
          jacopoc Jacopo Cappellato added a comment - Thanks to you for spotting it!
          Hide
          jacopoc Jacopo Cappellato added a comment -

          Fixed with the following commits:
          12.04: 1674927
          13.07: 1674925
          14.12: 1674917
          trunk: 1674908

          Show
          jacopoc Jacopo Cappellato added a comment - Fixed with the following commits: 12.04: 1674927 13.07: 1674925 14.12: 1674917 trunk: 1674908

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development