MT#5879 Default for datepicker

ipeshinskaya/InvoiceTemplate5
Irina Peshinskaya 11 years ago committed by Victor Seva
parent 4a1b5c005e
commit b6361e6cf3

@ -32,14 +32,14 @@ has_field 'submitid' => ( type => 'Hidden' );
has_field 'start' => (
type => '+NGCP::Panel::Field::DatePicker',
label => 'Start Date',
default => NGCP::Panel::Utils::DateTime::current_local()->truncate(to => 'month'),
default => NGCP::Panel::Utils::DateTime::current_local()->truncate(to => 'month')->ymd,
required => 1,
);
has_field 'end' => (
type => '+NGCP::Panel::Field::DatePicker',
label => 'End Date',
default => NGCP::Panel::Utils::DateTime::current_local()->truncate(to => 'month')->add( months => 1)->subtract(seconds=>1)->truncate(to=>'day'),
default => NGCP::Panel::Utils::DateTime::current_local()->truncate(to => 'month')->add( months => 1)->subtract(seconds=>1)->ymd,
required => 1,
);

@ -3,7 +3,7 @@
[% date_format_js = date_format_js || 'yy-mm-dd' %]
<label class="control-label" for="[% field_id %]">[% label %]</label>
<div class="controls">
<input type="text" name="[% field_name %]" id="[% field_id %]" class="ngcp-datepicker" rel="tooltip" data-original-title="[% date_format_js %]" onclick="
<input type="text" name="[% field_name %]" id="[% field_id %]" value="[%value%]" class="ngcp-datepicker" rel="tooltip" data-original-title="[% date_format_js %]" onclick="
$(this).datepicker({
'dateFormat': '[% date_format_js %]',
});$(this).datepicker('show');"/>

@ -90,8 +90,21 @@ function applyClientFilter(table,tr,contact_id){
{ name => 'contracts.status', title => c.loc('Status'), search => 1 },
];
helper.dt_buttons = [
{ name => c.loc('Generate invoice'), uri => 'javascript:void(0);', onclick => "fetch_into(\\'invoice_generate_form\\', \\'" _ c.uri_for_action('/invoice/invoice_generate', [ provider.id]) _ "\\',\\'item=invoice_generate&client_contract_id='+full.contracts_id+'\\',function(){modalFormScript();});void(0);", class => 'btn-small btn-primary', icon => 'icon-star' },
{ name => c.loc('Filter invoices'), uri=>'javascript:void(0);', onclick => "applyClientFilter(\\'\\',\$(this).closest(\\'tr\\'),'+full.id+');", class => 'btn-small btn-primary', icon => 'icon-glass', tooltip => 'Click twice to clear client filter.' },
{
name => c.loc('Generate invoice'),
uri => 'javascript:void(0);',
onclick => "fetch_into(\\'invoice_generate_form\\', \\'" _ c.uri_for_action('/invoice/invoice_generate', [ provider.id]) _ "\\',\\'item=invoice_generate&client_contract_id='+full.contracts_id+'\\',function(){modalFormScript();});void(0);",
class => 'btn-small btn-primary',
icon => 'icon-star'
},
{
name => c.loc('Filter invoices'),
uri=>'javascript:void(0);',
onclick => "applyClientFilter(\\'\\',\$(this).closest(\\'tr\\'),'+full.id+');",
class => 'btn-small btn-primary',
icon => 'icon-glass',
tooltip => 'Click twice to clear client filter.'
},
];
helper.identifier = 'provider_client_list_ajax';
helper.ajax_uri = c.uri_for_action( '/invoice/ajax_datatables_data', [ provider.id, 'provider_client_list' ] ) ;

Loading…
Cancel
Save