|
|
|
|
@ -1,22 +1,43 @@
|
|
|
|
|
package NGCP::Panel::Form::Invoice::Generate;
|
|
|
|
|
|
|
|
|
|
use Sipwise::Base;
|
|
|
|
|
#use Sipwise::Base;
|
|
|
|
|
use HTML::FormHandler::Moose;
|
|
|
|
|
#extends qw/HTML::FormHandler NGCP::Panel::Form::ValidatorBase/;
|
|
|
|
|
extends 'NGCP::Panel::Form::ValidatorBase';
|
|
|
|
|
use Moose::Util::TypeConstraints;
|
|
|
|
|
#extends qw/NGCP::Panel::Form::ValidatorBase HTML::FormHandler::Field::Compound/;
|
|
|
|
|
#extends 'HTML::FormHandler::Field::Compound';
|
|
|
|
|
#use Moose::Util::TypeConstraints;
|
|
|
|
|
|
|
|
|
|
use DateTime;
|
|
|
|
|
use DateTime::Format::Strptime;
|
|
|
|
|
use NGCP::Panel::Utils::DateTime;
|
|
|
|
|
|
|
|
|
|
has '+widget_wrapper' => ( default => 'Bootstrap' );
|
|
|
|
|
has_field 'submitid' => ( type => 'Hidden' );
|
|
|
|
|
has '+widget_wrapper' => ( default => 'Bootstrap' );
|
|
|
|
|
sub build_render_list {[qw/submitid fields actions/]}
|
|
|
|
|
sub build_form_element_class { [qw/form-horizontal/] }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
has_field 'submitid' => ( type => 'Hidden' );
|
|
|
|
|
has_field 'client_contract_id' => (
|
|
|
|
|
is => 'rw',
|
|
|
|
|
type => '+NGCP::Panel::Field::DataTable',
|
|
|
|
|
label => 'Contract',
|
|
|
|
|
do_label => 0,
|
|
|
|
|
do_wrapper => 0,
|
|
|
|
|
required => 1,
|
|
|
|
|
template => 'helpers/datatables_field.tt',
|
|
|
|
|
#we will set it in controller
|
|
|
|
|
#ajax_src => $c->uri_for_action( '/invoice/ajax_datatables_data', [ $self->provider_id, 'invoice_list_data' ],
|
|
|
|
|
ajax_src => '',
|
|
|
|
|
|
|
|
|
|
# { name => 'contracts.id', title => c.loc('Client Contract Id'), search => 1},
|
|
|
|
|
# { name => 'contracts.external_id', title => c.loc('External #'), search => 1 },
|
|
|
|
|
# { name => 'email', title => c.loc('Contact Email'), search => 1 },
|
|
|
|
|
# { name => 'contracts.billing_mappings.billing_profile.name', title => c.loc('Billing Profile'), search => 1 },
|
|
|
|
|
# { name => 'contracts.billing_mappings.product.name', title => c.loc('Product'), search => 1 },
|
|
|
|
|
# { name => 'contracts.status', title => c.loc('Status'), search => 1 },
|
|
|
|
|
table_titles => ['Contract Id', 'First Name', 'Last Name', 'Email'],
|
|
|
|
|
table_fields => ['contracts.id', 'firstname', 'lastname', 'email'],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
#has_field 'contract.id' => (
|
|
|
|
|
# type => '+NGCP::Panel::Field::DataTable',
|
|
|
|
|
@ -50,10 +71,10 @@ has_field 'save' => (
|
|
|
|
|
do_label => 0,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
has_field 'client_contract_id' => (
|
|
|
|
|
type => 'Hidden',
|
|
|
|
|
required => 1,
|
|
|
|
|
);
|
|
|
|
|
#has_field 'client_contract_id' => (
|
|
|
|
|
# type => 'Hidden',
|
|
|
|
|
# required => 1,
|
|
|
|
|
#);
|
|
|
|
|
|
|
|
|
|
has_block 'fields' => (
|
|
|
|
|
tag => 'div',
|
|
|
|
|
|