X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_pkg.cgi;h=fee0b411ea3301f2d7b27bfab6e36588a867d12e;hp=5eccc1e1e0058bea77eb169adf0875cf621a1f4a;hb=60c837e0aaf454dfa0b0c0283dc36928782d1b6c;hpb=c095a5391475464fa816b7732c40ffa7d293ac6d diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 5eccc1e1e..fee0b411e 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -1,4 +1,4 @@ - + <% @@ -34,8 +34,8 @@ if ( $cgi->param('clone') ) { } unless ( $part_pkg->plan ) { #backwards-compat $part_pkg->plan('flat'); - $part_pkg->plandata("setup=". $part_pkg->setup. "\n". - "recur=". $part_pkg->recur. "\n"); + $part_pkg->plandata("setup_fee=". $part_pkg->setup. "\n". + "recur_fee=". $part_pkg->recur. "\n"); } $action ||= $part_pkg->pkgpart ? 'Edit' : 'Add'; my $hashref = $part_pkg->hashref; @@ -76,28 +76,44 @@ print '
'; #print qq!!, print "Package Part #", $hashref->{pkgpart} ? $hashref->{pkgpart} : "(NEW)"; +print itable("#cccccc",2), <Package (customer-visable) +Comment (customer-hidden) +Frequency (months) of recurring fee +Setup fee tax exempt +END + +print '{setuptax} eq "Y"; +print '>'; + print < -Package (customer-visable) -Comment (customer-hidden) + +Recurring fee tax exempt +END -Frequency (months) of recurring fee +print '{recurtax} eq "Y"; +print '>'; - +print ''; +my $thead = "\n\n". ntable('#cccccc', 2). <Quan.Service END unless ( $cgi->param('clone') ) { - print <
- - + #print <' if $count == 0 ; - print qq!"; - $count++; - if ($count == 2) - { - print ''; - $count = 0; + qq!">!, $part_svc->getfield('svc'), ""; +# print "
Quan.ServiceQuan.Service
', $thead; +

Enter the quantity of each service this package includes.

END } -my $count = 0; my @fixups = (); -foreach my $part_svc ( ( qsearch( 'part_svc', {} ) ) ) { +my $count = 0; +my $columns = 3; +my @part_svc = qsearch( 'part_svc', {} ); +foreach my $part_svc ( @part_svc ) { my $svcpart = $part_svc->svcpart; my $pkg_svc = qsearchs( 'pkg_svc', { 'pkgpart' => $cgi->param('clone') || $part_pkg->pkgpart, @@ -112,16 +128,16 @@ foreach my $part_svc ( ( qsearch( 'part_svc', {} ) ) ) { push @fixups, "pkg_svc$svcpart"; unless ( defined ($cgi->param('clone')) && $cgi->param('clone') ) { - print '
quantity || 0, qq!">!, $part_svc->getfield('svc'), "
$thead" if ++$count == int(scalar(@part_svc) / 2); + $count+=1; + foreach ( 1 .. $columns-1 ) { + print "$thead" + if $count == int( $_ * scalar(@part_svc) / $columns ); } } else { print qq!"; + print ""; + #print ""; } # prolly should be in database @@ -216,6 +232,12 @@ function fixup(what) { <% foreach my $f ( qw( pkg comment freq ), @fixups ) { %> what.<%= $f %>.value = document.dummy.<%= $f %>.value; <% } %> +<% foreach my $f ( qw( setuptax recurtax ) ) { %> + if (document.dummy.<%= $f %>.checked) + what.<%= $f %>.value = 'Y'; + else + what.<%= $f %>.value = ''; +<% } %> what.plan.value = document.dummy.plan.options[document.dummy.plan.selectedIndex].value; <% foreach my $p ( keys %plans ) { %> if ( what.plan.value == "<%= $p %>" ) { @@ -246,6 +268,8 @@ if (document.getElementById) { + + <% foreach my $f ( @fixups ) { %> <% } %> @@ -257,17 +281,20 @@ if ( $cgi->param('clone') ) { if ( $cgi->param('pkgnum') ) { print qq!!; } -print qq!!, %> + +<%= itable("#cccccc",2) %> + <% my $href = $plans{$layer}->{'fields'}; foreach my $field ( keys %{ $href } ) { %> -<%= $href->{$field}{'name'} %>: -
+<%= $href->{$field}{'name'} %> + <% } %> + - +

Setup expression

Recurring espression