X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fdiscount.html;h=deb98c3c7a6a2e8bfbbd1b5c81ab50da53e9ee9e;hb=66fc0c9ba5d3f460a26a51ee72ee25923d644da8;hp=f7ef0b30f15caadc612c371e357be9d483599aed;hpb=0fcdc36642e1430f02ebf5326740e231883bd41f;p=freeside.git diff --git a/httemplate/browse/discount.html b/httemplate/browse/discount.html index f7ef0b30f..deb98c3c7 100644 --- a/httemplate/browse/discount.html +++ b/httemplate/browse/discount.html @@ -1,21 +1,18 @@ <% include( 'elements/browse.html', 'title' => 'Discounts', 'name' => 'discounts', - 'menubar' => [ 'Add a new discount' => - $p.'edit/discount.html', - ], - 'query' => { 'table' => 'discount', }, + 'menubar' => \@menubar, + 'query' => \%query, + 'order_by_sql' => { description => 'discountnum' }, 'count_query' => 'SELECT COUNT(*) FROM discount', 'disableable' => 1, - 'disabled_statuspos' => 2, - 'header' => [ '#', 'Name', 'Discount', ], - 'fields' => [ 'discountnum', - 'name', + 'disabled_statuspos' => 1, + 'header' => [ 'Name', 'Class', 'Discount', ], + 'fields' => [ 'name', + 'classname', 'description', ], - 'links' => [ $link, - $link, - ], + 'links' => \@links ) %> <%init> @@ -23,6 +20,20 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); -my $link = [ "${p}edit/discount.html?", 'discountnum' ]; +my @links = ( + [ "${p}edit/discount.html?", 'discountnum' ], + [ "${p}edit/discount_class.html?", 'classnum' ], +); + +my %query = ( + select => 'discount.*, discount_class.*', + table => 'discount', + addl_from => 'LEFT JOIN discount_class USING(classnum)', +); + +my @menubar = ( + 'Add a new discount' => $p.'edit/discount.html', + 'Discount classes' => $p.'browse/discount_class.html', +);