sub outstanding_debits {
my ($self) = @_;
- my $lines = $self->lines->search(
+ return $self->lines->search(
{
+ amount => { '>' => 0 },
amountoutstanding => { '>' => 0 }
}
);
-
- return $lines;
}
=head3 outstanding_credits
sub outstanding_credits {
my ($self) = @_;
- my $lines = $self->lines->search(
+ return $self->lines->search(
{
+ amount => { '<' => 0 },
amountoutstanding => { '<' => 0 }
}
);
-
- return $lines;
}
=head3 non_issues_charges
);
}
-=head3 normalize_balance
+=head3 reconcile_balance
-$account->normalize_balance();
+$account->reconcile_balance();
-Find outstanding credits and use them to pay outstanding debits
+Find outstanding credits and use them to pay outstanding debits.
+Currently, this implicitly uses the 'First In First Out' rule for
+applying credits against debits.
=cut
-sub normalize_balance {
+sub reconcile_balance {
my ($self) = @_;
my $outstanding_debits = $self->outstanding_debits;