Invoice Payment¶
-
class
moco_wrapper.models.
InvoicePayment
(moco)¶ Class for handling invoice payments.
-
create
(payment_date: datetime.date, invoice_id: int, paid_total: float, currency: str)¶ Create a new invoice payment.
Parameters: - payment_date – Date of the payment
- invoice_id – Id of the invoice this payment belongs to
- paid_total – Amount that was paid (ex. 193.50)
- currency – Currency used (e.g. EUR)
Returns: The created invoice payment object
-
create_bulk
(items: list = [])¶ Create multiple new invoice payments.
Parameters: items – Payment items Returns: List of created invoice payments Bulk creation if invoice payments items with generator:
from moco_wrapper.util.generator import InvoicePaymentGenerator() from moco_wrapper import Moco items = [ gen.generate(..), gen.generate(..) ] m = Moco() created_payments = m.InvoicePayment.create_bulk(items)
-
delete
(id: int)¶ Deletes an invoice payment.
Parameters: id – Id of the payment to delete Returns: Empty response on success
-
get
(id: int)¶ Retrieve a single invoice payment.
Parameters: id – Invoice payment id Returns: Single invoice payment object
-
getlist
(invoice_id: int = None, date_from: datetime.date = None, date_to: datetime.date = None, sort_by: str = None, sort_order='asc', page=1)¶ Retrieve a list of invoice payments.
Parameters: - invoice_id – Id of a corresponding invoice
- date_from – Start date
- date_to – End date
- sort_by – Field to sort results by
- sort_order – asc or desc (default asc)
- page – Page number (default 1)
Returns: List of invoice payments
-
update
(id: int, payment_date: datetime.date = None, paid_total: float = None, currency: str = None)¶ Updates an existing invoice payment.
Parameters: - id – Id of the payment to update
- payment_date – Date of the payment
- paid_total – Amount that was paid
- currency – Currency (e.g. EUR)
Returns: The updated invoice payment object
-