-$tototal=$tototal+$freight;
-
-$template->param(invoice => $invoice,
- datereceived => $datereceived->output('iso'),
- invoicedatereceived => $datereceived->output('iso'),
- formatteddatereceived => $datereceived->output(),
- name => $bookseller->{'name'},
- supplierid => $supplierid,
- gst => $gst,
- freight => $freight,
- invoice => $invoice,
- countreceived => $countlines,
- loop_received => \@loop_received,
- countpending => $countpendings,
- loop_orders => \@loop_orders,
- totalprice => sprintf($cfstr,$totalprice),
- totalfreight => $totalfreight,
- totalquantity => $totalquantity,
- tototal => sprintf($cfstr,$tototal),
- ordergrandtotal => sprintf($cfstr,$ordergrandtotal),
- gst => $gst,
- grandtot => sprintf($cfstr,$tototal+$gst),
- totalPunitprice => sprintf("%.2f",$totalPunitprice),
- totalPquantity => $totalPquantity,
- totalPqtyrcvd => $totalPqtyrcvd,
- totalPecost => sprintf("%.2f",$totalPecost),
- );
+$tototal = $tototal + $freight;
+
+$template->param(
+ invoice => $invoice,
+ datereceived => $datereceived->output('iso'),
+ invoicedatereceived => $datereceived->output('iso'),
+ formatteddatereceived => $datereceived->output(),
+ name => $bookseller->{'name'},
+ supplierid => $supplierid,
+ gst => $gst,
+ freight => $freight,
+ invoice => $invoice,
+ countreceived => $countlines,
+ loop_received => \@loop_received,
+ countpending => $countpendings,
+ loop_orders => \@loop_orders,
+ totalprice => sprintf($cfstr, $totalprice),
+ totalfreight => $totalfreight,
+ totalquantity => $totalquantity,
+ tototal => sprintf($cfstr, $tototal),
+ ordergrandtotal => sprintf($cfstr, $ordergrandtotal),
+ gst => $gst,
+ grandtot => sprintf($cfstr, $tototal + $gst),
+ totalPunitprice => sprintf("%.2f", $totalPunitprice),
+ totalPquantity => $totalPquantity,
+ totalPqtyrcvd => $totalPqtyrcvd,
+ totalPecost => sprintf("%.2f", $totalPecost),
+);