summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorjeff <jeff>2008-08-25 05:53:14 +0000
committerjeff <jeff>2008-08-25 05:53:14 +0000
commit4783789db90ba00a0e57077464c689bd082ffb0f (patch)
tree6d975ba0bbbd6a66016c254b1dbc25e9f218b887 /FS/FS
parent9698815f033fb517adb399dd437e6abc867a8528 (diff)
correct fallout from duplicate line items
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/Report/Table/Monthly.pm1
-rw-r--r--FS/FS/Schema.pm2
-rw-r--r--FS/FS/cust_bill_pkg.pm2
3 files changed, 3 insertions, 2 deletions
diff --git a/FS/FS/Report/Table/Monthly.pm b/FS/FS/Report/Table/Monthly.pm
index d75f0be79..0b8fca975 100644
--- a/FS/FS/Report/Table/Monthly.pm
+++ b/FS/FS/Report/Table/Monthly.pm
@@ -329,6 +329,7 @@ sub cust_bill_pkg {
LEFT JOIN cust_pkg USING ( pkgnum )
LEFT JOIN part_pkg USING ( pkgpart )
WHERE pkgnum != 0
+ AND ( duplicate IS NULL OR duplicate = '' )
AND $where
AND ". $self->in_time_period_and_agent($speriod, $eperiod, $agentnum)
);
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 530f632eb..3bcd078ab 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -500,7 +500,7 @@ sub tables_hashref {
'quantity', 'int', 'NULL', '', '', '',
'unitsetup', @money_typen, '', '',
'unitrecur', @money_typen, '', '',
- 'duplicate', 'char', 'NULL', 1, '', '', # does this need to be in db?
+ 'duplicate', 'char', 'NULL', 1, '', '',
'post_total', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'billpkgnum',
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index b3b8ea596..d3bf65bcb 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -370,7 +370,7 @@ sub owed_recur {
# modeled after cust_bill::owed...
sub owed {
my( $self, $field ) = @_;
- my $balance = $self->$field();
+ my $balance = $self->duplicate ? 0 : $self->$field();
$balance -= $_->amount foreach ( $self->cust_bill_pay_pkg($field) );
$balance -= $_->amount foreach ( $self->cust_credit_bill_pkg($field) );
$balance = sprintf( '%.2f', $balance );