diff options
Diffstat (limited to 'httemplate/search/unapplied_cust_pay.html')
-rwxr-xr-x | httemplate/search/unapplied_cust_pay.html | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/httemplate/search/unapplied_cust_pay.html b/httemplate/search/unapplied_cust_pay.html new file mode 100755 index 0000000..8d064d1 --- /dev/null +++ b/httemplate/search/unapplied_cust_pay.html @@ -0,0 +1,28 @@ +<% include( 'elements/cust_main_dayranges.html', + #'title' => 'Prepaid Balance Aging Summary', #??? + 'title' => 'Unapplied Payments Aging Summary', + 'range_sub' => \&unapplied_payments, + ) +%> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); + +</%init> +<%once> + +sub unapplied_payments { + my($start, $end, %opt) = @_; + + #handle start and end ranges (86400 = 24h * 60m * 60s) + my $str2time = str2time_sql; + my $closing = str2time_sql_closing; + $start = $start ? "( $str2time now() $closing - ".($start * 86400). ' )' : ''; + $end = $end ? "( $str2time now() $closing - ".($end * 86400). ' )' : ''; + + FS::cust_main->unapplied_payments_date_sql( $start, $end ); + +} + +</%once> |