Created
January 18, 2020 17:34
-
-
Save jeancaffou/6cb0eb020a26e7c192e710e23dd490ca to your computer and use it in GitHub Desktop.
UPN QR Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fields = [ | |
| 'UPNQR', // 1. Vodilni slog 5 Konstanta »UPNQR«. | |
| '', // 2. IBAN plačnika Prazno. | |
| '', // 3. Polog Prazno. | |
| '', // 4. Dvig Prazno. | |
| '', // 5. Referenca plačnika Prazno. | |
| (this.user.name || '').trim(), // 6. Ime plačnika Obvezno (*). Brez vodilnih ali sledečih presledkov. Max 33 znakov | |
| (this.user.naslov || '').trim(), // 7. Ulica in št. plačnika 33 Obvezno (*). Brez vodilnih ali sledečih presledkov. | |
| `${this.user.posta} ${this.user.mesto}`.trim(), // 8. Kraj plačnika 33 Obvezno (*). Brez vodilnih ali sledečih presledkov. | |
| String(this.payment.amount * 100).padStart(11, '0'), // 9. Znesek 11 Obvezno (**). Enajst cifer. | |
| '', // 10. Datum plačila Prazno. | |
| '', // 11. Nujno Prazno. | |
| 'GDSV', // 12. Koda namena 4 Obvezno. Štiri velike črke (A-Z). | |
| (this.payment.reason || '').trim(), // 13. Namen plačila 42 Obvezno. Brez vodilnih ali sledečih presledkov. | |
| '', // 14. Rok plačila 10 Poljubno. Format »DD.MM.LLLL« ali prazno. | |
| 'SI56600000000799448', // 15. IBAN prejemnika 34 Obvezno. Brez formatiranja (brez vmesnih presledkov). | |
| 'SI99', // 16. Referenca prejemnika 26 Obvezno. (4+22) Model in sklic skupaj brez presledkov. | |
| 'LEP OBLAK D.O.O.', // 17. Ime prejemnika 33 Obvezno. Brez vodilnih ali sledečih presledkov. | |
| 'LOG 79', // 18. Ulica in št. prejemnika 33 Obvezno. Brez vodilnih ali sledečih presledkov. | |
| '4228 ŽELEZNIKI' // 19. Kraj prejemnika 33 Obvezno. Brez vodilnih ali sledečih presledkov. | |
| ] | |
| // 20. Kontrolna vsota 3 Obvezno. Tri cifre. | |
| fields.push(String(19 + fields.reduce((a, v) => a + v.length, 0)).padStart(3, '0'), '') | |
| return fields.join('\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment