summaryrefslogtreecommitdiff
path: root/FS/FS/svc_acct.pm
diff options
context:
space:
mode:
authorivan <ivan>2010-08-07 10:11:43 +0000
committerivan <ivan>2010-08-07 10:11:43 +0000
commit96bcb3256650a35d57c2ac487e990b78a2f88a74 (patch)
treed1904b8798608c73c57c7dadb9f013cc478203ab /FS/FS/svc_acct.pm
parentb3205ddf480401284a5fc4ccbcb45d9c42b0bcf9 (diff)
communigate phase 3: RPOP/acct_snarf, RT#7515
Diffstat (limited to 'FS/FS/svc_acct.pm')
-rw-r--r--FS/FS/svc_acct.pm23
1 files changed, 17 insertions, 6 deletions
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 801c46533..c301bcd87 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -47,6 +47,7 @@ use FS::part_export;
use FS::svc_forward;
use FS::svc_www;
use FS::cdr;
+use FS::acct_snarf;
$DEBUG = 0;
$me = '[FS::svc_acct]';
@@ -1929,17 +1930,27 @@ sub email {
=item acct_snarf
Returns an array of FS::acct_snarf records associated with the account.
-If the acct_snarf table does not exist or there are no associated records,
-an empty list is returned
=cut
sub acct_snarf {
my $self = shift;
- return () unless dbdef->table('acct_snarf');
- eval "use FS::acct_snarf;";
- die $@ if $@;
- qsearch('acct_snarf', { 'svcnum' => $self->svcnum } );
+ qsearch({
+ 'table' => 'acct_snarf',
+ 'hashref' => { 'svcnum' => $self->svcnum },
+ #'order_by' => 'ORDER BY priority ASC',
+ });
+}
+
+=item cgp_rpop_hashref
+
+Returns an arrayref of RPOP data suitable for Communigate Pro API commands.
+
+=cut
+
+sub cgp_rpop_hashref {
+ my $self = shift;
+ { map { $_->snarfname => $_->cgp_hashref } $self->acct_snarf };
}
=item decrement_upbytes OCTETS