'recur_cost' => 'Recur cost',
'pay_weight' => 'Payment weight',
'credit_weight' => 'Credit weight',
+ 'agent_pkgpartid' => 'External ID',
'agentnum' => 'Agent',
'setup_fee' => 'Setup fee',
'setup_show_zero' => 'Show zero setup',
}
$conf->config('currencies')
),
+ 'usagepricepart' => ' ',
'discountnum' => 'Offer discounts for longer terms',
'bill_dst_pkgpart' => 'Include line item(s) from package',
'svc_dst_pkgpart' => 'Include services of package',
{ type => 'tablebreak-tr-title',
value => 'Cost tracking', #better name?
},
- { field=>'setup_cost', type=>'money', },
- { field=>'recur_cost', type=>'money', },
+
+ ( $curuser->access_right('Edit package definition costs')
+ ? ( { field=>'setup_cost', type=>'money', },
+ { field=>'recur_cost', type=>'money', },
+ )
+ : ( { field=>'setup_cost', type=>'fixed', },
+ { field=>'recur_cost', type=>'fixed', },
+ )
+ ),
( $conf->exists('part_pkg-delay_start')
? ( { type => 'tablebreak-tr-title',
},
},
- { 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 },
-
( $conf->exists('cust_pkg-show_fcc_voice_grade_equivalent')
? (
{ type => 'tablebreak-tr-title',
: ()
),
+ { type => 'tablebreak-tr-title',
+ value => 'External Links', #better name?
+ },
+ { field=>'agent_pkgpartid', type=>'text', size=>21 },
+
+ { 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',
+ value => 'Usage pricing add-ons', #better name? just 'Usage pricing' ? there's also CDR usage pricing, RADIUS usage pricing, etc :/
+ },
+ { 'field' => 'usagepricepart',
+ 'type' => 'part_pkg_usageprice',
+ 'o2m_table' => 'part_pkg_usageprice',
+ 'm2_label' => ' ',
+ 'm2_error_callback' => $usageprice_error_callback,
+ },
+
{ 'type' => $report_option ? 'tablebreak-tr-title'
: 'hidden',
'value' => 'Optional report classes',
$cgi->param;
};
+my $usageprice_error_callback = sub {
+ my( $cgi, $object ) = @_;
+ map {
+ if ( /^usagepricepart(\d+)_price$/
+ && $cgi->param("usagepricepart$1_price") )
+ {
+ new FS::part_pkg_usageprice {
+ 'usagepricepart' => $cgi->param("usagepricepart$1"),
+ 'pkgpart' => $object->pkgpart,
+ 'price' => scalar($cgi->param("usagepricepart$1_price")),
+ #'currency
+ 'action' => scalar($cgi->param("usagepricepart$1_action")),
+ 'target' => scalar($cgi->param("usagepricepart$1_target")),
+ 'amount' => scalar($cgi->param("usagepricepart$1_amount")),
+ };
+ } else {
+ ();
+ }
+ }
+ $cgi->param;
+};
+
my $m2_error_callback_maker = sub {
my $link_type = shift; #yay closures
return sub {
var plan = what.options[what.selectedIndex].value;
- var term_table = document.getElementById('TableNumber7') // XXX NOT ROBUST
+ var term_table = document.getElementById('TableNumber8') // XXX NOT ROBUST
if ( plan == 'flat' || plan == 'prorate' || plan == 'subscription' ) {
//term_table.disabled = false;
- term_table.style.visibility = '';
+ //term_table.style.visibility = '';
+ term_table.style.display = '';
} else {
//term_table.disabled = true;
- term_table.style.visibility = 'hidden';
+ //term_table.style.visibility = 'hidden';
+ term_table.style.display = 'none';
}
var currency_regex = /^(setup|recur)_fee_[A-Z]{3}$/;