X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_pkg.cgi;h=19545bd12e88304c118afb3fcfd5743aacafa328;hp=60319f9d9c6a60c47eb338fe683e10bcd38f934f;hb=d17a7cdeed4fbd901084369347b56d3d4f02c11b;hpb=1858140b774bfe3a694a2ededf70de797da31c51 diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 60319f9d9..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"; @@ -174,6 +191,24 @@ tie my %plans, 'Tie::IxHash', 'recur' => 'what.recur_fee.value', }, + 'flat_delayed' => { + 'name' => 'Free for X days, then flat rate (anniversary billing)', + 'fields' => { + 'free_days' => { 'name' => 'Initial free days', + 'default' => 0, + }, + 'setup_fee' => { 'name' => 'Setup fee for this package', + 'default' => 0, + }, + 'recur_fee' => { 'name' => 'Recurring fee for this package', + 'default' => 0, + }, + }, + 'fieldorder' => [ 'free_days', 'setup_fee', 'recur_fee' ], + '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' => { 'name' => 'First partial month pro-rated, then flat-rate (1st of month billing)', 'fields' => { @@ -326,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, @@ -333,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 = '';