summaryrefslogtreecommitdiff
path: root/httemplate/search/vend_bill.html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-07-31 03:36:14 -0700
committerIvan Kohler <ivan@freeside.biz>2013-07-31 03:36:14 -0700
commitf264598260908d2442fe1aed2ce3784ce51254e6 (patch)
treebd0f6efc5b41c49084a9d193a59c3e4a7672ba81 /httemplate/search/vend_bill.html
parent449e3c3b4fe9b4f55950951c0ecc7aaf954e2212 (diff)
simple A/P
Diffstat (limited to 'httemplate/search/vend_bill.html')
-rw-r--r--httemplate/search/vend_bill.html52
1 files changed, 52 insertions, 0 deletions
diff --git a/httemplate/search/vend_bill.html b/httemplate/search/vend_bill.html
new file mode 100644
index 000000000..ddcc0c93e
--- /dev/null
+++ b/httemplate/search/vend_bill.html
@@ -0,0 +1,52 @@
+<& elements/search.html,
+ 'title' => 'Payables',
+ 'name' => 'payables',
+ 'menubar' => [ 'Add a payable' => '../edit/vend_bill.html', ],
+ 'html_init' => $html_init,
+ 'query' => $query,
+ 'count_query' => $count_query,
+ 'count_addl' => [ '$%.2f total', ],
+ 'header' => [ 'Date',
+ 'Vendor',
+ 'Class',
+ 'Amount',
+ '',
+ ],
+ 'fields' => [
+ sub { time2str('%D', shift->_date) },
+ sub { shift->vend_main->vendname },
+ sub { shift->vend_main->vend_class->classname },
+ 'charged',
+ sub { '<A HREF="javascript:areyousure('.
+ shift->vendbillnum.
+ ')">delete</A>';
+ },
+ ],
+
+&>
+<%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, '');
+$search{'_date'} = [ $beginning, $ending ];
+
+my $query = FS::vend_bill->search( \%search );
+my $count_query = delete( $query->{'count_query'} );
+
+my $html_init .= <<"END";
+<SCRIPT TYPE="text/javascript">
+ function areyousure(vendbillnum) {
+ if ( confirm('Are you sure you want to delete this payable?') )
+ window.location.href="${p}misc/delete-vend_bill.html?" + vendbillnum;
+
+ }
+</SCRIPT>
+END
+
+</%init>
+