shorter names and rearranged weights for a brighter tommorow^W^Wbetter price plan...
authorivan <ivan>
Sun, 13 Apr 2008 07:41:29 +0000 (07:41 +0000)
committerivan <ivan>
Sun, 13 Apr 2008 07:41:29 +0000 (07:41 +0000)
20 files changed:
FS/FS/part_pkg/base_delayed.pm
FS/FS/part_pkg/base_rate.pm
FS/FS/part_pkg/bulk.pm
FS/FS/part_pkg/flat.pm
FS/FS/part_pkg/flat_comission.pm
FS/FS/part_pkg/flat_comission_cust.pm
FS/FS/part_pkg/flat_comission_pkg.pm
FS/FS/part_pkg/flat_delayed.pm
FS/FS/part_pkg/flat_introrate.pm
FS/FS/part_pkg/prepaid.pm
FS/FS/part_pkg/prorate.pm
FS/FS/part_pkg/prorate_delayed.pm
FS/FS/part_pkg/sesmon_hour.pm
FS/FS/part_pkg/sesmon_minute.pm
FS/FS/part_pkg/sql_external.pm
FS/FS/part_pkg/sql_generic.pm
FS/FS/part_pkg/sqlradacct_hour.pm
FS/FS/part_pkg/subscription.pm
FS/FS/part_pkg/voip_cdr.pm
FS/FS/part_pkg/voip_sqlradacct.pm

index ddd4caf..0d47381 100644 (file)
@@ -10,6 +10,7 @@ use FS::part_pkg::base_rate;
 %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,
@@ -35,7 +36,7 @@ use FS::part_pkg::base_rate;
                   ],
   #'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 {
index 04896e0..64636d9 100644 (file)
@@ -9,6 +9,9 @@ use FS::part_pkg;
 
 %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,
@@ -26,7 +29,7 @@ use FS::part_pkg;
   },
   'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 
                     'externalid' ],
-  'weight' => 10,
+  'weight' => 52,
 );
 
 sub calc_setup {
index 44645b7..63d344d 100644 (file)
@@ -32,7 +32,7 @@ $me = '[FS::part_pkg::bulk]';
   },
   'fieldorder' => [ 'setup_fee', 'recur_fee', 'svc_setup_fee', 'svc_recur_fee',
                     'unused_credit', ],
-  'weight' => 55,
+  'weight' => 50,
 );
 
 sub calc_recur {
index 92e72cf..e8417ff 100644 (file)
@@ -10,6 +10,7 @@ use FS::part_pkg;
 
 %info = (
   'name' => 'Flat rate (anniversary billing)',
+  'shortname' => 'Anniversary',
   'fields' => {
     'setup_fee'     => { 'name' => 'Setup fee for this package',
                          'default' => 0,
index 4592bed..1f57e4f 100644 (file)
@@ -9,6 +9,7 @@ use FS::part_pkg::flat;
 
 %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,
index 82e5111..e2034cd 100644 (file)
@@ -9,6 +9,7 @@ use FS::part_pkg::flat;
 
 %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,
index 07c3d1b..0a66ff0 100644 (file)
@@ -9,6 +9,7 @@ use FS::part_pkg::flat;
 
 %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,
index 8ac1682..5cbbc98 100644 (file)
@@ -10,6 +10,7 @@ use FS::part_pkg::flat;
 %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,
@@ -35,7 +36,7 @@ use FS::part_pkg::flat;
                   ],
   #'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 {
index c92ba97..2568afa 100644 (file)
@@ -14,6 +14,7 @@ $DEBUG_PRE = '[' . __PACKAGE__ . ']: ';
 %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,
@@ -34,7 +35,7 @@ $DEBUG_PRE = '[' . __PACKAGE__ . ']: ';
                        },
   },
   'fieldorder' => [ 'setup_fee', 'intro_duration', 'intro_fee', 'recur_fee', 'unused_credit' ],
-  'weight' => 150,
+  'weight' => 14,
 );
 
 sub calc_recur {
index d309d45..4499d0e 100644 (file)
@@ -14,6 +14,8 @@ tie %recur_action, 'Tie::IxHash',
 
 %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,
index 45bbf01..d3ca77a 100644 (file)
@@ -10,6 +10,7 @@ use FS::part_pkg::flat;
 
 %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,
index ee66432..bd2aec5 100644 (file)
@@ -10,6 +10,7 @@ use FS::part_pkg;
 %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,
@@ -28,7 +29,7 @@ use FS::part_pkg;
   '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 {
index 9843edb..acc034b 100644 (file)
@@ -9,6 +9,7 @@ use FS::part_pkg::flat;
 
 %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,
index 39516f8..f941e00 100644 (file)
@@ -9,6 +9,7 @@ use FS::part_pkg::flat;
 
 %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,
index ca58c4e..2e6119c 100644 (file)
@@ -10,6 +10,7 @@ use FS::part_pkg::flat;
 
 %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,
@@ -37,7 +38,7 @@ use FS::part_pkg::flat;
   '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 {
index 0e6ab7c..9047294 100644 (file)
@@ -10,6 +10,7 @@ use FS::part_pkg::flat;
 
 %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,
@@ -45,7 +46,7 @@ use FS::part_pkg::flat;
  # '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 {
index eac6758..aebffe2 100644 (file)
@@ -9,6 +9,7 @@ use FS::part_pkg::flat;
 
 %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,
index c9c472c..dbf6d79 100644 (file)
@@ -10,6 +10,7 @@ use FS::part_pkg::flat;
 
 %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,
index 72ef55f..8720bb6 100644 (file)
@@ -27,6 +27,7 @@ tie my %rating_method, 'Tie::IxHash',
 
 %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,
@@ -207,7 +208,7 @@ sub calc_recur {
         });
 
         #
-        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;
index bf18003..09e7a09 100644 (file)
@@ -14,6 +14,7 @@ $DEBUG = 1;
 
 %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,