C# Class pcAmerica.DesktopPOS.API.Client.SalesAPI

Mostra file Open project: pcAmerica/CRE-RPE-Client-API-Library Class Usage Examples

Public Methods

Method Description
ApplyCardPayment ( Context context, long invoiceNumber, int splitCheckNumber, CreditCardPaymentProcessingResponse response, int paymentIndex ) : AppliedPaymentResponse

Applies a credit card payment to the specified invoice

ApplyCashPayment ( Context context, long invoiceNumber, int splitCheckNumber, decimal amount ) : AppliedPaymentResponse

Applies a cash payment to the specified invoice

CombineSplits ( Context context, long invoiceNumber ) : Invoice

Combines the unpaid split checks back into a single check.

EmailReceipt ( Context context, long invoiceNumber, int splitCheckNumber, string emailAddress ) : bool

Emails a receipt for the specified invoice or split check to the specified email address

EndInvoice ( Context context, long invoiceNumber ) : bool

Marks the specified invoice as complete, only if it's fully paid. Also sends the order to the kitchen if it has not been printed yet.

EndSubCheck ( Context context, long invoiceNumber, short subCheckNumber ) : bool

Marks the specified subcheck as complete, only if it's fully paid. Also sends the order to the kitchen if it has not been printed yet.

GetAllOnHoldInvoices ( Context context ) : List

Retrieves a list of Invoice Numbers, Grand Total, CashierId, OnHoldID for the whole store/restaurant

GetInvoice ( Context context, long invoiceNumber ) : Invoice

Retrieves the invoice header and line item details for a specified invoice number in context.

GetInvoiceHeader ( Context context, long invoiceNumber ) : Invoice

Retrieves only the invoice header for a specified invoice number in context.

GetItemsSold ( System.DateTime startDateTime, System.DateTime endDateTime ) : List

Retrieves a list of invoice number, item name, item number, cashier, date sold, price, quantity, and discount amounts for each item record

GetOnHoldInvoicesForCashier ( Context context ) : List

Retrieves a list of Invoice Numbers, Grand Total, CashierId, OnHoldID for a specified Cashier/Employee

GetTotals ( System.DateTime startDateTime, System.DateTime endDateTime ) : SalesTotals

Retrieves the summary of Net Sales, Total Tax, and Grand Total between date/times

LockInvoice ( Context context, long invoiceNumber ) : bool

Locks an invoice so no other devices will attempt to open or modify it.

ModifyItems ( Context context, long invoiceNumber, List items ) : Invoice

Modifies an invoice to change the line item details based on EntityState. Items can be added/deleted/modified/unchanged. The API matches the line item id with the ObjectID in the CRE/RPE invoice, and does the specified operation to it. Line items with a modified status can change quantity and price. Deleted line items will remove the item from the invoice. Deleting an item that has child details will also remove the children. When adding a new line item, assign your own GUID as an id, and associate it as the parent to modifier items.

PrintReceipt ( Context context, long invoiceNumber, int splitCheckNumber ) : bool

Prints a receipt for the specified invoice or split check to the configured printer for the store id, station id

SendToKitchen ( Context context, long invoiceNumber ) : bool

Directs the API to send the order to the kitchen at this time. Only the items that have not previously been printed in the kitchen are printed.

SetPartySizeForInvoice ( Context context, long invoiceNumber, int partySize ) : bool

Sets the party size for the invoice

SplitInvoice ( Context context, long invoiceNumber, int numberOfWays ) : Invoice

Splits the invoice evenly into the specified number of ways

SplitInvoiceByGuest ( Context context, long invoiceNumber ) : Invoice

Splits the invoice evenly among the assigned guests

StartNewInvoice ( Context context, String onHoldID, String sectionID ) : Invoice

Begins a new invoice, saving it with the specified onHoldID, and automatically "locks" it so other devices cannot modify it. Always unlock the invoice when you are finished working with/modifying it.

UnLockInvoice ( Context context, long invoiceNumber ) : bool

Unlocks an invoice to make it available for other devices to open and work on it. Unlock should always be called when done working on an invoice on your device.

VoidInvoice ( Context context, long invoiceNumber, bool SendVoidToKitchen ) : bool

Voids the invoice the including removing all associated payments

Method Details

ApplyCardPayment() public method

Applies a credit card payment to the specified invoice
public ApplyCardPayment ( Context context, long invoiceNumber, int splitCheckNumber, CreditCardPaymentProcessingResponse response, int paymentIndex ) : AppliedPaymentResponse
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be paid
splitCheckNumber int The split check number, 0-based. Provide -1 if there are no split checks.
response CreditCardPaymentProcessingResponse Provides the details of the card payment
paymentIndex int Index for a payment being updated(post authing Credit Cards). Provide -1 if not updating a payment
return AppliedPaymentResponse

ApplyCashPayment() public method

Applies a cash payment to the specified invoice
public ApplyCashPayment ( Context context, long invoiceNumber, int splitCheckNumber, decimal amount ) : AppliedPaymentResponse
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be paid
splitCheckNumber int The split check number, 0-based. Provide -1 if there are no split checks.
amount decimal The cash amount being applied
return AppliedPaymentResponse

CombineSplits() public method

Combines the unpaid split checks back into a single check.
public CombineSplits ( Context context, long invoiceNumber ) : Invoice
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be combined
return Invoice

EmailReceipt() public method

Emails a receipt for the specified invoice or split check to the specified email address
public EmailReceipt ( Context context, long invoiceNumber, int splitCheckNumber, string emailAddress ) : bool
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be emailed
splitCheckNumber int The split check number, 0-based. Provide -1 if there are no split checks.
emailAddress string The email address to send the receipt to
return bool

EndInvoice() public method

Marks the specified invoice as complete, only if it's fully paid. Also sends the order to the kitchen if it has not been printed yet.
public EndInvoice ( Context context, long invoiceNumber ) : bool
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be ended
return bool

EndSubCheck() public method

Marks the specified subcheck as complete, only if it's fully paid. Also sends the order to the kitchen if it has not been printed yet.
public EndSubCheck ( Context context, long invoiceNumber, short subCheckNumber ) : bool
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be ended
subCheckNumber short The number for the subcheck to be ended
return bool

GetAllOnHoldInvoices() public method

Retrieves a list of Invoice Numbers, Grand Total, CashierId, OnHoldID for the whole store/restaurant
public GetAllOnHoldInvoices ( Context context ) : List
context Context The store id, station id, and cashier id the information should be restricted to.
return List

GetInvoice() public method

Retrieves the invoice header and line item details for a specified invoice number in context.
public GetInvoice ( Context context, long invoiceNumber ) : Invoice
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be returned
return Invoice

GetInvoiceHeader() public method

Retrieves only the invoice header for a specified invoice number in context.
public GetInvoiceHeader ( Context context, long invoiceNumber ) : Invoice
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be returned
return Invoice

GetItemsSold() public method

Retrieves a list of invoice number, item name, item number, cashier, date sold, price, quantity, and discount amounts for each item record
public GetItemsSold ( System.DateTime startDateTime, System.DateTime endDateTime ) : List
startDateTime System.DateTime The period start date/time
endDateTime System.DateTime The period end date/time
return List

GetOnHoldInvoicesForCashier() public method

Retrieves a list of Invoice Numbers, Grand Total, CashierId, OnHoldID for a specified Cashier/Employee
public GetOnHoldInvoicesForCashier ( Context context ) : List
context Context The store id, station id, and cashier id the information should be restricted to.
return List

GetTotals() public method

Retrieves the summary of Net Sales, Total Tax, and Grand Total between date/times
public GetTotals ( System.DateTime startDateTime, System.DateTime endDateTime ) : SalesTotals
startDateTime System.DateTime The period start date/time
endDateTime System.DateTime The period end date/time
return SalesTotals

LockInvoice() public method

Locks an invoice so no other devices will attempt to open or modify it.
public LockInvoice ( Context context, long invoiceNumber ) : bool
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be locked
return bool

ModifyItems() public method

Modifies an invoice to change the line item details based on EntityState. Items can be added/deleted/modified/unchanged. The API matches the line item id with the ObjectID in the CRE/RPE invoice, and does the specified operation to it. Line items with a modified status can change quantity and price. Deleted line items will remove the item from the invoice. Deleting an item that has child details will also remove the children. When adding a new line item, assign your own GUID as an id, and associate it as the parent to modifier items.
public ModifyItems ( Context context, long invoiceNumber, List items ) : Invoice
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be modified
items List The list of modified items
return Invoice

PrintReceipt() public method

Prints a receipt for the specified invoice or split check to the configured printer for the store id, station id
public PrintReceipt ( Context context, long invoiceNumber, int splitCheckNumber ) : bool
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be printed
splitCheckNumber int The split check number, 0-based. Provide -1 if there are no split checks.
return bool

SendToKitchen() public method

Directs the API to send the order to the kitchen at this time. Only the items that have not previously been printed in the kitchen are printed.
public SendToKitchen ( Context context, long invoiceNumber ) : bool
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be sent the kitchen
return bool

SetPartySizeForInvoice() public method

Sets the party size for the invoice
public SetPartySizeForInvoice ( Context context, long invoiceNumber, int partySize ) : bool
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be returned
partySize int The new number of guests in the party
return bool

SplitInvoice() public method

Splits the invoice evenly into the specified number of ways
public SplitInvoice ( Context context, long invoiceNumber, int numberOfWays ) : Invoice
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be split
numberOfWays int The number of ways to split the check. E.g. Provide 2 to split the check 2 ways.
return Invoice

SplitInvoiceByGuest() public method

Splits the invoice evenly among the assigned guests
public SplitInvoiceByGuest ( Context context, long invoiceNumber ) : Invoice
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be split
return Invoice

StartNewInvoice() public method

Begins a new invoice, saving it with the specified onHoldID, and automatically "locks" it so other devices cannot modify it. Always unlock the invoice when you are finished working with/modifying it.
public StartNewInvoice ( Context context, String onHoldID, String sectionID ) : Invoice
context Context The store id, station id, and cashier id the information should be restricted to.
onHoldID String The ID that should represent an invoice. If the ID matches a Table Number, the table will become reserved.
sectionID String The section for the invoice to be put into see TableAPI for section info
return Invoice

UnLockInvoice() public method

Unlocks an invoice to make it available for other devices to open and work on it. Unlock should always be called when done working on an invoice on your device.
public UnLockInvoice ( Context context, long invoiceNumber ) : bool
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that should be unlocked
return bool

VoidInvoice() public method

Voids the invoice the including removing all associated payments
public VoidInvoice ( Context context, long invoiceNumber, bool SendVoidToKitchen ) : bool
context Context The store id, station id, and cashier id the information should be restricted to.
invoiceNumber long The number of the invoice that is to be voided
SendVoidToKitchen bool
return bool