View source | Discuss this page | Page history | Printable version    | Latest revision

Massinvoicing/Functional Specifications

(General Description)
(Table: Invoice Template and Invoice Template Line)
Line 445: Line 445:
** name: the name of the invoice template, is displayed to the user generating the invoices
** name: the name of the invoice template, is displayed to the user generating the invoices
** description: is used to create the invoice description (c_invoice.description)
** description: is used to create the invoice description (c_invoice.description)
 +
** c_doctype_id (required): a required reference to he c_doctype table, only document types accessible from the organization of the template can be selected.
** m_pricelist_id (not-required): foreign key to the m_pricelist table
** m_pricelist_id (not-required): foreign key to the m_pricelist table
** paymentrule (not-required): a free format string field
** paymentrule (not-required): a free format string field

Revision as of 06:11, 24 July 2009

This document contains the functional specification of the mass invoicing module.


Contents

General Description

The mass invoicing function allows a user to create multiple invoices in one step for multiple business partners. The generated invoices are based on an invoice template. The invoice template defines default and pre-set information which is to be used in the generation of the invoices.

This module will use the prefix: MINV.

The menu options for the mass invoicing functions can be found in the Procurement Management > Transactions menu.

Relation to other modules

This module is related to (but not dependent on) the inter-company invoicing module. The invoices generated by mass invoicing can be used as input for the inter company invoicing process.

This module makes use of and is dependent on the multi-business-partner selector module. The business partner delivered by that module is used in the generation wizard.

MassInvoicing Wizard

To generate invoices the user will go through a multi-step wizard:

  1. select business partners, organization, invoice template and select which products will be in each invoice and their default price and quantity
  2. set a price quantity per business partner-invoice line combination and generate the invoices
  3. show the result of the generation step (invoices created)


Step 1: Select Organization, business partner and products

This step allows the user to:

A first version of the user interface is shown below.


Mass w1.png


The invoice template listbox will only show invoice templates which are active and which have at least one active line.

The product list in the bottom is refreshed when the user selects another invoice template.

When the user selects an invoice template then all product lines are initially selected.

The product list will only show active lines. The user can (de-)select all invoice template lines by checking the 'global' checkbox in the product list.

The price and quantity fields are only enabled if their corresponding line-checkbox is checked.

The business partner selector is implemented by the business partner selector module. It allows filtering business partners and to select one or more business partners.


Bp selector.png


The following validations should be done in step 1 of the wizard:

The validations marked with client-side are performed on the client-side (in the browser). The remaining validations are done when the user presses next. If a validation fails the same window is displayed with all the information as entered and a message box explaining the validation failure. The validation message should show enough detail (list specific business partners for which the above check fails).

When the user is satisfied the user can select the next button to go to step 2. The information entered in step 1 is stored and the user can return back from step 2 to change the information.

Step 2: Set price/quantity per business partner/invoice line

The second step uses the information from the first step to show a product list by business partner. All the lines of the selected invoice template are shown. Only the ones which have been selected in the first step are also selected in step 2 of the wizard. Also the price and quantity from step 1 are used, for the non-selected lines the price and quantity from the invoice template line is used.

Step 2 allows the user to change price/quantity on a business partner-invoice line level.


Mass w2.png


When the user presses generate the system validates the inputs and asks for confirmation. If the user confirms then system generates invoices (see later section for a description of the generate process).

The validation, validates that each selected line has a valid quantity and price.

If the generation fails then the step 2 window is re-shown with a detailed error message in a red message box.

Step 3: the result

In step 3 the result for of the generation step is shown. The proposal is to show the following information: a table with a list of invoices with for each invoice:

The invoice identifier is a link to the invoice itself.

In addition the sum of the total amount and grand total are displayed.

Open Topics


Invoice Templates

In the first step of the invoice generation wizard the user can select the invoice template. The invoice template defines which products are used as the basis for the generated invoice.

In addition it allows the definition of the following information which is used in each generated invoice:

On invoice header level:

On invoice line level:

If the non-mandatory information is not set then it is computed when the invoice generation takes place.


Generating Invoices

This section of the functional spec describes in some detail how the invoices are created and which information is used to set which invoice header and line column.

When the user presses the generate button the following actions are performed:


The information on the invoice header (c_invoice) is set as follows:

Column Value
ad_client_id the current user client
ad_org_id the organization selected in step 1
isactive Y
created, createdby, updated, updatedby current user, current date
issotrx Y
documentno will be computed
docstatus DR
docaction CO
processing N
processed N
posted N
c_doctype_id ARI (value to be confirmed by Gorka Ion)
c_doctypetarget_id same as c_doctype_id
c_order_id null
description set from the invoice template
salesrep_id null
dateinvoiced set to invoice date set in step 1 of the wizard
dateprinted null
dateacct set to invoice date set in step 1 of the wizard
c_bpartner_id the business partner for which the invoice is generated
c_businesspartner_location the first business partner location in c_bpartner_location which has billto='Y'
poreference null
isdiscountprinted N
dateordered null
c_currency_id taken from the invoice template, or computed
paymentrule taken from the invoice template, or computed
c_paymentterm_id taken from the invoice template, or computed
c_charge_id null
chargeamt null
totallines, grandtotal computed by triggers
m_pricelist-id taken from the invoice template, or computed
tax_included N
c_campaign_id, c_project_id, c_activity_id all null
createfrom, generateto, copyfrom null
isselfservice null
ad_orgtrx_id same as the ad_org_id
user1_id, user2_id null
witholdingamount null
taxdate invoice date entered in step 1
c_withholding_id null


The invoice line (c_invoice_line) is set as follows:

Column Value
ad_client_id the current user client
ad_org_id the organization selected in step 1
isactive Y
created, createdby, updated, updatedby current user, current date
c_invoice_id the id of the invoice header
c_orderline_id, c_inoutline_id null
line from the invoice template line
description from the invoice template line
m_product_id from the invoice template line
qtyinvoiced entered quantity on page 2 of the wizard
pricelist the price from the pricelist
priceactual price entered on page 2 of the wizard
pricelimit null
linenetamt pricestd * quantity entered by the user in step 2
c_charge_id null
chargeamt null
c_uom_id taken from the product: c_product.c_uom_id
c_tax_id from the invoice template line, or computed
s_resourceassignment_id null
taxamt null
m_attributesetinstance_id null
isdescription N
quantityorder null
m_product_uom_id same as c_uom_id
c_invoice_discount_id, c_projectline_id, c_offer_id null
pricestd computed from pricelist using the SLOrderProductData.getOffersStdPriceInvoice method
excludeforwithholding null

The following related tables are handled by triggers:

A created invoice is stored in the database and directly posted using the C_INVOICE_POST stored procedure.

Other considerations


Maintaining Invoice Templates: table definitions and windows/tabs

Table: Invoice Template and Invoice Template Line

To maintain and store invoice templates two new tables are created:

Window/Tabs for maintaining Invoice Templates

The following screenshots show examples of the maintenance windows for the invoice templates.

It header list.png


It header edit.png


It line list.png


It line edit.png

Server-Side Implementation

The server-side logic to create invoices will be using the DAL.

The idea is to implement the creation of invoices in two steps:

This pattern can be the basis for future more generic solutions as it is a common requirement that it should be easy to create business objects and set computable information automatically.

The posting of the invoice is done through a stored procedure. The implementation of this module will try to create a generic api for passing parameters to stored procedures and running stored procedures from java.