Hi Giulio, I think the hardcoded "N" is used there because a reservation is being deleted and then recreated. The assumption there is that if a reservation existed before the process, then it should also exist after the process and should not simply disappear because a physical inventory was recorded. In your situation (if I understand correctly), you require inventory for an order to be created but if you then reduce inventory to the point there is no longer enough to cover all orders then you want the reservations to disappear? What happens to the order?
Regards Scott On Fri, 8 Jul 2022 at 12:05, Giulio Speri - MpStyle Srl < giulio.sp...@mpstyle.it> wrote: > Hello devs, > > I hope you're doing good! > I write because I think I found a possible issue in minilang service > *reassignInventoryReservation*. > > This service is called as a SECA on createPhysicalInventoryAndVariance > service and at the end it deletes inventory reservation for an order items > that has quantityNotReserved .gt. 0 and then re-reserve the inventory > calling the service *reserveProductInventoryByFacility, *implemented by the > method *reserveProductInventory* > > > (applications/product/minilang/product/inventory/InventoryReserveServices.xml). > > The *reserveProductInventoryByFacility has some parameters passed in and > among them there is requireInventory parameter, that is hardcoded to N, to > allow back-orders (negative ATP).* > > In our ecommerce context this is not recommendable and the productStores > are all configured to requireInventory=Y, because we do not want > back-orders, but the hard-coded requireInventory "N", overrides the store > setting, making the order "available" even if stock is not present for an > order item. > > I think that it is better to check the productStore setting of the > requireInventory parameter, and pass that value to the > *reserveProductInventoryByFacility,* instead of a hard-coded "N". > > What do you think about it? > If you agree I could take care of it in a Jira Task and provide a patch. > > Thanks in advance, > Giulio > > -- > Giulio Speri > > > *Mp Styl**e Srl* > via Antonio Meucci, 37 > 41019 Limidi di Soliera (MO) > T 059/684916 > M 347/0965506 > > www.mpstyle.it >