$line_total=$results[$i]->{'quantity'}*$results[$i]->{'ecost'};
$sub_total+=$line_total;
- $gist=sprintf("%.2f",$sub_total*0.125);
- $grand_total=$sub_total+$gist;
my %line;
if ($toggle==0){
$line{color}='#ffffcc';
$line{biblionumber} = $results[$i]->{'biblionumber'};
push @books_loop, \%line;
}
+$gist=sprintf("%.2f",$sub_total*C4::Context->preference("gist"));
+$grand_total=$sub_total+$gist;
+
$template->param(basket => $basket,
authorisedby => $results[0]->{'authorisedby'},
entrydate => format_date($results[0]->{'entrydate'}),
use C4::Output;
use C4::Search;
use C4::Auth;
-use C4::Biblio;
use C4::Output;
use C4::Interface::CGI::Output;
use C4::Database;
my $dbh = C4::Context->dbh;
if ($ordnum eq ''){
$new='yes';
- warn "NEW : YES";
$ordnum=newordernum;
if ($biblio) {
$data=bibdata($biblio);
biblioitemnumber => $data->{'biblioitemnumber'},
itemtype => $data->{'itemtype'},
discount => $booksellers[0]->{'discount'},
- listingcst => $booksellers[0]->{'listincgst'},
+ listincgst => $booksellers[0]->{'listincgst'},
listprice => $booksellers[0]->{'listprice'},
gstreg => $booksellers[0]->{'gstreg'},
name => $booksellers[0]->{'name'},
+ currency => $booksellers[0]->{'listprice'},
+ gstrate => C4::Context->preference("gist") ,
loop_currencies => \@loop_currency,
orderexists => ($new eq 'yes')?0:1,
title => $data->{'title'},
ecost=rrp*(100-discount)/100
GST=0;
if (gst_on){
- rrp=rrp*1.125;
- GST=ecost*0.125
+ rrp=rrp*(1+<TMPL_VAR name="gstrate">);
+ GST=ecost*(<TMPL_VAR name="gstrate">);
}
total=(ecost+GST)*quantity
-
- f.rrp.value=display(rrp)
- f.ecost.value=display(ecost)
- f.GST.value=display(GST)
- f.total.value=display(total)
+ f.rrp.value=rrp;
+ f.ecost.value=ecost;
+ f.GST.value=GST;
+ f.total.value=total;
}
<input type=hidden name=oldtype value="<TMPL_VAR name="itemtype">">
<input type=hidden name=discount value="<TMPL_VAR name="discount">">
<input type=hidden name=listinc value="<TMPL_VAR name="listincgst">">
-<input type=hidden name=currency value="<TMPL_VAR name="listprice">">
-<input type=hidden name=applygst value="<TMPL_VAR name"gstreg">">
+<input type=hidden name=currency value="<TMPL_VAR name="currency">">
+<input type=hidden name=applygst value="<TMPL_VAR name="gstreg">">
<TMPL_LOOP name="loop_currencies">
<input type=hidden name="<TMPL_VAR name="currency">" value="<TMPL_VAR name="rate">">
</TMPL_LOOP>
<td width="10%"><b>Isbn</b></td>
<td width="30%"><b>Titre</b></td>
<td width="20%"><b>Auteur</b></td>
- <td width="6%"><b>? frais</b></td>
- <td width="8%"><b>? est</b></td>
+ <td width="6%"><b>Px rempl</b></td>
+ <td width="8%"><b>Px est</b></td>
<td width="8%"><b>Qté</b></td>
<td width="8%"><b>Total</b></td>
</tr>
<td><TMPL_VAR name="isbn"></td>
<td><a href="newbiblio.pl?ordnum=<TMPL_VAR name="ordernumber">&id=<TMPL_VAR name="booksellerid">&basket=<TMPL_VAR name="basket">"><TMPL_VAR name="title"></a></td>
<td><TMPL_VAR name="author"></td>
- <td><TMPL_VAR name="rrp">"></td>
- <td><TMPL_VAR name="ecost">"></td>
+ <td><TMPL_VAR name="rrp"></td>
+ <td><TMPL_VAR name="ecost"></td>
<td><TMPL_VAR name="quantity"></td>
<td><TMPL_VAR name="line_total"></td>
</tr>
ecost=rrp*(100-discount)/100
GST=0;
if (gst_on){
- rrp=rrp*1.125;
- GST=ecost*0.125
+ rrp=rrp*(1+<TMPL_VAR name="gstrate">);
+ GST=ecost*<TMPL_VAR name="gstrate">;
}
total=(ecost+GST)*quantity
- f.rrp.value=display(rrp)
- f.ecost.value=display(ecost)
- f.GST.value=display(GST)
- f.total.value=display(total)
+ f.rrp.value=rrp;
+ f.ecost.value=ecost;
+ f.GST.value=GST;
+ f.total.value=total;
}
<input type=hidden name=oldtype value="<TMPL_VAR name="itemtype">">
<input type=hidden name=discount value="<TMPL_VAR name="discount">">
<input type=hidden name=listinc value="<TMPL_VAR name="listincgst">">
-<input type=hidden name=currency value="<TMPL_VAR name="listprice">">
-<input type=hidden name=applygst value="<TMPL_VAR name"gstreg">">
+<input type=hidden name=currency value="<TMPL_VAR name="currency">">
+<input type=hidden name=applygst value="<TMPL_VAR name="gstreg">">
<TMPL_LOOP name="loop_currencies">
<input type=hidden name="<TMPL_VAR name="currency">" value="<TMPL_VAR name="rate">">
</TMPL_LOOP>
<td><input type=text size=20 name=ecost value="<TMPL_VAR name="ecost">" onchange='update(this.form)'></td>
</tr>
<TR VALIGN=TOP>
- <TD>Port budgété</td>
+ <TD>Taxes</td>
<td><input type=text size=20 name=GST value="" onchange='update(this.form)'></td>
</tr>
<TR VALIGN=TOP>
explanation => 'the email adress where borrowers modifs are sent',
type => 'free'
},
+ {
+ uniquefieldrequired => 'variable',
+ variable => 'gist',
+ forceupdate => { 'explanation' => 1,
+ 'type' => 1 },
+ value => '0.125',
+ explanation => 'the gist rate. NOT in %, but in numeric form (0.12 for 12%)',
+ type => 'free'
+ },
],
);
exit;
# $Log$
+# Revision 1.53 2003/07/07 14:11:16 tipaul
+# fixing bug #526 : gst rate is now calculated through systempref gist entry.
+# Before this fix :
+# * was harcoded to 12,5%
+# * some bugs in template parameters prevented the javascript to work.
+# * some bugs prevented some calculations to be done properly.
+#
# Revision 1.52 2003/06/23 15:54:32 tipaul
# *** empty log message ***
#