NYBU#29712 Annuleringshorizon (variabele doorbelastingspercentages)

svn path=/Website/trunk/; revision=30057
This commit is contained in:
Erik Groener
2016-07-14 13:53:04 +00:00
parent a368a19fb1
commit 22f351681a

View File

@@ -101,9 +101,10 @@ user.auth_required_or_abort(this_res.canDelete);
oRs.Close();
buttons = [];
if (aantalEerder > 0 || aantalLater > 0)
if (aantalEerder > 0 || aantalLater > 0 || (aantalEerder == 0 && aantalLater == 0))
{
buttons.push({ title: L("lcl_res_btn_current"),
id: "del_current",
icon: "delete.png",
action: "doDelete(false, false);",
tooltip: L("lcl_res_del_txt_current") + " " + rrr.rsv_ruimte_volgnr});
@@ -111,6 +112,7 @@ user.auth_required_or_abort(this_res.canDelete);
if (aantalEerder > 0 && aantalLater > 0)
{
buttons.push({ title: L("lcl_res_btn_future"),
id: "del_future",
icon: "delete.png",
action: "doDelete(false, true);",
tooltip: L("lcl_res_del_txt_future")});
@@ -118,6 +120,7 @@ user.auth_required_or_abort(this_res.canDelete);
if (urole != 'fe' || aantalEerder == 0)
{
buttons.push({ title: L("lcl_res_btn_total"),
id: "del_total",
icon: "delete.png",
action: "doDelete(true);",
tooltip: L("lcl_res_del_txt_total")});
@@ -134,6 +137,7 @@ user.auth_required_or_abort(this_res.canDelete);
// bonWards: vanaf datum huidige res_rsv_ruimte voorwaarts
function doDelete(bFull, bonWards)
{
checkMaxRecharge();
$("#deletefull").val(bFull?1:0);
$("#deletefuture").val(bonWards?1:0);
// Niet overdrijven met vragen: if (confirm(L("lcl_R_U_sure")))
@@ -142,10 +146,13 @@ user.auth_required_or_abort(this_res.canDelete);
function selectCharge()
{
checkMaxRecharge();
$(".div_perc_recharge").toggle();
$(".div_recharge").toggle();
$(".div_voorzieningen").toggle();
$(".div_totaalkosten").toggle();
$("#del_future").toggle();
$("#del_total").toggle();
FcltMgr.resized();
}
@@ -156,14 +163,35 @@ user.auth_required_or_abort(this_res.canDelete);
var totaal = <%=safe.jsfloat(voorzieningenprijs)%> + (perc * org_ruimte_prijs);
$("#recharge").val(num2currEditable(perc * org_ruimte_prijs));
$("#totaalkosten").text(num2currEditable(totaal));
checkMaxRecharge();
}
function checkMaxRecharge()
{
var org_ruimte_prijs = parseFloat(<%=safe.jsfloat(orgruimteprijs)%>);
var new_ruimte_prijs = parseFloat($("#recharge").val());
if ($("#cost_recharge").is(":checked") && new_ruimte_prijs > org_ruimte_prijs)
{
alert(L("mgt_validation_error_1").format(L("lcl_res_charge_total")));
$("#recharge").addClass("hot");
}
else
$("#recharge").removeClass("hot");
}
$(document).ready(function() {
if (!$("#cost_recharge").is(":checked"))
{
$(".div_perc_recharge").hide();
$(".div_recharge").hide()
$(".div_voorzieningen").hide();
$(".div_totaalkosten").hide();
}
else
{
$("#del_future").hide();
$("#del_total").hide();
}
});
</script>