InventoryIssueBuilder
The `InventoryIssueBuilder` is your primary tool for creating the JSON payload needed to create `InventoryIssue` records with the `InventoryService`.
Importing the Builder
To get started, import the `InventoryIssueBuilder` from the `easy_acumatica.models` module.
from easy_acumatica.models.inventory_issue_builder import InventoryIssueBuilder
Builder Methods
Use the shortcut methods to set common top-level fields on the inventory issue. For any other field, you can use the generic `.set()` method.
issue_payload = (
InventoryIssueBuilder()
.date("2023-10-27T00:00:00")
.description("Materials for internal project")
.post_period("102023")
)
add_detail(**kwargs)
The most important part of an inventory issue is its detail lines. This method allows you to add these lines by passing keyword arguments for each column in the line, such as `InventoryID`, `Warehouse`, `Qty`, and `UOM`.
issue_payload = (
InventoryIssueBuilder()
.description("Issue for project #123")
.add_detail(
InventoryID="PROJ-ITEM",
Warehouse="PROJECTS",
Qty=25,
UOM="BOX"
)
.add_detail(
InventoryID="RAW-MAT-01",
Warehouse="MAIN",
Qty=10
)
)
# Use with the InventoryService
# client.inventory.create_inventory_issue("24.200.001", builder=issue_payload)
to_body()
Once you have set all the required fields and details, call `.to_body()` to generate the final dictionary, ready to be sent as the JSON body in your API request.