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

Order Item with multiple qty reserved with multiple inventory item not correctly recorded into Shipment_Item_Billing

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 14.12.01, 16.11.01
    • Component/s: order
    • Labels:
      None

      Description

      Say an order Item had a quantity of 2. It seems item issuance was done for these 2 quantity from two different inventory_item records. So instead of ITEM_ISSUANCE.QUANTITY = 2, two different ITEM_ISSUSANCE records are created which when translated into the invoice, created two different invoice_item lines, one for each quantity but SHIPMENT_ITEM_BILLING is recording only one invoice item

      Steps to reproduce:

      1. Take a product and make sure we have two different inventory item available (received) in system with 1 unit each
      2. Place a sales order with 2 units of above product added as order item. This should reserve both the inventory items available in step#1
      3. Ship and complete the order item
      4. This would create two different invoice item lines with each of the inventory items but SHIPMENT_ITEM_BILLING would have only 1 line created for it.

      Expected Behavior:
      SHIPMENT_ITEM_BILLING should have records created against each invoice lines with corresponding invoice_id and invoice_item_seq_id.

        Activity

        Hide
        ankush.upadhyay Ankush Upadhyay added a comment -

        Inside "createInvoiceForOrder" service, ShipmentItemBilling creation logic implemented in a way that if system found any ShipmentItemBilling record for given shipmentId and shipmentItemSeqId then skip creating new ShipmentItemBilling record. But in the case of order Item had a quantity of 2 and reserved with 2 different inventoryItem, at that time 2 invoiceItem created for this order item(one for each quantity because inventory item different).

        To fix this issue we have changed the ShipmentItemBilling fetching logic based on shipmentId, shipmentItemSeqId, invoiceId, invoiceItemSeqId to create 2 ShipmentItemBilling records (for both invoice items).

        Show
        ankush.upadhyay Ankush Upadhyay added a comment - Inside "createInvoiceForOrder" service, ShipmentItemBilling creation logic implemented in a way that if system found any ShipmentItemBilling record for given shipmentId and shipmentItemSeqId then skip creating new ShipmentItemBilling record. But in the case of order Item had a quantity of 2 and reserved with 2 different inventoryItem, at that time 2 invoiceItem created for this order item(one for each quantity because inventory item different). To fix this issue we have changed the ShipmentItemBilling fetching logic based on shipmentId, shipmentItemSeqId, invoiceId, invoiceItemSeqId to create 2 ShipmentItemBilling records (for both invoice items).
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Thanks Swapnil for reporting the issue and Ankush for providing the patch.
        Your patch has been committed at
        Trunk at r#1724951
        15.12 at r#1724952
        14.12 at r#1724953

        Show
        deepak.dixit Deepak Dixit added a comment - Thanks Swapnil for reporting the issue and Ankush for providing the patch. Your patch has been committed at Trunk at r#1724951 15.12 at r#1724952 14.12 at r#1724953

          People

          • Assignee:
            deepak.dixit Deepak Dixit
            Reporter:
            swash78 Swapnil Shah
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development