Class s.d.i.IStorable(Interface):

Part of stoqlib.domain.interfaces View In Hierarchy

Storable documentation for a certain product or a sellable item. Each storable can have references to many concrete items which will be defined by IContainer routines.
Method increase_stock When receiving a product, update the stock reference for this new
Method decrease_stock When receiving a product, update the stock reference for the sold item
Method increase_logic_stock When receiving a product, update the stock logic quantity
Method decrease_logic_stock When selling a product, update the stock logic reference for the sold
Method get_full_balance Return the stock balance for the current product. If a branch
Method get_logic_balance Return the stock logic balance for the current product. If a branch
Method get_average_stock_price Average stock price is: SUM(total_cost attribute, StockItem
Method get_stock_item Fetch a stock item for a specific branch
Method get_stock_items Fetches the stock items available for all branches.
Method has_stock_by_branch Returns True if there is at least one item on stock for the
def increase_stock(quantity, branch):
When receiving a product, update the stock reference for this new item on a specific branch company.
Parametersquantityamount to increase
branchan object implement IBranch
def decrease_stock(quantity, branch):
When receiving a product, update the stock reference for the sold item this on a specific branch company.
Parametersquantityamount to decrease
branchan object implement IBranch
def increase_logic_stock(quantity, branch=None):
When receiving a product, update the stock logic quantity reference for this new item. If no branch company is supplied, update all branches.
def decrease_logic_stock(quantity, branch=None):
When selling a product, update the stock logic reference for the sold item. If no branch company is supplied, update all branches.
def get_full_balance(branch=None):
Return the stock balance for the current product. If a branch company is supplied, get the stock balance for this branch, otherwise, get the stock balance for all the branches. We get also the sum of logic_quantity attributes
def get_logic_balance(branch=None):
Return the stock logic balance for the current product. If a branch company is supplied, get the stock balance for this branch, otherwise, get the stock balance for all the branches.
def get_average_stock_price():
Average stock price is: SUM(total_cost attribute, StockItem object) of all the branches DIVIDED BY SUM(quantity atribute, StockReference object)
def get_stock_item(branch):
Fetch a stock item for a specific branch
Returnsa stock item
def get_stock_items():
Fetches the stock items available for all branches.
Returnsa sequence of stock items
def has_stock_by_branch(branch):
Returns True if there is at least one item on stock for the given branch or False if not. This method also considers the logic stock
API Documentation for Stoqlib, generated by pydoctor at 2009-07-14 16:00:32.