summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/cust_main-contacts.html1
-rwxr-xr-xhttemplate/edit/cust_main.cgi4
-rw-r--r--httemplate/edit/cust_main/contacts_new.html7
-rw-r--r--httemplate/edit/elements/edit.html4
-rw-r--r--httemplate/edit/elements/part_svc_column.html3
-rw-r--r--httemplate/edit/quick-charge.html4
6 files changed, 16 insertions, 7 deletions
diff --git a/httemplate/edit/cust_main-contacts.html b/httemplate/edit/cust_main-contacts.html
index 9f0654608..3b7eb07d3 100644
--- a/httemplate/edit/cust_main-contacts.html
+++ b/httemplate/edit/cust_main-contacts.html
@@ -11,6 +11,7 @@
{ 'field' => 'contactnum',
'type' => 'contact',
'colspan' => 6,
+ 'custnum' => $custnum,
'm2m_method' => 'cust_contact',
'm2m_dstcol' => 'contactnum',
'm2_label' => ' ', #'Contact',
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index 353ae1799..da87bfca7 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -325,8 +325,8 @@ if ( $cgi->param('error') ) {
$cust_main->company( $prospect_main->company );
#first contact? -> name
- my @contacts = $prospect_main->contact;
- my $contact = $contacts[0];
+ my @prospect_contacts = $prospect_main->prospect_contact;
+ my $contact = $prospect_contacts[0]->contact;
$cust_main->first( $contact->first );
$cust_main->set( 'last', $contact->get('last') );
#contact phone numbers?
diff --git a/httemplate/edit/cust_main/contacts_new.html b/httemplate/edit/cust_main/contacts_new.html
index f59126a66..0ab02b420 100644
--- a/httemplate/edit/cust_main/contacts_new.html
+++ b/httemplate/edit/cust_main/contacts_new.html
@@ -11,6 +11,7 @@
{ 'field' => 'contactnum',
'type' => 'contact',
'colspan' => 6,
+ 'custnum' => $opt{cust_main}->custnum,
'm2m_method' => 'cust_contact',
'm2m_dstcol' => 'contactnum',
'm2_label' => 'Contact',
@@ -36,8 +37,8 @@ my $m2_error_callback = sub {
my($cgi, $object) = @_;
#process_o2m fields in process/cust_main-contacts.html
- my @fields = qw( first last title comment );
- my @gfields = ( '', map "_$_", @fields );
+ my $fields = FS::contact->cgi_contact_fields;
+ my @gfields = ( '', map "_$_", @$fields );
map {
if ( /^contactnum(\d+)$/ ) {
@@ -45,7 +46,7 @@ my $m2_error_callback = sub {
if ( grep $cgi->param("contactnum$num$_"), @gfields ) {
my $x = new FS::contact {
'contactnum' => scalar($cgi->param("contactnum$num")),
- map { $_ => scalar($cgi->param("contactnum${num}_$_")) } @fields,
+ map { $_ => scalar($cgi->param("contactnum${num}_$_")) } @$fields,
};
$x;
} else {
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 9e506a731..4d5beee71 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -334,6 +334,10 @@ Example:
% #any?
% 'colspan' => $f->{'colspan'},
% 'required' => $f->{'required'},
+%
+% #contact
+% 'custnum' => $f->{'custnum'},
+% 'prospectnum' => $f->{'prospectnum'},
% );
%
% $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}),
diff --git a/httemplate/edit/elements/part_svc_column.html b/httemplate/edit/elements/part_svc_column.html
index 53cda859e..2bb4f5e41 100644
--- a/httemplate/edit/elements/part_svc_column.html
+++ b/httemplate/edit/elements/part_svc_column.html
@@ -140,7 +140,8 @@ that field.
'value_col' => $def->{'select_key'},
'order_by' => dbdef->table($def->{'select_table'})->primary_key,
'multiple' => $def->{'multiple'},
- 'disable_empty' => 1,
+ 'disable_empty' => $def->{'select_allow_empty'} ? undef : 1,
+ 'empty_label' => $def->{'select_allow_empty'} ? ' ' : undef,
'curr_value' => $value,
# these can be switched between multiple and singular,
# so put the complete curr_value in an attribute
diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index 20a9ec783..58c1b0a82 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -106,7 +106,7 @@ function bill_now_changed (what) {
<TABLE ID="QuickChargeTable" BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 STYLE="background-color: #cccccc">
-% if ( $cust_pkg ) {
+% if ( $cust_pkg ) { #modify one-time charge
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $cust_pkg->pkgnum %>">
% my $field = '/elements/tr-input-text.html';
@@ -171,6 +171,7 @@ function bill_now_changed (what) {
&>
% }
+% unless ($billed) {
<TR>
<TD ALIGN="right"><% mt('Tax exempt') |h %> </TD>
<TD><INPUT TYPE="checkbox" NAME="setuptax" VALUE="Y" <% $cgi->param('setuptax') ? 'CHECKED' : '' %>></TD>
@@ -179,6 +180,7 @@ function bill_now_changed (what) {
<& /elements/tr-select-taxclass.html, 'curr_value' => $part_pkg->get('taxclass') &>
<& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $part_pkg->get('taxproductnum') &>
+% }
% } else { # new one-time charge