How To Create Report ODT


In our Netforce system, users can make or change their own templates. We have created some basic templates containing some mandatory fields. Please click on the following link to see some samples:

Basic elements


There are several things a user needs to know before making a custom report template. Netforce ERP can read parameters in a prepared template and then replace them by the data in the system.

Basic element of each variable includes:

  1. Element Opening tag {{ This symbol is used as an indicator for the system to start reading and parsing parameters. Any word starts with these two blankets will be replaced by data read from the system
  2. Parameter: For example currency total_amount This is a key linked with the field name and format in the system, the user needs to enter it exactly the same as a code we provided in order to parse data.
  3. Element Ending tag }} This symbol indicates the end of the parameter.

For example, {{currency total_amount}} This will read value from the system and format it as a currency.

Parameters


After we knew already about the standard elements, we have to go a little bit deeper in other special components as listed below.

SUB OPENING & ENDING TAGS

Symbol

Meaning

Example

Description

#

Opening tag for special function

{{#each objs}}

For this example, it means that system will loop for each item for

/

Ending tag for special function

{{/each}}

End of statement

STATEMENT

For statement, opening and ending tag are required for example {{#statement parameter}} as opening tag, don’t forget to put {{/statement}} to complete the statement without parameter name

Symbol

Meaning

Example

Description

each

Looping function

{{#each lines}}
{{/each}}

Used to access data of some fields with One to Many relation.

** Many to One relationship mostly presented in lines. For example INV lines, SO lines, PO lines and etc.

unless

Condition

{{#unless _is_last}}
{{/unless}}

Used as a statement to check whether the parameter mentioned is TRUE or FALSE. If it is FALSE, the system will do functions inside.

** The Functions inside can be other parameters or even a word processing function like page break.

FORMAT

Symbol

Meaning

Example

Description

currency

To format number as currency

{{currency total_amount}}

This parameter will format number from #### to #,###.00

For example, 2459.5 will be formatted to 2,459.50

fmt_date

To format date as configured in Organizational Settings

{{fmt_date date}}

This parameter will format date from YYYY-MM-DD (default format) to the one configured in Organizational Settings.

For example, 2015-03-11 will be formatted to 11/03/2015

barcode

To read text and change it to a barcode image

{{barcode code}}

System will read data from field “code” and then generate a barcode image.

FIELDS

We need to enter a field path regarding to the system and all basic fields provided can be seen in Basic Fields

BASIC FIELDS


SALES MODULE

Outside Lines

No

Field

Parameter

No

Field

Parameter

1

Date

{{date}}

9

Price List

{{price_list_id.name}}

2

Number

{{number}}

10

Shipping Terms

{{ship_term_id.name}}

3

Ref

{{ref}}

11

Related To

{{related_id.name}}

4

Valid Until

{{exp_date}}

12

Sub Total

{{amount_subtotal}}

5

Currency Code

{{currency_id.code}}

13

Tax Amount

{{amount_tax}}

6

Tax Type

{{tax_type}}

14

Total

{{amount_total}}

7

Owner

{{user_id.name}}

15

Payment Terms

{{payment_terms}}

8

Opportunity

{{opport_id.name}}

16

Other Information

{{other_info}}

Inside Lines

Using {{#each lines}} … {{/each}}

No

Field

Parameter

No

Field

Parameter

1

Product

{{product_id.name}}

6

Unit Price

{{unit_price}}

2

Description

{{description}}

7

Disc %

{{discount}}

3

Qty

{{qty}}

8

Disc Amt

{{discount_amount}}

4

UoM

{{uom_id.name}}

9

Tax Rate

{{tax_id.rate}}

5

Product Image

{{product_id.image}}

10

Amount

{{amount}}

Outside Lines

No

Field

Parameter

No

Field

Parameter

1

Date

{{date}}

7

Price List

{{price_list_id.name}}

2

Number

{{number}}

8

Quotation

{{quot_id.number}}

3

Ref

{{ref}}

9

Production Team

{{team_id.name}}

4

Due Date

{{due_date}}

10

Shipping Method

{{ship_method_id.name}}

5

Currency

{{currency_id.code}}

11

Shipping Terms

{{ship_term_id.name}}

6

Tax Type

{{tax_type}}

Inside Lines

Using {{#each lines}} … {{/each}}

No

Field

Parameter

No

Field

Parameter

1

Product

{{product_id.name}}

8

Tax Rate

{{tax_id.rate}}

2

Description

{{description}}

9

Amount

{{amount}}

3

Qty

{{qty}}

10

Location

{{location_id.name}}

4

UoM

{{uom_id.name}}

11

Qty (Stock UoM)

{{qty_stock}}

5

Unit Price

{{unit_price}}

12

Delivered Qty

{{qty_delivered}}

6

Disc %

{{discount}}

13

Disc Amt

{{discount_amount}}

7

Product Image

{{product_id.image}}

14

Qty In Stock

{{qty_avail}}

PURCHASING MODULE

Outside Lines

No

Field

Parameter

No

Field

Parameter

1

Employee First Name

{{employee_id.first_name}}

5

Employee Last Name

{{employee_id.last_name}}

2

Number

{{number}}

6

Date

{{date}}

3

Request By

{{request_by_id.name}}

7

Ref

{{ref}}

4

Approved By

{{approve_by_id.name}}

8

Other Info

{{other_info}}

Inside Lines

Using {{#each lines}} … {{/each}}

No

Field

Parameter

No

Field

Parameter

1

Product

{{product_id.name}}

5

UoM

{{uom_id.name}}

2

Description

{{description}}

6

Location

{{location_id.name}}

3

Qty

{{qty}}

7

Product Image

{{product_id.image}}

4

Purchase Order

{{purchase_order_id.number}}

Outside Lines

No

Field

Parameter

No

Field

Parameter

1

Date

{{date}}

9

Shipping Method

{{ship_method_id.name}}

2

Number

{{number}}

10

Shipping Terms

{{ship_term_id.name}}

3

Ref

{{ref}}

11

Subtotal

{{amount_subtotal}}

4

Delivery Date

{{delivery_date}}

12

Tax Amount

{{amount_tax}}

5

Currency

{{currency_id.code}}

13

Total

{{amount_total}}

6

Tax Type

{{tax_type}}

14

Payment Terms

{{payment_terms}}

7

Price List

{{price_list_id.name}}

15

Other Info

{{other_info}}

8

Purchase Type

{{purchase_type_id.name}}

Inside Lines

Using {{#each lines}} … {{/each}}

No

Field

Parameter

No

Field

Parameter

1

Product

{{product_id.name}}

8

Amount

{{amount}}

2

Description

{{description}}

9

Location

{location_id.name}}

3

Qty

{{qty}}

10

Received Qty

{{qty_received}}

4

UoM

{{uom_id.name}}

11

Sales Order

{{sale_id.number}}

5

Unit Price

{{unit_price}}

12

Other Costs

{{amount_other}}

6

Tax Rate

{{tax_id.rate}}

13

Product Image

{{product_id.image}}

7

Disc %

{{discount_percent}}

14

Disc Amt

{{discount_amount}}

ACCOUNTING MODULE

Outside Lines

No

Field

Parameter

No

Field

Parameter

1

Date

{{date}}

5

Currency

{{currency_id.code}}

2

Due Date

{{due_date}}

6

Tax Type

{{tax_type}}

3

Number

{{number}}

7

Tax No.

{{tax_no}}

4

Ref

{{ref}}

8

Related To

{{related_id.number}}

Inside Lines

Using {{#each lines}} … {{/each}}

No

Field

Parameter

No

Field

Parameter

1

Product

{{product_id.name}}

7

Account

{{account_id.name}}

2

Description

{{description}}

8

Tax Rate

{{tax_id.rate}}

3

Qty

{{qty}}

9

Track-1

{{track_id.name}}

4

UoM

{{uom_id.name}}

10

Track-2

{{track2_id.name}}

5

Unit Price

{{unit_price}}

11

Amount

{{amount}}

6

Disc %

{{discount}}

12

Disc Amt

{{discount_amount}}

Outside Lines

No

Field

Parameter

No

Field

Parameter

1

Contact

{{contact_id.name}}

9

Tax No

{{tax_no}}

2

Type

{{type}}

10

Related To

{{related_id.number}}

3

Subtype

{{pay_type}}

11

Subtotal

{{amount_subtotal}}

4

Date

{{date}}

12

Tax Amount

{{amount_tax}}

5

Number

{{number}}

13

Total

{{amount_total}}

6

Account

{{account_id.name}}

14

Withholding Tax

{{amount_wht}}

7

Currency

{{currency_id.code}}

15

Net Amount

{{amount_payment}}

8

Tax Type

{{tax_type}}

16

Memo

{{memo}}

Inside Lines

Using {{#each lines}} … {{/each}}

No

Field

Parameter

No

Field

Parameter

1

Description

{{description}}

7

Tax Rate

{{tax_id.rate}}

2

Qty

{{qty}}

8

Track-1

{{track_id.name}}

3

Unit Price

{{unit_price}}

9

Track-2

{{track2_id.name}}

4

Account

{{account_id.name}}

10

Amount

{{amount}}

Outside Lines

No

Field

Parameter

No

Field

Parameter

1

Contact

{{contact_id.name}}

5

Number

{{number}}

2

Type

{{type}}

6

Account

{{account_id.name}}

3

Subtype

{{pay_type}}

7

Currency

{{currency_id.code}}

4

Date

{{date}}

8

Memo

{{memo}}

Inside Lines for Invoice Payment Tab

Using {{#each invoice_lines}} … {{/each}}

No

Field

Parameter

No

Field

Parameter

1

Invoice

{{invoice_id.number}}

3

Tax No.

{{tax_no}}

2

Amount

{{amount}}

Inside Lines for Adjustments Tab

Using {{#each adjust_lines}} … {{/each}}

No

Field

Parameter

No

Field

Parameter

1

Account

{{account_id.name}}

4

Track-1

{{track_id.name}}

2

Tax Comp.

{{tax_comp_id.rate}}

5

Track-2

{{track2_id.name}}

3

Tax Base

{{tax_base}}

6

Amount

{{amount}}

JOURNAL ENTRY

Outside Lines

No

Field

Parameter

No

Field

Parameter

1

Journal

{{journal_id.name}}

5

Related To

{{related_id.number}}

2

Number

{{number}}

6

Narration

{{narration}}

3

Date

{{date}}

7

Total Debit

{{total_debit}}

4

Reference

{{ref}}

8

Total Credit

{{total_credit}}

Inside Lines

Using {{#each lines}} … {{/each}}

No

Field

Parameter

No

Field

Parameter

1

Description

{{description}}

7

Tax Base

{{tax_base}}

2

Account

{{acount_id.name}}

8

Tax No.

{{tax_no}}

3

Debit

{{debit}}

9

Tax Date

{{tax_date}}

4

Credit

{{credit}}

10

Track-1

{{track_id.name}}

5

Contact

{{contact_id.name}}

11

Track-2

{{track2_id.name}}

6

Tax Comp.

{{tax_comp_id.rate}}

12

Currency Amt

{{amount_cur}}

INVENTORY MODULE

Outside Lines

No

Field

Parameter

No

Field

Parameter

1

Journal

{{journal_id.name}}

6

Currency

{{currency_id.code}}

2

Number

{{number}}

7

Container

{{container_id.number}}

3

Date

{{date}}

8

Ref

{{ref}}

4

Contact

{{contact_id.name}}

9

Related To

{{related_id.number}}

5

Form Barcode

{{barcode number}}

10

Shipping Method

{{ship_method_id.name}}

Inside Lines

Using {{#each lines}} … {{/each}}

No

Field

Parameter

No

Field

Parameter

1

Product

{{product_id.name}}

8

Qty2

{{qty2}}

2

Qty

{{qty}}

9

Lot / Serial No.

{{lot_id.number}}

3

UoM

{{uom_id.name}}

10

To Container

{{container_to_id.number}}

4

From Location

{{location_from_id.name}}

11

Packaging

{{packaging_id.name}}

5

To Location

{{location_to_id.name}}

12

# Packages

{{num_packages}}

6

Unit Price

{{unit_price}}

13

Related To

{{related_id.number}}

7

Product Image

{{product_id.image}}

14

Product Barcode

{{barcode product_id.code}}

How To Create Report ODT

Start making a report template


Adding basic tag

User need to identify a vital tags on the page which is {{#each objs}} … {{/each}} this is a basic tag every document needs to be entered

Adding Company parameters (Special Parameter)

Inside each objs, we can start writing parameters. In this example, we will show you how to make a report template for Quotation. For other templates, the concept is the same.

We will add company information using these following parameters. The reason why these are considered as special parameters is because they are not present in the transaction page, they are actually enter in a settings page so that we cannot call them directly as other parameters which will be describe later in STEP 4

COMPANY PARAMETERS

These special parameters can be used with all report templates

Parameter

Description

{{../company.name}}

Company Name

{{../settings.default_address_id.address}}

Company Address

{{../settings.default_address_id.city}}

City

{{../settings.default_address_id.postal_code}}

Postal Code

{{../settings.default_address_id.country_id.name}}

Country

{{../settings.phone}}

Phone Number

{{../settings.fax}}

Fax Number

{{../settings.tax_no}}

Tax Number

In this sample we use a table to make a layout more precise and we put those company parameters inside it.

NOTE : you can also put static texts inside a template by entering words without  {{blankets}}. System will skip those words while parsing.

Adding image used as a logo frame

Unlike the static image which can be placed directly in a template without any configuration, the company logo can be parsed also but need to add one parameter to the image inserted.

First of all, you just need to insert any image used as a frame for the logo parsed from Netforce system

Then, right click on that image and go to Description

And enter this parameter {{../settings.logo}} into a title field. This parameter will be then replaced by the actual logo path from the system.

NOTE: This steps can be used with other images also, just replace {{../settings.logo}} by image path parameter as seen in Basic Fields

 

Then click “OK” and the printed result will be as follows. You can see all the parameters entered earlier are replaced by data retrieved from the system.

Adding other parameters outside line items

For the field path you can see in Basic Fields. We will start by adding some data for customers as shown in an image below.

If the address uses the coding: {{contact_id.default_address_id.address}}, The system will take the field Address in the contact to report.

If you want to show city, district, province, country to the template, can use this coding below.

The system will take the field city, district, province, country in the contact to report.

You can even add some static objects like signature images into the template.

Adding other parameters inside line items

As we mentioned before. For line items, we need a looping statement
{{#each lines}} … {{/each}}. so that system can repeat items in this loop. The amount of times the system will repeat depends on the number of line items in that transaction. The result is shown below.

IMPORTANT : for adding lines parameters, the system requires at least 3 rows.
1. One blank row containing
{{#each lines}} in the first column
2. Another row containing parameters later replaced by data in the system
3. Last blank row containing
{{/each}} in the first column

Parameter in a second row can also be found on Basic Fields

NOTE:  If you want to insert image product in report template