[ 
https://issues.apache.org/jira/browse/OFBIZ-6806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15103078#comment-15103078
 ] 

Ankush Upadhyay commented on OFBIZ-6806:
----------------------------------------

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).

> Order Item with multiple qty reserved with multiple inventory item not 
> correctly recorded into Shipment_Item_Billing
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-6806
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6806
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>            Reporter: Swapnil Shah
>         Attachments: FixedShipmentItemBilling.patch
>
>
> 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:
> # Take a product and make sure we have two different inventory item available 
> (received) in system with 1 unit each
> # 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
> # Ship and complete the order item
> # 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to