Calculating original number of transaction lines

Before a transaction is saved in the Transaction service, the total number of lines (tender lines, sale lines, tax lines, discount lines, etc.) are calculated and set as the original number of transaction lines. This value can be used later after replication on the head office to check if the transaction has all the data that was saved originally. For example we could check this value against a transaction to validate if it's eligible for posting.

Currently only Retail Transactions have this value calculated. Other transaction types have this value set to 0.

Extending the calculation

In the Development Pack you can find the DevPack\Source\POS\Service\TransactionService.Partner.cs file where you can customize the CalculatePartnerTotalNumberOfTransactionLines(..) method. The result of this method is added to the default calculation of the lines and set as the original number of transaction lines.

Updating old transactions with the calculated value

Existing transactions created before version LS One 2018 will have this value set to NULL. If you require to calculate the existing transaction you can manually execute the spRecalculateOriginalNumberOfTransactionLines procedure in SQL Management Studio.

Parameters:

  • From date: The transaction date and time (inclusive) from which to calculate the total number of lines. Passing NULL will calculate all transactions until To date. Default value is NULL.
  • To date: The transaction date and time (exclusive) to which to calculate the total number of lines. Passing NULL will calculate all transactions starting from the From date. Default value is NULL.
  • Include calculated transaction: If set to 1, it will recalculate transactions that have the original number of lines not equal to NULL. Default value is 0.

Passing default parameters will recalcutate all transactions from the database. This may take a long time on large databases and it is recommended to execute the procedure on smaller periods.