CoreBOSBB
Default quantity when adding new Product lines - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Support (https://discussions.corebos.org/forumdisplay.php?fid=17)
+--- Forum: User Support (https://discussions.corebos.org/forumdisplay.php?fid=6)
+--- Thread: Default quantity when adding new Product lines (/showthread.php?tid=2023)



Default quantity when adding new Product lines - radu - 11-18-2020

Hello,
When you add a new product/service on a Purchase Order the default quantity is 1. Also if you generate a PO from a product. What is the proper procedure for giving it another value, a numeric field on the product item?
I noticed the quantity value is saved in vtiger_inventoryproductrel table, but how do I set that field? I tried with a field set mapping Products2PurchaseOrder with 'quantity' as fieldname and the custom field in products as OrgfieldName but it does not seem to work. I checked the wiki and the forum but it is still unclear to me how can that field be controlled.
I can easily set the quantity in the releted InventoryDetails but that does not reflect in the quantity on the PO.
Thanks


RE: Default quantity when adding new Product lines - joebordes - 11-18-2020

Try with the Inventory_Product_Default_Units global variable


RE: Default quantity when adding new Product lines - radu - 11-18-2020

(11-18-2020, 09:17 AM)joebordes Wrote: Try with the Inventory_Product_Default_Units global variable

Got it Wink. Thanks. I did check the GV's but was looking for 'quantity' so i overlooked that one. That works for a given number. How would one pick the value of a specific numeric field in products? Do I have to use a business map in that GV to somehow retrieve the value of that field?


RE: Default quantity when adding new Product lines - joebordes - 11-18-2020

I don't think we have support for that. There may be (should be) a hook to plugin your functionality but I don't remember right now.


RE: Default quantity when adding new Product lines - radu - 11-18-2020

(11-18-2020, 10:47 AM)joebordes Wrote: I don't think we have support for that. There may be (should be) a hook to plugin your functionality but I don't remember right now.

My thoughts exactly Wink. Initially I figured it's more obvious, then I thought about a hook to get that data from popup but it was not clear to me how to work with that quantity field, how to address it. I still don't know but I will play with it now that i know the general direction.
As a faster but not complete way to get that info displayed was to get it in a custom field in InventoryDetails and display it in Information column on the PO's detail lines.

Thanks!