Various changes and fixes: Added report, etc. Tests pass.

* reworked and used TrsrDB::expand_ids more tightly
  * account item selection in TrsrDB::make_transfers
  * web_auth / User relation for coming HTTP interface
  * income and target inter-relations between TrsrDB::Credit and TrsrDB::Debit
  * Transfer note
  * reactivated enforceFixedCredit to take effect unless _temp table is empty
  * added CreditsInFocus and Report views
This commit is contained in:
Florian "flowdy" Heß
2017-01-14 09:50:16 +01:00
parent 440453e4e6
commit 3773c3f123
7 changed files with 111 additions and 30 deletions

View File

@@ -34,5 +34,9 @@ __PACKAGE__->has_many(
history => 'TrsrDB::History',
{ 'foreign.account' => 'self.ID' }
);
__PACKAGE__->has_many(
report => 'TrsrDB::Report',
{ 'foreign.account' => 'self.ID' }
);
1;

View File

@@ -19,7 +19,12 @@ __PACKAGE__->belongs_to(
__PACKAGE__->has_many(
outgoings => 'TrsrDB::Transfer',
{ 'foreign.fromCredit' => 'self.Id' }
{ 'foreign.fromCredit' => 'self.credId' }
);
__PACKAGE__->has_many(
income => 'TrsrDB::Debit',
{ 'foreign.targetCredit' => 'self.credId' }
);
__PACKAGE__->many_to_many(

View File

@@ -18,6 +18,11 @@ __PACKAGE__->belongs_to(
{ 'foreign.ID' => 'self.debtor' }
);
__PACKAGE__->might_have(
target => 'TrsrDB::Credit',
{ 'foreign.credId' => 'self.targetCredit' }
);
__PACKAGE__->has_many(
incomings => 'TrsrDB::Transfer', 'billId'
);

View File

@@ -8,6 +8,7 @@ __PACKAGE__->add_column("timestamp" => { data_type => 'TIMESTAMP' });
__PACKAGE__->add_column("billId");
__PACKAGE__->add_column("credId" => { data_type => 'INTEGER' });
__PACKAGE__->add_column("amount" => { data_type => 'INTEGER', nullable => 1 });
__PACKAGE__->add_column("note" => { nullable => 1 });
__PACKAGE__->set_primary_key("billId", "credId");
__PACKAGE__->belongs_to(