1 <FONT CLASS="fsinnerbox-title"><% mt('Commissions') |h %></FONT>
2 <TABLE CLASS="fsinnerbox">
4 % my $pkey = $object->primary_key;
5 % my $pkey_value = $object->$pkey();
6 % my $link_class = 'FS::'.$link_table;
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 : ''
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};
21 <TD><% $pkg_class ? $pkg_class->classname : mt('(no package class)') |h %>:
23 <TD><INPUT TYPE = "text"
25 VALUE = "<% $cgi->param($param) || $thing_pkg_class->commission_percent |h %>"
30 % if ( $opt{'show_duration'} ) {
32 for <INPUT TYPE = "text"
33 NAME = "<% $param %>_duration"
34 VALUE = "<% $cgi->param($param.'_duration') || $thing_pkg_class->commission_duration |h %>"
45 % if ( $opt{'show_duration'} ) {
51 <FONT SIZE="-2"><I>blank for no time limit</I></FONT>
63 my $object = $opt{'source_obj'};
64 my $link_table = $opt{'link_table'};
65 my $target_table = $opt{'target_table'} || 'pkg_class';