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

(-)a/C4/Budgets.pm (+24 lines)
Lines 34-39 BEGIN { Link Here
34
	@EXPORT = qw(
34
	@EXPORT = qw(
35
35
36
        &GetBudget
36
        &GetBudget
37
        &GetBudgetByCode
37
        &GetBudgets
38
        &GetBudgets
38
        &GetBudgetHierarchy
39
        &GetBudgetHierarchy
39
	    &AddBudget
40
	    &AddBudget
Lines 672-677 sub GetBudget { Link Here
672
    return $result;
673
    return $result;
673
}
674
}
674
675
676
=head2 GetBudgetByCode
677
678
    my $budget = &GetBudgetByCode($budget_code);
679
680
Retrieve all aqbudgets fields as a hashref for the budget that has
681
given budget_code
682
683
=cut
684
685
sub GetBudgetByCode {
686
    my ( $budget_code ) = @_;
687
688
    my $dbh = C4::Context->dbh;
689
    my $query = qq{
690
        SELECT *
691
        FROM aqbudgets
692
        WHERE budget_code = ?
693
    };
694
    my $sth = $dbh->prepare( $query );
695
    $sth->execute( $budget_code );
696
    return $sth->fetchrow_hashref;
697
}
698
675
=head2 GetChildBudgetsSpent
699
=head2 GetChildBudgetsSpent
676
700
677
  &GetChildBudgetsSpent($budget-id);
701
  &GetChildBudgetsSpent($budget-id);
(-)a/acqui/addorderiso2709.pl (-49 / +117 lines)
Lines 21-31 Link Here
21
# with Koha; if not, write to the Free Software Foundation, Inc.,
21
# with Koha; if not, write to the Free Software Foundation, Inc.,
22
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23
23
24
use strict;
24
use Modern::Perl;
25
use warnings;
26
use CGI;
25
use CGI;
27
use Carp;
26
use Carp;
28
use Number::Format qw(:all);
27
use Number::Format qw(:all);
28
use YAML qw/Load/;
29
29
30
use C4::Context;
30
use C4::Context;
31
use C4::Auth;
31
use C4::Auth;
Lines 56-62 my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({ Link Here
56
});
56
});
57
57
58
my $cgiparams = $input->Vars;
58
my $cgiparams = $input->Vars;
59
my $op = $cgiparams->{'op'};
59
my $op = $cgiparams->{'op'} || '';
60
my $booksellerid  = $input->param('booksellerid');
60
my $booksellerid  = $input->param('booksellerid');
61
my $bookseller = GetBookSellerFromId($booksellerid);
61
my $bookseller = GetBookSellerFromId($booksellerid);
62
my $data;
62
my $data;
Lines 65-71 $template->param(scriptname => "/cgi-bin/koha/acqui/addorderiso2709.pl", Link Here
65
                booksellerid => $booksellerid,
65
                booksellerid => $booksellerid,
66
                booksellername => $bookseller->{name},
66
                booksellername => $bookseller->{name},
67
                );
67
                );
68
my $ordernumber;
69
68
70
if ($cgiparams->{'import_batch_id'} && $op eq ""){
69
if ($cgiparams->{'import_batch_id'} && $op eq ""){
71
    $op = "batch_details";
70
    $op = "batch_details";
Lines 124-130 if ($op eq ""){ Link Here
124
                     loop_currencies  => \@loop_currency,
123
                     loop_currencies  => \@loop_currency,
125
                     );
124
                     );
126
    import_biblios_list($template, $cgiparams->{'import_batch_id'});
125
    import_biblios_list($template, $cgiparams->{'import_batch_id'});
127
    if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber ) {
126
    if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
128
        # prepare empty item form
127
        # prepare empty item form
129
        my $cell = PrepareItemrecordDisplay( '', '', '', 'ACQ' );
128
        my $cell = PrepareItemrecordDisplay( '', '', '', 'ACQ' );
130
129
Lines 157-175 if ($op eq ""){ Link Here
157
    # retrieve the file you want to import
156
    # retrieve the file you want to import
158
    my $import_batch_id = $cgiparams->{'import_batch_id'};
157
    my $import_batch_id = $cgiparams->{'import_batch_id'};
159
    my $biblios = GetImportRecordsRange($import_batch_id);
158
    my $biblios = GetImportRecordsRange($import_batch_id);
159
    my @import_record_id_selected = $input->param("import_record_id");
160
    my @quantities = $input->param('quantity');
161
    my @prices = $input->param('price');
162
    my @budgets_id = $input->param('budget_id');
163
    my @rrp = $input->param('rrp');
164
    my @discount = $input->param('discount');
165
    my @sort1 = $input->param('sort1');
166
    my @sort2 = $input->param('sort2');
167
    my $cur = GetCurrency();
160
    for my $biblio (@$biblios){
168
    for my $biblio (@$biblios){
161
        # 1st insert the biblio, or find it through matcher
169
        # Check if this import_record_id was selected
170
        next if not grep { $_ eq $$biblio{import_record_id} } @import_record_id_selected;
162
        my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} );
171
        my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} );
163
        my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information";
172
        my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information";
164
        my $match = GetImportRecordMatches( $biblio->{'import_record_id'}, 1 );
173
        my $match = GetImportRecordMatches( $biblio->{'import_record_id'}, 1 );
165
        my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0;
174
        my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0;
175
        my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1;
176
        my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id;
177
        my $c_rrp = shift( @rrp ); # rrp include tax
178
        my $c_discount = shift ( @discount);
179
        $c_discount = $c_discount / 100 if $c_discount > 100;
180
        my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || '';
181
        my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || '';
166
182
183
        # 1st insert the biblio, or find it through matcher
167
        unless ( $biblionumber ) {
184
        unless ( $biblionumber ) {
168
            # add the biblio
185
            # add the biblio
169
            my $bibitemnum;
186
            my $bibitemnum;
170
187
171
            # remove ISBN -
188
            # remove ISBN -
172
            my ( $isbnfield, $isbnsubfield ) = GetMarcFromKohaField( 'biblioitems.isbn', '' );                
189
            my ( $isbnfield, $isbnsubfield ) = GetMarcFromKohaField( 'biblioitems.isbn', '' );
173
            if ( $marcrecord->field($isbnfield) ) {
190
            if ( $marcrecord->field($isbnfield) ) {
174
                foreach my $field ( $marcrecord->field($isbnfield) ) {
191
                foreach my $field ( $marcrecord->field($isbnfield) ) {
175
                    foreach my $subfield ( $field->subfield($isbnsubfield) ) {
192
                    foreach my $subfield ( $field->subfield($isbnsubfield) ) {
Lines 180-186 if ($op eq ""){ Link Here
180
                }
197
                }
181
            }
198
            }
182
            ( $biblionumber, $bibitemnum ) = AddBiblio( $marcrecord, $cgiparams->{'frameworkcode'} || '' );
199
            ( $biblionumber, $bibitemnum ) = AddBiblio( $marcrecord, $cgiparams->{'frameworkcode'} || '' );
183
            SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' );
184
            # 2nd add authorities if applicable
200
            # 2nd add authorities if applicable
185
            if (C4::Context->preference("BiblioAddsAuthorities")){
201
            if (C4::Context->preference("BiblioAddsAuthorities")){
186
                my $headings_linked =BiblioAutoLink($marcrecord, $cgiparams->{'frameworkcode'});
202
                my $headings_linked =BiblioAutoLink($marcrecord, $cgiparams->{'frameworkcode'});
Lines 194-240 if ($op eq ""){ Link Here
194
        # get quantity in the MARC record (1 if none)
210
        # get quantity in the MARC record (1 if none)
195
        my $quantity = GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour')) || 1;
211
        my $quantity = GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour')) || 1;
196
        my %orderinfo = (
212
        my %orderinfo = (
197
            "biblionumber", $biblionumber, "basketno", $cgiparams->{'basketno'},
213
            biblionumber => $biblionumber,
198
            "quantity", $quantity, "branchcode", $branch, 
214
            basketno => $cgiparams->{'basketno'},
199
            "budget_id", $budget_id, "uncertainprice", 1,
215
            quantity => $c_quantity,
200
            "sort1", $cgiparams->{'sort1'},"sort2", $cgiparams->{'sort2'},
216
            branchcode => $patron->{branchcode},
201
            "notes", $cgiparams->{'notes'}, "budget_id", $cgiparams->{'budget_id'},
217
            budget_id => $c_budget_id,
202
            "currency",$cgiparams->{'currency'},
218
            uncertainprice => 1,
219
            sort1 => $c_sort1,
220
            sort2 => $c_sort2,
221
            notes => $cgiparams->{'all_notes'},
222
            currency => $cgiparams->{'all_currency'},
203
        );
223
        );
204
224
        # get the price if there is one.
205
        my $price = GetMarcPrice($marcrecord, C4::Context->preference('marcflavour'));
225
        my $price= shift( @prices ) || GetMarcPrice($marcrecord, C4::Context->preference('marcflavour'));
206
207
        if ($price){
226
        if ($price){
208
            eval {
227
            # in France, the cents separator is the , but sometimes, ppl use a .
209
		require C4::Acquisition;
228
            # in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation
210
		import C4::Acquisition qw/GetBasket/;
229
            $price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
211
	    };
230
            $price = $num->unformat_number($price);
212
	    if ($@){
213
		croak $@;
214
	    }
215
            eval {
216
		require C4::Bookseller;
217
	        import C4::Bookseller qw/GetBookSellerFromId/;
218
	    };
219
	    if ($@){
220
		croak $@;
221
	    }
222
            my $basket     = GetBasket( $orderinfo{basketno} );
223
            my $bookseller = GetBookSellerFromId( $basket->{booksellerid} );
224
            $orderinfo{gstrate} = $bookseller->{gstrate};
231
            $orderinfo{gstrate} = $bookseller->{gstrate};
225
            $orderinfo{rrp}   = $price;
232
            my $c = $c_discount ? $c_discount / 100 : $bookseller->{discount} / 100;
226
            $orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $bookseller->{discount} / 100 );
233
            if ( $bookseller->{listincgst} ) {
227
            $orderinfo{listprice} = $orderinfo{rrp};
234
                if ( $c_discount ) {
235
                    $orderinfo{ecost} = $price;
236
                    $orderinfo{rrp}   = $orderinfo{ecost} / ( 1 - $c );
237
                } else {
238
                    $orderinfo{ecost} = $price * ( 1 - $c );
239
                    $orderinfo{rrp}   = $price;
240
                }
241
            } else {
242
                if ( $c_discount ) {
243
                    $orderinfo{ecost} = $price / ( 1 + $orderinfo{gstrate} );
244
                    $orderinfo{rrp}   = $orderinfo{ecost} / ( 1 - $c );
245
                } else {
246
                    $orderinfo{rrp}   = $price / ( 1 + $orderinfo{gstrate} );
247
                    $orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c );
248
                }
249
            }
250
            $orderinfo{listprice} = $orderinfo{rrp} / $cur->{rate};
228
            $orderinfo{unitprice} = $orderinfo{ecost};
251
            $orderinfo{unitprice} = $orderinfo{ecost};
229
            $orderinfo{total} = $orderinfo{ecost};
252
            $orderinfo{total} = $orderinfo{ecost} * $c_quantity;
230
        } else {
253
        } else {
231
            $orderinfo{'listprice'} = 0;
254
            $orderinfo{listprice} = 0;
232
        }
255
        }
233
256
234
        # remove uncertainprice flag if we have found a price in the MARC record
257
        # remove uncertainprice flag if we have found a price in the MARC record
235
        $orderinfo{uncertainprice} = 0 if $orderinfo{listprice};
258
        $orderinfo{uncertainprice} = 0 if $orderinfo{listprice};
236
        my $basketno;
259
        my ( $basketno, $ordernumber ) = NewOrder( \%orderinfo );
237
        ( $basketno, $ordernumber ) = NewOrder( \%orderinfo );
238
260
239
        # 4th, add items if applicable
261
        # 4th, add items if applicable
240
        # parse the item sent by the form, and create an item just for the import_record_id we are dealing with
262
        # parse the item sent by the form, and create an item just for the import_record_id we are dealing with
Lines 254-265 if ($op eq ""){ Link Here
254
            push @{ $item->{indicator} },    $indicator[0];
276
            push @{ $item->{indicator} },    $indicator[0];
255
            my $xml = TransformHtmlToXml( \@tags, \@subfields, \@field_values, \@ind_tag, \@indicator );
277
            my $xml = TransformHtmlToXml( \@tags, \@subfields, \@field_values, \@ind_tag, \@indicator );
256
            my $record = MARC::Record::new_from_xml( $xml, 'UTF-8' );
278
            my $record = MARC::Record::new_from_xml( $xml, 'UTF-8' );
257
            for (my $qtyloop=1;$qtyloop <=$quantity;$qtyloop++) {
279
            for (my $qtyloop=1;$qtyloop <= $c_quantity;$qtyloop++) {
258
                my ( $biblionumber, $bibitemnum, $itemnumber ) = AddItemFromMarc( $record, $biblionumber );
280
                my ( $biblionumber, $bibitemnum, $itemnumber ) = AddItemFromMarc( $record, $biblionumber );
259
                NewOrderItem( $itemnumber, $ordernumber );
281
                NewOrderItem( $itemnumber, $ordernumber );
260
            }
282
            }
261
        } else {
262
            SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' );
263
        }
283
        }
264
    }
284
    }
265
    # go to basket page
285
    # go to basket page
Lines 276-283 my $budget = GetBudget($budget_id); Link Here
276
296
277
# build budget list
297
# build budget list
278
my $budget_loop = [];
298
my $budget_loop = [];
279
$budgets = GetBudgetHierarchy;
299
my $budgets_hierarchy = GetBudgetHierarchy;
280
foreach my $r ( @{$budgets} ) {
300
foreach my $r ( @{$budgets_hierarchy} ) {
281
    next unless (CanUserUseBudget($borrower, $r, $userflags));
301
    next unless (CanUserUseBudget($borrower, $r, $userflags));
282
    if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) {
302
    if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) {
283
        next;
303
        next;
Lines 285-290 foreach my $r ( @{$budgets} ) { Link Here
285
    push @{$budget_loop},
305
    push @{$budget_loop},
286
      { b_id  => $r->{budget_id},
306
      { b_id  => $r->{budget_id},
287
        b_txt => $r->{budget_name},
307
        b_txt => $r->{budget_name},
308
        b_sort1_authcat => $r->{'sort1_authcat'},
309
        b_sort2_authcat => $r->{'sort2_authcat'},
288
        b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0,
310
        b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0,
289
      };
311
      };
290
}
312
}
Lines 296-302 if ($budget) { # its a mod .. Link Here
296
        $CGIsort1 = GetAuthvalueDropbox(  $budget->{'sort1_authcat'}, $data->{'sort1'} );
318
        $CGIsort1 = GetAuthvalueDropbox(  $budget->{'sort1_authcat'}, $data->{'sort1'} );
297
    }
319
    }
298
} elsif ( scalar(@$budgets) ) {
320
} elsif ( scalar(@$budgets) ) {
299
    $CGIsort1 = GetAuthvalueDropbox(  @$budgets[0]->{'sort1_authcat'}, '' );
321
} elsif ( scalar(@$budgets_hierarchy) ) {
322
    $CGIsort1 = GetAuthvalueDropbox( @$budgets_hierarchy[0]->{'sort1_authcat'}, '' );
300
}
323
}
301
# if CGIsort is successfully fetched, the use it
324
# if CGIsort is successfully fetched, the use it
302
# else - failback to plain input-field
325
# else - failback to plain input-field
Lines 311-318 if ($budget) { Link Here
311
    if ( defined $budget->{'sort2_authcat'} ) {
334
    if ( defined $budget->{'sort2_authcat'} ) {
312
        $CGIsort2 = GetAuthvalueDropbox(  $budget->{'sort2_authcat'}, $data->{'sort2'} );
335
        $CGIsort2 = GetAuthvalueDropbox(  $budget->{'sort2_authcat'}, $data->{'sort2'} );
313
    }
336
    }
314
} elsif ( scalar(@$budgets) ) {
337
} elsif ( scalar(@$budgets_hierarchy) ) {
315
    $CGIsort2 = GetAuthvalueDropbox(  @$budgets[0]->{sort2_authcat}, '' );
338
    $CGIsort2 = GetAuthvalueDropbox( @$budgets_hierarchy[0]->{sort2_authcat}, '' );
316
}
339
}
317
if ($CGIsort2) {
340
if ($CGIsort2) {
318
    $template->param( CGIsort2 => $CGIsort2 );
341
    $template->param( CGIsort2 => $CGIsort2 );
Lines 378-386 sub import_biblios_list { Link Here
378
            record_sequence => $biblio->{'record_sequence'},
401
            record_sequence => $biblio->{'record_sequence'},
379
            overlay_status => $biblio->{'overlay_status'},
402
            overlay_status => $biblio->{'overlay_status'},
380
            match_biblionumber => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0,
403
            match_biblionumber => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0,
381
            match_citation => $#$match > -1 ? $match->[0]->{'title'} . ' ' . $match->[0]->{'author'} : '',
404
            match_citation     => $#$match > -1 ? $match->[0]->{'title'} || '' . ' ' . $match->[0]->{'author'} || '': '',
382
            match_score => $#$match > -1 ? $match->[0]->{'score'} : 0,
405
            match_score => $#$match > -1 ? $match->[0]->{'score'} : 0,
383
        );
406
        );
407
        my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} );
408
        my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information";
409
        my $infos = get_infos_syspref($marcrecord, ['price', 'quantity', 'budget_code', 'rrp', 'discount', 'sort1', 'sort2']);
410
        my $price = $infos->{price};
411
        my $quantity = $infos->{quantity};
412
        my $budget_code = $infos->{budget_code};
413
        my $rrp = $infos->{rrp};
414
        my $discount = $infos->{discount};
415
        my $sort1 = $infos->{sort1};
416
        my $sort2 = $infos->{sort2};
417
        my $budget_id;
418
        if($budget_code) {
419
            my $biblio_budget = GetBudgetByCode($budget_code);
420
            if($biblio_budget) {
421
                $budget_id = $biblio_budget->{budget_id};
422
            }
423
        }
424
        $cellrecord{price} = $price || '';
425
        $cellrecord{quantity} = $quantity || '';
426
        $cellrecord{budget_id} = $budget_id || '';
427
        $cellrecord{rrp} = $rrp || '';
428
        $cellrecord{discount} = $discount || '';
429
        $cellrecord{sort1} = $sort1 || '';
430
        $cellrecord{sort2} = $sort2 || '';
431
384
        push @list, \%cellrecord;
432
        push @list, \%cellrecord;
385
    }
433
    }
386
    my $num_biblios = $batch->{'num_biblios'};
434
    my $num_biblios = $batch->{'num_biblios'};
Lines 440-442 sub add_matcher_list { Link Here
440
    }
488
    }
441
    $template->param(available_matchers => \@matchers);
489
    $template->param(available_matchers => \@matchers);
442
}
490
}
491
492
sub get_infos_syspref {
493
    my ($record, $field_list) = @_;
494
    my $syspref = C4::Context->preference('MarcFieldsToOrder');
495
    my $yaml = YAML::Load($syspref);
496
    my $r;
497
    for my $field_name ( @$field_list ) {
498
        my @fields = split /\|/, $yaml->{$field_name};
499
        for my $field ( @fields ) {
500
            my ( $f, $sf ) = split /\$/, $field;
501
            next unless $f and $sf;
502
            if ( my $v = $record->subfield( $f, $sf ) ) {
503
                $r->{$field_name} = $v;
504
            }
505
            last if $yaml->{$field};
506
        }
507
    }
508
    return $r;
509
}
510
(-)a/acqui/ajax-getauthvaluedropbox.pl (+73 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2012 BibLibre
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
=head1 NAME
21
22
ajax-getauthvaluedropbox.pl - returns an authorised values dropbox
23
24
=head1 DESCRIPTION
25
26
this script returns an authorised values dropbox
27
28
=head1 CGI PARAMETERS
29
30
=over 4
31
32
=item name
33
34
The name of the dropbox.
35
36
=item category
37
38
The category of authorised values.
39
40
=item default
41
42
Default value for the dropbox.
43
44
=back
45
46
=cut
47
48
use Modern::Perl;
49
50
use CGI;
51
use C4::Budgets;
52
use C4::Charset;
53
54
my $input = new CGI;
55
my $name = $input->param('name');
56
my $category = $input->param('category');
57
my $default = $input->param('default');
58
$default = C4::Charset::NormalizeString($default);
59
60
binmode STDOUT, ':encoding(UTF-8)';
61
print $input->header(-type => 'text/plain', -charset => 'UTF-8');
62
my $avs = GetAuthvalueDropbox($category, $default);
63
my $html = qq|<select id="$name", name="$name">|;
64
for my $av ( @$avs ) {
65
    if ( $av->{default} ) {
66
        $html .= qq|<option value="$av->{value}" selected="selected">$av->{label}</option>|;
67
    } else {
68
        $html .= qq|<option value="$av->{value}">$av->{label}</option>|;
69
    }
70
}
71
$html .= qq|</select>|;
72
73
print $html;
(-)a/installer/data/mysql/updatedatabase.pl (+12 lines)
Lines 7036-7041 if ( CheckVersion($DBversion) ) { Link Here
7036
    SetVersion($DBversion);
7036
    SetVersion($DBversion);
7037
}
7037
}
7038
7038
7039
7040
7041
7042
7043
7044
$DBversion = "3.13.00.XXX";
7045
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
7046
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MarcFieldsToOrder','','Set the mapping values for a new order line created from a marcrecord (staged file). In a YAML format.', NULL, 'textarea')");
7047
   print "Upgrade to $DBversion done (Bug 7180: Added MarcFieldsToOrder syspref)\n";
7048
   SetVersion ($DBversion);
7049
}
7050
7039
=head1 FUNCTIONS
7051
=head1 FUNCTIONS
7040
7052
7041
=head2 TableExists($table)
7053
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (+1 lines)
Lines 2582-2584 fieldset.rows table.mceListBox { Link Here
2582
    -webkit-box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5);
2582
    -webkit-box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5);
2583
    box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5);
2583
    box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5);
2584
}
2584
}
2585
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js (-75 / +20 lines)
Lines 679-762 function calcNewsuggTotal(){ Link Here
679
    return true;
679
    return true;
680
}
680
}
681
681
682
682
function getAuthValueDropbox( name, cat, destination, selected ) {
683
// ----------------------------------------
683
    if (cat == null || cat == "") {
684
//USED BY NEWORDEREMPTY.PL
684
        $(destination).replaceWith(' <input type="text" name="' + name + '" />' );
685
/*
686
function fetchSortDropbox(f) {
687
    var  budgetId=f.budget_id.value;
688
    var handleSuccess = function(o){
689
        if(o.responseText !== undefined){
690
            sort_dropbox.innerHTML   = o.responseText;
691
        }
692
    }
693
694
    var callback = {   success:handleSuccess };
695
    var sUrl = '../acqui/fetch_sort_dropbox.pl?sort=1&budget_id='+budgetId
696
    var sort_dropbox = document.getElementById('sort1');
697
    var request1 = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
698
    var rr = '00';
699
700
// FIXME: ---------  twice , coz the 2 requests get mixed up otherwise
701
702
    var handleSuccess2 = function(o){
703
    if(o.responseText !== undefined){
704
        sort2_dropbox.innerHTML   = o.responseText;
705
        }
706
    }
707
708
    var callback2 = {   success:handleSuccess };
709
    var sUrl2 = '../acqui/fetch_sort_dropbox.pl?sort=2&budget_id='+budgetId;
710
    var sort2_dropbox = document.getElementById('sort2');
711
    var request2 = YAHOO.util.Connect.asyncRequest('GET', sUrl2, callback2);
712
713
}
714
*/
715
716
717
718
//USED BY NEWORDEREMPTY.PL
719
function fetchSortDropbox(f) {
720
    var  budgetId=f.budget_id.value;
721
722
for (i=1;i<=2;i++) {
723
724
    var sort_zone = document.getElementById('sort'+i+'_zone');
725
    var url = '../acqui/fetch_sort_dropbox.pl?sort='+i+'&budget_id='+budgetId;
726
727
    var xmlhttp = null;
728
    xmlhttp = new XMLHttpRequest();
729
    if ( typeof xmlhttp.overrideMimeType != 'undefined') {
730
        xmlhttp.overrideMimeType('text/xml');
731
    }
732
733
    xmlhttp.open('GET', url, false);
734
    xmlhttp.send(null);
735
736
    xmlhttp.onreadystatechange = function() {
737
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
738
    // stupid JS...
739
        } else {
740
    // wait for the call to complete
741
        }
742
    };
743
    // rc =  eval ( xmlhttp.responseText );
744
    var retRootType = xmlhttp.responseXML.firstChild.nodeName;
745
    var existingInputs = sort_zone.getElementsByTagName('input');
746
    if (existingInputs.length > 0 && retRootType == 'input') {
747
        // when sort is already an input, do not override to preseve value
748
        return;
685
        return;
749
    }
686
    }
750
    sort_zone.innerHTML = xmlhttp.responseText;
687
    $.ajax({
751
}
688
        url: "/cgi-bin/koha/acqui/ajax-getauthvaluedropbox.pl",
689
        data: {
690
            name: name,
691
            category: cat,
692
            default: selected
693
        },
694
        async: false,
695
        success: function(data){
696
            if(data === "0"){
697
                $(destination).replaceWith(' <input type="text" name="' + name + '" />' );
698
            }else{
699
                $(destination).replaceWith(data);
700
            }
701
        }
702
    });
752
}
703
}
753
704
754
755
756
757
758
759
760
//USED BY NEWORDEREMPTY.PL
705
//USED BY NEWORDEREMPTY.PL
761
function totalExceedsBudget(budgetId, total) {
706
function totalExceedsBudget(budgetId, total) {
762
707
Lines 891-894 function hideAllColumns(){ Link Here
891
    $("#selections span").removeClass("selected");
836
    $("#selections span").removeClass("selected");
892
    $("#plan td:nth-child(2),#plan th:nth-child(2)").nextUntil("th:nth-child("+(allCols-1)+"),td:nth-child("+(allCols-1)+")").hide(); // hide all but the last two columns
837
    $("#plan td:nth-child(2),#plan th:nth-child(2)").nextUntil("th:nth-child("+(allCols-1)+"),td:nth-child("+(allCols-1)+")").hide(); // hide all but the last two columns
893
    $("#hideall").attr("checked","checked").parent().addClass("selected");
838
    $("#hideall").attr("checked","checked").parent().addClass("selected");
894
}
839
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt (-187 / +273 lines)
Lines 12-17 Link Here
12
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
12
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
13
[% INCLUDE 'datatables-strings.inc' %]
13
[% INCLUDE 'datatables-strings.inc' %]
14
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
14
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
15
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
15
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
16
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
16
<script type="text/JavaScript">
17
<script type="text/JavaScript">
17
//<![CDATA[
18
//<![CDATA[
Lines 25-31 Link Here
25
            ],
26
            ],
26
            "sPaginationType": "four_button"
27
            "sPaginationType": "four_button"
27
        } ) );
28
        } ) );
29
30
        $("select[name='budget_id']").change(function(){
31
            var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
32
            var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
33
            var destination_sort1 = $(this).siblings('span.sort1').find('input[name="sort1"]');
34
            var sort1 = $(destination_sort1).val();
35
            if ( destination_sort1.length < 1 ) {
36
                destination_sort1 = $(this).siblings('span.sort1').find('select[name="sort1"]');
37
            }
38
            var destination_sort2 = $(this).siblings('span.sort2').find('input[name="sort2"]');
39
            var sort2 = $(destination_sort2).val();
40
            if ( destination_sort2.length < 1 ) {
41
                destination_sort2 = $(this).siblings('span.sort2').find('select[name="sort2"]');
42
            }
43
            getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
44
45
            getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
46
        } );
47
48
        $("select[name='budget_id']").change();
49
50
        $("select[name='all_budget_id']").change(function(){
51
            var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
52
            var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
53
            var destination_sort1 = $(this).parent().siblings('li').find('input[name="all_sort1"]');
54
            if ( destination_sort1.length < 1 ) {
55
                destination_sort1 = $(this).parent().siblings('li').find('select[name="all_sort1"]');
56
            }
57
            var destination_sort2 = $(this).parent().siblings('li').find('input[name="all_sort2"]');
58
            if ( destination_sort2.length < 1 ) {
59
                destination_sort2 = $(this).parent().siblings('li').find('select[name="all_sort2"]');
60
            }
61
            getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1 );
62
            getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2 );
63
            $(this).parent().siblings('li').find('select[name="sort1"]').attr('name', 'all_sort1');
64
            $(this).parent().siblings('li').find('input[name="sort1"]').attr('name', 'all_sort1');
65
            $(this).parent().siblings('li').find('select[name="sort2"]').attr('name', 'all_sort2');
66
            $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2');
67
        } );
68
69
        $('input:checkbox[name="import_record_id"]').change(function(){
70
            if ( $(this).is(':checked') ) {
71
                $(this).parent().addClass("selected");
72
                $(this).parent().removeClass("unselected");
73
            } else {
74
                $(this).parent().addClass("unselected");
75
                $(this).parent().removeClass("selected");
76
            }
77
        } );
78
79
        $("input:checkbox").attr("checked", false);
80
        $("div.biblio.unselected select").attr("disabled", false);
81
        $("div.biblio.unselected input").attr("disabled", false);
82
83
        $("#checkAll").click(function(){
84
            $("#Aform").checkCheckboxes();
85
            $("input:checkbox[name='import_record_id']").change();
86
            return false;
87
        });
88
        $("#unCheckAll").click(function(){
89
            $("#Aform").unCheckCheckboxes();
90
            $("input:checkbox[name='import_record_id']").change();
91
            return false;
92
        });
93
28
    });
94
    });
95
96
    function disableUnchecked(form){
97
        $("div.biblio.unselected").each(function(){
98
            $(this).find('select').attr('disabled', 'disabled');
99
            $(this).find('input').attr('disabled', 'disabled');
100
        });
101
        form.submit();
102
    }
29
//]]>
103
//]]>
30
</script>
104
</script>
31
</head>
105
</head>
Lines 38-241 Link Here
38
       <div id="yui-main">
112
       <div id="yui-main">
39
           <div class="yui-b">
113
           <div class="yui-b">
40
             [% IF ( batch_details ) %]
114
             [% IF ( batch_details ) %]
41
                  <h1>Add orders from [% comments %]
115
                <h1>Add orders from [% comments %]
42
                    ([% file_name %] staged on [% upload_timestamp %])
116
                    ([% file_name %] staged on [% upload_timestamp %])
43
                  </h1>
117
                </h1>
44
               <div>
118
                <div>
45
                   <form action="[% scriptname %]" method="post" name="import_biblios">
119
                    <span class="checkall"><a id="checkAll" href="#">Check All</a></span>
46
                     <table>
120
                    <span class="uncheckall"><a id="unCheckAll" href="#">Uncheck All</a></span>
47
                     <tr>
121
                    <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform" onsubmit="disableUnchecked(this); return false;">
48
                         <th>Citation</th>
122
                        <input type="hidden" name="op" value="import_records"/>
49
                         <th>Match?</th>
123
                        <input type="hidden" name="basketno" value="[% basketno %]" />
50
                         <th>Order</th>
124
                        <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
51
                       </tr>
125
                        <input type="hidden" name="import_batch_id" value="[%import_batch_id %]" />
52
                       [% FOREACH biblio_lis IN biblio_list %]
126
                        <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
53
                         <tr>
54
                             <td>
55
                                [% biblio_lis.citation %]
56
57
                             </td>
58
                             <td>[% biblio_lis.overlay_status %]</td>
59
                             <td><a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]&amp;breedingid=[% biblio_lis.import_record_id %]&amp;import_batch_id=[% biblio_lis.import_batch_id %]&amp;biblionumber=[% biblio_lis.match_biblionumber %]">Add order</a></td>
60
                         </tr>
61
     [% IF ( biblio_lis.match_biblionumber ) %]
62
    <tr>
63
      <td class="highlight" colspan="3">&nbsp;&nbsp;&nbsp;Matches biblio [% biblio_lis.match_biblionumber %] (score = [% biblio_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_lis.match_biblionumber %]">[% biblio_lis.match_citation %]</a></td>
64
    </tr>
65
    [% END %]
66
                      [% END %]
67
                     </table>
68
                   </form>
69
               </div>
70
              [% IF ( pages ) %]
71
                <div class="pages">
72
                Page 
73
                  [% FOREACH page IN pages %]
74
                    [% IF ( page.current_page ) %]
75
                      <span class="current">[% page.page_number %]</span>
76
                    [% ELSE %]
77
                      <a class="nav" href="[% page.script_name %]?import_batch_id=[% page.import_batch_id %]&amp;offset=[% page.offset %]">[% page.page_number %]</a>
78
                    [% END %]
79
                  [% END %]
80
              [% END %]
81
             [% ELSE %]
82
               <div>
83
                <h1>Choose the file to add to the basket</h1>
84
                   <table id="files">
85
                     <thead>
86
                     <tr>
87
                       <th>File name</th>
88
                       <th>Comments</th>
89
                       <th>Status</th>
90
                       <th>Staged</th>
91
                       <th># Bibs</th>
92
                       <th>&nbsp;</th>
93
                     </tr>
94
                     </thead>
95
                     <tbody>
96
                     [% FOREACH batch_lis IN batch_list %]
97
                     <tr>
98
                        <td>[% batch_lis.file_name %]</td>
99
                       <td>[% batch_lis.comments %]</td>
100
                       <td>[% batch_lis.import_status %]</td>
101
                       <td>[% batch_lis.staged_date | $KohaDates %] [% batch_lis.staged_hour %]</td>
102
                       <td>[% batch_lis.num_biblios %]</td>
103
                       <td><a href="[% batch_lis.scriptname %]?import_batch_id=[% batch_lis.import_batch_id %]&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]">Add orders</a></td>
104
                     </tr>
105
                     [% END %]
106
                     </tbody>
107
                   </table>
108
               </div>
109
             [% END %]
110
           </div>
111
        [% IF ( import_batch_id ) %]
112
            <div class="yui-b">
113
            <h2>Import All</h2>
114
            <p>Import all the lines in the basket with the following parameters:</p>
115
            <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform">
116
                    <input type="hidden" name="op" value="import_records"/>
117
                    <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
118
                    <input type="hidden" name="basketno" value="[% basketno %]" />
119
                    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
120
                    <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
121
122
                    [% FOREACH loop_currencie IN loop_currencies %]
123
                        <input type="hidden" name="[% loop_currencie.currency %]" value="[% loop_currencie.rate %]" />
124
                    [% END %]
125
126
                [% IF ( items ) %]
127
                <fieldset class="rows">
128
                    <legend>Item</legend>
129
                    [% IF ( NoACQframework ) %]
130
                        <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
131
                    [% END %]
132
133
                    [% FOREACH item IN items %]
134
                    <div id="outeritemblock">
135
                    <div id="itemblock">
136
                        <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
137
                            <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
138
127
139
                                <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
128
                        [% FOREACH cur IN loop_currencies %]
140
                                [% iteminformatio.marc_value %]
129
                            <input type="hidden" name="[% cur.currency %]" value="[% cur.rate %]" />
141
                                <input type="hidden" name="itemid" value="1" />
142
                                <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
143
                                <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
144
                                <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
145
                                <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
146
                            </div></li>
147
                        [% END %]
130
                        [% END %]
148
                        </ol>
149
                    </div><!-- /iteminformation -->
150
                    </div>
151
131
152
                    [% END %] <!-- /items -->
132
                        [% FOREACH biblio IN biblio_list %]
153
                </fieldset>
133
                        <div class="biblio unselected" style="border-radius: 5px 5px; -moz-border-radius: 5px; padding: 5px; margin:5px; border-style : solid; border-color : grey; border-width:1px;">
154
                [% END %] <!-- items -->
134
                            <input type="checkbox" name="import_record_id" id="record_[% biblio.import_record_id %]" value="[% biblio.import_record_id %]" />
155
                <fieldset class="rows">
135
                            <input type="hidden" value="[% biblio.rrp %]" name="rrp" />
156
                    <legend>Accounting details</legend>
136
                            <label for="record_[% biblio.import_record_id %]"><span class="citation" style="font-weight:bold;">[% biblio.citation %]</span></label>
157
                    <ol>
137
                            <span class="match" style="display:block;">[% biblio.overlay_status %]</span>
158
                        <li>
138
                            [% IF ( biblio.match_biblionumber ) %]
159
                            <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
139
                                Matches biblio [% biblio.match_biblionumber %] (score = [% biblio.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.match_biblionumber %]">[% biblio.match_citation %]</a>
160
                            <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
140
                            [% END %]
161
                        </li>
141
                            <span class="quantity" style="display:block;">
162
                        <li>
142
                                Quantity: <input type="text" value="[% biblio.quantity %]" name="quantity" />
163
                            [% IF ( close ) %]
143
                            </span>
164
                        <span class="label">Budget: </span>
144
                            <span class="price" style="display:block;">
165
                                <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
145
                                Price: <input type="text" value="[% biblio.price %]" name="price" />
166
                            [% ELSE %]
146
                            </span>
167
                            <li>
147
                            <span class="discount" style="display:block;">
168
                            <label for="currency">Currency:</label>
148
                                Discount: <input type="text" value="[% biblio.discount %]" name="discount" />
169
                            <select name="currency" id="currency">
149
                            </span>
170
                            [% FOREACH loop_currencie IN loop_currencies %]
150
                            <span class="budget" style="display:block;">
171
                                    [% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
151
                                [% IF ( close ) %]
172
                            </select>
152
                                <span class="label">Budget: </span>
173
                            </li>
153
                                    <input type="hidden" size="20" name="budget_id" value="[% budget_id %]" />[% Budget_name %]
174
                            <li>
175
                            <label for="budget_id">Budget: </label>
176
                            <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id">
177
                            [% FOREACH budget_loo IN budget_loop %]
178
                                [% IF ( budget_loo.b_sel ) %]
179
                                    <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
180
                                [% ELSE %]
154
                                [% ELSE %]
181
                                    <option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
155
                                <label for="budget_id">Budget: </label>
156
                                <select size="1" name="budget_id">
157
                                    <option value=""></option>
158
                                    [% FOREACH budget IN budget_loop %]
159
                                        [% IF ( budget.b_id == biblio.budget_id ) %]
160
                                            <option value="[% budget.b_id %]" data-sort1-authcat="[% budget.b_sort1_authcat %]" data-sort2-authcat="[% budget.b_sort2_authcat %]" selected="selected">[% budget.b_txt %]</option>
161
                                        [% ELSE %]
162
                                            <option value="[% budget.b_id %]" data-sort1-authcat="[% budget.b_sort1_authcat %]" data-sort2-authcat="[% budget.b_sort2_authcat %]">[% budget.b_txt %]</option>
163
                                        [% END %]
164
                                    [% END %]
165
                                </select>
182
                                [% END %]
166
                                [% END %]
167
                                <span class="sort1">
168
                                    <label for="sort1">Planning value1: </label>
169
                                    <input type="text" id="sort1" size="20" name="sort1" value="[% biblio.sort1 %]" />
170
                                </span>
171
                                <span class="sort2">
172
                                    <label for="sort2">Planning value2: </label>
173
                                    <input type="text" id="sort2" size="20" name="sort2" value="[% biblio.sort2 %]" />
174
                                </span>
175
                            </span>
176
                        </div>
177
                        [% END %]
178
                        <div>
179
                        <h2>Import All</h2>
180
                        <p>Import all the lines in the basket with the following parameters:</p>
181
182
                        [% IF ( items ) %]
183
                        <fieldset class="rows">
184
                            <legend>Item</legend>
185
                            [% IF ( NoACQframework ) %]
186
                                <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
183
                            [% END %]
187
                            [% END %]
184
                            </select>
188
                            [% FOREACH item IN items %]
185
                            </li>
189
                            <div id="outeritemblock">
186
                            [% END %]
190
                            <div id="itemblock">
187
                        </li>
191
                                <ol>
188
                        <li>
192
                                [% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
189
                            <label for="notes">Notes: </label>
193
                                    <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
190
                            <textarea id="notes" cols="30" rows="3" name="notes"></textarea>
194
                                        <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
191
                        </li>
195
                                        [% iteminformatio.marc_value %]
192
                        <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
196
                                        <input type="hidden" name="itemid" value="1" />
193
                            <label for="sort1">Planning value1: </label>
197
                                        <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
194
                            <span id="sort1_zone">
198
                                        <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
195
                            [% IF CGIsort1 %]
199
                                        <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
196
                                <select id="sort1" size="1" name="sort1">
200
                                        <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
197
                                [% FOREACH sort_opt IN CGIsort1 %]
201
                                    </div></li>
198
                                    [% IF sort_opt.default %]
202
                                [% END %]
199
                                        <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
203
                                </ol>
204
                            </div><!-- /iteminformation -->
205
                            </div>
206
                            [% END %] <!-- /items -->
207
                        </fieldset>
208
                        [% END %] <!-- items -->
209
210
                        <fieldset class="rows">
211
                            <legend>Accounting details</legend>
212
                            <ol>
213
                                <li>
214
                                    <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
215
                                    <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
216
                                </li>
217
                                <li>
218
                                    [% IF ( close ) %]
219
                                        <span class="label">Budget: </span>
220
                                        <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
200
                                    [% ELSE %]
221
                                    [% ELSE %]
201
                                        <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
222
                                        <li>
223
                                            <label for="all_currency">Currency:</label>
224
                                            <select name="all_currency" id="all_currency">
225
                                            [% FOREACH loop_currencie IN loop_currencies %]
226
                                                [% IF ( loop_currencie.selected ) %]
227
                                                    <option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>
228
                                                [% ELSE %]
229
                                                    <option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>
230
                                                [% END %]
231
                                            [% END %]
232
                                            </select>
233
                                        </li>
234
                                        <li>
235
                                            <label for="all_budget_id">Budget: </label>
236
                                            <select id="all_budget_id" size="1" name="all_budget_id">
237
                                            [% FOREACH budget_loo IN budget_loop %]
238
                                                [% IF ( budget_loo.b_sel ) %]
239
                                                    <option value="[% budget_loo.b_id %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]" selected="selected">[% budget_loo.b_txt %]</option>
240
                                                [% ELSE %]
241
                                                    <option value="[% budget_loo.b_id %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">[% budget_loo.b_txt %]</option>
242
                                                [% END %]
243
                                            [% END %]
244
                                            </select>
245
                                        </li>
202
                                    [% END %]
246
                                    [% END %]
203
                                [% END %]
247
                                </li>
204
                                </select>
248
                                <li>
205
                            [% ELSE %]
249
                                    <label for="notes">Notes: </label>
206
                                <input type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
250
                                    <textarea id="notes" cols="30" rows="3" name="all_notes"></textarea>
207
                            [% END %]
251
                                </li>
208
                            </span>
252
                                <li>
209
                        </li>
253
                                    <div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
210
                        <li>
254
                                    <label for="sort1">Planning value1: </label>
211
                            <label for="sort2">Planning value2: </label>
255
                                    [% IF CGIsort1 %]
212
                            <span id="sort2_zone">
256
                                        <select id="all_sort1" size="1" name="all_sort1">
213
                            [% IF CGIsort2 %]
257
                                        [% FOREACH sort_opt IN CGIsort1 %]
214
                                <select id="sort2" size="1" name="sort1">
258
                                            [% IF sort_opt.default %]
215
                                [% FOREACH sort_opt IN CGIsort2 %]
259
                                                <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
216
                                    [% IF sort_opt.default %]
260
                                            [% ELSE %]
217
                                        <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
261
                                                <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
262
                                            [% END %]
263
                                        [% END %]
264
                                        </select>
218
                                    [% ELSE %]
265
                                    [% ELSE %]
219
                                        <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
266
                                        <input type="text" id="all_sort1" size="20" name="all_sort1" value="[% sort1 %]" />
220
                                    [% END %]
267
                                    [% END %]
221
                                [% END %]
268
                                </li>
222
                                </select>
269
                                <li>
223
                            [% ELSE %]
270
                                  <span id="sort2_zone">
224
                                 <input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
271
                                    <label for="sort2">Planning value2: </label>
225
                            [% END %]
272
                                    [% IF CGIsort2 %]
226
                            </span>
273
                                        <select id="all_sort2" size="1" name="all_sort1">
227
                        </li>
274
                                        [% FOREACH sort_opt IN CGIsort2 %]
228
                        <li>
275
                                            [% IF sort_opt.default %]
229
                            
276
                                                <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
230
                        </li>
277
                                            [% ELSE %]
231
            </ol>
278
                                                <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
232
                </fieldset>
279
                                            [% END %]
233
                <fieldset class="action">
280
                                        [% END %]
234
                    <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
281
                                        </select>
235
                </fieldset>
282
                                    [% ELSE %]
236
            </form>
283
                                         <input type="text" id="all_sort2" size="20" name="all_sort2" value="[% sort2 %]" />
237
            </div>
284
                                    [% END %]
238
        [% END %]
285
                                  </span>
286
                                </li>
287
                            </ol>
288
                        </fieldset>
289
                        <fieldset class="action">
290
                            <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
291
                        </fieldset>
292
293
                        </div>
294
                    </form>
295
                [% ELSE %]
296
                <div>
297
                  <h1>Choose the file to add to the basket</h1>
298
                  <table id="files">
299
                    <thead>
300
                      <tr>
301
                        <th>File name</th>
302
                        <th>Comments</th>
303
                        <th>Status</th>
304
                        <th>Staged</th>
305
                        <th># Bibs</th>
306
                        <th>&nbsp;</th>
307
                      </tr>
308
                    </thead>
309
                    <tbody>
310
                      [% FOREACH batch_lis IN batch_list %]
311
                      <tr>
312
                        <td>[% batch_lis.file_name %]</td>
313
                        <td>[% batch_lis.comments %]</td>
314
                        <td>[% batch_lis.import_status %]</td>
315
                        <td>[% batch_lis.staged_date | $KohaDates %] [% batch_lis.staged_hour %]</td>
316
                        <td>[% batch_lis.num_biblios %]</td>
317
                        <td><a href="[% batch_lis.scriptname %]?import_batch_id=[% batch_lis.import_batch_id %]&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]">Add orders</a></td>
318
                      </tr>
319
                      [% END %]
320
                    </tbody>
321
                  </table>
322
                </div>
323
                [% END %]
324
           </div>
239
       </div>
325
       </div>
240
   </div>
326
   </div>
241
</div>
327
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref (-1 / +4 lines)
Lines 42-47 Acquisitions: Link Here
42
                  yes: Warn
42
                  yes: Warn
43
                  no: "Do not warn"
43
                  no: "Do not warn"
44
            - when the librarian tries to create an invoice with a duplicate number.
44
            - when the librarian tries to create an invoice with a duplicate number.
45
        -
46
            - Set the mapping values for a new order line created from a marcrecord (staged file). In a YAML format, so you have to finished with an empty line.
47
            - pref: MarcFieldsToOrder
48
              type: textarea
45
49
46
    Printing:
50
    Printing:
47
        -
51
        -
48
- 

Return to bug 7180