Offer Item Generator

class moco_wrapper.util.generator.OfferItemGenerator
generate_description(description)

Generate an item of type description

Parameters:description – Description the item should have
Returns:The generated item
generate_detail_postion(title: str, quantity: float, unit: str, unit_price: float, optional: bool = False)

Generates a detailed position item to be used in an offer items list (for example work hours are a perfect example that can be split into units (a single hours set the unit, unit_price, and quantity))

Parameters:
  • title – Title of the position item
  • quantity – How many of the things (i.e. how many hours)
  • unit – What is the thing (i.e. hours)
  • unit_price – Price of a single thing (i.e. price of a single hour)
  • optional – If the position is optional or not (default False)

See also

generate_item()

generate_item(title: str, quantity: float = None, unit: int = None, unit_price: float = None, net_total: float = None, optional=False)

Generate an offer item

Parameters:
  • title – Title of the item
  • quantity – Quantity of the supplied item
  • unit – Unit name of the supplied item
  • unit_price – Unit price of the supplied item
  • net_total – Net total sum (either this is supplied or unit, unit_price, and quantity)
  • optional – Wether the item is an optional item or not (default False)
Returns:

The generated item

This is the base function for generating positions in an offer. 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()).

generate_lump_position(title: str, net_total: float, optional: bool = False)

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 – Title of the position
  • net_total – Total price of the postion
  • optional – If the position is optional or not (default False)

See also

generate_item()

generate_pagebreak()

Generate an item of type page-break

Returns:The generated item
generate_separator()

Generate an item of type separator

Returns:The generated item
generate_subtotal(title)

Generate an item of type subtotal

Returns:The generated item
generate_title(title)

Generate an item of type title

Parameters:title – Title the item should have
Returns:The generated item