Bug 35026: Tidy file
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
e5c44980ee
commit
5292426e3e
1 changed files with 90 additions and 66 deletions
|
@ -57,12 +57,14 @@ use Koha::Patrons;
|
|||
use Koha::MarcOrder;
|
||||
|
||||
my $input = CGI->new;
|
||||
my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({
|
||||
my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
|
||||
{
|
||||
template_name => "acqui/addorderiso2709.tt",
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
flagsrequired => { acquisition => 'order_manage' },
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
my $cgiparams = $input->Vars;
|
||||
my $op = $cgiparams->{'op'} || '';
|
||||
|
@ -70,7 +72,8 @@ my $booksellerid = $input->param('booksellerid');
|
|||
my $allmatch = $input->param('allmatch');
|
||||
my $bookseller = Koha::Acquisition::Booksellers->find($booksellerid);
|
||||
|
||||
$template->param(scriptname => "/cgi-bin/koha/acqui/addorderiso2709.pl",
|
||||
$template->param(
|
||||
scriptname => "/cgi-bin/koha/acqui/addorderiso2709.pl",
|
||||
booksellerid => $booksellerid,
|
||||
booksellername => $bookseller->name,
|
||||
);
|
||||
|
@ -90,16 +93,20 @@ my $basket = Koha::Acquisition::Baskets->find( $cgiparams->{basketno} );
|
|||
#
|
||||
if ( $op eq "" ) {
|
||||
$template->param( "basketno" => $cgiparams->{'basketno'} );
|
||||
|
||||
#display batches
|
||||
Koha::MarcOrder->import_batches_list($template);
|
||||
#
|
||||
# 2nd step = display the content of the chosen file
|
||||
#
|
||||
} elsif ( $op eq "batch_details" ) {
|
||||
|
||||
#display lines inside the selected batch
|
||||
|
||||
$template->param("batch_details" => 1,
|
||||
$template->param(
|
||||
"batch_details" => 1,
|
||||
"basketno" => $cgiparams->{'basketno'},
|
||||
|
||||
# get currencies (for change rates calcs if needed)
|
||||
currencies => Koha::Acquisition::Currencies->search,
|
||||
bookseller => $bookseller,
|
||||
|
@ -107,6 +114,7 @@ if ($op eq ""){
|
|||
);
|
||||
Koha::MarcOrder->import_biblios_list( $template, $cgiparams->{'import_batch_id'} );
|
||||
if ( $basket->effective_create_items eq 'ordering' && !$basket->is_standing ) {
|
||||
|
||||
# prepare empty item form
|
||||
my $cell = PrepareItemrecordDisplay( '', '', undef, 'ACQ' );
|
||||
|
||||
|
@ -132,6 +140,7 @@ if ($op eq ""){
|
|||
die "No budgets defined, can't continue";
|
||||
}
|
||||
my $budget_id = @$budgets[0]->{'budget_id'};
|
||||
|
||||
#get all records from a batch, and check their import status to see if they are checked.
|
||||
#(default values: quantity 1, uncertainprice yes, first budget)
|
||||
|
||||
|
@ -139,14 +148,24 @@ if ($op eq ""){
|
|||
my $import_batch_id = $cgiparams->{'import_batch_id'};
|
||||
my $import_batch = Koha::ImportBatches->find($import_batch_id);
|
||||
my $overlay_action = $import_batch->overlay_action;
|
||||
my $import_records = Koha::Import::Records->search({
|
||||
my $import_records = Koha::Import::Records->search(
|
||||
{
|
||||
import_batch_id => $import_batch_id,
|
||||
});
|
||||
}
|
||||
);
|
||||
my $duplinbatch;
|
||||
my $imported = 0;
|
||||
my @import_record_id_selected = $input->multi_param("import_record_id");
|
||||
my @quantities = $input->multi_param('quantity');
|
||||
my @prices = $input->multi_param('price');
|
||||
my @orderreplacementprices = $input->multi_param('replacementprice');
|
||||
my @budgets_id = $input->multi_param('budget_id');
|
||||
my @discount = $input->multi_param('discount');
|
||||
my @sort1 = $input->multi_param('sort1');
|
||||
my @sort2 = $input->multi_param('sort2');
|
||||
my $matcher_id = $input->param('matcher_id');
|
||||
my $active_currency = Koha::Acquisition::Currencies->get_active;
|
||||
|
||||
while ( my $import_record = $import_records->next ) {
|
||||
my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information";
|
||||
my @homebranches = $input->multi_param( 'homebranch_' . $import_record->import_record_id );
|
||||
|
@ -212,20 +231,24 @@ if ($op eq ""){
|
|||
|
||||
# If all bibliographic records from the batch have been imported we modifying the status of the batch accordingly
|
||||
SetImportBatchStatus( $import_batch_id, 'imported' )
|
||||
if Koha::Import::Records->search({import_batch_id => $import_batch_id, status => 'imported' })->count
|
||||
== Koha::Import::Records->search({import_batch_id => $import_batch_id})->count;
|
||||
if Koha::Import::Records->search( { import_batch_id => $import_batch_id, status => 'imported' } )->count ==
|
||||
Koha::Import::Records->search( { import_batch_id => $import_batch_id } )->count;
|
||||
|
||||
# go to basket page
|
||||
if ($imported) {
|
||||
print $input->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=".$cgiparams->{'basketno'}."&duplinbatch=$duplinbatch");
|
||||
print $input->redirect(
|
||||
"/cgi-bin/koha/acqui/basket.pl?basketno=" . $cgiparams->{'basketno'} . "&duplinbatch=$duplinbatch" );
|
||||
} else {
|
||||
print $input->redirect("/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=$import_batch_id&basketno=".$cgiparams->{'basketno'}."&booksellerid=$booksellerid&allmatch=1");
|
||||
print $input->redirect( "/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=$import_batch_id&basketno="
|
||||
. $cgiparams->{'basketno'}
|
||||
. "&booksellerid=$booksellerid&allmatch=1" );
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
my $budgets = GetBudgets();
|
||||
my $budget_id = @$budgets[0]->{'budget_id'};
|
||||
|
||||
# build bookfund list
|
||||
my $patron = Koha::Patrons->find($loggedinuser)->unblessed;
|
||||
my $budget = GetBudget($budget_id);
|
||||
|
@ -236,7 +259,8 @@ my $budgets_hierarchy = GetBudgetHierarchy;
|
|||
foreach my $r ( @{$budgets_hierarchy} ) {
|
||||
next unless ( CanUserUseBudget( $patron, $r, $userflags ) );
|
||||
push @{$budget_loop},
|
||||
{ b_id => $r->{budget_id},
|
||||
{
|
||||
b_id => $r->{budget_id},
|
||||
b_txt => $r->{budget_name},
|
||||
b_code => $r->{budget_code},
|
||||
b_sort1_authcat => $r->{'sort1_authcat'},
|
||||
|
|
Loading…
Reference in a new issue