问题

如何通过SuiteQL拿到库位、批次等信息?

解决

通过类似以下的请求方式

FROM transaction
INNER JOIN transactionline on transactionline.transaction = transaction.id
INNER JOIN inventoryassignment on inventoryassignment.transactionline = transactionline.id
and inventoryassignment.transaction = transactionline.transaction

从查询角度来说,inventoryAssignment表是复合主键

常用的值可能有quantity, inventorynumber, bin, inventorystatus

举例,如下请求

SELECT
  BUILTIN.DF(TransactionLine.item) as Item,
  BUILTIN.DF(Inventoryassignment.inventorynumber) as lot,
  BUILTIN.DF(Inventoryassignment.bin) as Bin,
  Inventoryassignment.quantity
FROM Transaction
INNER JOIN TransactionLine on TransactionLine.transaction = Transaction.id
INNER JOIN Inventoryassignment on Inventoryassignment.transactionline = TransactionLine.id
AND Inventoryassignment.transaction = TransactionLine.transaction
  WHERE Transaction.recordtype = 'itemreceipt'
  AND Transaction.id = 1234567

取回结果类似如下表格

ItemLotBinQuantity
Item 1Lot 0001Bin A10
Item 2Lot 0002Bin B12
Last modified: 15/08/2024

Author

Comments

Write a Reply or Comment

Your email address will not be published.