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 (+11 lines)
Lines 7155-7160 if ( CheckVersion($DBversion) ) { Link Here
7155
    SetVersion($DBversion);
7155
    SetVersion($DBversion);
7156
}
7156
}
7157
7157
7158
7159
7160
7161
7162
$DBversion = "3.13.00.XXX";
7163
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
7164
    $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')");
7165
   print "Upgrade to $DBversion done (Bug 7180: Added MarcFieldsToOrder syspref)\n";
7166
   SetVersion ($DBversion);
7167
}
7168
7158
=head1 FUNCTIONS
7169
=head1 FUNCTIONS
7159
7170
7160
=head2 TableExists($table)
7171
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js (-74 / +19 lines)
Lines 673-756 function calcNewsuggTotal(){ Link Here
673
    return true;
673
    return true;
674
}
674
}
675
675
676
676
function getAuthValueDropbox( name, cat, destination, selected ) {
677
// ----------------------------------------
677
    if (cat == null || cat == "") {
678
//USED BY NEWORDEREMPTY.PL
678
        $(destination).replaceWith(' <input type="text" name="' + name + '" />' );
679
/*
680
function fetchSortDropbox(f) {
681
    var  budgetId=f.budget_id.value;
682
    var handleSuccess = function(o){
683
        if(o.responseText !== undefined){
684
            sort_dropbox.innerHTML   = o.responseText;
685
        }
686
    }
687
688
    var callback = {   success:handleSuccess };
689
    var sUrl = '../acqui/fetch_sort_dropbox.pl?sort=1&budget_id='+budgetId
690
    var sort_dropbox = document.getElementById('sort1');
691
    var request1 = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
692
    var rr = '00';
693
694
// FIXME: ---------  twice , coz the 2 requests get mixed up otherwise
695
696
    var handleSuccess2 = function(o){
697
    if(o.responseText !== undefined){
698
        sort2_dropbox.innerHTML   = o.responseText;
699
        }
700
    }
701
702
    var callback2 = {   success:handleSuccess };
703
    var sUrl2 = '../acqui/fetch_sort_dropbox.pl?sort=2&budget_id='+budgetId;
704
    var sort2_dropbox = document.getElementById('sort2');
705
    var request2 = YAHOO.util.Connect.asyncRequest('GET', sUrl2, callback2);
706
707
}
708
*/
709
710
711
712
//USED BY NEWORDEREMPTY.PL
713
function fetchSortDropbox(f) {
714
    var  budgetId=f.budget_id.value;
715
716
for (i=1;i<=2;i++) {
717
718
    var sort_zone = document.getElementById('sort'+i+'_zone');
719
    var url = '../acqui/fetch_sort_dropbox.pl?sort='+i+'&budget_id='+budgetId;
720
721
    var xmlhttp = null;
722
    xmlhttp = new XMLHttpRequest();
723
    if ( typeof xmlhttp.overrideMimeType != 'undefined') {
724
        xmlhttp.overrideMimeType('text/xml');
725
    }
726
727
    xmlhttp.open('GET', url, false);
728
    xmlhttp.send(null);
729
730
    xmlhttp.onreadystatechange = function() {
731
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
732
    // stupid JS...
733
        } else {
734
    // wait for the call to complete
735
        }
736
    };
737
    // rc =  eval ( xmlhttp.responseText );
738
    var retRootType = xmlhttp.responseXML.firstChild.nodeName;
739
    var existingInputs = sort_zone.getElementsByTagName('input');
740
    if (existingInputs.length > 0 && retRootType == 'input') {
741
        // when sort is already an input, do not override to preseve value
742
        return;
679
        return;
743
    }
680
    }
744
    sort_zone.innerHTML = xmlhttp.responseText;
681
    $.ajax({
745
}
682
        url: "/cgi-bin/koha/acqui/ajax-getauthvaluedropbox.pl",
683
        data: {
684
            name: name,
685
            category: cat,
686
            default: selected
687
        },
688
        async: false,
689
        success: function(data){
690
            if(data === "0"){
691
                $(destination).replaceWith(' <input type="text" name="' + name + '" />' );
692
            }else{
693
                $(destination).replaceWith(data);
694
            }
695
        }
696
    });
746
}
697
}
747
698
748
749
750
751
752
753
754
//USED BY NEWORDEREMPTY.PL
699
//USED BY NEWORDEREMPTY.PL
755
function totalExceedsBudget(budgetId, total) {
700
function totalExceedsBudget(budgetId, total) {
756
701
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt (-197 / +270 lines)
Lines 10-17 Link Here
10
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
10
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
11
[% INCLUDE 'doc-head-close.inc' %]
11
[% INCLUDE 'doc-head-close.inc' %]
12
[% INCLUDE 'datatables.inc' %]
12
[% INCLUDE 'datatables.inc' %]
13
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
13
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
14
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
14
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
15
<script type="text/JavaScript">
15
<script type="text/JavaScript">
16
//<![CDATA[
16
//<![CDATA[
17
    [% IF (dateformat == 'metric') %]
17
    [% IF (dateformat == 'metric') %]
Lines 25-42 Link Here
25
            "sPaginationType": "four_button"
25
            "sPaginationType": "four_button"
26
        } ) );
26
        } ) );
27
27
28
        $("form#Aform").submit(function() {
28
        $("select[name='budget_id']").change(function(){
29
            var total_errors = CheckMandatorySubfields(this);
29
            var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
30
            if (total_errors > 0) {
30
            var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
31
                var alertString  = _("Form not submitted because of the following problem(s)");
31
            var destination_sort1 = $(this).siblings('span.sort1').find('input[name="sort1"]');
32
                alertString += "\n------------------------------------------------------------------------------------\n";
32
            var sort1 = $(destination_sort1).val();
33
                alertString += "\n- "+ total_errors + _(" mandatory fields empty (highlighted)");
33
            if ( destination_sort1.length < 1 ) {
34
                alert(alertString);
34
                destination_sort1 = $(this).siblings('span.sort1').find('select[name="sort1"]');
35
                return false;
36
            }
35
            }
37
            return true;
36
            var destination_sort2 = $(this).siblings('span.sort2').find('input[name="sort2"]');
37
            var sort2 = $(destination_sort2).val();
38
            if ( destination_sort2.length < 1 ) {
39
                destination_sort2 = $(this).siblings('span.sort2').find('select[name="sort2"]');
40
            }
41
            getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
42
43
            getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
44
        } );
45
46
        $("select[name='budget_id']").change();
47
48
        $("select[name='all_budget_id']").change(function(){
49
            var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
50
            var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
51
            var destination_sort1 = $(this).parent().siblings('li').find('input[name="all_sort1"]');
52
            if ( destination_sort1.length < 1 ) {
53
                destination_sort1 = $(this).parent().siblings('li').find('select[name="all_sort1"]');
54
            }
55
            var destination_sort2 = $(this).parent().siblings('li').find('input[name="all_sort2"]');
56
            if ( destination_sort2.length < 1 ) {
57
                destination_sort2 = $(this).parent().siblings('li').find('select[name="all_sort2"]');
58
            }
59
            getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1 );
60
            getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2 );
61
            $(this).parent().siblings('li').find('select[name="sort1"]').attr('name', 'all_sort1');
62
            $(this).parent().siblings('li').find('input[name="sort1"]').attr('name', 'all_sort1');
63
            $(this).parent().siblings('li').find('select[name="sort2"]').attr('name', 'all_sort2');
64
            $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2');
65
        } );
66
67
        $('input:checkbox[name="import_record_id"]').change(function(){
68
            if ( $(this).is(':checked') ) {
69
                $(this).parent().addClass("selected");
70
                $(this).parent().removeClass("unselected");
71
            } else {
72
                $(this).parent().addClass("unselected");
73
                $(this).parent().removeClass("selected");
74
            }
75
        } );
76
77
        $("input:checkbox").attr("checked", false);
78
        $("div.biblio.unselected select").attr("disabled", false);
79
        $("div.biblio.unselected input").attr("disabled", false);
80
81
        $("#checkAll").click(function(){
82
            $("#Aform").checkCheckboxes();
83
            $("input:checkbox[name='import_record_id']").change();
84
            return false;
85
        });
86
        $("#unCheckAll").click(function(){
87
            $("#Aform").unCheckCheckboxes();
88
            $("input:checkbox[name='import_record_id']").change();
89
            return false;
38
        });
90
        });
91
39
    });
92
    });
93
94
    function disableUnchecked(form){
95
        $("div.biblio.unselected").each(function(){
96
            $(this).find('select').attr('disabled', 'disabled');
97
            $(this).find('input').attr('disabled', 'disabled');
98
        });
99
        form.submit();
100
    }
40
//]]>
101
//]]>
41
</script>
102
</script>
42
</head>
103
</head>
Lines 49-252 Link Here
49
       <div id="yui-main">
110
       <div id="yui-main">
50
           <div class="yui-b">
111
           <div class="yui-b">
51
             [% IF ( batch_details ) %]
112
             [% IF ( batch_details ) %]
52
                  <h1>Add orders from [% comments %]
113
                <h1>Add orders from [% comments %]
53
                    ([% file_name %] staged on [% upload_timestamp %])
114
                    ([% file_name %] staged on [% upload_timestamp %])
54
                  </h1>
115
                </h1>
55
               <div>
116
                <div>
56
                   <form action="[% scriptname %]" method="post" name="import_biblios">
117
                    <span class="checkall"><a id="checkAll" href="#">Check All</a></span>
57
                     <table>
118
                    <span class="uncheckall"><a id="unCheckAll" href="#">Uncheck All</a></span>
58
                     <tr>
119
                    <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform" onsubmit="disableUnchecked(this); return false;">
59
                         <th>Citation</th>
120
                        <input type="hidden" name="op" value="import_records"/>
60
                         <th>Match?</th>
121
                        <input type="hidden" name="basketno" value="[% basketno %]" />
61
                         <th>Order</th>
122
                        <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
62
                       </tr>
123
                        <input type="hidden" name="import_batch_id" value="[%import_batch_id %]" />
63
                       [% FOREACH biblio_lis IN biblio_list %]
124
                        <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
64
                         <tr>
65
                             <td>
66
                                [% biblio_lis.citation %]
67
68
                             </td>
69
                             <td>[% biblio_lis.overlay_status %]</td>
70
                             <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>
71
                         </tr>
72
     [% IF ( biblio_lis.match_biblionumber ) %]
73
    <tr>
74
      <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>
75
    </tr>
76
    [% END %]
77
                      [% END %]
78
                     </table>
79
                   </form>
80
               </div>
81
              [% IF ( pages ) %]
82
                <div class="pages">
83
                Page 
84
                  [% FOREACH page IN pages %]
85
                    [% IF ( page.current_page ) %]
86
                      <span class="current">[% page.page_number %]</span>
87
                    [% ELSE %]
88
                      <a class="nav" href="[% page.script_name %]?import_batch_id=[% page.import_batch_id %]&amp;offset=[% page.offset %]">[% page.page_number %]</a>
89
                    [% END %]
90
                  [% END %]
91
              [% END %]
92
             [% ELSE %]
93
               <div>
94
                <h1>Choose the file to add to the basket</h1>
95
                   <table id="files">
96
                     <thead>
97
                     <tr>
98
                       <th>File name</th>
99
                       <th>Comments</th>
100
                       <th>Status</th>
101
                       <th>Staged</th>
102
                       <th># Bibs</th>
103
                       <th>&nbsp;</th>
104
                     </tr>
105
                     </thead>
106
                     <tbody>
107
                     [% FOREACH batch_lis IN batch_list %]
108
                     <tr>
109
                        <td>[% batch_lis.file_name %]</td>
110
                       <td>[% batch_lis.comments %]</td>
111
                       <td>[% batch_lis.import_status %]</td>
112
                       <td>[% batch_lis.staged_date | $KohaDates %] [% batch_lis.staged_hour %]</td>
113
                       <td>[% batch_lis.num_biblios %]</td>
114
                       <td><a href="[% batch_lis.scriptname %]?import_batch_id=[% batch_lis.import_batch_id %]&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]">Add orders</a></td>
115
                     </tr>
116
                     [% END %]
117
                     </tbody>
118
                   </table>
119
               </div>
120
             [% END %]
121
           </div>
122
        [% IF ( import_batch_id ) %]
123
            <div class="yui-b">
124
            <h2>Import All</h2>
125
            <p>Import all the lines in the basket with the following parameters:</p>
126
            <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform">
127
                    <input type="hidden" name="op" value="import_records"/>
128
                    <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
129
                    <input type="hidden" name="basketno" value="[% basketno %]" />
130
                    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
131
                    <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
132
133
                    [% FOREACH loop_currencie IN loop_currencies %]
134
                        <input type="hidden" name="[% loop_currencie.currency %]" value="[% loop_currencie.rate %]" />
135
                    [% END %]
136
137
                [% IF ( items ) %]
138
                <fieldset class="rows">
139
                    <legend>Item</legend>
140
                    [% IF ( NoACQframework ) %]
141
                        <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
142
                    [% END %]
143
125
144
                    [% FOREACH item IN items %]
126
                        [% FOREACH cur IN loop_currencies %]
145
                    <div id="outeritemblock">
127
                            <input type="hidden" name="[% cur.currency %]" value="[% cur.rate %]" />
146
                    <div id="itemblock">
147
                        <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
148
                            <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
149
150
                                <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
151
                                [% iteminformatio.marc_value %]
152
                                <input type="hidden" name="itemid" value="1" />
153
                                <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
154
                                <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
155
                                <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
156
                                <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
157
                            </div></li>
158
                        [% END %]
128
                        [% END %]
159
                        </ol>
160
                    </div><!-- /iteminformation -->
161
                    </div>
162
129
163
                    [% END %] <!-- /items -->
130
                        [% FOREACH biblio IN biblio_list %]
164
                </fieldset>
131
                        <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;">
165
                [% END %] <!-- items -->
132
                            <input type="checkbox" name="import_record_id" id="record_[% biblio.import_record_id %]" value="[% biblio.import_record_id %]" />
166
                <fieldset class="rows">
133
                            <input type="hidden" value="[% biblio.rrp %]" name="rrp" />
167
                    <legend>Accounting details</legend>
134
                            <label for="record_[% biblio.import_record_id %]"><span class="citation" style="font-weight:bold;">[% biblio.citation %]</span></label>
168
                    <ol>
135
                            <span class="match" style="display:block;">[% biblio.overlay_status %]</span>
169
                        <li>
136
                            [% IF ( biblio.match_biblionumber ) %]
170
                            <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
137
                                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>
171
                            <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
138
                            [% END %]
172
                        </li>
139
                            <span class="quantity" style="display:block;">
173
                        <li>
140
                                Quantity: <input type="text" value="[% biblio.quantity %]" name="quantity" />
174
                            [% IF ( close ) %]
141
                            </span>
175
                        <span class="label">Budget: </span>
142
                            <span class="price" style="display:block;">
176
                                <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
143
                                Price: <input type="text" value="[% biblio.price %]" name="price" />
177
                            [% ELSE %]
144
                            </span>
178
                            <li>
145
                            <span class="discount" style="display:block;">
179
                            <label for="currency">Currency:</label>
146
                                Discount: <input type="text" value="[% biblio.discount %]" name="discount" />
180
                            <select name="currency" id="currency">
147
                            </span>
181
                            [% FOREACH loop_currencie IN loop_currencies %]
148
                            <span class="budget" style="display:block;">
182
                                    [% 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 %]
149
                                [% IF ( close ) %]
183
                            </select>
150
                                <span class="label">Budget: </span>
184
                            </li>
151
                                    <input type="hidden" size="20" name="budget_id" value="[% budget_id %]" />[% Budget_name %]
185
                            <li>
186
                            <label for="budget_id">Budget: </label>
187
                            <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id">
188
                            [% FOREACH budget_loo IN budget_loop %]
189
                                [% IF ( budget_loo.b_sel ) %]
190
                                    <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
191
                                [% ELSE %]
152
                                [% ELSE %]
192
                                    <option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
153
                                <label for="budget_id">Budget: </label>
154
                                <select size="1" name="budget_id">
155
                                    <option value=""></option>
156
                                    [% FOREACH budget IN budget_loop %]
157
                                        [% IF ( budget.b_id == biblio.budget_id ) %]
158
                                            <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>
159
                                        [% ELSE %]
160
                                            <option value="[% budget.b_id %]" data-sort1-authcat="[% budget.b_sort1_authcat %]" data-sort2-authcat="[% budget.b_sort2_authcat %]">[% budget.b_txt %]</option>
161
                                        [% END %]
162
                                    [% END %]
163
                                </select>
193
                                [% END %]
164
                                [% END %]
165
                                <span class="sort1">
166
                                    <label for="sort1">Planning value1: </label>
167
                                    <input type="text" id="sort1" size="20" name="sort1" value="[% biblio.sort1 %]" />
168
                                </span>
169
                                <span class="sort2">
170
                                    <label for="sort2">Planning value2: </label>
171
                                    <input type="text" id="sort2" size="20" name="sort2" value="[% biblio.sort2 %]" />
172
                                </span>
173
                            </span>
174
                        </div>
175
                        [% END %]
176
                        <div>
177
                        <h2>Import All</h2>
178
                        <p>Import all the lines in the basket with the following parameters:</p>
179
180
                        [% IF ( items ) %]
181
                        <fieldset class="rows">
182
                            <legend>Item</legend>
183
                            [% IF ( NoACQframework ) %]
184
                                <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
194
                            [% END %]
185
                            [% END %]
195
                            </select>
186
                            [% FOREACH item IN items %]
196
                            </li>
187
                            <div id="outeritemblock">
197
                            [% END %]
188
                            <div id="itemblock">
198
                        </li>
189
                                <ol>
199
                        <li>
190
                                [% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
200
                            <label for="notes">Notes: </label>
191
                                    <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
201
                            <textarea id="notes" cols="30" rows="3" name="notes"></textarea>
192
                                        <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
202
                        </li>
193
                                        [% iteminformatio.marc_value %]
203
                        <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
194
                                        <input type="hidden" name="itemid" value="1" />
204
                            <label for="sort1">Planning value1: </label>
195
                                        <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
205
                            <span id="sort1_zone">
196
                                        <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
206
                            [% IF CGIsort1 %]
197
                                        <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
207
                                <select id="sort1" size="1" name="sort1">
198
                                        <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
208
                                [% FOREACH sort_opt IN CGIsort1 %]
199
                                    </div></li>
209
                                    [% IF sort_opt.default %]
200
                                [% END %]
210
                                        <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
201
                                </ol>
202
                            </div><!-- /iteminformation -->
203
                            </div>
204
                            [% END %] <!-- /items -->
205
                        </fieldset>
206
                        [% END %] <!-- items -->
207
208
                        <fieldset class="rows">
209
                            <legend>Accounting details</legend>
210
                            <ol>
211
                                <li>
212
                                    <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
213
                                    <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
214
                                </li>
215
                                <li>
216
                                    [% IF ( close ) %]
217
                                        <span class="label">Budget: </span>
218
                                        <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
211
                                    [% ELSE %]
219
                                    [% ELSE %]
212
                                        <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
220
                                        <li>
221
                                            <label for="all_currency">Currency:</label>
222
                                            <select name="all_currency" id="all_currency">
223
                                            [% FOREACH loop_currencie IN loop_currencies %]
224
                                                [% IF ( loop_currencie.selected ) %]
225
                                                    <option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>
226
                                                [% ELSE %]
227
                                                    <option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>
228
                                                [% END %]
229
                                            [% END %]
230
                                            </select>
231
                                        </li>
232
                                        <li>
233
                                            <label for="all_budget_id">Budget: </label>
234
                                            <select id="all_budget_id" size="1" name="all_budget_id">
235
                                            [% FOREACH budget_loo IN budget_loop %]
236
                                                [% IF ( budget_loo.b_sel ) %]
237
                                                    <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>
238
                                                [% ELSE %]
239
                                                    <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>
240
                                                [% END %]
241
                                            [% END %]
242
                                            </select>
243
                                        </li>
213
                                    [% END %]
244
                                    [% END %]
214
                                [% END %]
245
                                </li>
215
                                </select>
246
                                <li>
216
                            [% ELSE %]
247
                                    <label for="notes">Notes: </label>
217
                                <input type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
248
                                    <textarea id="notes" cols="30" rows="3" name="all_notes"></textarea>
218
                            [% END %]
249
                                </li>
219
                            </span>
250
                                <li>
220
                        </li>
251
                                    <div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
221
                        <li>
252
                                    <label for="sort1">Planning value1: </label>
222
                            <label for="sort2">Planning value2: </label>
253
                                    [% IF CGIsort1 %]
223
                            <span id="sort2_zone">
254
                                        <select id="all_sort1" size="1" name="all_sort1">
224
                            [% IF CGIsort2 %]
255
                                        [% FOREACH sort_opt IN CGIsort1 %]
225
                                <select id="sort2" size="1" name="sort1">
256
                                            [% IF sort_opt.default %]
226
                                [% FOREACH sort_opt IN CGIsort2 %]
257
                                                <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
227
                                    [% IF sort_opt.default %]
258
                                            [% ELSE %]
228
                                        <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
259
                                                <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
260
                                            [% END %]
261
                                        [% END %]
262
                                        </select>
229
                                    [% ELSE %]
263
                                    [% ELSE %]
230
                                        <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
264
                                        <input type="text" id="all_sort1" size="20" name="all_sort1" value="[% sort1 %]" />
231
                                    [% END %]
265
                                    [% END %]
232
                                [% END %]
266
                                </li>
233
                                </select>
267
                                <li>
234
                            [% ELSE %]
268
                                  <span id="sort2_zone">
235
                                 <input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
269
                                    <label for="sort2">Planning value2: </label>
236
                            [% END %]
270
                                    [% IF CGIsort2 %]
237
                            </span>
271
                                        <select id="all_sort2" size="1" name="all_sort1">
238
                        </li>
272
                                        [% FOREACH sort_opt IN CGIsort2 %]
239
                        <li>
273
                                            [% IF sort_opt.default %]
240
                            
274
                                                <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
241
                        </li>
275
                                            [% ELSE %]
242
            </ol>
276
                                                <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
243
                </fieldset>
277
                                            [% END %]
244
                <fieldset class="action">
278
                                        [% END %]
245
                    <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
279
                                        </select>
246
                </fieldset>
280
                                    [% ELSE %]
247
            </form>
281
                                         <input type="text" id="all_sort2" size="20" name="all_sort2" value="[% sort2 %]" />
248
            </div>
282
                                    [% END %]
249
        [% END %]
283
                                  </span>
284
                                </li>
285
                            </ol>
286
                        </fieldset>
287
                        <fieldset class="action">
288
                            <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
289
                        </fieldset>
290
291
                        </div>
292
                    </form>
293
                [% ELSE %]
294
                <div>
295
                  <h1>Choose the file to add to the basket</h1>
296
                  <table id="files">
297
                    <thead>
298
                      <tr>
299
                        <th>File name</th>
300
                        <th>Comments</th>
301
                        <th>Status</th>
302
                        <th>Staged</th>
303
                        <th># Bibs</th>
304
                        <th>&nbsp;</th>
305
                      </tr>
306
                    </thead>
307
                    <tbody>
308
                      [% FOREACH batch_lis IN batch_list %]
309
                      <tr>
310
                        <td>[% batch_lis.file_name %]</td>
311
                        <td>[% batch_lis.comments %]</td>
312
                        <td>[% batch_lis.import_status %]</td>
313
                        <td>[% batch_lis.staged_date | $KohaDates %] [% batch_lis.staged_hour %]</td>
314
                        <td>[% batch_lis.num_biblios %]</td>
315
                        <td><a href="[% batch_lis.scriptname %]?import_batch_id=[% batch_lis.import_batch_id %]&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]">Add orders</a></td>
316
                      </tr>
317
                      [% END %]
318
                    </tbody>
319
                  </table>
320
                </div>
321
                [% END %]
322
           </div>
250
       </div>
323
       </div>
251
   </div>
324
   </div>
252
</div>
325
</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