peiTeX / qrbill

LaTeX package to create qrbills based on the Swiss standard
13 stars 3 forks source link

use \today for invoicedate + add date parsing mechanisms #8

Closed scfrank-pri closed 2 years ago

scfrank-pri commented 3 years ago

It would be handy if the data fields

invoicedate=,%200701,%yymmdd
vatdate=,%200701,%yymmdd

could get assigned the value of \today. The required format yymmdd could come from

\usepackage[american]{babel}
\usepackage[yyyymmdd]{datetime}
\renewcommand{\dateseparator}{}

This gives yyyymmdd, but I could not figure out how to reduce it to yymmdd - and the value assignment did not work anyway. It works perfectly for

debtor*={\Firstname { } \Name \\
      \Street \\ \Nr \\
      \PLZ \\ \City\\
      \Country
      },

This is just a suggestion, I am already quite happy with the package.

TeXhackse commented 3 years ago

Thanks for your suggestions. I already provide this functionality with a customer specific invoice template. We wanted to keep qrbill as small as possible, but probably you're right, users should be able to choose the date format to be used for the input.

Internally I won't use extra packages for this, but taking your example one can easily add the desired variant:

%based on the definition of \ddmmyydate in datetime.dtx Copyright 2015 Nicola Talbot
\makekatletter
\renewcommand*{\formatdate}[3]{%
\@day=##1\relax\@month=##2\relax\@year=##3\relax
\@dtctr=\@year%
\@FCmodulo{\@dtctr}{100}%
\twodigit\@dtctr\twodigit\@month\twodigit\@day}
\makeatother
TeXhackse commented 2 years ago

Took a while until I found some free time.

This is resolved and added to the beta. To not depend on packages or depend on a specific language setup I Implemented it differently and allow to set the date scheme within the qrscheme file.

I will do some more testing today and finally prepare a release planned for tomorrow.