Anybody has a method of getting the inventory as o...
# suiteql
a
Anybody has a method of getting the inventory as of date?
t
There's a query in this Suitelet that might help get you started: https://timdietrich.me/blog/netsuite-inventory-balance-history-suitelet/
s
I usually use
select * from inventoryItemLocations
a
I need historic data.
s
I have a query that I use (basically transactionline with inventory asset account filter and posting filter), I'll see if I can find it
Copy code
SELECT tl.item, tl.quantity, t.tranid, t.createddate, t.lastmodifieddate  
 FROM transactionLine tl  
 JOIN TransactionAccountingLine tla  
 ON tla.TRANSACTION = tl.TRANSACTION  
 AND tla.TRANSACTIONLINE = tl.id  
 JOIN TRANSACTION t  
 ON t.id = tl.TRANSACTION  
 WHERE tl.item = '' 
 AND tla.account = {{asset account}}  
 AND tl.inventoryreportinglocation = {{location}}   
 AND tl.isclosed < > 'T' 
 AND tla.posting < > 'F' 
 AND t.trandate <= TO_DATE('{{date}}', 'YYYY-MM-DD')
You'll wanna sum the qty
a
Ah I see this should work.