X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_pkg.cgi;h=08d5dc9064e6129e9dfe80c85785858da63b9833;hp=dea02f1ccd635d7f8e71fd863f19606fd788d241;hb=2c9b97801b3981efaf6c65118e3cc1a0368e649c;hpb=a351f58cf394121aa1f72139356567c4785bf47f diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index dea02f1cc..08d5dc906 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,24 @@ print '>'; print ''; +my $conf = new FS::Conf; +#false laziness w/ view/cust_main.cgi quick order +if ( $conf->exists('enable_taxclasses') ) { + print 'Tax class'; +} else { + print + ''; +} + print 'Disable new orders'; print '{disabled} eq "Y"; @@ -188,8 +206,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 +362,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 +377,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 = '';