From fcc3ddbd03b97b88bf04f6984d7fd3c443fb14b5 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 29 Oct 2009 18:38:09 +0000 Subject: customer classification, RT#6376 --- httemplate/browse/pkg_category.html | 2 +- httemplate/edit/cust_main/top_misc.html | 9 +++++++++ httemplate/elements/select-cust_class.html | 18 ++++++++++++++++++ httemplate/elements/tr-select-cust_class.html | 27 +++++++++++++++++++++++++++ httemplate/view/cust_main/misc.html | 11 ++++++++--- 5 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 httemplate/elements/select-cust_class.html create mode 100644 httemplate/elements/tr-select-cust_class.html (limited to 'httemplate') 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!Package classes

!. - 'Package categories define groups of package classes.

'. + 'Package categories define groups of package classes, used for sectioned invoices.

'. qq!Add a package category

!; 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'}; + + 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 ) { + + + +% } else { + + + <% $opt{'label'} || 'Customer class' %> + + <% include( '/elements/select-cust_class.html', + 'curr_value' => $classnum, + %opt + ) + %> + + + +% } + +<%init> + +my %opt = @_; +my $classnum = $opt{'curr_value'} || $opt{'value'}; + +$opt{'cust_class'} ||= [ qsearch( 'cust_class', { disabled=>'' } ) ]; + + 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 @@ % % } -% + +% #if ( $cust_main->classnum ) { + + Class + <% $cust_main->classname || '(none)' %> + +% #} + % unless ( FS::part_referral->num_part_referral == 1 ) { % my $referral = qsearchs('part_referral', { % 'refnum' => $cust_main->refnum % } ); -% - Advertising source -- cgit v1.2.1