summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/elements/menu.html3
-rw-r--r--httemplate/search/report_vend_main.html48
-rw-r--r--httemplate/search/vend_main.html40
3 files changed, 90 insertions, 1 deletions
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 7df2448d3..fdd496230 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -377,7 +377,8 @@ if( $curuser->access_right('Financial reports') ) {
} # else $report_financial contains nothing.
tie my %report_payable, 'Tie::IxHash',
- 'Payables' => [ $fsurl. 'search/report_vend_bill.html' ],
+ 'Payables summary' => [ $fsurl. 'search/report_vend_main.html', 'Payables summary by vendor' ],
+ 'Payables detail' => [ $fsurl. 'search/report_vend_bill.html' ],
;
tie my %report_logs, 'Tie::IxHash';
diff --git a/httemplate/search/report_vend_main.html b/httemplate/search/report_vend_main.html
new file mode 100644
index 000000000..c7fbb2be4
--- /dev/null
+++ b/httemplate/search/report_vend_main.html
@@ -0,0 +1,48 @@
+<& /elements/header.html, mt('Payables summary by vendor') &>
+
+<FORM ACTION="vend_main.html" METHOD="GET">
+
+ <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Date') |h %></TD>
+ <TD>
+ <TABLE>
+ <& /elements/tr-input-beginning_ending.html,
+ prefix => '_date',
+ layout => 'horiz',
+ &>
+ </TABLE>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Payment date') |h %></TD>
+ <TD>
+ <TABLE>
+ <& /elements/tr-input-beginning_ending.html,
+ prefix => 'payment_date',
+ layout => 'horiz',
+ &>
+ </TABLE>
+ </TD>
+ </TR>
+
+ <& /elements/tr-select-vend_class.html,
+ &>
+
+ </TABLE>
+
+<BR>
+<INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
+
+</FORM>
+
+<& /elements/footer.html &>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
+
diff --git a/httemplate/search/vend_main.html b/httemplate/search/vend_main.html
new file mode 100644
index 000000000..41917a517
--- /dev/null
+++ b/httemplate/search/vend_main.html
@@ -0,0 +1,40 @@
+<& elements/search.html,
+ 'title' => 'Payables summary by vendor',
+ 'name' => 'vendors',
+ 'query' => $query,
+ 'count_query' => $count_query,
+ 'count_addl' => [ '$%.2f total', ],
+ 'header' => [
+ 'Vendor',
+ 'Class',
+ 'Amount',
+ '',
+ ],
+ 'fields' => [
+ sub { shift->vendname },
+ sub { shift->vend_class->classname },
+ 'sum_charged',
+ ],
+
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my %search = ();
+
+# begin/end/beginning/ending
+my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, '_date');
+$search{'_date'} = [ $beginning, $ending ];
+
+($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, 'payment_date');
+$search{'payment_date'} = [ $beginning, $ending ];
+
+$search{'classnum'} = $cgi->param('classnum');
+
+my $query = FS::vend_main->search( \%search );
+my $count_query = delete( $query->{'count_query'} );
+
+</%init>
+