Koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/ordered.tt
Alex Buckley 3ca1ab63ac
Bug 31631: Optionally use tax-exclusive values for calculating fund values
Test plan:
1. Apply patches
2. sudo koha-upgrade-schema <instance>
3. Restart services
4. Set TaxRates syspref = 0.15
5. Create a new fund with amount = 1000
6. Add an order to a basket with the following values:
- Fund = Choose the fund from step #5
- Quantity = 1
- Vendor price = 10
- Tax rate = 15%
- Discount = 20%
- Retail price = 10.00
- Replacement cost = 10.00
- Actual cost = 10.00
- Ensure the basket belongs to a vendor with ("List prices" = "Don't include tax" and "Invoice prices" = "Don't include tax")
7. Go to the Acquisitions home page
8. Confirm the 'Ordered' column for the step #5 fund contains 9.20
9. Click on the 9.20 link and confirm the ordered.pl page that loads
also contains 9.20 as the 'Subtotal'

10. Change 'CalculateFundValuesIncludingTax' = 'Exclude'
11. On the Acquisitions home page confirm the 'Ordered' column now
contains 8.00
12. Click on the 8.00 link and confirm the ordered.pl page also contains
8.00 as the 'Subtotal'

13. Close your basket and receive your order - change the 'Actual costs'
= 8.00 (the $10 retail price less the 20% discount, tax exclusive)
14. Go to the Acquisitions home page and confirm the 'Spent' column now
contains 8.00
15. Click on the 8.00 link and confirm the spent.pl page also contains
8.00 as the 'Subtotal'

16. Change 'CalculateFundValuesIncludingTax' = 'Include'
17. Confirm the 'Spent' column on the Acquisitions home page now shows
9.20
18. Click on the 9.20 link and confirm the spent.pl page also contains
9.20 as the 'Subtotal'

Sponsored-by: Waikato Institute of Technology, New Zealand

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-18 15:41:35 -03:00

154 lines
6.1 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE KohaDates %]
[% USE ItemTypes %]
[% USE Price %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% t("Ordered") | html %] &rsaquo;
[% t("Acquisitions") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="acq_ordered" class="acq">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Ordered - [% fund_code | html %]</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
<h1>Ordered - Fund: [% fund_code | html %]</h1>
<div class="page-section">
<table id="spent">
<thead>
<tr>
<th class="anti-the"> Title </th>
<th> [% tp('noun', 'Order') | html %] </th>
<th> Vendor </th>
<th> Item types </th>
<th> Left on order </th>
<th> Estimated cost per unit </th>
<th> Date ordered </th>
<th> Subtotal </th>
</tr>
</thead>
<tbody>
[% FOREACH order IN ordered %]
<tr>
<td class="cell">
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">
[% order.title | html %]
</a>
</td>
<td class="cell">
[% IF ( CAN_user_acquisition_order_manage ) %]
<a href="/cgi-bin/koha/acqui/neworderempty.pl?ordernumber=[% order.ordernumber | uri %]&amp;booksellerid=[% order.booksellerid | uri %]&amp;basketno=[% order.basketno | uri %]">[% order.ordernumber | html %]</a>
[% ELSE %]
[% order.ordernumber | html %]
[% END %]
</td>
<td class="cell">
<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid | uri %]">[% order.vendorname | html %]</a>
</td>
<td class="cell">
[% FOREACH itemtype IN order.itemtypes %]
[% ItemTypes.GetDescription( itemtype ) | html %]
[% IF !loop.last() %] | [% END %]
[% END %]
</td>
<td class="cell">
[% order.left | html %]
</td>
<td class="data cell">
[% IF Koha.Preference('CalculateFundValuesIncludingTax') %]
[% order.ecost_tax_included | $Price %]
[% ELSE %]
[% order.ecost_tax_excluded | $Price %]
[% END %]
</td>
<td class="cell" data-order="[% order.entrydate | html %]">
[% order.entrydate | $KohaDates %]
</td>
<td class="data cell">
[% order.subtotal | $Price %]
</td>
</tr>
[% END %]
</tbody>
<tfoot>
[% IF ( adjustments && adjustments.count > 0 ) %]
[% FOREACH adjustment IN adjustments %]
<tr>
<td></td>
<td colspan="6">Adjustment cost for invoice
<a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% adjustment.invoiceid | uri %]">
[% adjustment.invoice.invoicenumber | html %]
</a>
</td>
<td class="data total">[% adjustment.adjustment | $Price %]</td>
</tr>
[% END %]
[% END %]
<tr>
<td> Total </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td class="data">
[% total | $Price %]
</td>
</tr>
</tfoot>
</table>
</div> <!-- /.page-section -->
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'acquisitions-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/acquisitions-menu.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
<script>
$(document).ready(function() {
$("#spent").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] }
],
"sPaginationType": "full"
}));
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]