diff options
| author | ivan <ivan> | 2009-03-17 21:38:39 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2009-03-17 21:38:39 +0000 | 
| commit | c72e127acc79a61703223e6c8b504abd234ca8b3 (patch) | |
| tree | b19822ffe496e5163912a96cc397d5160132c22b | |
| parent | 106bc3bf631b49daafa890bd092a3f8c5084adb3 (diff) | |
add payment_info_renew_info method to ClientAPI/MyAccount and SG-equivalent previous_payment_info_renew_info to ClientAPI/SGNG
| -rw-r--r-- | FS/FS/ClientAPI/MyAccount.pm | 22 | ||||
| -rw-r--r-- | FS/FS/ClientAPI/SGNG.pm | 14 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/SelfService.pm | 14 | 
3 files changed, 45 insertions, 5 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index c6a4e0058..564acb1a6 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -1162,11 +1162,14 @@ sub renew_info {                      $total += $_->part_pkg->base_recur;                      my $renew_date = $_->part_pkg->add_freq($_->bill);                      { -                      'bill_date'         => $_->bill, -                      'bill_date_pretty'  => time2str('%x', $_->bill), -                      'renew_date'        => $renew_date, -                      'renew_date_pretty' => time2str('%x', $renew_date), -                      'amount'            => sprintf('%.2f', $total), +                      'pkgnum'             => $_->pkgnum, +                      'amount'             => sprintf('%.2f', $total), +                      'bill_date'          => $_->bill, +                      'bill_date_pretty'   => time2str('%x', $_->bill), +                      'renew_date'         => $renew_date, +                      'renew_date_pretty'  => time2str('%x', $renew_date), +                      'expire_date'        => $_->expire, +                      'expire_date_pretty' => time2str('%x', $_->expire),                      };                    }                    @cust_pkg; @@ -1175,6 +1178,15 @@ sub renew_info {  } +sub payment_info_renew_info { +  my $p = shift; +  my $renew_info   = renew_info($p); +  my $payment_info = payment_info($p); +  return { %$renew_info, +           %$payment_info, +         }; +} +  sub order_renew {    my $p = shift; diff --git a/FS/FS/ClientAPI/SGNG.pm b/FS/FS/ClientAPI/SGNG.pm index 6f74e23a0..872148abd 100644 --- a/FS/FS/ClientAPI/SGNG.pm +++ b/FS/FS/ClientAPI/SGNG.pm @@ -7,6 +7,7 @@ use vars qw( $cache $DEBUG );  use Time::Local qw(timelocal timelocal_nocheck);  use Business::CreditCard;  use FS::Record qw( qsearch qsearchs ); +use FS::Conf;  use FS::cust_main;  use FS::cust_pkg;  use FS::ClientAPI::MyAccount; #qw( payment_info process_payment ) @@ -158,6 +159,10 @@ sub _cust_main_payment_info {  #find old cust_main records (with payments)  sub _previous_cust_main { + +  #safety check!  return nothing unless we're enabled explicitly +  return () unless FS::Conf->new->exists('sg-multicustomer_hack'); +    my %opt = @_;    my $custnum  = $opt{'custnum'};    my $username = $opt{'username'}; @@ -225,6 +230,15 @@ sub previous_process_payment {  } +sub previous_payment_info_renew_info { +  my $p = shift; +  my $renew_info   = renew_info($p); +  my $payment_info = previous_payment_info($p); +  return { %$renew_info, +           %$payment_info, +         }; +} +  sub previous_process_payment_order_pkg {    my $p = shift; diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm index fda3e8596..b4b9ecf29 100644 --- a/fs_selfservice/FS-SelfService/SelfService.pm +++ b/fs_selfservice/FS-SelfService/SelfService.pm @@ -944,6 +944,20 @@ Specified as a integer UNIX timestamp.  Renewal date as a human-readable string.  (Convenience for display;  subject to change, so best not to parse for the date.) +=item pkgnum + +Package that will be renewed. + +=item expire_date + +Expiration date of the package that will be renewed. + +=item expire_date_pretty + +Expiration date of the package that will be renewed, as a human-readable +string.  (Convenience for display; subject to change, so best not to parse for +the date.) +  =back  =item order_renew  | 
