[jira] [Commented] (OFBIZ-9464) Accounting quantity transfer should not be zero while transferring inventory from one facility to another

2017-12-23 Thread Vaibhav Jain (JIRA)

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

Vaibhav Jain commented on OFBIZ-9464:
-

Hello Paul,

There are two fields which affect reservation here

cogsMethodId in PartyAcctgPreference which address the accounting method of 
inventory and reservation accordingly
COGS_AVG_COSTAverage cost
COGS_INV_COST Inventory cost
COGS_FIFO   First in First out
COGS_LIFO   Last in First out

ReservationEnumId in ProductStore entity which defines inventory reservation 
like :
INVRO_FIFO_EXP  FIFO Expire
INVRO_FIFO_REC  FIFO Received
INVRO_GUNIT_COST Greater Unit Cost
INVRO_LIFO_EXP   LIFO Expire
INVRO_LIFO_REC   LIFO Received
INVRO_LUNIT_COST  Less Unit Cost

Now the question is either COGS method override the reservation logic or vice 
versa. 

Do we have any user story about it? So we can get the direction in it.



> Accounting quantity transfer should not be zero while transferring inventory 
> from one facility to another
> -
>
> Key: OFBIZ-9464
> URL: https://issues.apache.org/jira/browse/OFBIZ-9464
> Project: OFBiz
>  Issue Type: Bug
>Affects Versions: Trunk
>Reporter: Vaibhav Jain
>Assignee: Vaibhav Jain
>  Labels: inventory, stock, valuation
> Fix For: 16.11.04
>
> Attachments: OFBIZ_9464.patch
>
>
> when we transfer inventory, the accountingQuantityTotal field of 
> _InventoryItem_ entity is always ZERO. There is no reflection of ATP/QOH in 
> accountingQuantityTotal.
> This will create following issues in the system.
> # Accounting quantity total will mismatch with the original quantity in the 
> facility which shows the wrong result when we calculate facility specific 
> inventory valuation.
> # Inventory reservation also throws an error in some specific case like when 
> AQT of respective product is zero in the specific facility from when 
> reservation happens.
> As we manage 5 different statuses of inventory transfer in OFBiz and 
> according to my current understanding these processes are associated with the 
> respective statuses, which are as show below
> Requested: As inventory transfer is requested for another facility. 
> a)ATP, QOH and AQT should decrease from the inventory item of From Facility 
> and QOH of To Facility should increase.
> b)ATP and AQT should be Zero in To Facility as inventory is not transferred 
> yet. But QOH should increase at To Facility because QOH shows the 
> xferquantity later. At the time of the completion of the transfer
> ATP = ATP + (QOH - ATP) (Adjustment in case of backorder)
> AQT = QOH
> b)AQT should not decrease because AQT is used for accounting purpose and as 
> of now quantity is still in From Facility as the transfer is not done yet. 
> which shows the xferQuantity later 
> Scheduled: As inventory transfer is Scheduled for another facility. ATP, QOH 
> and AQT should not affect in both From Facility and To Facility.
> En-route: As inventory is routed to reach at To Facility. Even in this case 
> ATP, QOH and AQT should not affect in both From Facility and To Facility.
> Complete: As inventory transfer is completed 
> a)ATP, QOH and AQT should not affect at From Facility. 
> b)QOH will be same but ATP and AQT should affect respectively
> ATP = ATP + (QOH - ATP)
> AQT = QOH
> Cancelled: As inventory transfer is cancelled and inventory item record is 
> already created  so 
> a) ATP, QOH and AQT should decrease from old inventory item and ATP, QOH and 
> AQT should increase in the newly created inventory item.
> Key points: 
> If the whole ATP and QOH is moved then new inventory item will not create. 
> Only Facility and location are changed for existing inventory item.
> Before Changes:-
> As I know there are following processes are associated with respective 
> statuses 
> **Note:   ATP-> Available to promiseQOH-> Quantity on handAQT-> 
> Accounting quantity total
> 1. Requested:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 2. Scheduled:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 3.En-Route:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 4.Complete:-
> If the partial quantity of any inventory item is transferred.
> ATP =Transferred quantity   QOH=Transferred quantity   AQT=0
> If the whole quantity is transferred then only facility id and location 
> will change no new inventory item record will create. 
> 5.Cancelled:-
> No new inventory item recor

[jira] [Commented] (OFBIZ-9464) Accounting quantity transfer should not be zero while transferring inventory from one facility to another

2017-12-23 Thread Paul Foxworthy (JIRA)

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

Paul Foxworthy commented on OFBIZ-9464:
---

Hi Vaibhav,

I think the two are independent of each other. You might use FIFO for 
inventory, to minimise customers getting old and stale stock, but LIFO for 
accounting, to ensure you get a higher amount into your Cost Of Goods Sold 
account.

The whole point of COGS_FIFO and COGS_LIFO is that for a given inventory item, 
the quantity for the purposes of *valuation* of stock can vary from the 
quantity of *actual* stock.  In contrast, the inventory reservation sets a 
policy on which inventory to reserve for an order. You are reserving actual 
stock from an actual inventory item in an actual place in your warehouse.

createAcctgTransForSalesShipmentIssuance looks for other inventory items for 
the same product, and may adjust the accountingQuantity on them, and not the 
accountingQuantity for the inventory item that was shipped.

I think all that's necessary is to split out the part of 
createAcctgTransForSalesShipmentIssuance that deals with adjusting accounting 
quantity, and use it for your transfer service as well.

Hope that helps.

> Accounting quantity transfer should not be zero while transferring inventory 
> from one facility to another
> -
>
> Key: OFBIZ-9464
> URL: https://issues.apache.org/jira/browse/OFBIZ-9464
> Project: OFBiz
>  Issue Type: Bug
>Affects Versions: Trunk
>Reporter: Vaibhav Jain
>Assignee: Vaibhav Jain
>  Labels: inventory, stock, valuation
> Fix For: 16.11.04
>
> Attachments: OFBIZ_9464.patch
>
>
> when we transfer inventory, the accountingQuantityTotal field of 
> _InventoryItem_ entity is always ZERO. There is no reflection of ATP/QOH in 
> accountingQuantityTotal.
> This will create following issues in the system.
> # Accounting quantity total will mismatch with the original quantity in the 
> facility which shows the wrong result when we calculate facility specific 
> inventory valuation.
> # Inventory reservation also throws an error in some specific case like when 
> AQT of respective product is zero in the specific facility from when 
> reservation happens.
> As we manage 5 different statuses of inventory transfer in OFBiz and 
> according to my current understanding these processes are associated with the 
> respective statuses, which are as show below
> Requested: As inventory transfer is requested for another facility. 
> a)ATP, QOH and AQT should decrease from the inventory item of From Facility 
> and QOH of To Facility should increase.
> b)ATP and AQT should be Zero in To Facility as inventory is not transferred 
> yet. But QOH should increase at To Facility because QOH shows the 
> xferquantity later. At the time of the completion of the transfer
> ATP = ATP + (QOH - ATP) (Adjustment in case of backorder)
> AQT = QOH
> b)AQT should not decrease because AQT is used for accounting purpose and as 
> of now quantity is still in From Facility as the transfer is not done yet. 
> which shows the xferQuantity later 
> Scheduled: As inventory transfer is Scheduled for another facility. ATP, QOH 
> and AQT should not affect in both From Facility and To Facility.
> En-route: As inventory is routed to reach at To Facility. Even in this case 
> ATP, QOH and AQT should not affect in both From Facility and To Facility.
> Complete: As inventory transfer is completed 
> a)ATP, QOH and AQT should not affect at From Facility. 
> b)QOH will be same but ATP and AQT should affect respectively
> ATP = ATP + (QOH - ATP)
> AQT = QOH
> Cancelled: As inventory transfer is cancelled and inventory item record is 
> already created  so 
> a) ATP, QOH and AQT should decrease from old inventory item and ATP, QOH and 
> AQT should increase in the newly created inventory item.
> Key points: 
> If the whole ATP and QOH is moved then new inventory item will not create. 
> Only Facility and location are changed for existing inventory item.
> Before Changes:-
> As I know there are following processes are associated with respective 
> statuses 
> **Note:   ATP-> Available to promiseQOH-> Quantity on handAQT-> 
> Accounting quantity total
> 1. Requested:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 2. Scheduled:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 3.En-Route:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 4.Complete:-
> If the partial quantity of any inventory item is transferred.
> ATP =Transferred quantity   QOH=Transferred quantity   AQT=0
> If the who

[jira] [Commented] (OFBIZ-9464) Accounting quantity transfer should not be zero while transferring inventory from one facility to another

2017-07-08 Thread Deepak Dixit (JIRA)

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

Deepak Dixit commented on OFBIZ-9464:
-

Backported to release 16.11 at r#1801304

> Accounting quantity transfer should not be zero while transferring inventory 
> from one facility to another
> -
>
> Key: OFBIZ-9464
> URL: https://issues.apache.org/jira/browse/OFBIZ-9464
> Project: OFBiz
>  Issue Type: Bug
>Affects Versions: Trunk
>Reporter: Vaibhav Jain
>Assignee: Divesh Dutta
> Fix For: 16.11.04
>
> Attachments: OFBIZ_9464.patch
>
>
> when we transfer inventory, the accountingQuantityTotal field of 
> _InventoryItem_ entity is always ZERO. There is no reflection of ATP/QOH in 
> accountingQuantityTotal.
> This will create following issues in the system.
> # Accounting quantity total will mismatch with the original quantity in the 
> facility which shows the wrong result when we calculate facility specific 
> inventory valuation.
> # Inventory reservation also throws an error in some specific case like when 
> AQT of respective product is zero in the specific facility from when 
> reservation happens.
> As we manage 5 different statuses of inventory transfer in OFBiz and 
> according to my current understanding these processes are associated with the 
> respective statuses, which are as show below
> Requested: As inventory transfer is requested for another facility. 
> a)ATP, QOH and AQT should decrease from the inventory item of From Facility 
> and QOH of To Facility should increase.
> b)ATP and AQT should be Zero in To Facility as inventory is not transferred 
> yet. But QOH should increase at To Facility because QOH shows the 
> xferquantity later. At the time of the completion of the transfer
> ATP = ATP + (QOH - ATP) (Adjustment in case of backorder)
> AQT = QOH
> b)AQT should not decrease because AQT is used for accounting purpose and as 
> of now quantity is still in From Facility as the transfer is not done yet. 
> which shows the xferQuantity later 
> Scheduled: As inventory transfer is Scheduled for another facility. ATP, QOH 
> and AQT should not affect in both From Facility and To Facility.
> En-route: As inventory is routed to reach at To Facility. Even in this case 
> ATP, QOH and AQT should not affect in both From Facility and To Facility.
> Complete: As inventory transfer is completed 
> a)ATP, QOH and AQT should not affect at From Facility. 
> b)QOH will be same but ATP and AQT should affect respectively
> ATP = ATP + (QOH - ATP)
> AQT = QOH
> Cancelled: As inventory transfer is cancelled and inventory item record is 
> already created  so 
> a) ATP, QOH and AQT should decrease from old inventory item and ATP, QOH and 
> AQT should increase in the newly created inventory item.
> Key points: 
> If the whole ATP and QOH is moved then new inventory item will not create. 
> Only Facility and location are changed for existing inventory item.
> Before Changes:-
> As I know there are following processes are associated with respective 
> statuses 
> **Note:   ATP-> Available to promiseQOH-> Quantity on handAQT-> 
> Accounting quantity total
> 1. Requested:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 2. Scheduled:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 3.En-Route:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 4.Complete:-
> If the partial quantity of any inventory item is transferred.
> ATP =Transferred quantity   QOH=Transferred quantity   AQT=0
> If the whole quantity is transferred then only facility id and location 
> will change no new inventory item record will create. 
> 5.Cancelled:-
> No new inventory item record will create. An inventory transfer record is 
> created with whole ATP/QOH in cancelled status.
> After Changes:-
> As shown above, accounting quantity transfer will not affect in transfer 
> inventory. After the following changes, records will be updated a shown below.
> 1. Requested:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 2. Scheduled:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 3.En-Route:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 4.Complete:-
> If the partial quantity of any inventory item is transferred.
> ATP =Transferred quantity   QOH=Transferred quantity   
> AQT=Transferred quantity
> If the whole quantity is transferred then only facility id and location 
> will change no new inventory item record 

[jira] [Commented] (OFBIZ-9464) Accounting quantity transfer should not be zero while transferring inventory from one facility to another

2017-07-19 Thread Paul Foxworthy (JIRA)

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

Paul Foxworthy commented on OFBIZ-9464:
---

This fix is OK for COGS methods of inventory cost and average cost, but not for 
FIFO and LIFO.

See this thread from January: 
http://ofbiz.135035.n4.nabble.com/AccountingQuantity-COGS-method-and-inventory-valuation-td4700867.html#a4700869
 .

During a sale, the createAcctgTransForSalesShipmentIssuance service adjusts the 
accountingQuantity for the most or least recent inventory item, not necessarily 
the item being sold. The same should happen during transfers.

> Accounting quantity transfer should not be zero while transferring inventory 
> from one facility to another
> -
>
> Key: OFBIZ-9464
> URL: https://issues.apache.org/jira/browse/OFBIZ-9464
> Project: OFBiz
>  Issue Type: Bug
>Affects Versions: Trunk
>Reporter: Vaibhav Jain
>Assignee: Divesh Dutta
> Fix For: 16.11.04
>
> Attachments: OFBIZ_9464.patch
>
>
> when we transfer inventory, the accountingQuantityTotal field of 
> _InventoryItem_ entity is always ZERO. There is no reflection of ATP/QOH in 
> accountingQuantityTotal.
> This will create following issues in the system.
> # Accounting quantity total will mismatch with the original quantity in the 
> facility which shows the wrong result when we calculate facility specific 
> inventory valuation.
> # Inventory reservation also throws an error in some specific case like when 
> AQT of respective product is zero in the specific facility from when 
> reservation happens.
> As we manage 5 different statuses of inventory transfer in OFBiz and 
> according to my current understanding these processes are associated with the 
> respective statuses, which are as show below
> Requested: As inventory transfer is requested for another facility. 
> a)ATP, QOH and AQT should decrease from the inventory item of From Facility 
> and QOH of To Facility should increase.
> b)ATP and AQT should be Zero in To Facility as inventory is not transferred 
> yet. But QOH should increase at To Facility because QOH shows the 
> xferquantity later. At the time of the completion of the transfer
> ATP = ATP + (QOH - ATP) (Adjustment in case of backorder)
> AQT = QOH
> b)AQT should not decrease because AQT is used for accounting purpose and as 
> of now quantity is still in From Facility as the transfer is not done yet. 
> which shows the xferQuantity later 
> Scheduled: As inventory transfer is Scheduled for another facility. ATP, QOH 
> and AQT should not affect in both From Facility and To Facility.
> En-route: As inventory is routed to reach at To Facility. Even in this case 
> ATP, QOH and AQT should not affect in both From Facility and To Facility.
> Complete: As inventory transfer is completed 
> a)ATP, QOH and AQT should not affect at From Facility. 
> b)QOH will be same but ATP and AQT should affect respectively
> ATP = ATP + (QOH - ATP)
> AQT = QOH
> Cancelled: As inventory transfer is cancelled and inventory item record is 
> already created  so 
> a) ATP, QOH and AQT should decrease from old inventory item and ATP, QOH and 
> AQT should increase in the newly created inventory item.
> Key points: 
> If the whole ATP and QOH is moved then new inventory item will not create. 
> Only Facility and location are changed for existing inventory item.
> Before Changes:-
> As I know there are following processes are associated with respective 
> statuses 
> **Note:   ATP-> Available to promiseQOH-> Quantity on handAQT-> 
> Accounting quantity total
> 1. Requested:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 2. Scheduled:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 3.En-Route:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 4.Complete:-
> If the partial quantity of any inventory item is transferred.
> ATP =Transferred quantity   QOH=Transferred quantity   AQT=0
> If the whole quantity is transferred then only facility id and location 
> will change no new inventory item record will create. 
> 5.Cancelled:-
> No new inventory item record will create. An inventory transfer record is 
> created with whole ATP/QOH in cancelled status.
> After Changes:-
> As shown above, accounting quantity transfer will not affect in transfer 
> inventory. After the following changes, records will be updated a shown below.
> 1. Requested:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 2. Scheduled:-
> ATP =0QOH=Transferred q

[jira] [Commented] (OFBIZ-9464) Accounting quantity transfer should not be zero while transferring inventory from one facility to another

2017-07-25 Thread Vaibhav Jain (JIRA)

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

Vaibhav Jain commented on OFBIZ-9464:
-

Hi Paul,

Thanks for pointing out this two scenario which will affect due to this changes.
I am working on it.

> Accounting quantity transfer should not be zero while transferring inventory 
> from one facility to another
> -
>
> Key: OFBIZ-9464
> URL: https://issues.apache.org/jira/browse/OFBIZ-9464
> Project: OFBiz
>  Issue Type: Bug
>Affects Versions: Trunk
>Reporter: Vaibhav Jain
>Assignee: Divesh Dutta
>  Labels: inventory, stock, valuation
> Fix For: 16.11.04
>
> Attachments: OFBIZ_9464.patch
>
>
> when we transfer inventory, the accountingQuantityTotal field of 
> _InventoryItem_ entity is always ZERO. There is no reflection of ATP/QOH in 
> accountingQuantityTotal.
> This will create following issues in the system.
> # Accounting quantity total will mismatch with the original quantity in the 
> facility which shows the wrong result when we calculate facility specific 
> inventory valuation.
> # Inventory reservation also throws an error in some specific case like when 
> AQT of respective product is zero in the specific facility from when 
> reservation happens.
> As we manage 5 different statuses of inventory transfer in OFBiz and 
> according to my current understanding these processes are associated with the 
> respective statuses, which are as show below
> Requested: As inventory transfer is requested for another facility. 
> a)ATP, QOH and AQT should decrease from the inventory item of From Facility 
> and QOH of To Facility should increase.
> b)ATP and AQT should be Zero in To Facility as inventory is not transferred 
> yet. But QOH should increase at To Facility because QOH shows the 
> xferquantity later. At the time of the completion of the transfer
> ATP = ATP + (QOH - ATP) (Adjustment in case of backorder)
> AQT = QOH
> b)AQT should not decrease because AQT is used for accounting purpose and as 
> of now quantity is still in From Facility as the transfer is not done yet. 
> which shows the xferQuantity later 
> Scheduled: As inventory transfer is Scheduled for another facility. ATP, QOH 
> and AQT should not affect in both From Facility and To Facility.
> En-route: As inventory is routed to reach at To Facility. Even in this case 
> ATP, QOH and AQT should not affect in both From Facility and To Facility.
> Complete: As inventory transfer is completed 
> a)ATP, QOH and AQT should not affect at From Facility. 
> b)QOH will be same but ATP and AQT should affect respectively
> ATP = ATP + (QOH - ATP)
> AQT = QOH
> Cancelled: As inventory transfer is cancelled and inventory item record is 
> already created  so 
> a) ATP, QOH and AQT should decrease from old inventory item and ATP, QOH and 
> AQT should increase in the newly created inventory item.
> Key points: 
> If the whole ATP and QOH is moved then new inventory item will not create. 
> Only Facility and location are changed for existing inventory item.
> Before Changes:-
> As I know there are following processes are associated with respective 
> statuses 
> **Note:   ATP-> Available to promiseQOH-> Quantity on handAQT-> 
> Accounting quantity total
> 1. Requested:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 2. Scheduled:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 3.En-Route:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 4.Complete:-
> If the partial quantity of any inventory item is transferred.
> ATP =Transferred quantity   QOH=Transferred quantity   AQT=0
> If the whole quantity is transferred then only facility id and location 
> will change no new inventory item record will create. 
> 5.Cancelled:-
> No new inventory item record will create. An inventory transfer record is 
> created with whole ATP/QOH in cancelled status.
> After Changes:-
> As shown above, accounting quantity transfer will not affect in transfer 
> inventory. After the following changes, records will be updated a shown below.
> 1. Requested:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 2. Scheduled:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 3.En-Route:-
> ATP =0QOH=Transferred quantity
>AQT=0
> 4.Complete:-
> If the partial quantity of any inventory item is transferred.
> ATP =Transferred quantity   QOH=Transferred quantity   
> AQT=Transferred quantity
>