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

(-)a/acqui/addorderiso2709.pl (-6 / +15 lines)
Lines 171-186 if ($op eq ""){ Link Here
171
    for my $biblio (@$biblios){
171
    for my $biblio (@$biblios){
172
        # Check if this import_record_id was selected
172
        # Check if this import_record_id was selected
173
        next if not grep { $_ eq $$biblio{import_record_id} } @import_record_id_selected;
173
        next if not grep { $_ eq $$biblio{import_record_id} } @import_record_id_selected;
174
175
        # With this we know from which index from the http params we get the data
176
        my $index;
177
        for (my $i = 0; $i <= $#import_record_id_selected; $i++) {
178
            if ($import_record_id_selected[$i] eq $$biblio{import_record_id}) {
179
                $index = $i;
180
                last;
181
            }
182
        }
183
174
        my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} );
184
        my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} );
175
        my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information";
185
        my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information";
176
        my $match = GetImportRecordMatches( $biblio->{'import_record_id'}, 1 );
186
        my $match = GetImportRecordMatches( $biblio->{'import_record_id'}, 1 );
177
        my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0;
187
        my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0;
178
        my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1;
188
        my $c_quantity = $quantities[$index] || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1;
179
        my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id;
189
        my $c_budget_id = $budgets_id[$index] || $input->param('all_budget_id') || $budget_id;
180
        my $c_discount = shift ( @discount);
190
        my $c_discount = $discount[$index];
181
        $c_discount = $c_discount / 100 if $c_discount > 1;
191
        $c_discount = $c_discount / 100 if $c_discount > 1;
182
        my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || '';
192
        my $c_sort1 = $sort1[$index] || $input->param('all_sort1') || '';
183
        my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || '';
193
        my $c_sort2 = $sort2[$index] || $input->param('all_sort2') || '';
184
194
185
        # 1st insert the biblio, or find it through matcher
195
        # 1st insert the biblio, or find it through matcher
186
        unless ( $biblionumber ) {
196
        unless ( $biblionumber ) {
187
- 

Return to bug 14999