From 80b548ef7cad9b01584f8ab2018e186a03148210 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Wed, 27 Jul 2016 14:01:44 -0500 Subject: RT#71009: (v4+) OFM - Separate permissions for edit dates and contract dates [renamed start date files for generic use, original commit RT#38883] --- httemplate/misc/change_pkg_date.html | 99 +++++++++++++++++++++++++++ httemplate/misc/change_pkg_start.html | 99 --------------------------- httemplate/misc/process/change_pkg_date.html | 53 ++++++++++++++ httemplate/misc/process/change_pkg_start.html | 53 -------------- 4 files changed, 152 insertions(+), 152 deletions(-) create mode 100755 httemplate/misc/change_pkg_date.html delete mode 100755 httemplate/misc/change_pkg_start.html create mode 100755 httemplate/misc/process/change_pkg_date.html delete mode 100755 httemplate/misc/process/change_pkg_start.html (limited to 'httemplate/misc') diff --git a/httemplate/misc/change_pkg_date.html b/httemplate/misc/change_pkg_date.html new file mode 100755 index 000000000..5a890c86e --- /dev/null +++ b/httemplate/misc/change_pkg_date.html @@ -0,0 +1,99 @@ +<& /elements/header-popup.html, mt($title) &> + +<& /elements/error.html &> + +% # only slightly different from unhold_pkg. +
+ + +
+<% emt('Start billing [_1]', $part_pkg->pkg_comment(cust_pkg => $cust_pkg)) %> + + + +
+ + + +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied" + unless $curuser->access_right('Change package start date'); + +my $pkgnum; +if ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) { + $pkgnum = $1; +} else { + die "illegal query ". $cgi->keywords; +} + +my $conf = new FS::Conf; +my $date_format = $conf->config('date_format') || '%m/%d/%Y'; + +my $title = 'Start billing package'; + +my $cust_pkg = qsearchs({ + table => 'cust_pkg', + addl_from => ' JOIN cust_main USING (custnum) ', + hashref => { 'pkgnum' => $pkgnum }, + extra_sql => ' AND '. $curuser->agentnums_sql, +}) or die "Unknown pkgnum: $pkgnum"; + +my $next_bill_date = $cust_pkg->cust_main->next_bill_date; + +my $part_pkg = $cust_pkg->part_pkg; + +# defaults: +# sticky on error, then the existing start date if any, then the customer's +# next bill date, and if none of those, default to now +my $when = $cgi->param('when'); + +if (!$when) { + if ($cust_pkg->start_date) { + $when = 'date'; + } elsif ($next_bill_date) { + $when = 'next_bill_date'; + } else { + $when = 'now'; + } +} + diff --git a/httemplate/misc/change_pkg_start.html b/httemplate/misc/change_pkg_start.html deleted file mode 100755 index 5a890c86e..000000000 --- a/httemplate/misc/change_pkg_start.html +++ /dev/null @@ -1,99 +0,0 @@ -<& /elements/header-popup.html, mt($title) &> - -<& /elements/error.html &> - -% # only slightly different from unhold_pkg. -
- - -
-<% emt('Start billing [_1]', $part_pkg->pkg_comment(cust_pkg => $cust_pkg)) %> - - - -
- - - -<%init> - -my $curuser = $FS::CurrentUser::CurrentUser; -die "access denied" - unless $curuser->access_right('Change package start date'); - -my $pkgnum; -if ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) { - $pkgnum = $1; -} else { - die "illegal query ". $cgi->keywords; -} - -my $conf = new FS::Conf; -my $date_format = $conf->config('date_format') || '%m/%d/%Y'; - -my $title = 'Start billing package'; - -my $cust_pkg = qsearchs({ - table => 'cust_pkg', - addl_from => ' JOIN cust_main USING (custnum) ', - hashref => { 'pkgnum' => $pkgnum }, - extra_sql => ' AND '. $curuser->agentnums_sql, -}) or die "Unknown pkgnum: $pkgnum"; - -my $next_bill_date = $cust_pkg->cust_main->next_bill_date; - -my $part_pkg = $cust_pkg->part_pkg; - -# defaults: -# sticky on error, then the existing start date if any, then the customer's -# next bill date, and if none of those, default to now -my $when = $cgi->param('when'); - -if (!$when) { - if ($cust_pkg->start_date) { - $when = 'date'; - } elsif ($next_bill_date) { - $when = 'next_bill_date'; - } else { - $when = 'now'; - } -} - diff --git a/httemplate/misc/process/change_pkg_date.html b/httemplate/misc/process/change_pkg_date.html new file mode 100755 index 000000000..17a8518f9 --- /dev/null +++ b/httemplate/misc/process/change_pkg_date.html @@ -0,0 +1,53 @@ +<& /elements/header-popup.html &> + + + +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied" + unless $curuser->access_right('Change package start date'); + +$cgi->param('pkgnum') =~ /^(\d+)$/ + or die "illegal pkgnum"; +my $pkgnum = $1; + +my $cust_pkg = qsearchs({ + table => 'cust_pkg', + addl_from => ' JOIN cust_main USING (custnum) ', + hashref => { 'pkgnum' => $pkgnum }, + extra_sql => ' AND '. $curuser->agentnums_sql, +}) or die "Unknown pkgnum: $pkgnum"; + +my $cust_main = $cust_pkg->cust_main; + +my $error; +my $start_date; +if ( $cgi->param('when') eq 'now' ) { + # start it the next time billing runs + $start_date = ''; +} elsif ( $cgi->param('when') eq 'next_bill_date' ) { + $start_date = $cust_main->next_bill_date; +} elsif ( $cgi->param('when') eq 'date' ) { + $start_date = parse_datetime($cgi->param('start_date')); +} + +if ( $cust_pkg->setup ) { + # shouldn't happen + $error = 'This package has already started billing.'; +} else { + local $FS::UID::AutoCommit = 0; + foreach my $pkg ($cust_pkg, $cust_pkg->supplemental_pkgs) { + $pkg->set('start_date', $start_date); + $error ||= $pkg->replace; + } + $error ? dbh->rollback : dbh->commit; +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect($fsurl.'misc/change_pkg_start.html?', $cgi->query_string); +} + diff --git a/httemplate/misc/process/change_pkg_start.html b/httemplate/misc/process/change_pkg_start.html deleted file mode 100755 index 17a8518f9..000000000 --- a/httemplate/misc/process/change_pkg_start.html +++ /dev/null @@ -1,53 +0,0 @@ -<& /elements/header-popup.html &> - - - -<%init> - -my $curuser = $FS::CurrentUser::CurrentUser; -die "access denied" - unless $curuser->access_right('Change package start date'); - -$cgi->param('pkgnum') =~ /^(\d+)$/ - or die "illegal pkgnum"; -my $pkgnum = $1; - -my $cust_pkg = qsearchs({ - table => 'cust_pkg', - addl_from => ' JOIN cust_main USING (custnum) ', - hashref => { 'pkgnum' => $pkgnum }, - extra_sql => ' AND '. $curuser->agentnums_sql, -}) or die "Unknown pkgnum: $pkgnum"; - -my $cust_main = $cust_pkg->cust_main; - -my $error; -my $start_date; -if ( $cgi->param('when') eq 'now' ) { - # start it the next time billing runs - $start_date = ''; -} elsif ( $cgi->param('when') eq 'next_bill_date' ) { - $start_date = $cust_main->next_bill_date; -} elsif ( $cgi->param('when') eq 'date' ) { - $start_date = parse_datetime($cgi->param('start_date')); -} - -if ( $cust_pkg->setup ) { - # shouldn't happen - $error = 'This package has already started billing.'; -} else { - local $FS::UID::AutoCommit = 0; - foreach my $pkg ($cust_pkg, $cust_pkg->supplemental_pkgs) { - $pkg->set('start_date', $start_date); - $error ||= $pkg->replace; - } - $error ? dbh->rollback : dbh->commit; -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect($fsurl.'misc/change_pkg_start.html?', $cgi->query_string); -} - -- cgit v1.2.1 From 990d718978480aa02b0031a2ec6753e64975fd34 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Wed, 27 Jul 2016 17:23:14 -0500 Subject: RT#71009: (v4+) OFM - Separate permissions for edit dates and contract dates --- httemplate/misc/change_pkg_date.html | 33 +++++++++++++++++++--------- httemplate/misc/process/change_pkg_date.html | 31 ++++++++++++++++++-------- 2 files changed, 45 insertions(+), 19 deletions(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/change_pkg_date.html b/httemplate/misc/change_pkg_date.html index 5a890c86e..0a23805f4 100755 --- a/httemplate/misc/change_pkg_date.html +++ b/httemplate/misc/change_pkg_date.html @@ -3,11 +3,12 @@ <& /elements/error.html &> % # only slightly different from unhold_pkg. -
+ +
-<% emt('Start billing [_1]', $part_pkg->pkg_comment(cust_pkg => $cust_pkg)) %> +<% emt(($isstart ? 'Start billing' : 'Set contract end for').' [_1]', $part_pkg->pkg_comment(cust_pkg => $cust_pkg)) %>
  • <& /elements/radio.html, @@ -16,7 +17,7 @@ value => 'now', curr_value => $when, &> - +
  • % if ( $next_bill_date ) {
  • @@ -41,13 +42,13 @@ &> <& /elements/input-date-field.html, - { name => 'start_date', - value => $cgi->param('start_date') || $cust_pkg->start_date, + { name => 'date_value', + value => $cgi->param('date_value') || $cust_pkg->get($field), } &>
- +
@@ -55,9 +56,21 @@ <%init> +my $field = $cgi->param('field'); + +my ($acl, $isstart); +if ($field eq 'start_date') { + $acl = 'Change package start date'; + $isstart = 1; +} elsif ($field eq 'contract_end') { + $acl = 'Change package contract end date'; +} else { + die "Unknown date field"; +} + my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" - unless $curuser->access_right('Change package start date'); + unless $curuser->access_right($acl); my $pkgnum; if ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) { @@ -69,7 +82,7 @@ if ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) { my $conf = new FS::Conf; my $date_format = $conf->config('date_format') || '%m/%d/%Y'; -my $title = 'Start billing package'; +my $title = $isstart ? 'Start billing package' : 'Change contract end'; my $cust_pkg = qsearchs({ table => 'cust_pkg', @@ -83,12 +96,12 @@ my $next_bill_date = $cust_pkg->cust_main->next_bill_date; my $part_pkg = $cust_pkg->part_pkg; # defaults: -# sticky on error, then the existing start date if any, then the customer's +# sticky on error, then the existing date if any, then the customer's # next bill date, and if none of those, default to now my $when = $cgi->param('when'); if (!$when) { - if ($cust_pkg->start_date) { + if ($cust_pkg->get($field)) { $when = 'date'; } elsif ($next_bill_date) { $when = 'next_bill_date'; diff --git a/httemplate/misc/process/change_pkg_date.html b/httemplate/misc/process/change_pkg_date.html index 17a8518f9..5b1eedfad 100755 --- a/httemplate/misc/process/change_pkg_date.html +++ b/httemplate/misc/process/change_pkg_date.html @@ -6,9 +6,21 @@ <%init> +my $field = $cgi->param('field'); + +my ($acl, $isstart); +if ($field eq 'start_date') { + $acl = 'Change package start date'; + $isstart = 1; +} elsif ($field eq 'contract_end') { + $acl = 'Change package contract end date'; +} else { + die "Unknown date field"; +} + my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" - unless $curuser->access_right('Change package start date'); + unless $curuser->access_right($acl); $cgi->param('pkgnum') =~ /^(\d+)$/ or die "illegal pkgnum"; @@ -24,23 +36,24 @@ my $cust_pkg = qsearchs({ my $cust_main = $cust_pkg->cust_main; my $error; -my $start_date; +my $date_value; if ( $cgi->param('when') eq 'now' ) { - # start it the next time billing runs - $start_date = ''; + # blank start means start it the next time billing runs + $date_value = $isstart ? '' : time; } elsif ( $cgi->param('when') eq 'next_bill_date' ) { - $start_date = $cust_main->next_bill_date; + $date_value = $cust_main->next_bill_date; } elsif ( $cgi->param('when') eq 'date' ) { - $start_date = parse_datetime($cgi->param('start_date')); + $date_value = parse_datetime($cgi->param('date_value')); } -if ( $cust_pkg->setup ) { +if ( $isstart && $cust_pkg->setup ) { # shouldn't happen $error = 'This package has already started billing.'; } else { local $FS::UID::AutoCommit = 0; foreach my $pkg ($cust_pkg, $cust_pkg->supplemental_pkgs) { - $pkg->set('start_date', $start_date); + last if $error; + $pkg->set($field, $date_value); $error ||= $pkg->replace; } $error ? dbh->rollback : dbh->commit; @@ -48,6 +61,6 @@ if ( $cust_pkg->setup ) { if ( $error ) { $cgi->param('error', $error); - print $cgi->redirect($fsurl.'misc/change_pkg_start.html?', $cgi->query_string); + print $cgi->redirect($fsurl.'misc/change_pkg_date.html?', $cgi->query_string); } -- cgit v1.2.1 From 76b22e66bf8e615def0a24cd8cda23c3949eae70 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 26 Jul 2016 15:06:36 -0700 Subject: prevent reload loops on process pages, #71249 --- httemplate/misc/cust_main-cancel.cgi | 2 +- httemplate/misc/cust_main-suspend.cgi | 2 +- httemplate/misc/cust_main-unsuspend.cgi | 2 +- httemplate/misc/delete-addr_range.html | 2 +- httemplate/misc/delete-rate_detail.html | 2 +- httemplate/misc/did_order_confirmed.html | 2 +- httemplate/misc/disable-cust_location.cgi | 2 +- httemplate/misc/disable-msg_template.cgi | 2 +- httemplate/misc/process/bulk_pkg_increment_bill.cgi | 2 +- httemplate/misc/process/cancel_pkg.html | 2 +- httemplate/misc/process/change_pkg_contact.html | 2 +- httemplate/misc/process/cust_bill-promised_date.html | 2 +- httemplate/misc/process/delay_susp_pkg.html | 2 +- httemplate/misc/process/enable_or_disable_tax.html | 2 +- httemplate/misc/process/nms-add_iface.html | 2 +- httemplate/misc/process/nms-add_router.html | 2 +- httemplate/misc/process/recharge_svc.html | 2 +- httemplate/misc/process/unhold_pkg.html | 2 +- httemplate/misc/process/void-cust_bill.html | 2 +- httemplate/misc/reason-merge.html | 2 +- httemplate/misc/void-cust_credit.html | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi index f6fd1e915..73c4deb7a 100755 --- a/httemplate/misc/cust_main-cancel.cgi +++ b/httemplate/misc/cust_main-cancel.cgi @@ -1,6 +1,6 @@ <& /elements/header-popup.html, mt("Customer cancelled") &> diff --git a/httemplate/misc/cust_main-suspend.cgi b/httemplate/misc/cust_main-suspend.cgi index 7a501d61a..e81e2b490 100755 --- a/httemplate/misc/cust_main-suspend.cgi +++ b/httemplate/misc/cust_main-suspend.cgi @@ -1,6 +1,6 @@ <& /elements/header-popup.html, mt("Customer suspended") &> diff --git a/httemplate/misc/cust_main-unsuspend.cgi b/httemplate/misc/cust_main-unsuspend.cgi index e8ac8d31e..99ec70a23 100755 --- a/httemplate/misc/cust_main-unsuspend.cgi +++ b/httemplate/misc/cust_main-unsuspend.cgi @@ -1,6 +1,6 @@ <& /elements/header-popup.html, mt("Customer unsuspended") &> diff --git a/httemplate/misc/delete-addr_range.html b/httemplate/misc/delete-addr_range.html index c6310e9b1..239332d23 100644 --- a/httemplate/misc/delete-addr_range.html +++ b/httemplate/misc/delete-addr_range.html @@ -3,7 +3,7 @@ % } else { <& /elements/header-popup.html, "Address range deleted" &> diff --git a/httemplate/misc/delete-rate_detail.html b/httemplate/misc/delete-rate_detail.html index 30856a73a..b4d31b379 100755 --- a/httemplate/misc/delete-rate_detail.html +++ b/httemplate/misc/delete-rate_detail.html @@ -3,7 +3,7 @@ % } else { <% header('Rate deleted') %> % } diff --git a/httemplate/misc/did_order_confirmed.html b/httemplate/misc/did_order_confirmed.html index 53dbb2f3a..3cc121c6f 100644 --- a/httemplate/misc/did_order_confirmed.html +++ b/httemplate/misc/did_order_confirmed.html @@ -14,7 +14,7 @@ die "access denied" my $action = $1; my $header = ''; my $popup = ''; -my $js = 'window.top.location.reload();'; +my $js = 'topreload();'; $cgi->param('ordernum') =~ /^(\d+)$/ or die 'illegal ordernum'; my $ordernum = $1; diff --git a/httemplate/misc/disable-cust_location.cgi b/httemplate/misc/disable-cust_location.cgi index ee7ba1dbc..677f0b891 100755 --- a/httemplate/misc/disable-cust_location.cgi +++ b/httemplate/misc/disable-cust_location.cgi @@ -1,6 +1,6 @@ <% header("Location disabled") %> diff --git a/httemplate/misc/disable-msg_template.cgi b/httemplate/misc/disable-msg_template.cgi index 1eb4d25e5..565eb2cee 100644 --- a/httemplate/misc/disable-msg_template.cgi +++ b/httemplate/misc/disable-msg_template.cgi @@ -3,7 +3,7 @@ % } else { <& /elements/header-popup.html, "Template ${actioned}" &> diff --git a/httemplate/misc/process/bulk_pkg_increment_bill.cgi b/httemplate/misc/process/bulk_pkg_increment_bill.cgi index 0d8417b26..8da849508 100755 --- a/httemplate/misc/process/bulk_pkg_increment_bill.cgi +++ b/httemplate/misc/process/bulk_pkg_increment_bill.cgi @@ -4,7 +4,7 @@ %} else { <% header('Packages Adjusted') %> % } diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html index eb3b2efe6..46ba06a6d 100755 --- a/httemplate/misc/process/cancel_pkg.html +++ b/httemplate/misc/process/cancel_pkg.html @@ -1,6 +1,6 @@ <% header(emt("Package $past_method")) %> diff --git a/httemplate/misc/process/change_pkg_contact.html b/httemplate/misc/process/change_pkg_contact.html index 2795c1197..5bf896200 100644 --- a/httemplate/misc/process/change_pkg_contact.html +++ b/httemplate/misc/process/change_pkg_contact.html @@ -1,6 +1,6 @@ <% header(emt("Package contact $past_method")) %> diff --git a/httemplate/misc/process/cust_bill-promised_date.html b/httemplate/misc/process/cust_bill-promised_date.html index 721a763eb..f390609c7 100644 --- a/httemplate/misc/process/cust_bill-promised_date.html +++ b/httemplate/misc/process/cust_bill-promised_date.html @@ -1,4 +1,4 @@ - + <%init> # XXX ACL? die "access denied" diff --git a/httemplate/misc/process/delay_susp_pkg.html b/httemplate/misc/process/delay_susp_pkg.html index 675da0496..15a3c963c 100755 --- a/httemplate/misc/process/delay_susp_pkg.html +++ b/httemplate/misc/process/delay_susp_pkg.html @@ -1,6 +1,6 @@ <% header($msg) %> diff --git a/httemplate/misc/process/enable_or_disable_tax.html b/httemplate/misc/process/enable_or_disable_tax.html index 9b7324b0d..8a7a559a0 100755 --- a/httemplate/misc/process/enable_or_disable_tax.html +++ b/httemplate/misc/process/enable_or_disable_tax.html @@ -4,7 +4,7 @@ <% include('/elements/header-popup.html', $title) %> diff --git a/httemplate/misc/process/nms-add_iface.html b/httemplate/misc/process/nms-add_iface.html index 79e685686..cbd0fc048 100644 --- a/httemplate/misc/process/nms-add_iface.html +++ b/httemplate/misc/process/nms-add_iface.html @@ -1,6 +1,6 @@ <& /elements/header-popup.html, 'Interface added' &> <%init> diff --git a/httemplate/misc/process/nms-add_router.html b/httemplate/misc/process/nms-add_router.html index c3b42a8d3..a4c3423da 100644 --- a/httemplate/misc/process/nms-add_router.html +++ b/httemplate/misc/process/nms-add_router.html @@ -1,6 +1,6 @@ <& /elements/header-popup.html, 'Router added' &> <%init> diff --git a/httemplate/misc/process/recharge_svc.html b/httemplate/misc/process/recharge_svc.html index 2d49f6b06..88a1f7f36 100755 --- a/httemplate/misc/process/recharge_svc.html +++ b/httemplate/misc/process/recharge_svc.html @@ -4,7 +4,7 @@ %} else { <% header("Package recharged") %> %} diff --git a/httemplate/misc/process/unhold_pkg.html b/httemplate/misc/process/unhold_pkg.html index 694048023..7e54262c6 100755 --- a/httemplate/misc/process/unhold_pkg.html +++ b/httemplate/misc/process/unhold_pkg.html @@ -1,6 +1,6 @@ <& /elements/header-popup.html &> diff --git a/httemplate/misc/process/void-cust_bill.html b/httemplate/misc/process/void-cust_bill.html index 7773b0ba9..32a2fc591 100755 --- a/httemplate/misc/process/void-cust_bill.html +++ b/httemplate/misc/process/void-cust_bill.html @@ -4,7 +4,7 @@ %} else { <& /elements/header-popup.html, 'Invoice voided' &> %} diff --git a/httemplate/misc/reason-merge.html b/httemplate/misc/reason-merge.html index 14f5ebb84..b7e4df454 100644 --- a/httemplate/misc/reason-merge.html +++ b/httemplate/misc/reason-merge.html @@ -1,7 +1,7 @@ % if ($success) { <% include('/elements/header-popup.html', 'Reason Merge Success') %> % } else { <% include('/elements/header-popup.html', 'Merge Reasons') %> diff --git a/httemplate/misc/void-cust_credit.html b/httemplate/misc/void-cust_credit.html index 1e71f0030..81ba31d54 100755 --- a/httemplate/misc/void-cust_credit.html +++ b/httemplate/misc/void-cust_credit.html @@ -1,7 +1,7 @@ %if ( $success ) { <& /elements/header-popup.html, mt("Credit voided") &> -- cgit v1.2.1 From 3e5bee7db5e58a9938edc3926d55d7e71688ddb2 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Fri, 29 Jul 2016 18:57:14 -0500 Subject: RT#71009: (v4+) OFM - Separate permissions for edit dates and contract dates [tweaked now handling] --- httemplate/misc/change_pkg_date.html | 2 +- httemplate/misc/process/change_pkg_date.html | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/change_pkg_date.html b/httemplate/misc/change_pkg_date.html index 0a23805f4..642a5b89e 100755 --- a/httemplate/misc/change_pkg_date.html +++ b/httemplate/misc/change_pkg_date.html @@ -17,7 +17,7 @@ value => 'now', curr_value => $when, &> - + % if ( $next_bill_date ) {
  • diff --git a/httemplate/misc/process/change_pkg_date.html b/httemplate/misc/process/change_pkg_date.html index 5b1eedfad..3084ec538 100755 --- a/httemplate/misc/process/change_pkg_date.html +++ b/httemplate/misc/process/change_pkg_date.html @@ -38,8 +38,9 @@ my $cust_main = $cust_pkg->cust_main; my $error; my $date_value; if ( $cgi->param('when') eq 'now' ) { - # blank start means start it the next time billing runs - $date_value = $isstart ? '' : time; + # blank start means start it the next time billing runs ("Now") + # blank contract end means it never ends ("Never") + $date_value = ''; } elsif ( $cgi->param('when') eq 'next_bill_date' ) { $date_value = $cust_main->next_bill_date; } elsif ( $cgi->param('when') eq 'date' ) { -- cgit v1.2.1