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
|
|
|
)); }}
|
|
|
|
|
|
|
|
@if ($credit)
|
|
|
|
{{ Former::populate($credit) }}
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-8">
|
|
|
|
|
|
|
|
@if ($credit)
|
|
|
|
{{ Former::legend('Edit Credit') }}
|
|
|
|
@else
|
|
|
|
{{ Former::legend('New Credit') }}
|
|
|
|
@endif
|
|
|
|
|
|
|
|
{{ Former::select('client')->fromQuery($clients, 'name', 'public_id')->select($client ? $client->public_id : '')->addOption('', '')->addGroupClass('client-select') }}
|
2013-12-29 18:40:11 +01:00
|
|
|
{{ Former::select('currency_id')->addOption('','')->label('Currency')
|
|
|
|
->fromQuery($currencies, 'name', 'id')->select(Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY)) }}
|
2013-12-05 16:23:24 +01:00
|
|
|
{{ Former::text('amount') }}
|
2013-12-25 22:34:42 +01:00
|
|
|
{{ Former::text('credit_date')->data_date_format(DEFAULT_DATE_PICKER_FORMAT) }}
|
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">
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
|
|
|
|
var $input = $('select#client');
|
|
|
|
$input.combobox();
|
2013-12-29 18:40:11 +01:00
|
|
|
$('#currency_id').combobox();
|
|
|
|
|
2013-12-05 16:23:24 +01:00
|
|
|
$('#credit_date').datepicker({
|
|
|
|
autoclose: true,
|
|
|
|
todayHighlight: true
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
@stop
|