1 # This file has been auto-generated only because it didn't exist.
2 # Feel free to modify it at will; it will not be overwritten automatically.
4 package SL::DB::AccTransaction;
8 use SL::DB::MetaSetup::AccTransaction;
10 __PACKAGE__->meta->initialize;
12 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
13 __PACKAGE__->meta->make_manager_class;
18 my @classes = qw(Invoice PurchaseInvoice GLTransaction);
20 foreach my $class ( @classes ) {
21 $class = 'SL::DB::' . $class;
22 my $record = $class->new(id => $self->trans_id);
23 return $record if $record->load(speculative => 1);
36 SL::DB::AccTransaction: Rose model for transactions (table "acc_trans")
44 Returns the ar, ap or gl object of the current acc_trans object.
47 my $acc_trans = SL::DB::Manager::AccTransaction->find_by( trans_id => '427' );
48 my $record = $acc_trans->record;
50 Each acc_trans entry is associated with an ar, ap or gl record. If we only have
51 an acc_trans object, and we want to find out which kind of record it belongs
52 to, we have to look for its trans_id in the tables ar, ap and gl. C<record>
53 does this for you and returns an Invoice, PurchaseInvoice or GLTransaction
56 We use the Rose::DB::Object load function with the C<speculative> parameter for
57 each record type, which returns true if the load was successful, so we don't
58 bother to check the ref of the object.
68 G. Richardson E<lt>information@kivitendo-premium.deE<gt>