From e01039f94d36fed6f04cc62da049eaeb328bc264 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Tue, 20 Jan 2009 19:18:25 -0600 Subject: [PATCH] Minor rework of template js. Lines explicitly ended with semicolons. Allow some better behavior if TMPL_VAR's are undefined or zero. Note FIXME added. I believe this is part of the fragmentary integration of Katipo code for GST. Would be obliged if someone with access there can confirm. Signed-off-by: Henri-Damien LAURENT --- .../prog/en/modules/acqui/neworderempty.tmpl | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl index 91b4482552..fc66edb1f8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl @@ -5,38 +5,41 @@ //0"); } -discount=f.discount.value -listinc=parseInt(f.listinc.value) -currency=f.currency.value -applygst=parseInt(f.applygst.value) -listprice=f.list_price.value + discount=f.discount.value; + currency=f.currency.value; +listprice=f.list_price.value; + listinc=parseInt(f.listinc.value); + applygst=parseInt(f.applygst.value); // rrp=f.rrp.value // ecost=f.ecost.value //budgetted cost // GST=f.GST.value // total=f.total.value //make useful constants out of the above -exchangerate=f.elements[currency].value //get exchange rate +exchangerate=f.elements[currency].value; //get exchange rate. same as "discount" above? gst_on=(!listinc && applygst); //do real stuff rrp=listprice*exchangerate; -ecost=rrp*(100-discount)/100 +ecost=rrp*(100-discount)/100; GST=0; if (gst_on){ + rrp=rrp*(1+); GST=ecost*(); + ; // TMPL_VAR NAME=gstrate not set. leave rrp and GST alone. + } -total=(ecost+GST)*quantity +total=(ecost+GST)*quantity; -f.rrp.value=rrp; + f.rrp.value=rrp; f.ecost.value=ecost; f.total.value=total; - -f.GST.value=GST; + // FIXME: TMPL_VAR NAME="GST" never populated + f.GST.value=GST; return true; } -- 2.39.2