X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_event_fee.pm;h=181640ddcd00cf5b8f3230776861b1f774d4487c;hp=78794fdfefdd2717056f504a3e0b7dcf8477c126;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hpb=439d00a59c67a7d9d53b5d89c14ab332be16e38b diff --git a/FS/FS/cust_event_fee.pm b/FS/FS/cust_event_fee.pm index 78794fdfe..181640ddc 100644 --- a/FS/FS/cust_event_fee.pm +++ b/FS/FS/cust_event_fee.pm @@ -45,6 +45,9 @@ time billing runs for the customer. =item feepart - key of the fee definition (L). +=item nextbill - 'Y' if the fee should be charged on the customer's next +bill, rather than causing a bill to be produced immediately. + =back =head1 METHODS @@ -93,6 +96,7 @@ sub check { || $self->ut_foreign_key('eventnum', 'cust_event', 'eventnum') || $self->ut_foreign_keyn('billpkgnum', 'cust_bill_pkg', 'billpkgnum') || $self->ut_foreign_key('feepart', 'part_fee', 'feepart') + || $self->ut_flag('nextbill') ; return $error if $error; @@ -108,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'. @@ -141,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 }) }