Project Payment Schedule

class moco_wrapper.models.ProjectPaymentSchedule(moco)

Class for handling billing schedules for fixed price projects.

Fixed Price projects can have a target date they should be billed on (in the future). With this class you can create this target entry (and how much should be billed).

For Example you can create a project that will be billed in four (4) steps over the year.

from moco_wrapper import Moco
from datetime import date

m = Moco()

# create fixed price project
project = m.Project.create(
    name="my fixed price project",
    currency="EUR",
    leader_id=1,
    customer_id=2,
    fixed_price=True,
    budget=4000
).data

first_payment = m.ProjectPaymentSchedule.create(project.id, 1000.0, date(2020, 3, 1))
second_payment = m.ProjectPaymentSchedule.create(project.id, 1000.0, date(2020, 6, 1))
third_payment = m.ProjectPaymentSchedule.create(project.id, 1000.0, date(2020, 9, 1))
fourth_payment = m.ProjectPaymentSchedule.create(project.id, 1000.0, date(2020, 12, 1))
create(project_id: int, net_total: float, schedule_date: datetime.date, title: str = None, checked: bool = False)

Creates a new project payment schedule.

Parameters:
  • project_id (int) – The id of the project the entry belongs to
  • net_total (float) – How much should be billed on this schedule
  • schedule_date (datetime.date, str) – Date of the entry
  • title (str) – Title string (default None)
  • checked (bool) – Mark entry as checked (the entry will be crossed out in the UI) (default False)
Returns:

The created schedule item

Return type:

moco_wrapper.util.response.ObjectResponse

delete(project_id: int, schedule_id: int)

Delete a project payment schedule item

Parameters:
  • project_id (int) – Project the payment schedule belongs to
  • schedule_id (int) – Id of the schedule item to delete
Returns:

The deleted schedule on success

Return type:

moco_wrapper.util.response.ObjectResponse

static endpoints() → List[moco_wrapper.util.endpoint.endpoint.Endpoint]

Returns all endpoints associated with the model

Returns:List of Endpoint objects
Return type:moco_wrapper.util.endpoint.Endpoint
get(project_id: int, schedule_id: int)

Retrieves project payment schedule.

Parameters:
  • project_id (int) – Id of the project to schedule item belongs to
  • schedule_id (int) – Id of the schedule to retrieve
Returns:

The schedule item

Return type:

moco_wrapper.util.response.ObjectResponse

getall(from_date: datetime.date = None, to_date: datetime.date = None, checked: bool = None, company_id: int = None, project_id: int = None)

Retrieve all payment schedules

Parameters:
  • from_date (datetime.date, str (default None)) – From Date
  • to_date (datetime.date, str (default None)) – To Date
  • checked (bool (default None)) – Show checked of payment schedules
  • company_id (int (default None)) – Show payment schedules for specific company
  • project_id (int (default None)) – Show payment schedules for a project
Returns:

List of payment schedules

Return type:

moco_wrapper.util.response.ListResponse

Note

For retrieving payment schedules for a specific projects see also getlist()

getlist(project_id: int, from_date: datetime.date = None, to_date: datetime.date = None, checked: bool = None)

Retrieve a list of project payment schedules

Parameters:
  • project_id (int) – Project id of the schedule items
  • from_date (datetime.date, str (default None)) – From Date
  • to_date (datetime.date, str (default None)) – To Date
  • checked (bool (default None)) – Show checked off payment schedules
Returns:

List of schedules payments

Return type:

moco_wrapper.util.response.ListResponse

update(project_id: int, schedule_id: int, net_total: float = None, schedule_date: datetime.date = None, title: str = None, checked: bool = None)

Updates an existing project payment schedule.

Parameters:
  • project_id (int) – Project id the schedule item belongs to
  • schedule_id (int) – Id of the schedule item to update
  • net_total (float) – Total amount to be billed (default None)
  • schedule_date (datetime.date, str) – Date the billing will take place (default None)
  • title (str) – Title of the item (default None)
  • checked (bool) – Mark entry as checked (the entry will be crossed out in the UI) (default None)
Returns:

The updated schedule item

Return type:

moco_wrapper.util.response.ObjectResponse