summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/rate_region.cgi
diff options
context:
space:
mode:
authormark <mark>2010-07-22 00:11:56 +0000
committermark <mark>2010-07-22 00:11:56 +0000
commit342e2bfbe6aad470ab9dee40640f8ac7d9653003 (patch)
treebf350b2d3876651ee0c4487b0e321ec21f839f0c /httemplate/edit/process/rate_region.cgi
parentc26fea8a168f255412a8065c0a04758c9b0d340d (diff)
cdr rating by day and time, part 2, RT#4763
Diffstat (limited to 'httemplate/edit/process/rate_region.cgi')
-rwxr-xr-xhttemplate/edit/process/rate_region.cgi21
1 files changed, 6 insertions, 15 deletions
diff --git a/httemplate/edit/process/rate_region.cgi b/httemplate/edit/process/rate_region.cgi
index 8036f7388..d342e605a 100755
--- a/httemplate/edit/process/rate_region.cgi
+++ b/httemplate/edit/process/rate_region.cgi
@@ -1,6 +1,8 @@
%if ( $error ) {
% $cgi->param('error', $error);
<% $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string ) %>
+%} elsif ( $action eq 'Add' ) {
+<% $cgi->redirect(popurl(2). "rate_region.cgi?$regionnum") %>
%} else {
<% $cgi->redirect(popurl(3). "browse/rate_region.html") %>
%}
@@ -11,6 +13,7 @@ die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $regionnum = $cgi->param('regionnum');
+my $action = $regionnum ? 'Edit' : 'Add';
my $old = qsearchs('rate_region', { 'regionnum' => $regionnum } ) if $regionnum;
@@ -33,24 +36,12 @@ my @rate_prefix = map {
'npa' => $_,
}
} @npa;
-
-my @dest_detail = map {
- my $ratenum = $_->ratenum;
- new FS::rate_detail {
- 'ratenum' => $ratenum,
- map { $_ => $cgi->param("$_$ratenum") }
- qw( min_included conn_charge conn_sec min_charge sec_granularity classnum )
- };
-} qsearch('rate', {} );
-
-
+# we no longer process dest_detail records here
my $error;
if ( $regionnum ) {
- $error = $new->replace($old, 'rate_prefix' => \@rate_prefix,
- 'dest_detail' => \@dest_detail, );
+ $error = $new->replace($old, 'rate_prefix' => \@rate_prefix );
} else {
- $error = $new->insert( 'rate_prefix' => \@rate_prefix,
- 'dest_detail' => \@dest_detail, );
+ $error = $new->insert( 'rate_prefix' => \@rate_prefix );
$regionnum = $new->getfield('regionnum');
}