R29929 SalesOrder - Valid Fiscal Sales Number

Code R29929
Entity Crm.Sales.SalesOrders Entity
Name ValidFiscalSalesNumber
Attribute FiscalSalesNumber
Layer Back-End
Events Commit
Priority Late
Modify NO
Applicable Legislations BG (EnterpriseCompany.Company)
Action Validate that:

If (FiscalSalesNumber != NULL)

, then REGEX(FiscalSalesNumber , ^.{8}-.{4}-[0-9]{7}$) = True
Description

When a POS Sales Order is created into database, according to the Bulgarian legislation the software must generate a unique sales number with the following format 'XXXXXXXX-ZZZZ-0000001', where:

  • XXXXXXXX - the 8-digit individual Fiscal Printer number assigned by the manufacturer;
  • ZZZZ - the 4-digit operator code entered the sales data according to the software nomenclature;
  • 0000001 - 7-digit individual number of the sales order, formed separately for each Fiscal Printer.

    Separating the elements in the unique sales number with a "-" sign is required.

    The current rule reassures that if the Applicable Legislation of the document's Enterprise Company is Bulgaria, then the format of the Fiscal Sales Number meets the requirements of the Bulgarian legislation.
Message Document '{DocumentText}' contains a Fiscal Sales Number '{FiscalSalesNumber}' that does not meet the format requirements of the Bulgarian legislation. The format of the Fiscal Sales Number must be 'XXXXXXXX-ZZZZ-0000001', where:

* XXXXXXXX - 8-digit Individual Number of the POS Fiscal Printer;

* ZZZZ - 4-digit POS Operator code;

* 0000001 - 7-digit individual number of the Sales Order, formed by the active POS Fiscal Printer's Sequence.
Introduced In Version 2019.1
Revocable NO

* For more information about the Business Rules Documentation Template and a short explanation of each column, see topic System Business Rules.