OFBiz
  1. OFBiz
  2. OFBIZ-4630

Wrong invoice for drop shipment orders when you cancel order item(s)

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Release Branch 11.04, SVN trunk
    • Fix Version/s: None
    • Component/s: accounting, order
    • Labels:
      None

      Description

      To produce the problem, please, use the demo data (from OFBiz release), do not use any promotions. The sales tax in my case is set in VAT style, i.e. 19% for all products and shipping charge, and I retired all demo sales taxes for USA.

      Please, create an order with drop shipment products.
      In my test case, I added 2 "dropShip1" and 1 "dropShip2" products, so we have 2 shipping groups, I set the 10 USD cost for both shipping charges.

      The payment way : is offline payment

      As result, I have one Sales order and 2 Purchase orders.
      Please, see the "1-just_created_order.PNG" screenshot.
      Now, I am going to cancel one of item, so the system makes tax correction, you can see the result on the next screenshot : "2-item_is_cancelled.PNG".
      On this step all look correct, the total due has the right value.

      Now, I have completed the order, by completing the purchase order.
      What we have you can see on the next screenshot: "3-order-completed.PNG"

      Also, the system generated the invoice.
      But the invoice looks strange, you can see it in the attachment:
      "CI5-invoice.PNG".

      Total sum is $41.60 instead of $45.19, Total excl. tax is also wrong.

      dropShip1 DropShip from DemoSupplier 2 $13.99 $27.98
      Invoice Item Sales Tax $5.32
      Invoice Item Shipping and Handling $10.00
      Invoice Item Shipping and Handling $10.00
      Invoice Item Shipping and Handling ($10.00)
      Invoice Item Sales Tax $1.90
      Invoice Item Sales Tax $2.03
      Tax adjustment due to order change ($5.63)
      TOTAL $41.60
      Total excl. tax $37.98

      It is obvious that there is a mistake, I think on the invoice creating phase.
      From my side, I can say that is not convenient to have cancelled shipping charges in the invoice.
      Also, I prefer a little bit another way for tax correction (recalcOrderTax service).
      Why we add a header compensation adjustment to the order in case if an item was cancelled and the tax must not used. Why not to create the compensation adjustment and associate it with the according ship group and item?
      Example, if an item is cancelled its sales tax will be reduced to zero by the same sales tax amount(s) but with negative sign.

      1. CI5-invoice.pdf
        10 kB
        Sergei Biletnikov
      2. 3-order-completed.PNG
        42 kB
        Sergei Biletnikov
      3. 1-just_created_order.PNG
        46 kB
        Sergei Biletnikov
      4. 2-item_is_cancelled.PNG
        44 kB
        Sergei Biletnikov

        Activity

        Sergei Biletnikov created issue -
        Sergei Biletnikov made changes -
        Field Original Value New Value
        Attachment CI5-invoice.pdf [ 12508260 ]
        Sergei Biletnikov made changes -
        Attachment 3-order-completed.PNG [ 12508261 ]
        Attachment 1-just_created_order.PNG [ 12508262 ]
        Attachment 2-item_is_cancelled.PNG [ 12508263 ]
        Sergei Biletnikov made changes -
        Description To produce the problem, please, use the demo data (from OFBiz release), do not use any promotions. The sales tax in my case is set in VAT style, i.e. 19% for all products and shipping charge, and I retired all demo sales taxes for USA.

        Please, create an order with drop shipment products.
        In my test case, I added 2 "dropShip1" and 1 "dropShip2" products, so we have 2 shipping groups, I set the 10 USD cost for both shipping charges.

        The payment way : is offline payment

        As result, I have one Sales order and 2 Purchase orders.
        Please, see the "1-just_created_order.PNG" screenshot.
        Now, I am going to cancel one of item, so the system makes tax correction, you can see the result on the next screenshot : "2-item_is_cancelled.PNG".
        On this step all look correct, the total due has the right value.

        Now, I have completed the order, by completing the purchase order.
        What we have you can see on the next screenshot: "3-order-completed.PNG"

        Also, the system generated the invoice.
        But the invoice looks strange, you can see it in the attachment:
        "CI5-invoice.PNG".

        Total sum is $41.60 instead of $45.19, Total excl. tax is also wrong.

        dropShip1 DropShip from DemoSupplier 2 $13.99 $27.98
                               Invoice Item Sales Tax $5.32
                   Invoice Item Shipping and Handling $10.00
                   Invoice Item Shipping and Handling $10.00
                   Invoice Item Shipping and Handling ($10.00)
                               Invoice Item Sales Tax $1.90
                               Invoice Item Sales Tax $2.03
                  Tax adjustment due to order change ($5.63)
                                                TOTAL $41.60
                                      Total excl. tax $37.98

        It is obvious that there is a mistake, I think on the invoice creating phase.
        From my side, I can say that is not convenient to have cancelled shipping charges in the invoice.
        Also, I prefer a little bit another way for tax correction (recalcTotalTax service).
        Why we add a header compensation adjustment to the order in case if an item was cancelled and the tax must not used. Why not to create the compensation adjustment and associate it with the according ship group and item?
        Example, if an item is cancelled its sales tax will be reduced to zero by the same sales tax amount(s) but with negative sign.
        To produce the problem, please, use the demo data (from OFBiz release), do not use any promotions. The sales tax in my case is set in VAT style, i.e. 19% for all products and shipping charge, and I retired all demo sales taxes for USA.

        Please, create an order with drop shipment products.
        In my test case, I added 2 "dropShip1" and 1 "dropShip2" products, so we have 2 shipping groups, I set the 10 USD cost for both shipping charges.

        The payment way : is offline payment

        As result, I have one Sales order and 2 Purchase orders.
        Please, see the "1-just_created_order.PNG" screenshot.
        Now, I am going to cancel one of item, so the system makes tax correction, you can see the result on the next screenshot : "2-item_is_cancelled.PNG".
        On this step all look correct, the total due has the right value.

        Now, I have completed the order, by completing the purchase order.
        What we have you can see on the next screenshot: "3-order-completed.PNG"

        Also, the system generated the invoice.
        But the invoice looks strange, you can see it in the attachment:
        "CI5-invoice.PNG".

        Total sum is $41.60 instead of $45.19, Total excl. tax is also wrong.

        dropShip1 DropShip from DemoSupplier 2 $13.99 $27.98
                               Invoice Item Sales Tax $5.32
                   Invoice Item Shipping and Handling $10.00
                   Invoice Item Shipping and Handling $10.00
                   Invoice Item Shipping and Handling ($10.00)
                               Invoice Item Sales Tax $1.90
                               Invoice Item Sales Tax $2.03
                  Tax adjustment due to order change ($5.63)
                                                TOTAL $41.60
                                      Total excl. tax $37.98

        It is obvious that there is a mistake, I think on the invoice creating phase.
        From my side, I can say that is not convenient to have cancelled shipping charges in the invoice.
        Also, I prefer a little bit another way for tax correction (recalcOrderTax service).
        Why we add a header compensation adjustment to the order in case if an item was cancelled and the tax must not used. Why not to create the compensation adjustment and associate it with the according ship group and item?
        Example, if an item is cancelled its sales tax will be reduced to zero by the same sales tax amount(s) but with negative sign.
        Hide
        Jeffrey Paul Prickett added a comment -

        The difference is the Item Sales Tax of 2.03 and the adjustment to the sales tax of -5.63. If you remove these the order totals correctly. I will see if I can fix it.

        Show
        Jeffrey Paul Prickett added a comment - The difference is the Item Sales Tax of 2.03 and the adjustment to the sales tax of -5.63. If you remove these the order totals correctly. I will see if I can fix it.

          People

          • Assignee:
            Unassigned
            Reporter:
            Sergei Biletnikov
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development