Creating a contract template in ABillS

I will give an example of creating and adding a contract template in ABillS.

Install the necessary components (if the Ubuntu system):

sudo -i
apt-get install libpdf-api2-perl

Or so:

perl -e shell -MCPAN
install PDF::API2 
exit

Check if after entering the command nothing is displayed – it means the installation was successful:

perl -e 'use PDF::API2'

Add a new template in the “Settings” – “Other” – “Contract Types” menu, where we specify the name of the template and the file name without an extension, for example:
Name: TEST
Template: Docs_docs_test

After that, we’ll save the finished PDF document in /usr/abills/Abills/templates/Docs_docs_test.pdf and create an empty Docs_docs_test.tpl file in the same directory.

I used the finished Microsoft Word document and saved it in PDF format.

Now, in order to get the required fields from the database in the PDF document, create a file Docs_docs_test.dsc with coordinates, for example, I specified variables and coordinates:

CONTRACT_DATE:::(x=275;y=677)
CONTRACT_ID:::(x=275;y=637)
UID:::(x=275;y=622)
FIO:::(x=275;y=608)
PASPORT_NUM:::(x=275;y=593)
PASPORT_GRANT:::(x=275;y=578)
PASPORT_DATE:::(x=275;y=563)
PHONE:::(x=275;y=548)
EMAIL:::(x=275;y=533)
CITY:::(x=275;y=517)
ADDRESS_DISTRICT:::(x=275;y=517)
ADDRESS_FULL:::(x=275;y=506)

//DOCS_TPNAME_DV:::(x=275;y=497)
//DOCS_TPNAME_ABON_XX:::(x=275;y=497)
_CONNECTION_TYPE:::(x=275;y=451)
LOGIN:::(x=275;y=436)
PASSWORD:::(x=275;y=425)

File format .dsc:

VARIABLE:DESCRIBE:LANGUAGE:PARAMETЕRS:DEFAULT_VALUE:EXPRATION:

For the test on the client page we will add a new contract and click print.

By changing the numbers in the coordinates and looking at the document in ABillS, you can see how the variables move, so I put them in the right place.

Leave a comment

Leave a Reply