MT#3971 Add max_subscribers field.

This only happens when creating customers for now.
apogrebennyk/3_1_force_outbound
Andreas Granig 13 years ago
parent 4559764348
commit ff5d127f06

@ -460,6 +460,9 @@ sub customer_create :Chained('customer_list') :PathPart('create') :Args(0) {
unless($product_id) {
$product_id = $c->model('DB')->resultset('products')->find({ class => 'sipaccount' })->id;
}
unless($form->params->{max_subscribers} && length($form->params->{max_subscribers})) {
delete $form->params->{max_subscribers};
}
my $contract = $schema->resultset('contracts')->create($form->params);
my $billing_profile = $schema->resultset('billing_profiles')->find($bprof_id);
$contract->billing_mappings->create({

@ -9,10 +9,21 @@ has_field 'product' => (
not_nullable => 1,
);
has_field 'max_subscribers' => (
type => 'PosInteger',
label => 'Max Subscribers',
required => 0,
element_attr => {
rel => ['tooltip'],
title => ['Optionally set the maximum number of subscribers for this contract. Leave empty for unlimited.']
},
);
has_block 'fields' => (
tag => 'div',
class => [qw/modal-body/],
render_list => [qw/product contact billing_profile status external_id/],
render_list => [qw/contact billing_profile product max_subscribers status external_id/],
);
1;

Loading…
Cancel
Save