diff --git a/lib/NGCP/Panel/Controller/Billing.pm b/lib/NGCP/Panel/Controller/Billing.pm index 7fcb3ef25f..62d4ffc50a 100644 --- a/lib/NGCP/Panel/Controller/Billing.pm +++ b/lib/NGCP/Panel/Controller/Billing.pm @@ -19,6 +19,7 @@ sub profile_list :Chained('/') :PathPart('billing') :CaptureArgs(0) :Args(0) { NGCP::Panel::Utils::check_redirect_chain(c => $c); $c->stash(has_edit => 1); + $c->stash(has_delete => 0); $c->stash(template => 'billing/list.tt'); } @@ -102,19 +103,6 @@ sub create :Chained('profile_list') :PathPart('create') :Args(0) { $c->stash(form => $form); } -sub delete :Chained('base') :PathPart('delete') :Args(0) { - my ($self, $c) = @_; - - unless ( defined($c->stash->{'profile_result'}) ) { - $c->flash(messages => [{type => 'error', text => 'Billing profile not found!'}]); - return; - } - $c->stash->{'profile_result'}->delete; - - $c->flash(messages => [{type => 'success', text => 'Billing profile successfully deleted!'}]); - $c->response->redirect($c->uri_for); -} - sub fees_list :Chained('base') :PathPart('fees') :CaptureArgs(0) { my ($self, $c) = @_; @@ -557,10 +545,6 @@ Show a modal to edit one billing_profile. Show a modal to add a new billing_profile. -=head2 delete - -Delete a billing_profile identified by base. - =head2 fees_list basis for the billing_fees logic. for a certain billing_profile identified diff --git a/share/templates/billing/list.tt b/share/templates/billing/list.tt index 2eebd9bae9..561fe6f84e 100644 --- a/share/templates/billing/list.tt +++ b/share/templates/billing/list.tt @@ -10,6 +10,7 @@ helper.edit_flag = edit_flag; helper.form_object = form; helper.has_edit = has_edit; + helper.has_delete = has_delete; helper.ajax_uri = c.uri_for( c.controller.action_for('ajax') ); helper.base_uri = c.uri_for( c.controller.action_for("") ); diff --git a/share/templates/helpers/datatables.tt b/share/templates/helpers/datatables.tt index df28af3c80..9f1039cf04 100644 --- a/share/templates/helpers/datatables.tt +++ b/share/templates/helpers/datatables.tt @@ -32,9 +32,11 @@ $(document).ready(function() { ' Edit' + '' + [%- END %] + [%- IF helper.has_delete != 0 %] '' + ' Delete' + '' + + [%- END %] [%- IF helper.extra_buttons.size %] [% FOR b IN helper.extra_buttons %] '