From 277ef4d5ea367fa4819fde5bed75ede8e53a7d9d Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 8 May 2009 08:41:10 +0000 Subject: fix cloning of custom packages where you've changed '(CUSTOM)', RT#5350 --- httemplate/edit/part_pkg.cgi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/part_pkg.cgi') diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index f40469937..a2ec63068 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -209,7 +209,9 @@ my $disabled_type = $acl_edit_either ? 'checkbox' : 'hidden'; my $agent_clone_extra_sql = ' ( '. FS::part_pkg->curuser_pkgs_sql. #kludge to clone custom customer packages you otherwise couldn't see - " OR ( part_pkg.disabled = 'Y' AND part_pkg.comment LIKE '(CUSTOM)%' ) ". + #really need a proper "CUSTOM" flag that's distinct from disabled + #" OR ( part_pkg.disabled = 'Y' AND part_pkg.comment LIKE '(CUSTOM)%' ) ". + " OR ( part_pkg.disabled = 'Y' ) ". ' ) '; my $conf = new FS::Conf; -- cgit v1.2.1 From 287bf810a8ae3528525fff354610afa606468299 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 18 Jun 2009 11:03:34 +0000 Subject: add basic part_pkg cost columns for agent wholsale price plan, RT#4696 --- httemplate/edit/part_pkg.cgi | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/part_pkg.cgi') diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index a2ec63068..6391db92a 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -37,6 +37,8 @@ 'taxproduct_select'=> 'Tax products', 'plan' => 'Price plan', 'disabled' => 'Disable new orders', + 'setup_cost' => 'Setup cost', + 'recur_cost' => 'Recur cost', 'pay_weight' => 'Payment weight', 'credit_weight' => 'Credit weight', 'agentnum' => 'Agent', @@ -131,10 +133,10 @@ { field=>'promo_code', type=>'text', size=>15 }, { type => 'tablebreak-tr-title', - value => 'Line-item revenue recogition', #better name? + value => 'Cost tracking', #better name? }, - { field=>'pay_weight', type=>'text', size=>6 }, - { field=>'credit_weight', type=>'text', size=>6 }, + { field=>'setup_cost', type=>'money', }, + { field=>'recur_cost', type=>'money', }, { type => 'columnnext' }, @@ -148,6 +150,13 @@ }, }, + { type => 'tablebreak-tr-title', + value => 'Line-item revenue recogition', #better name? + }, + { field=>'pay_weight', type=>'text', size=>6 }, + { field=>'credit_weight', type=>'text', size=>6 }, + + { type => 'columnend' }, { 'type' => 'tablebreak-tr-title', -- cgit v1.2.1 From 04a69f9d197efee6fa396bd35d04ae553e669978 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 21 Jun 2009 15:21:32 +0000 Subject: CUSTOM packages/actual flag for custom packages #3988 --- httemplate/edit/part_pkg.cgi | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'httemplate/edit/part_pkg.cgi') diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 6391db92a..0934f501a 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -58,6 +58,8 @@ sub { shift->param('pkgnum') }, }, + { field=>'custom', type=>'hidden' }, + { type => 'columnstart' }, { field => 'pkg', @@ -217,10 +219,7 @@ my $disabled_type = $acl_edit_either ? 'checkbox' : 'hidden'; my $agent_clone_extra_sql = ' ( '. FS::part_pkg->curuser_pkgs_sql. - #kludge to clone custom customer packages you otherwise couldn't see - #really need a proper "CUSTOM" flag that's distinct from disabled - #" OR ( part_pkg.disabled = 'Y' AND part_pkg.comment LIKE '(CUSTOM)%' ) ". - " OR ( part_pkg.disabled = 'Y' ) ". + " OR ( part_pkg.custom = 'Y' ) ". ' ) '; my $conf = new FS::Conf; @@ -339,9 +338,8 @@ my $clone_callback = sub { $opt->{action} = 'Custom'; #my $part_pkg = $clone_part_pkg->clone; - #this is all clone did anyway - $object->comment( '(CUSTOM) '. $object->comment ) - unless $object->comment =~ /^\(CUSTOM\) /; + #this is all clone does anyway + $object->custom('Y'); $object->disabled('Y'); -- cgit v1.2.1 From 55f003404af6a2416571138356d11c5ad3755e58 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 29 Jun 2009 13:53:25 +0000 Subject: FCC form 477 reporting #4912 --- httemplate/edit/part_pkg.cgi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'httemplate/edit/part_pkg.cgi') diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 0934f501a..a78aa87d8 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -46,6 +46,7 @@ 'recur_fee' => 'Recurring fee', 'bill_dst_pkgpart' => 'Include line item(s) from package', 'svc_dst_pkgpart' => 'Include services of package', + 'report_option' => 'Report classes', }, 'fields' => [ @@ -161,6 +162,19 @@ { type => 'columnend' }, + { 'type' => $census ? 'tablebreak-tr-title' + : 'hidden', + 'value' => 'Optional report classes', + 'field' => 'census_title', + }, + { 'field' => 'report_option', + 'type' => $census ? 'select-table' : 'hidden', + 'table' => 'part_pkg_report_option', + 'name_col' => 'name', + 'multiple' => 1, + }, + + { 'type' => 'tablebreak-tr-title', 'value' => 'Pricing add-ons', }, @@ -224,6 +238,7 @@ my $agent_clone_extra_sql = my $conf = new FS::Conf; my $taxproducts = $conf->exists('enable_taxproducts'); +my $census = scalar( qsearch( 'part_pkg_report_option', {} ) ); #XXX # - tr-part_pkg_freq: month_increments_only (from price plans) @@ -301,14 +316,27 @@ my $edit_callback = sub { (@agent_type) = map {$_->typenum} qsearch('type_pkgs',{'pkgpart'=>$1}); + my @report_option = (); foreach ($object->options) { /^usage_taxproductnum_(\d+)$/ && ($taxproductnums{$1} = 1); + /^report_option_(\d+)$/ && (push @report_option, $1); } foreach ($object->part_pkg_taxoverride) { $taxproductnums{$_->usage_class} = 1 if $_->usage_class; } + $cgi->param('report_option', join(',', @report_option)); + foreach my $field ( @$fields ) { + next unless ( + ref($field) eq 'HASH' && + $field->{field} && + $field->{field} eq 'report_option' + ); + #$field->{curr_value} = join(',', @report_option); + $field->{value} = join(',', @report_option); + } + %options = $object->options; $object->set($_ => $object->option($_)) -- cgit v1.2.1 From 87a986f35b347affed5f1e1ff5c5c7c59ccd4ad1 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 20 Jul 2009 14:26:12 +0000 Subject: bundle bill linked packages into top line total when desired #5724 --- httemplate/edit/part_pkg.cgi | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'httemplate/edit/part_pkg.cgi') diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index a78aa87d8..690e884db 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -175,8 +175,9 @@ }, - { 'type' => 'tablebreak-tr-title', - 'value' => 'Pricing add-ons', + { 'type' => 'tablebreak-tr-title', + 'value' => 'Pricing add-ons', + 'colspan' => 4, }, { 'field' => 'bill_dst_pkgpart', 'type' => 'select-part_pkg', @@ -185,6 +186,13 @@ 'm2m_dstcol' => 'dst_pkgpart', 'm2_error_callback' => &{$m2_error_callback_maker}('bill'), + 'm2_fields' => [ { 'field' => 'hidden', + 'type' => 'checkbox', + 'value' => 'Y', + 'curr_value' => '', + 'label' => 'Bundle', + }, + ], }, { type => 'tablebreak-tr-title', @@ -385,16 +393,26 @@ my $m2_error_callback_maker = sub { my $link_type = shift; #yay closures return sub { my( $cgi, $object ) = @_; - map { - new FS::part_pkg_link { - 'link_type' => $link_type, - 'src_pkgpart' => $object->pkgpart, - 'dst_pkgpart' => $_, - }; - } - grep $_, - map $cgi->param($_), - grep /^${link_type}_dst_pkgpart(\d+)$/, $cgi->param; + my $num; + map { + + if ( /^${link_type}_dst_pkgpart(\d+)$/ && + ( my $dst = $cgi->param("${link_type}_dst_pkgpart$1") ) ) + { + + my $hidden = $cgi->param("${link_type}_dst_pkgpart__hidden$1") + || ''; + new FS::part_pkg_link { + 'link_type' => $link_type, + 'src_pkgpart' => $object->pkgpart, + 'dst_pkgpart' => $dst, + 'hidden' => $hidden, + }; + } else { + (); + } + } + $cgi->param; }; }; -- cgit v1.2.1