View | Details | Raw Unified | Return to bug 5466
Collapse All | Expand All

(-)a/acqui/basket.pl (-2 / +7 lines)
Lines 217-224 if ( $op eq 'delete_confirm' ) { Link Here
217
      "loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s",
217
      "loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s",
218
      $basket->{creationdate}, $basket->{authorisedby};
218
      $basket->{creationdate}, $basket->{authorisedby};
219
219
220
	#to get active currency
221
	my $cur = GetCurrency();
222
223
220
    my @results = GetOrders( $basketno );
224
    my @results = GetOrders( $basketno );
221
    
225
   
222
	my $gist = $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
226
	my $gist = $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
223
	my $discount = $bookseller->{'discount'} / 100;
227
	my $discount = $bookseller->{'discount'} / 100;
224
    my $total_rrp;      # RRP Total, its value will be assigned to $total_rrp_gsti or $total_rrp_gste depending of $bookseller->{'listincgst'}
228
    my $total_rrp;      # RRP Total, its value will be assigned to $total_rrp_gsti or $total_rrp_gste depending of $bookseller->{'listincgst'}
Lines 310-316 if ( $op eq 'delete_confirm' ) { Link Here
310
        gist_rrp             => sprintf( "%.2f", $gist_rrp ),        
314
        gist_rrp             => sprintf( "%.2f", $gist_rrp ),        
311
        total_rrp_gsti       => sprintf( "%.2f", $total_rrp_gsti ),
315
        total_rrp_gsti       => sprintf( "%.2f", $total_rrp_gsti ),
312
        total_est_gsti       => sprintf( "%.2f", $total_est_gsti ),
316
        total_est_gsti       => sprintf( "%.2f", $total_est_gsti ),
313
        currency             => $bookseller->{'listprice'},
317
#        currency             => $bookseller->{'listprice'},
318
	currency		=> $cur->{'currency'},
314
        qty_total            => $qty_total,
319
        qty_total            => $qty_total,
315
        GST                  => $gist,
320
        GST                  => $gist,
316
        basketgroups         => $basketgroups,
321
        basketgroups         => $basketgroups,
(-)a/acqui/neworderempty.pl (-3 / +4 lines)
Lines 203-210 my $count = scalar @rates; Link Here
203
my @loop_currency = ();
203
my @loop_currency = ();
204
for ( my $i = 0 ; $i < $count ; $i++ ) {
204
for ( my $i = 0 ; $i < $count ; $i++ ) {
205
    my %line;
205
    my %line;
206
    $line{currency} = $rates[$i]->{'currency'};
206
    $line{currcode} = $rates[$i]->{'currency'};
207
    $line{rate}     = $rates[$i]->{'rate'};
207
    $line{rate}     = $rates[$i]->{'rate'};
208
	$line{selected} = 1 if ($line{currcode} eq $data->{currency});
208
    push @loop_currency, \%line;
209
    push @loop_currency, \%line;
209
}
210
}
210
211
Lines 336-342 $template->param( Link Here
336
    name             => $bookseller->{'name'},
337
    name             => $bookseller->{'name'},
337
    cur_active_sym   => $cur->{'symbol'},
338
    cur_active_sym   => $cur->{'symbol'},
338
    cur_active       => $cur->{'currency'},
339
    cur_active       => $cur->{'currency'},
339
    currency         => $bookseller->{'listprice'} || $cur->{'currency'}, # eg: 'EUR'
340
#    currency         => $bookseller->{'listprice'} || $cur->{'currency'}, # eg: 'EUR'
340
    loop_currencies  => \@loop_currency,
341
    loop_currencies  => \@loop_currency,
341
    orderexists      => ( $new eq 'yes' ) ? 0 : 1,
342
    orderexists      => ( $new eq 'yes' ) ? 0 : 1,
342
    title            => $data->{'title'},
343
    title            => $data->{'title'},
Lines 348-354 $template->param( Link Here
348
    quantity         => $data->{'quantity'},
349
    quantity         => $data->{'quantity'},
349
    quantityrec      => $data->{'quantity'},
350
    quantityrec      => $data->{'quantity'},
350
    rrp              => $data->{'rrp'},
351
    rrp              => $data->{'rrp'},
351
    listprice        => sprintf("%.2f", $data->{'listprice'}||$listprice),
352
    listprice        => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice),
352
    total            => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ),
353
    total            => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ),
353
    ecost            => $data->{'ecost'},
354
    ecost            => $data->{'ecost'},
354
    notes            => $data->{'notes'},
355
    notes            => $data->{'notes'},
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js (-2 / +5 lines)
Lines 645-655 function calcNeworderTotal(){ Link Here
645
    var quantity = new Number(f.quantity.value);
645
    var quantity = new Number(f.quantity.value);
646
    var discount = new Number(f.discount.value);
646
    var discount = new Number(f.discount.value);
647
    var listinc  = new Number (f.listinc.value);
647
    var listinc  = new Number (f.listinc.value);
648
    var currency = f.currency.value;
648
    //var currency = f.currency.value;
649
    var applygst = new Number (f.applygst.value);
649
    var applygst = new Number (f.applygst.value);
650
    var listprice   =  new Number(f.listprice.value);
650
    var listprice   =  new Number(f.listprice.value);
651
    var invoiceingst =  new Number (f.invoiceincgst.value);
651
    var invoiceingst =  new Number (f.invoiceincgst.value);
652
    var exchangerate =  new Number(f.elements[currency].value);      //get exchange rate
652
//    var exchangerate =  new Number(f.elements[currency].value);      //get exchange rate
653
        var currcode = new String(document.getElementById('currency').value);
654
	var exchangerate =  new Number(document.getElementById(currcode).value);
655
653
    var gst_on=(!listinc && invoiceingst);
656
    var gst_on=(!listinc && invoiceingst);
654
657
655
    //do real stuff
658
    //do real stuff
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl (-5 / +15 lines)
Lines 127-133 ff.submit(); Link Here
127
        <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
127
        <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
128
        <input type="hidden" name="discount" value="<!-- TMPL_VAR NAME="discount" -->" />
128
        <input type="hidden" name="discount" value="<!-- TMPL_VAR NAME="discount" -->" />
129
        <input type="hidden" name="listinc" value="<!-- TMPL_VAR NAME="listincgst" -->" />
129
        <input type="hidden" name="listinc" value="<!-- TMPL_VAR NAME="listincgst" -->" />
130
        <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->" />
130
<!--        <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->" />-->
131
        <input type="hidden" name="applygst" value="<!-- TMPL_VAR NAME="gstreg" -->" />
131
        <input type="hidden" name="applygst" value="<!-- TMPL_VAR NAME="gstreg" -->" />
132
        <input type="hidden" name="invoiceincgst" value="<!-- TMPL_VAR NAME="invoiceincgst" -->" />
132
        <input type="hidden" name="invoiceincgst" value="<!-- TMPL_VAR NAME="invoiceincgst" -->" />
133
        <input type="hidden" name="gstrate" value="<!-- TMPL_VAR NAME="gstrate" -->" />
133
        <input type="hidden" name="gstrate" value="<!-- TMPL_VAR NAME="gstrate" -->" />
Lines 135-141 ff.submit(); Link Here
135
        <input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
135
        <input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
136
136
137
        <!-- TMPL_LOOP NAME="loop_currencies" -->
137
        <!-- TMPL_LOOP NAME="loop_currencies" -->
138
            <input type="hidden" name="<!-- TMPL_VAR NAME="currency" -->" value="<!-- TMPL_VAR NAME="rate" -->" />
138
            <input type="hidden" id="<!-- TMPL_VAR NAME="currcode" -->"  name="<!-- TMPL_VAR NAME="currcode" -->" value="<!-- TMPL_VAR NAME="rate" -->" />
139
        <!-- /TMPL_LOOP -->
139
        <!-- /TMPL_LOOP -->
140
        <ol><li>
140
        <ol><li>
141
            <!-- TMPL_IF name="biblionumber" -->
141
            <!-- TMPL_IF name="biblionumber" -->
Lines 263-276 ff.submit(); Link Here
263
                </select>
263
                </select>
264
                <!--/TMPL_IF-->
264
                <!--/TMPL_IF-->
265
            </li>
265
            </li>
266
		<li>
267
                <!-- TMPL_IF name="close" -->
268
			<span class="label">Currency: </span>
269
			<input type="hidden" size="10" name="currency" id="currency" value="<!-- TMPL_VAR NAME="currency" -->" /><!-- TMPL_VAR NAME="currency" -->
270
                <!-- TMPL_ELSE -->
271
			<label for="currency">Currency:</label>
272
			<select name="currency" id="currency" onchange="calcNeworderTotal();">
273
			<!-- TMPL_LOOP name="loop_currencies" -->
274
	                <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="currcode" -->" selected="selected"><!-- TMPL_VAR name="currcode" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="currcode" -->"><!-- TMPL_VAR name="currcode" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
275
			</select>
276
		<!-- /TMPL_IF-->
277
                </li>
266
            <li>
278
            <li>
267
                <!-- TMPL_IF name="close" -->
279
                <!-- TMPL_IF name="close" -->
268
            <span class="label">Vendor price: </span>
280
            <span class="label">Vendor price: </span>
269
                    <input type="hidden" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" /><!-- TMPL_VAR NAME="listprice" -->
281
                    <input type="hidden" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" /><!-- TMPL_VAR NAME="listprice" -->
270
                <!-- TMPL_ELSE -->
282
                <!-- TMPL_ELSE -->
271
                <label for="listprice">Vendor price: </label>
283
                <label for="listprice">Vendor price: </label>
272
                    <input type="text" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="calcNeworderTotal()" /> (entered as <!-- TMPL_VAR NAME="currency" -->)
284
                    <input type="text" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="calcNeworderTotal()" />
273
274
                <!--/TMPL_IF-->
285
                <!--/TMPL_IF-->
275
            </li>
286
            </li>
276
            <!-- TMPL_UNLESS NAME="close" -->
287
            <!-- TMPL_UNLESS NAME="close" -->
277
- 

Return to bug 5466