MDocument
Extends:
Constructor Summary
Public Constructor | ||
public |
constructor(data: null | object) |
Member Summary
Public Members | ||
public |
ID reference to Organization's Client. If provided _documentClient object gets populated using referenced Client. |
|
public |
ISO 4217 currency code. |
|
public |
Javascript date, date of Document. |
|
public |
Javascript date, date invoice is due. |
|
public |
Javascript date, date service was started or conducted. |
|
public |
Javascript date, date service period ends. |
|
public |
Number of decimal places the Document items are trimmed and rounded to in calculations. |
|
public |
Boolean, if invoice a draft. |
|
public |
Text footer for Document. |
|
public |
module: * |
|
public |
Text note for Document. |
|
public |
String, unique (to Document type and Organization) Document number. |
|
public |
Text signature for Document. |
|
public |
Type of document (invoice, estimate or advance). |
Private Members | ||
private |
Object containting client data. |
|
private |
Object containting issuer data. |
|
private |
Collection of objects containing document line items. |
Method Summary
Public Methods | ||
public |
createPayment(data: *): Promise<MPayment> |
|
public |
createReccurence(data: *): Promise<MRecurrence> |
|
public |
listPayments(): Promise<MPayment[]> |
|
public |
|
Inherited Summary
From class BaseModel | ||
public |
data: * |
|
public |
id: * |
|
public |
module: * |
|
public |
|
|
public |
|
|
public |
setId() |
|
public |
|
Public Constructors
Public Members
public clientId: string source
ID reference to Organization's Client. If provided _documentClient object gets populated using referenced Client.
public currencyId: string source
ISO 4217 currency code. Wikipedia If not provided the Organization's default currency is used.
public date: string source
Javascript date, date of Document. Represents date the Document was issued. Time is trimmed.
public dateDue: string source
Javascript date, date invoice is due. Auto populated using Organization's default due days from today. Only present on type invoice. Time is trimmed.
public dateService: string source
Javascript date, date service was started or conducted. Only present on type invoice. Time is trimmed.
public dateServiceTo: string source
Javascript date, date service period ends. Only present on type invoice. Time is trimmed.
public decimalPlaces: string source
Number of decimal places the Document items are trimmed and rounded to in calculations. Should be 4 in most cases.
public draft: string source
Boolean, if invoice a draft. If set to true the property cannot go back to false. Only present if type is invoice.
public footer: string source
Text footer for Document. Populated with Organizaion default if not provided. May contain shortcode notations which get parsed to data on PDF or when parseForDisplay flag is provided.
public note: string source
Text note for Document. Populated with Organizaion default if not provided. May contain shortcode notations which get parsed to data on PDF or when parseForDisplay flag is provided.
public number: string source
String, unique (to Document type and Organization) Document number. Auto populated with next number based on document type.
public signature: string source
Text signature for Document. Populated with Organizaion default if not provided. May contain shortcode notations which get parsed to data on PDF or when parseForDisplay flag is provided.
public type: string source
Type of document (invoice, estimate or advance). Determines type of document, note that different document types contain different properties, rules and funcionalities. For example invoice can have Payments logged and contains dateService property. Document type cannot be switched once set to instance.
Private Members
private _documentClient: string source
Object containting client data. Property is optional if clientId is provided. Any key defined in object will be used instead of loaded client data. If clientId is not provided the data in object is saved to Organization's Clients and referenced in document ie. the clientId is auto populated. toggle definition