Hyper Open Edge Cloud

Base Amount Structure Good Practice

Notes on inconsistency in current base_amount category design (2009)
  • Last Update:2016-04-08
  • Version:001
  • Language:en

Some inconsistency have been found in current (december 2009) base_amount category design.

Table of Contents

base_amount structure good practice

Some inconsisytency have been found in current (december 2009) base_amount category design.

The issue was that, for trade, there is a notion of taxable, wherease for payroll, there was no such notion. This meant that either one or the other was wrong.

Right approach ?

The conclucion is that the right approach is in trade. There are 2 kinds of base amounts :

  • those which are used with getTotalPrice to computer the total of certain prices in an invoice
  • those which are used during by trade model lines to define the base of calculation of a tax or a discount

Examples

  • the notion of "salary" refers the the total of paysheet lines which contribute to salary (net or gross)
  • there is a notion of "contribution" base which is the base on which all contributions are calculated

In most countries the contribution base is equal salary, but it happens sometimes that some parts of salary are not taken into account in the contribution base.

It is the same idea as saying that the the base of vat calculation is the total price of an invoice line. However, some lines are not submitted to vat sometimes in an invoice.

Category structure

All this gives a structure of categories in which we separate 2 notions: base and report.

    /trade
    /trade/base
    /trade/base/tax/vat
    /trade/report
    /trade/report/price
    /trade/report/tax/vat
    /payroll
    /payroll/base
    /payroll/base/contribution
    /payroll/report
    /payroll/report/salary
    /payroll/report/contribution

For example

      /trade/base/tax/vat

means the base amount on which vat is calculated from the invoice lines of products. Whereas

      /trade/report/tax/vat

means the amount of vat in the invoice lines of tax.

One will notice by the way that the total quantities of lines of (/trade/report/tax/vat) is different from the total of price of lines of (/trade/base/tax/vat) due to rounding.

'base' is used for base_amounts which are needed by trade model lines to compute something else.

'report' is used for base amounts which must be displayed in a report.

Localisation structure

In some cases, specific categories are needed and are related to localisation. That's why we introduce a structure for localisation and specialisation:

   /trade
    /trade/base
    /trade/report
    /trade/i18n/fr
    /trade/local/nexedi_cn
    /payroll
    /payroll/base
    /payroll/report
    /payroll/i18n/fr
    /payroll/local/nexedi_cn

For example

    /trade/i18n/fr

stores category definitions for countries in TioLive. This is very useful.

And

       /trade/local/nexedi_cn

some exceptions to the standard categories (this can be useful in a group of companies). This is less useful.

Related Articles