%%
%% This is file `swiss.qrbill-cfg.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% qrbill.dtx  (with options: `swiss.qrbill-cfg.tex')
%% 
%% Copyright (C) 2020–2023 by Marei Peischl (peiTeX) <marei@peitex.de>
%% 
%% This work is a collaboration of
%%   Marei Peischl (peiTeX) and Alex Antener (foobar LLC).
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% 
%% The Current Maintainer of this work is
%%   Marei Peischl <qrbill@peitex.de>.
%% 
%% This work consists of the files
%% qrbill.dtx and qrbill.ins, qrbill-vocab.csv
%% and the derived files
%% qrbill.sty, swiss.qrbill-cfg.tex, epc.qrbill-cfg.tex,
%% qrbill-letter-demo.tex, qrbill-standalone-demo.tex,
%% and qrbill-epc-demo.tex.
%% 
%% The development repository can be found at
%% https://github.com/peitex/qrbill
%% Please use the issue tracker for feedback!
%% 
\qrbillsetup{
creditorprefix=CR-,
debtorprefix=UD-,
ignore-if-empty={
AV1-Parameters,
AV2-Parameters,
BillingInfo
}
}

\SetQrScheme{
  QRType,
  Version,
  CodingType,
  Account,
  CR-AddressType,
  CR-Name,
  CR-Address1,
  CR-Address2,
  CR-PostalCode,
  CR-City,
  CR-Country,
  UCR-AddressType,
  UCR-Name,
  UCR-Address1,
  UCR-Address2,
  UCR-ZIP,
  UCR-City,
  UCR-Country,
  Amount,
  Currency,
  UD-AddressType,
  UD-Name,
  UD-Address1,
  UD-Address2,
  UD-PostalCode,
  UD-City,
  UD-Country,
  ReferenceType,
  Reference,
  Message,
  Trailer,
  BillingInfo,
  AV1-Parameters,
  AV2-Parameters
}

\SetStaticData{prefix,11,31}

\SetBillingInfoScheme{
  prefix=//S1,
  10=invoicenum,
  11=invoicedate,
  20=customerref,
  30=vat,
  31=vatdate,
  32=vatdetails,
  33=importvat,
  40=conditions
}

\ExplSyntaxOn
\cs_set:Nn \qrbill_parse_date:nnn {
\str_range:nnn {#1} {3} {4}
\int_compare:nNnT {#2} < {10} {0}#2
\int_compare:nNnT {#3} < {10} {0}#3
}
\ExplSyntaxOff

\SetupQrBill{
QRType=SPC,
Version=0200,
CodingType=1,
Trailer=EPD,
Currency=CHF,
ReferenceType=NON,
}

\qrbillsetdata*{
invoicedate=\QRbillParseDate{\the\year}{\the\month}{\the\day},
vatdate=\QRbillParseDate{\the\year}{\the\month}{\the\day}
}
\endinput
%%
%% End of file `swiss.qrbill-cfg.tex'.
