freeside/FS/FS part_pkg.pm,1.35,1.36 cust_pkg.pm,1.55,1.56
ivan
ivan at pouncequick.420.am
Tue Mar 1 16:03:51 PST 2005
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory pouncequick:/tmp/cvs-serv9709
Modified Files:
part_pkg.pm cust_pkg.pm
Log Message:
prevent bug causing 'Error crediting customer for service remaining: FS::cust_pkg=HASH(0x9958c60)' error on package cancellations where the part_pkg record didn't have a plan, closes: Bug#1153
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- cust_pkg.pm 29 Jan 2005 12:34:10 -0000 1.55
+++ cust_pkg.pm 2 Mar 2005 00:03:48 -0000 1.56
@@ -396,12 +396,16 @@
}
# Add a credit for remaining service
- my $remaining_value= $self->calc_remain();
- if ($remaining_value > 0) {
- my $error = $self->credit($remaining_value, 'Credit for service remaining');
+ my $remaining_value = $self->calc_remain();
+ if ( $remaining_value > 0 ) {
+ my $error = $self->cust_main->credit(
+ $remaining_value,
+ 'Credit for unused time on'. $self->part_pkg->pkg,
+ );
if ($error) {
$dbh->rollback if $oldAutoCommit;
- return "Error crediting customer for service remaining: $error";
+ return "Error crediting customer \$$remaining_value for unused time on".
+ $self->part_pkg->pkg. ": $error";
}
}
Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- part_pkg.pm 25 Feb 2005 20:52:11 -0000 1.35
+++ part_pkg.pm 2 Mar 2005 00:03:48 -0000 1.36
@@ -672,6 +672,11 @@
$value;
}
+#fallback that return 0 for old legacy packages with no plan
+
+sub calc_remain { 0; }
+sub calc_cancel { 0; }
+
=back
=head1 SUBROUTINES
More information about the freeside-commits
mailing list