[freeside-commits] freeside/FS/FS cust_main.pm,1.566,1.567
Ivan,,,
ivan at wavetail.420.am
Sun Oct 31 16:39:19 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv31976
Modified Files:
cust_main.pm
Log Message:
on merge, add customer (ship) name to svc_phone.phone_name if blank, RT#10247
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.566
retrieving revision 1.567
diff -u -w -d -r1.566 -r1.567
--- cust_main.pm 31 Oct 2010 21:23:36 -0000 1.566
+++ cust_main.pm 31 Oct 2010 23:39:17 -0000 1.567
@@ -1246,6 +1246,8 @@
}
+ my $name = $self->ship_name;
+
my $locationnum = '';
foreach my $cust_pkg ( $self->all_pkgs ) {
$cust_pkg->custnum($new_custnum);
@@ -1271,6 +1273,22 @@
$dbh->rollback if $oldAutoCommit;
return $error;
}
+
+ # add customer (ship) name to svc_phone.phone_name if blank
+ my @cust_svc = $cust_pkg->cust_svc;
+ foreach my $cust_svc (@cust_svc) {
+ my($label, $value, $svcdb) = $cust_svc->label;
+ next unless $svcdb eq 'svc_phone';
+ my $svc_phone = $cust_svc->svc_x;
+ next if $svc_phone->phone_name;
+ $svc_phone->phone_name($name);
+ my $error = $svc_phone->replace;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
}
#not considered:
More information about the freeside-commits
mailing list