summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2002-02-18 08:39:21 +0000
committerivan <ivan>2002-02-18 08:39:21 +0000
commit32e8c2a2a58428acd539d880357c76720334c011 (patch)
tree37cdbbbc6ae6c2c83fc2364c32892f63dfc1fd39 /httemplate/edit
parent412e2892a324cdd838f4a790102359adcc9b7400 (diff)
safe web demo operation! closes: Bug#217
fix bug in edit/part_pkg: s/bkg/pkg/ edit/part_pkg.cgi - plan <SELECT> is now properly stick on errors, closes: Bug#323
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/part_pkg.cgi10
1 files changed, 6 insertions, 4 deletions
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index f4ebd6770..ae268811a 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -29,8 +29,10 @@ if ( $cgi->param('clone') ) {
} elsif ( $query && $query =~ /^(\d+)$/ ) {
$part_pkg ||= qsearchs('part_pkg',{'pkgpart'=>$1});
} else {
- $part_pkg ||= new FS::part_pkg {};
- $part_pkg->plan('flat');
+ unless ( $part_pkg ) {
+ $part_pkg = new FS::part_pkg {};
+ $part_pkg->plan('flat');
+ }
}
unless ( $part_pkg->plan ) { #backwards-compat
$part_pkg->plan('flat');
@@ -279,7 +281,7 @@ tie my %plans, 'Tie::IxHash',
},
'fieldorder' => [ 'setup_fee', 'recur_flat', 'recur_included_hours', 'recur_hourly_charge' ],
'setup' => 'what.setup_fee.value',
- 'recur' => '\'my $hours = $cust_pkg->seconds_since($cust_bkg->bill || 0) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; \' + what.recur_flat.value + \' + \' + what.recur_hourly_charge.value + \' * $hours;\'',
+ 'recur' => '\'my $hours = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; \' + what.recur_flat.value + \' + \' + what.recur_hourly_charge.value + \' * $hours;\'',
},
'sesmon_minute' => {
@@ -300,7 +302,7 @@ tie my %plans, 'Tie::IxHash',
},
'fieldorder' => [ 'setup_fee', 'recur_flat', 'recur_included_min', 'recur_minly_charge' ],
'setup' => 'what.setup_fee.value',
- 'recur' => '\'my $min = $cust_pkg->seconds_since($cust_bkg->bill || 0) / 60 - \' + what.recur_included_min.value + \'; $min = 0 if $min < 0; \' + what.recur_flat.value + \' + \' + what.recur_minly_charge.value + \' * $min;\'',
+ 'recur' => '\'my $min = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 60 - \' + what.recur_included_min.value + \'; $min = 0 if $min < 0; \' + what.recur_flat.value + \' + \' + what.recur_minly_charge.value + \' * $min;\'',
},