first commit
This commit is contained in:
		
							
								
								
									
										105
									
								
								resources/views/incomes/revenues/create.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										105
									
								
								resources/views/incomes/revenues/create.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,105 @@
 | 
			
		||||
@extends('layouts.admin')
 | 
			
		||||
 | 
			
		||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.revenues', 1)]))
 | 
			
		||||
 | 
			
		||||
@section('content')
 | 
			
		||||
<!-- Default box -->
 | 
			
		||||
<div class="box box-success">
 | 
			
		||||
    {!! Form::open(['url' => 'incomes/revenues', 'files' => true, 'role' => 'form']) !!}
 | 
			
		||||
 | 
			
		||||
    <div class="box-body">
 | 
			
		||||
        {{ Form::textGroup('paid_at', trans('general.date'), 'calendar',['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => ''], Date::now()->toDateString()) }}
 | 
			
		||||
 | 
			
		||||
        {{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
 | 
			
		||||
 | 
			
		||||
        {{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('general.accounts', 1)) }}
 | 
			
		||||
 | 
			
		||||
        <div class="form-group col-md-6 {{ $errors->has('currency_code') ? 'has-error' : ''}}">
 | 
			
		||||
            {!! Form::label('currency_code', trans_choice('general.currencies', 1), ['class' => 'control-label']) !!}
 | 
			
		||||
            <div class="input-group">
 | 
			
		||||
                <div class="input-group-addon"><i class="fa fa-exchange"></i></div>
 | 
			
		||||
                {!! Form::text('currency', $currencies[$account_currency_code], ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
 | 
			
		||||
                {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
 | 
			
		||||
            </div>
 | 
			
		||||
            {!! $errors->first('currency_code', '<p class="help-block">:message</p>') !!}
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        {{ Form::textareaGroup('description', trans('general.description')) }}
 | 
			
		||||
 | 
			
		||||
        {{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder-open-o', $categories) }}
 | 
			
		||||
 | 
			
		||||
        {{ Form::selectGroup('customer_id', trans_choice('general.customers', 1), 'user', $customers, null, []) }}
 | 
			
		||||
 | 
			
		||||
        {{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('general.default_payment_method')) }}
 | 
			
		||||
 | 
			
		||||
        {{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
 | 
			
		||||
 | 
			
		||||
        {{ Form::fileGroup('attachment', trans('general.attachment')) }}
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- /.box-body -->
 | 
			
		||||
 | 
			
		||||
    <div class="box-footer">
 | 
			
		||||
        {{ Form::saveButtons('incomes/revenues') }}
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- /.box-footer -->
 | 
			
		||||
 | 
			
		||||
    {!! Form::close() !!}
 | 
			
		||||
</div>
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@section('js')
 | 
			
		||||
    <script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
 | 
			
		||||
    <script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@section('css')
 | 
			
		||||
    <link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
 | 
			
		||||
    <link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@section('scripts')
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
        $(document).ready(function(){
 | 
			
		||||
            //Date picker
 | 
			
		||||
            $('#paid_at').datepicker({
 | 
			
		||||
                format: 'yyyy-mm-dd',
 | 
			
		||||
                autoclose: true
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $("#account_id").select2({
 | 
			
		||||
                placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $("#category_id").select2({
 | 
			
		||||
                placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $("#customer_id").select2({
 | 
			
		||||
                placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)]) }}"
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $("#payment_method").select2({
 | 
			
		||||
                placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)]) }}"
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $('#attachment').fancyfile({
 | 
			
		||||
                text  : '{{ trans('general.form.select.file') }}',
 | 
			
		||||
                style : 'btn-default',
 | 
			
		||||
                placeholder : '{{ trans('general.form.no_file_selected') }}'
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $(document).on('change', '#account_id', function (e) {
 | 
			
		||||
                $.ajax({
 | 
			
		||||
                    url: '{{ url("settings/currencies/currency") }}',
 | 
			
		||||
                    type: 'GET',
 | 
			
		||||
                    dataType: 'JSON',
 | 
			
		||||
                    data: 'account_id=' + $(this).val(),
 | 
			
		||||
                    success: function(data) {
 | 
			
		||||
                        $('#currency').val(data.currency_name);
 | 
			
		||||
                        $('#currency_code').val(data.currency_code);
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    </script>
 | 
			
		||||
@endsection
 | 
			
		||||
							
								
								
									
										112
									
								
								resources/views/incomes/revenues/edit.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										112
									
								
								resources/views/incomes/revenues/edit.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,112 @@
 | 
			
		||||
@extends('layouts.admin')
 | 
			
		||||
 | 
			
		||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.revenues', 1)]))
 | 
			
		||||
 | 
			
		||||
@section('content')
 | 
			
		||||
    <!-- Default box -->
 | 
			
		||||
    <div class="box box-success">
 | 
			
		||||
        {!! Form::model($revenue, [
 | 
			
		||||
            'method' => 'PATCH',
 | 
			
		||||
            'files' => true,
 | 
			
		||||
            'url' => ['incomes/revenues', $revenue->id],
 | 
			
		||||
            'role' => 'form'
 | 
			
		||||
        ]) !!}
 | 
			
		||||
 | 
			
		||||
        <div class="box-body">
 | 
			
		||||
            {{ Form::textGroup('paid_at', trans('general.date'), 'calendar',['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => ''],Date::now()->toDateString()) }}
 | 
			
		||||
 | 
			
		||||
            {{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
 | 
			
		||||
 | 
			
		||||
            {{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('general.accounts', 1)) }}
 | 
			
		||||
 | 
			
		||||
            <div class="form-group col-md-6 {{ $errors->has('currency_code') ? 'has-error' : ''}}">
 | 
			
		||||
                {!! Form::label('currency_code', trans_choice('general.currencies', 1), ['class' => 'control-label']) !!}
 | 
			
		||||
                <div class="input-group">
 | 
			
		||||
                    <div class="input-group-addon"><i class="fa fa-exchange"></i></div>
 | 
			
		||||
                    {!! Form::text('currency', $currencies[$account_currency_code], ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
 | 
			
		||||
                    {!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
 | 
			
		||||
                </div>
 | 
			
		||||
                {!! $errors->first('currency_code', '<p class="help-block">:message</p>') !!}
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            {{ Form::textareaGroup('description', trans('general.description')) }}
 | 
			
		||||
 | 
			
		||||
            {{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder-open-o', $categories) }}
 | 
			
		||||
 | 
			
		||||
            {{ Form::selectGroup('customer_id', trans_choice('general.customers', 1), 'user', $customers, null, []) }}
 | 
			
		||||
 | 
			
		||||
            {{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, null) }}
 | 
			
		||||
 | 
			
		||||
            {{ Form::textGroup('reference', trans('general.reference'), 'file-text-o',[]) }}
 | 
			
		||||
 | 
			
		||||
            {{ Form::fileGroup('attachment', trans('general.attachment')) }}
 | 
			
		||||
        </div>
 | 
			
		||||
        <!-- /.box-body -->
 | 
			
		||||
 | 
			
		||||
        @permission('update-incomes-revenues')
 | 
			
		||||
        <div class="box-footer">
 | 
			
		||||
            {{ Form::saveButtons('incomes/revenues') }}
 | 
			
		||||
        </div>
 | 
			
		||||
        <!-- /.box-footer -->
 | 
			
		||||
        @endpermission
 | 
			
		||||
 | 
			
		||||
        {!! Form::close() !!}
 | 
			
		||||
    </div>
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@section('js')
 | 
			
		||||
    <script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/bootstrap-datepicker.js') }}"></script>
 | 
			
		||||
    <script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@section('css')
 | 
			
		||||
    <link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datepicker/datepicker3.css') }}">
 | 
			
		||||
    <link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@section('scripts')
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
        $(document).ready(function(){
 | 
			
		||||
            //Date picker
 | 
			
		||||
            $('#paid_at').datepicker({
 | 
			
		||||
                format: 'yyyy-mm-dd',
 | 
			
		||||
                autoclose: true
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $("#account_id").select2({
 | 
			
		||||
                placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)]) }}"
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $("#category_id").select2({
 | 
			
		||||
                placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.categories', 1)]) }}"
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $("#customer_id").select2({
 | 
			
		||||
                placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)]) }}"
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $("#payment_method").select2({
 | 
			
		||||
                placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)]) }}"
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $('#attachment').fancyfile({
 | 
			
		||||
                text  : '{{ trans('general.form.select.file') }}',
 | 
			
		||||
                style : 'btn-default',
 | 
			
		||||
                placeholder : '<?php echo $revenue->attachment; ?>'
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            $(document).on('change', '#account_id', function (e) {
 | 
			
		||||
                $.ajax({
 | 
			
		||||
                    url: '{{ url("settings/currencies/currency") }}',
 | 
			
		||||
                    type: 'GET',
 | 
			
		||||
                    dataType: 'JSON',
 | 
			
		||||
                    data: 'account_id=' + $(this).val(),
 | 
			
		||||
                    success: function(data) {
 | 
			
		||||
                        $('#currency').val(data.currency_name);
 | 
			
		||||
                        $('#currency_code').val(data.currency_code);
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
        });
 | 
			
		||||
    </script>
 | 
			
		||||
@endsection
 | 
			
		||||
							
								
								
									
										72
									
								
								resources/views/incomes/revenues/index.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								resources/views/incomes/revenues/index.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,72 @@
 | 
			
		||||
@extends('layouts.admin')
 | 
			
		||||
 | 
			
		||||
@section('title', trans_choice('general.revenues', 2))
 | 
			
		||||
 | 
			
		||||
@permission('create-incomes-revenues')
 | 
			
		||||
@section('new_button')
 | 
			
		||||
<span class="new-button"><a href="{{ url('incomes/revenues/create') }}" class="btn btn-success btn-sm"><span class="fa fa-plus"></span>  {{ trans('general.add_new') }}</a></span>
 | 
			
		||||
@endsection
 | 
			
		||||
@endpermission
 | 
			
		||||
 | 
			
		||||
@section('content')
 | 
			
		||||
<!-- Default box -->
 | 
			
		||||
<div class="box box-success">
 | 
			
		||||
    <div class="box-header">
 | 
			
		||||
        {!! Form::open(['url' => 'incomes/revenues', 'role' => 'form', 'method' => 'GET']) !!}
 | 
			
		||||
        <div class="pull-left">
 | 
			
		||||
            <span class="title-filter">{{ trans('general.search') }}:</span>
 | 
			
		||||
            {!! Form::select('customer', $customers, request('customer'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('customers.all')]) !!}
 | 
			
		||||
            {!! Form::select('category', $categories, request('category'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('categories.all')]) !!}
 | 
			
		||||
            {!! Form::select('account', $accounts, request('account'), ['class' => 'form-control input-filter input-sm', 'placeholder' => trans('accounts.all')]) !!}
 | 
			
		||||
            {!! Form::button('<span class="fa fa-filter"></span>  ' . trans('general.filter'), ['type' => 'submit', 'class' => 'btn btn-sm btn-default btn-filter']) !!}
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="pull-right">
 | 
			
		||||
            <span class="title-filter">{{ trans('general.show') }}:</span>
 | 
			
		||||
            {!! Form::select('limit', $limits, request('limit', setting('general.list_limit', '25')), ['class' => 'form-control input-filter input-sm', 'onchange' => 'this.form.submit()']) !!}
 | 
			
		||||
        </div>
 | 
			
		||||
        {!! Form::close() !!}
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- /.box-header -->
 | 
			
		||||
    <div class="box-body">
 | 
			
		||||
        <div class="table table-responsive">
 | 
			
		||||
            <table class="table table-bordered table-striped table-hover" id="tbl-revenues">
 | 
			
		||||
                <thead>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <th>@sortablelink('paid_at', trans('general.date'))</th>
 | 
			
		||||
                        <th>@sortablelink('amount', trans('general.amount'))</th>
 | 
			
		||||
                        <th>@sortablelink('customer.name', trans_choice('general.customers', 1))</th>
 | 
			
		||||
                        <th>@sortablelink('category.name', trans_choice('general.categories', 1))</th>
 | 
			
		||||
                        <th>@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
 | 
			
		||||
                        <th style="width: 15%;">{{ trans('general.actions') }}</th>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                </thead>
 | 
			
		||||
                <tbody>
 | 
			
		||||
                @foreach($revenues as $item)
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td><a href="{{ url('incomes/revenues/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
 | 
			
		||||
                        <td>@money($item->amount, $item->currency_code, true)</td>
 | 
			
		||||
                        <td>{{ !empty($item->customer->name) ? $item->customer->name : 'N/A'}}</td>
 | 
			
		||||
                        <td>{{ $item->category->name }}</td>
 | 
			
		||||
                        <td>{{ $item->account->name }}</td>
 | 
			
		||||
                        <td>
 | 
			
		||||
                            <a href="{{ url('incomes/revenues/' . $item->id . '/edit') }}" class="btn btn-primary btn-xs"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {{ trans('general.edit') }}</a>
 | 
			
		||||
                            @permission('delete-incomes-revenues')
 | 
			
		||||
                            {!! Form::deleteButton($item, 'incomes/revenues') !!}
 | 
			
		||||
                            @endpermission
 | 
			
		||||
                        </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                @endforeach
 | 
			
		||||
                </tbody>
 | 
			
		||||
            </table>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- /.box-body -->
 | 
			
		||||
 | 
			
		||||
    <div class="box-footer">
 | 
			
		||||
        @include('partials.admin.pagination', ['items' => $revenues, 'type' => 'revenues'])
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- /.box-footer -->
 | 
			
		||||
</div>
 | 
			
		||||
<!-- /.box -->
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user