GetInventory API accepts 'omit_input' to take into account only incoming movements and 'omit_output' to take into account only outgoing movement from a node.
Table of Contents
omit_input and omit_output in inventory API¶
Problem #1:
- We don't want to take into account movements that comes from this node and goes to this node.
Problem #2:
- We don't want to limit to a node, but rather to a node category, section category and/or payment category, in that case we don't count movement going from a node in the "area" to another node in
this same area.
This area where we want to exclude internal movements from is defined by membership of given categories, using node_category and/or section_category (or specifying node/section directly using their
uids), we don't find it necessary to add payment or function categories here, especially because it would require adding new columns to stock table.
The API proposal is:
- by default, omit_input and omit_output only takes movement where quantity < 0 and quantity > 0, respectivly.
- we add new keywords, consolidate_node and consolidate_section which are binary arguments, both false by default. If consolidate_node is true, we will not sum movements that come from and
goes to the same node group. node group is defined by node_uid or node_category parameters. (mirror_node is ignored here) If consolidate_section is true, we will not sum movements that come
from and goes to the same section group. section group is defined by section_uid and section_category parameters. (mirror_section is ignored here) If both are true, the area is the set intersection
of area defined by consolidate_node and consolidate_section.
Related Articles¶