summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/invoice2
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-08-17 21:18:23 +0000
committerKarl Berry <karl@freefriends.org>2017-08-17 21:18:23 +0000
commita3711d6a9e039a268ecb9355e12056b434ee98e4 (patch)
treece54557f3663520b85ef41980072e85e1e329d44 /Master/texmf-dist/tex/latex/invoice2
parent8451414decba3809dad3d415ada2cdf286afb074 (diff)
invoice2 (17aug17)
git-svn-id: svn://tug.org/texlive/trunk@45060 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/invoice2')
-rw-r--r--Master/texmf-dist/tex/latex/invoice2/invoice2.sty37
1 files changed, 25 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/invoice2/invoice2.sty b/Master/texmf-dist/tex/latex/invoice2/invoice2.sty
index 91b4f5713e5..4972d781de5 100644
--- a/Master/texmf-dist/tex/latex/invoice2/invoice2.sty
+++ b/Master/texmf-dist/tex/latex/invoice2/invoice2.sty
@@ -29,8 +29,8 @@
\RequirePackage{translations}
\RequirePackage[table]{xcolor}
\RequirePackage{xparse}
-\ProvidesExplPackage{invoice2}{2017/07/15}{1.0}
- {Next-generation invoice typesetting with booktabs}
+\ProvidesExplPackage{invoice2}{2017/08/16}{1.1}
+ {Intelligent invoices with LaTeX3}
\LoadDictionaryFor{english}{invoice2}
\LoadDictionaryFor{german}{invoice2}
\DeclareTranslationFallback{invoice2-thousands-sep}{\,}
@@ -101,7 +101,7 @@
l
\bool_if:NT \l__invoicetwo_vat_nonzero_bool { c }
r
-\bool_if:NT \l__invoicetwo_amount_nonone_bool { r }
+\bool_if:nT { \l__invoicetwo_amount_nonone_bool || \l__invoicetwo_vat_nonzero_bool } { r }
}
}
\cs_new:Nn {\__invoicetwo_print_column_title:n}{
@@ -127,7 +127,7 @@ r
}
}
\cs_new:Nn {\__invoicetwo_print_unit_price_title:}{
- \bool_if:NT \l__invoicetwo_amount_nonone_bool {
+ \bool_if:nT { \l__invoicetwo_amount_nonone_bool || \l__invoicetwo_vat_nonzero_bool } {
\__invoicetwo_print_column_title:n {\GetTranslation{invoice2-unit-price}} &
}
}
@@ -145,6 +145,14 @@ r
\\
\midrule
}
+\cs_new:Nn {\__invoicetwo_print_real_value:n}{
+\num[round-integer-to-decimal,
+group-minimum-digits=4,
+group-separator={\GetTranslation{invoice2-thousands-sep}},
+output-decimal-marker={\GetTranslation{invoice2-decimal-point}}]{
+#1
+}
+}
\cs_new:Nn {\__invoicetwo_print_currency_value:n}{
\num[round-precision={\int_use:N \l__invoicetwo_currency_fraction_digits_int},
round-mode=places,
@@ -160,7 +168,7 @@ r
\__invoicetwo_print_currency_value:n {\fp_use:N #1}
}
\cs_new:Nn {\__invoicetwo_print_percentage:n}{
- \num[round-integer-to-decimal,,
+ \num[round-integer-to-decimal,
group-minimum-digits=4,
group-separator={\GetTranslation{invoice2-thousands-sep}},
output-decimal-marker={\GetTranslation{invoice2-decimal-point}}]{
@@ -169,7 +177,7 @@ r
\, \%
}
\cs_new:Nn {\__invoicetwo_update_trackers:nn}{
- \int_compare:nT {#1 != 1}{
+ \fp_compare:nT {#1 != 1}{
\bool_set_true:N \l__invoicetwo_amount_nonone_bool
}
\fp_compare:nT {#2 != 0}{
@@ -189,7 +197,7 @@ r
}
\cs_new:Nn {\__invoicetwo_print_amount:n}{
\bool_if:NT \l__invoicetwo_amount_nonone_bool {
- #1 &
+ \__invoicetwo_print_real_value:n {#1} &
}
}
\cs_new:Nn {\__invoicetwo_print_item:n}{
@@ -200,9 +208,13 @@ r
\__invoicetwo_print_percentage:n {#1} &
}
}
-\cs_new:Nn {\__invoicetwo_print_unit_price:n}{
- \bool_if:NT \l__invoicetwo_amount_nonone_bool {
- \__invoicetwo_print_currency_value:n {#1} &
+\cs_new:Nn {\__invoicetwo_print_unit_price:nn}{
+ \bool_if:nT { \l__invoicetwo_amount_nonone_bool || \l__invoicetwo_vat_nonzero_bool } {
+ \__invoicetwo_print_currency_value:n {
+ \fp_eval:n {
+ #2 \bool_if:NT \l__invoicetwo_included_vat_bool { / (1 + #1) }
+ }
+ } &
}
}
\cs_new:Nn {\__invoicetwo_print_price:nnn}{
@@ -231,7 +243,7 @@ r
\__invoicetwo_print_amount:n {#1}
\__invoicetwo_print_item:n {#2}
\__invoicetwo_print_vat:n {#3}
- \__invoicetwo_print_unit_price:n {#4}
+ \__invoicetwo_print_unit_price:nn {#3} {#4}
\__invoicetwo_print_price:nnn {#1} {#3} {#4} \\
}
}
@@ -249,7 +261,8 @@ r
\int_eval:n {
1
\bool_if:NT \l__invoicetwo_vat_nonzero_bool {+1}
- \bool_if:NT \l__invoicetwo_amount_nonone_bool {+2}
+ \bool_if:NT \l__invoicetwo_amount_nonone_bool {+1}
+ \bool_if:nT { \l__invoicetwo_amount_nonone_bool || \l__invoicetwo_vat_nonzero_bool } {+1}
}
}
\cs_new:Nn {\__invoicetwo_print_footer_item:n}{