How to configure the invoices format - BBCWiki/IPos-Internal GitHub Wiki

InvoiceNumberRules – New Method for Setting Invoice Formats

Introduction

This is the new method for setting the invoice format.
Previously, the invoice format was determined by the following parameters in Store Setup:

  • InvoiceNumberFormat – For regular invoices
  • CreditNoteNumberFormat – For return invoices
  • TaxFreeInvoiceNumberFormat – For tax-free invoices

From now on, we have the Invoice Number Rules Table, where invoice formats will be configured based on multiple criteria, as detailed below.

For clients who previously used the Store Setup parameters to configure the invoice format, starting from the version where we introduce the Invoice Number Rules Table (1.2412.1.0), the table will be populated with the formats used until now.

  • It will take the format from the respective parameters as a default.
  • If no parameters were previously set, the default format will be:
    {StoreCode}{Progressive}
  • If only the InvoiceNumberFormat parameter was filled in (as is the case for most clients), then return invoices, tax-free invoices, and back-office invoices will all follow the format specified by the InvoiceNumberFormat parameter.

Invoice Number Rules Table

InvoiceNumberRuleId DocumentType IsLegalPerson DeliveryRegion ProgressiveName InvoiceNumberFormat ProgressiveCharCount
1 SS NULL NULL Invoice {StoreCode}{Progressive} NULL
2 SR NULL NULL Invoice {StoreCode}{Progressive} NULL
3 PS NULL NULL Invoice {StoreCode}{Progressive} NULL
4 PR NULL NULL Invoice {StoreCode}{Progressive} NULL
5 TF NULL NULL Invoice {StoreCode}{Progressive} NULL

Column Explanation (Columns marked with * are mandatory)

*DocumentType

Specifies the type of sale, which can be:

  • SS - ShippingInvoice
  • SR - ShippingInvoiceReturn
  • PS - POSSale
  • PR - POSReturn
  • TF - TaxFree

IsLegalPerson

Specifies the type of person in case a different progressive is needed based on the type of person.

DeliveryRegion

Specifies the delivery destination. If the user wants different progressives based on the destination region, the values can be:

  • ICN - IntraCountry
  • IEU - Intra EU
  • EEU - Extra EU
  • NULL - If the destination is not relevant

*ProgressiveName

Specifies the name (KeyTable) of the progressive from the Progressives table that we want to use.

*InvoiceNumberFormat

Specifies the desired format:

  • {Progressive} – Will be replaced by the respective Progressive number.
  • {YY} – Will be replaced by the last two digits of the current year.
  • {YYYY} – Will be replaced by the current year.
  • {StoreCode} – Will be replaced by the store code executing the transaction.
  • {StoreId} – Will be replaced by the store ID executing the transaction.
  • {StoreExtCode} – Will be replaced by the external code of the store executing the transaction.

ProgressiveCharCount

Specifies the number of characters the progressive should have.