my @quantities = $input->param('quantity');
my @prices = $input->param('price');
my @budgets_id = $input->param('budget_id');
- my @rrp = $input->param('rrp');
my @discount = $input->param('discount');
my @sort1 = $input->param('sort1');
my @sort2 = $input->param('sort2');
my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0;
my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1;
my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id;
- my $c_rrp = shift( @rrp ); # rrp include tax
my $c_discount = shift ( @discount);
- $c_discount = $c_discount / 100 if $c_discount > 100;
+ $c_discount = $c_discount / 100 if $c_discount > 1;
my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || '';
my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || '';
}
}
( $biblionumber, $bibitemnum ) = AddBiblio( $marcrecord, $cgiparams->{'frameworkcode'} || '' );
+ SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' );
# 2nd add authorities if applicable
if (C4::Context->preference("BiblioAddsAuthorities")){
my $headings_linked =BiblioAutoLink($marcrecord, $cgiparams->{'frameworkcode'});
$price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
$price = $num->unformat_number($price);
$orderinfo{gstrate} = $bookseller->{gstrate};
- my $c = $c_discount ? $c_discount / 100 : $bookseller->{discount} / 100;
+ my $c = $c_discount ? $c_discount : $bookseller->{discount} / 100;
if ( $bookseller->{listincgst} ) {
if ( $c_discount ) {
$orderinfo{ecost} = $price;
my ( $biblionumber, $bibitemnum, $itemnumber ) = AddItemFromMarc( $record, $biblionumber );
NewOrderItem( $itemnumber, $ordernumber );
}
+ } else {
+ SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' );
}
}
# go to basket page
b_txt => $r->{budget_name},
b_sort1_authcat => $r->{'sort1_authcat'},
b_sort2_authcat => $r->{'sort2_authcat'},
+ b_active => $r->{budget_period_active},
b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0,
};
}
-$template->param( budget_loop => $budget_loop,);
-my $CGIsort1;
-if ($budget) { # its a mod ..
- if ( defined $budget->{'sort1_authcat'} ) { # with custom Asort* planning values
- $CGIsort1 = GetAuthvalueDropbox( $budget->{'sort1_authcat'}, $data->{'sort1'} );
- }
-} elsif ( scalar(@$budgets) ) {
-} elsif ( scalar(@$budgets_hierarchy) ) {
- $CGIsort1 = GetAuthvalueDropbox( @$budgets_hierarchy[0]->{'sort1_authcat'}, '' );
-}
-# if CGIsort is successfully fetched, the use it
-# else - failback to plain input-field
-if ($CGIsort1) {
- $template->param( CGIsort1 => $CGIsort1 );
-} else {
- $template->param( sort1 => $data->{'sort1'} );
-}
+@{$budget_loop} =
+ sort { uc( $a->{b_txt}) cmp uc( $b->{b_txt}) } @{$budget_loop};
-my $CGIsort2;
-if ($budget) {
- if ( defined $budget->{'sort2_authcat'} ) {
- $CGIsort2 = GetAuthvalueDropbox( $budget->{'sort2_authcat'}, $data->{'sort2'} );
- }
-} elsif ( scalar(@$budgets_hierarchy) ) {
- $CGIsort2 = GetAuthvalueDropbox( @$budgets_hierarchy[0]->{sort2_authcat}, '' );
-}
-if ($CGIsort2) {
- $template->param( CGIsort2 => $CGIsort2 );
-} else {
- $template->param( sort2 => $data->{'sort2'} );
-}
+$template->param( budget_loop => $budget_loop,);
output_html_with_http_headers $input, $cookie, $template->output;
foreach my $batch (@$batches) {
if ( $batch->{'import_status'} =~ /^staged$|^reverted$/ ) {
# check if there is at least 1 line still staged
- my $stagedList=GetImportRecordsRange($batch->{'import_batch_id'}, undef, undef, $batch->{import_status});
+ my $stagedList=GetImportRecordsRange($batch->{'import_batch_id'}, undef, undef, $batch->{import_status}, { order_by_direction => 'ASC' });
if (scalar @$stagedList) {
push @list, {
import_batch_id => $batch->{'import_batch_id'},
- num_biblios => $batch->{'num_biblios'},
+ num_records => $batch->{'num_records'},
num_items => $batch->{'num_items'},
staged_date => $batch->{'upload_timestamp'},
import_status => $batch->{'import_status'},
);
my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} );
my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information";
- my $infos = get_infos_syspref($marcrecord, ['price', 'quantity', 'budget_code', 'rrp', 'discount', 'sort1', 'sort2']);
+ my $infos = get_infos_syspref($marcrecord, ['price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2']);
my $price = $infos->{price};
my $quantity = $infos->{quantity};
my $budget_code = $infos->{budget_code};
- my $rrp = $infos->{rrp};
my $discount = $infos->{discount};
my $sort1 = $infos->{sort1};
my $sort2 = $infos->{sort2};
$cellrecord{price} = $price || '';
$cellrecord{quantity} = $quantity || '';
$cellrecord{budget_id} = $budget_id || '';
- $cellrecord{rrp} = $rrp || '';
$cellrecord{discount} = $discount || '';
$cellrecord{sort1} = $sort1 || '';
$cellrecord{sort2} = $sort2 || '';
push @list, \%cellrecord;
}
- my $num_biblios = $batch->{'num_biblios'};
+ my $num_records = $batch->{'num_records'};
my $overlay_action = GetImportBatchOverlayAction($import_batch_id);
my $nomatch_action = GetImportBatchNoMatchAction($import_batch_id);
my $item_action = GetImportBatchItemAction($import_batch_id);
$template->param(biblio_list => \@list,
- num_results => $num_biblios,
+ num_results => $num_records,
import_batch_id => $import_batch_id,
"overlay_action_${overlay_action}" => 1,
overlay_action => $overlay_action,
comments => $batch->{'comments'},
import_status => $batch->{'import_status'},
upload_timestamp => $batch->{'upload_timestamp'},
- num_biblios => $batch->{'num_biblios'},
- num_items => $batch->{'num_biblios'});
- if ($batch->{'num_biblios'} > 0) {
+ num_records => $batch->{'num_records'},
+ num_items => $batch->{'num_items'});
+ if ($batch->{'num_records'} > 0) {
if ($batch->{'import_status'} eq 'staged' or $batch->{'import_status'} eq 'reverted') {
$template->param(can_commit => 1);
}