# system.kanoa.inventory.issuePartToWorkOrderEvent(issueInfo, userId)

Issues (deducts) a quantity of a part from inventory and records the consumption against a CMMS work order event. 
This is a cross-module operation: `workOrderEventId` ties the transaction back to a `system.kanoa.cmms` work order event, `inventoryAssetId` identifies the bin/location the part is issued from, and `assetId` identifies the (maintainable) asset the part was used on. 
Unless otherwise noted, all fields in `issueInfo` are required. The operation is attributed to the user identified by `userId`.

---
### Parameters
**issueInfo** `Dictionary`<br />
<table class='dictionaryKeyTable'>
	<tbody>
 	<tr><td> - assetId</td><td>Integer</td><td>Where the part was used</td></tr>	
 	<tr><td> - inventoryAssetId</td><td>Integer</td><td>Where the part came from</td></tr>	
 	<tr><td> - notes</td><td>String</td><td>Not required</td></tr>	
 	<tr><td> - partId</td><td>Integer</td><td></td></tr>	
 	<tr><td> - quantity</td><td>Float</td><td></td></tr>	
 	<tr><td> - unitCost</td><td>Float</td><td>Not required</td></tr>	
 	<tr><td> - usedBy</td><td>Integer</td><td>Not required</td></tr>	
 	<tr><td> - workOrderEventId</td><td>Integer</td><td></td></tr>	
	</tbody>
</table>

**userId** `Integer`:Id of the user executing the function<br />

---
### Returns
**inventoryTransactionId** `Integer`<br />
**message** `String` None if success<br />

---
### Example
```python
issueInfo = {
	'assetId': 340,
	'inventoryAssetId': 12,
	'notes': 'Replaced worn bearing during PM',
	'partId': 8891,
	'quantity': 2.0,
	'unitCost': 14.75,
	'usedBy': 205,
	'workOrderEventId': 5502,
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
inventoryTransactionId, message = system.kanoa.inventory.issuePartToWorkOrderEvent(issueInfo, userId)
print inventoryTransactionId, message
```
