summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/ConfDefaults.pm22
-rw-r--r--FS/FS/UI/Web.pm23
-rw-r--r--FS/FS/cust_main.pm10
-rw-r--r--FS/FS/cust_main_Mixin.pm9
4 files changed, 40 insertions, 24 deletions
diff --git a/FS/FS/ConfDefaults.pm b/FS/FS/ConfDefaults.pm
index de65b44..191ff85 100644
--- a/FS/FS/ConfDefaults.pm
+++ b/FS/FS/ConfDefaults.pm
@@ -38,15 +38,15 @@ sub cust_fields_avail { (
'Cust# | Cust. Status | Name | Company' =>
'custnum | Status | Last, First | Company',
- 'Cust. Status | (bill) Customer | (service) Customer' =>
- 'Status | Last, First or Company (Last, First) | (same for service contact if present)',
- 'Cust# | Cust. Status | (bill) Customer | (service) Customer' =>
- 'custnum | Status | Last, First or Company (Last, First) | (same for service contact if present)',
+ 'Cust. Status | Customer' =>
+ 'Status | Last, First or Company (Last, First)',
+ 'Cust# | Cust. Status | Customer' =>
+ 'custnum | Status | Last, First or Company (Last, First)',
- 'Cust. Status | (bill) Name | (bill) Company | (service) Name | (service) Company' =>
- 'Status | Last, First | Company | (same for service contact if present)',
- 'Cust# | Cust. Status | (bill) Name | (bill) Company | (service) Name | (service) Company' =>
- 'custnum | Status | Last, First | Company | (same for service contact if present)',
+ 'Cust. Status | Name | Company' =>
+ 'Status | Last, First | Company',
+ 'Cust# | Cust. Status | Name | Company' =>
+ 'custnum | Status | Last, First | Company',
'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Invoicing email(s)' =>
'custnum | Status | Last, First | Company | (address) | Day phone | Night phone | Invoicing email(s)',
@@ -57,13 +57,13 @@ sub cust_fields_avail { (
'Cust# | Cust. Status | Name | Company | Address 1 | Address 2 | City | State | Zip | Country | Day phone | Night phone | Fax number | Invoicing email(s) | Payment Type | Current Balance' =>
'custnum | Status | Last, First | Company | (address) | (all phones) | Invoicing email(s) | Payment Type | Current Balance',
- 'Cust# | Cust. Status | (bill) Name | (bill) Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | (bill) Day phone | (bill) Night phone | (service) Name | (service) Company | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | (service) Day phone | (service) Night phone | Invoicing email(s)' =>
+ 'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | Day phone | Night phone | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | Day phone | Night phone | Invoicing email(s)' =>
'custnum | Status | Last, First | Company | (address) | Day phone | Night phone | (service address) | Invoicing email(s)',
- 'Cust# | Cust. Status | (bill) Name | (bill) Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | (bill) Day phone | (bill) Night phone | (bill) Fax number | (service) Name | (service) Company | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | (service) Day phone | (service) Night phone | (service) Fax number | Invoicing email(s) | Payment Type' =>
+ 'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | Day phone | Night phone | Fax number | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | Invoicing email(s) | Payment Type' =>
'custnum | Status | Last, First | Company | (address) | (all phones) | (service address) | Invoicing email(s) | Payment Type',
- 'Cust# | Cust. Status | (bill) Name | (bill) Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | (bill) Day phone | (bill) Night phone | (bill) Fax number | (service) Name | (service) Company | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | (service) Day phone | (service) Night phone | (service) Fax number | Invoicing email(s) | Payment Type | Current Balance' =>
+ 'Cust# | Cust. Status | Name | Company | (bill) Address 1 | (bill) Address 2 | (bill) City | (bill) State | (bill) Zip | (bill) Country | Day phone | Night phone | Fax number | (service) Address 1 | (service) Address 2 | (service) City | (service) State | (service) Zip | (service) Country | Day phone | Night phone | Fax number | Invoicing email(s) | Payment Type | Current Balance' =>
'custnum | Status | Last, First | Company | (address) | (all phones) | (service address) | Invoicing email(s) | Payment Type | Current Balance',
'Invoicing email(s)' => 'Invoicing email(s)',
diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm
index ccba1de..d7f998b 100644
--- a/FS/FS/UI/Web.pm
+++ b/FS/FS/UI/Web.pm
@@ -229,18 +229,25 @@ sub cust_header {
'Cust#' => 'custnum',
'Name' => 'contact',
'Company' => 'company',
+
+ # obsolete but might still be referenced in configuration
'(bill) Customer' => 'name',
'(service) Customer' => 'ship_name',
'(bill) Name' => 'contact',
'(service) Name' => 'ship_contact',
'(bill) Company' => 'company',
'(service) Company' => 'ship_company',
+ '(bill) Day phone' => 'daytime',
+ '(bill) Night phone' => 'night',
+ '(bill) Fax number' => 'fax',
+
+ 'Customer' => 'name',
'Address 1' => 'bill_address1',
'Address 2' => 'bill_address2',
'City' => 'bill_city',
'State' => 'bill_state',
'Zip' => 'bill_zip',
- 'Country' => 'country_full',
+ 'Country' => 'bill_country_full',
'Day phone' => 'daytime', # XXX should use msgcat, but how?
'Night phone' => 'night', # XXX should use msgcat, but how?
'Fax number' => 'fax',
@@ -249,19 +256,13 @@ sub cust_header {
'(bill) City' => 'bill_city',
'(bill) State' => 'bill_state',
'(bill) Zip' => 'bill_zip',
- '(bill) Country' => 'country_full',
- '(bill) Day phone' => 'daytime', # XXX should use msgcat, but how?
- '(bill) Night phone' => 'night', # XXX should use msgcat, but how?
- '(bill) Fax number' => 'fax',
+ '(bill) Country' => 'bill_country_full',
'(service) Address 1' => 'ship_address1',
'(service) Address 2' => 'ship_address2',
'(service) City' => 'ship_city',
'(service) State' => 'ship_state',
'(service) Zip' => 'ship_zip',
'(service) Country' => 'ship_country_full',
- '(service) Day phone' => 'ship_daytime', # XXX should use msgcat, how?
- '(service) Night phone' => 'ship_night', # XXX should use msgcat, how?
- '(service) Fax number' => 'ship_fax',
'Invoicing email(s)' => 'invoicing_list_emailonly_scalar',
'Payment Type' => 'payby',
'Current Balance' => 'current_balance',
@@ -348,8 +349,10 @@ sub cust_sql_fields {
}
}
}
-
- push @fields, 'payby' if grep { $_ eq 'payby'} @cust_fields;
+
+ foreach my $field (qw(daytime night fax payby)) {
+ push @fields, $field if (grep { $_ eq $field } @cust_fields);
+ }
push @fields, 'agent_custid';
my @extra_fields = ();
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 3403dc4..e393125 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -4061,6 +4061,16 @@ sub ship_contact_firstlast {
# code2country($self->country);
#}
+sub bill_country_full {
+ my $self = shift;
+ code2country($self->bill_location->country);
+}
+
+sub ship_country_full {
+ my $self = shift;
+ code2country($self->ship_location->country);
+}
+
=item county_state_county [ PREFIX ]
Returns a string consisting of just the county, state and country.
diff --git a/FS/FS/cust_main_Mixin.pm b/FS/FS/cust_main_Mixin.pm
index 212c04e..f584b41 100644
--- a/FS/FS/cust_main_Mixin.pm
+++ b/FS/FS/cust_main_Mixin.pm
@@ -131,9 +131,12 @@ linked to a customer.
sub country_full {
my $self = shift;
- $self->cust_linked
- ? FS::cust_main::country_full($self)
- : $self->cust_unlinked_msg;
+ if ( $self->locationnum ) { # cust_pkg has this
+ my $location = FS::cust_location->by_key($self->locationnum);
+ $location ? $location->country_full : '';
+ } elsif ( $self->cust_linked ) {
+ $self->cust_main->bill_country_full;
+ }
}
=item invoicing_list_emailonly