IInvoiceService Interface
Assembly: PTS.Modules.Invoices.dll
Syntax
public interface IInvoiceService
Methods
CalculateDueAmount(Decimal, Decimal, Decimal)
Returns a calculated due amount.
Declaration
decimal CalculateDueAmount(decimal invoiceTotal, decimal invoiceBalance, decimal accountBalance)
Parameters
Type |
Name |
Description |
System.Decimal |
invoiceTotal |
|
System.Decimal |
invoiceBalance |
|
System.Decimal |
accountBalance |
|
Returns
Type |
Description |
System.Decimal |
|
CalculateTotalFromItems(Invoice, Boolean)
Calculates and sets the total amount from invoice items.
Declaration
void CalculateTotalFromItems(Invoice invoice, bool recalculateVat = false)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
System.Boolean |
recalculateVat |
|
CalculateTotalFromItemsAsync(Invoice, Boolean)
Calculates and sets the total amount from invoice items asynchronously.
Declaration
Task CalculateTotalFromItemsAsync(Invoice invoice, bool recalculateVat = false)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
System.Boolean |
recalculateVat |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
GetBalance(Invoice)
Returns balance to effective date of an invoice.
Declaration
decimal GetBalance(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Decimal |
|
GetBalanceAsync(Invoice)
Returns balance to effective date of an invoice asynchronously.
Declaration
Task<decimal> GetBalanceAsync(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Decimal> |
|
GetDueAmount(Invoice)
Returns balance applied to the invoice before the next invoice was issued between the same issuer and receiver.
Declaration
decimal GetDueAmount(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Decimal |
|
GetDueAmountAsync(Invoice)
Returns balance applied to the invoice before the next invoice was issued between the same issuer and receiver asynchronously.
Declaration
Task<decimal> GetDueAmountAsync(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Decimal> |
|
GetInvoiceBillingInfo(Invoice, InvoiceBillingInfoType)
Gets billing info of an invoice based on a given type.
Declaration
InvoiceBillingInfo GetInvoiceBillingInfo(Invoice invoice, InvoiceBillingInfoType type)
Parameters
Returns
GetInvoiceBillingInfoAsync(Invoice, InvoiceBillingInfoType)
Gets billing info of an invoice based on a given type asynchronously.
Declaration
Task<InvoiceBillingInfo> GetInvoiceBillingInfoAsync(Invoice invoice, InvoiceBillingInfoType type)
Parameters
Returns
GetInvoiceBillingInfos(Invoice)
Gets all billing infos of an invoice.
Declaration
List<InvoiceBillingInfo> GetInvoiceBillingInfos(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
GetInvoiceBillingInfosAsync(Invoice)
Gets all billing infos of an invoice asynchronously.
Declaration
Task<List<InvoiceBillingInfo>> GetInvoiceBillingInfosAsync(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Collections.Generic.List<InvoiceBillingInfo>> |
|
GetInvoiceItem(Invoice, Int64)
Gets an invoice item by item number.
Declaration
InvoiceItem GetInvoiceItem(Invoice invoice, long itemNo)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
System.Int64 |
itemNo |
|
Returns
GetInvoiceItemAsync(Invoice, Int64)
Gets an invoice item by item number asynchronously.
Declaration
Task<InvoiceItem> GetInvoiceItemAsync(Invoice invoice, long itemNo)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
System.Int64 |
itemNo |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<InvoiceItem> |
|
GetInvoiceItems(Invoice)
Returns invoice items of an invoice.
Declaration
List<InvoiceItem> GetInvoiceItems(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Collections.Generic.List<InvoiceItem> |
|
GetInvoiceItemsAsync(Invoice)
Returns invoice items of an invoice asynchronously.
Declaration
Task<List<InvoiceItem>> GetInvoiceItemsAsync(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Collections.Generic.List<InvoiceItem>> |
|
GetInvoiceItemsCount(Invoice)
Gets count of invoice items of an invoice.
Declaration
int GetInvoiceItemsCount(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Int32 |
|
GetInvoiceItemsCountAsync(Invoice)
Gets count of invoice items of an invoice asynchronously.
Declaration
Task<int> GetInvoiceItemsCountAsync(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
GetUnpaidInvoices(Account, Account, Int32)
Returns unpaid invoices for a profile
Declaration
List<Invoice> GetUnpaidInvoices(Account receiver, Account issuer, int typeCode = 0)
Parameters
Type |
Name |
Description |
Account |
receiver |
|
Account |
issuer |
|
System.Int32 |
typeCode |
|
Returns
Type |
Description |
System.Collections.Generic.List<Invoice> |
|
GetUnpaidInvoicesAsync(Account, Account, Int32)
Returns unpaid invoices for a profile asynchronously.
Declaration
Task<List<Invoice>> GetUnpaidInvoicesAsync(Account receiver, Account issuer, int typeCode = 0)
Parameters
Type |
Name |
Description |
Account |
receiver |
|
Account |
issuer |
|
System.Int32 |
typeCode |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Collections.Generic.List<Invoice>> |
|
IssueInvoice(Account, Account, Int64, Decimal, CurrencyCode, Decimal, DateTime, VatType, Int32, Nullable<DateTime>)
Declaration
Invoice IssueInvoice(Account receiver, Account issuer, long invoiceNo, decimal amount, CurrencyCode currency, decimal vatRate, DateTime dueOn, VatType vatOption = VatType.IncludedInTotal, int typeCode = 0, DateTime? issuedOn = default(DateTime? ))
Parameters
Type |
Name |
Description |
Account |
receiver |
Profile that the invoice is issued to
|
Account |
issuer |
Profile that issues the invoice.
|
System.Int64 |
invoiceNo |
Invoice number.
|
System.Decimal |
amount |
Total amount
|
CurrencyCode |
currency |
Currency for the invoice
|
System.Decimal |
vatRate |
Decimal form for the VAT rate
|
System.DateTime |
dueOn |
The date the invoice has to be paid.
|
VatType |
vatOption |
|
System.Int32 |
typeCode |
|
System.Nullable<System.DateTime> |
issuedOn |
|
Returns
Type |
Description |
Invoice |
Issued invoice.
|
IssueInvoiceAsync(Account, Account, Int64, Decimal, CurrencyCode, Decimal, DateTime, VatType, Int32, Nullable<DateTime>)
Creates a new invoice asynchronously.
Declaration
Task<Invoice> IssueInvoiceAsync(Account receiver, Account issuer, long invoiceNo, decimal amount, CurrencyCode currency, decimal vatRate, DateTime dueOn, VatType vatOption = VatType.IncludedInTotal, int typeCode = 0, DateTime? issuedOn = default(DateTime? ))
Parameters
Type |
Name |
Description |
Account |
receiver |
Profile that the invoice is issued to
|
Account |
issuer |
Profile that issues the invoice.
|
System.Int64 |
invoiceNo |
Invoice number.
|
System.Decimal |
amount |
|
CurrencyCode |
currency |
Currency for the invoice
|
System.Decimal |
vatRate |
Decimal form for the VAT rate
|
System.DateTime |
dueOn |
The date the invoice has to be paid.
|
VatType |
vatOption |
|
System.Int32 |
typeCode |
|
System.Nullable<System.DateTime> |
issuedOn |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Invoice> |
Issued invoice.
|
SetInvoiceBillingInfo(Invoice, InvoiceBillingInfoType, String, StreetAddress, String, String, String, String)
Sets billing info of an invoice.
Declaration
InvoiceBillingInfo SetInvoiceBillingInfo(Invoice invoice, InvoiceBillingInfoType type, string name = null, StreetAddress address = null, string vatId = null, string IBan = null, string email = null, string phone = null)
Parameters
Returns
SetInvoiceBillingInfoAsync(Invoice, InvoiceBillingInfoType, String, StreetAddress, String, String, String, String)
Sets billing info of an invoice asynchronously.
Declaration
Task<InvoiceBillingInfo> SetInvoiceBillingInfoAsync(Invoice invoice, InvoiceBillingInfoType type, string name = null, StreetAddress address = null, string vatId = null, string IBan = null, string email = null, string phone = null)
Parameters
Returns
SetInvoiceItem(Invoice, Int64, Decimal, Int32, String, String)
Creates a new invoice item to an invoice.
Declaration
InvoiceItem SetInvoiceItem(Invoice invoice, long itemNo, decimal unitPrice, int quantity, string label, string note = null)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
System.Int64 |
itemNo |
|
System.Decimal |
unitPrice |
|
System.Int32 |
quantity |
|
System.String |
label |
|
System.String |
note |
|
Returns
SetInvoiceItemAsync(Invoice, Int64, Decimal, Int32, String, String)
Creates a new invoice item to an invoice asynchronously.
Declaration
Task<InvoiceItem> SetInvoiceItemAsync(Invoice invoice, long itemNo, decimal unitPrice, int quantity, string label, string note = null)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
System.Int64 |
itemNo |
|
System.Decimal |
unitPrice |
|
System.Int32 |
quantity |
|
System.String |
label |
|
System.String |
note |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<InvoiceItem> |
|
Extension Methods