The Command Line
Configuration and Customization
Option | Description | Command Example |
---|---|---|
--create (-c) | Creates a new invoice (and stores it in the repository) based on an UBL order. | Example |
--render (-r) | Renders an existing invoice in the repository to the specified output format. TeX, PDF and HTML formats are supported. | Example |
--update (-u) | Updates an existing invoice in the repository. | Example |
--delete (-d) | Deletes an existing invoice from the repository | Example |
--generate (-g) | Creates a new invoice based on an existing invoice in the repository. | Example |
--query (-q) | Queries tne invoice repository | Example |
--format (-f) | Specifies the invoice output format | Example |
--output (-o) | Specifies the invoice output file path | Example |
--template(-t) | Specifies the template path used to produce the invoice output file. | Example |
Given the UBL order, use the -c option to creates a new invoice in the repository. Open Invoice creates a new invoice in the repository and renders the invoice output using the following default values:
java -jar lib/openinvoice-0.1.jar -c order.xml
Given an existing invoice in the repository, you can use -g option to have Open Invoice create a new invoice based on the information available in the existing invoice. Open Invoice, retrieves the existing invoice and uses its content to create the new invoice. But, you can still provide set of keys & values to be used by Open Invoice when creating the new invoice; those keys are:
java -jar lib/openinvoice-0.1.jar -g new-values.properties
invoice.properties
# Sample content of invoice.properties. Note that all of the following properties are optional; # if they are not specified, Open Invoice will set them to default values. EXISTING.INV_ID=2011-10-31_153 INV_ISSUE_DATE=2015-01-01 INV_ID=300 INV_ITEM_QUANTITY=10.0
TeX is the Open Invoice default output format and most customizable format for printing. To generate your own custom invoice:
java -jar lib/openinvoice-0.1.jar -r invoice-key -t custom-template.tex -o invoice.tex
Use the -u option to update an existing invoice; you needs to provide the invoice-key of the existing invoice as well as an order file that contains the update information.
java -jar lib/openinvoice-0.1.jar -u invoice-key order.xml
The following command deletes the invoice corresponding to the specified invoice-key. By default, the invoice-key is composed of the invoice issue date and the invoice number
java -jar lib/openinvoice-0.1.jar -d invoice-key
Use the -q option to perform queries on Open Invoice repository. The Open Invoice query accepts a set of filters to search the repository and format its result set to CSV or plain text format. In the following example, the query processes the pre-defined filters; sorts its result set on the invoice supplier name in ascending order; formats its result in CSV format and finaly writes the output to the result.csv file. formats see the sample file below.
java -jar lib/openinvoice-0.1.jar -q query.properties -f CSV -o result.csv
query.properties
# Sample content of query.properties. Note that all of the following filters are # optional; if they are not specified, Open Invoice will set them to default values. # Some filters are range filters including a pair of values separated by a ';'. # Putting a value inside a pair of '[]', flags the value as being inclusive. # ----------------------------------------------------------------------------- # Filters # ----------------------------------------------------------------------------- filter.INV_ISSUE_DATE=[2009-01-02];[2015-12-31] filter.INV_CURRENCY_CODE=USD filter.INV_SUBTOTAL=1;[1000000] filter.INV_TOTAL=100.00;[1000000000] filter.INV_TAX_TOTAL=1;10000000 filter.INV_ID=%200% filter.SUPPLIER_NAME=Plain% filter.CUSTOMER_NAME=%Sun% # ----------------------------------------------------------------------------- # Sort properties # ----------------------------------------------------------------------------- sort.column=SUPPLIER_NAME sort.order=DESCENDING # ----------------------------------------------------------------------------- # Result set properties # ----------------------------------------------------------------------------- result.maxSize=1000 result.countOnly=false
Open Invoice reads configuration information from several sources. The default configuration, built into the application, is augmented by user-specified configuration files, system properties, and command line options, generally in that order. Configuration files are located in the cfg directory.
The invoice locale is determined based on the Language.LocaleCode and Country.IdentificationCode of the SellerSupplierParty.party in the given UBL order. For example, fr and BE selects French as the invoice language and the invoice fields formatting are done according to the Belgian locale.
The invoice currency is determined based on the Price.CurrencyCode of the first InvoiceLine of the given UBL order.
There are two ways for changing your invoice terms:
To change the invoice look and feel:
In openinvoice.properties, set repository.uri to point to your desired directory path.
In openinvoice.properties, set output.dir to point to your desired directory path.
It's the unique key identifying a given invoice in the Open Invoice repository. By default, Open Invoice uses a composite key that is composed of the invoice issue date and the invoice identifier. For example, 2012-01-01_101.