diff options
author | Karl Berry <karl@freefriends.org> | 2020-08-26 21:11:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-08-26 21:11:59 +0000 |
commit | 2f8ba2684ef82c68c8c56bdcc9ffdd4d079417b0 (patch) | |
tree | c54939270fffdad50efeeb3948b3b905c089b2ca | |
parent | 7b5487090fb9724487b2821fa71e4f5f330e7d66 (diff) |
qrbill (26aug20)
git-svn-id: svn://tug.org/texlive/trunk@56190 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/qrbill/README.md | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/qrbill/qrbill.pdf | bin | 72627 -> 75048 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/qrbill/qrbill.dtx | 97 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/qrbill/qrbill.ins | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/qrbill/qrbill.sty | 55 |
5 files changed, 141 insertions, 23 deletions
diff --git a/Master/texmf-dist/doc/latex/qrbill/README.md b/Master/texmf-dist/doc/latex/qrbill/README.md index 14ca52239f2..6d82af8ebf1 100644 --- a/Master/texmf-dist/doc/latex/qrbill/README.md +++ b/Master/texmf-dist/doc/latex/qrbill/README.md @@ -4,7 +4,7 @@ Copyright (C) Marei Peischl (peiTeX) <marei@peitex.de>, 2020 This work is part of a collaborative project of Marei Peischl (peiTeX) and Alex Antener (foobar LLC). -qrbill 2020/06/29 v1.01 +qrbill 2020/08/25 v1.02 *************************************************************************** @@ -41,4 +41,8 @@ To simplify this, you can have a look at the qrbill.tds.zip, which provides an a ## Version History * v1.00 (2020-06-28) First official version - * v1.01 (2020-06-29) Add tds package and the separate option
\ No newline at end of file + * v1.01 (2020-06-29) Add tds package and the separate option + * v1.02 (2020-08-25) + - Fix placement issue with separate option + - add sep-iban/sep-reference mechanism + - not on version number inconsistency
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/qrbill/qrbill.pdf b/Master/texmf-dist/doc/latex/qrbill/qrbill.pdf Binary files differindex aedbe44c7f0..7aad2960564 100644 --- a/Master/texmf-dist/doc/latex/qrbill/qrbill.pdf +++ b/Master/texmf-dist/doc/latex/qrbill/qrbill.pdf diff --git a/Master/texmf-dist/source/latex/qrbill/qrbill.dtx b/Master/texmf-dist/source/latex/qrbill/qrbill.dtx index 9005496f3dc..09e705814da 100644 --- a/Master/texmf-dist/source/latex/qrbill/qrbill.dtx +++ b/Master/texmf-dist/source/latex/qrbill/qrbill.dtx @@ -54,7 +54,7 @@ % \fi % \iffalse %<*driver> -\ProvidesFile{qrbill.dtx}[2020/06/29 v1.01 \ create QR-bills based on the Swiss standard] +\ProvidesFile{qrbill.dtx}[2020/08/25 v1.02 \ create QR-bills based on the Swiss standard] \documentclass[english, parskip=half-]{scrartcl} \usepackage{iftex} \ifPDFTeX @@ -170,12 +170,12 @@ %</driver> %\fi % -% \changes{v1.0}{2020/06/28}{First official version} +% \changes{v1.00}{2020/06/28}{First official version} % % \GetFileInfo{qrbill.dtx} % % \DoNotIndex{\newcommand,\newenvironment} -% \title{qrbill} +% \title{qrbill v1.02} % \subtitle{\LaTeX-package to create QR-bills based on the Swiss payments standards} % \author{Marei Peischl \href{mailto:marei@peitex.de}{<marei@peitex.de>}} % \publishers{A collaborative project of pei\TeX{} and foobar LLC} @@ -262,6 +262,11 @@ % \item[frame (true/false/top/bottom) (true)] % Switch to disable the frame around the created QRbill. The top/bottom options should be prefered when the bill is embedded into a document of a4 papersize. % +% \changes{v1.02}{2020/08/25}{add ibanseparator option} +% \item[ibanseparator (tokenlist) (\textbackslash,)] +% Set the tokenlist to separate the account numbers. See option \code{sep-iban} for +% further information. +% % \item[icon (swiss-cross/filename) (<empty>)] % The swiss standard describes the placement of a swiss-cross icon in the center of the QRcode. This can be achieved using this option. The default is set empty, so no icon will be placed. If this option holds another string than \enquote{swiss-cross} it will be interpreted as filename and try to load a custom image. % @@ -269,9 +274,30 @@ % This option allows custom scaling for custom icons. % \item[qrscheme (Name of a custom QRbill scheme) (swiss)] -% Loads the definitions for the QRcode and the BillingInformation. Currently only the swiss qrbill scheme is available, but one can define own variants based on this file. Users can copy the file swiss.qrbill-cfg.tex as an example. +% Loads the definitions for the QRcode and the BillingInformation. Currently only the +% swiss qrbill scheme is available, but one can define own variants based on this file. +% Users can copy the file swiss.qrbill-cfg.tex as an example. +% +% \changes{v1.02}{2020/08/25}{add referenceseparator option} +% \item[referenceseparator (tokenlist) (\textbackslash,)] +% Set the tokenlist to separate the reference codes. See option \code{sep-reference} for +% further information. +% +% \changes{v1.02}{2020/08/25}{add sep-iban/sep-reference option} +% \item[sep-iban\\sep-reference (integer) (0)] +% Set the size of character groups to separate these. Positive values will be counted left to right. Negative ones the other way round. +% The most variants of the Swiss QRbill use values of \code{sep-iban=4} and \code{sep-reference=-5} e.\,g.: +% +% \ExplSyntaxOn +% \begingroup +% \keys_set:nn {qrbill} {sep-iban=4,sep-reference=-5} +% Iban:~\__qrbill_sep_tl:nn {iban} {CH1280808005649899718}\\ +% Reference:~\__qrbill_sep_tl:nn {reference} {000000000000000000000000152} +% \endgroup +% \ExplSyntaxOff % % \changes{v1.01}{2020/06/29}{Add separate option to modify the top rule of the QR bill} +% \changes{v1.02}{2020/08/25}{Fix placement issue with separate option} % \item[separate (false/text/symbol) (text)] % Setup the separation rule between the document and the qrbill. If the value is text or symbol the Info \enquote{\qrbillseparatename} or the corresponding translation will be printed on top of the frame. This option will be ignored it the frame has no top rule. % \end{optionlist} @@ -294,7 +320,13 @@ % Trailer=EPD, % } % \end{doccode} -% These fields are currently required to use these values. If any future changes on the standard would require changes, they can be overwritten or redefined by using a custom implementation file, similar to swiss.qrbill-cfg.tex. +% These fields are required to use these values for Version 2.1 of the QRbill standard. If any future changes on the standard would require changes, they can be overwritten or redefined by using a custom implementation file, similar to swiss.qrbill-cfg.tex. +% +% \changes{v1.02}{2020/08/25}{Note the version number inconsistency in the official guidelines} +% Be aware that we use the versioncode \code{0210}, as this is the current, implemented standard from the official guidelines, which replaced version 2.0 in 09/2019. +% As the mentioned example in v2.1 of the official guidelines use an outdated version code (e.g. \code{0200}), some banking apps may refuse the processing of the QR code. Hence, this is not a bug of the qrbill package, but of these apps. +% Feel free to change the version back to \code{0200} to override and support the replaced standard. +% The corresponding issue and discussion can be found at \url{https://github.com/peiTeX/qrbill/issues/3}. % % Additionally the Currency has been initialized to use \enquote{CHF}. This also can be overwritten. Currently the Swiss standards only allow the values \code{CHF} or \code{EUR}. % \subsection{Address data} @@ -394,7 +426,7 @@ % \section{Implementation} % \begin{macrocode} \RequirePackage{expl3} -\ProvidesExplPackage{qrbill}{2020/06/29}{1.01}{ +\ProvidesExplPackage{qrbill}{2020/08/25}{1.02}{ Template for QR-bills based on the Swiss Payment Standards } \RequirePackage{iftex} @@ -480,7 +512,7 @@ separate / text .code:n = { \bool_gset_true:N \g__qrbill_separateinfo_bool \cs_set:Nn \qrbill_print_separate_info: { - \centerline{\footnotesize\qrbillseparatename} + \centerline{\raisebox{\dimexpr\depth+.3ex\relax}[0pt][0pt]{\footnotesize\qrbillseparatename}} \par\nointerlineskip \rule{\c_qrbill_width_dim}{\g__qrbill_rule_dim} } @@ -488,6 +520,14 @@ , separate / false .code:n = {\bool_gset_false:N \g__qrbill_separateinfo_bool}, separate .initial:n = text, + sep-iban .int_gset:N = \g__qrbill_ibansep_int, + sep-iban .initial:n = 0, + ibanseperator .tl_gset:N = \g__qrbill_ibansep_tl, + ibanseperator .initial:n = {\,}, + sep-reference .int_gset:N = \g__qrbill_referencesep_int, + sep-reference .initial:n = 0, + referenceseperator .tl_gset:N = \g__qrbill_referencesep_tl, + referenceseperator .initial:n = {\,} } \ProcessKeysOptions{qrbill} @@ -585,14 +625,16 @@ \vbox_to_ht:nn {56mm}{ {\qrbill_headingR_font:\qrbillaccountname\par} { - \qrbill_valueR_font:\tl_use:c {l_qrbill_data_Account_tl}\par + \qrbill_valueR_font: + \__qrbill_sep_tl:nV {iban} \l_qrbill_data_Account_tl\par \qrbill_insert_address:N \g__qrbill_creditorprefix_tl \par\vskip\baselineskip } \tl_if_empty:NF \l_qrbill_data_Reference_tl { {\qrbill_headingR_font:\qrbillreferencename\par} { - \qrbill_valueR_font:\tl_use:c {l_qrbill_data_Reference_tl} + \qrbill_valueR_font: + \__qrbill_sep_tl:nV {reference} \l_qrbill_data_Reference_tl \par\vskip\baselineskip } } @@ -635,7 +677,7 @@ \skip_horizontal:n {2\c_qrbill_sep_dim} \begin{minipage}[c][95mm][t]{138mm} \begin{minipage}[c][85mm][t]{51mm} - {\qrbill_title_font:\qrbillpaymentpartname} + \parbox[t][7mm][t]{\linewidth}{\qrbill_title_font:\qrbillpaymentpartname} \par\nointerlineskip \skip_vertical:n {\c_qrbill_sep_dim} \qrcode_setup_QRcode: @@ -671,13 +713,15 @@ \par\nointerlineskip {\qrbill_headingP_font:\qrbillaccountname\par} { - \qrbill_valueP_font:\tl_use:c {l_qrbill_data_Account_tl}\par + \qrbill_valueP_font: + \__qrbill_sep_tl:nV {iban} \l_qrbill_data_Account_tl \par \qrbill_insert_address:N \g__qrbill_creditorprefix_tl \par\vskip\baselineskip } \tl_if_empty:NF \l_qrbill_data_Reference_tl { {\qrbill_headingP_font:\qrbillreferencename\par} - {\qrbill_valueP_font:\tl_use:c {l_qrbill_data_Reference_tl} + {\qrbill_valueP_font: + \__qrbill_sep_tl:nV {reference} \l_qrbill_data_Reference_tl \par\vskip\baselineskip} } \exp_args:Nf \tl_if_empty:nF { @@ -812,6 +856,35 @@ } } +\cs_new:Nn \__qrbill_sep_tl:nn { + \int_compare:nTF {\int_use:c {g__qrbill_#1sep_int} = 0} { + #2 + }{ + \str_set:Nn \l_tmpa_str {#2} + \int_compare:nT {\int_use:c {g__qrbill_#1sep_int} < 0} { + \tl_reverse:N \l_tmpa_str + } + \int_set:Nn \l_tmpb_int {\int_abs:n {\int_use:c {g__qrbill_#1sep_int}}} + \int_set:Nn \l_tmpa_int {1} + \tl_clear:N \l_tmpa_tl + \int_while_do:nn {\l_tmpa_int < \str_count:N \l_tmpa_str} { + \tl_put_right:Nx \l_tmpa_tl { + \str_range:Nnn \l_tmpa_str {\l_tmpa_int} {\l_tmpa_int + \l_tmpb_int-1} + } + \int_add:Nn \l_tmpa_int {\l_tmpb_int} + \tl_put_right:Nn \l_tmpa_tl {{\tl_use:c {g__qrbill_#1sep_tl}}} + } + \tl_put_right:Nx \l_tmpa_tl { + \str_range:Nnn \l_tmpa_str {\l_tmpa_int} {\str_count:N \l_tmpa_str} + } + \int_compare:nT {\int_use:c {g__qrbill_#1sep_int} < 0} { + \tl_reverse:N \l_tmpa_tl + } + \l_tmpa_tl + } +} +\cs_generate_variant:Nn \__qrbill_sep_tl:nn {nV} + \newcommand*{\insertdebtor}{\null\qrbill_insert_address:N \g__qrbill_debtorprefix_tl} \newcommand*{\insertcreditor}{\null\qrbill_insert_address:N \g__qrbill_creditorprefix_tl} \newcommand*{\insertcurrency}{\l_qrbill_data_Currency_tl} diff --git a/Master/texmf-dist/source/latex/qrbill/qrbill.ins b/Master/texmf-dist/source/latex/qrbill/qrbill.ins index 116adcb78c7..5af7e8fb785 100644 --- a/Master/texmf-dist/source/latex/qrbill/qrbill.ins +++ b/Master/texmf-dist/source/latex/qrbill/qrbill.ins @@ -1,7 +1,7 @@ \input l3docstrip -\def\filedate{2020/06/29} -\def\fileversion{1.01} +\def\filedate{2020/08/25} +\def\fileversion{1.02} \preamble diff --git a/Master/texmf-dist/tex/latex/qrbill/qrbill.sty b/Master/texmf-dist/tex/latex/qrbill/qrbill.sty index ff602b56172..ec784ae5bbe 100644 --- a/Master/texmf-dist/tex/latex/qrbill/qrbill.sty +++ b/Master/texmf-dist/tex/latex/qrbill/qrbill.sty @@ -38,7 +38,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \RequirePackage{expl3} -\ProvidesExplPackage{qrbill}{2020/06/28}{1.0}{ +\ProvidesExplPackage{qrbill}{2020/08/25}{1.02}{ Template for QR-bills based on the Swiss Payment Standards } \RequirePackage{iftex} @@ -124,7 +124,7 @@ separate / text .code:n = { \bool_gset_true:N \g__qrbill_separateinfo_bool \cs_set:Nn \qrbill_print_separate_info: { - \centerline{\footnotesize\qrbillseparatename} + \centerline{\raisebox{\dimexpr\depth+.3ex\relax}[0pt][0pt]{\footnotesize\qrbillseparatename}} \par\nointerlineskip \rule{\c_qrbill_width_dim}{\g__qrbill_rule_dim} } @@ -132,6 +132,14 @@ , separate / false .code:n = {\bool_gset_false:N \g__qrbill_separateinfo_bool}, separate .initial:n = text, + sep-iban .int_gset:N = \g__qrbill_ibansep_int, + sep-iban .initial:n = 0, + ibanseperator .tl_gset:N = \g__qrbill_ibansep_tl, + ibanseperator .initial:n = {\,}, + sep-reference .int_gset:N = \g__qrbill_referencesep_int, + sep-reference .initial:n = 0, + referenceseperator .tl_gset:N = \g__qrbill_referencesep_tl, + referenceseperator .initial:n = {\,} } \ProcessKeysOptions{qrbill} @@ -228,14 +236,16 @@ \vbox_to_ht:nn {56mm}{ {\qrbill_headingR_font:\qrbillaccountname\par} { - \qrbill_valueR_font:\tl_use:c {l_qrbill_data_Account_tl}\par + \qrbill_valueR_font: + \__qrbill_sep_tl:nV {iban} \l_qrbill_data_Account_tl\par \qrbill_insert_address:N \g__qrbill_creditorprefix_tl \par\vskip\baselineskip } \tl_if_empty:NF \l_qrbill_data_Reference_tl { {\qrbill_headingR_font:\qrbillreferencename\par} { - \qrbill_valueR_font:\tl_use:c {l_qrbill_data_Reference_tl} + \qrbill_valueR_font: + \__qrbill_sep_tl:nV {reference} \l_qrbill_data_Reference_tl \par\vskip\baselineskip } } @@ -278,7 +288,7 @@ \skip_horizontal:n {2\c_qrbill_sep_dim} \begin{minipage}[c][95mm][t]{138mm} \begin{minipage}[c][85mm][t]{51mm} - {\qrbill_title_font:\qrbillpaymentpartname} + \parbox[t][7mm][t]{\linewidth}{\qrbill_title_font:\qrbillpaymentpartname} \par\nointerlineskip \skip_vertical:n {\c_qrbill_sep_dim} \qrcode_setup_QRcode: @@ -314,13 +324,15 @@ \par\nointerlineskip {\qrbill_headingP_font:\qrbillaccountname\par} { - \qrbill_valueP_font:\tl_use:c {l_qrbill_data_Account_tl}\par + \qrbill_valueP_font: + \__qrbill_sep_tl:nV {iban} \l_qrbill_data_Account_tl \par \qrbill_insert_address:N \g__qrbill_creditorprefix_tl \par\vskip\baselineskip } \tl_if_empty:NF \l_qrbill_data_Reference_tl { {\qrbill_headingP_font:\qrbillreferencename\par} - {\qrbill_valueP_font:\tl_use:c {l_qrbill_data_Reference_tl} + {\qrbill_valueP_font: + \__qrbill_sep_tl:nV {reference} \l_qrbill_data_Reference_tl \par\vskip\baselineskip} } \exp_args:Nf \tl_if_empty:nF { @@ -455,6 +467,35 @@ } } +\cs_new:Nn \__qrbill_sep_tl:nn { +\int_compare:nTF {\int_use:c {g__qrbill_#1sep_int} = 0} { +#2 +}{ +\str_set:Nn \l_tmpa_str {#2} +\int_compare:nT {\int_use:c {g__qrbill_#1sep_int} < 0} { +\tl_reverse:N \l_tmpa_str +} +\int_set:Nn \l_tmpb_int {\int_abs:n {\int_use:c {g__qrbill_#1sep_int}}} +\int_set:Nn \l_tmpa_int {1} +\tl_clear:N \l_tmpa_tl +\int_while_do:nn {\l_tmpa_int < \str_count:N \l_tmpa_str} { +\tl_put_right:Nx \l_tmpa_tl { +\str_range:Nnn \l_tmpa_str {\l_tmpa_int} {\l_tmpa_int + \l_tmpb_int-1} +} +\int_add:Nn \l_tmpa_int {\l_tmpb_int} +\tl_put_right:Nn \l_tmpa_tl {{\tl_use:c {g__qrbill_#1sep_tl}}} +} +\tl_put_right:Nx \l_tmpa_tl { +\str_range:Nnn \l_tmpa_str {\l_tmpa_int} {\str_count:N \l_tmpa_str} +} +\int_compare:nT {\int_use:c {g__qrbill_#1sep_int} < 0} { +\tl_reverse:N \l_tmpa_tl +} +\l_tmpa_tl +} +} +\cs_generate_variant:Nn \__qrbill_sep_tl:nn {nV} + \newcommand*{\insertdebtor}{\null\qrbill_insert_address:N \g__qrbill_debtorprefix_tl} \newcommand*{\insertcreditor}{\null\qrbill_insert_address:N \g__qrbill_creditorprefix_tl} \newcommand*{\insertcurrency}{\l_qrbill_data_Currency_tl} |