X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main.cgi;h=706526865fad93762b5240b9509afbd1ffb152b6;hp=cf8de2f133b692b889b3868fea26ce0136169476;hb=2a5963390ddd68ecb2e40568ca272c0a2f8b831a;hpb=cab37352b30b0bb1318ff237fb4dda8482f4bfef
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index cf8de2f13..706526865 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -17,6 +17,7 @@ my $conf = new FS::Conf;
my $error = '';
my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart);
+my(@invoicing_list);
if ( $cgi->param('error') ) {
$error = $cgi->param('error');
$cust_main = new FS::cust_main ( {
@@ -32,6 +33,7 @@ if ( $cgi->param('error') ) {
$username = $cgi->param('username');
$password = $cgi->param('_password');
$popnum = $cgi->param('popnum');
+ @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') );
} elsif ( $cgi->keywords ) { #editing
my( $query ) = $cgi->keywords;
$query =~ /^(\d+)$/;
@@ -41,6 +43,7 @@ if ( $cgi->param('error') ) {
$username = '';
$password = '';
$popnum = 0;
+ @invoicing_list = $cust_main->invoicing_list;
} else {
$custnum='';
$cust_main = new FS::cust_main ( {} );
@@ -50,6 +53,7 @@ if ( $cgi->param('error') ) {
$username = '';
$password = '';
$popnum = 0;
+ @invoicing_list = ();
}
$cgi->delete_all();
my $action = $custnum ? 'Edit' : 'Add';
@@ -73,7 +77,7 @@ my $r = qq!* !;
my @agents = qsearch( 'agent', {} );
#die "No agents created!" unless @agents;
-die "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents;
+eidiot "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents;
my $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first
if ( scalar(@agents) == 1 ) {
print qq!!;
@@ -99,7 +103,7 @@ if ( $custnum && ! $conf->exists('editreferrals') ) {
} else {
my(@referrals) = qsearch('part_referral',{});
if ( scalar(@referrals) == 0 ) {
- die "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources.";
+ eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources.";
} elsif ( scalar(@referrals) == 1 ) {
$refnum ||= $referrals[0]->refnum;
print qq!!;
@@ -195,10 +199,13 @@ my($daytime,$night,$fax)=(
$cust_main->fax,
);
+my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone';
+my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone';
+
print <
${r}Country
$country_html
-
Day Phone
-
Night Phone
+
$daytime_label
+
$night_label
Fax
END
@@ -231,7 +238,7 @@ END
print ' Service address ',
'(ship_last ) {
+ unless ( $cust_main->ship_last && $cgi->param('same') ne 'Y' ) {
print ' CHECKED';
foreach (
qw( last first company address1 address2 city county state zip country
@@ -294,8 +301,8 @@ END
print <
${r}Country
$ship_country_html
-
Day Phone
-
Night Phone
+
$daytime_label
+
$night_label
Fax
END
@@ -336,48 +343,98 @@ sub expselect {
$return;
}
-print " Billing information", &itable("#cccccc"),
- qq!
$r required fields for each billing type";
+ print "$r required fields for each billing type";
+
+}
if ( defined $cust_main->dbdef_table->column('comments') ) {
print "