X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main.cgi;h=896472d2b96df3a750ee5e92cfbf4a6b96a6ec14;hb=b89c7f126690704c8d1558dba06d5fabd7470528;hp=bfd396881b110106adaea556412bed4dea58cfd8;hpb=673b9a458d9138523026963df6fa3b4683e09bae;p=freeside.git
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index bfd396881..896472d2b 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -1,244 +1,281 @@
-<%
-
- #for misplaced logic below
- #use FS::part_pkg;
-
- #for false laziness below (now more properly lazy)
- #use FS::svc_acct_pop;
-
- #for (other) false laziness below
- #use FS::agent;
- #use FS::type_pkgs;
-
-my $conf = new FS::Conf;
-
-#get record
-
-my $error = '';
-my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart);
-my(@invoicing_list);
-my $same = '';
-if ( $cgi->param('error') ) {
- $error = $cgi->param('error');
- $cust_main = new FS::cust_main ( {
- map { $_, scalar($cgi->param($_)) } fields('cust_main')
- } );
- $custnum = $cust_main->custnum;
- $saved_pkgpart = $cgi->param('pkgpart_svcpart') || '';
- if ( $saved_pkgpart =~ /^(\d+)_/ ) {
- $saved_pkgpart = $1;
- } else {
- $saved_pkgpart = '';
- }
- $username = $cgi->param('username');
- $password = $cgi->param('_password');
- $popnum = $cgi->param('popnum');
- @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') );
- $same = $cgi->param('same');
-} elsif ( $cgi->keywords ) { #editing
- my( $query ) = $cgi->keywords;
- $query =~ /^(\d+)$/;
- $custnum=$1;
- $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
- if ( $cust_main->dbdef_table->column('paycvv')
- && length($cust_main->paycvv) ) {
- my $paycvv = $cust_main->paycvv;
- $paycvv =~ s/./*/g;
- $cust_main->paycvv($paycvv);
- }
- $saved_pkgpart = 0;
- $username = '';
- $password = '';
- $popnum = 0;
- @invoicing_list = $cust_main->invoicing_list;
-} else {
- $custnum='';
- $cust_main = new FS::cust_main ( {} );
- $cust_main->otaker( &getotaker );
- $cust_main->referral_custnum( $cgi->param('referral_custnum') );
- $saved_pkgpart = 0;
- $username = '';
- $password = '';
- $popnum = 0;
- @invoicing_list = ();
-}
-$cgi->delete_all();
-my $action = $custnum ? 'Edit' : 'Add';
+%
+%
+% #for misplaced logic below
+% #use FS::part_pkg;
+%
+% #for false laziness below (now more properly lazy)
+% #use FS::svc_acct_pop;
+%
+% #for (other) false laziness below
+% #use FS::agent;
+% #use FS::type_pkgs;
+%
+%my $conf = new FS::Conf;
+%
+%#get record
+%
+%my $error = '';
+%my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart);
+%my(@invoicing_list);
+%my $payinfo;
+%my $same = '';
+%if ( $cgi->param('error') ) {
+% $error = $cgi->param('error');
+% $cust_main = new FS::cust_main ( {
+% map { $_, scalar($cgi->param($_)) } fields('cust_main')
+% } );
+% $custnum = $cust_main->custnum;
+% $saved_pkgpart = $cgi->param('pkgpart_svcpart') || '';
+% if ( $saved_pkgpart =~ /^(\d+)_/ ) {
+% $saved_pkgpart = $1;
+% } else {
+% $saved_pkgpart = '';
+% }
+% $username = $cgi->param('username');
+% $password = $cgi->param('_password');
+% $popnum = $cgi->param('popnum');
+% @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') );
+% $same = $cgi->param('same');
+% $cust_main->setfield('paid' => $cgi->param('paid')) if $cgi->param('paid');
+% $payinfo = $cust_main->payinfo; # don't mask an entered value on errors
+%} elsif ( $cgi->keywords ) { #editing
+% my( $query ) = $cgi->keywords;
+% $query =~ /^(\d+)$/;
+% $custnum=$1;
+% $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
+% if ( $cust_main->dbdef_table->column('paycvv')
+% && length($cust_main->paycvv) ) {
+% my $paycvv = $cust_main->paycvv;
+% $paycvv =~ s/./*/g;
+% $cust_main->paycvv($paycvv);
+% }
+% $saved_pkgpart = 0;
+% $username = '';
+% $password = '';
+% $popnum = 0;
+% @invoicing_list = $cust_main->invoicing_list;
+% $payinfo = $cust_main->paymask;
+%} else {
+% $custnum='';
+% $cust_main = new FS::cust_main ( {} );
+% $cust_main->otaker( &getotaker );
+% $cust_main->referral_custnum( $cgi->param('referral_custnum') );
+% $saved_pkgpart = 0;
+% $username = '';
+% $password = '';
+% $popnum = 0;
+% @invoicing_list = ();
+% push @invoicing_list, 'POST'
+% unless $conf->exists('disablepostalinvoicedefault');
+% $payinfo = '';
+%}
+%$cgi->delete_all();
+%
+%my $action = $custnum ? 'Edit' : 'Add';
+%$action .= ": ". $cust_main->name if $custnum;
+%
+%my $r = qq!* !;
+%
+%
-%>
-<%= header("Customer $action", '', ' onUnload="myclose()"') %>
+<% include('/elements/header.html',
+ "Customer $action",
+ '',
+ ' onUnload="myclose()"'
+) %>
+% if ( $error ) {
+
+Error: <% $error %>
+% }
-<% if ( $error ) { %>
-Error: <%= $error %>
-<% } %>