Lines 117-133
if it is an order from an existing suggestion : the id of this suggestion.
Link Here
|
117 |
=cut |
117 |
=cut |
118 |
|
118 |
|
119 |
use Modern::Perl; |
119 |
use Modern::Perl; |
120 |
use CGI qw ( -utf8 ); |
120 |
use CGI qw ( -utf8 ); |
121 |
use JSON qw ( to_json encode_json ); |
121 |
use JSON qw ( to_json encode_json ); |
122 |
|
122 |
|
123 |
use C4::Acquisition qw( FillWithDefaultValues ModOrderUsers ); |
123 |
use C4::Acquisition qw( FillWithDefaultValues ModOrderUsers ); |
124 |
use C4::Auth qw( get_template_and_user ); |
124 |
use C4::Auth qw( get_template_and_user ); |
125 |
use C4::Barcodes; |
125 |
use C4::Barcodes; |
126 |
use C4::Biblio qw( AddBiblio GetMarcFromKohaField TransformHtmlToXml TransformKohaToMarc ); |
126 |
use C4::Biblio qw( AddBiblio GetMarcFromKohaField TransformHtmlToXml TransformKohaToMarc ); |
127 |
use C4::Budgets qw( GetBudget GetBudgetSpent GetBudgetOrdered FieldsForCalculatingFundValues ); |
127 |
use C4::Budgets qw( GetBudget GetBudgetSpent GetBudgetOrdered FieldsForCalculatingFundValues ); |
128 |
use C4::Items qw( AddItemFromMarc ); |
128 |
use C4::Items qw( AddItemFromMarc ); |
129 |
use C4::Log qw( logaction ); |
129 |
use C4::Log qw( logaction ); |
130 |
use C4::Output qw( output_html_with_http_headers ); |
130 |
use C4::Output qw( output_html_with_http_headers ); |
131 |
use C4::Suggestions qw( ModSuggestion ); |
131 |
use C4::Suggestions qw( ModSuggestion ); |
132 |
use Koha::Acquisition::Baskets; |
132 |
use Koha::Acquisition::Baskets; |
133 |
use Koha::Acquisition::Currencies qw( get_active ); |
133 |
use Koha::Acquisition::Currencies qw( get_active ); |
Lines 387-403
if ( $op eq 'cud-order' ) {
Link Here
|
387 |
ModOrderUsers( $order->ordernumber, @order_users ); |
387 |
ModOrderUsers( $order->ordernumber, @order_users ); |
388 |
|
388 |
|
389 |
# Retrieve and save additional fields values |
389 |
# Retrieve and save additional fields values |
390 |
my @additional_fields = Koha::AdditionalFields->search( { tablename => 'aqorders' } )->as_list; |
390 |
my @additional_fields; |
391 |
my @additional_field_values; |
391 |
my $order_fields = Koha::AdditionalFields->search( { tablename => 'aqorders' } ); |
392 |
foreach my $af (@additional_fields) { |
392 |
while ( my $field = $order_fields->next ) { |
393 |
my $id = $af->id; |
393 |
my @field_values = $input->param( 'additional_field_' . $field->id ); |
394 |
my $value = $input->param("additional_field_$id"); |
394 |
foreach my $value (@field_values){ |
395 |
push @additional_field_values, { |
395 |
push @additional_fields, |
396 |
id => $id, |
396 |
{ |
397 |
value => $value, |
397 |
id => $field->id, |
|
|
398 |
value => $value, |
399 |
} if $value; |
398 |
}; |
400 |
}; |
399 |
} |
401 |
} |
400 |
$order->set_additional_fields( \@additional_field_values ); |
402 |
$order->set_additional_fields( \@additional_fields ); |
401 |
|
403 |
|
402 |
# now, add items if applicable |
404 |
# now, add items if applicable |
403 |
if ( $basket->effective_create_items eq 'ordering' ) { |
405 |
if ( $basket->effective_create_items eq 'ordering' ) { |
Lines 482-485
if ( $op eq 'cud-order' ) {
Link Here
|
482 |
print $input->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=$basketno"); |
484 |
print $input->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=$basketno"); |
483 |
exit; |
485 |
exit; |
484 |
} |
486 |
} |
485 |
|
|
|