[freeside-commits] branch FREESIDE_3_BRANCH updated. 3bde0c43f02bf817cce2458a1a49312b1aef1de7
Ivan
ivan at 420.am
Thu Dec 22 16:09:22 PST 2016
The branch, FREESIDE_3_BRANCH has been updated
via 3bde0c43f02bf817cce2458a1a49312b1aef1de7 (commit)
from 0f64cd3a12a28ccf5786e696305e545dfc37e83d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3bde0c43f02bf817cce2458a1a49312b1aef1de7
Author: Ivan Kohler <ivan at freeside.biz>
Date: Thu Dec 22 16:09:21 2016 -0800
package search on null dates, RT#73715
diff --git a/httemplate/misc/process/bulk_change_pkg.cgi b/httemplate/misc/process/bulk_change_pkg.cgi
index 469ae7c..2432f3c 100755
--- a/httemplate/misc/process/bulk_change_pkg.cgi
+++ b/httemplate/misc/process/bulk_change_pkg.cgi
@@ -11,16 +11,43 @@ my %search_hash = ();
$search_hash{'query'} = $cgi->param('query');
-for my $param (qw(agentnum magic status classnum pkgpart)) {
- $search_hash{$param} = $cgi->param($param)
- if $cgi->param($param);
+#scalars
+for (qw( agentnum cust_status cust_main_salesnum salesnum custnum magic status
+ custom cust_fields pkgbatch zip
+ 477part 477rownum date
+ ))
+{
+ $search_hash{$_} = $cgi->param($_) if length($cgi->param($_));
+}
+
+#arrays
+for my $param (qw( pkgpart classnum refnum towernum )) {
+ $search_hash{$param} = [ $cgi->param($param) ]
+ if grep { $_ eq $param } $cgi->param;
+}
+
+#scalars that need to be passed if empty
+for my $param (qw( censustract censustract2 )) {
+ $search_hash{$param} = $cgi->param($param) || ''
+ if grep { $_ eq $param } $cgi->param;
+}
+
+#location flags (checkboxes)
+my @loc = grep /^\w+$/, $cgi->param('loc');
+$search_hash{"location_$_"} = 1 foreach @loc;
+
+my $report_option = $cgi->param('report_option');
+$search_hash{report_option} = $report_option if $report_option;
+
+for my $param (grep /^report_option_any/, $cgi->param) {
+ $search_hash{$param} = $cgi->param($param);
}
###
# parse dates
###
-#false laziness w/report_cust_pkg.html
+#false laziness w/report_cust_pkg.html and bulk_pkg_increment_bill.cgi
my %disable = (
'all' => {},
'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
@@ -32,6 +59,8 @@ my %disable = (
foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) {
+ $search_hash{$field.'_null'} = scalar( $cgi->param($field.'_null') );
+
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
next if $beginning == 0 && $ending == 4294967295
diff --git a/httemplate/misc/process/bulk_pkg_increment_bill.cgi b/httemplate/misc/process/bulk_pkg_increment_bill.cgi
index a5fd8a6..f298cf8 100755
--- a/httemplate/misc/process/bulk_pkg_increment_bill.cgi
+++ b/httemplate/misc/process/bulk_pkg_increment_bill.cgi
@@ -25,17 +25,43 @@ my %search_hash = ();
$search_hash{'query'} = $cgi->param('query');
-for my $param (qw(agentnum magic status classnum pkgpart)) {
- $search_hash{$param} = $cgi->param($param)
- if $cgi->param($param);
+#scalars
+for (qw( agentnum cust_status cust_main_salesnum salesnum custnum magic status
+ custom cust_fields pkgbatch zip
+ 477part 477rownum date
+ ))
+{
+ $search_hash{$_} = $cgi->param($_) if length($cgi->param($_));
+}
+
+#arrays
+for my $param (qw( pkgpart classnum refnum towernum )) {
+ $search_hash{$param} = [ $cgi->param($param) ]
+ if grep { $_ eq $param } $cgi->param;
+}
+
+#scalars that need to be passed if empty
+for my $param (qw( censustract censustract2 )) {
+ $search_hash{$param} = $cgi->param($param) || ''
+ if grep { $_ eq $param } $cgi->param;
+}
+
+#location flags (checkboxes)
+my @loc = grep /^\w+$/, $cgi->param('loc');
+$search_hash{"location_$_"} = 1 foreach @loc;
+
+my $report_option = $cgi->param('report_option');
+$search_hash{report_option} = $report_option if $report_option;
+
+for my $param (grep /^report_option_any/, $cgi->param) {
+ $search_hash{$param} = $cgi->param($param);
}
###
# parse dates
###
-#false laziness w/report_cust_pkg.html
-# and, now, w/bulk_change_pkg.cgi
+#false laziness w/report_cust_pkg.html and bulk_change_pkg.cgi
my %disable = (
'all' => {},
'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
@@ -47,6 +73,8 @@ my %disable = (
foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) {
+ $search_hash{$field.'_null'} = scalar( $cgi->param($field.'_null') );
+
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
next if $beginning == 0 && $ending == 4294967295
-----------------------------------------------------------------------
Summary of changes:
httemplate/misc/process/bulk_change_pkg.cgi | 37 ++++++++++++++++---
.../misc/process/bulk_pkg_increment_bill.cgi | 38 +++++++++++++++++---
2 files changed, 66 insertions(+), 9 deletions(-)
More information about the freeside-commits
mailing list