GM-X ERP for Blockchain - The INVOICE subsystem

By Tony Marston

6th September 2007
Amended 22nd September 2022

Introduction
1. Invoices, Invoice Items and Item Features
2. Invoice Roles
3. Invoice Status
4. Invoice Terms
5. Invoice Adjustments
6. Initial Values
7. Invoice Extra Values
8. Invoice Item Extra Values
Amendment History

Introduction

Ensuring that payment occurs is critical for organisations. One items have been ordered, shipped, or delivered in some fashion, it is important for the enterprise to make sure that is requests payments, and this is often done through invoices. It is vitally important to send out correct invoices that correspond to the appropriate orders, shipments or work efforts. The enterprise needs to set up systems that facilitate getting paid, and this could involve setting up appropriate billing accounts; matching invoices to orders, billing for shipments, invoicing for work efforts; sending out invoices; tracking payments against invoices; recording deposits, and issuing statements.

If a charge on an invoice needs to be reversed, or the whole invoice needs to be cancelled, it is possible to create a Credit Note which the customer can offset against the next purchase.

It should be noted here that this invoicing system does nothing more than allow the organisation to create sales invoices, credit notes and debit notes, and send them to customers. Tracking payments and issuing statements is done in the GM-X Accounts Receivable subsystem. The creation of purchase invoices and making payments is done in the GM-X Accounts Payable subsystem.

An invoice is a commercial document issued by a seller to a buyer, relating to a sale transaction and indicating the products, quantities, and agreed prices for products or services the seller has provided to the buyer. While it is possible to create an invoice manually, it is usual practice to create an invoice from an order. It is possible to create several invoices for the same order if different components of the order are delivered on different dates and each delivery has its own invoice. Note that an invoice can only cover the components of a single order - it is not permissable to combine the components of several orders into a single invoice.

A credit note is used to cancel an invoice, either in whole or in part, when the seller agrees that the buyer need not pay those parts, due to a fault with or a non-delivery of those parts. While it is possible to create credit notes manually, it is usual practice to create a credit note from an invoice, then to remove any components not affected by the credit note. It is possible to create several credit notes for the same invoice if different components of the invoice are disputed at different times. Note that a credit note can only cover the components of a single invoice - it is not permissable to combine the components of several invoices into a single credit note.

A debit note is used to cancel a credit note, either in whole or in part, when the seller agrees that the buyer must now pay those parts. While it is possible to create debit notes manually, it is usual practice to create a debit note from an credit note, then to remove any components not affected by the debit note. It is possible to create several debit notes for the same credit note if different components of the credit note are disputed at different times. Note that a debit note can only cover the components of a single credit note - it is not permissable to combine the components of several credit notes into a single debit note.


Invoices, Invoice Items and Item Features

Invoices are usually created directly from sales orders. A function is available to do this automatically so that the order details do not have to be transposed manually. It is possible to amend the resulting invoice, such as to add in any delivery charges, and it is also possible to create an invoice from scratch without referencing a sales order.

Figure 1 - Invoices, Invoice Items and Item Features

invoice-01 (2K)

INVOICE_HEADER table

This holds information about the invoice/credit note/debit note as a whole. The link to a related sales order is optional.

An invoice can either be created manually or generated from an existing sales order which will copy across all the items and adjustment details exactly. The rules for amending invoice details, and for creating invoices from scratch, are exactly the same as for creating and amending sales orders.

A Credit/Debit Note can either be created manually or generated from an existing invoice. The tax date of the Credit/Debit Note should be the same as the date of the Invoice to which it applies so that any values which are time sensitive can be taken from the correct time period. For example, if the tax rate changes after the invoice is created but before the credit note is produced it will be necessary to specify the invoice date on the credit note so that the rate of tax which is applied to the credit note is the same rate of tax which was applied to the invoice.

FieldTypeDescription
invoice_type string

This identifies the document type, which can be one of the following:

  • 'I' = Customer Invoice, with positive amounts.
  • 'C' = Customer Credit Note, with negative amounts.
  • 'D' = Customer Debit Note, with positive amounts.

The following document types can only be maintained via the ACCOUNTS PAYABLE subsystem.

  • 'V' = Vendor Invoice, with positive amounts.
  • 'U' = Vendor Credit Note, with negative amounts.
  • 'R' = Vendor Debit Note, with positive amounts.

Each of these document types will have their own numbering sequence.

invoice_id numeric Identity number which is generated automatically by the system.
invoice_status_type_id string Links to an entry on the INVOICE_STATUS_TYPE table for customer documents.

Links to an entry on the SUPPLIER_INVOICE_STATUS_TYPE table for supplier/vendor documents.

invoice_date date The date on which the invoice or credit note was raised.
tax_date date The tax date for the document. For Invoices this is always the invoice date, but for Credit Notes this should be the same date as the invoice to which it applies.
due_date date Optional. The date by which the invoice is due to be paid. Can be set by adding the value field in the INVOICE_TERMS table which has a term_type_id which begins with "NET-", which represents a number of days, to the tax_date field.

All available terms are initially identified on the TERM_TYPE table. Terms for each individual party must then be defined on the PARTY_TERMS table so that they can be automatically added to each invoice for that party.

invoice_msg string Optional message.
invoice_id_external string Optional. Used only in the ACCOUNTS PAYABLE subsystem to hold the invoice_id that was used by the vendor/supplier.
order_type string Optional. Links to an entry on the ORDER_HEADER table.
order_id numeric Optional. Links to an entry on the ORDER_HEADER table.
sale_type_id string Links to an entry on the SALE_TYPE table. If this table is empty then this field will not be shown, otherwise it will be required.
party_id_bill_from numeric Links to an entry on the PARTY table. This identifies the party to whom this invoice should be paid.

For customer invoices/credit notes/debit notes this will be the user's Functional Unit.

For vendor invoices/credit notes/debit notes this will be the party_id of the vendor/supplier.

party_id_bill_to numeric Links to an entry on the PARTY table. This identifies the party who is due to pay this invoice.

For customer invoices/credit notes/debit notes this will be the party_id of the customer.

For vendor invoices/credit notes/debit notes this will be the user's Functional Unit.

relationship_seq_no numeric When being accessed from the Accounts Receivable subsystem this links to the seq_no column of an entry on the AR_PARTY_RELATIONSHIP table.

When being accessed from the Accounts Payable subsystem this links to the seq_no column of an entry on the AP_PARTY_RELATIONSHIP table.

contact_mech_id_bill_from numeric Optional. Links to an entry on the CONTACT_MECHANISM table. This is the contact mechanism for party_id_bill_from. If left blank the primary postal address for this party will be used.
contact_mech_id_bill_to numeric Optional. Links to an entry on the CONTACT_MECHANISM table. This is the contact mechanism for party_id_bill_to. If left blank the primary postal address for this party will be used.
item_count numeric Display only. The count of related entries on the INVOICE_ITEM table.
invoice_value numeric Display only. The sum of all values from related entries on the INVOICE_ITEM table. This is the value in home/functional currency.
adjusted_value numeric Display only. The invoice_value plus the sum of all values from any invoice adjustments such as surcharges, discounts and taxes. This is the value in home/functional currency.
invoice_type_from string Read only. Used whan a credit note is created from an invoice to provide the identity of that invoice. Links to an entry on the INVOICE_HEADER table.
invoice_id_from numeric Read only. Used whan a credit note is created from an invoice to provide the identity of that invoice. Links to an entry on the INVOICE_HEADER table.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
currency_code_tx string Display only. The transaction (TX) currency. Links to an entry on the CURRENCY_CODE table. Obtained from the PARTY table for party_id_bill_to when the invoice is created.
currency_code_fn string Display only. The functional (FN) currency. Links to an entry on the CURRENCY_CODE table. Obtained from the PARTY table for party_id_bill_from (for customer invoices) or party_id_bill_to (for vendor invoices) when the invoice is created.
exchange_rate numeric Display only. Obtained from the Exchange Rate table when the invoice is created, but only if the transaction currency is different from the functional currency. The exchange rate lookup is FROM the transaction currency TO the functional currency.

Note that this is the inverse of the lookup method used in the ORDER subsystem which converts from functional to transaction currency.

invoice_value_tx numeric Display only. This is the same as invoice_value, but expressed in foreign/transaction currency.
adjusted_value_tx numeric Display only. This is the same as adjusted_value, but expressed in foreign/transaction currency.
The following fields are display only, and are used by the Accounts Receivable and Accounts Payable subsystems.
balance numeric Display only. The amount not yet paid for this invoice in home/functional currency. The initial value is the same as adjusted_value.
balance_tx numeric Display only. The amount not yet paid for this invoice in transaction currency. The initial value is the same as adjusted_value_tx.
posting_date date This is the date which determines the fiscal period to which the journal entry created from this invoice, credit note or debit note was (or will be) posted. Today's date by default.
last_reval_date date Read only. This is the date when revaluation processing was last performed for this invoice, credit note or debit note. That date determined the fiscal period to which the journal entry created by the revaluation (if any) was posted. Automatically updated by the system whenever revaluation processing is performed.
adjusted_reval_value numeric Read only. This is the cumulative remaining invoice revaluation amount to be cleared by application of future payments, credit notes and/or debit notes, in the functional currency of the party_id_bill_from (for customer invoices) or party_id_bill_to (for vendor invoices). Automatically updated by the system whenever revaluation processing is performed and payments, credit notes and/or debit notes are applied to the invoice.
is_posted boolean A YES/NO switch with an initial value of NO. Indicates if the invoice, credit note or debit note has been posted by creating a journal entry for the general ledger, or not. Once is_posted is YES for an invoice, credit note or debit note, the invoice, credit note or debit note cannot be modified or deleted (except by the system when performing revaluation or settlement processing).

INVOICE_ITEM table

This holds information on individual items with an invoice. Each item specifies a product and a quantity, and may have related records on INVOICE_ITEM_FEATURE and INVOICE_ITEM_ADJUSTMENT.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_HEADER table.
invoice_id numeric Links to an entry on the INVOICE_HEADER table.
invoice_item_seq_no numeric A sequence number which is generated by the system.
invoice_item_desc string Item description.
product_id string Optional. Links to an entry on the PRODUCT table.
uom_id string Links to an entry on the UNIT_OF_MEASURE table. If product_id is specified it will use that product's value, otherwise it will default to 'EACH'.
party_id numeric Optional. Links to an entry on the INVENTORY_ITEM table.
inventory_item_id numeric Optional. Links to an entry on the INVENTORY_ITEM table.
price_component_id numeric Optional. Links to an entry on the PRICE_COMPONENT table. This identifies the source of any price. It is read-only.
quantity numeric This identifies how many units of product_id were supplied.
free_units numeric Display only. An adjustment associated with this item may be a discount which is expressed as a number of free units instead of a percentage or a value. This field will identify how many units will be free of charge as a result of such a discount.
unit_price numeric Display only. The unit price for this product. This is extracted from the PRICE_COMPONENT table, and may either be the agreed price for this customer, or a special price for this class of customer, or the product's base price. This is the value in home/functional currency.
feature_price numeric Display only. The value (discount or surcharge) of any optional features which have been selected for this item. This is the value in home/functional currency.
adjusted_price numeric Display only. The price for this item which is unit_price plus feature_price plus any surcharges or discounts from the INVOICE_ITEM_ADJUSTMENT table. This is the value in home/functional currency.

The total item value, which is sometimes known as extended_price, is calculated as adjusted_price * quantity.

item_comments string Optional comments.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
unit_price_tx numeric This is the same as unit_price, but expressed in foreign/transaction currency.
feature_price_tx numeric This is the same as feature_price, but expressed in foreign/transaction currency.
adjusted_price_tx numeric This is the same as adjusted_price, but expressed in foreign/transaction currency.
The following fields are display only, and are used by the Accounts Receivable and Accounts Payable subsystems.
orig_balance numeric Read-only. This is the total value for this invoice item which is due to be paid, expressed in home/functional currency. It is calculated as unit_price multiplied by quantity (less any free_units). It does not include the feature_price (if any) nor any surcharges or discounts (if any) from the INVOICE_ITEM_ADJUSTMENT table.
orig_balance_tx numeric This is the same as orig_balance, but expressed in transaction currency.
balance numeric Read-only. The amount not yet paid for this invoice item. This initially has the same value as orig_balance, but may be reduced by settlements in the FINANCE-AR or FINANCE-AP subsystems.
balance_tx numeric This is the same as balance, but expressed in transaction currency.
reval_value numeric Read only. This is the cumulative remaining invoice item revaluation amount to be cleared by application of future payments, credit notes and/or debit notes, in the functional currency of the party_id_bill_from (for customer invoices) or party_id_bill_to (for vendor invoices) of the INVOICE_HEADER record for this invoice item. Automatically updated by the system whenever revaluation processing is performed and payments, credit notes and/or debit notes are applied to the invoice item.

INVOICE_ITEM_FEATURE table

A product may have any number of features, optional or otherwise, and some features may adjust the product price by applying either a surcharge or a discount.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_ITEM table.
invoice_id numeric Links to an entry on the INVOICE_ITEM table.
invoice_item_seq_no numeric Links to an entry on the INVOICE_ITEM table.
prod_feature_id numeric Links to an entry on the PRODUCT_FEATURE table.
price_component_id numeric Optional. Links to an entry on the PRICE_COMPONENT table. This identifies the source of any price. It is read-only.
feature_price numeric Display only. A surcharge (positive value) or discount (negative value) which is associated with this feature. This is the price per unit. The sum of all these values will be shown as the feature_price on the INVOICE_ITEM record, so will adjust the unit_price to give adjusted_price for that item. This is the value in home/functional currency.
is_hidden boolean Signifies that this entry is not to be included in any printed output.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
feature_price_tx numeric This is the same as feature_price, but expressed in foreign/transaction currency.
The following fields are display only, and are used by the Accounts Receivable and Accounts Payable subsystems.
orig_balance numeric Read-only. This is the total value for this invoice item feature which is due to be paid, expressed in home/functional currency. It is calculated as feature_price multiplied by quantity (less any free_units) for the INVOICE_ITEM record linked to this invoice item feature.
orig_balance_tx numeric Read-only. This is the same as orig_balance, but expressed in transaction currency.
balance numeric Read-only. The amount not yet paid for this invoice item feature. This initially has the same value as orig_balance, but may be reduced by settlements in the FINANCE-AR or FINANCE-AP subsystems.
balance_tx numeric Read-only. This is the same as balance, but expressed in transaction currency.
reval_value numeric Read only. This is the cumulative remaining invoice adjustment revaluation amount to be cleared by application of future payments, credit notes and/or debit notes, in the functional currency of the party_id_bill_from (for customer invoices) or party_id_bill_to (for vendor invoices) of the INVOICE_HEADER record for this invoice adjustment. Automatically updated by the system whenever revaluation processing is performed and payments, credit notes and/or debit notes are applied to the invoice adjustment.

INVOICE_ITEM_FEATURE_CUSTOMISATION table

This table holds all the customised values for a feature which has been selected for an invoice item. Some features within a feature category may be able to be customised, such as engraving options for jewellery will need the text which is to be engraved.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_ITEM_FEATURE table.
invoice_id numeric Links to an entry on the INVOICE_ITEM_FEATURE table.
invoice_item_seq_no numeric Links to an entry on the INVOICE_ITEM_FEATURE table.
prod_feature_id numeric Links to an entry on the INVOICE_ITEM_FEATURE table.
custom_seq_no numeric Links to the seq_no field on an entry in the PROD_FEAT_CAT_CUSTOMISATION table.
feature_customisation string Text.

EMAIL_TEXT table

When an invoice or credit note is emailed to a customer it will be constructed as a PDF document and sent as an attachment. The email will, however, require some text as the subject line and message body, and this table allows that text to be customised for different installations.

FieldTypeDescription
invoice_type string

This identifies the document type, which can be one of the following:

  • 'I' = Customer Invoice.
  • 'C' = Customer Credit Note.
  • 'D' = Customer Debit Note.

The following document types can only be maintained via the ACCOUNTS PAYABLE subsystem.

  • 'V' = Vendor Invoice.
  • 'U' = Vendor Credit Note.
  • 'R' = Vendor Debit Note.
template_id string Links to an entry on the EMAIL_TEMPLATE table.

The email template may contain certain keywords enclosed in '#' characters. These keywords will be replaced with proper values at runtime as follows:

  • #party_name# - the party name
  • #invoice_id# - the invoice number
  • #due_date# - the due date
  • #order_id# - the associated order number
  • #corp_name# - the organisation's name
  • #company_name# - an alias for #corp_name#
  • #corp_reg_no# - the organisation's registration number
  • #corp_vat_no# - the organisation's VAT number
  • #corp_tel_no# - the organisation's telephone number
  • #corp_email# - the organisation's email address

Invoice Roles

As well as the bill_to and bill_from details which are held on the INVOICE_HEADER, there may be a need to identify other parties who may be involved with an invoice.

Figure 2 - Invoice Roles

invoice-02 (2K)

INVOICE_ROLE_TYPE table

This identifies the types of role with which parties can be related to an invoice.

FieldTypeDescription
invoice_role_type_id string Identity
invoice_role_type_desc string Description

Here are some examples:

INVOICE_ROLE table

This identifies the roles that various parties have with an invoice.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_HEADER table.
invoice_id numeric Links to an entry on the INVOICE_HEADER table.
invoice_role_type_id string Links to an entry on the INVOICE_ROLE_TYPE table.
party_id numeric Links to an entry on the PARTY table.
percent_contribution numeric Optional. The percentage contribution made by this party. This could be useful, for example, if the commission on an order needs to be shared among several people.

Invoice Status

An invoice will be in different states at different points in time, and instead of just recording the current state it may be more useful to maintain a history of each change in state.

Figure 3 - Invoice Status

invoice-03 (2K)

INVOICE_STATUS_TYPE table

This identifies all the possible states that an invoice may go through.

FieldTypeDescription
invoice_status_type_id string Identity
invoice_status_type_desc string Description
sort_seq numeric Used for sorting the entries in the dropdown list.

Here are the values used by the system which cannot be altered:

IdDescriptionSequence
PEND Pending 1
APPR Approved 2
SENT Sent to the customer 3
PAID Paid in full 4

INVOICE_STATUS_HIST table

This keeps a history of all changes in status for an invoice. The entry with the highest sequence number is the latest.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_HEADER table.
invoice_id numeric Links to an entry on the INVOICE_HEADER table.
seq_no numeric Sequence number which is generated by the system.
invoice_status_type_id string Links to an entry on the INVOICE_STATUS_TYPE table.
status_date date The date on which this entry was created.

Invoice Terms

The parties involved in an invoice may agree on many arrangements or terms, such as payment terms. Each order may have one or more terms which are categorised by TERM_TYPE.

Figure 4 - Invoice Terms

invoice-04 (2K)

INVOICE_TERMS table

This identifies the terms which have been added to an invoice. Any entries which have been added to the PARTY_TERMS table for this party_id_bill_to (for sales invoices) or party_id_bill_from (for vendor invoices) will automatically be added to this table.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_HEADER table.
invoice_id numeric Links to an entry on the INVOICE_HEADER table.
seq_no numeric A number which is generated by the system.
term_type_id string Links to an entry on the TERM_TYPE table.
value numeric Required if is_value_required on TERM_TYPE is 'Y', otherwise it must be empty.

INVOICE_ITEM_TERMS table

This identifies the terms which have been added to an invoice item.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_ITEM table.
invoice_id numeric Links to an entry on the INVOICE_ITEM table.
invoice_item_seq_no numeric Links to an entry on the INVOICE_ITEM table.
seq_no numeric A number which is generated by the system.
term_type_id string Links to an entry on the TERM_TYPE table.
value numeric Required if is_value_required on TERM_TYPE is 'Y', otherwise it must be empty.

Invoice Adjustments

As well as the price of individual products an invoice may contain a variety of discounts or surcharges which affect its total value. Some of these adjustments may apply to individual items, such as quantity breaks, while others apply to the whole invoice, such as sales tax.

Figure 5 - Invoice Adjustments

invoice-05 (2K)

INVOICE_ADJUSTMENT table

This identifies those adjustments (surcharges or discounts) which apply to an invoice as a whole.

When any part of an invoice is amended the contents of this table is scanned to determine if any adjustments need to be made. Any effect that an individual adjustment record has is indicated in that entry's details, and the sum of all adjustments will be shown in the INVOICE_HEADER details.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_HEADER table.
invoice_id numeric Links to an entry on the INVOICE_HEADER table.
adjustment_seq_no numeric A number which is generated by the system
order_adjustment_type_id string Links to an entry on the ORDER_ADJUSTMENT_TYPE table.
price_component_id numeric Optional. Links to an entry on the PRICE_COMPONENT table.
discount_code string Optional. Links to an entry on the DISCOUNT_CODE table.
prod_cat_id string Optional. Links to an entry on the PRODUCT_CATEGORY table. This is only used where different tax rates apply to different product categories so that the system can determine the total ammount which applies to those items which fall within each tax category.
adjustment_desc string The description for this adjustment.
amount numeric A fixed amount for this adjustment. This is the value in home/functional currency.

Only one of amount, percent or product_id_free can be used.

percent numeric A percentage amount which will be applied to applicable_amount in order to calculate the adjustment value.

Only one of amount, percent or product_id_free can be used.

rounding_method string Required. This is the method used when rounding numbers to the specified number of decimal places. Allowed values are:
  • S = Standard (values of 0.4 and below will be round DOWN, 0.5 and above will be rounded UP)
  • D = DOWN (values of 0.1 to 0.9 will always be round DOWN)
  • U = UP (values of 0.1 to 0.9 will always be rounded UP)

This is initially copied from the PRICE_COMPONENT table, but can be altered manually.

adjustment numeric This is the value of the adjustment after applying percent or amount. It is held as a discrete field as it needs to be accumulated by invoice_id for the purposes of the CSV extract. This is the value in home/functional currency.
product_id_free string Optional. Links to an entry on the PRODUCT table. For Value Breaks the discount may be a free unit of a particular product instead of a monetary value. This free product will appear in the INVOICE_ITEM table with a zero price.

Only one of amount, percent or product_id_free can be used.

applicable_amount numeric Display only. The order amount that was used to calculate an adjustment value using the details contained within this entry. If this field is empty then this entry was not used to produce an adjustment value. This is the value in home/functional currency.
value_from numeric This is used only in Value Breaks, and represents the lower part of the range of values for which this entry actually applies. This is the value in home/functional currency.
value_to numeric This is used only in Value Breaks, and represents the upper part of the range of values for which this entry actually applies. This is the value in home/functional currency.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
amount_tx numeric This is the same as amount, but expressed in foreign/transaction currency.
adjustment_tx numeric This is the same as adjustment, but expressed in foreign/transaction currency.
applicable_amount_tx numeric This is the same as applicable_amount, but expressed in foreign/transaction currency.
value_from_tx numeric This is the same as value_from, but expressed in foreign/transaction currency.
value_to_tx numeric This is the same as value_to, but expressed in foreign/transaction currency.
The following fields are display only, and are used by the Accounts Receivable and Accounts Payable subsystems.
balance numeric Read-only. The amount not yet paid for this invoice adjustment. This initially has the same value as adjustment, but may be reduced by settlements in the FINANCE-AR or FINANCE-AP subsystems.
balance_tx numeric This is the same as balance, but expressed in foreign/transaction currency.
reval_value numeric Read only. This is the cumulative remaining invoice adjustment revaluation amount to be cleared by application of future payments, credit notes and/or debit notes, in the functional currency of the party_id_bill_from (for customer invoices) or party_id_bill_to (for vendor invoices) of the INVOICE_HEADER record for this invoice adjustment. Automatically updated by the system whenever revaluation processing is performed and payments, credit notes and/or debit notes are applied to the invoice adjustment.

Here are some examples:

Adjustment TypeProduct CategoryAmountPercentFree ProductValue FromValue ToApplicable AmountAdjustment
Sales Tax Zero-Rated VAT              
Sales Tax Reduced Rate VAT   5.00          
Sales Tax     17.500       18.99 3.32
Value Discount       Corkscrew 50.00 250.00    
Value Discount       Wine Cooler 250.01 500.00    
Discount   10.00         28.99 -10.00

INVOICE_ITEM_ADJUSTMENT table

This identifies those adjustments (surcharges or discounts) which apply to an invoice item.

When any part of an invoice item is amended the contents of this table is scanned to determine if any adjustments need to be made. The sum of all adjustments will be shown in the INVOICE_ITEM details.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_ITEM table.
invoice_id numeric Links to an entry on the INVOICE_ITEM table.
invoice_item_seq_no numeric Links to an entry on the INVOICE_ITEM table.
adjustment_seq_no numeric A number which is generated by the system
item_adjustment_type_id string Links to an entry on the ITEM_ADJUSTMENT_TYPE table.
price_component_id numeric Optional. Links to an entry on the PRICE_COMPONENT table.
adjustment_desc string The description for this adjustment.
amount numeric A fixed amount for this adjustment. This is the value in home/functional currency.

Only one of amount, percent, free_units or product_id_free can be used.

percent numeric A percentage amount which will be applied to applicable_amount in order to calculate the adjustment value.

Only one of amount, percent, free_units or product_id_free can be used.

rounding_method string Required. This is the method used when rounding numbers to the specified number of decimal places. Allowed values are:
  • S = Standard (values of 0.4 and below will be round DOWN, 0.5 and above will be rounded UP)
  • D = DOWN (values of 0.1 to 0.9 will always be round DOWN)
  • U = UP (values of 0.1 to 0.9 will always be rounded UP)

This is initially copied from the PRICE_COMPONENT table, but can be altered manually.

free_units numeric For Quantity Breaks the discount may be a number of free units of the same product instead of a monetary value.

Only one of amount, percent, free_units or product_id_free can be used.

product_id_free string Optional. Links to an entry on the PRODUCT table. For Quantity Breaks the discount may be a free unit of a particular product instead of a monetary value. This free product will appear in the INVOICE_ITEM table with a zero price.

Only one of amount, percent, free_units or product_id_free can be used.

applicable_amount numeric Display only. The invoice/credit note amount that was used to calculate an adjustment value using the details contained within this entry. If this field is empty then this entry was not used to produce an adjustment value. This is the value in home/functional currency.
adjustment numeric Read-only. This is the value for this invoice item adjustment after applying percent or amount to applicable_amount.
applicable_qty numeric Read-only. The quantity that was used to calculate an adjustment value using the details contained within this entry. If this field is empty then this entry was not used to produce an adjustment value.
quantity_from numeric This is used only in Quantity Breaks, and represents the lower part of the range of values for which this entry actually applies.
quantity_to numeric This is used only in Quantity Breaks, and represents the upper part of the range of values for which this entry actually applies.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
amount_tx numeric This is the same as amount, but expressed in transaction currency.
applicable_amount_tx numeric This is the same as applicable_amount, but expressed in transaction currency.
adjustment_tx numeric This is the same as adjustment, but expressed in transaction currency.
The following fields are display only, and are used by the Accounts Receivable and Accounts Payable subsystems.
orig_balance numeric Read-only. This is the total value for this invoice item adjustment which is due to be paid, expressed in home/functional currency. It is calculated as adjustment multiplied by quantity (less any free_units) for the INVOICE_ITEM record linked to this invoice item adjustment.
orig_balance_tx numeric This is the same as orig_balance, but expressed in transaction currency.
balance numeric Read-only. The amount not yet paid for this invoice item adjustment. This initially has the same value as orig_balance, but may be reduced by settlements in the FINANCE-AR or FINANCE-AP subsystems.
balance_tx numeric This is the same as balance, but expressed in transaction currency.
reval_value numeric Read only. This is the cumulative remaining invoice adjustment revaluation amount to be cleared by application of future payments, credit notes and/or debit notes, in the functional currency of the party_id_bill_from (for customer invoices) or party_id_bill_to (for vendor invoices) of the INVOICE_HEADER record for this invoice adjustment. Automatically updated by the system whenever revaluation processing is performed and payments, credit notes and/or debit notes are applied to the invoice adjustment.

Here are some examples:

Adjustment TypeAmountPercentFree UnitsFree ProductQty FromQty ToApplicable Qty
Quantity Discount 0.25       6 10 6
Quantity Discount 0.50       11 20  
Quantity Discount 0.75       21 30  

It should be noted that it is possible to have more than one item for the same product in the same invoice, perhaps with different features, so any quantity discounts have to operate on the total quantity for that product across all items within the invoice, and not just the quantity on the current item.


Initial Values

There may be cases where a transaction requires user input and a particular value or values remains constant for all instances of that transaction. In order to avoid having to manually input the same value(s) each time the transaction is run it is possible to define each of those values in the database and have those values automatically included in the user input. For maximum flexibility the following tables in the MENU database are used:

TableDescription
mnu_task_field Identifies the field names within each task for which initial values can be defined. Entries must be created here for each task+field before any initial values can be defined for a task+field.
mnu_initial_value_role This defines the initial values which are to be used when users within this role execute this task.
mnu_initial_value_user This defines the initial values which are to be used when this user executes this task.

Note that USER values take precedence over ROLE values.

Here are some typical cases:

Task Field Description
acc_credit_note(output3)b (send credit note to printer) printer_address The email address used by the desired printer.
subject The subject line in the generated email.
acc_invoice_header(output3)b
(send invoice to printer)
printer_address The email address used by the desired printer.
subject The subject line in the generated email.

Invoice Extra Values

This database may be used by other systems, such as a web front end, which may have a requirement for extra fields to be held for each invoice. There is a NAMES table which holds the names of any such extra fields, with their validation types, and a VALUES table which holds a corresponding value for each invoice.

Although these values can be held in the database they cannot be considered when processing any business rules as their names and meanings are not part of the standard software. They can, however, be dealt with in any custom plugins.

Figure 6 - Invoice Extra Values

invoice-06 (2K)

INVOICE_EXTRA_NAMES table

This identifies the names of extra fields which can be held for each invoice.

FieldTypeDescription
extra_id string Identity
extra_name string Short Name
extra_desc string Optional. Long Description
extra_type string Validation type. Allowable values are:
  • string (the default)
  • boolean
  • date
  • number(P) - a number with P digits
  • number(P,S) - a number with P digits, including S decimals

INVOICE_EXTRA_VALUES table

This holds the values for any extra fields for each invoice.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_HEADER table.
invoice_id numeric Links to an entry on the INVOICE_HEADER table.
extra_id string Links to an entry on the INVOICE_EXTRA_NAMES table.
extra_value string This holds the value for this Extra Name with this Invoice.

Invoice Item Extra Values

This database may be used by other systems, such as a web front end, which may have a requirement for extra fields to be held for each invoice item. There is a NAMES table which holds the names of any such extra fields, with their validation types, and a VALUES table which holds a corresponding value for each invoice item.

Although these values can be held in the database they cannot be considered when processing any business rules as their names and meanings are not part of the standard software. They can, however, be dealt with in any custom plugins.

Figure 7 - Invoice Item Extra Values

invoice-07 (2K)

INVOICE_ITEM_EXTRA_NAMES table

This identifies the names of extra fields which can be held for each invoice item.

FieldTypeDescription
extra_id string Identity
extra_name string Short Name
extra_desc string Optional. Long Description
extra_type string Validation type. Allowable values are:
  • string (the default)
  • boolean
  • date
  • number(P) - a number with P digits
  • number(P,S) - a number with P digits, including S decimals

INVOICE_ITEM_EXTRA_VALUES table

This holds the values for any extra fields for each invoice item.

FieldTypeDescription
invoice_type string Links to an entry on the INVOICE_ITEM table.
invoice_id numeric Links to an entry on the INVOICE_ITEM table.
invoice_item_seq_no numeric Links to an entry on the INVOICE_ITEM table.
extra_id string Links to an entry on the INVOICE_ITEM_EXTRA_NAMES table.
extra_value string This holds the value for this Extra Name with this Invoice Item.

Date created: 6th September 2007

Amendment history:

22nd Sept 2022 Updated the INVOICE_HEADER table to include the sale_type_id column.
17th Sept 2022 Updated the INVOICE_ADJUSTMENT and INVOICE_ITEM_ADJUSTMENT tables to include the rounding_method column.
22nd Dec 2020 Updated the INVOICE_HEADER table to include the relationship_seq_no column.
21st Jul 2020 Updated the INVOICE_HEADER table to include the invoice_type_from and invoice_id_from columns.
9th Apr 2019 Updated the INVOICE_HEADER table to include the invoice_id_external column.
26th Jan 2019 Updated the INVOICE_ITEM table to include the party_id column.
12th Jan 2019 Updated the INVOICE_ITEM_ADJUSTMENT table to add the orig_balance and orig_balance_tx columns.
Updated the INVOICE_HEADER table to rename currency_code to currency_code_tx.
Updated the INVOICE_HEADER table to add the currency_code_fn column.
10th Jan 2019 Updated the INVOICE_HEADER table to add the invoice_status_type_id column.
17th Dec 2018 Updated the INVOICE_HEADER table to update invoice_type to include Debit Notes.
Updated the INVOICE_HEADER table to add the posting_date, last_reval_date, adjusted_reval_value and is_posted columns.
Updated the INVOICE_ADJUSTMENT table to add the balance, balance_tx and reval_value columns.
Updated the INVOICE_ITEM table to include the price_component_id, orig_balance, orig_balance_tx, balance, balance_tx and reval_value columns.
Updated the INVOICE_ITEM_ADJUSTMENT table to include the adjustment, adjustment_tx, balance, balance_tx and reval_value columns.
Updated the INVOICE_ITEM_FEATURE table to include the price_component_id, orig_balance, orig_balance_tx, balance, balance_tx and reval_value columns.
3rd Apr 2017 Updated the INVOICE_ITEM_FEATURE table to remove the feature_customisation column.
Added the INVOICE_ITEM_FEATURE_CUSTOMISATION table
22nd Nov 2016 Added the INVOICE_EXTRA_NAMES and INVOICE_EXTRA_VALUES tables.
Added the INVOICE_ITEM_EXTRA_NAMES and INVOICE_ITEM_EXTRA_VALUES tables.
28th Sep 2015 Updated the EMAIL_TEXT table to replace the email_message and email_subject columns with the template_id column.
04 Jul 2014 Updated the INVOICE_HEADER table to include the invoice_value_tx, adjusted_value_tx and balance_tx columns.
Updated the INVOICE_ADJUSTMENT table to include the amount_tx, adjustment_tx, applicable_amount_tx, value_from_tx and value_to_tx columns.
Updated the INVOICE_ITEM table to include the unit_price_tx, feature_price_tx and adjusted_price_tx columns.
Updated the INVOICE_ITEM_ADJUSTMENT table to include the amount_tx and applicable_amount_tx columns.
Updated the INVOICE_ITEM_FEATURE table to include the feature_price_tx column.
18 Apr 2012 Updated the INVOICE_ITEM_ADJUSTMENT table to include the applicable_amount column.
14 Jul 2010 Deleted the INVOICE_NOTES table, which has been replaced by the PARTY_NOTES table.
28 Oct 2008 Updated the INVOICE_ADJUSTMENT table to include the adjustment column.
04 Oct 2008 Added the EMAIL_TEXT table.
29 Sep 2008 Added the invoice_type column to all tables to differentiate between Invoices and Credit Notes.
24 Sep 2008 Updated the INVOICE_HEADER table by removing the invoice_desc column.
Updated the INVOICE_ITEM table by adding the item_comments column.
Added the INVOICE_NOTES table.
12 Jun 2008 Updated the INVOICE_ITEM_FEATURE table by adding the feature_customisation and is_hidden columns.
20 Mar 2008 Added the sort_seq column to the INVOICE_STATUS_TYPE table.

Copyright © 1999-2022 by Geoprise Technologies Licensing, All Rights Reserved.