GithubHelp home page GithubHelp logo

heribertosgp / hulk-uplatnica Goto Github PK

View Code? Open in Web Editor NEW

This project forked from linuxhr/hulk-uplatnica

1.0 1.0 0.0 390 KB

Generates Croatian payment slips in vector format with Postscript and Python.

Shell 16.14% Python 83.86%

hulk-uplatnica's Introduction

Uplatnica

Uplatnica generates Croatian payment slips in vector form.

Written in Python (Jinja2) and Postscript, it uses Ghostscript to make a PDF file with the required fields and PDF417 2D barcode necessary for automated or mobile app based payments.

image

Dependencies

  • Jinja2
  • Ghostscript

Usage

kreiraj_uplatnicu(json_fields)

json_fields should be a string containing the following JSON key-value pairs:

Fields:

  • poziv_na_broj_platitelja (<= 22 chars)
  • iznos (<= 15)
  • poziv_na_broj_primatelja (<= 22)
  • iban_primatelja (21)
  • iban_platitelja (21)
  • model_primatelja (<= 4)
  • sifra_namjene (<= 4)
  • datum_izvrsenja (8)
  • valuta_placanja (3)
  • hitno (1)
  • ime_i_prezime_platitelja (<= 30)
  • ulica_i_broj_platitelja (<= 25)
  • postanski_i_grad_platitelja (<= 27)
  • naziv_primatelja (<= 25)
  • ulica_i_broj_primatelja (<= 25)
  • postanski_i_grad_primatelja (<= 27)
  • opis_placanja (<= 35)

Make sure not to exceed the lengths in order to generate a valid 2D barcode.

Data example and usage

testni_podaci = """
                 {"poziv_na_broj_platitelja": "54321-121-1",
                 "poziv_na_broj_primatelja": "12345-212-2",
                 "iznos": "12345",
                 "iban_primatelja": "HR9223600001501426697",
                 "iban_platitelja": "HR6025000091000000013",
                 "model_primatelja": "HR01",
                 "model_platitelja": "HR05",
                 "sifra_namjene": "OTLC",
                 "datum_izvrsenja": "10022016",
                 "valuta_placanja": "HRK",
                 "hitno": "X",
                 "ime_i_prezime_platitelja": "Pero Perić",
                 "ulica_i_broj_platitelja": "Ilica 1",
                 "postanski_i_grad_platitelja": "10000 Zagreb",
                 "naziv_primatelja": "Sklonište za nezbrinute životinje",
                 "ulica_i_broj_primatelja": "Franjčevićeva 43",
                 "postanski_i_grad_primatelja": "10361 Dumovec",
                 "opis_placanja": "Novčani prilog za pomoć nezbrinutim životinjama."}
                """

uplatnica = kreiraj_uplatnicu(testni_podaci)

'uplatnica' now contains the PDF document and you can either save it to disk or provide it through a web server.

License

This mini-project is released under the LGPL v3 license. Feel free to use it in your product!

Credits

  • PDF 417 part uses parts of Terry Burton's excellent barcode writer in Postscript.
  • Fonts are derived from t1-cyrillic Debian package.
  • The payment slip form was adapted from the specification issued by Croatian Banking Association.

hulk-uplatnica's People

Contributors

hrvach avatar hbogner avatar billythesleeper avatar

Stargazers

Heriberto Sierra avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.