summaryrefslogtreecommitdiff
path: root/httemplate/search/unapplied_cust_pay.html
diff options
context:
space:
mode:
authorivan <ivan>2009-07-08 03:33:45 +0000
committerivan <ivan>2009-07-08 03:33:45 +0000
commit0cc20c3d66e50d640422c2d587d97ddf7768493b (patch)
treeb582c445901d6f0867fc651fbd9db47912ecbe52 /httemplate/search/unapplied_cust_pay.html
parent7e4c4494f0ca232a482fe94f78083fc250e2bd4b (diff)
factor out the range-handling portions of receivables report, start on a similar unapplied payment report, RT#4861
Diffstat (limited to 'httemplate/search/unapplied_cust_pay.html')
-rwxr-xr-xhttemplate/search/unapplied_cust_pay.html46
1 files changed, 46 insertions, 0 deletions
diff --git a/httemplate/search/unapplied_cust_pay.html b/httemplate/search/unapplied_cust_pay.html
new file mode 100755
index 000000000..35abd6bbc
--- /dev/null
+++ b/httemplate/search/unapplied_cust_pay.html
@@ -0,0 +1,46 @@
+<% 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>
+
+#Example:
+#
+# my $balance = balance(
+# $start, $end,
+# 'no_as' => 1, #set to true when using in a WHERE clause (supress AS clause)
+# #or 0 / omit when using in a SELECT clause as a column
+# # ("AS balance_$start_$end")
+# 'sum' => 1, #set to true to get a SUM() of the values, for totals
+#
+# #obsolete? options for totals (passed to cust_main::balance_date_sql)
+# 'total' => 1, #set to true to remove all customer comparison clauses
+# 'join' => $join, #JOIN clause
+# 'where' => \@where, #WHERE clause hashref (elements "AND"ed together)
+# )
+
+#sub balance {
+sub unapplied_payments {
+ my($start, $end, %opt) = @_;
+
+#XXX fill-in
+# #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). ' )' : '';
+#
+# #$opt{'unapplied_date'} = 1;
+#
+# FS::cust_main->balance_date_sql( $start, $end, %opt ).
+
+}
+
+</%once>