[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-04-05 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

Backported to release branch 18.12. 

I remove the "backport-needed" label and close definitely this issue.

I'll soon work to apply OFBIZ-12455 patch.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, 18.12.06
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
>  Labels: backport-needed
> Fix For: 22.01.01
>
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-04-05 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on OFBIZ-12264:
-

Commit 9a6b54af2e8cd689b82f566327887486030175e0 in ofbiz-framework's branch 
refs/heads/release18.12 from Giulio Speri
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=9a6b54af2e ]

Fixed: multiple facility inventory reservation issue (OFBIZ-12264)

The ProductStore is set up to reserve inventory from more than one
facility, so the flag oneInventoryFacility is set to N.
Flags requireInventory and reserveInventory are both to Y.
Flag allocateInventory is N.

A product can be anyway reserved in a ProductStoreFacility with its
thru date set and past, so is disabled, and if is not present enough
inventory quantity on other facilities.

Added filtering by date on multiple facility code in
reserveStoreInventoryMethod() and on isStoreInventoryAvailable().
This is the first part of the problem resolution; the second part is
accomplished by path to OFBIZ-12455 Jira.

Thanks: Jacques Le Roux and Pierre SMith for Jira feedbacks, Nicola
Mazzoni for helping in bug analaysis and Jacopo Cappellato for path
review.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, 18.12.06
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
>  Labels: backport-needed
> Fix For: 22.01.01
>
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-04-03 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

Fix backported in release 22.01.

With this release I could easily apply the same patch file used for trunk.

 

For r18.12 I need a couple more days to double check the patch since in this 
release ProductStoreServices are written in minilang and not in groovy.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, 18.12.06
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
>  Labels: backport-needed
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-04-03 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on OFBIZ-12264:
-

Commit ae37f446d7054c9b2e513a3af36752b802a03af5 in ofbiz-framework's branch 
refs/heads/release22.01 from Giulio Speri
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=ae37f44 ]

Fixed: multiple facility inventory reservation issue (OFBIZ-12264)

The ProductStore is set up to reserve inventory from more than one
facility, so the flag oneInventoryFacility is set to N.
Flags requireInventory and reserveInventory are both to Y.
Flag allocateInventory is N.

A product can be anyway reserved in a ProductStoreFacility with its
thru date set and past, so is disabled, and if is not present enough
inventory quantity on other facilities.

Added filtering by date on multiple facility code in
reserveStoreInventoryMethod() and on isStoreInventoryAvailable().
This is the first part of the problem resolution; the second part is
accomplished by path to OFBIZ-12455 Jira.

Thanks: Jacques Le Roux and Pierre SMith for Jira feedbacks, Nicola
Mazzoni for helping in bug analaysis and Jacopo Cappellato for path
review.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, 18.12.06
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
>  Labels: backport-needed
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-04-02 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

Hello Jacques,

 

great, thanks for clarifications.

I will try to follow the steps of the backport guide and adjust them if needed.

At the end, if the steps are different than the current then I will work on 
updating that wiki.

 

Thanks again!

 

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, 18.12.06
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
>  Labels: backport-needed
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-04-02 Thread Jacques Le Roux (Jira)


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

Jacques Le Roux commented on OFBIZ-12264:
-

Hi Giulio,
# Right, R17 is no longer supported
# Nope it's indeed not up to date (svn ;)). You could udate it if you like :)
# I was not even aware of this  "backport-needed" label. That makes sense 
indeed when the backport is not done with the initial commit, like here.
# We don't use  "Upcoming branch" in "Fix version/s" field when we backport. 
The other "Unreleased versions" should be used, ie here 18.12.06 & 22.01.01
HTH


 

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, 18.12.06
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
>  Labels: backport-needed
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-04-01 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

Hi Jacques,

yes I will backport the fix.

I have a couple of question here:

1) Currently active and supported branches are 18.12 and 22.01? Correct? I can 
skip the r17 branch backport.

2) Info and guide lines present in the wiki in the section "How should 
committers handle backporting?" are still valid or they have been updated ?

As wiki docs say I labeled this issue with "backport-needed" and I remove the 
label once I completed the backporting.

Last question for today : I worked and applied my patch in trunk revision;  how 
should I fill the Jira field "Fix version/s",  since "trunk" is not present? Is 
the "Upcoming branch" element that refers to "trunk"?

 

Thank you very much in advance for your help.

 

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, 18.12.06
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
>  Labels: backport-needed
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-04-01 Thread Jacques Le Roux (Jira)


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

Jacques Le Roux commented on OFBIZ-12264:
-

Hi Giulio,

Will you backport the fix?

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, 18.12.06
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-03-31 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

Patch committed on trunk.

Thanks [~jleroux] , [~pierresmits] for your feedback and [~jacopoc] for the 
revision.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, Upcoming Branch
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-03-31 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on OFBIZ-12264:
-

Commit 691c74c66bed39112368e671caffd4402fa7bbd7 in ofbiz-framework's branch 
refs/heads/trunk from Giulio Speri
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=691c74c ]

Fixed: multiple facility inventory reservation issue (OFBIZ-12264)

The ProductStore is set up to reserve inventory from more than one
facility, so the flag oneInventoryFacility is set to N.
Flags requireInventory and reserveInventory are both to Y.
Flag allocateInventory is N.

A product can be anyway reserved in a ProductStoreFacility with its
thru date set and past, so is disabled, and if is not present enough
inventory quantity on other facilities.

Added filtering by date on multiple facility code in
reserveStoreInventoryMethod() and on isStoreInventoryAvailable().
This is the first part of the problem resolution; the second part is
accomplished by path to OFBIZ-12455 Jira.

Thanks: Jacques Le Roux and Pierre SMith for Jira feedbacks, Nicola
Mazzoni for helping in bug analaysis and Jacopo Cappellato for path
review.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, Upcoming Branch
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2022-03-23 Thread Jacopo Cappellato (Jira)


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

Jacopo Cappellato commented on OFBIZ-12264:
---

Hi [~Giulio_MpStyle] 

I have reviewed your last patch and it looks good to me for being committed.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07, Upcoming Branch
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-12-13 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

Hi,

 

after reviewing the code again to check the status of this patch, I found 
another issue related to this and it involves the service 
{_}reserveProductInventoryByFacility{_}, called in the _reserveStoreInventory_ 
method for the actual reservation of the product.

The problem in _reserveProductInventoryByFacility_  is that is not considered 
the case where requireInventory = Y (and reserveInventory = Y), so for such a 
scenario that service will not fail returning an error, but simply returns the 
value of quantityNotReserved letting an order to be placed also if we do not 
have inventory available.

 

For this reason I decided to move the error raised in my previous version of 
the patch, into the _reserveProductInventoryByFacility :_ I will create a new 
issue where I share more detail on it.

 

In the meanwhile I add the new version of the patch (I call this fix-part1)

Thanks,

Giulio[^OFBIZ-12264_13122021_trunk.patch]

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_13122021_trunk.patch, 
> OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 
> 01-58-45.png, image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-11-11 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

I forgot to say that if this solution is good, I will start working on 
backporting the patch to Release Branch 18.12 

 

Giulio

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: Release Branch 18.12, 17.12.03, Trunk, 17.12.04, 
> 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_trunk.patch, OFBIZ-12264_v130703.patch, 
> OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 01-58-45.png, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-11-11 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

Hello Pierre, Jacques,

I rewrote the patch as suggested by you and how reported in the wiki for the 
trunk branch.

 

I slightly modified it:
 * in _reserveStoreInventory_ when ProductStore flag oneInventoryFacility is N 
and the ProductStoreFacilities are looped to find where inventory available 
could be, if no facility is found I directly return from the service with a 
specific error, instead of picking the first facility in the list above.
 * I added a filterByDate filter also to service 
{_}isStoreInventoryAvailable{_}: that service returns Y or N whether a product 
is available in some facilities. This filtering also avoid products in this 
scenario to be added to the cart with the following error:

!Screenshot from 2021-11-12 01-58-45.png|width=674,height=288!

 

This prevents an item to be added to the cart if no stock is available in one 
of the "enabled" ProductStore facilities. 

I tested different situations (facility enabled/disabled, service 
isStoreInventoryAvailable filtered/non-filtered) and I think that these two 
combined fixes solve the original issue.

Here is the updated patch for trunk.  

[^OFBIZ-12264_trunk.patch]

 

Thanks and good night,

Giulio

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_trunk.patch, OFBIZ-12264_v130703.patch, 
> OFBIZ-12264_v17.patch, Screenshot from 2021-11-12 01-58-45.png, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-11-05 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

Hello Pierre, Jacques,

Thank you for both for the feedback.
I apologise for the wrong patch, I did not have much time to review and 
recreate it on trunk.
I will rewrite it soon.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-11-05 Thread Jacques Le Roux (Jira)


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

Jacques Le Roux commented on OFBIZ-12264:
-

Yes: 
https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Committers+Roles+and+Responsibilities#OFBizCommittersRolesandResponsibilities-Howshouldcommittershandlebackporting?

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-11-05 Thread Pierre Smits (Jira)


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

Pierre Smits commented on OFBIZ-12264:
--

Bonjour Jacques,

Indeed. I guess as per documentation in our Confluence wiki.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-11-05 Thread Jacques Le Roux (Jira)


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

Jacques Le Roux commented on OFBIZ-12264:
-

Hi Giulio, Pierre,

The best practice when fixing bugs is, when possible, to try to fix it in trunk 
and then backport from there to supported branches*, when possible.

 

Don't expect to fix old branches like R13. Maybe even now R17 since it's no 
longer our stable branch. It's R18 now, though it's not yet reflected in demos.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-11-05 Thread Pierre Smits (Jira)


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

Pierre Smits commented on OFBIZ-12264:
--

Buon giornio Giulio,

I checked your patch for r17, but it won't apply. In R17 (nor in R18) we don't 
have a  ProductStoreServices.groovy in product/groovyScripts/product/store. 
This file came into play after the creation of the R18 branch (on 2020-09-16 to 
be exact, under OFBIZ-11449).

It appears that you mixed some stuff, as it won't apply to trunk either.

Could you please check, and if you are going to deliver a new improvement 
please consider having it a dev branch in your public git repo and in a PR 
(Pull Request). That way I can pull it from there.

Grazie in anticipo

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-10-28 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

I will check better r18 (just to be sure) and then I will update the Affect 
Version field.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-10-28 Thread Pierre Smits (Jira)


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

Pierre Smits commented on OFBIZ-12264:
--

HI Giulio,

if not persisted to any branch, then the issue  is most likely to be existing 
in all branches and releases available. Will you correct?

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-10-28 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

Hello Pierre,

I don't remember why exactly I listed only r17 versions and not r18 or trunk, 
maybe I simply miss them, but anyway I don't think that the patch has been 
merged in the trunk of (now outgoing) r18.

I notified the availability of the patch to the dev ML to Suraj, but I didn't 
receive a feedback back, so for now I assume that the bug still exists in the 
r18.

 

 

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-10-28 Thread Pierre Smits (Jira)


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

Pierre Smits commented on OFBIZ-12264:
--

IMO, the aspect that a warehouse in OFBiz has an end-of-life date and still has 
inventory items may be an indicator that there is something missing in the 
business procedures of the adopter.

It may be that the lifespan of such a warehouse has ended recently and that 
transfers from that warehouse to another have not been approved yet (or not 
have happened).

Nevertheless, your point is a valid one. If a warehouse is past has a thru date 
set and that date has gone by, the reservation service should not include that 
warehouse in its considerations.

One question though, [~Giulio_MpStyle] : you listed various affected versions 
in the r17 branch, but does that mean it doesn't affect later branches or trunk 
(I did not check)?

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-07-04 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

HI, I've created a patch for the reserveStoreInventory service, both for 
version 13 and 17.

I post here some considerations on the patch:

 
 * the service mainly checks for the existence of input the parameter 
"facilityId"; *CASE 1)* if it does not exists (front-end/ecommerce application 
scenario) and the flag "oneInventoryFacility" is set to "N" on the 
ProductStore, it retrieves the list of all the ProductStoreFacility records and 
try to find a valid facility for reservation. In this step I added a 
filter-by-date entity filter to exclude disabled facilities;
 * in the above scenario, if a valid facility for reservation is not found I 
explicitly rise and return an error in the service, otherwise sales order is 
created anyway; thinking about an ecommerce context, I think that this is 
necessary to avoid that a customer pays for a product that is not available;
 *  *CASE 2)* the input parameter facilityId exists (backoffice order entry 
scenario where inventory facility is selected in the process) and 
"oneInventoryFacility" flag is "N" ; The system retrieves the 
ProductStoreFacility records for the store and facility given as parameters: I 
added a filter-by-date filter to this find. In this scenario I do not rise an 
error for the service and I simply log an updated message in case there is 
quantityNotAvailable for a product. Basically it does the same thing as always 
and I kept it as is, because backoffice order entry flow is performed for 
manual handle of orders so I I think is ok having some more flexibility.

I really appreciate if you could give me your opinion on this; in the meanwhile 
I will investigate the front-end part of this: I think that a variant that has 
quantity in a disabled facility should not appear in a product detail page and 
a user should not be able to add it to the cart.

Thanks,

Giulio

[^OFBIZ-12264_v17.patch]

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: OFBIZ-12264_v130703.patch, OFBIZ-12264_v17.patch, 
> image-2021-06-24-00-35-10-392.png, image-2021-06-24-00-37-21-890.png, 
> image-2021-06-24-00-40-41-737.png, image-2021-06-24-00-41-56-344.png, 
> image-2021-06-24-00-43-33-640.png, image-2021-06-24-00-46-17-924.png, 
> image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
>  The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>   
>  Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>   
>  After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>   
>  The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
>  I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.
>  
> ADDITIONAL NOTE:
> The the reservation should not be done for this product, but this part is 
> only the last step of the ecommerce sales order flow.
> I think that with a scenario like the one above, the specific product variant 
> should not even be added to the cart, so in the item page (productdetail) 
> this particular variant should not have been visible/selected by the user.
> But I have to take a better look at this part.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-06-23 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

Here I attach configuration screenshots and some other details.

1) ProductStoreFacility set up: facilities 1 and 10010 are up, while all 
the others have been disabled with the thruDate

!image-2021-06-24-00-35-10-392.png|width=780,height=166!

 

2) Inventory situation for a sample product variant: no inventory available for 
the two facilities still enabled

!image-2021-06-24-00-49-23-904.png|width=806,height=382!

 

3) reserveStoreInventory log prints: it loops all the facilities and the 
facility selected for the reservation is 10020, that should be disabled.

!image-2021-06-24-00-46-17-924.png|width=834,height=259!

 

4) Order Summary screen: the order item is reserved in the facility 10020.

!image-2021-06-24-00-43-33-640.png|width=800,height=331!

 

 

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
> Attachments: image-2021-06-24-00-35-10-392.png, 
> image-2021-06-24-00-37-21-890.png, image-2021-06-24-00-40-41-737.png, 
> image-2021-06-24-00-41-56-344.png, image-2021-06-24-00-43-33-640.png, 
> image-2021-06-24-00-46-17-924.png, image-2021-06-24-00-49-23-904.png
>
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
> The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>  
> Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>  
> After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>  
> The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
> I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (OFBIZ-12264) Multiple Facility Inventory reservation does not consider store facility thru date

2021-06-23 Thread Giulio Speri (Jira)


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

Giulio Speri commented on OFBIZ-12264:
--

I will soon attach screenshots with details of the configuration.

> Multiple Facility Inventory reservation does not consider store facility thru 
> date
> --
>
> Key: OFBIZ-12264
> URL: https://issues.apache.org/jira/browse/OFBIZ-12264
> Project: OFBiz
>  Issue Type: Bug
>  Components: ecommerce, product
>Affects Versions: 17.12.03, 17.12.04, 17.12.05, 17.12.06, 17.12.07
> Environment: Linux/Ubuntu 18.04 LTS, Java jdk 8, OFBiz v13.07.03
>  
>Reporter: Giulio Speri
>Assignee: Giulio Speri
>Priority: Major
>
> The ProductStore is set up to reserve inventory from more than one facility, 
> so the flag oneInventoryFacility is set to N. 
> The we have 8 different facilities configured (each with a specific sequence 
> num from 1 to 8) in the entity ProductStoreFacility.
>  
> Due to customer requests I had to disable 6 out of 8 facilities associated 
> with the store, so basically only facilities with (sequence) numbers 1 and 2 
> are left. To achieve this I set the thruDate on the other six records.
>  
> After that, an order came in with a variant product that had only 1 quantity 
> left available in one of the disabled facilities and 0 in both the two 
> facilities left enabled, but despite this the system reserved inventory from 
> the disabled facility: I wouldn't expect that.
>  
> The service responsible for the reservation is reserveStoreInventory that in 
> our ofbiz version (13.07.03) is minilang and is implemented in 
> ProductStoreServices.xml: I checked that service and I noticed that when the 
> ProductStore is set to multi facility (oneInventoryFacility to N) and the 
> list of productStoreFacility records are retrieved, they are not filtered by 
> date, and this lead to a "bad" reservation.
> I took a look also at the current revision of ofbiz and the code (groovy 
> script) is basically the same, so the issue is present there also.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)