continue sales person work: customer and package selection, commissions, reporting...
[freeside.git] / httemplate / elements / table-commissions.html
1 <FONT CLASS="fsinnerbox-title"><% mt('Commissions') |h %></FONT>
2 <TABLE CLASS="fsinnerbox">
3
4 % my $pkey = $object->primary_key;
5 % my $pkey_value = $object->$pkey();
6 % my $link_class = 'FS::'.$link_table;
7
8 % #surprising amount of false laziness w/ edit/process/agent.cgi
9 % # (somewhat less now that we're more generic)
10 % my @pkg_class = qsearch($target_table, { 'disabled'=>'' });
11 % foreach my $pkg_class ( '', @pkg_class ) {
12 %   my %thing_pkg_class = ( $pkey    => $pkey_value,
13 %                           classnum => $pkg_class ? $pkg_class->classnum : ''
14 %                         );
15 %   my $thing_pkg_class =
16 %     qsearchs( $link_table, \%thing_pkg_class )
17 %     || $link_class->new( \%thing_pkg_class );
18 %   my $param = 'classnum'. $thing_pkg_class{classnum};
19
20     <TR>
21       <TD><INPUT TYPE      = "text"
22                  NAME      = "<% $param %>"
23                  VALUE     = "<% $cgi->param($param) || $thing_pkg_class->commission_percent |h %>"
24                  SIZE      = 6
25                  MAXLENGTH = 7
26           >%
27       </TD>
28       <TD><% $pkg_class ? $pkg_class->classname : mt('(no package class)') |h %>
29       </TD>
30     </TR>
31
32 % }
33
34 </TABLE>
35
36 <%init>
37
38 my %opt = @_;
39
40 my $object = $opt{'source_obj'};
41 my $link_table = $opt{'link_table'};
42 my $target_table = $opt{'target_table'} || 'pkg_class';
43
44 </%init>