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

(-)a/acqui/invoice.pl (-8 / +8 lines)
Lines 131-141 elsif ( $op && $op eq 'mod' ) { Link Here
131
    my @additional_fields;
131
    my @additional_fields;
132
    my $invoice_fields = Koha::AdditionalFields->search({ tablename => 'aqinvoices' });
132
    my $invoice_fields = Koha::AdditionalFields->search({ tablename => 'aqinvoices' });
133
    while ( my $field = $invoice_fields->next ) {
133
    while ( my $field = $invoice_fields->next ) {
134
        my $value = $input->param('additional_field_' . $field->id);
134
        my @field_values = $input->param( 'additional_field_' . $field->id );
135
        push @additional_fields, {
135
        foreach my $value (@field_values) {
136
            id => $field->id,
136
            push @additional_fields, {
137
            value => $value,
137
                id    => $field->id,
138
        };
138
                value => $value,
139
            } if $value;
140
        }
139
    }
141
    }
140
    Koha::Acquisition::Invoices->find($invoiceid)->set_additional_fields(\@additional_fields);
142
    Koha::Acquisition::Invoices->find($invoiceid)->set_additional_fields(\@additional_fields);
141
143
Lines 320-328 if ( $adjustments ) { $template->param( adjustments => $adjustments ); } Link Here
320
my $invoice = Koha::Acquisition::Invoices->find($invoiceid);
322
my $invoice = Koha::Acquisition::Invoices->find($invoiceid);
321
$template->param(
323
$template->param(
322
    available_additional_fields => Koha::AdditionalFields->search( { tablename => 'aqinvoices' } ),
324
    available_additional_fields => Koha::AdditionalFields->search( { tablename => 'aqinvoices' } ),
323
    additional_field_values => { map {
325
    additional_field_values => $invoice->get_additional_field_values_for_template,
324
                $_->field->id => $_->value
325
            } $invoice->additional_field_values->as_list },
326
);
326
);
327
327
328
$template->param(
328
$template->param(
(-)a/acqui/parcels.pl (-3 / +3 lines)
Lines 134-145 if ($op and $op eq 'confirm') { Link Here
134
        my @additional_fields;
134
        my @additional_fields;
135
        my $invoice_fields = Koha::AdditionalFields->search({ tablename => 'aqinvoices' });
135
        my $invoice_fields = Koha::AdditionalFields->search({ tablename => 'aqinvoices' });
136
        while ( my $field = $invoice_fields->next ) {
136
        while ( my $field = $invoice_fields->next ) {
137
            my $value = $input->param('additional_field_' . $field->id);
137
            my @field_values = $input->param( 'additional_field_' . $field->id );
138
            if (defined $value) {
138
            foreach my $value (@field_values) {
139
                push @additional_fields, {
139
                push @additional_fields, {
140
                    id    => $field->id,
140
                    id    => $field->id,
141
                    value => $value,
141
                    value => $value,
142
                };
142
                } if $value;
143
            }
143
            }
144
        }
144
        }
145
        if (@additional_fields) {
145
        if (@additional_fields) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt (+1 lines)
Lines 537-542 Link Here
537
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
537
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
538
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
538
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
539
    [% Asset.js("js/acq.js") | $raw %]
539
    [% Asset.js("js/acq.js") | $raw %]
540
    [% Asset.js("js/additional-fields-entry.js") | $raw %]
540
    [% INCLUDE 'calendar.inc' %]
541
    [% INCLUDE 'calendar.inc' %]
541
    [% INCLUDE 'datatables.inc' %]
542
    [% INCLUDE 'datatables.inc' %]
542
    <script>
543
    <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (+1 lines)
Lines 390-395 Link Here
390
                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
390
                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
391
                                </select>
391
                                </select>
392
                            </li>
392
                            </li>
393
                        [%# FIXME additional-fields.entry.inc should/could be considered here %]
393
                        [% FOR field IN additional_fields_for_invoice %]
394
                        [% FOR field IN additional_fields_for_invoice %]
394
                            <li>
395
                            <li>
395
                                <label for="additional_field_[% field.id | html %]ID"> [% field.name | html %]: </label>
396
                                <label for="additional_field_[% field.id | html %]ID"> [% field.name | html %]: </label>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt (-1 / +1 lines)
Lines 241-246 Link Here
241
241
242
[% MACRO jsinclude BLOCK %]
242
[% MACRO jsinclude BLOCK %]
243
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
243
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
244
    [% Asset.js("js/additional-fields-entry.js") | $raw %]
244
    [% INCLUDE 'calendar.inc' %]
245
    [% INCLUDE 'calendar.inc' %]
245
    [% INCLUDE 'datatables.inc' %]
246
    [% INCLUDE 'datatables.inc' %]
246
    <script>
247
    <script>
247
- 

Return to bug 35044