Skip to main content

system.kanoa.inventory.addInventoryTransaction(inventoryTransactionInfo, userId)

Adds or updates an inventory transaction and updates the inventory balance. Pass inventoryTransactionId to update an existing record, omit or pass None to insert.


Parameters

inventoryTransactionInfo Dictionary

- assetIdIntegerNot required. Physical asset the part was used on.
- costCenterIdIntegerNot required.
- inventoryAssetIdIntegerRequired for insert.
- inventoryTransactionIdIntegerNot required. Pass to update existing record.
- inventoryTransactionTypeIdIntegerRequired for insert.
- notesStringNot required.
- partIdIntegerRequired for insert.
- quantityFloatRequired for insert. Must be > 0.
- referenceNumberStringNot required. e.g. 'PO 1234'
- referenceTypeStringNot required. e.g. 'PO', 'WO'
- sourceRecordIdIntegerNot required. For automated processes only.
- sourceSchemaNameStringNot required. For automated processes only.
- sourceTableNameStringNot required. For automated processes only.
- supplierIdIntegerNot required.
- unitCostFloatNot required.

userId Integer:Id of the user executing the function


Returns

inventoryTransactionId Integer
message String None if success


Example