Transaction service
This service has functionality that relates to the conclusion of any transaction within the POS as well as some other transaction related functionality such as emailing reciepts, gift receipts, returning a sale and reason codes.
Configurations
For the email functionality to work there are some configurations that need to be set. Please see further information in the LS One Online help.
Main functionality
The transaction service is divided into a few partial classes which are collections of functions for a specific functionality.
There are several functions within this service which are very important or should be used in most if not all customizations. Please read through the list of functions carefully before starting any LS One POS customizations.
The most important function in this service is the function ConcludeTransaction. Please read the information about it carefully
Name | Description |
---|---|
AddCustomerToTransaction |
Does all the checks and functionality needed when adding a customer to a transaction including processing infocodes, getting price, discount and tax information as well as calculating the new balance of the sale. When adding a customer to a sale in code this function should always be used |
CalculatePriceTaxDiscount |
This function retrieves information about price, tax and discounts for the last item on the transaction. Despite what the name implies it does not calculate the final balance of the last item or for the entire sale. This function calls the price, tax and discount services to get the information needed for the item. To calculate the balance CalculateTotals from the Calculation service needs to be called. When adding an item to a transaction in code this function should be called to get the price, tax and discount information for the item For an example of how this function is used see CreateSubcodeSaleLineItem in the Infocode service |
ClearCustomerFromTransaction | Performs the Customer clear operation |
CheckTenderStatusInDrawer | Checks what the status of the cash is in the drawer and depending on configurations returns a message to tell the user that a tender removal is required. |
ConcludeTransaction |
This is one of the most important functions in the LS One POS code base. This function is called once the POS has determined that the balance has been paid or that the transaction can be concluded, saved, printed and cleared from the POS. This function goes through the transaction and calls various functions in various services to update information centrally. The information that is updated is as follows:
Some functionality is also called in this function to either conclude or kick off some functionality that is needed:
This function should not be customized or changed except after careful consideration but the functions that are called in the various services can be customized in each service as needed. |
CreateCloneTransaction | If a transaction needs to be cloned this function needs to be called first. For an example of how this is used see the Price check dialog in the Dialog service. |
LoadTransactionStatus |
This function sets all the properties on a transaction that is needed for the POS to be able to process and calculate the transaction correctly. If a new transaction is created in code, no matter what type of transaction, this function should always be called. |
OnPriceOverride | Called from the price override operation when the item selected needs special price override functionality. In all versions including LS One 2018 this function is only called for a sales order item. If the item selected is a sales order item then function PriceOverride is called in the Sales order service |
RecalculatePriceTaxDiscount |
This function retrieves information about price, tax and discounts for all the items on the transaction. Despite what the name implies it does not calculate the final balance of the items or for the entire sale. This function calls the price, tax and discount services to get the information needed for the items. When changing a property on a sale that can affect prices, taxes and discounts on all the items this function should be called. Changing the customer on the sale for example would require a call to this function. See operations list below for a more comprehensive list |
ReturnSequencedNumbers |
If a transaction that already has a receipt ID needs to be discarded or given a new receipt ID (for example in fiscalization functionality) this function should always be called for the receipt ID that has already been issued so that the next sale. By law, in most countries, the receipt IDs that are issued have to be in the order the payments were received on each terminal so if a receipt ID is not going to be used for any reason it needs to be returned so that it can be issued again. |
SiteServiceConnectionIsNeededandAlive |
This function is called by the core of the POS before ConcludeTransaction is called to check if there is anything on the sale that needs to be checked or updated through the Site service. If so then a check is done to make sure that the Site service connection is alive. This is done so that each and every function in ConcludeTransaction doesn't need to do it's own check which limits the time the conclusion of the sale takes and also so that a message to inform the user that the Site service connection isn't working can be displayed before any process is started to close the sale. |
Email receipt functionality
Name | Description |
---|---|
CreateEmailAttachmentName | Creates the name for the attachments file that is to be sent with the email |
EmailReceipt |
Depending on the parameters on the operation "Send an email receipt" this function either sends the receipt directly to be emailed or asks for information on which receipt to be emailed. The Site service does the actual emailing so this functionality only schedules the email to be sent. |
SetReceiptOptions | Here all configurations are looked at and it is determined if the receipt can or should be sent by email or not. |
TransactionCanSendEmail | Very few types transactions that area available in the POS create receipts and this function makes sure that the transaction that is being processed can send emails. |
Gift receipt functionality
Name | Description |
---|---|
PrintGiftReceipt | Prints a gift receipt for a specific sale through the PrintGiftReceipt function in the Printing service |
Reprint receipt functionality
Name | Description |
---|---|
ReprintReceipt | Reprints a receipt for a specific sale through various printing function in the Printing service Which printing function is called depends on the configuration of the Reprint receipt button on the POS layout |
Return transaction functionality
Name | Description |
---|---|
ReturnTransaction | Retrieves information about a sale through the Site service if it is not available locally using the receipt ID. Displays information about the sale before it is marked and processed for return. |
Set reason code functionality
Name | Description |
---|---|
SetReasonCode | Displays a dialog with reason code information for each item. |
POS Operations
Many operations in the POS directly call the Transaction service. Here below is a list of all the operations and which functions they call
Name | Description |
---|---|
Add customer to loyalty card | Calls function RecalculatePriceTaxDiscount |
Customer | Calls function RecalculatePriceTaxDiscount |
Customer clear | Calls function RecalculatePriceTaxDiscount |
Change unit of measure | Calls function RecalculatePriceTaxDiscount |
Clear transaction tax exemption | Calls function RecalculatePriceTaxDiscount |
Customer add | Calls function RecalculatePriceTaxDiscount |
Customer account deposit | Calls function AddCustomerToTransaction |
Clear quantity | Calls functions CalculatePriceTaxDiscount, RecalculatePriceTaxDiscount |
Gift receipt (in Daily journal) | Calls function PrintGiftReceipt |
Infocode tax group change | Calls function RecalculatePriceTaxDiscount |
Item sale | Calls function CalculatePriceTaxDiscount |
Loyalty points discount | Calls function RecalculatePriceTaxDiscount |
Loyalty request | Calls function RecalculatePriceTaxDiscount |
Pay customer account | Calls functions AddCustomerToTransaction, ClearCustomerFromTransaction |
Pay loyalty | Calls function RecalculatePriceTaxDiscount |
Price override | Calls function OnPriceOverride (in some cases, not all) |
Recall suspended transaction | Calls function RecalculatePriceTaxDiscount |
Reprint receipt | Calls functions PrintGiftReceipt, ReprintReceipt |
Return transaction | Calls function ReturnTransaction |
Send an email receipt | Calls function EmailReceipt |
Set quantity | Calls functions CalculatePriceTaxDiscount, RecalculatePriceTaxDiscount |
Set reason code | Calls function SetReasonCode |
Tax exempt transaction | Calls function RecalculatePriceTaxDiscount |
Void item | Calls function CalculatePriceTaxDiscount |
When scanning a customer barcode or a customer card into the POS | Calls function AddCustomerToTransaction |
Development pack
To find this service in the development pack go to DevPack\Source\POS\Services