[freeside-commits] branch FREESIDE_4_BRANCH updated. 393e0c1f9d9175f802832bd9d15d9a230538ec7d
Mitch Jackson
mitch at freeside.biz
Fri Oct 19 12:53:26 PDT 2018
The branch, FREESIDE_4_BRANCH has been updated
via 393e0c1f9d9175f802832bd9d15d9a230538ec7d (commit)
from 5794f606bc6eaa40521f21204aaea72c605d371a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 393e0c1f9d9175f802832bd9d15d9a230538ec7d
Author: Mitch Jackson <mitch at freeside.biz>
Date: Fri Jun 29 14:01:36 2018 -0500
RT# 31208 Fix Browse Discounts sorting error
diff --git a/httemplate/browse/discount.html b/httemplate/browse/discount.html
index 9b2298ae4..deb98c3c7 100644
--- a/httemplate/browse/discount.html
+++ b/httemplate/browse/discount.html
@@ -1,22 +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' => 1,
- 'header' => [ 'Name', 'Comment', 'Class', 'Discount', ],
+ 'header' => [ 'Name', 'Class', 'Discount', ],
'fields' => [ 'name',
- 'comment',
'classname',
'description',
],
- 'links' => [ $link,
- $link,
- ],
+ 'links' => \@links
)
%>
<%init>
@@ -24,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',
+);
</%init>
-----------------------------------------------------------------------
Summary of changes:
httemplate/browse/discount.html | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
More information about the freeside-commits
mailing list