# Generating an invoice in "facturae" format (version 3.2)
# Instructions for use
This window is devoted to generating drafts and invoices in "facturae" format (version 3.2). For this purpose a number of fields are displayed, some of which must be filled in by the user (marked with an asterisk: *) and other non-editable ones (with a blue background) which are merely for information purposes. We shall now describe in detail how to fill in the different fields:
In the section "General invoice data" you can enter global details such as the date of issue, the transaction date and place and the billing period. In addition, the system will assign, internally, a unique identifier or "Invoice number" to the invoice being generated. In the section "Issuer" an existing issuer may be selected (from among all those previously stored in the application) or a new issuer may be entered and saved in the database. In the first case, select "Legal entity" or "Private individual" and then click on the "Issuer" tab. Finally, click on the desired user. In the second case, click on "New User". Immediately, all issuer fields will become editable (white background) so that you can enter the new user data. The only non-editable field will be "Identifier", whose value will be internally assigned by the application itself. Once all compulsory fields have been completed, click on "Save": a message will pop up reporting on the success or failure of the operation. It is also possible to delete an existing issuer, provided it has not previously been used in another invoice or draft copy: all you have to do is select it and click on "Delete user". The section "Recipient" is completely analogous to the previous one. In this case, the FACe tab will be enabled, if selected to be a recipient of this type. In the section "Invoice Detail" you must enter the item(s) to be billed (table with deep blue borders). You may add or delete details (or items) by using the icons situated for the purpose on the right hand side. In addition, you may enter or delete global invoice data such as discounts, charges, attached documents ...etc. in the panel located beneath the items table; to do this, you use the buttons "Add" and "Delete" which are situated on the right hand side. Finally, in the section "Totals" the numerical values of the different fields that will make up the invoice are shown for information purposes.
Once all the compulsory fields have been completed, there are two possibilities:
Save draft: It will be stored in the "Drafts" folder, pending subsequent modification and/or signing. A draft may also be deleted if one wishes. Sign: A window will open with all the digital certificates available. After selecting one of them, the corresponding invoice will be generated with a digital signature and will be stored in the "Issued" folder. An invoice that has been issued cannot be deleted.
# Attaching documents.
If you wish, you may attach one or several documents to the invoice to be generated. To do this, click on the tab "Attached" situated in the section "Invoice detail". When "Add" is clicked, an emerging window will open where you can select the type of file to attach (in "Format") and the route to its location (click on "Browse" to do this). It is compulsory to enter, in addition, a description of the document attached. Finally, you can choose to include (or not) the file attached in the invoice xml. If you do include it, the document will be binary encoded and will become a part of the xml; if you do not include it, an internal reference will only be constructed between the invoice generated and the file attached. Next, click on "OK": the document selected will appear in the attached table. In the same way, you can also delete attached documents by clicking on "Delete".
# Entering extensions.
The block "Extension" requires a basic knowledge of the internal structure of an XML file. This format is composed of tags which open and close blocks of information schematically. The electronic bill specification defines the tags that may be displayed in the XML files generated. To add new tags, you must first indicate in the "Configuration" window the schema descriptor (XSD file) to be extended and the tag names space to be added. Then, enter the information block you wish to insert in the invoice. You can do this in two ways: Directly in the field "Extension". By clicking on "Extend": an emerging window will open in which you can insert the information block. Next, click on "Verify" to check whether the information entered complies with the schema defined by the XSD file selected in "Configuration". If the result is positive, a success message will pop up and this portion of code will become part of the invoice. If, on the other hand, the result is negative, a warning message will be displayed (you can click on "Extend" to obtain more information on the error that occurred) and the information will not be entered in the invoice.
# NOTE
Extensions may be entered in three different places in the invoice: At global invoice level, from the invoice generation window. At attached document level, in the "Attached" tab situated In the section "Invoice detail" of the invoice generation window. At item or detail line level, from the item generation window.