Verknüpfte Belege Einkauf/Verkauf/Projekte: Listen nach Datum sortieren
[kivitendo-erp.git] / SL / DB / PurchaseInvoice.pm
1 package SL::DB::PurchaseInvoice;
2
3 use strict;
4
5 use Carp;
6
7 use SL::DB::MetaSetup::PurchaseInvoice;
8 use SL::DB::Manager::PurchaseInvoice;
9 use SL::DB::Helper::LinkedRecords;
10 # The calculator hasn't been adjusted for purchase invoices yet.
11 # use SL::DB::Helper::PriceTaxCalculator;
12
13 __PACKAGE__->meta->add_relationship(invoiceitems => { type         => 'one to many',
14                                                       class        => 'SL::DB::InvoiceItem',
15                                                       column_map   => { id => 'trans_id' },
16                                                       manager_args => { with_objects => [ 'part' ] }
17                                                     },
18                                    );
19
20 __PACKAGE__->meta->initialize;
21
22 sub items { goto &invoiceitems; }
23
24 sub is_sales {
25   # For compatibility with Order, DeliveryOrder
26   croak 'not an accessor' if @_ > 1;
27   return 0;
28 }
29
30 sub date {
31   goto &transdate;
32 }
33
34 1;