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

(-)a/acqui/neworderempty.pl (-55 / +61 lines)
Lines 102-125 use Koha::Subscriptions; Link Here
102
use Koha::UI::Form::Builder::Biblio;
102
use Koha::UI::Form::Builder::Biblio;
103
use Koha::AdditionalFields;
103
use Koha::AdditionalFields;
104
104
105
our $input           = CGI->new;
105
our $input        = CGI->new;
106
my $booksellerid    = $input->param('booksellerid');	# FIXME: else ERROR!
106
our $biblionumber = $input->param('biblionumber');
107
my $budget_id       = $input->param('budget_id') || 0;
107
our $basketno     = $input->param('basketno');
108
my $title           = $input->param('title');
108
our $breedingid   = $input->param('breedingid');
109
my $author          = $input->param('author');
109
my $booksellerid        = $input->param('booksellerid');           # FIXME: else ERROR!
110
my $publicationyear = $input->param('publicationyear');
110
my $budget_id           = $input->param('budget_id') || 0;
111
my $ordernumber          = $input->param('ordernumber') || '';
111
my $title               = $input->param('title');
112
our $biblionumber    = $input->param('biblionumber');
112
my $author              = $input->param('author');
113
our $basketno        = $input->param('basketno');
113
my $publicationyear     = $input->param('publicationyear');
114
my $suggestionid    = $input->param('suggestionid');
114
my $ordernumber         = $input->param('ordernumber') || '';
115
my $uncertainprice  = $input->param('uncertainprice');
115
my $suggestionid        = $input->param('suggestionid');
116
my $import_batch_id = $input->param('import_batch_id'); # if this is filled, we come from a staged file, and we will return here after saving the order !
116
my $uncertainprice      = $input->param('uncertainprice');
117
my $from_subscriptionid  = $input->param('from_subscriptionid');
117
my $from_subscriptionid = $input->param('from_subscriptionid');
118
my $frameworkcode        = $input->param('frameworkcode') // q{};
118
my $frameworkcode       = $input->param('frameworkcode') // q{};
119
our $breedingid          = $input->param('breedingid');
119
120
# if this is filled, we come from a staged file, and we will return here after saving the order !
121
my $import_batch_id = $input->param('import_batch_id');
122
120
my $data;
123
my $data;
121
my $new = 'no';
124
my $new = 'no';
122
my $op = $input->param('op') || q{};
125
my $op  = $input->param('op') || q{};
123
126
124
our ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
127
our ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
125
    {
128
    {
Lines 446-452 $template->param( Link Here
446
449
447
# fill template
450
# fill template
448
$template->param(
451
$template->param(
449
    existing         => $biblionumber,
452
    existing => $biblionumber,
453
450
    # basket informations
454
    # basket informations
451
    basketname           => $basket->{'basketname'},
455
    basketname           => $basket->{'basketname'},
452
    basketnote           => $basket->{'note'},
456
    basketnote           => $basket->{'note'},
Lines 458-511 $template->param( Link Here
458
    authorisedby         => $basket->{'authorisedby'},
462
    authorisedby         => $basket->{'authorisedby'},
459
    authorisedbyname     => $basket->{'authorisedbyname'},
463
    authorisedbyname     => $basket->{'authorisedbyname'},
460
    closedate            => $basket->{'closedate'},
464
    closedate            => $basket->{'closedate'},
465
461
    # order details
466
    # order details
462
    suggestionid         => $suggestion->{suggestionid},
467
    suggestionid         => $suggestion->{suggestionid},
463
    surnamesuggestedby   => $suggestion->{surnamesuggestedby},
468
    surnamesuggestedby   => $suggestion->{surnamesuggestedby},
464
    firstnamesuggestedby => $suggestion->{firstnamesuggestedby},
469
    firstnamesuggestedby => $suggestion->{firstnamesuggestedby},
465
    biblionumber         => $biblionumber,
470
    biblionumber         => $biblionumber,
466
    uncertainprice       => $data->{'uncertainprice'},
471
    uncertainprice       => $data->{'uncertainprice'},
467
    discount_2dp         => sprintf( "%.2f",  $bookseller->discount ) ,   # for display
472
    discount_2dp         => sprintf( "%.2f", $bookseller->discount ),      # for display
468
    discount             => $bookseller->discount,
473
    discount             => $bookseller->discount,
469
    orderdiscount_2dp    => sprintf( "%.2f", $data->{'discount'} || 0 ),
474
    orderdiscount_2dp    => sprintf( "%.2f", $data->{'discount'} || 0 ),
470
    orderdiscount        => $data->{'discount'},
475
    orderdiscount        => $data->{'discount'},
471
    order_internalnote   => $data->{'order_internalnote'},
476
    order_internalnote   => $data->{'order_internalnote'},
472
    order_vendornote     => $data->{'order_vendornote'},
477
    order_vendornote     => $data->{'order_vendornote'},
473
    listincgst       => $bookseller->listincgst,
478
    listincgst           => $bookseller->listincgst,
474
    invoiceincgst    => $bookseller->invoiceincgst,
479
    invoiceincgst        => $bookseller->invoiceincgst,
475
    cur_active_sym   => $active_currency->symbol,
480
    cur_active_sym       => $active_currency->symbol,
476
    cur_active       => $active_currency->currency,
481
    cur_active           => $active_currency->currency,
477
    currencies       => Koha::Acquisition::Currencies->search,
482
    currencies           => Koha::Acquisition::Currencies->search,
478
    currency         => $data->{currency},
483
    currency             => $data->{currency},
479
    vendor_currency  => $bookseller->listprice,
484
    vendor_currency      => $bookseller->listprice,
480
    orderexists      => ( $new eq 'yes' ) ? 0 : 1,
485
    orderexists          => ( $new eq 'yes' ) ? 0 : 1,
481
    title            => $data->{'title'},
486
    title                => $data->{'title'},
482
    author           => $data->{'author'},
487
    author               => $data->{'author'},
483
    publicationyear  => $data->{'publicationyear'} ? $data->{'publicationyear'} : $data->{'copyrightdate'},
488
    publicationyear      => $data->{'publicationyear'} ? $data->{'publicationyear'} : $data->{'copyrightdate'},
484
    editionstatement => $data->{'editionstatement'},
489
    editionstatement     => $data->{'editionstatement'},
485
    budget_loop      => $budget_loop,
490
    budget_loop          => $budget_loop,
486
    isbn             => $data->{'isbn'},
491
    isbn                 => $data->{'isbn'},
487
    ean              => $data->{'ean'},
492
    ean                  => $data->{'ean'},
488
    seriestitle      => $data->{'seriestitle'},
493
    seriestitle          => $data->{'seriestitle'},
489
    itemtypeloop     => \@itemtypes,
494
    itemtypeloop         => \@itemtypes,
490
    quantity         => $quantity,
495
    quantity             => $quantity,
491
    quantityrec      => $quantity,
496
    quantityrec          => $quantity,
492
    quantitysugg      => $data->{quantitysugg},
497
    quantitysugg         => $data->{quantitysugg},
493
    rrp              => $data->{'rrp'},
498
    rrp                  => $data->{'rrp'},
494
    replacementprice => $data->{'replacementprice'},
499
    replacementprice     => $data->{'replacementprice'},
495
    gst_values       => \@gst_values,
500
    gst_values           => \@gst_values,
496
    tax_rate         => $data->{tax_rate_on_ordering} ? $data->{tax_rate_on_ordering}+0.0 : $bookseller->tax_rate ? $bookseller->tax_rate+0.0 : 0,
501
    tax_rate             => $data->{tax_rate_on_ordering} ? $data->{tax_rate_on_ordering} + 0.0
497
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
502
    : $bookseller->tax_rate ? $bookseller->tax_rate + 0.0
498
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
503
    : 0,
499
    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
504
    listprice => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice ),
500
    unitprice        => sprintf( "%.2f", $data->{unitprice} || 0),
505
    total     => sprintf( "%.2f", ( $data->{ecost} || 0 ) * ( $data->{'quantity'} || 0 ) ),
501
    publishercode    => $data->{'publishercode'},
506
    ecost     => sprintf( "%.2f", $data->{ecost}     || 0 ),
502
    barcode_subfield => $barcode_subfield,
507
    unitprice => sprintf( "%.2f", $data->{unitprice} || 0 ),
503
    import_batch_id  => $import_batch_id,
508
    publishercode                                    => $data->{'publishercode'},
504
    acqcreate        => $basketobj->effective_create_items eq "ordering" ? 1 : "",
509
    barcode_subfield                                 => $barcode_subfield,
505
    users_ids        => join(':', @order_user_ids),
510
    import_batch_id                                  => $import_batch_id,
506
    users            => \@order_users,
511
    acqcreate                                        => $basketobj->effective_create_items eq "ordering" ? 1 : "",
507
    (uc(C4::Context->preference("marcflavour"))) => 1,
512
    users_ids                                        => join( ':', @order_user_ids ),
508
    estimated_delivery_date => $data->{estimated_delivery_date},
513
    users                                            => \@order_users,
514
    ( uc( C4::Context->preference("marcflavour") ) ) => 1,
515
    estimated_delivery_date                          => $data->{estimated_delivery_date},
509
);
516
);
510
517
511
output_html_with_http_headers $input, $cookie, $template->output;
518
output_html_with_http_headers $input, $cookie, $template->output;
512
- 

Return to bug 36620