SimplifiedInvoice class

A class representing a simplified invoice used for transactions.

The SimplifiedInvoice class holds all necessary data for an invoice, including the supplier and customer information, the invoice lines (items), tax details, and other related fields. It can also generate both a JSON and an XML representation of the invoice, suitable for reporting and invoicing purposes.

Constructors

SimplifiedInvoice.new({required int icv, required String id, required String uuid, required DateTime issueDate, required DateTime issueTime, required String currency, required IndividualParty customer, required List<InvoiceLine> lines, required TaxDetails tax, required LegalMonetaryTotal monetaryTotal, required String pih})
Constructor to initialize the SimplifiedInvoice object with necessary values.

Properties

currency String
Currency used in the invoice (e.g., SAR for Saudi Riyals).
final
customer IndividualParty
The customer to whom the invoice is addressed.
final
hashCode int
The hash code for this object.
no setterinherited
icv int
Internal control number (ICV) for the invoice.
final
id String
Unique identifier for the invoice.
final
issueDate DateTime
The date the invoice was issued.
final
issueTime DateTime
The time the invoice was issued.
final
lines List<InvoiceLine>
The list of items (invoice lines) associated with the invoice.
final
monetaryTotal LegalMonetaryTotal
The legal monetary total of the invoice (e.g., subtotal, taxes, total).
final
pih String
The PIH (Payment Instructions Header) or additional reference for the invoice.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supplier MyBusinessInfo?
The supplier information, fetched from local storage.
no setter
tax TaxDetails
The tax details related to the invoice.
final
uuid String
Universal Unique Identifier (UUID) for the invoice.
final

Methods

generateAndSaveXml(String fileName) Future<void>
Generates and saves the XML representation of the invoice to a file.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the SimplifiedInvoice object to a JSON format.
toJsonString() String
Converts the SimplifiedInvoice object to a JSON string.
toString() String
A string representation of this object.
inherited
toXml() String
Generates the XML representation of the invoice.

Operators

operator ==(Object other) bool
The equality operator.
inherited