treasuredb/TrsrDB/History.pm
2017-01-29 16:08:28 +01:00

25 lines
518 B
Perl

use strict;
package TrsrDB::History;
use base qw/DBIx::Class::Core/;
__PACKAGE__->table('History');
__PACKAGE__->add_columns(qw/date purpose category account credId credit debit contra billId note/);
__PACKAGE__->belongs_to(
account => 'TrsrDB::Account',
{ 'foreign.ID' => 'self.account' }
);
__PACKAGE__->belongs_to(
this_credit => 'TrsrDB::Credit',
{ 'foreign.credId' => 'self.credId' }
);
__PACKAGE__->belongs_to(
that_credit => 'TrsrDB::Credit',
{ 'foreign.credId' => 'self.contra' }
);
1;