X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_pkg.cgi;h=fee0b411ea3301f2d7b27bfab6e36588a867d12e;hb=85e18d1c25a16b3d37ff87484b36a9e17d17cbcf;hp=a4123e1377c76e5b57ce032b215ab33544491709;hpb=a6d3e4dc73803cffad96fd4b6270b2fb5f4b0568;p=freeside.git diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index a4123e137..fee0b411e 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -1,4 +1,4 @@ - + <% @@ -28,15 +28,15 @@ if ( $cgi->param('clone') ) { $part_pkg ||= $old_part_pkg->clone; } elsif ( $query && $query =~ /^(\d+)$/ ) { $part_pkg ||= qsearchs('part_pkg',{'pkgpart'=>$1}); - unless ( $part_pkg->plan ) { - $part_pkg->plan('flat'); - $part_pkg->plandata("setup=". $part_pkg->setup. "\n". - "recur=". $part_pkg->recur. "\n"); - } } else { $part_pkg ||= new FS::part_pkg {}; $part_pkg->plan('flat'); } +unless ( $part_pkg->plan ) { #backwards-compat + $part_pkg->plan('flat'); + $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 @@ -213,10 +229,15 @@ function fchanged(what) { } function fixup(what) { -alert(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 %>" ) { @@ -247,6 +268,8 @@ if (document.getElementById) { + + <% foreach my $f ( @fixups ) { %> <% } %> @@ -258,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