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

(-)a/Koha/Acquisition/Basket.pm (+24 lines)
Lines 96-101 sub orders { Link Here
96
    return Koha::Acquisition::Orders->_new_from_dbic( $orders_rs );
96
    return Koha::Acquisition::Orders->_new_from_dbic( $orders_rs );
97
}
97
}
98
98
99
=head3 edi_order
100
101
  my $edi_order = $basket->edi_order;
102
103
Returns the most recently attached EDI order object if one exists for the basket.
104
105
NOTE: This currently returns a bare DBIx::Class result or undefined. This is consistent with the rest of EDI;
106
However it would be beneficial to convert these to full fledge Koha::Objects in the future.
107
108
=cut
109
110
sub edi_order {
111
    my ($self) = @_;
112
113
    my $order_rs = $self->_result->edifact_messages(
114
        {
115
            message_type => 'ORDERS',
116
            deleted      => 0
117
        },
118
        { order_by => { '-desc' => 'transfer_date' }, rows => 1 }
119
    );
120
    return $order_rs->single;
121
}
122
99
=head3 effective_create_items
123
=head3 effective_create_items
100
124
101
Returns C<create_items> for this basket, falling back to C<AcqCreateItem> if unset.
125
Returns C<create_items> for this basket, falling back to C<AcqCreateItem> if unset.
(-)a/acqui/basket.pl (+4 lines)
Lines 380-385 if ( $op eq 'list' ) { Link Here
380
        last;
380
        last;
381
    }
381
    }
382
382
383
    my $basket_obj = Koha::Acquisition::Baskets->find($basketno);
384
    my $edi_order = $basket_obj->edi_order;
385
383
    $template->param(
386
    $template->param(
384
        basketno             => $basketno,
387
        basketno             => $basketno,
385
        basket               => $basket,
388
        basket               => $basket,
Lines 391-396 if ( $op eq 'list' ) { Link Here
391
        basketcontractname   => $contract->{contractname},
394
        basketcontractname   => $contract->{contractname},
392
        branches_loop        => \@branches_loop,
395
        branches_loop        => \@branches_loop,
393
        creationdate         => $basket->{creationdate},
396
        creationdate         => $basket->{creationdate},
397
        edi_order            => $edi_order,
394
        authorisedby         => $basket->{authorisedby},
398
        authorisedby         => $basket->{authorisedby},
395
        authorisedbyname     => $basket->{authorisedbyname},
399
        authorisedbyname     => $basket->{authorisedbyname},
396
        users_ids            => join(':', @basketusers_ids),
400
        users_ids            => join(':', @basketusers_ids),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-1 / +14 lines)
Lines 314-319 Link Here
314
                        [% IF ( closedate ) %]
314
                        [% IF ( closedate ) %]
315
                            <li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>
315
                            <li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>
316
                        [% END %]
316
                        [% END %]
317
                        [% IF ( ediaccount ) %]
318
                            [%- BLOCK edi_status -%]
319
                                [%- SWITCH edi_order.status -%]
320
                                    [%- CASE 'Pending'   -%]Pending
321
                                    [%- CASE 'Sent'      -%]Sent
322
                                    [%- CASE 'Processed' -%]Processed
323
                                [%- END -%]
324
                            [%- END -%]
325
                            [% IF ( edi_order ) %]
326
                            <li><span class="label">EDI status:</span> [%- PROCESS edi_status edi_order=edi_order -%] ([% edi_order.transfer_date | $KohaDates %])</li>
327
                            [% ELSE %]
328
                            <li><span class="label">EDI status:</span> Not ordered</li>
329
                            [% END %]
330
                        [% END %]
317
                        [% IF ( estimateddeliverydate ) %]
331
                        [% IF ( estimateddeliverydate ) %]
318
                            <li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates %]</li>
332
                            <li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates %]</li>
319
                        [% END %]
333
                        [% END %]
320
- 

Return to bug 28640