%info = (
'name' => 'Free (or setup fee) for X days, then base rate'.
' (anniversary billing)',
+ 'shortname' => 'Bulk (manual from "units" option), w/intro period',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
],
#'setup' => '\'my $d = $cust_pkg->bill || $time; $d += 86400 * \' + what.free_days.value + \'; $cust_pkg->bill($d); $cust_pkg_mod_flag=1; \' + what.setup_fee.value',
#'recur' => 'what.recur_fee.value',
- 'weight' => 50,
+ 'weight' => 54, #&g!
);
sub calc_setup {
%info = (
'name' => 'Base rate (anniversary billing, Times units ordered)',
+ # XXX it multiplies recurring fee by cust_pkg option "units", how to
+ # express that
+ 'shortname' => 'Bulk (manual from "units" option)',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
},
'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit',
'externalid' ],
- 'weight' => 10,
+ 'weight' => 52,
);
sub calc_setup {
},
'fieldorder' => [ 'setup_fee', 'recur_fee', 'svc_setup_fee', 'svc_recur_fee',
'unused_credit', ],
- 'weight' => 55,
+ 'weight' => 50,
);
sub calc_recur {
%info = (
'name' => 'Flat rate (anniversary billing)',
+ 'shortname' => 'Anniversary',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
%info = (
'name' => 'Flat rate with recurring commission per (any) active package',
+ 'shortname' => 'Commission per (any) active package',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
%info = (
'name' => 'Flat rate with recurring commission per active customer',
+ 'shortname' => 'Commission per active customer',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
%info = (
'name' => 'Flat rate with recurring commission per (selected) active package',
+ 'shortname' => 'Commission per (selected) active package',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
%info = (
'name' => 'Free (or setup fee) for X days, then flat rate'.
' (anniversary billing)',
+ 'shortname' => 'Anniversary, with intro period',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
],
#'setup' => '\'my $d = $cust_pkg->bill || $time; $d += 86400 * \' + what.free_days.value + \'; $cust_pkg->bill($d); $cust_pkg_mod_flag=1; \' + what.setup_fee.value',
#'recur' => 'what.recur_fee.value',
- 'weight' => 50,
+ 'weight' => 12,
);
sub calc_setup {
%info = (
'name' => 'Introductory price for X months, then flat rate,'.
'relative to setup date (anniversary billing)',
+ 'shortname' => 'Anniversary, with intro price',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
},
},
'fieldorder' => [ 'setup_fee', 'intro_duration', 'intro_fee', 'recur_fee', 'unused_credit' ],
- 'weight' => 150,
+ 'weight' => 14,
);
sub calc_recur {
%info = (
'name' => 'Prepaid, flat rate',
+ #'name' => 'Prepaid (no automatic recurring)', #maybe use it here too
+ 'shortname' => 'Prepaid, no automatic cycle',
'fields' => {
'setup_fee' => { 'name' => 'One-time setup fee for this package',
'default' => 0,
%info = (
'name' => 'First partial month pro-rated, then flat-rate (selectable billing day)',
+ 'shortname' => 'Prorate (Nth of month billing)',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
%info = (
'name' => 'Free (or setup fee) for X days, then prorate, then flat-rate ' .
'(1st of month billing)',
+ 'shortname' => 'Prorate (Nth of month billing), with intro period', #??
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
'fieldorder' => [ 'free_days', 'setup_fee', 'recur_fee', 'unused_credit' ],
#'setup' => '\'my $d = $cust_pkg->bill || $time; $d += 86400 * \' + what.free_days.value + \'; $cust_pkg->bill($d); $cust_pkg_mod_flag=1; \' + what.setup_fee.value',
#'recur' => 'what.recur_fee.value',
- 'weight' => 50,
+ 'weight' => 22,
);
sub calc_setup {
%info = (
'name' => 'Base charge plus charge per-hour from the session monitor',
+ 'shortname' => 'Session monitor (per-hour)',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
%info = (
'name' => 'Base charge plus charge per-minute from the session monitor',
+ 'shortname' => 'Session monitor (per-minute)',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
%info = (
'name' => 'Base charge plus additional fees for external services from a configurable SQL query',
+ 'shortname' => 'External SQL query',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
'fieldorder' => [qw( setup_fee recur_flat unused_credit datasrc db_username db_password query )],
#'setup' => 'what.setup_fee.value',
#'recur' => q!'my $dbh = DBI->connect("' + what.datasrc.value + '", "' + what.db_username.value + '", "' + what.db_password.value + '" ) or die $DBI::errstr; my $sth = $dbh->prepare("' + what.query.value + '") or die $dbh->errstr; my $price = ' + what.recur_flat.value + '; foreach my $cust_svc ( grep { $_->part_svc->svcdb eq "svc_external" } $cust_pkg->cust_svc ){ my $id = $cust_svc->svc_x->id; $sth->execute($id) or die $sth->errstr; $price += $sth->fetchrow_arrayref->[0]; } $price;'!,
- 'weight' => '72',
+ 'weight' => '58',
);
sub calc_recur {
%info = (
'name' => 'Base charge plus a per-domain metered rate from a configurable SQL query',
+ 'shortname' => 'Bulk (per-domain from SQL query)',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
# 'recur' => '\'my $dbh = DBI->connect(\"\' + what.datasrc.value + \'\", \"\' + what.db_username.value + \'\") or die $DBI::errstr; \'',
#'recur' => '\'my $dbh = DBI->connect(\"\' + what.datasrc.value + \'\", \"\' + what.db_username.value + \'\", \"\' + what.db_password.value + \'\" ) or die $DBI::errstr; my $sth = $dbh->prepare(\"\' + what.query.value + \'\") or die $dbh->errstr; my $units = 0; foreach my $cust_svc ( grep { $_->part_svc->svcdb eq \"svc_domain\" } $cust_pkg->cust_svc ) { my $domain = $cust_svc->svc_x->domain; $sth->execute($domain) or die $sth->errstr; $units += $sth->fetchrow_arrayref->[0]; } $units -= \' + what.recur_included.value + \'; $units = 0 if $units < 0; \' + what.recur_flat.value + \' + $units * \' + what.recur_unit_charge.value + \';\'',
#'recur' => '\'my $dbh = DBI->connect("\' + what.datasrc.value + \'", "\' + what.db_username.value + \'", "\' what.db_password.value + \'" ) or die $DBI::errstr; my $sth = $dbh->prepare("\' + what.query.value + \'") or die $dbh->errstr; my $units = 0; foreach my $cust_svc ( grep { $_->part_svc->svcdb eq "svc_domain" } $cust_pkg->cust_svc ) { my $domain = $cust_svc->svc_x->domain; $sth->execute($domain) or die $sth->errstr; $units += $sth->fetchrow_arrayref->[0]; } $units -= \' + what.recur_included.value + \'; $units = 0 if $units < 0; \' + what.recur_flat.value + \' + $units * \' + what.recur_unit_charge + \';\'',
- 'weight' => '70',
+ 'weight' => '56',
);
sub calc_recur {
%info = (
'name' => 'Base charge plus per-hour (and for data) from an SQL RADIUS radacct table',
+ 'shortname' => 'Usage charges from RADIUS',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
%info = (
'name' => 'First partial month full charge, then flat-rate (selectable billing day)',
+ 'shortname' => 'Subscription (Nth of month, full charge for first)',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
%info = (
'name' => 'VoIP rating by plan of CDR records in an internal (or external) SQL table',
+ 'shortname' => 'VoIP/telco CDR rating (standard)',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,
});
#
- die "Can't find rate for call $to_or_from +$countrycode $\numbern"
+ die "Can't find rate for call $to_or_from +$countrycode $number\n"
unless $rate_prefix;
$regionnum = $rate_prefix->regionnum;
%info = (
'name' => 'VoIP rating by plan of CDR records in an SQL RADIUS radacct table',
+ 'shortname' => 'VoIP/telco CDR rating (external RADIUS)',
'fields' => {
'setup_fee' => { 'name' => 'Setup fee for this package',
'default' => 0,