[ 
https://issues.apache.org/jira/browse/OFBIZ-13373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anahita Goljahani updated OFBIZ-13373:
--------------------------------------
    Description: 
When a PO receipt contains rejected units, clicking the *“Force Complete 
Purchase Order”* button in the Order Details screen generates an error because 
the {{cancelRemainingPurchaseOrderItems}} service does not take rejected items 
into account when computing the units to cancel.

The issue can be reproduced as follows.

Create a PO for, e.g., 10 units of WG-1111 and approve it.

In the ‘Actions’ sections of the order details screen, click the ‘Receive’ 
button.

  !1_Receive_annotated.png! 

 Select the automatically created shipment and click ‘Receive Selected 
Shipment’.

 

 Receive 8 units of WG-1111, reject 1 and click ‘Receive Selected Product(s)’.

 

 Go back to the order details screen, e.g., by clicking the PO id in the 
‘Receipt(s) For Purchase Order …’ recap section.

 

 Click ‘Force Complete Purchase Order’ in  the ‘Actions’ section of the Order 
details screen.

 

 
An error is generated because of an invalid cancel quantity computation in the 
'cancelRemainingPurchaseOrderItems' service.

 

 The problem is that, currently, the service only accounts for accepted 
quantities, 8 in our example, and doesn’t take into account rejected units, 1 
in our example. Hence, the service tries to cancel 2 units ( = 10 –  8) from 
the 10 units ordered, but an error is generated because there is only 1 unit ( 
= 10 – 8 – 1) available to cancel.

 

 

 

 

 

  was:
When a PO receipt contains rejected units, clicking the *“Force Complete 
Purchase Order”* button in the Order Details screen generates an error because 
the {{cancelRemainingPurchaseOrderItems}} service does not take rejected items 
into account when computing the units to cancel.

The issue can be reproduced as follows.

Create a PO for, e.g., 10 units of WG-1111 and approve it.

In the ‘Actions’ sections of the order details screen, click the ‘Receive’ 
button.

 

 Select the automatically created shipment and click ‘Receive Selected 
Shipment’.

 

 Receive 8 units of WG-1111, reject 1 and click ‘Receive Selected Product(s)’.

 

 Go back to the order details screen, e.g., by clicking the PO id in the 
‘Receipt(s) For Purchase Order …’ recap section.

 

 Click ‘Force Complete Purchase Order’ in  the ‘Actions’ section of the Order 
details screen.

 

 
An error is generated because of an invalid cancel quantity computation in the 
'cancelRemainingPurchaseOrderItems' service.

 

 The problem is that, currently, the service only accounts for accepted 
quantities, 8 in our example, and doesn’t take into account rejected units, 1 
in our example. Hence, the service tries to cancel 2 units ( = 10 –  8) from 
the 10 units ordered, but an error is generated because there is only 1 unit ( 
= 10 – 8 – 1) available to cancel.

 

 

 

 

 


> Error when forcing PO completion if receipt contains rejected units
> -------------------------------------------------------------------
>
>                 Key: OFBIZ-13373
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13373
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: Upcoming Branch
>            Reporter: Anahita Goljahani
>            Priority: Major
>         Attachments: 1_Receive_annotated.png, 
> 2_Receive_Selected_Shipment_annotated.png, 
> 3_Receive_Selected_product(s)_annotated.png, 
> 4_Receipt(s)_For_Purchase_Order_annotated.png, 
> 5_Force_Complete_Purchase_Order_annotated.png, 
> 6_Error_cannot_cancel_annotated.png
>
>
> When a PO receipt contains rejected units, clicking the *“Force Complete 
> Purchase Order”* button in the Order Details screen generates an error 
> because the {{cancelRemainingPurchaseOrderItems}} service does not take 
> rejected items into account when computing the units to cancel.
> The issue can be reproduced as follows.
> Create a PO for, e.g., 10 units of WG-1111 and approve it.
> In the ‘Actions’ sections of the order details screen, click the ‘Receive’ 
> button.
>   !1_Receive_annotated.png! 
>  Select the automatically created shipment and click ‘Receive Selected 
> Shipment’.
>  
>  Receive 8 units of WG-1111, reject 1 and click ‘Receive Selected Product(s)’.
>  
>  Go back to the order details screen, e.g., by clicking the PO id in the 
> ‘Receipt(s) For Purchase Order …’ recap section.
>  
>  Click ‘Force Complete Purchase Order’ in  the ‘Actions’ section of the Order 
> details screen.
>  
>  
> An error is generated because of an invalid cancel quantity computation in 
> the 'cancelRemainingPurchaseOrderItems' service.
>  
>  The problem is that, currently, the service only accounts for accepted 
> quantities, 8 in our example, and doesn’t take into account rejected units, 1 
> in our example. Hence, the service tries to cancel 2 units ( = 10 –  8) from 
> the 10 units ordered, but an error is generated because there is only 1 unit 
> ( = 10 – 8 – 1) available to cancel.
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to