add pick up template
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
tobiasd 2024-10-08 15:19:17 +02:00
parent 786c34b726
commit 5084dd8b9f
Signed by: tobiasd
GPG Key ID: 25FE376FF17694A1
2 changed files with 9 additions and 3 deletions

View File

@ -261,7 +261,11 @@ my @odtfill = qw();
push @odtfill, $ENV{"DOCUMENT_ROOT"} . "/cgi-bin/odtfill";
# template file
push @odtfill, $ENV{"DOCUMENT_ROOT"} . "/templates/invoice.odt";
if ( !$pickup ) {
push @odtfill, $ENV{"DOCUMENT_ROOT"} . "/templates/invoice.odt";
} else {
push @odtfill, $ENV{"DOCUMENT_ROOT"} . "/templates/invoicepu.odt";
}
# output file
push @odtfill, "/tmp/invoice.odt";
@ -284,8 +288,10 @@ foreach my $item ( $query->param ) {
push @odtfill, "Amount=" . sprintf "%.2f", $value * $price;
}
}
push @odtfill, "Country=" . $country_name; # 2nd Country placeholder
push @odtfill, "Shipping=" . sprintf "%.2f", $shipping;
if ( !$pickup ) {
push @odtfill, "Country=" . $country_name; # 2nd Country placeholder
push @odtfill, "Shipping=" . sprintf "%.2f", $shipping;
}
push @odtfill, "Total=" . $amount_f;
push @odtfill, "Net=" . $net;
push @odtfill, "Vat=" . $vat;

Binary file not shown.