From b5fbaadb1cb2893660e460a1d4a3cabe02774de7 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 12 Mar 2005 14:31:50 +0000 Subject: [PATCH] - bring prepaid support into this century (close: Bug#1124) - finally get rid of fs_signup (everything is in fs_selfservice now) (Bug#413) - organize main menu sysadmin section so it is slightly less confusing --- ANNOUNCE.1.5 | 2 + FS/FS/agent.pm | 17 + FS/FS/cust_main.pm | 33 +- FS/FS/cust_pay.pm | 2 +- FS/FS/prepay_credit.pm | 72 +++- FS/bin/freeside-setup | 1 + README.1.5.7 | 6 +- fs_selfservice/DEPLOY | 25 +- fs_selfservice/FS-SelfService/cgi/agent.cgi | 15 +- fs_selfservice/FS-SelfService/cgi/decline.html | 5 + fs_selfservice/FS-SelfService/cgi/map.gif | Bin 0 -> 8181 bytes fs_selfservice/FS-SelfService/cgi/promocode.html | 14 + fs_selfservice/FS-SelfService/cgi/regcode.html | 14 + .../FS-SelfService/cgi/signup-agentselect.html | 195 ++++++++++ .../FS-SelfService/cgi/signup-alternate.html | 218 +++++++++++ .../FS-SelfService/cgi/signup-billaddress.html | 307 +++++++++++++++ .../FS-SelfService/cgi/signup-freeoption.html | 262 +++++++++++++ .../FS-SelfService/cgi/signup-snarf.html | 228 +++++++++++ fs_selfservice/FS-SelfService/cgi/signup.cgi | 429 +++++++++++++++++++++ fs_selfservice/FS-SelfService/ieak.template | 40 ++ httemplate/browse/agent.cgi | 8 + httemplate/docs/schema.html | 8 +- httemplate/docs/selfservice.html | 17 +- httemplate/docs/upgrade10.html | 4 +- httemplate/edit/prepay_credit.cgi | 56 +++ httemplate/edit/process/prepay_credit.cgi | 51 +++ httemplate/edit/process/reg_code.cgi | 5 +- httemplate/index.html | 59 ++- httemplate/search/elements/search.html | 11 +- httemplate/search/prepay_credit.html | 43 +++ httemplate/view/cust_main/payment_history.html | 1 + 31 files changed, 2076 insertions(+), 72 deletions(-) create mode 100644 fs_selfservice/FS-SelfService/cgi/decline.html create mode 100644 fs_selfservice/FS-SelfService/cgi/map.gif create mode 100644 fs_selfservice/FS-SelfService/cgi/promocode.html create mode 100644 fs_selfservice/FS-SelfService/cgi/regcode.html create mode 100755 fs_selfservice/FS-SelfService/cgi/signup-agentselect.html create mode 100755 fs_selfservice/FS-SelfService/cgi/signup-alternate.html create mode 100755 fs_selfservice/FS-SelfService/cgi/signup-billaddress.html create mode 100755 fs_selfservice/FS-SelfService/cgi/signup-freeoption.html create mode 100755 fs_selfservice/FS-SelfService/cgi/signup-snarf.html create mode 100755 fs_selfservice/FS-SelfService/cgi/signup.cgi create mode 100755 fs_selfservice/FS-SelfService/ieak.template create mode 100644 httemplate/edit/prepay_credit.cgi create mode 100644 httemplate/edit/process/prepay_credit.cgi create mode 100644 httemplate/search/prepay_credit.html diff --git a/ANNOUNCE.1.5 b/ANNOUNCE.1.5 index 0be1a930a..029527fc0 100644 --- a/ANNOUNCE.1.5 +++ b/ANNOUNCE.1.5 @@ -37,6 +37,8 @@ - package changes don't re-charge setup fee - per-agent payment and credit reports - CSV and Excel export of most reports, others to be migrated to new report template +- prepaid card support updated: now includes a web generator, agent-specific + prepaid cards, and creates *payments*, not credits notyet (1.5.8?): - account merging UI in exports (for example, to consolidate passwd files from diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index 3d8e67739..fc1d1a93e 100644 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@ -274,6 +274,7 @@ generated codes, or a scalar error message. =cut +#false laziness w/prepay_credit::generate sub generate_reg_codes { my( $self, $num, $pkgparts ) = @_; @@ -325,6 +326,22 @@ sub num_reg_code { $sth->fetchrow_arrayref->[0]; } +=item num_prepay_credit + +Returns the number of unused prepaid cards for this agent. + +=cut + +sub num_prepay_credit { + my $self = shift; + my $sth = dbh->prepare( + "SELECT COUNT(*) FROM prepay_credit WHERE agentnum = ?" + ) or die dbh->errstr; + $sth->execute($self->agentnum) or die $sth->errstr; + $sth->fetchrow_arrayref->[0]; +} + + =back =head1 BUGS diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 60556a5a4..e5748ec3f 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -175,7 +175,7 @@ FS::Record. The following fields are currently supported: =item ship_fax - phone (optional) -=item payby - I (credit card - automatic), I (credit card - on-demand), I (electronic check - automatic), I (electronic check - on-demand), I (Phone bill billing), I (billing), I (free), or I (special billing type: applies a credit - see L and sets billing type to I) +=item payby - I (credit card - automatic), I (credit card - on-demand), I (electronic check - automatic), I (electronic check - on-demand), I (Phone bill billing), I (billing), I (free), or I (special billing type: applies a payment from a prepaid card - see L - and sets billing type to I) =item payinfo - card number, P.O., comp issuer (4-8 lowercase alphanumerics; think username) or prepayment identifier (see L) @@ -271,20 +271,28 @@ sub insert { local $FS::UID::AutoCommit = 0; my $dbh = dbh; - my $amount = 0; + my $prepay_credit = ''; my $seconds = 0; if ( $self->payby eq 'PREPAY' ) { $self->payby('BILL'); - my $prepay_credit = qsearchs( + $prepay_credit = qsearchs( 'prepay_credit', { 'identifier' => $self->payinfo }, '', 'FOR UPDATE' ); - warn "WARNING: can't find pre-found prepay_credit: ". $self->payinfo - unless $prepay_credit; - $amount = $prepay_credit->amount; + unless ( $prepay_credit ) { + $dbh->rollback if $oldAutoCommit; + return "Invalid prepaid card: ". $self->payinfo; + } $seconds = $prepay_credit->seconds; + if ( $prepay_credit->agentnum ) { + if ( $self->agentnum && $self->agentnum != $prepay_credit->agentnum ) { + $dbh->rollback if $oldAutoCommit; + return "prepaid card not valid for agent ". $self->agentnum; + } + $self->agentnum($prepay_credit->agentnum); + } my $error = $prepay_credit->delete; if ( $error ) { $dbh->rollback if $oldAutoCommit; @@ -321,15 +329,18 @@ sub insert { return "No svc_acct record to apply pre-paid time"; } - if ( $amount ) { - my $cust_credit = new FS::cust_credit { + if ( $prepay_credit && $prepay_credit->amount ) { + my $cust_pay = new FS::cust_pay { 'custnum' => $self->custnum, - 'amount' => $amount, + 'paid' => $prepay_credit->amount, + #'_date' => #date the prepaid card was purchased??? + 'payby' => 'PREP', + 'payinfo' => $prepay_credit->identifier, }; - $error = $cust_credit->insert; + $error = $cust_pay->insert; if ( $error ) { $dbh->rollback if $oldAutoCommit; - return "inserting credit (transaction rolled back): $error"; + return "inserting prepayment (transaction rolled back): $error"; } } diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 1ceb599a0..80d4a140b 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -357,7 +357,7 @@ sub check { $self->_date(time) unless $self->_date; - $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP)$/ or return "Illegal payby"; + $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREP)$/ or return "Illegal payby"; $self->payby($1); #false laziness with cust_refund::check diff --git a/FS/FS/prepay_credit.pm b/FS/FS/prepay_credit.pm index a9d26d151..cffedeb0f 100644 --- a/FS/FS/prepay_credit.pm +++ b/FS/FS/prepay_credit.pm @@ -2,8 +2,8 @@ package FS::prepay_credit; use strict; use vars qw( @ISA ); -#use FS::Record qw( qsearch qsearchs ); -use FS::Record qw(); +use FS::Record qw(qsearchs dbh); +use FS::agent; @ISA = qw(FS::Record); @@ -37,8 +37,8 @@ FS::prepay_credit - Object methods for prepay_credit records =head1 DESCRIPTION -An FS::table_name object represents an pre--paid credit, such as a pre-paid -"calling card". FS::prepay_credit inherits from FS::Record. The following +An FS::prepay_credit object represents a pre-paid card. FS::prepay_credit +inherits from FS::Record. The following fields are currently supported: =over 4 @@ -107,14 +107,76 @@ sub check { $self->ut_numbern('prepaynum') || $self->ut_alpha('identifier') || $self->ut_money('amount') - || $self->utnumbern('seconds') + || $self->ut_numbern('seconds') + || $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum') || $self->SUPER::check ; } +=item agent + +Returns the agent (see L) for this prepaid card, if any. + +=cut + +sub agent { + my $self = shift; + qsearchs('agent', { 'agentnum' => $self->agentnum } ); +} + =back +=head1 SUBROUTINES + +=over 4 + +=item generate NUM TYPE HASHREF + +Generates the specified number of prepaid cards. Returns an array reference of +the newly generated card identifiers, or a scalar error message. + +=cut + +#false laziness w/agent::generate_reg_codes +sub generate { + my( $num, $type, $hashref ) = @_; + + my @codeset = (); + push @codeset, ( 'A'..'Z' ) if $type =~ /alpha/; + push @codeset, ( '1'..'9' ) if $type =~ /numeric/; + + local $SIG{HUP} = 'IGNORE'; + local $SIG{INT} = 'IGNORE'; + local $SIG{QUIT} = 'IGNORE'; + local $SIG{TERM} = 'IGNORE'; + local $SIG{TSTP} = 'IGNORE'; + local $SIG{PIPE} = 'IGNORE'; + + my $oldAutoCommit = $FS::UID::AutoCommit; + local $FS::UID::AutoCommit = 0; + my $dbh = dbh; + + my @cards = (); + for ( 1 ... $num ) { + my $prepay_credit = new FS::prepay_credit { + 'identifier' => join('', map($codeset[int(rand $#codeset)], (0..7) ) ), + %$hashref, + }; + my $error = $prepay_credit->check || $prepay_credit->insert; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return "(inserting prepay_credit) $error"; + } + push @cards, $prepay_credit->identifier; + } + + $dbh->commit or die $dbh->errstr if $oldAutoCommit; + + \@cards; + +} + =head1 BUGS =head1 SEE ALSO diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup index 5ab6eb9f3..74aa5e2f0 100755 --- a/FS/bin/freeside-setup +++ b/FS/bin/freeside-setup @@ -890,6 +890,7 @@ sub tables_hash_hack { 'identifier', 'varchar', '', $char_d, 'amount', @money_type, 'seconds', 'int', 'NULL', '', + 'agentnum', 'int', 'NULL', '', ], 'primary_key' => 'prepaynum', 'unique' => [ ['identifier'] ], diff --git a/README.1.5.7 b/README.1.5.7 index 7b72dfb6f..2620d828b 100644 --- a/README.1.5.7 +++ b/README.1.5.7 @@ -2,6 +2,7 @@ NOTE: Version numbering has been simplified. 1.5.7 is the version after 1.5.0pre6. It is still a development version - releases with odd numbered middle parts (NN in x.NN.x) are development versions, like Perl or Linux. +install DBIx::DBSchema 0.24 CREATE TABLE rate ( ratenum serial NOT NULL, @@ -77,6 +78,9 @@ CREATE INDEX h_part_pkg2 ON h_part_pkg ( promo_code ); ALTER TABLE cust_main ALTER COLUMN zip DROP NOT NULL; ALTER TABLE h_cust_main ALTER COLUMN zip DROP NOT NULL; +ALTER TABLE prepay_credit ADD agentnum integer NULL; +ALTER TABLE h_prepay_credit ADD agentnum integer NULL; + Installs w/integrated RT: CREATE SEQUENCE attributes_id_seq; @@ -106,7 +110,7 @@ dbdef-create username install Javascript::RPC (JavaScript::RPC::Server::CGI), Text::CSV_XS, Spreadsheet::WriteExcel, IO-stringy (IO::Scalar) and Frontier::RPC -((Frontier::RPC2) +(Frontier::RPC2) afterwords (for installs w/integrated RT): make configure-rt diff --git a/fs_selfservice/DEPLOY b/fs_selfservice/DEPLOY index 7420df778..63412784f 100755 --- a/fs_selfservice/DEPLOY +++ b/fs_selfservice/DEPLOY @@ -1,20 +1,27 @@ #!/bin/sh -kill `cat /var/run/freeside-selfservice-server.fs_selfservice.pid` +#this is a quick hack for my dev machine. do not use it. +# see the "make install-selfservice" and "make update-selfservice" makefile +# targets to properly install this stuff. -( cd ..; make deploy; cd fs_selfservice ) +#kill `cat /var/run/freeside-selfservice-server.fs_selfservice.pid` cd FS-SelfService perl Makefile.PL && make && make install +cd .. + +( cd ..; make deploy; cd fs_selfservice ) cp /home/ivan/freeside/fs_selfservice/FS-SelfService/cgi/* /var/www/MyAccount -chown freeside /var/www/MyAccount/selfservice.cgi /var/www/MyAccount/agent.cgi -chmod 755 /var/www/MyAccount/selfservice.cgi /var/www/MyAccount/agent.cgi +chown freeside /var/www/MyAccount/*.cgi +chmod 755 /var/www/MyAccount/*.cgi ln -s /var/www/MyAccount/selfservice.cgi /var/www/MyAccount/index.cgi || true -cp /home/ivan/freeside/fs_signup/FS-SignupClient/cgi/* /var/www/signup/ -#mv /var/www/signup/signup-snarf.html /var/www/signup/signup.html #!!!!! -chown freeside /var/www/signup/signup.cgi -chmod 755 /var/www/signup/signup.cgi -ln -s /var/www/signup/signup.cgi /var/www/signup/index.cgi || true + #cp /home/ivan/freeside/fs_signup/FS-SignupClient/cgi/* /var/www/signup/ + ##mv /var/www/signup/signup-snarf.html /var/www/signup/signup.html #!!!!! + ##mv /var/www/signup/signup-billaddress.html /var/www/signup/signup.html #!!!!! + ##mv /var/www/signup/signup-freeoption.html /var/www/signup/signup.html #!!!!! + #chown freeside /var/www/signup/signup.cgi + #chmod 755 /var/www/signup/signup.cgi + #ln -s /var/www/signup/signup.cgi /var/www/signup/index.cgi || true diff --git a/fs_selfservice/FS-SelfService/cgi/agent.cgi b/fs_selfservice/FS-SelfService/cgi/agent.cgi index 92c76f38e..695d20e4c 100644 --- a/fs_selfservice/FS-SelfService/cgi/agent.cgi +++ b/fs_selfservice/FS-SelfService/cgi/agent.cgi @@ -113,7 +113,7 @@ sub process_signup { my $error = ''; - #some false laziness w/signup.cgi + #false laziness w/signup.cgi, identical except for agentnum vs session_id my $payby = $cgi->param('payby'); if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) { #$payinfo = join('@', map { $cgi->param( $payby. "_payinfo$_" ) } (1,2) ); @@ -161,17 +161,25 @@ sub process_signup { unless ( $error ) { my $rv = new_customer ( { 'session_id' => $session_id, - map { $_ => $cgi->param($_) } + map { $_ => scalar($cgi->param($_)) } qw( last first ss company address1 address2 city county state zip country daytime night fax + + ship_last ship_first ship_company + ship_address1 ship_address2 ship_city ship_county ship_state + ship_zip ship_country + ship_daytime ship_night ship_fax + payby payinfo paycvv paydate payname invoicing_list + referral_custnum promo_code reg_code pkgpart username sec_phrase _password popnum refnum ), grep { /^snarf_/ } $cgi->param } ); $error = $rv->{'error'}; } + #eslaf if ( $error ) { $action = 'signup'; @@ -409,7 +417,8 @@ sub do_template { #warn join(' / ', map { "$_=>".$fill_in->{$_} } keys %$fill_in). "\n"; $cgi->delete_all(); - $fill_in->{'selfurl'} = $cgi->self_url; + $fill_in->{'selfurl'} = $cgi->self_url; #OLD + $fill_in->{'self_url'} = $cgi->self_url; $fill_in->{'cgi'} = \$cgi; my $template = new Text::Template( TYPE => 'FILE', diff --git a/fs_selfservice/FS-SelfService/cgi/decline.html b/fs_selfservice/FS-SelfService/cgi/decline.html new file mode 100644 index 000000000..a37ba3ab6 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/decline.html @@ -0,0 +1,5 @@ +Processing error +Processing error

+There has been an error processing your account. Please contact customer +support. + diff --git a/fs_selfservice/FS-SelfService/cgi/map.gif b/fs_selfservice/FS-SelfService/cgi/map.gif new file mode 100644 index 0000000000000000000000000000000000000000..ef884d8f948db2b04cd43dac72600b3d6ff7cd85 GIT binary patch literal 8181 zcmV}*y*TU5yZ>M)j$~<`XsWJk>%MR-&vb3yc&_h!@BhG{ za7Zi~kI1BQ$!t2G(5Q4uty-_xtai)odcWYXcuX#v&*-#z&2D1@0zn`!gwNghJZL@# z`2Tc30e^9PdWVP-0)LEvf{lc7fr*rPgOH4qGj|V{n2eH|m7^(f0t;{ob_;Pbi=Td{ zHH)IEu%CsTq`M-H1d9r^3w|-4x3w;wqQ& z!{tnYavBb8WGWO)omAWrz$PqU(3KXJLMnQ+D?4LJk2cK-m1I5$Mv2PvIy0;{woJ#K zEn7*JgtTgt!KGQx?Ot3sAJWxxwG+dqBk=x(WD}6q#q$Cq9_$5U1c!t|0&vKO9t*sZ z09^_#`mvvyrXk;wE12>ZmX}$bM#;d~#VV@M^W6z^+4swRcT^=?ET3Tq-zlE;mI`RV4d|hO1A^#`E}FsS zg>##M6O#j%1QQ5L!o;Uvh482{ReSjH_F^-QIp!gNB61g`I5!#Sgn3d)h{9E`1arzD z?zz`c3&FKFh+VIwmm@4ap7!659Std*m^2;8PL2#HxuS0t)f44@SUQE^hzm`|fJ)ZklUIPO-`sz3!xo>Vyb;d(>?Kr*X%gqt-V= zLIyLWDVG*+Ma`kDI8ZWUrlt9wb!V=_W5S2ERH?=!d&%Q0daf+c$Oh5e6PhQ#{1?RQ z;rC`YmR39<#xs^7r9n&|Q$s-xPfDzqa`Rw7+sU?&Z}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{ zD#ipe3=|9hdx$tX*r|F?+>;QmAv0Ep<%o+g1MgU5oB{z4iX!2IlNvR&D|#Y}s|r+a z&Sb)zIAUjXs8NNgNXC;)NGc^$qaCuis6XASM{synG0f8u5qzeJF~lEW@;D4Xrix^e ztON-qQK3PG#)y`JLl~N|l=A%GLXaHB?<%3NO0pn};@F~ikOD}V%*qtJYgrXtA&&?Z zu9OM<6CPEh%7I*vV8N85xT4^!p&;ox<3XcehR92AHJ%+u)=h##ekhz z&yqY-jtHC5S^_*O=o6@FO|GC*TmR@$KBxk$W$h>kTg63@J~(!ugdI;v_d0~n5%oG{ z-Rd!6CfUi-b8O6EQxoADttEW*u0dt$Gnu9t(Fk^|5L%b4D^& zu#!JA^||`6Zdn~uT*ZK+8m;WgPM_2D=C~;tgFA8a!r(0Cu+2IDQ%*@p z1p7=I*4g>abM2v=_2e{RgbcQ#eGX0s4d&mbP?1Zr(Vl-HWkvTiCXjlf`XEhcgyk`D z1iCaaHvJ29ol4Y!W*MmEY3i+^$A~tKb(T_*n+iYr)x7SfeYVKt0oQ7=K=MTeIxS6C z_j=hcon9=10Sa4VY0*7R^mk3eYywtUQ|dD?I=3XLVjYg!PrK!=vyJI(I~0ujF$fO{ z+6+^4IcwxLkL7aMVRY+z7h!g{gVKt-BDX_N#MY8gCB5%#C-EfmCYsHHt8R!NueRS# zxW13INPDDf%i^Ojlp=2N_TliIv8z3;ss-xHUD5TmuQ!fTOxWy}8NWNoUGBR3Uzh8GcM^5MyL%VA zBG-m6S_+;>h0l82wH++JKIq?#4?34C7v)6psq&65rPDbN`d&{V^rRoOKjvHd)Gzt+ bs&BpPUl04(%YOE>uf6SWkNe!KJ^=tbEHr(M literal 0 HcmV?d00001 diff --git a/fs_selfservice/FS-SelfService/cgi/promocode.html b/fs_selfservice/FS-SelfService/cgi/promocode.html new file mode 100644 index 000000000..f8ee7f6eb --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/promocode.html @@ -0,0 +1,14 @@ +ISP Signup +ISP Signup - promotional code

+ +
+Enter promotional code + + +
+ + diff --git a/fs_selfservice/FS-SelfService/cgi/regcode.html b/fs_selfservice/FS-SelfService/cgi/regcode.html new file mode 100644 index 000000000..e639b9b53 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/regcode.html @@ -0,0 +1,14 @@ +ISP Signup +ISP Signup - registration code

+ +
+Enter registration code + + +
+ + diff --git a/fs_selfservice/FS-SelfService/cgi/signup-agentselect.html b/fs_selfservice/FS-SelfService/cgi/signup-agentselect.html new file mode 100755 index 000000000..7851c5601 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/signup-agentselect.html @@ -0,0 +1,195 @@ +ISP Signup form +ISP Signup form

+<%= $error %> +
+ + + +Agent

+Contact Information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*Contact name
(last, first)
, +
Company
*Address
 
*City*State/Country + <%= + ($county_html, $state_html, $country_html) = + regionselector( $county, $state, $country ); + + "$county_html $state_html"; + %> + *Zip
*Country<%= $country_html %>
Day Phone
Night Phone
Fax
* required fields
+
Billing information + + +<%= scalar(@payby) > 1 ? '' : '' %> +
+ + <%= + $OUT .= ' + + Postal mail invoice +
Email invoice +
Billing type
+ + + + <%= + + my $cardselect = ''; + + my %payby = ( + 'CARD' => qq!Credit card
*$cardselect
*Exp !. expselect("CARD"). qq!
*Name on card
!, + 'DCRD' => qq!Credit card
*$cardselect
*Exp !. expselect("DCRD"). qq!
*Name on card
!, + 'CHEK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'DCHK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'LECB' => qq!Phone bill billing
${r}Phone number !, + 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", "12-2037"). qq!
*Attention
!, + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP"), + 'PREPAY' => qq!Prepaid card
*!, + ); + + my( $account, $aba ) = split('@', $payinfo); + my %paybychecked = ( + 'CARD' => qq!Credit card
*$cardselect
*Exp !. expselect("CARD", $paydate). qq!
*Name on card
!, + 'DCRD' => qq!Credit card
*$cardselect
*Exp !. expselect("DCRD", $paydate). qq!
*Name on card
!, + 'CHEK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'DCHK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'LECB' => qq!Phone bill billing
${r}Phone number !, + 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", $paydate). qq!
*Attention
!, + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP", $paydate), + 'PREPAY' => qq!Prepaid card
*!, + ); + + for (@payby) { + if ( scalar(@payby) == 1) { + $OUT .= '"; + } else { + $OUT .= qq!!; + } else { + $OUT .= qq!> $payby{$_}!; + } + + } + } + %> + +
'. + qq!!. + "$paybychecked{$_} $paybychecked{$_}
* required fields for each billing type +

First package + + + + + + + + + + + + + + + + +<%= + if ( $init_data->{'security_phrase'} ) { + $OUT .= < + + + +ENDOUT + } else { + $OUT .= ''; + } +%> +<%= + if ( scalar(@$pops) ) { + $OUT .= ''; + } else { + $OUT .= popselector($popnum); + } +%> +
Username
Password
Re-enter Password
Security Phrase +
Access number'. + popselector($popnum). '
+

+
diff --git a/fs_selfservice/FS-SelfService/cgi/signup-alternate.html b/fs_selfservice/FS-SelfService/cgi/signup-alternate.html new file mode 100755 index 000000000..490cefa5e --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/signup-alternate.html @@ -0,0 +1,218 @@ +ISP Signup form +ISP Signup form

+<%= $error %> +
+ + + + +Contact Information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*Contact name
(last, first)
, +
Company
*Address
 
*City*State/Country*Zip
Day Phone
Night Phone
Fax
* required fields
+ +

+ + + + + + + + + + + + + + +<%= if ( $init_data->{'security_phrase'} ) { + < + + + +ENDOUT + } else { + ''; + } +%> + +<%= if ( scalar(@$pops) ) { + ''; + } else { + popselector($popnum); + } +%> + +
*Username
*Password
*Re-enter Password
Security Phrase +
Access number'. + popselector($popnum). '
* required fields + +

First package + + <%= use Tie::IxHash; + my %pkgpart2payby = map { $_->{pkgpart} => $_->{payby}[0] } @{$packages}; + tie my %options, 'Tie::IxHash', + '' => '(none)', + map { $_->{pkgpart} => $_->{pkg} } + sort { $a->{recur} <=> $b->{recur} } + @{$packages} + ; + + use HTML::Widgets::SelectLayers 0.02; + my @form_text = qw( magic ref ss agentnum + last first company address1 address2 + city zip daytime night fax + username _password _password2 sec_phrase ); + my @form_select = qw( state ); #county country + if ( scalar(@$pops) == 0 or scalar(@$pops) == 1 ) { + push @form_text, 'popnum', + } else { + push @form_select, 'popnum', + } + my $widget = new HTML::Widgets::SelectLayers( + options => \%options, + selected_layer => $pkgpart, + form_name => 'dummy', + form_action => $self_url, + form_text => \@form_text, + form_select => \@form_select, + layer_callback => sub { + my $layer = shift; + my $html = qq( ); + + if ( $pkgpart2payby{$layer} eq 'BILL' ) { + $html .= < + + + + + +

+ENDOUT + } elsif ( $pkgpart2payby{$layer} eq 'CARD' ) { + my $postal_checked = ''; + my @invoicing_list = split(', ', $invoicing_list ); + $postal_checked = 'CHECKED' + if ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list; + + $invoicing_list= join(', ', grep { $_ ne 'POST' } @invoicing_list ); + + my $expselect = expselect("CARD", $paydate); + + my $cardselect = ''; + + $html .= < +

Billing information + + + + + + + + + + + + + + + + + + + + + + +
Email statement to
*Credit card type$cardselect
*Card number
**Exp$expselect
*Name on card
+* required fields +

+ENDOUT + } else { + $html = <Please select a package.
+ENDOUT + + } + + $html; + + }, + ); + + $widget->html; + + + %> + diff --git a/fs_selfservice/FS-SelfService/cgi/signup-billaddress.html b/fs_selfservice/FS-SelfService/cgi/signup-billaddress.html new file mode 100755 index 000000000..3cf9d2505 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/signup-billaddress.html @@ -0,0 +1,307 @@ +ISP Signup form + + +ISP Signup form

+<%= $error %> + + + + +Where did you hear about our service?

+Billing Address (where credit card statement is sent) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*Exact name on card
(last, first)
, +
Company
*Address
 
*City*State/Country + <%= + ($county_html, $state_html, $country_html) = + regionselector( $county, $state, $country, '', 'changed(this)' ); + + "$county_html $state_html"; + %> + *Zip
*Country<%= $country_html %>
Day Phone
Night Phone
Fax
+ + + +

+Service Address +(>same as billing address)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*Contact name
(last, first)
, +
Company
*Address
 
*City*State/Country + <%= + ($ship_county_html, $ship_state_html, $ship_country_html) = + regionselector( $ship_county, + $ship_state, + $ship_country, + 'ship_', + 'changed(this)', + ); + + "$ship_county_html $ship_state_html"; + %> + *Zip
*Country<%= $ship_country_html %>
Day Phone
Night Phone
Fax
+ +* required fields
+ +
Billing information + + +<%= scalar(@payby) > 1 ? '' : '' %> +
+ + <%= + $OUT .= ' + + Postal mail invoice +
Email invoice +
Billing type
+ + + + <%= + + my $cardselect = ''; + + my %payby = ( + 'CARD' => qq!Credit card
*$cardselect
*Exp !. expselect("CARD"), #. qq!
*Name on card
!, + 'DCRD' => qq!Credit card
*$cardselect
*Exp !. expselect("DCRD"), #. qq!
*Name on card
!, + 'CHEK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'DCHK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'LECB' => qq!Phone bill billing
${r}Phone number !, + 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", "12-2037"). qq!
*Attention
!, + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP"), + 'PREPAY' => qq!Prepaid card
*!, + ); + + if ( $init_data->{'cvv_enabled'} ) { + foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5 + $payby{$payby} .= qq!
CVV2 (help!; + } + } + + my( $account, $aba ) = split('@', $payinfo); + my %paybychecked = ( + 'CARD' => qq!Credit card
*$cardselect
*Exp !. expselect("CARD", $paydate), #. qq!
*Name on card
!, + 'DCRD' => qq!Credit card
*$cardselect
*Exp !. expselect("DCRD", $paydate), #. qq!
*Name on card
!, + 'CHEK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'DCHK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'LECB' => qq!Phone bill billing
${r}Phone number !, + 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", $paydate). qq!
*Attention
!, + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP", $paydate), + 'PREPAY' => qq!Prepaid card
*!, + ); + + if ( $init_data->{'cvv_enabled'} ) { + foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5 + $paybychecked{$payby} .= qq!
CVV2 (help!; + } + } + + for (@payby) { + if ( scalar(@payby) == 1) { + $OUT .= '"; + } else { + $OUT .= qq!!; + } else { + $OUT .= qq!> $payby{$_}!; + } + + } + } + %> + +
'. + qq!!. + "$paybychecked{$_} $paybychecked{$_}
* required fields for each billing type +

First package + + + + + + + + + + + + + + + + + +<%= + if ( $init_data->{'security_phrase'} ) { + $OUT .= < + + + +ENDOUT + } else { + $OUT .= ''; + } +%> +<%= + if ( scalar(@$pops) ) { + $OUT .= ''; + } else { + $OUT .= popselector($popnum); + } +%> +
Username
Password
Re-enter Password
Security Phrase +
Access number'. + popselector($popnum). '
+

+ diff --git a/fs_selfservice/FS-SelfService/cgi/signup-freeoption.html b/fs_selfservice/FS-SelfService/cgi/signup-freeoption.html new file mode 100755 index 000000000..40ad03c0b --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/signup-freeoption.html @@ -0,0 +1,262 @@ +ISP Signup form + + +ISP Signup form

+<%= $error %> +
+ + + +Where did you hear about our service?

+Contact Information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*Contact name
(last, first)
, +
Company
*Address
 
*City*State/Country + <%= + ($county_html, $state_html, $country_html) = + regionselector( $county, $state, $country ); + + "$county_html $state_html"; + %> + *Zip
*Country<%= $country_html %>
Day Phone
Night Phone
Fax
* required fields
+
+<%= + my $first_payby = $packages->[0]{'payby'}[0]; + unless ( grep { scalar( @{$_->{'payby'}} ) > 1 + || $_->{'payby'}->[0] ne $first_payby + } @$packages + ) { + @payby = ( $first_payby ); + } + + unless ( scalar(@payby) == 1 && $payby[0] eq 'BILL' ) { + + $OUT .= ' Billing information + + '; + + $OUT .= '' + if scalar(@payby) > 1; + + $OUT .= '
+
Billing type
'; + + } else { + $OUT .= ' + '; + } + +%> + + + + + <%= + + my $cardselect = ''; + + my %payby = ( + 'CARD' => qq!Credit card
*$cardselect
*Exp !. expselect("CARD"). qq!
*Name on card
!, + 'DCRD' => qq!Credit card
*$cardselect
*Exp !. expselect("DCRD"). qq!
*Name on card
!, + 'CHEK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'DCHK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'LECB' => qq!Phone bill billing
${r}Phone number !, + 'BILL' => <<'END', + + + + +END + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP"), + 'PREPAY' => qq!Prepaid card
*!, + ); + + if ( $init_data->{'cvv_enabled'} ) { + foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5 + $payby{$payby} .= qq!
CVV2 (help!; + } + } + + my( $account, $aba ) = split('@', $payinfo); + my %paybychecked = ( + 'CARD' => qq!Credit card
*$cardselect
*Exp !. expselect("CARD", $paydate). qq!
*Name on card
!, + 'DCRD' => qq!Credit card
*$cardselect
*Exp !. expselect("DCRD", $paydate). qq!
*Name on card
!, + 'CHEK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'DCHK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'LECB' => qq!Phone bill billing
${r}Phone number !, + 'BILL' => <<'END', + + + + +END + + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP", $paydate), + 'PREPAY' => qq!Prepaid card
*!, + ); + + if ( $init_data->{'cvv_enabled'} ) { + foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5 + $paybychecked{$payby} .= qq!
CVV2 (help!; + } + } + + for (@payby) { + if ( scalar(@payby) == 1) { + $OUT .= '"; + } else { + $OUT .= qq!!; + } else { + $OUT .= qq!> $payby{$_}!; + } + + } + } + %> + +
'. + qq!!. + "$paybychecked{$_} $paybychecked{$_}
+<%= unless ( scalar(@payby) == 1 && $payby[0] eq 'BILL' ) { + $OUT .= '* required fields for each billing type'; + } + ''; +%> +

First package + + + + + + + + + + + + + + + + +<%= + if ( $init_data->{'security_phrase'} ) { + $OUT .= < + + + +ENDOUT + } else { + $OUT .= ''; + } +%> +<%= + if ( scalar(@$pops) ) { + $OUT .= ''; + } else { + $OUT .= popselector($popnum); + } +%> +
Username
Password
Re-enter Password
Security Phrase +
Access number'. + popselector($popnum). '
+

+
diff --git a/fs_selfservice/FS-SelfService/cgi/signup-snarf.html b/fs_selfservice/FS-SelfService/cgi/signup-snarf.html new file mode 100755 index 000000000..d167efbf9 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/signup-snarf.html @@ -0,0 +1,228 @@ +ISP Signup form + + +ISP Signup form

+<%= $error %> +
+ + + +Contact Information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*Contact name
(last, first)
, +
Company
*Address
 
*City*State/Country + <%= + ($county_html, $state_html, $country_html) = + regionselector( $county, $state, $country ); + + "$county_html $state_html"; + %> + *Zip
*Country<%= $country_html %>
Day Phone
Night Phone
Fax
* required fields
+
Billing information + + +<%= scalar(@payby) > 1 ? '' : '' %> +
+ + <%= + $OUT .= ' + + Postal mail invoice +
Email invoice +
Billing type
+ + + + <%= + + my $cardselect = ''; + + my %payby = ( + 'CARD' => qq!Credit card
*$cardselect
*Exp !. expselect("CARD"). qq!
*Name on card
!, + 'DCRD' => qq!Credit card
*$cardselect
*Exp !. expselect("DCRD"). qq!
*Name on card
!, + 'CHEK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'DCHK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'LECB' => qq!Phone bill billing
${r}Phone number !, + 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", "12-2037"). qq!
*Attention
!, + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP"), + 'PREPAY' => qq!Prepaid card
*!, + ); + + if ( $init_data->{'cvv_enabled'} ) { + foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5 + $payby{$payby} .= qq!
CVV2 (help!; + } + } + + my( $account, $aba ) = split('@', $payinfo); + my %paybychecked = ( + 'CARD' => qq!Credit card
*$cardselect
*Exp !. expselect("CARD", $paydate). qq!
*Name on card
!, + 'DCRD' => qq!Credit card
*$cardselect
*Exp !. expselect("DCRD", $paydate). qq!
*Name on card
!, + 'CHEK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'DCHK' => qq!Electronic check
${r}Account number
${r}ABA/Routing code
${r}Bank name !, + 'LECB' => qq!Phone bill billing
${r}Phone number !, + 'BILL' => qq!Billing
P.O.
*Exp !. expselect("BILL", $paydate). qq!
*Attention
!, + 'COMP' => qq!Complimentary
*Approved by
*Exp !. expselect("COMP", $paydate), + 'PREPAY' => qq!Prepaid card
*!, + ); + + if ( $init_data->{'cvv_enabled'} ) { + foreach my $payby ( grep { exists $payby{$_} } qw(CARD DCRD) ) { #1.4/1.5 + $paybychecked{$payby} .= qq!
CVV2 (help!; + } + } + + for (@payby) { + if ( scalar(@payby) == 1) { + $OUT .= '"; + } else { + $OUT .= qq!!; + } else { + $OUT .= qq!> $payby{$_}!; + } + + } + } + %> + +
'. + qq!!. + "$paybychecked{$_} $paybychecked{$_}
* required fields for each billing type +

First package + + + + + + + + + + + + + + + + +<%= + if ( $init_data->{'security_phrase'} ) { + $OUT .= < + + + +ENDOUT + } else { + $OUT .= ''; + } +%> +<%= + if ( scalar(@$pops) ) { + $OUT .= ''; + } else { + $OUT .= popselector($popnum); + } +%> +
Username
Password
Re-enter Password
Security Phrase +
Access number'. + popselector($popnum). '
+

Enter up to ten external accounts from which to retrieve email + + + + + + +<%= + for my $num ( 1..10 ) { + no strict 'vars'; + $OUT .= qq!!. + qq!!. + qq!!. + qq!!. + qq!!; + } +%> +
Mail serverUsernamePassword
+ +

+
diff --git a/fs_selfservice/FS-SelfService/cgi/signup.cgi b/fs_selfservice/FS-SelfService/cgi/signup.cgi new file mode 100755 index 000000000..afae1f167 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/signup.cgi @@ -0,0 +1,429 @@ +#!/usr/bin/perl -T +#!/usr/bin/perl -Tw +# +# $Id: signup.cgi,v 1.1 2005-03-12 14:31:50 ivan Exp $ + +use strict; +use vars qw( @payby $cgi $init_data + $self_url $error $agentnum + + $ieak_file $ieak_template + $signup_html $signup_template + $success_html $success_template + $decline_html $decline_template + ); + #$locales $packages + #$pops %pop %popnum2pop + + #$last $first $ss $company $address1 + #$address2 $city $state $county + #$country $zip $daytime $night $fax + + #$ship_last $ship_first $ship_ss $ship_company $ship_address1 + #$ship_address2 $ship_city $ship_state $ship_county + #$ship_country $ship_zip $ship_daytime $ship_night $ship_fax + + #$invoicing_list $payby $payinfo + #$paycvv $paydate $payname $referral_custnum $init_popstate + #$pkgpart $username $_password $_password2 $sec_phrase $popnum + #$refnum + + #$ac $exch $loc + #$email_name $pkg +use subs qw( print_form print_okay print_decline + success_default decline_default + ); +use CGI; +#use CGI::Carp qw(fatalsToBrowser); +use Text::Template; +use Business::CreditCard; +use HTTP::BrowserDetect; +use FS::SelfService qw( signup_info new_customer ); + +#acceptable payment methods +# +#@payby = qw( CARD BILL COMP ); +#@payby = qw( CARD BILL ); +#@payby = qw( CARD ); +@payby = qw( CARD PREPAY ); + +$ieak_file = '/usr/local/freeside/ieak.template'; +$signup_html = -e 'signup.html' + ? 'signup.html' + : '/usr/local/freeside/signup.html'; +$success_html = -e 'success.html' + ? 'success.html' + : '/usr/local/freeside/success.html'; +$decline_html = -e 'decline.html' + ? 'decline.html' + : '/usr/local/freeside/decline.html'; + + +if ( -e $ieak_file ) { + my $ieak_txt = Text::Template::_load_text($ieak_file) + or die $Text::Template::ERROR; + $ieak_txt =~ /^(.*)$/s; #untaint the template source - it's trusted + $ieak_txt = $1; + $ieak_txt =~ s/\r//g; # don't double \r on old templates + $ieak_txt =~ s/\n/\r\n/g; + $ieak_template = new Text::Template ( TYPE => 'STRING', SOURCE => $ieak_txt ) + or die $Text::Template::ERROR; +} else { + $ieak_template = ''; +} + +$agentnum = ''; +if ( -e $signup_html ) { + my $signup_txt = Text::Template::_load_text($signup_html) + or die $Text::Template::ERROR; + $signup_txt =~ /^(.*)$/s; #untaint the template source - it's trusted + $signup_txt = $1; + $signup_template = new Text::Template ( TYPE => 'STRING', + SOURCE => $signup_txt, + DELIMITERS => [ '<%=', '%>' ] + ) + or die $Text::Template::ERROR; + if ( $signup_txt =~ + /<\s*INPUT TYPE="?hidden"?\s+NAME="?agentnum"?\s+VALUE="?(\d+)"?\s*>/si + ) { + $agentnum = $1; + } +} else { + #too much maintenance hassle to keep in this file + die "can't find ./signup.html or /usr/local/freeside/signup.html"; + #$signup_template = new Text::Template ( TYPE => 'STRING', + # SOURCE => &signup_default, + # DELIMITERS => [ '<%=', '%>' ] + # ) + # or die $Text::Template::ERROR; +} + +if ( -e $success_html ) { + my $success_txt = Text::Template::_load_text($success_html) + or die $Text::Template::ERROR; + $success_txt =~ /^(.*)$/s; #untaint the template source - it's trusted + $success_txt = $1; + $success_template = new Text::Template ( TYPE => 'STRING', + SOURCE => $success_txt, + DELIMITERS => [ '<%=', '%>' ], + ) + or die $Text::Template::ERROR; +} else { + $success_template = new Text::Template ( TYPE => 'STRING', + SOURCE => &success_default, + DELIMITERS => [ '<%=', '%>' ], + ) + or die $Text::Template::ERROR; +} + +if ( -e $decline_html ) { + my $decline_txt = Text::Template::_load_text($decline_html) + or die $Text::Template::ERROR; + $decline_txt =~ /^(.*)$/s; #untaint the template source - it's trusted + $decline_txt = $1; + $decline_template = new Text::Template ( TYPE => 'STRING', + SOURCE => $decline_txt, + DELIMITERS => [ '<%=', '%>' ], + ) + or die $Text::Template::ERROR; +} else { + $decline_template = new Text::Template ( TYPE => 'STRING', + SOURCE => &decline_default, + DELIMITERS => [ '<%=', '%>' ], + ) + or die $Text::Template::ERROR; +} + +$cgi = new CGI; + +$init_data = signup_info( 'agentnum' => $agentnum, + 'promo_code' => scalar($cgi->param('promo_code')), + 'reg_code' => uc(scalar($cgi->param('reg_code'))), + ); +#$error = $init_data->{'error'}; +#$locales = $init_data->{'cust_main_county'}; +#$packages = $init_data->{'part_pkg'}; +#$pops = $init_data->{'svc_acct_pop'}; +#@payby = @{$init_data->{'payby'}} if @{$init_data->{'payby'}}; +#$packages = $init_data->{agentnum2part_pkg}{$agentnum} if $agentnum; + +if ( ( defined($cgi->param('magic')) && $cgi->param('magic') eq 'process' ) + || ( defined($cgi->param('action')) && $cgi->param('action') eq 'process_signup' ) + ) { + +# if ( $cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ ) { +# $state = $1; +# $county = $3 || ''; +# $country = $4; +# } elsif ( $cgi->param('state') =~ /^(\w*)$/ ) { +# $state = $1; +# $cgi->param('county') =~ /^([\w ]*)$/ +# or die "illegal county: ". $cgi->param('county'); +# $county = $1; +# $cgi->param('country') =~ /^(\w+)$/ +# or die "illegal country: ". $cgi->param('country'); +# $country = $1; +# } else { +# die "illegal state: ". $cgi->param('state'); +# } +# if ( $cgi->param('ship_state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ ) { +# $ship_state = $1; +# $ship_county = $3 || ''; +# $ship_country = $4; +# } elsif ( $cgi->param('ship_state') =~ /^(\w*)$/ ) { +# $ship_state = $1; +# $cgi->param('ship_county') =~ /^([\w ]*)$/ +# or die "illegal county: ". $cgi->param('ship_county'); +# $ship_county = $1; +# #$cgi->param('ship_country') =~ /^(\w+)$/ +# $cgi->param('ship_country') =~ /^(\w*)$/ +# or die "illegal ship_country: ". $cgi->param('ship_country'); +# $ship_country = $1; +# #} else { +# # die "illegal ship_state: ". $cgi->param('ship_state'); +# } + + $error = ''; + + $cgi->param('agentnum', $agentnum) if $agentnum; + $cgi->param('reg_code', uc(scalar($cgi->param('reg_code'))) ); + + #false laziness w/agent.cgi, identical except for agentnum + my $payby = $cgi->param('payby'); + if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) { + #$payinfo = join('@', map { $cgi->param( $payby. "_payinfo$_" ) } (1,2) ); + $cgi->param('payinfo' => $cgi->param($payby. '_payinfo1'). '@'. + $cgi->param($payby. '_payinfo2') + ); + } else { + $cgi->param('payinfo' => $cgi->param( $payby. '_payinfo' ) ); + } + $cgi->param('paydate' => $cgi->param( $payby. '_month' ). '-'. + $cgi->param( $payby. '_year' ) + ); + $cgi->param('payname' => $cgi->param( $payby. '_payname' ) ); + $cgi->param('paycvv' => defined $cgi->param( $payby. '_paycvv' ) + ? $cgi->param( $payby. '_paycvv' ) + : '' + ); + + if ( $cgi->param('invoicing_list') ) { + $cgi->param('invoicing_list' => $cgi->param('invoicing_list'). ', POST') + if $cgi->param('invoicing_list_POST'); + } else { + $cgi->param('invoicing_list' => 'POST' ); + } + + if ( $cgi->param('_password') ne $cgi->param('_password2') ) { + $error = $init_data->{msgcat}{passwords_dont_match}; #msgcat + $cgi->param('_password', ''); + $cgi->param('_password2', ''); + } + + if ( $payby =~ /^(CARD|DCRD)$/ && $cgi->param('CARD_type') ) { + my $payinfo = $cgi->param('payinfo'); + $payinfo =~ s/\D//g; + + $payinfo =~ /^(\d{13,16})$/ + or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo; + $payinfo = $1; + validate($payinfo) + or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo; + cardtype($payinfo) eq $cgi->param('CARD_type') + or $error ||= $init_data->{msgcat}{not_a}. $cgi->param('CARD_type'); + } + + unless ( $error ) { + my $rv = new_customer( { + map { $_ => scalar($cgi->param($_)) } + qw( last first ss company + address1 address2 city county state zip country + daytime night fax + + ship_last ship_first ship_company + ship_address1 ship_address2 ship_city ship_county ship_state + ship_zip ship_country + ship_daytime ship_night ship_fax + + payby payinfo paycvv paydate payname invoicing_list + referral_custnum promo_code reg_code + pkgpart username sec_phrase _password popnum refnum + agentnum + ), + grep { /^snarf_/ } $cgi->param + } ); + $error = $rv->{'error'}; + } + #eslaf + + if ( $error eq '_decline' ) { + print_decline(); + } elsif ( $error ) { + #fudge the snarf info + no strict 'refs'; + ${$_} = $cgi->param($_) foreach grep { /^snarf_/ } $cgi->param; + print_form(); + } else { + print_okay( + 'pkgpart' => scalar($cgi->param('pkgpart')), + ); + } + +} else { + $error = ''; +# $last = ''; +# $first = ''; +# $ss = ''; +# $company = ''; +# $address1 = ''; +# $address2 = ''; +# $city = ''; +# $state = $init_data->{statedefault}; +# $county = ''; +# $country = $init_data->{countrydefault}; +# $zip = ''; +# $daytime = ''; +# $night = ''; +# $fax = ''; +# $ship_last = ''; +# $ship_first = ''; +# $ship_company = ''; +# $ship_address1 = ''; +# $ship_address2 = ''; +# $ship_city = ''; +# $ship_state = $init_data->{statedefault}; +# $ship_county = ''; +# $ship_country = $init_data->{countrydefault}; +# $ship_zip = ''; +# $ship_daytime = ''; +# $ship_night = ''; +# $ship_fax = ''; +# $invoicing_list = ''; +# $payby = ''; +# $payinfo = ''; +# $paydate = ''; +# $payname = ''; +# $pkgpart = ''; +# $username = ''; +# $_password = ''; +# $_password2 = ''; +# $sec_phrase = ''; +# $popnum = ''; +# $referral_custnum = $cgi->param('ref') || ''; +# $init_popstate = $cgi->param('init_popstate') || ''; +# $refnum = $init_data->{'refnum'}; + print_form; +} + +sub print_form { + + $error = "Error: $error" if $error; + + my $r = { + $cgi->Vars, + %{$init_data}, + 'error' => $error, + }; + + $r->{referral_custnum} = $r->{'ref'}; + #$cgi->delete('ref'); + #$cgi->delete('init_popstate'); + $r->{self_url} = $cgi->self_url; + + print $cgi->header( '-expires' => 'now' ), + $signup_template->fill_in( PACKAGE => 'FS::SelfService::_signupcgi', + HASH => $r + ); +} + +sub print_decline { + print $cgi->header( '-expires' => 'now' ), + $decline_template->fill_in(); +} + +sub print_okay { + my %param = @_; + my $user_agent = new HTTP::BrowserDetect $ENV{HTTP_USER_AGENT}; + + $cgi->param('username') =~ /^(.+)$/ + or die "fatal: invalid username got past FS::SelfService::new_customer"; + my $username = $1; + $cgi->param('_password') =~ /^(.+)$/ + or die "fatal: invalid password got past FS::SelfService::new_customer"; + my $password = $1; + ( $cgi->param('first'). ' '. $cgi->param('last') ) =~ /^(.*)$/ + or die "fatal: invalid email_name got past FS::SelfService::new_customer"; + my $email_name = $1; #global for template + + #my %pop = (); + my %popnum2pop = (); + foreach ( @{ $init_data->{'svc_acct_pop'} } ) { + #push @{ $pop{ $_->{state} }->{ $_->{ac} } }, $_; + $popnum2pop{$_->{popnum}} = $_; + } + + my( $ac, $exch, $loc); + my $pop = $popnum2pop{$cgi->param('popnum')}; + #or die "fatal: invalid popnum got past FS::SelfService::new_customer"; + if ( $pop ) { + ( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} ); + } else { + ( $ac, $exch, $loc ) = ( '', '', ''); #presumably you're not using them. + } + + #global for template + my $pkg = ( grep { $_->{'pkgpart'} eq $param{'pkgpart'} } + @{ $init_data->{'part_pkg'} } + )[0]->{'pkg'}; + + if ( $ieak_template && $user_agent->windows && $user_agent->ie ) { + #send an IEAK config + print $cgi->header('application/x-Internet-signup'), + $ieak_template->fill_in(); + } else { #send a simple confirmation + print $cgi->header( '-expires' => 'now' ), + $success_template->fill_in( HASH => { + username => $username, + password => $password, + _password => $password, + email_name => $email_name, + ac => $ac, + exch => $exch, + loc => $loc, + pkg => $pkg, + }); + } +} + +sub success_default { #html to use if you don't specify a success file + <<'END'; +Signup successful +Signup successful

+Thanks for signing up! +

+Signup information for <%= $email_name %>: +

+Username: <%= $username %>
+Password: <%= $password %>
+Access number: (<%= $ac %>) / <%= $exch %> - <%= $local %>
+Package: <%= $pkg %>
+ +END +} + +sub decline_default { #html to use if there is a decline + <<'END'; +Processing error +Processing error

+There has been an error processing your account. Please contact customer +support. + +END +} + +# subs for the templates... + +package FS::SelfService::_signupcgi; +use HTML::Entities; +use FS::SelfService qw(regionselector expselect popselector); + diff --git a/fs_selfservice/FS-SelfService/ieak.template b/fs_selfservice/FS-SelfService/ieak.template new file mode 100755 index 000000000..52edaa951 --- /dev/null +++ b/fs_selfservice/FS-SelfService/ieak.template @@ -0,0 +1,40 @@ +[Entry] +Entry_Name = The Internet +[Phone] +Dial_As_Is=no +Phone_Number = { $exch. $loc } +Area_Code = { $ac } +Country_Code = 1 +Country_Id = 1 +[Server] +Type = PPP +SW_Compress = Yes +PW_Encrypt = Yes +Negotiate_TCP/IP = Yes +Disable_LCP = No +[TCP/IP] +Specify_IP_Address = No +Specity_Server_Address = No +IP_Header_Compress = Yes +Gateway_On_Remote = Yes +[User] +Name = { $username } +Password = { $password } +Display_Password = Yes +[Internet_Mail] +Email_Name = { $email_name } +Email_Address = { $username }\@domain.tld +POP_Server = mail.domain.tld +POP_Server_Port_Number = 110 +POP_Login_Name = { $username } +POP_Login_Password = { $password } +SMTP_Server = mail.domain.tld +SMTP_Server_Port_Number = 25 +Install_Mail = 1 +[Internet_News] +NNTP_Server = news.domain.tld +NNTP_Server_Port_Number = 119 +Logon_Required = No +Install_News = 1 +[Branding] +Window_Title = The Internet diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi index 82f18bff7..d8c74d1fe 100755 --- a/httemplate/browse/agent.cgi +++ b/httemplate/browse/agent.cgi @@ -37,6 +37,7 @@ full offerings (via their type).

Customers Reports Registration Codes + Prepaid cards Freq. Prog. @@ -106,6 +107,13 @@ foreach my $agent ( sort {
Generate codes + + <%= my $num_prepay_credit = $agent->num_prepay_credit %> + <% if ( $num_prepay_credit ) { %> + <% } %>Unused<% if ( $num_prepay_credit ) { %><% } %> +
Generate cards + + <%= $agent->freq %> <%= $agent->prog %> diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html index 63c795375..e9688756b 100644 --- a/httemplate/docs/schema.html +++ b/httemplate/docs/schema.html @@ -353,11 +353,13 @@
  • nasport - port number on the NAS
  • nasnum - NAS -
  • prepay_credit +
  • prepay_credit - prepaid cards
    • prepaynum - primary key -
    • identifier - text or numeric string used to receive this credit -
    • amount - amount of credit +
    • identifier - text or numeric string of prepaid card +
    • amount - amount of prepayment +
    • seconds - prepaid time instead of (or in addition to) monetary value +
    • agentnum - optional agent assignment for prepaid cards
  • session
      diff --git a/httemplate/docs/selfservice.html b/httemplate/docs/selfservice.html index e533ed2ee..6d17ead3f 100644 --- a/httemplate/docs/selfservice.html +++ b/httemplate/docs/selfservice.html @@ -16,19 +16,26 @@ machine, not the backend Freeside server. On the public machine, install:
    • HTTP::BrowserDetect
    • FS::SelfService (copy the fs_selfservice/FS-SelfService directory to the external machine, then: perl Makefile.PL; make; make install) -
    • FS::SignupClient (copy the fs_signup/FS-SignupClient directory to the external machine, then: perl Makefile.PL; make; make install)
    Then:
    • Set the signup_server-default_agentnum configuration value to a default agent number.
    • Set the signup_server-default_refnum to a default advertising source.
    • Add the user `freeside' to the the external machine. -
    • Copy or symlink the
      fs_selfservice/FS-SelfService/cgi/
      directory into the web server's document space, for customer self-service and reseller access. Optionally, customize the .html templates. -
    • Copy or symlink the
      fs_signup/FS-SignupClient/cgi/
      directory into the web server's document space, for signups. Optionally, customize the .html templates. +
    • Copy or symlink the fs_selfservice/FS-SelfService/cgi/ directory into the web server's document space. Optionally, customize the .html templates. "Entry points" (useful places to link to) are: +
        +
      • signup.cgi - Signup +
      • selfservice.cgi - Customer self-service +
      • agent.cgi - Reseller interface +
      • passwd.cgi - Simple password-changing interface +
      • promocode.html - Promotional code pre-signup +
      • regcode.html - Registration code pre-signup +
      • stateselect.html - State selection pre-signup +
    • When linking to signup.cgi, you can include a referring custnum in the URL as follows: http://public.web.server/path/signup.cgi?ref=1542
    • Enable CGI execution for files with the `.cgi' extension. (with Apache)
    • Create the /usr/local/freeside directory on the external machine (owned by the freeside user). -
    • touch /usr/local/freeside/fs_signupd_socket; chown freeside /usr/local/freeside/fs_signupd_socket; chmod 600 /usr/local/freeside/fs_signupd_socket +
    • touch /usr/local/freeside/selfservice_socket; chown freeside /usr/local/freeside/selfservice_socket; chmod 600 /usr/local/freeside/selfservice_socket
    • Use suEXEC or setuid (see install.html for details) to run signup.cgi, selfservice.cgi, agent.cgi and passwd.cgi as the freeside user.
    • Append the identity.pub from the freeside user on your freeside machine to the authorized_keys file of the newly created freeside user on the external machine(s).
    • Run an instance of
      freeside-selfservice-server user machine agentnum refnum
      on the Freeside machine for each external machine. @@ -42,7 +49,7 @@ Then: Optional:
      • If you create a /usr/local/freeside/ieak.template file on the external machine, it will be sent to IE users with MIME type application/x-Internet-signup. This file will be processed with Text::Template with the variables listed below available. - (an example file is included as fs_signup/ieak.template) See the section on internet settings files in the IEAK documentation for more information. + (an example file is included as fs_selfservice/FS-SelfService/ieak.template) See the section on internet settings files in the IEAK documentation for more information.
      • Variable substitutions available in ieak.template and success.html:
          diff --git a/httemplate/docs/upgrade10.html b/httemplate/docs/upgrade10.html index 2a60ca44f..76c49330c 100644 --- a/httemplate/docs/upgrade10.html +++ b/httemplate/docs/upgrade10.html @@ -2,7 +2,7 @@ this is incomplete install DBD::Pg 1.32 (or, if you're using a Perl version before 5.6, you could try installing DBD::Pg 1.22 with this patch and commenting out the "use DBD::Pg 1.32" at the top of DBIx/DBSchema/DBD/Pg.pm) -install DBIx::DBSchema 0.23 +install DBIx::DBSchema 0.24 install Net::SSH 0.08 - If using Apache::ASP, add PerlSetVar RequestBinaryRead Off and PerlSetVar IncludesDir /your/freeside/document/root/ to your Apache configuration and make sure you are using Apache::ASP minimum version 2.55. - In httpd.conf, change <Files ~ \.cgi> to <Files ~ (\.cgi|\.html)> @@ -291,6 +291,8 @@ ALTER TABLE part_pkg ADD promo_code varchar(80) NULL; ALTER TABLE h_part_pkg ADD promo_code varchar(80) NULL; CREATE INDEX part_pkg2 ON part_pkg ( promo_code ); CREATE INDEX h_part_pkg2 ON h_part_pkg ( promo_code ); +ALTER TABLE prepay_credit ADD agentnum integer NULL; +ALTER TABLE h_prepay_credit ADD agentnum integer NULL; On recent Pg versions: diff --git a/httemplate/edit/prepay_credit.cgi b/httemplate/edit/prepay_credit.cgi new file mode 100644 index 000000000..9cf0fc6e1 --- /dev/null +++ b/httemplate/edit/prepay_credit.cgi @@ -0,0 +1,56 @@ +<% +my $agent = ''; +my $agentnum = ''; +if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { + $agent = qsearchs('agent', { 'agentnum' => $agentnum=$1 } ); +} + +tie my %multiplier, 'Tie::IxHash', + 1 => 'seconds', + 60 => 'minutes', + 3600 => 'hours', +; + +$cgi->param('multiplier', '60') unless $cgi->param('multiplier'); + +%> + +<%= header('Generate prepaid cards'. ($agent ? ' for '. $agent->agent : ''), + menubar( 'Main Menu' => $p, )) +%> + +<% if ( $cgi->param('error') ) { %> + Error: <%= $cgi->param('error') %> +<% } %> + +
          + +Generate + + + prepaid cards + +
          for + +
          Value: +$ +and/or + + +

          + + +
          + diff --git a/httemplate/edit/process/prepay_credit.cgi b/httemplate/edit/process/prepay_credit.cgi new file mode 100644 index 000000000..25ecbe079 --- /dev/null +++ b/httemplate/edit/process/prepay_credit.cgi @@ -0,0 +1,51 @@ +<% +my $hashref = {}; + +my $agent = ''; +if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { + $agent = qsearchs('agent', { 'agentnum' => $hashref->{agentnum}=$1 } ); +} + +my $error = ''; + +my $num = 0; +if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) { + $num = $1; +} else { + $error = 'Illegal number of prepaid cards: '. $cgi->param('num'); +} + +$hashref->{amount} = $cgi->param('amount'); +$hashref->{seconds} = $cgi->param('seconds') * $cgi->param('multiplier'); + +$error ||= FS::prepay_credit::generate( $num, + scalar($cgi->param('type')), + $hashref + ); + +unless ( ref($error) ) { + $cgi->param('error', $error ); +%><%= + $cgi->redirect(popurl(3). "edit/prepay_credit.cgi?". $cgi->query_string ) +%><% } else { %> + +<%= header( "$num prepaid cards generated". + ( $agent ? ' for '.$agent->agent : '' ), + menubar( 'Main menu' => popurl(3) ) + ) +%> + + +<% foreach my $card ( @$error ) { %> + <%= $card %> + - + <%= $hashref->{amount} ? sprintf('$%.2f', $hashref->{amount} ) : '' %> + <%= $hashref->{amount} && $hashref->{seconds} ? 'and' : '' %> + <%= $hashref->{seconds} ? duration_exact($hashref->{seconds}) : '' %> +
          +<% } %> + +
          + + +<% } %> diff --git a/httemplate/edit/process/reg_code.cgi b/httemplate/edit/process/reg_code.cgi index 581ede893..4658257f3 100644 --- a/httemplate/edit/process/reg_code.cgi +++ b/httemplate/edit/process/reg_code.cgi @@ -22,11 +22,14 @@ my @pkgparts = $error ||= $agent->generate_reg_codes($num, \@pkgparts); -unless ( ref($error) ) { %><%= +unless ( ref($error) ) { + $cgi->param('error'. $error ); +%><%= $cgi->redirect(popurl(3). "edit/reg_code.cgi?". $cgi->query_string ) %><% } else { %> <%= header("$num registration codes generated for ". $agent->agent, menubar( + 'Main menu' => popurl(3), 'View all agents' => popurl(3). 'browse/agent.cgi', ) ) %> diff --git a/httemplate/index.html b/httemplate/index.html index b3b1c231a..c2676025f 100644 --- a/httemplate/index.html +++ b/httemplate/index.html @@ -139,26 +139,6 @@

          Prepaid Income (Unearned Revenue) Report

          Sales Tax Liability Report

          -


          - Administration - -
          @@ -232,7 +212,7 @@
          Download database dump



          Configuration -

          Administration +

          Provisioning, services and packages
          • View/Edit exports - Provisioning services to external machines, databases and APIs. @@ -242,30 +222,49 @@ - One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services. +
          + Resellers +
          • View/Edit agent types - Agent types define groups of package definitions that you can then assign to particular agents.
          • View/Edit agents - Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type). -
          • View/Edit advertising sources - - Where a customer heard about your service. Tracked for - informational purposes. +
          + Billing + + Dialup + + Fixed (username-less) broadband + + Miscellaneous +
          diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html index 6bd6b0363..53aa309c3 100644 --- a/httemplate/search/elements/search.html +++ b/httemplate/search/elements/search.html @@ -177,9 +177,16 @@ } else { ( my $xlsname = $opt{'name'} ) =~ s/\W//g; $opt{'name'} =~ s/s$// if $total == 1; + + my @menubar = (); + if ( $opt{'menubar'} ) { + @menubar = @{ $opt{'menubar'} }; + } else { + @menubar = ( 'Main menu' => $p ); + } %> <%= include( '/elements/header.html', $opt{'title'}, - include( '/elements/menubar.html', 'Main menu' => $p ) + include( '/elements/menubar.html', @menubar ) ) %> <% my $pager = include ( '/elements/pager.html', @@ -195,7 +202,7 @@ -
          + <%= $total %> total <%= $opt{'name'} %>
          <% if ( $opt{'count_addl'} ) { %> <% my $n=0; foreach my $count ( @{$opt{'count_addl'}} ) { %> diff --git a/httemplate/search/prepay_credit.html b/httemplate/search/prepay_credit.html new file mode 100644 index 000000000..8c8f57b5a --- /dev/null +++ b/httemplate/search/prepay_credit.html @@ -0,0 +1,43 @@ +<% +my $agent = ''; +my $hashref = {}; +if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { + $hashref->{agentnum} = $1; + $agent = qsearchs('agent', { 'agentnum' => $1 } ); +} + +my $count_query = 'SELECT COUNT(*) FROM prepay_credit'; +$count_query .= ' WHERE agentnum = '. $agent->agentnum if $agent; + +%><%= include( 'elements/search.html', + 'title' => 'Unused Prepaid Cards'. + ($agent ? ' for '. $agent->agent : ''), + 'menubar' => [ + 'Main menu' => $p, + 'Generate cards' => $p.'edit/prepay_credit.cgi', + ], + 'name' => 'prepaid cards', + 'query' => { 'table' => 'prepay_credit', + 'hashref' => $hashref, + }, + 'count_query' => $count_query, + #'redirect' => $link, + 'header' => [ '#', qw(Amount Time Agent) ], + 'fields' => [ + 'identifier', + sub { sprintf('$%.2f', shift->amount ) }, + sub { my $c = shift; $c ? duration_exact($c->seconds) : '' }, + sub { my $agent = shift->agent; + $agent ? $agent->agent : ''; + }, + ], + 'links' => [ + '', + '', + '', + sub { my $agent = shift->agent; + $agent ? [ "${p}view/agent.cgi?", 'agentnum' ] : ''; + }, + ], + ) +%> diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 0f3a98702..db01ebbcf 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -50,6 +50,7 @@ foreach my $cust_pay ($cust_main->cust_pay) { my $target = "$payby$payinfo"; $payby =~ s/^BILL$/Check #/ if $payinfo; $payby =~ s/^CHEK$/Electronic check /; + $payby =~ s/^PREP$/Prepaid card /; $payby =~ s/^BILL$//; $payby =~ s/^(CARD|COMP)$/$1 /; my $info = $payby ? " ($payby$payinfo)" : ''; -- 2.11.0