diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-12-09 10:30:54 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-12-09 10:30:54 -0800 |
commit | 93e3a52f23c3473207f29f36cda06adfe221353f (patch) | |
tree | 350bda2d2d5906f1f2d8756e30a59fc61bf786b5 /FS/FS/cust_bill_pkg.pm | |
parent | b62f98268b17471c7b195d7d193b33c4a6915892 (diff) |
create credits by selecting line items, RT#18676
Diffstat (limited to 'FS/FS/cust_bill_pkg.pm')
-rw-r--r-- | FS/FS/cust_bill_pkg.pm | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index 826569b25..a83af1326 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -665,8 +665,9 @@ sub set_display { =item disintegrate -Returns a list of cust_bill_pkg objects each with no more than a single class -(including setup or recur) of charge. +Returns a hash: keys are "setup", "recur" or usage classnum, values are +FS::cust_bill_pkg objects, each with no more than a single class (setup or +recur) of charge. =cut @@ -843,6 +844,18 @@ sub _X_show_zero { $self->cust_pkg->_X_show_zero($what); } +=item credited [ BEFORE, AFTER, OPTIONS ] + +Returns the sum of credits applied to this item. Arguments are the same as +owed_sql/paid_sql/credited_sql. + +=cut + +sub credited { + my $self = shift; + $self->scalar_sql('SELECT '. $self->credited_sql(@_).' FROM cust_bill_pkg WHERE billpkgnum = ?', $self->billpkgnum); +} + =back =head1 CLASS METHODS |