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 'cud-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 'cud-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 542-547 Link Here
542
    [% Asset.js("js/form-submit.js") | $raw %]
542
    [% Asset.js("js/form-submit.js") | $raw %]
543
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
543
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
544
    [% Asset.js("js/acq.js") | $raw %]
544
    [% Asset.js("js/acq.js") | $raw %]
545
    [% Asset.js("js/additional-fields-entry.js") | $raw %]
545
    [% INCLUDE 'calendar.inc' %]
546
    [% INCLUDE 'calendar.inc' %]
546
    [% INCLUDE 'datatables.inc' %]
547
    [% INCLUDE 'datatables.inc' %]
547
    <script>
548
    <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (+1 lines)
Lines 385-390 Link Here
385
                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
385
                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
386
                                </select>
386
                                </select>
387
                            </li>
387
                            </li>
388
                        [%# FIXME additional-fields.entry.inc should/could be considered here %]
388
                        [% FOR field IN additional_fields_for_invoice %]
389
                        [% FOR field IN additional_fields_for_invoice %]
389
                            <li>
390
                            <li>
390
                                <label for="additional_field_[% field.id | html %]ID"> [% field.name | html %]: </label>
391
                                <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 244-249 Link Here
244
244
245
[% MACRO jsinclude BLOCK %]
245
[% MACRO jsinclude BLOCK %]
246
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
246
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
247
    [% Asset.js("js/additional-fields-entry.js") | $raw %]
247
    [% INCLUDE 'calendar.inc' %]
248
    [% INCLUDE 'calendar.inc' %]
248
    [% INCLUDE 'datatables.inc' %]
249
    [% INCLUDE 'datatables.inc' %]
249
    <script>
250
    <script>
250
- 

Return to bug 35044