summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2009-10-29 18:38:09 +0000
committerivan <ivan>2009-10-29 18:38:09 +0000
commitfcc3ddbd03b97b88bf04f6984d7fd3c443fb14b5 (patch)
tree3982ce563d7b0fa726ae033aadf92748350b2123 /httemplate
parent9d77a21db3642ca66d9a0e545b804b7e6b4090ee (diff)
customer classification, RT#6376
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/pkg_category.html2
-rw-r--r--httemplate/edit/cust_main/top_misc.html9
-rw-r--r--httemplate/elements/select-cust_class.html18
-rw-r--r--httemplate/elements/tr-select-cust_class.html27
-rw-r--r--httemplate/view/cust_main/misc.html11
5 files changed, 63 insertions, 4 deletions
diff --git a/httemplate/browse/pkg_category.html b/httemplate/browse/pkg_category.html
index 2223445e1..a156c06da 100644
--- a/httemplate/browse/pkg_category.html
+++ b/httemplate/browse/pkg_category.html
@@ -22,7 +22,7 @@ die "access denied"
my $html_init =
qq!<A HREF="${p}browse/pkg_class.html">Package classes</A><BR><BR>!.
- 'Package categories define groups of package classes.<BR><BR>'.
+ 'Package categories define groups of package classes, used for sectioned invoices.<BR><BR>'.
qq!<A HREF="${p}edit/pkg_category.html"><I>Add a package category</I></A><BR><BR>!;
my $count_query = 'SELECT COUNT(*) FROM pkg_category';
diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html
index 041050664..7c9e0395c 100644
--- a/httemplate/edit/cust_main/top_misc.html
+++ b/httemplate/edit/cust_main/top_misc.html
@@ -23,6 +23,15 @@
% }
+%# class
+<% include('/elements/tr-select-cust_class.html',
+ 'curr_value' => $cust_main->classnum,
+ 'label' => "Class",
+ #'empty_label' => '(none)',
+ #'disable_empty' =>
+ )
+%>
+
%# referral (advertising source)
%my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0;
%if ( $custnum && ! $conf->exists('editreferrals') ) {
diff --git a/httemplate/elements/select-cust_class.html b/httemplate/elements/select-cust_class.html
new file mode 100644
index 000000000..94b935acb
--- /dev/null
+++ b/httemplate/elements/select-cust_class.html
@@ -0,0 +1,18 @@
+<% include( '/elements/select-table.html',
+ 'table' => 'cust_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{'cust_class'}
+ if $opt{'cust_class'};
+
+</%init>
diff --git a/httemplate/elements/tr-select-cust_class.html b/httemplate/elements/tr-select-cust_class.html
new file mode 100644
index 000000000..54a11d79e
--- /dev/null
+++ b/httemplate/elements/tr-select-cust_class.html
@@ -0,0 +1,27 @@
+% if ( scalar(@{ $opt{'cust_class'} }) == 0 ) {
+
+ <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'classnum' %>" VALUE="">
+
+% } else {
+
+ <TR>
+ <TD ALIGN="right"><% $opt{'label'} || 'Customer class' %></TD>
+ <TD>
+ <% include( '/elements/select-cust_class.html',
+ 'curr_value' => $classnum,
+ %opt
+ )
+ %>
+ </TD>
+ </TR>
+
+% }
+
+<%init>
+
+my %opt = @_;
+my $classnum = $opt{'curr_value'} || $opt{'value'};
+
+$opt{'cust_class'} ||= [ qsearch( 'cust_class', { disabled=>'' } ) ];
+
+</%init>
diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html
index 71e8d6973..2cfe0263f 100644
--- a/httemplate/view/cust_main/misc.html
+++ b/httemplate/view/cust_main/misc.html
@@ -31,13 +31,18 @@
</TR>
%
% }
-%
+
+% #if ( $cust_main->classnum ) {
+ <TR>
+ <TD ALIGN="right">Class</TD>
+ <TD BGCOLOR="#ffffff"><% $cust_main->classname || '(none)' %></TD>
+ </TR>
+% #}
+
% unless ( FS::part_referral->num_part_referral == 1 ) {
% my $referral = qsearchs('part_referral', {
% 'refnum' => $cust_main->refnum
% } );
-%
-
<TR>
<TD ALIGN="right">Advertising&nbsp;source</TD>