summaryrefslogtreecommitdiff
path: root/FS/FS/cust_event_fee.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-02-27 14:04:52 -0800
committerMark Wells <mark@freeside.biz>2014-02-27 15:08:21 -0800
commita0e00fa0547e99893c735ab3dbdacdb2bb054f5a (patch)
tree2784c6564ab363606a606fbbac56539006bb16a1 /FS/FS/cust_event_fee.pm
parent55190e4a18ff318cf2a0ac2eb6abaf7a3b95e087 (diff)
package fees and usage-based fees, #27687, #25899
Diffstat (limited to 'FS/FS/cust_event_fee.pm')
-rw-r--r--FS/FS/cust_event_fee.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/FS/FS/cust_event_fee.pm b/FS/FS/cust_event_fee.pm
index d924485..181640d 100644
--- a/FS/FS/cust_event_fee.pm
+++ b/FS/FS/cust_event_fee.pm
@@ -112,7 +112,8 @@ sub check {
=item by_cust CUSTNUM[, PARAMS]
Finds all cust_event_fee records belonging to the customer CUSTNUM. Currently
-fee events can be cust_main or cust_bill events; this will return both.
+fee events can be cust_main, cust_pkg, or cust_bill events; this will return
+all of them.
PARAMS can be additional params to pass to qsearch; this really only works
for 'hashref' and 'order_by'.
@@ -145,6 +146,15 @@ sub by_cust {
extra_sql => "$where eventtable = 'cust_bill' ".
"AND cust_bill.custnum = $custnum",
%params
+ }),
+ qsearch({
+ table => 'cust_event_fee',
+ addl_from => 'JOIN cust_event USING (eventnum) ' .
+ 'JOIN part_event USING (eventpart) ' .
+ 'JOIN cust_pkg ON (cust_event.tablenum = cust_pkg.pkgnum)',
+ extra_sql => "$where eventtable = 'cust_pkg' ".
+ "AND cust_pkg.custnum = $custnum",
+ %params
})
}