[freeside-commits] freeside/FS/FS Mason.pm, 1.4, 1.5 cust_main.pm, 1.395, 1.396 cust_location.pm, 1.1, 1.2

Ivan,,, ivan at wavetail.420.am
Thu Jan 8 20:06:28 PST 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv25024/FS/FS

Modified Files:
	Mason.pm cust_main.pm cust_location.pm 
Log Message:
pick/enter a location when ordering a package, RT#4499

Index: cust_location.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_location.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cust_location.pm	8 Jan 2009 01:45:21 -0000	1.1
+++ cust_location.pm	9 Jan 2009 04:06:26 -0000	1.2
@@ -158,6 +158,27 @@
   code2country($self->country);
 }
 
+=item line
+
+Returns this location on one line
+
+=cut
+
+sub line {
+  my $self = shift;
+  my $cydefault = FS::conf->new->config('countrydefault') || 'US';
+
+  my $line =       $self->address1;
+  $line   .= ', '. $self->address2              if $self->address2;
+  $line   .= ', '. $self->city;
+  $line   .= ' ('. $self->county. ' county)'    if $self->county;
+  $line   .= ', '. $self->state                 if $self->state;
+  $line   .= '  '. $self->zip                   if $self->zip;
+  $line   .= '  '. code2country($self->country) if $self->country ne $cydefault;
+
+  $line;
+}
+
 =back
 
 =head1 BUGS

Index: Mason.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Mason.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Mason.pm	9 Nov 2008 08:51:00 -0000	1.4
+++ Mason.pm	9 Jan 2009 04:06:26 -0000	1.5
@@ -105,6 +105,7 @@
   use FS::cust_main qw(smart_search);
   use FS::cust_main::Import;
   use FS::cust_main_county;
+  use FS::cust_location;
   use FS::cust_pay;
   use FS::cust_pkg;
   use FS::part_pkg_taxclass;

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.395
retrieving revision 1.396
diff -u -d -r1.395 -r1.396
--- cust_main.pm	8 Jan 2009 01:45:21 -0000	1.395
+++ cust_main.pm	9 Jan 2009 04:06:26 -0000	1.396
@@ -36,6 +36,7 @@
 use FS::cust_refund;
 use FS::part_referral;
 use FS::cust_main_county;
+use FS::cust_location;
 use FS::tax_rate;
 use FS::cust_tax_location;
 use FS::part_pkg_taxrate;
@@ -1721,6 +1722,17 @@
   shift->all_pkgs(@_);
 }
 
+=item cust_location
+
+Returns all locations (see L<FS::cust_location>) for this customer.
+
+=cut
+
+sub cust_location {
+  my $self = shift;
+  qsearch('cust_location', { 'custnum' => $self->custnum } );
+}
+
 =item ncancelled_pkgs
 
 Returns all non-cancelled packages (see L<FS::cust_pkg>) for this customer.



More information about the freeside-commits mailing list