d02e2789e5
There is currently no way to delete unused invoices (for example, invoices created by mistake), and there really should be, since errors and absent-mindedness can result in numerous empty invoices over the course of years. To test: 1) Apply patch. 2) Create three invoices in the Acquisitions module. For one of them, receive at least one item. For the other two, do not receive any items. 3) View one of the invoices that does not have any items on it. 4) Try to delete it. This should succeed. 5) View the invoice that has an item. There should not be any option to delete it. 6) Do an invoice search that brings up the other invoice with no items on it. Try to delete it from the results page. This should succeed. 7) Run the unit test: > prove t/Acquisition/Invoice.t 8) Sign off. Signed-off-by: Srdjan <srdjan@catalyst.net.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> All tests and QA script pass. I also did another test: I cancelled all receipts from an existing invoice and then could successfully delete it in the last step. Signed-off-by: Galen Charlton <gmc@esilibrary.com>
180 lines
7.1 KiB
Text
180 lines
7.1 KiB
Text
[% USE KohaDates %]
|
|
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Acquisitions › Invoice</title>
|
|
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% INCLUDE 'calendar.inc' %]
|
|
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
|
|
[% INCLUDE 'datatables-strings.inc' %]
|
|
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
$(document).ready(function() {
|
|
$("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
bInfo: false,
|
|
bPaginate: false,
|
|
bFilter: false,
|
|
sDom: "t"
|
|
}));
|
|
});
|
|
//]]>
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE '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> › <a href="/cgi-bin/koha/acqui/invoices.pl">Invoices</a> › <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">[% invoicenumber %]</a></div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
[% IF ( modified ) %]
|
|
<div class="dialog message">
|
|
<p>Invoice has been modified</p>
|
|
</div>
|
|
[% END %]
|
|
<h1>Invoice: [% invoicenumber %]</h1>
|
|
|
|
<p>Vendor: <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% suppliername %]</a></p>
|
|
<form action="/cgi-bin/koha/acqui/invoice.pl" method="post">
|
|
<fieldset class="rows">
|
|
<ol>
|
|
<li><label for="shipmentdate">Shipment date:</label>
|
|
<input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" readonly="readonly" class="datepicker" /></li>
|
|
|
|
<li><label for="billingdate">Billing date:</label>
|
|
<input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" readonly="readonly" class="datepicker" /></li>
|
|
|
|
<li><label for="shipmentcost">Shipment cost:</label>
|
|
<input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost %]" /></li>
|
|
<li><label for="shipment_budget_id">Fund:</label>
|
|
<select id="shipment_budget_id" name="shipment_budget_id">
|
|
<option value="">No fund</option>
|
|
[% FOREACH budget IN budgets_loop %]
|
|
[% IF ( budget.selected ) %]
|
|
<option selected="selected" value="[% budget.budget_id %]">
|
|
[% ELSE %]
|
|
<option value="[% budget.budget_id %]">
|
|
[% END %]
|
|
[% budget.budget_name %]
|
|
</option>
|
|
[% END %]
|
|
</select></li>
|
|
|
|
[% IF ( invoiceclosedate ) %]
|
|
<li><span class="label">Status:</span>
|
|
Closed on [% invoiceclosedate | $KohaDates %].</li>
|
|
|
|
<li><label for="reopen">Reopen: </label> <input type="checkbox" name="reopen" id="reopen" /></li>
|
|
[% ELSE %]
|
|
<li><span class="label">Status:</span>
|
|
Open.</li>
|
|
|
|
<li><label for="close">Close: </label> <input type="checkbox" name="close" id="close" />
|
|
</li>
|
|
[% END %]
|
|
</ol>
|
|
<input type="hidden" name="op" value="mod" />
|
|
<input type="hidden" name="invoiceid" value="[% invoiceid %]" />
|
|
</fieldset>
|
|
<fieldset class="action">
|
|
<input type="submit" value="Save" />
|
|
[% UNLESS orders_loop.size %]
|
|
<a href="invoice.pl?op=delete&invoiceid=[% invoiceid %]">Delete</a>
|
|
[% END %]
|
|
</fieldset>
|
|
</form>
|
|
<p>
|
|
<a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a>
|
|
</p>
|
|
<h2>Invoice details</h2>
|
|
[% IF orders_loop.size %]
|
|
<table id="orderst">
|
|
<thead>
|
|
<tr>
|
|
<th>Summary</th>
|
|
<th>Publisher</th>
|
|
<th>Library</th>
|
|
<th>RRP</th>
|
|
<th>Est.</th>
|
|
<th>Qty.</th>
|
|
<th>Total</th>
|
|
<th>Fund</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH order IN orders_loop %]
|
|
<tr>
|
|
<td><p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title %]</a>
|
|
[% IF ( order.author ) %]
|
|
<br /><em>by</em> [% order.author %]
|
|
[% END %]
|
|
</p></td>
|
|
<td>
|
|
[% IF ( order.publishercode ) %]
|
|
<p>[% order.publishercode %]
|
|
[% IF ( order.publicationyear ) %]
|
|
- [% order.publicationyear %]
|
|
[% END %]
|
|
</p>
|
|
[% END %]
|
|
</td>
|
|
<td><p>[% order.branchcode %]</p></td>
|
|
<td>[% order.rrp %]</td>
|
|
<td>[% order.ecost %]</td>
|
|
<td class="number">[% order.quantity %]</td>
|
|
<td>[% order.total %]</td>
|
|
<td>[% order.budget_name %]</td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<th colspan="3">Total tax exc.</th>
|
|
<th>[% total_rrp_gste %]</th>
|
|
<th> </th>
|
|
<th>[% total_quantity %]</th>
|
|
<th>[% total_est_gste %]</th>
|
|
<th> </th>
|
|
</tr>
|
|
<tr>
|
|
<th colspan='3'>Tax ([% gist %]%)</th>
|
|
<th>[% gist_rrp %]</th>
|
|
<th> </th>
|
|
<th> </th>
|
|
<th>[% gist_est %]</th>
|
|
<th> </th>
|
|
</tr>
|
|
<tr>
|
|
<th colspan='3'>Total tax inc. ([% currency %])</th>
|
|
<th>[% total_rrp_gsti %]</th>
|
|
<th> </th>
|
|
<th>[% total_quantity %]</th>
|
|
<th>[% total_est_gsti %]</th>
|
|
<th> </th>
|
|
</tr>
|
|
<tr>
|
|
<th colspan="3">Total + shipment cost ([% currency %])</th>
|
|
<th> </th>
|
|
<th> </th>
|
|
<th>[% total_quantity %]</th>
|
|
<th>[% total_gsti_shipment %]</th>
|
|
<th> </th>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
[% ELSE %]
|
|
<div class="dialog message"><p>No orders yet</p></div>
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
[% INCLUDE 'acquisitions-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|