flagsrequired => {acquisition => 1},
debug => 1,
});
+my $cfstr = "%.2f"; # currency format string -- could get this from currency table.
my @parcelitems=GetParcel($supplierid,$invoice,$datereceived->output('iso'));
my $countlines = scalar @parcelitems;
-
my $totalprice=0;
my $totalfreight=0;
my $totalquantity=0;
%line = %{$parcelitems[$i]};
$line{invoice} = $invoice;
$line{gst} = $gst;
- $line{total} = $total;
+ $line{total} = sprintf($cfstr,$total);
$line{supplierid} = $supplierid;
push @loop_received, \%line;
$totalprice+=$parcelitems[$i]->{'unitprice'};
+ $line{unitprice} = sprintf($cfstr,$parcelitems[$i]->{'unitprice'});
#double FIXME - totalfreight is redefined later.
# FIXME - each order in a parcel holds the freight for the whole parcel. This means if you receive a parcel with items from multiple budgets, you'll see the freight charge in each budget..
my $countpendings = scalar @$pendingorders;
# pending orders totals
-my ($totalPunitprice,$totalPquantity,$totalPecost);
+my ($totalPunitprice,$totalPquantity,$totalPecost, $totalPqtyrcvd);
my @loop_orders = ();
for (my $i=0;$i<$countpendings;$i++){
$toggle=0;
}
%line = %{$pendingorders->[$i]};
+ $line{quantity}+=0;
+ $line{quantityreceived}+=0;
+ $line{unitprice}+=0;
$totalPunitprice += $line{unitprice};
$totalPquantity +=$line{quantity};
+ $totalPqtyrcvd +=$line{quantityreceived};
$totalPecost += $line{ecost};
$line{ecost} = sprintf("%.2f",$line{ecost});
$line{unitprice} = sprintf("%.2f",$line{unitprice});
loop_received => \@loop_received,
countpending => $countpendings,
loop_orders => \@loop_orders,
- totalprice => $totalprice,
+ totalprice => sprintf($cfstr,$totalprice),
totalfreight => $totalfreight,
totalquantity => $totalquantity,
- tototal => $tototal,
+ tototal => sprintf($cfstr,$tototal),
gst => $gst,
- grandtot => $tototal+$gst,
+ grandtot => sprintf($cfstr,$tototal+$gst),
totalPunitprice => sprintf("%.2f",$totalPunitprice),
totalPquantity => $totalPquantity,
+ totalPqtyrcvd => $totalPqtyrcvd,
totalPecost => sprintf("%.2f",$totalPecost),
);
output_html_with_http_headers $input, $cookie, $template->output;
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha › Acquisitions › <!-- TMPL_IF name="date" -->
- Receipt Summary for <!-- TMPL_VAR NAME="name" --> <!--TMPL_IF Name="invoice"-->Parcel <!-- TMPL_VAR NAME="invoice" --><!--/TMPL_IF --> on <!-- TMPL_VAR NAME="date" --><!-- TMPL_ELSE -->Orders not yet Received for <!-- TMPL_VAR NAME="name" --><!-- /TMPL_IF --></title>
+ Receipt Summary for <!-- TMPL_VAR NAME="name" --> <!--TMPL_IF Name="invoice"-->Invoice <!-- TMPL_VAR NAME="invoice" --><!--/TMPL_IF --> on <!-- TMPL_VAR NAME="datereceived" --><!-- TMPL_ELSE -->Receive Orders from <!-- TMPL_VAR NAME="name" --><!-- /TMPL_IF --></title>
<!-- TMPL_INCLUDE NAME="greybox.inc" -->
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
</head>
<!-- TMPL_INCLUDE NAME="acquisitions-search.inc" -->
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <!-- TMPL_IF name="date" -->
- Receipt Summary for <i><!-- TMPL_VAR NAME="name" --></i> <!--TMPL_IF Name="invoice"-->Parcel <i><!-- TMPL_VAR NAME="invoice" --></i><!--/TMPL_IF --> on <i><!-- TMPL_VAR NAME="date" --></i>
+ Receipt Summary for <i><!-- TMPL_VAR NAME="name" --></i> <!--TMPL_IF Name="invoice"--><i>[ <!-- TMPL_VAR NAME="invoice" --> ]</i><!--/TMPL_IF --> on <i><!-- TMPL_VAR NAME="datereceived" --></i>
<!-- TMPL_ELSE -->
- Orders not yet Received for <!-- TMPL_VAR NAME="name" -->
+ Orders not yet Received from <!-- TMPL_VAR NAME="name" -->
<!-- /TMPL_IF --></div>
<div id="doc3" class="yui-t2">
<div class="yui-b">
<h1>
- <!-- TMPL_IF name="date" -->
- Receipt Summary for <i><!-- TMPL_VAR NAME="name" --></i> <!--TMPL_IF Name="invoice"-->Parcel <i><!-- TMPL_VAR NAME="invoice" --></i><!--/TMPL_IF --> on <i><!-- TMPL_VAR NAME="date" --></i>
+ <!-- TMPL_IF name="datereceived" -->
+ Receipt Summary for <i><!-- TMPL_VAR NAME="name" --></i> <!--TMPL_IF Name="invoice"--> <i> [ <!-- TMPL_VAR NAME="invoice" --> ] </i><!--/TMPL_IF --> on <i><!-- TMPL_VAR NAME="datereceived" --></i>
<!-- TMPL_ELSE -->
- Orders not yet Received for <!-- TMPL_VAR NAME="name" -->
+ Orders not yet Received from <!-- TMPL_VAR NAME="name" -->
<!-- /TMPL_IF -->
</h1>
<div id="acqui_recieve_summary">
<th>Basket/Order</th>
<th>Summary</th>
<th>View Record</th>
- <th>Qty ordered</th>
<th>Est cost</th>
<th>Actual cost</th>
<th>TOTAL</th>
<!-- TMPL_IF NAME="publishercode" --><br />Publisher :<!-- TMPL_VAR NAME="publishercode" --><!--/TMPL_IF-->
</td>
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">View MARC</a></td>
- <td><!-- TMPL_VAR NAME="quantity" --></td>
<td><!-- TMPL_VAR NAME="ecost" --></td>
<td><!-- TMPL_VAR NAME="unitprice" --></td>
<td><!-- TMPL_VAR NAME="total" --></td>
</tr>
<!-- /TMPL_LOOP -->
<tr>
- <th colspan="3"> </th>
- <th>SUBTOTALS</th>
+ <td colspan="3"> </td>
+ <th>SUBTOTAL</th>
+ <td> </td>
<th><!-- TMPL_VAR NAME="totalprice" --></th>
- <th><!-- TMPL_VAR NAME="totalfreight" --></th>
- <th><!-- TMPL_VAR NAME="totalquantity" --></th>
<th><!-- TMPL_VAR NAME="tototal" --></th>
</tr>
+ <!-- TMPL_IF NAME="totalfreight" -->
+ <tr>
+ <td colspan="5">
+ </td>
+ </p>
+ <th colspan="1">Freight</th>
+ <td><!-- TMPL_VAR NAME="totalfreight" --></td>
+ </tr> <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="gst" -->
<tr>
<td colspan="5">
<td><!-- TMPL_VAR NAME="gst" --></td>
</tr> <!-- /TMPL_IF -->
<tr>
- <td colspan="5"> </td>
- <td colspan="2"><b>TOTAL</b></td>
- <td><!-- TMPL_VAR NAME="grandtot" --></td>
+ <td colspan="3"> </td>
+ <th>TOTAL</th>
+ <td colspan="2"> </td>
+ <th><!-- TMPL_VAR NAME="grandtot" --></th>
</tr>
</table>
</form>
<th>BASKET</th>
<th>Summary</th>
<th>View Record</th>
- <th>Order qty</th>
+ <th>Qty received / ordered</th>
<th>Order cost</th>
- <th>Already Received </th>
<th>Received cost</th>
+ <th> </th>
</tr>
<!-- TMPL_LOOP NAME="loop_orders" -->
<tr>
<!-- TMPL_IF NAME="publishercode" --><br />Publisher :<!-- TMPL_VAR NAME="publishercode" --><!--/TMPL_IF-->
</td>
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
- <td><!-- TMPL_VAR NAME="quantity" --></td>
+ <td> <!-- TMPL_VAR NAME="quantityreceived" --> / <!-- TMPL_VAR NAME="quantity" --></td>
<td><!-- TMPL_VAR NAME="ecost" --></td>
- <td><!-- TMPL_IF name="quantityreceived" -->
- <!-- TMPL_VAR NAME="quantityreceived" --> <a href="orderreceive.pl?recieve=<!-- TMPL_VAR NAME="ordernumber" -->&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&daterecieved=<!-- TMPL_VAR NAME="datereceived" -->&invoice=<!-- TMPL_VAR NAME="invoice" -->&gst=<!-- TMPL_VAR NAME="gst" -->&freight=<!-- TMPL_VAR NAME="freight" -->&supplierid=<!-- TMPL_VAR NAME="supplierid" -->">More</a>
- <!-- TMPL_ELSE -->
- <a href="orderreceive.pl?recieve=<!-- TMPL_VAR NAME="ordernumber" -->&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&daterecieved=<!-- TMPL_VAR NAME="datereceived" -->&invoice=<!-- TMPL_VAR NAME="invoice" -->&gst=<!-- TMPL_VAR NAME="gst" -->&freight=<!-- TMPL_VAR NAME="freight" -->&supplierid=<!-- TMPL_VAR NAME="supplierid" -->">Receive</a>
- <!-- /TMPL_IF -->
- </td>
<td><!-- TMPL_IF EXPR="unitprice ne '0.00'" --><!-- TMPL_VAR NAME="unitprice" --><!-- /TMPL_IF --></td>
+ <td><a href="orderreceive.pl?recieve=<!-- TMPL_VAR NAME="ordernumber" -->&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&daterecieved=<!-- TMPL_VAR NAME="datereceived" -->&invoice=<!-- TMPL_VAR NAME="invoice" -->&gst=<!-- TMPL_VAR NAME="gst" -->&freight=<!-- TMPL_VAR NAME="freight" -->&supplierid=<!-- TMPL_VAR NAME="supplierid" -->">Receive</a></td>
</tr>
<!-- /TMPL_LOOP -->
- <tr>
- <th colspan="3">TOTAL</th>
- <th><!-- TMPL_VAR NAME="totalPquantity" --></th>
+ <tr><td colspan="2"> </td>
+ <th>TOTAL</th>
+ <th><!-- TMPL_VAR NAME="totalPqtyrcvd" --> / <!-- TMPL_VAR NAME="totalPquantity" --> </th>
<th><!-- TMPL_VAR NAME="totalPecost" --></th>
- <th><!-- TMPL_VAR NAME="quantityreceived" --></th>
<th><!-- TMPL_VAR NAME="totalPunitprice" --></th>
+ <td> </td>
</tr>
</table>
</div>