X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_pkg.cgi;h=19545bd12e88304c118afb3fcfd5743aacafa328;hp=dea02f1ccd635d7f8e71fd863f19606fd788d241;hb=d17a7cdeed4fbd901084369347b56d3d4f02c11b;hpb=a351f58cf394121aa1f72139356567c4785bf47f diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index dea02f1cc..19545bd12 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -69,7 +69,7 @@ print "Package Part #", $hashref->{pkgpart} ? $hashref->{pkgpart} : "(NEW)"; print ntable("#cccccc",2), <Package (customer-visable) Comment (customer-hidden) -Frequency (months) of recurring fee +Frequency (months) of recurring fee  0=no recurring fee, 1=monthly, 3=quarterly, 12=yearly Setup fee tax exempt END @@ -88,6 +88,23 @@ print '>'; print ''; +my $conf = new FS::Conf; +if ( $conf->exists('enable_taxclasses') ) { + print 'Tax class'; +} else { + print + ''; +} + print 'Disable new orders'; print '{disabled} eq "Y"; @@ -188,8 +205,8 @@ tie my %plans, 'Tie::IxHash', }, }, 'fieldorder' => [ 'free_days', 'setup_fee', 'recur_fee' ], - 'setup' => 'what.setup_fee.value', - 'recur' => '\'$sdate += 86400 * \' + what.free_days.value + \'; \' + what.recur_fee.value', + 'setup' => '\'my $d = $cust_pkg->bill || $time; $d += 86400 * \' + what.free_days.value + \'; $cust_pkg->bill($d); $cust_pkg_mod_flag=1; \' + what.setup_fee.value', + 'recur' => 'what.recur_fee.value', }, 'prorate' => { @@ -344,6 +361,14 @@ my %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); } tie my %options, 'Tie::IxHash', map { $_=>$plans{$_}->{'name'} } keys %plans; +my @form_select = (); +if ( $conf->exists('enable_taxclasses') ) { + push @form_select, 'taxclass'; +} else { + push @fixups, 'taxclass'; #hidden +} + + my $widget = new HTML::Widgets::SelectLayers( 'selected_layer' => $part_pkg->plan, 'options' => \%options, @@ -351,6 +376,7 @@ my $widget = new HTML::Widgets::SelectLayers( 'form_action' => 'process/part_pkg.cgi', 'form_text' => [ qw(pkg comment freq clone pkgnum pkgpart), @fixups ], 'form_checkbox' => [ qw(setuptax recurtax disabled) ], + 'form_select' => [ @form_select ], 'fixup_callback' => sub { #my $ = @_; my $html = '';