2013-12-05 16:23:24 +01:00
|
|
|
@extends('header')
|
|
|
|
|
|
|
|
|
|
|
|
@section('onReady')
|
|
|
|
$('input#name').focus();
|
|
|
|
@stop
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
|
|
|
|
|
|
|
{{ Former::open($url)->addClass('col-md-10 col-md-offset-1 main_form')->method($method)->rules(array(
|
2013-12-08 14:32:49 +01:00
|
|
|
'client' => 'required',
|
|
|
|
'amount' => 'required',
|
2013-12-05 16:23:24 +01:00
|
|
|
)); }}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-8">
|
|
|
|
|
2013-12-30 21:17:45 +01:00
|
|
|
{{ Former::select('client')->addOption('', '')->addGroupClass('client-select') }}
|
2013-12-05 16:23:24 +01:00
|
|
|
{{ Former::text('amount') }}
|
2014-01-01 00:50:13 +01:00
|
|
|
{{ Former::text('credit_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT)) }}
|
2014-01-15 15:01:24 +01:00
|
|
|
{{-- Former::select('currency_id')->addOption('','')->label('Currency')
|
|
|
|
->fromQuery($currencies, 'name', 'id')->select(Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY)) --}}
|
|
|
|
{{ Former::textarea('private_notes') }}
|
2013-12-05 16:23:24 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<center style="margin-top:16px">
|
|
|
|
{{ Button::lg_primary_submit('Save') }} |
|
|
|
|
{{ link_to('credits/' . ($credit ? $credit->public_id : ''), 'Cancel') }}
|
|
|
|
</center>
|
|
|
|
|
|
|
|
{{ Former::close() }}
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
2014-01-02 09:27:48 +01:00
|
|
|
|
2013-12-30 21:17:45 +01:00
|
|
|
var clients = {{ $clients }};
|
|
|
|
|
2013-12-05 16:23:24 +01:00
|
|
|
$(function() {
|
|
|
|
|
2014-01-16 22:12:46 +01:00
|
|
|
var $clientSelect = $('select#client');
|
|
|
|
for (var i=0; i<clients.length; i++) {
|
|
|
|
var client = clients[i];
|
|
|
|
$clientSelect.append(new Option(getClientDisplayName(client), client.public_id));
|
|
|
|
}
|
|
|
|
|
|
|
|
if ({{ $clientPublicId ? 'true' : 'false' }}) {
|
|
|
|
$clientSelect.val({{ $clientPublicId }});
|
|
|
|
}
|
|
|
|
|
|
|
|
$clientSelect.combobox();
|
|
|
|
|
2014-01-02 09:27:48 +01:00
|
|
|
|
2013-12-30 21:17:45 +01:00
|
|
|
|
2013-12-29 18:40:11 +01:00
|
|
|
$('#currency_id').combobox();
|
|
|
|
|
2014-01-02 14:21:15 +01:00
|
|
|
$('#credit_date').datepicker('update', new Date({{ strtotime(Utils::today()) * 1000 }}));
|
2013-12-05 16:23:24 +01:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
@stop
|