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

Christian Carlow edited comment on OFBIZ-5345 at 10/14/13 1:47 PM:
-------------------------------------------------------------------

Hey Jacopo,

1.  Create a sales order for DemoCustomer with 1 product WG-1000
2.  Create another sales order for DemoCustomer with 1 product WG-1000
3.  Click "New Shipment for Ship Group" for the ship group of the second sales 
order created
4.  Click on the Order Items tab
5.  Click the "Issue All" button to issue 1 item of the second order created to 
the shipment
6.  Change the Order Id in the "Add Items From Order" section above to the 
orderId of the first order created
7.  Click the "Issue All" button to issue 1 item of the first order created to 
the shipment
8.  Click on the "Edit tab, change the status to "Pick" or "Pack" and then 
click the Update button.




was (Author: ofbizzer):
Hey Jacopo,

1.  Create a sales order for DemoCustomer with 1 product WG-1000
2.  Create another sales order for DemoCustomer with 1 product WG-1000
3.  Click "Create New Shipment" for the ship group of the second sales order 
created
4.  Click on the Order Items tab
5.  Click the "Issue All" button to issue 1 item of the second order created to 
the shipment
6.  Change the Order Id in the "Add Items From Order" section above to the 
orderId of the first order created
7.  Click the "Issue All" button to issue 1 item of the first order created to 
the shipment
8.  Click on the "Edit tab, change the status to "Pick" or "Pack" and then 
click the Update button.



> Cannot pick or pack shipment for mutiple sales orders
> -----------------------------------------------------
>
>                 Key: OFBIZ-5345
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5345
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: Release Branch 12.04
>            Reporter: Christian Carlow
>         Attachments: InvoiceServices.java.patch, InvoiceServices.xml.patch
>
>
> I get this error when trying to change the statusId of a shipment to picked 
> or packed:
> Error calling event: org.ofbiz.webapp.event.EventHandlerException: Service 
> invocation error (Could not commit transaction for service [updateShipment] 
> call: Roll back error, could not commit transaction, was rolled back instead 
> because of: Failure in create operation for entity [InvoiceRole]: 
> org.ofbiz.entity.GenericEntityException: Error while inserting: 
> [GenericEntity:InvoiceRole][createdStamp,2013-10-09 
> 13:13:57.498(java.sql.Timestamp)][createdTxStamp,2013-10-09 
> 13:13:49.522(java.sql.Timestamp)][datetimePerformed,2013-10-09 
> 13:13:57.498(java.sql.Timestamp)][invoiceId,CI6(java.lang.String)][lastUpdatedStamp,2013-10-09
>  13:13:57.498(java.sql.Timestamp)][lastUpdatedTxStamp,2013-10-09 
> 13:13:49.522(java.sql.Timestamp)][partyId,DemoCustCompany(java.lang.String)][roleTypeId,PLACING_CUSTOMER(java.lang.String)]
>  (SQL Exception while executing the following:INSERT INTO public.INVOICE_ROLE 
> (INVOICE_ID, PARTY_ID, ROLE_TYPE_ID, DATETIME_PERFORMED, PERCENTAGE, 
> LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) 
> VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates 
> unique constraint "pk_invoice_role"<br/>  Detail: Key (invoice_id, party_id, 
> role_type_id)=(CI6, DemoCustCompany, PLACING_CUSTOMER) already exists.)). 
> Rolling back transaction.org.ofbiz.entity.GenericEntityException: Error while 
> inserting: [GenericEntity:InvoiceRole][createdStamp,2013-10-09 
> 13:13:57.498(java.sql.Timestamp)][createdTxStamp,2013-10-09 
> 13:13:49.522(java.sql.Timestamp)][datetimePerformed,2013-10-09 
> 13:13:57.498(java.sql.Timestamp)][invoiceId,CI6(java.lang.String)][lastUpdatedStamp,2013-10-09
>  13:13:57.498(java.sql.Timestamp)][lastUpdatedTxStamp,2013-10-09 
> 13:13:49.522(java.sql.Timestamp)][partyId,DemoCustCompany(java.lang.String)][roleTypeId,PLACING_CUSTOMER(java.lang.String)]
>  (SQL Exception while executing the following:INSERT INTO public.INVOICE_ROLE 
> (INVOICE_ID, PARTY_ID, ROLE_TYPE_ID, DATETIME_PERFORMED, PERCENTAGE, 
> LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) 
> VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates 
> unique constraint "pk_invoice_role"<br/>  Detail: Key (invoice_id, party_id, 
> role_type_id)=(CI6, DemoCustCompany, PLACING_CUSTOMER) already exists.)) 
> (Error while inserting: [GenericEntity:InvoiceRole][createdStamp,2013-10-09 
> 13:13:57.498(java.sql.Timestamp)][createdTxStamp,2013-10-09 
> 13:13:49.522(java.sql.Timestamp)][datetimePerformed,2013-10-09 
> 13:13:57.498(java.sql.Timestamp)][invoiceId,CI6(java.lang.String)][lastUpdatedStamp,2013-10-09
>  13:13:57.498(java.sql.Timestamp)][lastUpdatedTxStamp,2013-10-09 
> 13:13:49.522(java.sql.Timestamp)][partyId,DemoCustCompany(java.lang.String)][roleTypeId,PLACING_CUSTOMER(java.lang.String)]
>  (SQL Exception while executing the following:INSERT INTO public.INVOICE_ROLE 
> (INVOICE_ID, PARTY_ID, ROLE_TYPE_ID, DATETIME_PERFORMED, PERCENTAGE, 
> LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) 
> VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates 
> unique constraint "pk_invoice_role"<br/>  Detail: Key (invoice_id, party_id, 
> role_type_id)=(CI6, DemoCustCompany, PLACING_CUSTOMER) already exists.))))
> The createInvoiceForOrder service is called for each orderId in 
> createInvoicesFromShipments of InvoiceServices.java but the 
> createInvoiceForOrder calls createInvoiceRole which attempts to insert the 
> OrderRoles associated with the orderId which causes primary key violations.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to