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

(-)a/acqui/basket.pl (-1 / +6 lines)
Lines 217-222 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;
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 209-216 my $count = scalar @rates; Link Here
209
my @loop_currency = ();
209
my @loop_currency = ();
210
for ( my $i = 0 ; $i < $count ; $i++ ) {
210
for ( my $i = 0 ; $i < $count ; $i++ ) {
211
    my %line;
211
    my %line;
212
    $line{currency} = $rates[$i]->{'currency'};
212
    $line{currcode} = $rates[$i]->{'currency'};
213
    $line{rate}     = $rates[$i]->{'rate'};
213
    $line{rate}     = $rates[$i]->{'rate'};
214
	$line{selected} = 1 if ($line{currcode} eq $data->{currency});
214
    push @loop_currency, \%line;
215
    push @loop_currency, \%line;
215
}
216
}
216
217
Lines 342-348 $template->param( Link Here
342
    name             => $bookseller->{'name'},
343
    name             => $bookseller->{'name'},
343
    cur_active_sym   => $cur->{'symbol'},
344
    cur_active_sym   => $cur->{'symbol'},
344
    cur_active       => $cur->{'currency'},
345
    cur_active       => $cur->{'currency'},
345
    currency         => $bookseller->{'listprice'} || $cur->{'currency'}, # eg: 'EUR'
346
#    currency         => $bookseller->{'listprice'} || $cur->{'currency'}, # eg: 'EUR'
346
    loop_currencies  => \@loop_currency,
347
    loop_currencies  => \@loop_currency,
347
    orderexists      => ( $new eq 'yes' ) ? 0 : 1,
348
    orderexists      => ( $new eq 'yes' ) ? 0 : 1,
348
    title            => $data->{'title'},
349
    title            => $data->{'title'},
Lines 354-360 $template->param( Link Here
354
    quantity         => $data->{'quantity'},
355
    quantity         => $data->{'quantity'},
355
    quantityrec      => $data->{'quantity'},
356
    quantityrec      => $data->{'quantity'},
356
    rrp              => $data->{'rrp'},
357
    rrp              => $data->{'rrp'},
357
    listprice        => sprintf("%.2f", $data->{'listprice'}||$listprice),
358
    listprice        => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice),
358
    total            => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ),
359
    total            => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ),
359
    ecost            => $data->{'ecost'},
360
    ecost            => $data->{'ecost'},
360
    notes            => $data->{'notes'},
361
    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 143-149 ff.submit(); Link Here
143
        <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
143
        <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
144
        <input type="hidden" name="discount" value="<!-- TMPL_VAR NAME="discount" -->" />
144
        <input type="hidden" name="discount" value="<!-- TMPL_VAR NAME="discount" -->" />
145
        <input type="hidden" name="listinc" value="<!-- TMPL_VAR NAME="listincgst" -->" />
145
        <input type="hidden" name="listinc" value="<!-- TMPL_VAR NAME="listincgst" -->" />
146
        <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->" />
146
<!--        <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->" />-->
147
        <input type="hidden" name="applygst" value="<!-- TMPL_VAR NAME="gstreg" -->" />
147
        <input type="hidden" name="applygst" value="<!-- TMPL_VAR NAME="gstreg" -->" />
148
        <input type="hidden" name="invoiceincgst" value="<!-- TMPL_VAR NAME="invoiceincgst" -->" />
148
        <input type="hidden" name="invoiceincgst" value="<!-- TMPL_VAR NAME="invoiceincgst" -->" />
149
        <input type="hidden" name="gstrate" value="<!-- TMPL_VAR NAME="gstrate" -->" />
149
        <input type="hidden" name="gstrate" value="<!-- TMPL_VAR NAME="gstrate" -->" />
Lines 151-157 ff.submit(); Link Here
151
        <input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
151
        <input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
152
152
153
        <!-- TMPL_LOOP NAME="loop_currencies" -->
153
        <!-- TMPL_LOOP NAME="loop_currencies" -->
154
            <input type="hidden" name="<!-- TMPL_VAR NAME="currency" -->" value="<!-- TMPL_VAR NAME="rate" -->" />
154
            <input type="hidden" id="<!-- TMPL_VAR NAME="currcode" -->"  name="<!-- TMPL_VAR NAME="currcode" -->" value="<!-- TMPL_VAR NAME="rate" -->" />
155
        <!-- /TMPL_LOOP -->
155
        <!-- /TMPL_LOOP -->
156
        <ol><li>
156
        <ol><li>
157
            <!-- TMPL_IF name="biblionumber" -->
157
            <!-- TMPL_IF name="biblionumber" -->
Lines 279-292 ff.submit(); Link Here
279
                </select>
279
                </select>
280
                <!--/TMPL_IF-->
280
                <!--/TMPL_IF-->
281
            </li>
281
            </li>
282
		<li>
283
                <!-- TMPL_IF name="close" -->
284
			<span class="label">Currency: </span>
285
			<input type="hidden" size="10" name="currency" id="currency" value="<!-- TMPL_VAR NAME="currency" -->" /><!-- TMPL_VAR NAME="currency" -->
286
                <!-- TMPL_ELSE -->
287
			<label for="currency">Currency:</label>
288
			<select name="currency" id="currency" onchange="calcNeworderTotal();">
289
			<!-- TMPL_LOOP name="loop_currencies" -->
290
	                <!-- 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 -->
291
			</select>
292
		<!-- /TMPL_IF-->
293
                </li>
282
            <li>
294
            <li>
283
                <!-- TMPL_IF name="close" -->
295
                <!-- TMPL_IF name="close" -->
284
            <span class="label">Vendor price: </span>
296
            <span class="label">Vendor price: </span>
285
                    <input type="hidden" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" /><!-- TMPL_VAR NAME="listprice" -->
297
                    <input type="hidden" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" /><!-- TMPL_VAR NAME="listprice" -->
286
                <!-- TMPL_ELSE -->
298
                <!-- TMPL_ELSE -->
287
                <label for="listprice">Vendor price: </label>
299
                <label for="listprice">Vendor price: </label>
288
                    <input type="text" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="calcNeworderTotal()" /> (entered as <!-- TMPL_VAR NAME="currency" -->)
300
                    <input type="text" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="calcNeworderTotal()" />
289
290
                <!--/TMPL_IF-->
301
                <!--/TMPL_IF-->
291
            </li>
302
            </li>
292
            <!-- TMPL_UNLESS NAME="close" -->
303
            <!-- TMPL_UNLESS NAME="close" -->
293
- 

Return to bug 5466