The below sections provide an overview of the extensibility options required to implement the Retail localization solution for Norway.
The solution consists of a new project, new interfaces and a new service. Besides that, several existing interfaces are extended with new methods.
- The ReceiptTransactionTypeService project is located under the Retail SDK\POS Plug-ins\Services folder and is part of the Services solutions.
- The new interface of ITaxOverrideTrigger is part of the Contracts assembly.
- The existing interface of IBatchOperationTrigger is extended with three new methods:
- PreSaveCloseBatch is called before saving a closed batch data;
- PreBuildReport is called before building a daily report;
- PostBuildReport is called after building a daily report with possibility to extend it.
- The existing interface of IItemTrigger is extended with new method:
- PostPriceCheck is called after checking the item price.
These new interfaces should be implemented and used in the Norway trigger localization project.
Receipt transaction type service
The new ReceiptTransactionTypeService service is added to enable the customization of logic determining the type of receipt for a POS transaction. This service works the same way as other services and is loaded by MEF. It provides the GetReceiptTransType method, which could be called from localization triggers to determine the type of receipt for a POS transaction, for example in order to resolve the receipt title field.
Tax override trigger
The new TaxOverride trigger is added to enable the customization of the tax override process. This trigger works the same way as other triggers and is loaded by MEF. It provides the following four methods: PreOverrideTaxLine, PostOverrideTaxLine, PreOverrideTaxTransaction and PostOverrideTaxTransaction; the methods are called before and after overriding tax for a sales line and a sales transaction, respectively.
The new ITaxOverrideTrigger interface was added to the Contracts library. This interface describes the PreOverrideTaxLine, PostOverrideTaxLine, PreOverrideTaxTransaction and PostOverrideTaxTransaction methods.
The PreOverrideTaxLine and PreOverrideTaxTransaction methods can interrupt the tax overriding process and show messages via the standard PreTriggerResult object. To use the TaxOverride trigger, a new class needs to be created. This class should implement the ITaxOverrideTrigger interface. In this case, MEF will load the class during the application startup.
Norway triggers
To complete the Norway localization the NorwayTriggers project should be implemented as standard POS triggers that are loaded if the ISO code field of the functionality profile of POS is set to NO.
- NorwayApplicationTrigger should implement the IApplicationTrigger interface and overrides the ApplicationStart method in order to initialize the registration state.
- NorwayBatchOperationTrigger should implement the IBatchOperationTrigger interface and overrides the SaveCloseBatch, PreSaveCloseBatch and PreBuildReport methods:
- The SaveCloseBatch method updates shift grand total counters;
- The PreSaveCloseBatch method calculates Norway-specific shift date and saves in order to transmit it to HQ;
- The PreBuildReport method overrides X and Z reports build logic.
- NorwayPrintingTrigger should implement the IPrintingTrigger interface and overrides the GetReceiptFieldInfo method. The method receives the IReceiptField and the IReceiptPrintingContext objects and calculates the value of the receipt field being printed.
- NorwayTransactionTrigger should implement the ITransactionTrigger interface and overrides the PreEndTransaction and SaveTransaction methods:
- The PreEndTransaction method receives the IPosTransaction object and performs the registration of the retail transaction;
- The SaveTransaction method receives the IPosTransaction object and finalizes the registration of the retail transaction by saving the fiscal registration information.