texlive[56190] Master/texmf-dist: qrbill (26aug20)

commits+karl at tug.org commits+karl at tug.org
Wed Aug 26 23:11:59 CEST 2020


Revision: 56190
          http://tug.org/svn/texlive?view=revision&revision=56190
Author:   karl
Date:     2020-08-26 23:11:59 +0200 (Wed, 26 Aug 2020)
Log Message:
-----------
qrbill (26aug20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/qrbill/README.md
    trunk/Master/texmf-dist/doc/latex/qrbill/qrbill.pdf
    trunk/Master/texmf-dist/source/latex/qrbill/qrbill.dtx
    trunk/Master/texmf-dist/source/latex/qrbill/qrbill.ins
    trunk/Master/texmf-dist/tex/latex/qrbill/qrbill.sty

Modified: trunk/Master/texmf-dist/doc/latex/qrbill/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/qrbill/README.md	2020-08-26 21:11:42 UTC (rev 56189)
+++ trunk/Master/texmf-dist/doc/latex/qrbill/README.md	2020-08-26 21:11:59 UTC (rev 56190)
@@ -4,7 +4,7 @@
 
 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 @@
 ## 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

Modified: trunk/Master/texmf-dist/doc/latex/qrbill/qrbill.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/qrbill/qrbill.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/qrbill/qrbill.dtx	2020-08-26 21:11:42 UTC (rev 56189)
+++ trunk/Master/texmf-dist/source/latex/qrbill/qrbill.dtx	2020-08-26 21:11:59 UTC (rev 56190)
@@ -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 at peitex.de}{<marei at 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,8 +320,14 @@
 %   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}
 % The Swiss payment standards for QR-bills require the following data for the address of creditor (Prefix \code{CR-})  and debtor (Prefix \code{UD-}):
@@ -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,7 +625,8 @@
         \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
           }
@@ -592,7 +633,8 @@
           \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}

Modified: trunk/Master/texmf-dist/source/latex/qrbill/qrbill.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/qrbill/qrbill.ins	2020-08-26 21:11:42 UTC (rev 56189)
+++ trunk/Master/texmf-dist/source/latex/qrbill/qrbill.ins	2020-08-26 21:11:59 UTC (rev 56190)
@@ -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
 

Modified: trunk/Master/texmf-dist/tex/latex/qrbill/qrbill.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/qrbill/qrbill.sty	2020-08-26 21:11:42 UTC (rev 56189)
+++ trunk/Master/texmf-dist/tex/latex/qrbill/qrbill.sty	2020-08-26 21:11:59 UTC (rev 56190)
@@ -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,7 +236,8 @@
         \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
           }
@@ -235,7 +244,8 @@
           \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}



More information about the tex-live-commits mailing list.