InvoiceService Class
Assembly: PTS.Modules.Invoices.dll
Syntax
public class InvoiceService : UnitOfWorkService, IServiceProviderAccessor, IInvoiceService, ISeedWork<IInvoiceService>, ISeedWork
Inheritance
System.Object
InvoiceService
Constructors
InvoiceService(IUnitOfWork, ICommerceComponentService, ITransactionService)
Declaration
public InvoiceService(IUnitOfWork unitOfWork, ICommerceComponentService CommerceComponentService, ITransactionService transactionService)
Parameters
Fields
Accounts
Declaration
protected readonly IRepository<Account> Accounts
Field Value
BillingInfos
Declaration
protected readonly IRepository<InvoiceBillingInfo> BillingInfos
Field Value
InvoiceItems
Declaration
protected readonly IRepository<InvoiceItem> InvoiceItems
Field Value
Invoices
Declaration
protected readonly IRepository<Invoice> Invoices
Field Value
Methods
CalculateDueAmount(Decimal, Decimal, Decimal)
Declaration
public 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)
Declaration
public void CalculateTotalFromItems(Invoice invoice, bool recalculateVat = false)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
System.Boolean |
recalculateVat |
|
CalculateTotalFromItemsAsync(Invoice, Boolean)
Declaration
public 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)
Declaration
public decimal GetBalance(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Decimal |
|
GetBalanceAsync(Invoice)
Declaration
public Task<decimal> GetBalanceAsync(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Decimal> |
|
GetDueAmount(Invoice)
Declaration
public decimal GetDueAmount(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Decimal |
|
GetDueAmountAsync(Invoice)
Declaration
public Task<decimal> GetDueAmountAsync(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Decimal> |
|
GetInvoiceBillingInfo(Invoice, InvoiceBillingInfoType)
Declaration
public InvoiceBillingInfo GetInvoiceBillingInfo(Invoice invoice, InvoiceBillingInfoType type)
Parameters
Returns
GetInvoiceBillingInfoAsync(Invoice, InvoiceBillingInfoType)
Declaration
public Task<InvoiceBillingInfo> GetInvoiceBillingInfoAsync(Invoice invoice, InvoiceBillingInfoType type)
Parameters
Returns
GetInvoiceBillingInfos(Invoice)
Declaration
public List<InvoiceBillingInfo> GetInvoiceBillingInfos(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
GetInvoiceBillingInfosAsync(Invoice)
Declaration
public 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)
Declaration
public InvoiceItem GetInvoiceItem(Invoice invoice, long itemNo)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
System.Int64 |
itemNo |
|
Returns
GetInvoiceItemAsync(Invoice, Int64)
Declaration
public 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)
Declaration
public List<InvoiceItem> GetInvoiceItems(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Collections.Generic.List<InvoiceItem> |
|
GetInvoiceItemsAsync(Invoice)
Declaration
public 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)
Declaration
public int GetInvoiceItemsCount(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Int32 |
|
GetInvoiceItemsCountAsync(Invoice)
Declaration
public Task<int> GetInvoiceItemsCountAsync(Invoice invoice)
Parameters
Type |
Name |
Description |
Invoice |
invoice |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
GetUnpaidInvoices(Account, Account, Int32)
Declaration
public 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)
Declaration
public 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
public 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 |
|
Account |
issuer |
|
System.Int64 |
invoiceNo |
|
System.Decimal |
amount |
|
CurrencyCode |
currency |
|
System.Decimal |
vatRate |
|
System.DateTime |
dueOn |
|
VatType |
vatOption |
|
System.Int32 |
typeCode |
|
System.Nullable<System.DateTime> |
issuedOn |
|
Returns
IssueInvoiceAsync(Account, Account, Int64, Decimal, CurrencyCode, Decimal, DateTime, VatType, Int32, Nullable<DateTime>)
Declaration
public 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 |
|
Account |
issuer |
|
System.Int64 |
invoiceNo |
|
System.Decimal |
amount |
|
CurrencyCode |
currency |
|
System.Decimal |
vatRate |
|
System.DateTime |
dueOn |
|
VatType |
vatOption |
|
System.Int32 |
typeCode |
|
System.Nullable<System.DateTime> |
issuedOn |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Invoice> |
|
SetInvoiceBillingInfo(Invoice, InvoiceBillingInfoType, String, StreetAddress, String, String, String, String)
Declaration
public 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)
Declaration
public 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)
Declaration
public 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)
Declaration
public 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> |
|
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Extension Methods