By using this website, you agree to our Terms of Use (click here)
I'm not sure why, but it seems that INSiteStatus.QtyOnHand is no longer reliable. So, wherever I was using INSiteStatus.QtyOnHand in SQL Views, I'm now using INItemStats.QtyOnHand instead.
I discovered this at a client that had recently upgraded from Acumatica 2022 R1 to Acumatica 2023 R2. The QtyOnHand numbers looked funny to them and it turned out that the problem was with any SQL Views that were using INSiteStatus.QtyOnHand.
The Primary Keys for INSiteStatus are CompanyID,InventoryID,SiteID,SubItemID
The Primary Keys for INItemStats are CompanyID,InventoryID,SiteID
I like using INItemStats better because SubItemID is related to Sub Items which are rarely used (for good reason) in Acumatica implementations.
If I do a Trace on a Generic Inquiry in Acumatica 2022 R1 that uses INSiteStatus, I get something like this:
SELECT COUNT( *) FROM [INSiteStatus] [InnerQuery_INSiteStatus] WHERE ( [InnerQuery_INSiteStatus].[CompanyID] = 2)
If I do a Trace on a Generic Inquiry in Acumatica 2023 R2 that uses INSiteStatus, I get something like this:
SELECT COUNT( *) FROM [INSiteStatusByCostCenter] [InnerQuery_INSiteStatus_INSiteStatusByCostCenter] WHERE ( [InnerQuery_INSiteStatus_INSiteStatusByCostCenter].[CompanyID] = 2) AND ( [InnerQuery_INSiteStatus_INSiteStatusByCostCenter].[CostCenterID] = 0)
So you can see that, in Acumatica 2023 R2, INSiteStatus is now pulling its data from INSiteStatusByCostCenter for some reason. I'm not sure why, but it is.
The Primary Keys for INSiteStatusByCostCenter are CompanyID,InventoryID,SiteID,SubItemID,CostCenterID
I prefer using INItemStats over over INSiteStatusByCostCenter because its Primary Keys are simpler.