summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-01-05 14:49:44 -0800
committerIvan Kohler <ivan@freeside.biz>2013-01-05 14:49:44 -0800
commit7a618d4493ab7a87f6eabfd1ce3630a6b3436c2f (patch)
treeecb446f0297fe53227fc9d6b0be8ee1f4b3208d3 /httemplate/search
parent170085d3536733f303e242503f0e034c65016b73 (diff)
parent949114e0f65232b405e084bcfcff37b1fd9a2926 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/search')
-rwxr-xr-xhttemplate/search/cust_bill.html4
-rw-r--r--httemplate/search/cust_bill_pay.html7
-rw-r--r--httemplate/search/cust_bill_pkg.cgi9
-rw-r--r--httemplate/search/cust_bill_pkg_referral.html5
-rwxr-xr-xhttemplate/search/cust_credit.html6
-rw-r--r--httemplate/search/cust_credit_refund.html7
-rw-r--r--httemplate/search/customer_accounting_summary.html15
-rwxr-xr-xhttemplate/search/elements/cust_pay_or_refund.html16
-rw-r--r--httemplate/search/elements/report_cust_pay_or_refund.html43
-rw-r--r--httemplate/search/prepaid_income.html7
-rw-r--r--httemplate/search/report_cust_bill_pkg.html5
-rw-r--r--httemplate/search/report_cust_bill_pkg_referral.html5
-rwxr-xr-xhttemplate/search/report_customer_accounting_summary.html6
-rw-r--r--httemplate/search/report_prepaid_income.html2
-rw-r--r--httemplate/search/unearned_detail.html9
15 files changed, 131 insertions, 15 deletions
diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html
index 406486a85..3c0530e4f 100755
--- a/httemplate/search/cust_bill.html
+++ b/httemplate/search/cust_bill.html
@@ -97,6 +97,10 @@ if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) {
$search{'refnum'} = $1;
}
+ if ( $cgi->param('cust_classnum') ) {
+ $search{'cust_classnum'} = [ $cgi->param('cust_classnum') ];
+ }
+
if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
$search{'custnum'} = $1;
}
diff --git a/httemplate/search/cust_bill_pay.html b/httemplate/search/cust_bill_pay.html
index 22e9a6795..79de74985 100644
--- a/httemplate/search/cust_bill_pay.html
+++ b/httemplate/search/cust_bill_pay.html
@@ -99,6 +99,13 @@ if ( $cgi->param('refnum') && $cgi->param('refnum') =~ /^(\d+)$/ ) {
$title = $part_referral->referral. " $title";
}
+if ( $cgi->param('cust_classnum') ) {
+ my @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+ push @search, 'cust_main.classnum IN('.join(',',@classnums).')'
+ if @classnums;
+}
+
+
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
push @search, "cust_bill._date >= $beginning ",
"cust_bill._date <= $ending";
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi
index 817238da0..1e67e9320 100644
--- a/httemplate/search/cust_bill_pkg.cgi
+++ b/httemplate/search/cust_bill_pkg.cgi
@@ -120,6 +120,8 @@ Filtering parameters:
- refnum: Filter on customer reference source.
+- cust_classnum: Filter on customer class.
+
- classnum: Filter on package class.
- use_override: Apply "classnum" and "taxclass" filtering based on the
@@ -258,6 +260,13 @@ if ( $cgi->param('refnum') =~ /^(\d+)$/ ) {
push @where, "cust_main.refnum = $1";
}
+# cust_classnum
+if ( $cgi->param('cust_classnum') ) {
+ my @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+ push @where, 'cust_main.classnum IN('.join(',',@classnums).')'
+ if @classnums;
+}
+
# custnum
if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
push @where, "cust_main.custnum = $1";
diff --git a/httemplate/search/cust_bill_pkg_referral.html b/httemplate/search/cust_bill_pkg_referral.html
index 77b486021..1289ff7ee 100644
--- a/httemplate/search/cust_bill_pkg_referral.html
+++ b/httemplate/search/cust_bill_pkg_referral.html
@@ -156,6 +156,11 @@ if ( @refnum ) {
push @where, 'cust_main.refnum IN ('.join(',', @refnum).')';
}
+my @cust_classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+if ( @cust_classnums ) {
+ push @where, 'cust_main.classnum IN ('.join(',', @cust_classnums).')';
+}
+
if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
push @where, "cust_main.agentnum = $1";
}
diff --git a/httemplate/search/cust_credit.html b/httemplate/search/cust_credit.html
index 38f03491d..f5d8fa19f 100755
--- a/httemplate/search/cust_credit.html
+++ b/httemplate/search/cust_credit.html
@@ -103,6 +103,12 @@ if ( $cgi->param('refnum') && $cgi->param('refnum') =~ /^(\d+)$/ ) {
$title = $part_referral->referral. " $title";
}
+if ( $cgi->param('cust_classnum') ) {
+ my @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+ push @search, 'cust_main.classnum IN('.join(',',@classnums).')'
+ if @classnums;
+}
+
if ( $unapplied ) {
push @search, FS::cust_credit->unapplied_sql . ' > 0';
}
diff --git a/httemplate/search/cust_credit_refund.html b/httemplate/search/cust_credit_refund.html
index 361c8ad2f..75138e99d 100644
--- a/httemplate/search/cust_credit_refund.html
+++ b/httemplate/search/cust_credit_refund.html
@@ -85,6 +85,13 @@ if ( $cgi->param('refnum') && $cgi->param('refnum') =~ /^(\d+)$/ ) {
$title = $part_referral->referral. " $title";
}
+if ( $cgi->param('cust_classnum') ) {
+ my @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+ push @search, 'cust_main.classnum IN('.join(',',@classnums).')'
+ if @classnums;
+}
+
+
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
push @search, "cust_credit._date >= $beginning ",
"cust_credit._date <= $ending";
diff --git a/httemplate/search/customer_accounting_summary.html b/httemplate/search/customer_accounting_summary.html
index 0e9e24fa6..12c896276 100644
--- a/httemplate/search/customer_accounting_summary.html
+++ b/httemplate/search/customer_accounting_summary.html
@@ -142,8 +142,7 @@ $title .= $sel_part_referral->referral.' '
$title .= 'Customer Accounting Summary Report';
-my @custs = ();
-@custs = qsearch('cust_main', {} );
+my @cust_classnums = grep /^\d+$/, $cgi->param('cust_classnum');
my @items = ('netsales', 'cashflow');
my @params = ( [], [] );
@@ -167,6 +166,18 @@ my @custnames = ();
my $status = $cgi->param('status');
die "invalid status" unless $status =~ /^\w+|$/;
+my %search_hash;
+foreach (qw(agentnum refnum status)) {
+ if ( defined $cgi->param($_) ) {
+ $search_hash{$_} = $cgi->param($_);
+ }
+}
+$search_hash{'classnum'} = [ $cgi->param('cust_classnum') ]
+ if $cgi->param('cust_classnum');
+
+my $query = FS::cust_main::Search->search(\%search_hash);
+my @custs = qsearch($query);
+
foreach my $cust_main ( @custs ) {
# XXX should do this in the qsearch
next unless ($status eq '' || $status eq $cust_main->status);
diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html
index c60411107..eeef0c0e1 100755
--- a/httemplate/search/elements/cust_pay_or_refund.html
+++ b/httemplate/search/elements/cust_pay_or_refund.html
@@ -239,6 +239,12 @@ if ( $cgi->param('magic') ) {
$title = $part_referral->referral. " $title";
}
+ if ( $cgi->param('cust_classnum') ) {
+ my @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+ push @search, 'cust_main.classnum IN('.join(',',@classnums).')'
+ if @classnums;
+ }
+
if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
push @search, "custnum = $1";
}
@@ -324,6 +330,16 @@ if ( $cgi->param('magic') ) {
push @search, "$table.payinfo = '$1'";
}
+ if ( $cgi->param('ccpay') =~ /^([\w-:]+)$/ ) {
+ # I think that's all the characters we need to allow.
+ # To avoid confusion, this parameter searches both auth and order_number.
+ push @search, "($table.auth LIKE '$1%') OR ($table.order_number LIKE '$1%')";
+ push @fields, 'auth', 'order_number';
+ push @header, 'Auth #', 'Transaction #';
+ $align .= 'rr';
+
+ }
+
if ( $cgi->param('usernum') =~ /^(\d+)$/ ) {
push @search, "$table.usernum = $1";
}
diff --git a/httemplate/search/elements/report_cust_pay_or_refund.html b/httemplate/search/elements/report_cust_pay_or_refund.html
index a2b90b47d..0e04ab0dd 100644
--- a/httemplate/search/elements/report_cust_pay_or_refund.html
+++ b/httemplate/search/elements/report_cust_pay_or_refund.html
@@ -50,23 +50,48 @@ Examples:
<SCRIPT TYPE="text/javascript">
function payby_changed(what) {
- if ( what.options[what.selectedIndex].value == 'BILL' ) {
- document.getElementById('checkno_caption').style.color = '#000000';
- what.form.payinfo.disabled = false;
- what.form.payinfo.style.backgroundColor = '#ffffff';
+ if ( what.value == 'BILL' ) {
+ show('payinfo');
+ hide('ccpay');
+ } else if ( what.value.match(/^CARD|CHEK/) ) {
+ hide('payinfo');
+ show('ccpay');
} else {
- document.getElementById('checkno_caption').style.color = '#bbbbbb';
- what.form.payinfo.disabled = true;
- what.form.payinfo.style.backgroundColor = '#dddddd';
+ hide('payinfo');
+ hide('ccpay');
}
}
+ function show(what) {
+ document.getElementById(what+'_caption').style.color = '#000000';
+ document.getElementById(what).disabled = false;
+ document.getElementById(what).style.backgroundColor = '#ffffff';
+ }
+
+ function hide(what) {
+ document.getElementById(what+'_caption').style.color = '#bbbbbb';
+ document.getElementById(what).disabled = true;
+ document.getElementById(what).style.backgroundColor = '#dddddd';
+ }
+
+
+
</SCRIPT>
<TR>
- <TD ALIGN="right"><FONT ID="checkno_caption" COLOR="#bbbbbb"><% mt('Check #:') |h %> </FONT></TD>
+ <TD ALIGN="right"><FONT ID="payinfo_caption" COLOR="#bbbbbb"><% mt('Check #:') |h %> </FONT></TD>
+ <TD>
+ <INPUT TYPE="text" ID="payinfo" NAME="payinfo" DISABLED STYLE="background-color: #dddddd">
+ </TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">
+ <FONT ID="ccpay_caption" COLOR="#bbbbbb">
+ <% mt('Transaction #') |h %>
+ </FONT>
+ </TD>
<TD>
- <INPUT TYPE="text" NAME="payinfo" DISABLED STYLE="background-color: #dddddd">
+ <INPUT TYPE="text" ID="ccpay" NAME="ccpay" DISABLED STYLE="background-color: #dddddd">
</TD>
</TR>
diff --git a/httemplate/search/prepaid_income.html b/httemplate/search/prepaid_income.html
index ebac5a2a9..03d121d70 100644
--- a/httemplate/search/prepaid_income.html
+++ b/httemplate/search/prepaid_income.html
@@ -129,6 +129,13 @@ if ( $cgi->param('status') =~ /^([a-z]+)$/ ) {
push @where, FS::cust_main->cust_status_sql . " = '$status'";
}
+if ( $cgi->param('cust_classnum') ) {
+ my @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+ $link .= ";cust_classnum=$_" foreach @classnums;
+ push @where, 'cust_main.classnum IN('.join(',',@classnums).')'
+ if @classnums;
+}
+
my %total = ();
my %total_legacy = ();
foreach my $agentnum (@agentnums) {
diff --git a/httemplate/search/report_cust_bill_pkg.html b/httemplate/search/report_cust_bill_pkg.html
index 4f6ee78db..f121ef49f 100644
--- a/httemplate/search/report_cust_bill_pkg.html
+++ b/httemplate/search/report_cust_bill_pkg.html
@@ -15,14 +15,13 @@
label => emt('Customer status'),
&>
-<!-- customer
<& /elements/tr-select-cust_class.html,
- 'label' => emt('Class'),
+ 'label' => emt('Customer class'),
+ 'field' => 'cust_classnum',
'multiple' => 1,
'pre_options' => [ '' => emt('(none)') ],
'all_selected' => 1,
&>
--->
<& /elements/tr-input-beginning_ending.html &>
diff --git a/httemplate/search/report_cust_bill_pkg_referral.html b/httemplate/search/report_cust_bill_pkg_referral.html
index b4716d4fc..47478aa42 100644
--- a/httemplate/search/report_cust_bill_pkg_referral.html
+++ b/httemplate/search/report_cust_bill_pkg_referral.html
@@ -23,6 +23,11 @@
'disable_empty' => 1,
&>
+<& /elements/tr-select-cust_class.html,
+ 'field' => 'cust_classnum',
+ 'multiple' => 1,
+&>
+
<& /elements/tr-select-pkg_class.html,
'pre_options' => [ '' => 'all', '0' => '(empty class)' ],
'disable_empty' => 1,
diff --git a/httemplate/search/report_customer_accounting_summary.html b/httemplate/search/report_customer_accounting_summary.html
index 537abffeb..8206f34ca 100755
--- a/httemplate/search/report_customer_accounting_summary.html
+++ b/httemplate/search/report_customer_accounting_summary.html
@@ -25,6 +25,12 @@
'label' => 'Customer Status'
) %>
+ <& /elements/tr-select-cust_class.html,
+ 'label' => 'Customer Class',
+ 'field' => 'cust_classnum',
+ 'multiple' => 1,
+ &>
+
<& /elements/tr-checkbox.html,
'label' => 'Separate setup fees',
'field' => 'setuprecur',
diff --git a/httemplate/search/report_prepaid_income.html b/httemplate/search/report_prepaid_income.html
index 4743e2d21..dfb2ea249 100644
--- a/httemplate/search/report_prepaid_income.html
+++ b/httemplate/search/report_prepaid_income.html
@@ -33,6 +33,8 @@
<& /elements/tr-select-cust_main-status.html,
label => mt('Customer Status') &>
+ <& /elements/tr-select-cust_class.html,
+ label => mt('Customer Class'), field => 'cust_classnum', multiple => 1 &>
<& /elements/tr-select.html,
label => 'Invoice Status',
field => 'mode',
diff --git a/httemplate/search/unearned_detail.html b/httemplate/search/unearned_detail.html
index 02d514cbe..f61de052e 100644
--- a/httemplate/search/unearned_detail.html
+++ b/httemplate/search/unearned_detail.html
@@ -118,6 +118,12 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
push @where, "cust_main.agentnum = $1";
}
+if ( $cgi->param('cust_classnum') ) {
+ my @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+ push @where, 'cust_main.classnum IN('.join(',',@classnums).')'
+ if @classnums;
+}
+
# no pkgclass, no taxclass, no tax location...
# unearned revenue mode
@@ -235,7 +241,8 @@ my $query = {
my $ilink = [ "${p}view/cust_bill.cgi?", 'invnum' ];
my $clink = [ "${p}view/cust_main.cgi?", 'custnum' ];
-my $money_char;
+my $conf = new FS::Conf;
+my $money_char = $conf->config('money_char') || '$';
sub money_sub {
$conf ||= new FS::Conf;