From a73084513b067a4d85d272970c43fba5d485b920 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 6 Jul 2003 18:58:57 +0000 Subject: don't bother displaying comments that are only whitespace/newlines --- httemplate/view/cust_main.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 4fe60fe79..c36c9e265 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -290,7 +290,7 @@ if ( $conf->config('payby-default') ne 'HIDE' ) { print ''; if ( defined $cust_main->dbdef_table->column('comments') - && $cust_main->comments ) + && $cust_main->comments =~ /[^\s\n\r]/ ) { print "
Comments". &ntable("#cccccc"). "". &ntable("#cccccc",2). -- cgit v1.2.1 From a1f82a6afd45e0fd208b1e69c6647195eab48bb6 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 9 Jul 2003 14:39:36 +0000 Subject: increase max domain length to 63 --- httemplate/edit/svc_domain.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate') diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi index d20e1f336..ca0e3398f 100755 --- a/httemplate/edit/svc_domain.cgi +++ b/httemplate/edit/svc_domain.cgi @@ -87,7 +87,7 @@ print ' CHECKED' if $kludge_action eq 'M'; print qq!>Transfer!; print <Domain +

Domain
Purpose/Description:

-- cgit v1.2.1 From 3d7644882ebf59fcac7230a408d06e7c4e1bb34b Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 11 Jul 2003 15:23:33 +0000 Subject: payments report for inventivemedia / hpnx --- httemplate/index.html | 6 ++- httemplate/search/cust_pay.cgi | 71 ++++++++++++++++++++++++++++------ httemplate/search/cust_pkg.cgi | 2 + httemplate/search/report_cust_pay.html | 24 ++++++++++++ 4 files changed, 89 insertions(+), 14 deletions(-) create mode 100644 httemplate/search/report_cust_pay.html (limited to 'httemplate') diff --git a/httemplate/index.html b/httemplate/index.html index e5bd11806..7354b1c00 100644 --- a/httemplate/index.html +++ b/httemplate/index.html @@ -67,7 +67,8 @@

  • 120 day open invoices (by invoice number) (by date) (by customer number)
  • all invoices (by invoice number) (by date) (by customer number) - Financial reports + Payments +

    Financial reports - Financial reports + Payments +

    Financial reports
    • current receivables
    • tax reports diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi index b5bdf8296..d601617f9 100755 --- a/httemplate/search/cust_pay.cgi +++ b/httemplate/search/cust_pay.cgi @@ -1,12 +1,46 @@ <% -$cgi->param('payinfo') =~ /^\s*(\d+)\s*$/ or die "illegal payinfo"; -my $payinfo = $1; -$cgi->param('payby') =~ /^(\w+)$/ or die "illegal payby"; -my $payby = $1; -my @cust_pay = qsearch('cust_pay', { 'payinfo' => $payinfo, +my $sortby; +my @cust_pay; +if ( $cgi->param('magic') && $cgi->param('magic') eq '_date' ) { + + my %search; + if ( $cgi->param('payby') ) { + $cgi->param('payby') =~ /^(CARD|CHEK|BILL)$/ + or die "illegal payby ". $cgi->param('payby'); + $search{'payby'} = $1; + } + + #false laziness with cust_pkg.cgi + my $range = ''; + if ( $cgi->param('beginning') + && $cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/ ) { + my $beginning = str2time($1); + $range = " WHERE _date >= $beginning "; + } + if ( $cgi->param('ending') + && $cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/ ) { + my $ending = str2time($1) + 86400; + $range .= ( $range ? ' AND ' : ' WHERE ' ). " _date <= $ending "; + } + + @cust_pay = qsearch('cust_pay', \%search, '', " $range" ); + + $sortby = \*date_sort; + +} else { + + $cgi->param('payinfo') =~ /^\s*(\d+)\s*$/ or die "illegal payinfo"; + my $payinfo = $1; + + $cgi->param('payby') =~ /^(\w+)$/ or die "illegal payby"; + my $payby = $1; + + @cust_pay = qsearch('cust_pay', { 'payinfo' => $payinfo, 'payby' => $payby } ); -my $sortby = \*date_sort; + $sortby = \*date_sort; + +} if (0) { #if ( scalar(@cust_pay) == 1 ) { @@ -16,7 +50,7 @@ if (0) { %> <% - idiot("Check # not found."); + idiot("Payment not found."); #exit; } else { my $total = scalar(@cust_pay); @@ -24,9 +58,9 @@ if (0) { %> <% - print header("Check # Search Results", menubar( + print header("Payment Search Results", menubar( 'Main Menu', popurl(2) - )), "$total matching check$s found
      ", &table(), <", &table(), < Amount @@ -40,23 +74,36 @@ END foreach my $cust_pay ( sort $sortby grep(!$saw{$_->paynum}++, @cust_pay) ) { - my($paynum, $custnum, $payinfo, $amount, $date ) = ( + my($paynum, $custnum, $payby, $payinfo, $amount, $date ) = ( $cust_pay->paynum, $cust_pay->custnum, + $cust_pay->payby, $cust_pay->payinfo, sprintf("%.2f", $cust_pay->paid), $cust_pay->_date, ); - my $pdate = time2str("%b %d %Y", $date); + my $pdate = time2str("%b %d %Y", $date); my $rowspan = 1; my $view = popurl(2). "view/cust_main.cgi?". $custnum. "#". $payby. $payinfo; + my $payment_info; + if ( $payby eq 'CARD' ) { + $payment_info = 'Card #'. 'x'x(length($payinfo)-4). + substr($payinfo,(length($payinfo)-4)); + } elsif ( $payby eq 'CHEK' ) { + $payment_info = "E-check acct#$payinfo"; + } elsif ( $payby eq 'BILL' ) { + $payment_info = "Check #$payinfo"; + } else { + $payment_info = "$payby $payinfo"; + } + print < - $payinfo + $payment_info \$$amount $pdate END diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index 12179eaca..603b5654c 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -19,6 +19,8 @@ my @cust_pkg; if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) { $sortby=\*bill_sort; + + #false laziness with cust_pay.cgi my $range = ''; if ( $cgi->param('beginning') && $cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/ ) { diff --git a/httemplate/search/report_cust_pay.html b/httemplate/search/report_cust_pay.html new file mode 100644 index 000000000..93053e1ee --- /dev/null +++ b/httemplate/search/report_cust_pay.html @@ -0,0 +1,24 @@ + + + Payment report criteria + + +
      +

      Payment report criteria

      +
      +
      +
      + + Return payments for period
      + from m/d/y + to m/d/y +

      +

      +
      + + -- cgit v1.2.1