[freeside-commits] freeside/FS/FS cust_pkg.pm, 1.179.2.12, 1.179.2.13
Ivan,,,
ivan at wavetail.420.am
Wed Jan 19 21:22:36 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv24069
Modified Files:
Tag: FREESIDE_2_1_BRANCH
cust_pkg.pm
Log Message:
fix cancelling services on exspirations, RT#11269
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.179.2.12
retrieving revision 1.179.2.13
diff -u -w -d -r1.179.2.12 -r1.179.2.13
--- cust_pkg.pm 16 Jan 2011 22:31:27 -0000 1.179.2.12
+++ cust_pkg.pm 20 Jan 2011 05:22:34 -0000 1.179.2.13
@@ -749,23 +749,8 @@
}
my %svc;
- if ( $date ) {
-# copied from below
- foreach my $cust_svc (
- #schwartz
- map { $_->[0] }
- sort { $a->[1] <=> $b->[1] }
- map { [ $_, $_->svc_x->table_info->{'cancel_weight'} ]; }
- qsearch( 'cust_svc', { 'pkgnum' => $self->pkgnum } )
- ) {
- my $error = $cust_svc->cancel( ('date' => $date) );
+ unless ( $date ) {
- if ( $error ) {
- $dbh->rollback if $oldAutoCommit;
- return "Error expiring cust_svc: $error";
- }
- }
- } else { #!date
foreach my $cust_svc (
#schwartz
map { $_->[0] }
@@ -780,7 +765,6 @@
return "Error cancelling cust_svc: $error";
}
}
- } #if $date
# Add a credit for remaining service
my $last_bill = $self->getfield('last_bill') || 0;
@@ -809,12 +793,14 @@
);
if ($error) {
$dbh->rollback if $oldAutoCommit;
- return "Error crediting customer \$$remaining_value for unused time on".
- $self->part_pkg->pkg. ": $error";
+ return "Error crediting customer \$$remaining_value for unused time".
+ " on ". $self->part_pkg->pkg. ": $error";
}
} #if $remaining_value
} #if $do_credit
+ } #unless $date
+
my %hash = $self->hash;
$date ? ($hash{'expire'} = $date) : ($hash{'cancel'} = $cancel_time);
my $new = new FS::cust_pkg ( \%hash );
More information about the freeside-commits
mailing list