$form->{nodiscount} = $form->format_amount($myconfig, $nodiscount, 2);
$form->{yesdiscount} = $form->format_amount($myconfig, $form->{nodiscount_total} - $nodiscount, 2);
- $form->{invtotal} = ($form->{taxincluded}) ? $form->{total} : $form->{total} + $tax;
- $form->{total} = $form->format_amount($myconfig, $form->{invtotal} - $form->{paid}, 2);
+ my $grossamount = ($form->{taxincluded}) ? $form->{total} : $form->{total} + $tax;
+ $form->{invtotal} = $form->round_amount($grossamount, 2, 1);
+ $form->{rounding} = $form->round_amount(
+ $form->{invtotal} - $form->round_amount($grossamount, 2),
+ 2
+ );
+ $form->{rounding} = $form->format_amount($myconfig, $form->{rounding}, 2);
+ $form->{total} = $form->format_amount($myconfig, $form->{invtotal} - $form->{paid}, 2);
$form->{invtotal} = $form->format_amount($myconfig, $form->{invtotal}, 2);
$form->{paid} = $form->format_amount($myconfig, $form->{paid}, 2);
$form->{subtotal_nofmt} = $form->{ordtotal};
}
- $form->{ordtotal} = ($form->{taxincluded}) ? $form->{ordtotal} : $form->{ordtotal} + $tax;
+ my $grossamount = ($form->{taxincluded}) ? $form->{ordtotal} : $form->{ordtotal} + $tax;
+ $form->{ordtotal} = $form->round_amount( $grossamount, 2, 1);
+ $form->{rounding} = $form->round_amount(
+ $form->{ordtotal} - $form->round_amount($grossamount, 2),
+ 2
+ );
# format amounts
+ $form->{rounding} = $form->format_amount($myconfig, $form->{rounding}, 2);
$form->{quototal} = $form->{ordtotal} = $form->format_amount($myconfig, $form->{ordtotal}, 2);
$form->set_payment_options($myconfig, $form->{$form->{type} =~ /_quotation/ ? 'quodate' : 'orddate'}, $form->{type});
<tr valign=bottom>
<td width=10> </td>
<td>
-
+
<table width=100%>
<tr>
<td>
<table width=100% callspacing=0 cellpadding=0>
-
+
<tr>
<td align=right>
<table>
<tr>
<th align=right>Ausgestellt am</th><td width=10> </td><td><%invdate%></td>
</tr>
-
+
<tr>
<th align=right>Bezahlbar bis</th><td width=10> </td><td><%duedate%></td>
</tr>
<tr>
<th align=right>Nummer</th><td> </td><td><%invnumber%></td></tr>
</tr>
-
+
<tr>
<th align=right>Lieferdatum</th><td> </td><td><%deliverydate%></td></tr>
</tr>
<br><%city%>
<br><%country%>
</td>
-
+
<td><%shiptoname%>
<br><%shiptostreet%>
<br><%shiptozipcode%>
<tr>
<td> </td>
</tr>
-
+
<tr>
<td>
<table width=100%>
<tr>
<td colspan=7><hr noshade></td>
</tr>
-
+
<%if taxincluded%>
<tr>
<th colspan=5 align=right>Total</th>
</tr>
<%end tax%>
+<%if rounding%>
+ <tr>
+ <th colspan=5 align=right>Rundung</th>
+ <td colspan=2 align=right><%rounding%></td>
+ </tr>
+<%end rounding%>
+
<%if paid%>
<tr>
<th colspan=5 align=right>Bezahlt</th>
</tr>
<tr><td> </td></tr>
-
+
<tr>
<td>
<table width=100%>
<tr valign=bottom>
<td width=10> </td>
<td>
-
+
<table width=100%>
<tr>
<td>
<table width=100% callspacing=0 cellpadding=0>
-
+
<tr>
<td align=right>
<table>
<tr>
<th align=right>Bestelldatum</th><td width=10> </td><td><%orddate%></td>
</tr>
-
+
<tr>
<th align=right>Lieferbar bei</th><td width=10> </td><td><%reqdate%></td>
</tr>
<tr>
<th align=right>Bestellnummer</th><td> </td><td><%ordnumber%></td></tr>
</tr>
-
+
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
-
+
<tr>
<td>
<table width=100%>
<tr>
<td colspan=7><hr noshade></td>
</tr>
-
+
<%if taxincluded%>
<tr>
<th colspan=5 align=right>Total</th>
</tr>
<%end tax%>
+<%if rounding%>
+ <th colspan=5 align=right>Rundung</th>
+ <td colspan=2 align=right><%rounding%></td>
+<%end rounding%>
+
<tr>
<td colspan=2> </td>
<td colspan=5><hr noshade></td>
</tr>
<tr><td> </td></tr>
-
+
<tr>
<td>
<table width=100%>
<tr valign=bottom>
<td width=10> </td>
<td>
-
+
<table width=100%>
<tr valign=top>
<td>
<td colspan=2>
<table width=100% border=1>
<tr>
- <th width=17% align=left nowrap>Nummer</th>
- <th width=17% align=left>Datum</th>
- <th width=17% align=left>Gültig bis</th>
- <th width=17% align=left nowrap>Kontakt</th>
- <th width=17% align=left nowrap>Lagerplatz</th>
- <th width=15% align=left nowrap>Lieferung mit</th>
- </tr>
-
- <tr>
- <td><%quonumber%></td>
- <td><%quodate%></td>
- <td><%reqdate%></td>
- <td><%employee%></td>
- <td><%shippingpoint%></td>
- <td><%shipvia%></td>
- </tr>
+ <th width=17% align=left nowrap>Nummer</th>
+ <th width=17% align=left>Datum</th>
+ <th width=17% align=left>Gültig bis</th>
+ <th width=17% align=left nowrap>Kontakt</th>
+ <th width=17% align=left nowrap>Lagerplatz</th>
+ <th width=15% align=left nowrap>Lieferung mit</th>
+ </tr>
+
+ <tr>
+ <td><%quonumber%></td>
+ <td><%quodate%></td>
+ <td><%reqdate%></td>
+ <td><%employee%></td>
+ <td><%shippingpoint%></td>
+ <td><%shipvia%></td>
+ </tr>
</table>
</td>
</tr>
</tr>
<%end tax%>
+<%if rounding%>
+ <th colspan=6 align=right>Rundung</th>
+ <td colspan=2 align=right><%rounding%></td>
+<%end rounding%>
+
<tr>
<td colspan=4> </td>
<td colspan=4><hr noshade></td>
</tr>
[%- END %]
-[%- IF rounding %]
- <tr>
- <th align='right'>[% 'Rounding' | $T8 %]</th>
- <td align='right'>[% LxERP.format_amount(rounding, 2) %]</td>
- </tr>
-[%- END %]
-
[%# tax %]
[% FOREACH item = taxaccounts_array %]
[% SET description_ref = item _ '_description' %]
</tr>
[%- END %]
[%- END %]
+
+[%- IF rounding %]
+ <tr>
+ <th align='right'>[% 'Rounding' | $T8 %]</th>
+ <td align='right'>[% LxERP.format_amount(rounding, 2) %]</td>
+ </tr>
+[%- END %]
+
<tr>
<th align="right">[% 'Total' | $T8 %]</th>
<td align="right">[% LxERP.format_amount(invtotal, 2) %]</td>
<td align='right'>[% LxERP.format_amount(invsubtotal, 2) %]</td>
</tr>
[%- END %]
+ [% tax %]
[%- IF rounding %]
<tr>
<th align='right'>[% 'Rounding' | $T8 %]</th>
<td align='right'>[% LxERP.format_amount(rounding, 2) %]</td>
</tr>
[%- END %]
- [% tax %]
<tr>
<th align="right">[% 'Total' | $T8 %]</th>
<td align="right">[% LxERP.format_amount(invtotal, 2) %]