8459e9ae48
TrsrDB: fixed Id -> credId autobalance -> make_transfers TrsrDB::Account: added history accessor TrsrDB::Balance: added fieds earned spent and even_until, renamed credit to available TrsrDB::CurrentArrears: fixed account -> debtor in relation declaration schema.sql: fixed triggers deactivated trigger enforceFixedCredit extended Balance with some more fields t/schema.{sql,out} trivial fixes t/schema.t added tests: Get balances after transfers partial use of credit, indirect transfers
20 lines
423 B
Perl
20 lines
423 B
Perl
use strict;
|
|
|
|
package TrsrDB::CurrentArrears;
|
|
use base qw/DBIx::Class::Core/;
|
|
|
|
__PACKAGE__->table('CurrentArrears');
|
|
__PACKAGE__->add_columns(qw/billId debtor targetCredit date purpose difference/);
|
|
__PACKAGE__->set_primary_key("billId");
|
|
|
|
__PACKAGE__->belongs_to(
|
|
debtor => 'TrsrDB::Account',
|
|
{ 'foreign.ID' => 'self.debtor' }
|
|
);
|
|
|
|
__PACKAGE__->many_to_many(
|
|
payable_with => debtor => 'available_credits'
|
|
);
|
|
|
|
1;
|