From 51a648bdf566a6be176b1d7f98a89a2e400481bf Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 31 Jul 2013 05:24:27 -0700 Subject: simple A/P --- httemplate/elements/select-vend_class.html | 18 ++++++++++++++++++ httemplate/elements/tr-select-vend_class.html | 27 +++++++++++++++++++++++++++ httemplate/search/report_vend_bill.html | 7 +++++-- httemplate/search/vend_bill.html | 2 ++ 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 httemplate/elements/select-vend_class.html create mode 100644 httemplate/elements/tr-select-vend_class.html (limited to 'httemplate') diff --git a/httemplate/elements/select-vend_class.html b/httemplate/elements/select-vend_class.html new file mode 100644 index 000000000..e323988de --- /dev/null +++ b/httemplate/elements/select-vend_class.html @@ -0,0 +1,18 @@ +<% include( '/elements/select-table.html', + 'table' => 'vend_class', + 'name_col' => 'classname', + 'value' => $classnum, + 'empty_label' => '(none)', + 'hashref' => { 'disabled' => '' }, + %opt, + ) +%> +<%init> + +my %opt = @_; +my $classnum = $opt{'curr_value'} || $opt{'value'}; + +$opt{'records'} = delete $opt{'vend_class'} + if $opt{'vend_class'}; + + diff --git a/httemplate/elements/tr-select-vend_class.html b/httemplate/elements/tr-select-vend_class.html new file mode 100644 index 000000000..b17191bc0 --- /dev/null +++ b/httemplate/elements/tr-select-vend_class.html @@ -0,0 +1,27 @@ +% if ( 0 ) { # scalar(@{ $opt{'vend_class'} }) == 0 ) { + + + +% } else { + + + <% $opt{'label'} || 'Vendor class' %> + + <% include( '/elements/select-vend_class.html', + 'curr_value' => $classnum, + %opt + ) + %> + + + +% } + +<%init> + +my %opt = @_; +my $classnum = $opt{'curr_value'} || $opt{'value'}; + +$opt{'vend_class'} ||= [ qsearch( 'vend_class', { disabled=>'' } ) ]; + + diff --git a/httemplate/search/report_vend_bill.html b/httemplate/search/report_vend_bill.html index defda70ae..4f391fde8 100644 --- a/httemplate/search/report_vend_bill.html +++ b/httemplate/search/report_vend_bill.html @@ -4,7 +4,7 @@ - +
<% mt('Date') |h %> @@ -16,7 +16,7 @@ - +
<% mt('Payment date') |h %> @@ -28,6 +28,9 @@ + <& /elements/tr-select-vend_class.html, + &> +

diff --git a/httemplate/search/vend_bill.html b/httemplate/search/vend_bill.html index 33eb2241c..9bc74cfc5 100644 --- a/httemplate/search/vend_bill.html +++ b/httemplate/search/vend_bill.html @@ -40,6 +40,8 @@ $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_bill->search( \%search ); my $count_query = delete( $query->{'count_query'} ); -- cgit v1.2.1