Tax service
This service is for retrieving and calculating all tax data in the system. It can, for instance, be useful for tax rounding. This service needs to be customized if the tax should be calculated in another way than it is in the standard service.
Configurations
Tax groups need to be configured on items and on either the store or customers. One or more tax codes can be set for each tax groups. For an overview over the tax setup that can be configured in LS One please read the help topics on taxes.
Main functionality
In some cases it may be necessary to directly call any of these tax functions. But when adding an item to a sale in customizations the function that should be used is the CalculatePriceTaxDiscount function in the Transaction service which also retrieves discounts and price information.
Name | Description |
---|---|
CalcAmountsTaxExcluded | Uses tax information that is on the item itself (retrieved in CalcTaxExcluded) and calculates tax amounts and adds it to all amounts on the item such as LineDiscountWithTax, LoyaltyDiscountWithTax and etc. |
CalcAmountsTaxIncluded | Uses tax information that is on the item itself (retrieved in CalcTaxIncluded) and calculates net amounts and sets the appropriate properties on the item such as LineDiscount, LoyaltyDiscount and etc. |
CalculateNewItemPrice | Calculates new item base price when a tax group has changed. Used for tax calculations in the Site Manager on the item card |
CalculatePriceFromPriceWithTax | Calculates price without tax based on price with tax |
CalculatePriceWithTax | Calculates price with tax based on the given price and the two sales tax groups |
CalculateTax | Calculates the tax for a specific sale line item. Calls CalcTaxExcluded or CalcTaxIncluded depending on configurations |
CalculateTaxBetweenSalesTaxGroups | Calculates a price by using common tax groups from two sales tax groups |
CalcTaxExcluded | Calculates tax for an item that has the net price set. The price with tax is then calculated and set on the item |
CalcTaxIncluded | Calculates tax for an item that has the price with tax set. The net price (without tax) is then calculated and set on the item |
ClearTaxExemption | Clears the tax exemption properties of the transaction and recalculates the prices |
GetCommonTaxCodes | Returns the list of tax codes that the item sales tax group and the store/customer sales tax groups have in common and therefore should be used for the tax calculations. |
GetItemTax | Gets an items tax based on its sales price. It is assumed the item is sold on the default store. Used for tax calculations in the Site Manager on the item card |
GetItemTaxForAmount | Gets the tax for an item given a price and that it is sold on the default store. Used for tax calculations in the Site Manager on the item card |
GetItemPriceForItemPriceWithTax | Gets an items price given its price with tax. It is assumed the item is sold on the default store. Used for tax calculations in the Site Manager on the item card |
GetLinesWithPrices | Looks up extended information for each item in supplied list and adds to the reply. |
GetTaxAmountForPurchaseOrderLine | Gets the tax amount for a purchase order line |
SetTaxExemption | Asks the user for a tax exemption code and then sets the tax exemption properties of the transaction and recalculates the prices |
PricesAreCalculatedWithTax | Returns true if prices are calculated with tax. Used for tax calculations in the Site Manager |
UpdatePrices | Updates all prices in the system. Updates include item prices, trade agreement prices, promotion prices. It depends on the default store setting whether prices with or without tax are kept and the other updated. |
UpdateTradeAgreementsAndPromotionsForItem | Updates trade agreement lines as well as promotion lines for given retail item when tax group has changed. |
POS Operations
Two operations in the POS directly call the Tax service. Here below is a list of all the operations and which functions they call.
Name | Description |
---|---|
Clear transaction tax exemption | Calls function ClearTaxExemption |
Tax exempt transaction | Calls function SetTaxExemption |
Development pack
To find this service in the development pack go to DevPack\Source\Core\Common_services