# 

In this tutorial we will learn how to create a bank slip application in Scriptcase, the bar code used will be 2 out of 5 in the Febraban Collection pattern.  
  
(The file is available for download at the end).

FEBRABAN:[http://www.febraban.org.br](http://www.febraban.org.br/)

- HTML file with the billet layout.

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/01.png)

- Access the Scriptcase template option.

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/02.png)

1. Click on New Template;
2. Select the type as Free Format;
3. Upload the HTML file.

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/03.png)

- Set the orientation of the query to free format.

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/04.png)

- Select the free format template, in this case the billet.

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/05.png)

- Create the type 2 barcode field of 5.

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/06.png)

- Create a text field for a digitable line.

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/07.png)

- Now let's create the **M\_codigobarras** method for configuring the barcode.

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/08.png)

$ free - Variable that contains the 25 free positions of the bar code, in the example the free part does not have the 25 positions, but the macro is complete with 0 (Zeros).  
$ valor\_boleto - formatted to work to two decimal places (truncates the value).  
$ data - formatted in yyyymmdd, as it must be used in that format.  
After formatting the values, we will use the sc\_lin\_cod\_barra\_banco macro to generate the barcode.  
  
Parameters:

{codigobarras} - Type 2 barcode field of 5.  
'409' - Bank code (FEBRABAN).  
'9' - Currency Code (FEBRABAN).  
$ valor\_boleto - Document value.  
$ free - Free part (FEBRABAN).  
$ data - Expiration Date.

- In this step, we will associate the existing fields in the query with the variables defined in the free format (HTML file used).

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/09.png)

- Auxiliary application (Order inquiry), for generating the ticket according to the order.

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/10.png)

- Billet generated.

![](http://cdn1.netmake.com.br/img_kb/pt_br/exemplo_boleto_bancario/11.png)

We held a live showing the creation of the billet on 06/19/2015. The video with the recording of the seminar can be seen on this youtube link:

<https://youtu.be/0nASrp-VqlI>