Page 1 of 1

Overide Inventory Decimals St.Proc

PostPosted: Wed Sep 10, 2014 12:38 pm
by 2can2
Hi, We have modified the standard stored proc usp_Jiwa_Warehouse_SOH_Summary to add an extra column (Tot KG) to the form.
Is there any way to override the standard Inventory Decimal Places default for this one column on Display.
Most Inventory items have 0 decimal places BUT this field needs to be displayed as 2 decimals immaterial of the Inventory setting. Thanks.

Re: Overide Inventory Decimals St.Proc  Topic is solved

PostPosted: Fri Sep 12, 2014 5:23 pm
by Mike.Sheen
2can2 wrote:Is there any way to override the standard Inventory Decimal Places default for this one column on Display.
Most Inventory items have 0 decimal places BUT this field needs to be displayed as 2 decimals immaterial of the Inventory setting.


Hi Doug,

Yes there is - but be aware in the next build (07.00.80.00) as part of addressing bug 10759 - we have changed the framework used to display the information from usp_JIWA_Warehouse_SOH_Summary on the inventory maintenance form. This means you will have to re-apply your changes to the new stored procedure. The new changes include the ability to specify the decimal places for each column or cell of the grid, as well as adding drill-down abilities.

So, in version 07.00.80.00 and later, you can control the decimals easily from the stored procedure. In previous versions you'd have to do something like this after the warehouse summary data was displayed:

Code: Select all
For row As Integer = 0 To inventoryForm.grdWarehouseSummary.ActiveSheet.RowCount - 1
    inventoryForm.grdWarehouseSummary.GridDecimalPlaces("TotalSOH", row, 2)
Next


When this grid is populated is a bit tricky - we do a lazy load for this data and quite a few other tabs - what that means is we don't even call the stored procedure or populate the grid, unless the tab was visible at the time the item was read. So, to handle this you will need to set the decimals also when the user clicks a tab, and work out if the warehouse summary tab was visible.

Attached is a plugin which demonstrates this.

Plugin Warehouse SOH Column to 2 Decimals.xml
Sample Plugin
(31.34 KiB) Downloaded 275 times


And remember - in version 07.00.80.00 and later you won't need this plugin at all - the stored procedure will take care of decimal precision.

Re: Overide Inventory Decimals St.Proc

PostPosted: Tue Sep 30, 2014 9:11 am
by 2can2
Thanks for the detail!