Commit e16373b2 authored by Douglas's avatar Douglas Committed by Jérome Perrin

Adds difference between amount and movement, and inventory and budget

amended to address
!1 (diffs, comment 19128)
and
!1 (diffs, comment 19127)
parent 4cef59fb
......@@ -149,9 +149,11 @@ Even if in our example the total price is 200€, the "value" of this movement c
Movements also have an *efficiency* property to note that a percentage of the movements quantity can be lost during the movement. For example, a movement with quantity 10 and efficiency of 95% would decrease the source's inventory by 10 and increase the inventory of the destination by 9.5. This is what we call source *inventoriated quantity* and *destination inventoriated quantity*.
XXX Difference from Amount and Movement.
## Difference from Amount and Movement
XXX Reference to movement interface.
Amount is used to represent a quantity of a given resource in a given quantity unit. Amounts are used in Movements to define a subtraction of a resource from a node and its addition to another node (mirror_node).
For more information check the [Movement interface documentation](https://lab.nexedi.com/nexedi/erp5/blob/master/product/ERP5/interfaces/movement.py).
## Movements categories
......@@ -193,7 +195,9 @@ Future inventory considers all movements that have not really happened yet, but
## Available Inventory
Available inventory is the inventory that can be offered to customers without risking to go out of stock. Available inventory counts incoming movements only if they really happened and count outgoing movements even if they are only planned.
XXX relationship with budget
## Relationship with budget
Budgets are documents that implement a process of forecasting and later comparing the real values with what was planned. The budget is used to define a limit total quantity or price of a set of movements between nodes. When movements are created they can be matched to the related budgets by using predicates. This can be used to check budget consumption and use it as a constraint to prevent the execution of movements that would exceed the budget.
# Hierarchical categories
Explain node_category instead of node_uid
......@@ -215,11 +219,11 @@ Using one `getInventoryList` is usually much more efficient than doing multiple
For example, this code:
```python
print "N1's inventory of R1 is {inventory}, value is {value}".format(
inventory=getInventory(node_uid=N1.getUid(), resource=R1.getUid(),
asset_price=getInventoryAssetPrice(node_uid=N1.getUid(), resource=R1.getUid()))
inventory=getInventory(node_uid=N1.getUid(), resource=R1.getUid(),
asset_price=getInventoryAssetPrice(node_uid=N1.getUid(), resource=R1.getUid()))
print "N2's inventory of R1 is {inventory}, value is {value}".format(
inventory=getInventory(node_uid=N2.getUid(), resource=R1.getUid(),
asset_price=getInventoryAssetPrice(node_uid=N2.getUid(), resource=R1.getUid()))
inventory=getInventory(node_uid=N2.getUid(), resource=R1.getUid(),
asset_price=getInventoryAssetPrice(node_uid=N2.getUid(), resource=R1.getUid()))
```
can be written more efficiently with `getInventoryList` this way:
......@@ -229,9 +233,9 @@ for brain in getInventoryList(node_uid=(N1.getUid(), N2.getUid()),
resource_uid=R1.getUid(),
group_by_node=True):
print "{node}'s inventory of R1 is {inventory}, value is {value}".format(
node=brain.node_title,
inventory=brain.total_inventory,
asset_price=brain.total_price)
node=brain.node_title,
inventory=brain.total_inventory,
asset_price=brain.total_price)
```
## getMovementHistoryList
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment