[freeside-commits] freeside/FS/FS part_pkg.pm,1.92,1.93
Ivan,,,
ivan at wavetail.420.am
Mon Jun 22 03:28:44 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv26009
Modified Files:
part_pkg.pm
Log Message:
fix setup/recur -> setup_fee/recur_fee upgrade
Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- part_pkg.pm 21 Jun 2009 15:21:30 -0000 1.92
+++ part_pkg.pm 22 Jun 2009 10:28:41 -0000 1.93
@@ -1225,27 +1225,29 @@
foreach my $part_pkg (@part_pkg) {
unless ( $part_pkg->plan ) {
-
$part_pkg->plan('flat');
+ }
- if ( $part_pkg->setup =~ /^\s*([\d\.]+)\s*$/ ) {
+ if ( length($part_pkg->option('setup_fee')) == 0
+ && $part_pkg->setup =~ /^\s*([\d\.]+)\s*$/ ) {
- my $opt = new FS::part_pkg_option {
- 'pkgpart' => $part_pkg->pkgpart,
- 'optionname' => 'setup_fee',
- 'optionvalue' => $1,
- };
- my $error = $opt->insert;
- die $error if $error;
+ my $opt = new FS::part_pkg_option {
+ 'pkgpart' => $part_pkg->pkgpart,
+ 'optionname' => 'setup_fee',
+ 'optionvalue' => $1,
+ };
+ my $error = $opt->insert;
+ die $error if $error;
- $part_pkg->setup('');
- } else {
- die "Can't parse part_pkg.setup for fee; convert pkgnum ".
- $part_pkg->pkgnum. " manually: ". $part_pkg->setup. "\n";
- }
+ #} else {
+ # die "Can't parse part_pkg.setup for fee; convert pkgnum ".
+ # $part_pkg->pkgnum. " manually: ". $part_pkg->setup. "\n";
+ }
+ $part_pkg->setup('');
- if ( $part_pkg->recur =~ /^\s*([\d\.]+)\s*$/ ) {
+ if ( length($part_pkg->option('recur_fee')) == 0
+ && $part_pkg->recur =~ /^\s*([\d\.]+)\s*$/ ) {
my $opt = new FS::part_pkg_option {
'pkgpart' => $part_pkg->pkgpart,
@@ -1255,14 +1257,12 @@
my $error = $opt->insert;
die $error if $error;
- $part_pkg->recur('');
-
- } else {
- die "Can't parse part_pkg.setup for fee; convert pkgnum ".
- $part_pkg->pkgnum. " manually: ". $part_pkg->setup. "\n";
- }
+ #} else {
+ # die "Can't parse part_pkg.setup for fee; convert pkgnum ".
+ # $part_pkg->pkgnum. " manually: ". $part_pkg->setup. "\n";
}
+ $part_pkg->recur('');
$part_pkg->replace; #this should take care of plandata, right?
More information about the freeside-commits
mailing list