StandardInvoice class
A class representing a standard invoice used for issuing an invoice to a customer.
The StandardInvoice class holds all necessary data for an invoice, including customer and supplier details, invoice lines (items), tax details, delivery information, and other related fields. It can generate the XML and JSON representations of the invoice, suitable for reporting and invoicing purposes.
Constructors
-
StandardInvoice.new({required int icv, required String id, required String uuid, required DateTime issueDate, required DateTime issueTime, required String currency, required BusinessParty customer, required List<
InvoiceLine> lines, required TaxDetails tax, required LegalMonetaryTotal monetaryTotal, required String pih, required Delivery delivery}) - Constructor to initialize the StandardInvoice object with necessary values.
Properties
- currency → String
-
Currency used in the invoice (e.g., SAR for Saudi Riyals).
final
- customer → BusinessParty
-
The customer to whom the invoice is issued.
final
- delivery → Delivery
-
The delivery information related to the invoice.
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 invoice to a JSON map, suitable for serializing to JSON format.
-
toJsonString(
) → String - Converts the invoice 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