Invoice Item Generator¶
-
class
moco_wrapper.util.generator.
InvoiceItemGenerator
¶ -
generate_description
(description: str) → dict¶ Generate an item of type
description
Parameters: description (str) – Description the item should have Returns: The generated item
-
generate_detail_position
(title: str, quantity: float, unit: str, unit_price: float, activity_ids: list = None, expense_ids: list = None) → dict¶ Generates a detailed position item to be used in an offer items list (for example hours are a perfect example that can be split into units (a single hours set the unit, unit_price, and quantity)).
Parameters: - title (str) – Title of the position item
- quantity (float) – How many of the things (i.e. how many hours)
- unit (str) – What is the thing (i.e. hours)
- unit_price (float) – Price of a single thing (i.e. price of a single hour)
- activity_ids (list) – Ids of the activities billed by this item
- expense_ids (list) – Ids of the expenses billed by this item
Returns: The generated item
See also
-
generate_item
(title: str, quantity: float = None, unit: str = None, unit_price: float = None, net_total: float = None, activity_ids: list = None, expense_ids: list = None) → dict¶ Generate an invoice item.
Parameters: - title (str) – Title of the item
- quantity (float) – Quantity of the supplied item
- unit (str) – Unit name of the supplied item
- unit_price (float) – Unit price of the supplied item
- net_total (float) – Net total sum (either this is supplied or unit, unit_price, and quantity)
- activity_ids (list) – Ids of the activities billed by this item
- expense_ids (list) – Ids of the expenses billed by this item
Returns: The generated item
This is the base function for generating positions in an invoice. There are two types of positions. Postions that can be itemized (see
generate_detail_postion()
) and positions that do not have to be itemized (generate_lump_position()
).See also
generate_detail_postion()
andgenerate_lump_position()
-
generate_lump_position
(title: str, net_total: float) → dict¶ Generates a general position item to be used in a offer list (use this if the postion cannot (or do not want) to split the position into units).
Parameters: - title (str) – Title of the position
- net_total (float) – Total price of the postion
Returns: The generated item
See also
-
generate_pagebreak
() → dict¶ Generate an item of type
page-break
Returns: The generated item
-
generate_separator
() → dict¶ Generate an item of type
separator
Returns: The generated item
-
generate_subtotal
(title: str) → dict¶ Generate an item of type
subtotal
Parameters: title (str) – The title of the subtotal Returns: The generated item
-
generate_title
(title: str) → dict¶ Generate an item of type
title
Parameters: title (str) – Title the item should have Returns: The generated item
-