+ $hash{'servicename'} = ( $svc_acct->radius_groups )[0];
+
+ my $cust_pkg = $svc_acct->cust_svc->cust_pkg;
+ $hash{'validto'} = $cust_pkg->bill
+ if $cust_pkg && $cust_pkg->part_pkg->is_prepaid && $cust_pkg->bill;
+
+ #some other random stuff, should probably be attributes or virtual fields
+ #$hash{'state'} = 0; #only inserts
+ #$hash{'badlogins'} = 0; #only inserts
+ $hash{'maxlogins'} = 1;
+ $hash{'addeddate'} = $cust_pkg->setup
+ if $cust_pkg && $cust_pkg->setup;
+ $hash{'validfrom'} = $cust_pkg->last_bill || $cust_pkg->setup
+ if $cust_pkg && ( $cust_pkg->last_bill || $cust_pkg->setup );
+ $hash{'state'} = $cust_pkg->susp ? 1 : 0
+ if $cust_pkg;
+