version 1.6, 2012/08/18 21:21:54 |
version 1.8, 2012/11/28 02:25:13 |
|
|
: $self->{_table}->{unpaid}; |
: $self->{_table}->{unpaid}; |
} |
} |
|
|
|
sub credits { |
|
my ( $self, $custid ) = @_; |
|
|
|
$self->_match_payments; |
|
return defined $custid |
|
? $self->{_table}->{credit}->{$custid} |
|
: $self->{_table}->{credit}; |
|
} |
|
|
sub save { |
sub save { |
my ($self) = @_; |
my ($self) = @_; |
|
|
|
|
delete $credit{$custid} unless $credit{$custid}; |
delete $credit{$custid} unless $credit{$custid}; |
} |
} |
|
|
foreach my $id ( sort { $b <=> $a } keys %owes ) { |
foreach my $id ( sort { $a <=> $b } keys %owes ) { |
my $i = $invoices->{$id}; |
my $i = $invoices->{$id}; |
my $custid = $i->{custid} or next; |
my $custid = $i->{custid} or next; |
|
|