diff --git a/lib/NGCP/Panel/Controller/Customer.pm b/lib/NGCP/Panel/Controller/Customer.pm index 589ed3dc6b..f1fb3fbb2c 100644 --- a/lib/NGCP/Panel/Controller/Customer.pm +++ b/lib/NGCP/Panel/Controller/Customer.pm @@ -131,12 +131,18 @@ sub create :Chained('list_customer') :PathPart('create') :Args(0) { try { my $schema = $c->model('DB'); $schema->txn_do(sub { + #foreach(qw/contact subscriber_email_template passreset_email_template invoice_email_template/){ + # $form->params->{$_.'_id'} = $form->params->{$_}{id} || undef; + # delete $form->params->{$_}; + #} $form->params->{contact_id} = $form->params->{contact}{id}; delete $form->params->{contact}; $form->params->{subscriber_email_template_id} = $form->params->{subscriber_email_template}{id} || undef; delete $form->params->{subscriber_email_template}; $form->params->{passreset_email_template_id} = $form->params->{passreset_email_template}{id} || undef; delete $form->params->{passreset_email_template}; + $form->params->{invoice_email_template_id} = $form->params->{invoice_email_template}{id} || undef; + delete $form->params->{invoice_email_template}; my $bprof_id = $form->params->{billing_profile}{id}; delete $form->params->{billing_profile}; $form->{create_timestamp} = $form->{modify_timestamp} = NGCP::Panel::Utils::DateTime::current_local; diff --git a/lib/NGCP/Panel/Form/Contract/Basic.pm b/lib/NGCP/Panel/Form/Contract/Basic.pm index 0c8b29d176..2fbb4fc86d 100644 --- a/lib/NGCP/Panel/Form/Contract/Basic.pm +++ b/lib/NGCP/Panel/Form/Contract/Basic.pm @@ -86,7 +86,8 @@ has_field 'invoice_email_template' => ( element_attr => { rel => ['tooltip'], title => ['The email template used to notify users about invoice.'] - },); + }, +); has_field 'vat_rate' => ( type => 'Integer', @@ -111,7 +112,6 @@ has_field 'add_vat' => ( ); - has_field 'save' => ( type => 'Submit', value => 'Save', @@ -136,7 +136,7 @@ sub update_fields { my $c = $self->ctx; return unless $c; - foreach my $field(qw/subscriber_email_template passreset_email_template/) { + foreach my $field(qw/subscriber_email_template passreset_email_template invoice_email_template/) { my $email = $self->field($field); if($email && $c->stash->{contract}) { $email->field('id')->ajax_src(