Lines 159-164
if ($op eq ""){
Link Here
|
159 |
my $import_batch_id = $cgiparams->{'import_batch_id'}; |
159 |
my $import_batch_id = $cgiparams->{'import_batch_id'}; |
160 |
my $biblios = GetImportRecordsRange($import_batch_id); |
160 |
my $biblios = GetImportRecordsRange($import_batch_id); |
161 |
my @import_record_id_selected = $input->param("import_record_id"); |
161 |
my @import_record_id_selected = $input->param("import_record_id"); |
|
|
162 |
my @overlay = $input->param("overlay"); |
162 |
my @quantities = $input->param('quantity'); |
163 |
my @quantities = $input->param('quantity'); |
163 |
my @prices = $input->param('price'); |
164 |
my @prices = $input->param('price'); |
164 |
my @budgets_id = $input->param('budget_id'); |
165 |
my @budgets_id = $input->param('budget_id'); |
Lines 173-178
if ($op eq ""){
Link Here
|
173 |
my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information"; |
174 |
my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information"; |
174 |
my $match = GetImportRecordMatches( $biblio->{'import_record_id'}, 1 ); |
175 |
my $match = GetImportRecordMatches( $biblio->{'import_record_id'}, 1 ); |
175 |
my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0; |
176 |
my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0; |
|
|
177 |
my $c_overlay = shift @overlay; |
176 |
my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1; |
178 |
my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1; |
177 |
my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id; |
179 |
my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id; |
178 |
my $c_discount = shift ( @discount); |
180 |
my $c_discount = shift ( @discount); |
Lines 180-187
if ($op eq ""){
Link Here
|
180 |
my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || ''; |
182 |
my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || ''; |
181 |
my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || ''; |
183 |
my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || ''; |
182 |
|
184 |
|
183 |
# 1st insert the biblio, or find it through matcher |
185 |
# INSERT the biblio if no match found, or if we want to overlay the existing match |
184 |
unless ( $biblionumber ) { |
186 |
if ( not($biblionumber) || $c_overlay ) { |
185 |
# add the biblio |
187 |
# add the biblio |
186 |
my $bibitemnum; |
188 |
my $bibitemnum; |
187 |
|
189 |
|
Lines 196-202
if ($op eq ""){
Link Here
|
196 |
} |
198 |
} |
197 |
} |
199 |
} |
198 |
} |
200 |
} |
199 |
( $biblionumber, $bibitemnum ) = AddBiblio( $marcrecord, $cgiparams->{'frameworkcode'} || '' ); |
201 |
( $biblionumber, $bibitemnum ) = AddBiblio( $marcrecord, $cgiparams->{'frameworkcode'} || '' ) unless $c_overlay; |
|
|
202 |
ModBiblio( $marcrecord, $biblionumber, $cgiparams->{'frameworkcode'} || '' ) if $c_overlay; |
200 |
SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); |
203 |
SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); |
201 |
|
204 |
|
202 |
#We need to provide information to koha.import_record_matches to tell Koha that this import_record matches the |
205 |
#We need to provide information to koha.import_record_matches to tell Koha that this import_record matches the |