Project Recurring Expense¶
-
class
moco_wrapper.models.
ProjectRecurringExpense
(moco)¶ Class for handling recurring expenses of a project.
An example for this would be when a third part subscription (repeat cost) is bought for a specific customer project and then get billed to the project to regain the cost.
See also
moco_wrapper.models.ProjectExpense
for one time expenses.-
create
(project_id: int, start_date: datetime.date, period: moco_wrapper.models.project_recurring_expense.ProjectRecurringExpensePeriod, title: str, quantity: float, unit: str, unit_price: float, unit_cost: float, finish_date: datetime.date = None, description: str = None, billable: bool = True, budget_relevant: bool = False, custom_properties: dict = None)¶ Create a new recurring expense for a project.
Parameters: - project_id (int) – Id of the project to create the expense for
- start_date (datetime.date, str) – Starting date of the expense
- period (
ProjectRecurringExpensePeriod
, str) – period of the expense - title (str) – Title of the expense
- quantity (float) – Quantity (how much of
unit
was bought?) - unit (str) – Name of the unit (What was bought for the customer/project?)
- unit_price (float) – Price of the unit that will be billed to the customer/project
- unit_cost (float) – Cost that we had to pay
- finish_date (datetime.date, str) – Finish date, (if empty: unlimited)
- description (str) – Descripion of the expense
- billable (bool) – If this expense billable (default True)
- budget_relevant (bool) – If this expense is budget relevant (default False)
- custom_properties (dict) – Additional fields as dictionary
Returns: The created recurring expense object
-
delete
(project_id: int, recurring_expense_id: int)¶ Deletes an existing recurring expense.
Parameters: - project_id (int) – Project id the expense belongs to
- recurring_expense_id (int) – Id of the expense to delete
Returns: Empty response on success
-
get
(project_id: int, recurring_expense_id: int)¶ Retrieve a single recurring expense
Parameters: - project_id (int) – Id of the project the expesen belongs to
- recurring_expense_id (int) – iI of the recurring expense
Returns: Single recurring expense object
-
getlist
(project_id: int, sort_by: str = None, sort_order: str = 'asc', page: int = 1)¶ Retrieve a list of recurring expenses for a project
Parameters: - project_id (int) – Id of the project the expesen belongs to
- sort_by (str) – Field to sort results by
- sort_order (str) – asc or desc (default asc)
- page (int) – Page number (default 1)
Returns: List of recurring expenses
-
update
(project_id: int, recurring_expense_id: int, title: str = None, quantity: float = None, unit: str = None, unit_price: float = None, unit_cost: float = None, finish_date: datetime.date = None, description: str = None, billable: bool = None, budget_relevant: bool = None, custom_properties: dict = None)¶ Update an existing recurring expense.
Parameters: - project_id (int) – Id of the project
- recurring_expense_id (int) – Id of the recurring expense to update
- title (str) – Title of the expense
- quantity (int) – Quantity (how much of
unit
was bought?) - unit (str) – Name of the unit (What was bought for the customer/project?)
- unit_price (float) – Price of the unit that will be billed to the customer/project
- unit_cost (float) – Cost that we had to pay
- finish_date (datetime.date, str) – Finish date, (if empty: unlimited)
- description (str) – Descripion of the expense
- billable (bool) – If this expense billable
- custom_properties (dict) – Additional fields as dictionary
Returns: The updated recurring expense object
-
-
class
moco_wrapper.models.project_recurring_expense.
ProjectRecurringExpensePeriod
¶ Enumeration for allowed values of
period
argument ofProjectRecurringExpense.create()
.Example usage:
from moco_wrapper.models.project_recurring_expense import ProjectRecurringExpensePeriod from moco_wrapper import Moco m = Moco() recur_expense = m.ProjectRecurringExpense.create( .. period = ProjectRecurringExpensePeriod.WEEKLY )
-
ANNUAL
= 'annual'¶
-
BIANNUAL
= 'biannual'¶
-
BIWEEKLY
= 'biweekly'¶
-
MONTHLY
= 'monthly'¶
-
QUARTERLY
= 'quarterly'¶
-
WEEKLY
= 'weekly'¶
-