Koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorder.tt
Jonathan Druart ea3b5aad21 Bug 9822: Alert on adding an order to a basket if budget s exceeded
2 DB fields are not used: aqbudgets.encumb and aqbudgets.expend.

This patch uses these fields in order to show a warning message if the
budget selected for an order has exceeded.

Test plan:
- Create a new active fund with at least 1 of both warning fields
  ('Warning at (%)' and 'Warning at (amount)').
- Create a new order for a basket with this new fund and a cost >
  warning amount defined for the fund (or using %).
- Save and check that a warning message appears
- Retry playing with all combinations of warning fields

Signed-off-by: Koha Team Lyon 3 <koha@univ-lyon3.fr>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-30 15:10:11 +00:00

41 lines
1.5 KiB
Text

[% INCLUDE "doc-head-open.inc" %]
<title>Koha &rsaquo; Acquisition &rsaquo; Add order</title>
[% INCLUDE "doc-head-close.inc" %]
</head>
<body>
[% INCLUDE "header.inc" %]
<div id="doc3" class="yui-t7">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% IF (not_enough_budget) %]
<form action="/cgi-bin/koha/acqui/addorder.pl" method="post">
[% FOREACH var IN vars_loop %]
[% FOREACH val IN var.values %]
<input type="hidden" name="[% var.name %]" value="[% val |html %]" />
[% END %]
[% END %]
<input type="hidden" name="confirm_budget_exceeding" value="1" />
<div class="dialog">
[% IF (budget_exceeded) %]
<p>Warning! Order total amount exceeds allowed budget.</p>
[% END %]
[% IF (encumbrance_exceeded) %]
<p>Warning! You will exceed [% encumbrance %]% of your fund.</p>
[% END %]
[% IF (expenditure_exceeded) %]
<p>Warning! You will exceed maximum limit ([% expenditure %][% IF (currency) %] [% currency %][% END %]) for your fund.</p>
[% END %]
<p>Do you want to confirm this order?</p>
<input type="submit" class="approve" value="Yes, I confirm" />
<input type="button" class="deny" value="No, I don't confirm" onclick="window.location.href = '[% referer %]'" />
</div>
</form>
[% END %]
</div>
</div>
</div>
[% INCLUDE "intranet-bottom.inc" %]