merge
This commit is contained in:
		| @@ -142,17 +142,20 @@ | ||||
|             </div> | ||||
|  | ||||
|             <div class="box-footer row no-print"> | ||||
|                 <div class="col-md-12"> | ||||
|                 <div class="col-md-10"> | ||||
|                     <a href="{{ url('incomes/invoices/' . $invoice->id . '/print') }}" target="_blank" class="btn btn-default"> | ||||
|                         <i class="fa fa-print"></i>  {{ trans('general.print') }} | ||||
|                     </a> | ||||
|                     <a href="{{ url('incomes/invoices/' . $invoice->id . '/pdf') }}" class="btn btn-default" data-toggle="tooltip" title="{{ trans('invoices.download_pdf') }}"> | ||||
|                         <i class="fa fa-file-pdf-o"></i>  {{ trans('general.download') }} | ||||
|                     </a> | ||||
|                 </div> | ||||
|  | ||||
|                 <div class="col-md-2 no-padding-right"> | ||||
|                     @if($invoice->invoice_status_code != 'paid') | ||||
|                         @if ($payment_methods) | ||||
|                         {!! Form::select('payment_method', $payment_methods, null, array_merge(['id' => 'payment-method', 'class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)])])) !!} | ||||
|                             {!! Form::select('payment_method', $payment_methods, null, array_merge(['id' => 'payment-method', 'class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)])])) !!} | ||||
|                             {!! Form::hidden('invoice_id', $invoice->id, []) !!} | ||||
|                         @else | ||||
|  | ||||
|                         @endif | ||||
| @@ -179,13 +182,15 @@ | ||||
|                     data: $('.box-footer input, .box-footer select'), | ||||
|                     headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' }, | ||||
|                     beforeSend: function() { | ||||
|                         $('#confirm').html(''); | ||||
|  | ||||
|                         $('#confirm').append('<div id="loading" class="text-center"><i class="fa fa-spinner fa-spin fa-5x checkout-spin"></i></div>'); | ||||
|                     }, | ||||
|                     complete: function() { | ||||
|                         $('#loading').remove(); | ||||
|                     }, | ||||
|                     success: function(data) { | ||||
|                         if (data['erorr']) { | ||||
|                         if (data['error']) { | ||||
|  | ||||
|                         } | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,17 @@ | ||||
|     {!! Form::open(['url' => 'expenses/bills', 'files' => true, 'role' => 'form']) !!} | ||||
|  | ||||
|     <div class="box-body"> | ||||
|         {{ Form::selectGroup('vendor_id', trans_choice('general.vendors', 1), 'user', $vendors) }} | ||||
|         <div class="form-group col-md-6 required {{ $errors->has('vendor_id') ? 'has-error' : ''}}"> | ||||
|             {!! Form::label('vendor_id', trans_choice('general.vendors', 1), ['class' => 'control-label']) !!} | ||||
|             <div class="input-group"> | ||||
|                 <div class="input-group-addon"><i class="fa fa-user"></i></div> | ||||
|                 {!! Form::select('vendor_id', $vendors, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.vendors', 1)])])) !!} | ||||
|                 <span class="input-group-btn"> | ||||
|                     <button type="button" onclick="createVendor();" class="btn btn-success">{{ trans('bills.create_vendor') }}</button> | ||||
|                 </span> | ||||
|             </div> | ||||
|             {!! $errors->first('vendor_id', '<p class="help-block">:message</p>') !!} | ||||
|         </div> | ||||
|  | ||||
|         {{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('general.default_currency')) }} | ||||
|  | ||||
| @@ -260,5 +270,112 @@ | ||||
|                 } | ||||
|             }); | ||||
|         } | ||||
|  | ||||
|         function createVendor() { | ||||
|             $('#modal-create-vendor').remove(); | ||||
|  | ||||
|             modal  = '<div class="modal fade" id="modal-create-vendor" style="display: none;">'; | ||||
|             modal += '  <div class="modal-dialog  modal-lg">'; | ||||
|             modal += '      <div class="modal-content">'; | ||||
|             modal += '          <div class="modal-header">'; | ||||
|             modal += '              <h4 class="modal-title">{{ trans('general.title.new', ['type' => trans_choice('general.vendors', 1)]) }}</h4>'; | ||||
|             modal += '          </div>'; | ||||
|             modal += '          <div class="modal-body">'; | ||||
|             modal += '              {!! Form::open(['id' => 'form-create-vendor', 'role' => 'form']) !!}'; | ||||
|             modal += '              <div class="row">'; | ||||
|             modal += '                  <div class="form-group col-md-6 required">'; | ||||
|             modal += '                      <label for="name" class="control-label">{{ trans('general.name') }}</label>'; | ||||
|             modal += '                      <div class="input-group">'; | ||||
|             modal += '                          <div class="input-group-addon"><i class="fa fa-id-card-o"></i></div>'; | ||||
|             modal += '                          <input class="form-control" placeholder="{{ trans('general.name') }}" required="required" name="name" type="text" id="name">'; | ||||
|             modal += '                      </div>'; | ||||
|             modal += '                  </div>'; | ||||
|             modal += '                  <div class="form-group col-md-6 required">'; | ||||
|             modal += '                      <label for="email" class="control-label">{{ trans('general.email') }}</label>'; | ||||
|             modal += '                      <div class="input-group">'; | ||||
|             modal += '                          <div class="input-group-addon"><i class="fa fa-envelope"></i></div>'; | ||||
|             modal += '                          <input class="form-control" placeholder="{{ trans('general.email') }}" required="required" name="email" type="text" id="email">'; | ||||
|             modal += '                      </div>'; | ||||
|             modal += '                  </div>'; | ||||
|             modal += '                  <div class="form-group col-md-6">'; | ||||
|             modal += '                      <label for="tax_number" class="control-label">{{ trans('general.tax_number') }}</label>'; | ||||
|             modal += '                      <div class="input-group">'; | ||||
|             modal += '                          <div class="input-group-addon"><i class="fa fa-percent"></i></div>'; | ||||
|             modal += '                          <input class="form-control" placeholder="{{ trans('general.tax_number') }}" name="tax_number" type="text" id="tax_number">'; | ||||
|             modal += '                      </div>'; | ||||
|             modal += '                  </div>'; | ||||
|             modal += '                  <div class="form-group col-md-6 required">'; | ||||
|             modal += '                      <label for="email" class="control-label">{{ trans_choice('general.currencies', 1) }}</label>'; | ||||
|             modal += '                      <div class="input-group">'; | ||||
|             modal += '                          <div class="input-group-addon"><i class="fa fa-exchange"></i></div>'; | ||||
|             modal += '                          <select class="form-control" required="required" id="currency_code" name="currency_code">'; | ||||
|             modal += '                              <option value="">{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}</option>'; | ||||
|             @foreach($currencies as $currency_code => $currency_name) | ||||
|             modal += '                              <option value="{{ $currency_code }}" {{ (setting('general.default_currency') == $currency_code) ? 'selected' : '' }}>{{ $currency_name }}</option>'; | ||||
|             @endforeach | ||||
|             modal += '                          </select>'; | ||||
|             modal += '                      </div>'; | ||||
|             modal += '                  </div>'; | ||||
|             modal += '                  <div class="form-group col-md-12">'; | ||||
|             modal += '                      <label for="address" class="control-label">{{ trans('general.address') }}</label>'; | ||||
|             modal += '                      <textarea class="form-control" placeholder="{{ trans('general.address') }}" rows="3" name="address" cols="50" id="address"></textarea>'; | ||||
|             modal += '                  </div>'; | ||||
|             modal += '                  {!! Form::hidden('enabled', '1', []) !!}'; | ||||
|             modal += '              </div>'; | ||||
|             modal += '              {!! Form::close() !!}'; | ||||
|             modal += '          </div>'; | ||||
|             modal += '          <div class="modal-footer">'; | ||||
|             modal += '              <div class="pull-left">'; | ||||
|             modal += '              {!! Form::button('<span class="fa fa-save"></span>  ' . trans('general.save'), ['type' => 'button', 'id' =>'button-create-vendor', 'class' => 'btn btn-success']) !!}'; | ||||
|             modal += '              <button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-times-circle"></span>  {{ trans('general.cancel') }}</button>'; | ||||
|             modal += '              </div>'; | ||||
|             modal += '          </div>'; | ||||
|             modal += '      </div>'; | ||||
|             modal += '  </div>'; | ||||
|             modal += '</div>'; | ||||
|  | ||||
|             $('body').append(modal); | ||||
|  | ||||
|             $("#modal-create-vendor #currency_code").select2({ | ||||
|                 placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}" | ||||
|             }); | ||||
|  | ||||
|             $('#modal-create-vendor').modal('show'); | ||||
|         } | ||||
|  | ||||
|         $(document).on('click', '#button-create-vendor', function (e) { | ||||
|             $.ajax({ | ||||
|                 url: '{{ url("expenses/vendors/vendor") }}', | ||||
|                 type: 'POST', | ||||
|                 dataType: 'JSON', | ||||
|                 data: $("#form-create-vendor").serialize(), | ||||
|                 beforeSend: function () { | ||||
|                     $(".form-group").removeClass("has-error"); | ||||
|                     $(".help-block").remove(); | ||||
|                 }, | ||||
|                 success: function(data) { | ||||
|                     $('#modal-create-vendor').modal('hide'); | ||||
|  | ||||
|                     $("#vendor_id").append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>'); | ||||
|                     $("#vendor_id").select2('refresh'); | ||||
|                 }, | ||||
|                 error: function(error, textStatus, errorThrown) { | ||||
|                     if (error.responseJSON.name) { | ||||
|                         $("input[name='name']").parent().parent().addClass('has-error'); | ||||
|                         $("input[name='name']").parent().after('<p class="help-block">' + error.responseJSON.name + '</p>'); | ||||
|                     } | ||||
|  | ||||
|                     if (error.responseJSON.email) { | ||||
|                         $("input[name='email']").parent().parent().addClass('has-error'); | ||||
|                         $("input[name='email']").parent().after('<p class="help-block">' + error.responseJSON.email + '</p>'); | ||||
|                     } | ||||
|  | ||||
|                     if (error.responseJSON.currency_code) { | ||||
|                         $("select[name='currency_code']").parent().parent().addClass('has-error'); | ||||
|                         $("select[name='currency_code']").parent().after('<p class="help-block">' + error.responseJSON.currency_code + '</p>'); | ||||
|                     } | ||||
|                 } | ||||
|             }); | ||||
|         }); | ||||
|     </script> | ||||
| @endpush | ||||
|   | ||||
| @@ -170,89 +170,91 @@ | ||||
|         </div> | ||||
|     </div> | ||||
|  | ||||
|     <div class="col-xs-6 no-padding-left"> | ||||
|         <div class="box box-default collapsed-box"> | ||||
|             <div class="box-header with-border"> | ||||
|                 <h3 class="box-title">{{ trans('bills.histories') }}</h3> | ||||
|     <div class="row"> | ||||
|         <div class="col-xs-6"> | ||||
|             <div class="box box-default collapsed-box"> | ||||
|                 <div class="box-header with-border"> | ||||
|                     <h3 class="box-title">{{ trans('bills.histories') }}</h3> | ||||
|  | ||||
|                 <div class="box-tools pull-right"> | ||||
|                     <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button> | ||||
|                     <div class="box-tools pull-right"> | ||||
|                         <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button> | ||||
|                     </div> | ||||
|                     <!-- /.box-tools --> | ||||
|                 </div> | ||||
|                 <!-- /.box-tools --> | ||||
|             </div> | ||||
|             <div class="box-body"> | ||||
|                 <div class="table-responsive"> | ||||
|                     <table class="table"> | ||||
|                         <thead> | ||||
|                         <tr> | ||||
|                             <th>{{ trans('general.date') }}</th> | ||||
|                             <th>{{ trans_choice('general.statuses', 1) }}</th> | ||||
|                             <th>{{ trans('general.description') }}</th> | ||||
|                         </tr> | ||||
|                         </thead> | ||||
|                         <tbody> | ||||
|                         @foreach($bill->histories as $history) | ||||
|                 <div class="box-body"> | ||||
|                     <div class="table-responsive"> | ||||
|                         <table class="table"> | ||||
|                             <thead> | ||||
|                             <tr> | ||||
|                                 <td>{{ Date::parse($bill->created_at)->format($date_format) }}</td> | ||||
|                                 <td>{{ $bill->status->name }}</td> | ||||
|                                 <td>{{ $bill->description }}</td> | ||||
|                                 <th>{{ trans('general.date') }}</th> | ||||
|                                 <th>{{ trans_choice('general.statuses', 1) }}</th> | ||||
|                                 <th>{{ trans('general.description') }}</th> | ||||
|                             </tr> | ||||
|                         @endforeach | ||||
|                         </tbody> | ||||
|                     </table> | ||||
|                             </thead> | ||||
|                             <tbody> | ||||
|                             @foreach($bill->histories as $history) | ||||
|                                 <tr> | ||||
|                                     <td>{{ Date::parse($bill->created_at)->format($date_format) }}</td> | ||||
|                                     <td>{{ $bill->status->name }}</td> | ||||
|                                     <td>{{ $bill->description }}</td> | ||||
|                                 </tr> | ||||
|                             @endforeach | ||||
|                             </tbody> | ||||
|                         </table> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|  | ||||
|     <div class="col-xs-6 no-padding-right"> | ||||
|         <div class="box box-default collapsed-box"> | ||||
|             <div class="box-header with-border"> | ||||
|                 <h3 class="box-title">{{ trans('bills.payments') }}</h3> | ||||
|         <div class="col-xs-6"> | ||||
|             <div class="box box-default collapsed-box"> | ||||
|                 <div class="box-header with-border"> | ||||
|                     <h3 class="box-title">{{ trans('bills.payments') }}</h3> | ||||
|  | ||||
|                 <div class="box-tools pull-right"> | ||||
|                     <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button> | ||||
|                     <div class="box-tools pull-right"> | ||||
|                         <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button> | ||||
|                     </div> | ||||
|                     <!-- /.box-tools --> | ||||
|                 </div> | ||||
|                 <!-- /.box-tools --> | ||||
|             </div> | ||||
|             <div class="box-body"> | ||||
|                 <div class="table-responsive"> | ||||
|                     <table class="table"> | ||||
|                         <thead> | ||||
|                         <tr> | ||||
|                             <th>{{ trans('general.date') }}</th> | ||||
|                             <th>{{ trans('general.amount') }}</th> | ||||
|                             <th>{{ trans_choice('general.accounts', 1) }}</th> | ||||
|                             <th style="width: 15%;">{{ trans('general.actions') }}</th> | ||||
|                         </tr> | ||||
|                         </thead> | ||||
|                         <tbody> | ||||
|                         @foreach($bill->payments as $payment) | ||||
|                 <div class="box-body"> | ||||
|                     <div class="table-responsive"> | ||||
|                         <table class="table"> | ||||
|                             <thead> | ||||
|                             <tr> | ||||
|                                 <td>{{ Date::parse($payment->paid_at)->format($date_format) }}</td> | ||||
|                                 <td>@money($payment->amount, $payment->currency_code, true)</td> | ||||
|                                 <td>{{ $payment->account->name }}</td> | ||||
|                                 <td> | ||||
|                                     <a href="{{ url('expenses/bills/' . $payment->id) }}" class="btn btn-info btn-xs hidden"><i class="fa fa-eye" aria-hidden="true"></i> {{ trans('general.show') }}</a> | ||||
|                                     <a href="{{ url('expenses/bills/' . $payment->id . '/edit') }}" class="btn btn-primary btn-xs  hidden"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {{ trans('general.edit') }}</a> | ||||
|                                     {!! Form::open([ | ||||
|                                         'id' => 'bill-payment-' . $payment->id, | ||||
|                                         'method' => 'DELETE', | ||||
|                                         'url' => ['expenses/bills/payment', $payment->id], | ||||
|                                         'style' => 'display:inline' | ||||
|                                     ]) !!} | ||||
|                                     {!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array( | ||||
|                                         'type'    => 'button', | ||||
|                                         'class'   => 'btn btn-danger btn-xs', | ||||
|                                         'title'   => trans('general.delete'), | ||||
|                                         'onclick' => 'confirmDelete("' . '#bill-payment-' . $payment->id . '", "' . trans_choice('general.payments', 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . Date::parse($payment->paid_at)->format($date_format) . ' - ' . money($payment->amount, $payment->currency_code, true) . ' - ' . $payment->account->name . '</strong>', 'type' => strtolower(trans_choice('general.revenues', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")' | ||||
|                                     )) !!} | ||||
|                                     {!! Form::close() !!} | ||||
|                                 </td> | ||||
|                                 <th>{{ trans('general.date') }}</th> | ||||
|                                 <th>{{ trans('general.amount') }}</th> | ||||
|                                 <th>{{ trans_choice('general.accounts', 1) }}</th> | ||||
|                                 <th style="width: 15%;">{{ trans('general.actions') }}</th> | ||||
|                             </tr> | ||||
|                         @endforeach | ||||
|                         </tbody> | ||||
|                     </table> | ||||
|                             </thead> | ||||
|                             <tbody> | ||||
|                             @foreach($bill->payments as $payment) | ||||
|                                 <tr> | ||||
|                                     <td>{{ Date::parse($payment->paid_at)->format($date_format) }}</td> | ||||
|                                     <td>@money($payment->amount, $payment->currency_code, true)</td> | ||||
|                                     <td>{{ $payment->account->name }}</td> | ||||
|                                     <td> | ||||
|                                         <a href="{{ url('expenses/bills/' . $payment->id) }}" class="btn btn-info btn-xs hidden"><i class="fa fa-eye" aria-hidden="true"></i> {{ trans('general.show') }}</a> | ||||
|                                         <a href="{{ url('expenses/bills/' . $payment->id . '/edit') }}" class="btn btn-primary btn-xs  hidden"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {{ trans('general.edit') }}</a> | ||||
|                                         {!! Form::open([ | ||||
|                                             'id' => 'bill-payment-' . $payment->id, | ||||
|                                             'method' => 'DELETE', | ||||
|                                             'url' => ['expenses/bills/payment', $payment->id], | ||||
|                                             'style' => 'display:inline' | ||||
|                                         ]) !!} | ||||
|                                         {!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array( | ||||
|                                             'type'    => 'button', | ||||
|                                             'class'   => 'btn btn-danger btn-xs', | ||||
|                                             'title'   => trans('general.delete'), | ||||
|                                             'onclick' => 'confirmDelete("' . '#bill-payment-' . $payment->id . '", "' . trans_choice('general.payments', 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . Date::parse($payment->paid_at)->format($date_format) . ' - ' . money($payment->amount, $payment->currency_code, true) . ' - ' . $payment->account->name . '</strong>', 'type' => strtolower(trans_choice('general.revenues', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")' | ||||
|                                         )) !!} | ||||
|                                         {!! Form::close() !!} | ||||
|                                     </td> | ||||
|                                 </tr> | ||||
|                             @endforeach | ||||
|                             </tbody> | ||||
|                         </table> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|   | ||||
| @@ -8,7 +8,17 @@ | ||||
|     {!! Form::open(['url' => 'incomes/invoices', 'files' => true, 'role' => 'form']) !!} | ||||
|  | ||||
|     <div class="box-body"> | ||||
|         {{ Form::selectGroup('customer_id', trans_choice('general.customers', 1), 'user', $customers) }} | ||||
|         <div class="form-group col-md-6 required {{ $errors->has('customer_id') ? 'has-error' : ''}}"> | ||||
|             {!! Form::label('customer_id', trans_choice('general.customers', 1), ['class' => 'control-label']) !!} | ||||
|             <div class="input-group"> | ||||
|                 <div class="input-group-addon"><i class="fa fa-user"></i></div> | ||||
|                 {!! Form::select('customer_id', $customers, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.customers', 1)])])) !!} | ||||
|                 <span class="input-group-btn"> | ||||
|                     <button type="button" onclick="createCustomer();" class="btn btn-success">{{ trans('invoices.create_customer') }}</button> | ||||
|                 </span> | ||||
|             </div> | ||||
|             {!! $errors->first('customer_id', '<p class="help-block">:message</p>') !!} | ||||
|         </div> | ||||
|  | ||||
|         {{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, setting('general.default_currency')) }} | ||||
|  | ||||
| @@ -261,5 +271,112 @@ | ||||
|                 } | ||||
|             }); | ||||
|         } | ||||
|  | ||||
|         function createCustomer() { | ||||
|             $('#modal-create-customer').remove(); | ||||
|  | ||||
|             modal  = '<div class="modal fade" id="modal-create-customer" style="display: none;">'; | ||||
|             modal += '  <div class="modal-dialog  modal-lg">'; | ||||
|             modal += '      <div class="modal-content">'; | ||||
|             modal += '          <div class="modal-header">'; | ||||
|             modal += '              <h4 class="modal-title">{{ trans('general.title.new', ['type' => trans_choice('general.customers', 1)]) }}</h4>'; | ||||
|             modal += '          </div>'; | ||||
|             modal += '          <div class="modal-body">'; | ||||
|             modal += '              {!! Form::open(['id' => 'form-create-customer', 'role' => 'form']) !!}'; | ||||
|             modal += '              <div class="row">'; | ||||
|             modal += '                  <div class="form-group col-md-6 required">'; | ||||
|             modal += '                      <label for="name" class="control-label">{{ trans('general.name') }}</label>'; | ||||
|             modal += '                      <div class="input-group">'; | ||||
|             modal += '                          <div class="input-group-addon"><i class="fa fa-id-card-o"></i></div>'; | ||||
|             modal += '                          <input class="form-control" placeholder="{{ trans('general.name') }}" required="required" name="name" type="text" id="name">'; | ||||
|             modal += '                      </div>'; | ||||
|             modal += '                  </div>'; | ||||
|             modal += '                  <div class="form-group col-md-6 required">'; | ||||
|             modal += '                      <label for="email" class="control-label">{{ trans('general.email') }}</label>'; | ||||
|             modal += '                      <div class="input-group">'; | ||||
|             modal += '                          <div class="input-group-addon"><i class="fa fa-envelope"></i></div>'; | ||||
|             modal += '                          <input class="form-control" placeholder="{{ trans('general.email') }}" required="required" name="email" type="text" id="email">'; | ||||
|             modal += '                      </div>'; | ||||
|             modal += '                  </div>'; | ||||
|             modal += '                  <div class="form-group col-md-6">'; | ||||
|             modal += '                      <label for="tax_number" class="control-label">{{ trans('general.tax_number') }}</label>'; | ||||
|             modal += '                      <div class="input-group">'; | ||||
|             modal += '                          <div class="input-group-addon"><i class="fa fa-percent"></i></div>'; | ||||
|             modal += '                          <input class="form-control" placeholder="{{ trans('general.tax_number') }}" name="tax_number" type="text" id="tax_number">'; | ||||
|             modal += '                      </div>'; | ||||
|             modal += '                  </div>'; | ||||
|             modal += '                  <div class="form-group col-md-6 required">'; | ||||
|             modal += '                      <label for="email" class="control-label">{{ trans_choice('general.currencies', 1) }}</label>'; | ||||
|             modal += '                      <div class="input-group">'; | ||||
|             modal += '                          <div class="input-group-addon"><i class="fa fa-exchange"></i></div>'; | ||||
|             modal += '                          <select class="form-control" required="required" id="currency_code" name="currency_code">'; | ||||
|             modal += '                              <option value="">{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}</option>'; | ||||
|             @foreach($currencies as $currency_code => $currency_name) | ||||
|             modal += '                              <option value="{{ $currency_code }}" {{ (setting('general.default_currency') == $currency_code) ? 'selected' : '' }}>{{ $currency_name }}</option>'; | ||||
|             @endforeach | ||||
|             modal += '                          </select>'; | ||||
|             modal += '                      </div>'; | ||||
|             modal += '                  </div>'; | ||||
|             modal += '                  <div class="form-group col-md-12">'; | ||||
|             modal += '                      <label for="address" class="control-label">{{ trans('general.address') }}</label>'; | ||||
|             modal += '                      <textarea class="form-control" placeholder="{{ trans('general.address') }}" rows="3" name="address" cols="50" id="address"></textarea>'; | ||||
|             modal += '                  </div>'; | ||||
|             modal += '                  {!! Form::hidden('enabled', '1', []) !!}'; | ||||
|             modal += '              </div>'; | ||||
|             modal += '              {!! Form::close() !!}'; | ||||
|             modal += '          </div>'; | ||||
|             modal += '          <div class="modal-footer">'; | ||||
|             modal += '              <div class="pull-left">'; | ||||
|             modal += '              {!! Form::button('<span class="fa fa-save"></span>  ' . trans('general.save'), ['type' => 'button', 'id' =>'button-create-customer', 'class' => 'btn btn-success']) !!}'; | ||||
|             modal += '              <button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-times-circle"></span>  {{ trans('general.cancel') }}</button>'; | ||||
|             modal += '              </div>'; | ||||
|             modal += '          </div>'; | ||||
|             modal += '      </div>'; | ||||
|             modal += '  </div>'; | ||||
|             modal += '</div>'; | ||||
|  | ||||
|             $('body').append(modal); | ||||
|  | ||||
|             $("#modal-create-customer #currency_code").select2({ | ||||
|                 placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.currencies', 1)]) }}" | ||||
|             }); | ||||
|  | ||||
|             $('#modal-create-customer').modal('show'); | ||||
|         } | ||||
|  | ||||
|         $(document).on('click', '#button-create-customer', function (e) { | ||||
|             $.ajax({ | ||||
|                 url: '{{ url("incomes/customers/customer") }}', | ||||
|                 type: 'POST', | ||||
|                 dataType: 'JSON', | ||||
|                 data: $("#form-create-customer").serialize(), | ||||
|                 beforeSend: function () { | ||||
|                     $(".form-group").removeClass("has-error"); | ||||
|                     $(".help-block").remove(); | ||||
|                 }, | ||||
|                 success: function(data) { | ||||
|                     $('#modal-create-customer').modal('hide'); | ||||
|  | ||||
|                     $("#customer_id").append('<option value="' + data.id + '" selected="selected">' + data.name + '</option>'); | ||||
|                     $("#customer_id").select2('refresh'); | ||||
|                 }, | ||||
|                 error: function(error, textStatus, errorThrown) { | ||||
|                     if (error.responseJSON.name) { | ||||
|                         $("input[name='name']").parent().parent().addClass('has-error'); | ||||
|                         $("input[name='name']").parent().after('<p class="help-block">' + error.responseJSON.name + '</p>'); | ||||
|                     } | ||||
|  | ||||
|                     if (error.responseJSON.email) { | ||||
|                         $("input[name='email']").parent().parent().addClass('has-error'); | ||||
|                         $("input[name='email']").parent().after('<p class="help-block">' + error.responseJSON.email + '</p>'); | ||||
|                     } | ||||
|  | ||||
|                     if (error.responseJSON.currency_code) { | ||||
|                         $("select[name='currency_code']").parent().parent().addClass('has-error'); | ||||
|                         $("select[name='currency_code']").parent().after('<p class="help-block">' + error.responseJSON.currency_code + '</p>'); | ||||
|                     } | ||||
|                 } | ||||
|             }); | ||||
|         }); | ||||
|     </script> | ||||
| @endpush | ||||
|   | ||||
| @@ -175,89 +175,91 @@ | ||||
|         </section> | ||||
|     </div> | ||||
|  | ||||
|     <div class="col-xs-6 no-padding-left"> | ||||
|         <div class="box box-default collapsed-box"> | ||||
|             <div class="box-header with-border"> | ||||
|                 <h3 class="box-title">{{ trans('invoices.histories') }}</h3> | ||||
|     <div class="row"> | ||||
|         <div class="col-xs-6"> | ||||
|             <div class="box box-default collapsed-box"> | ||||
|                 <div class="box-header with-border"> | ||||
|                     <h3 class="box-title">{{ trans('invoices.histories') }}</h3> | ||||
|  | ||||
|                 <div class="box-tools pull-right"> | ||||
|                     <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button> | ||||
|                     <div class="box-tools pull-right"> | ||||
|                         <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button> | ||||
|                     </div> | ||||
|                     <!-- /.box-tools --> | ||||
|                 </div> | ||||
|                 <!-- /.box-tools --> | ||||
|             </div> | ||||
|             <div class="box-body"> | ||||
|                 <div class="table-responsive"> | ||||
|                     <table class="table"> | ||||
|                         <thead> | ||||
|                         <tr> | ||||
|                             <th>{{ trans('general.date') }}</th> | ||||
|                             <th>{{ trans_choice('general.statuses', 1) }}</th> | ||||
|                             <th>{{ trans('general.description') }}</th> | ||||
|                         </tr> | ||||
|                         </thead> | ||||
|                         <tbody> | ||||
|                         @foreach($invoice->histories as $history) | ||||
|                 <div class="box-body"> | ||||
|                     <div class="table-responsive"> | ||||
|                         <table class="table"> | ||||
|                             <thead> | ||||
|                             <tr> | ||||
|                                 <td>{{ Date::parse($history->created_at)->format($date_format) }}</td> | ||||
|                                 <td>{{ $history->status->name }}</td> | ||||
|                                 <td>{{ $history->description }}</td> | ||||
|                                 <th>{{ trans('general.date') }}</th> | ||||
|                                 <th>{{ trans_choice('general.statuses', 1) }}</th> | ||||
|                                 <th>{{ trans('general.description') }}</th> | ||||
|                             </tr> | ||||
|                         @endforeach | ||||
|                         </tbody> | ||||
|                     </table> | ||||
|                             </thead> | ||||
|                             <tbody> | ||||
|                             @foreach($invoice->histories as $history) | ||||
|                                 <tr> | ||||
|                                     <td>{{ Date::parse($history->created_at)->format($date_format) }}</td> | ||||
|                                     <td>{{ $history->status->name }}</td> | ||||
|                                     <td>{{ $history->description }}</td> | ||||
|                                 </tr> | ||||
|                             @endforeach | ||||
|                             </tbody> | ||||
|                         </table> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
|  | ||||
|     <div class="col-xs-6 no-padding-right"> | ||||
|         <div class="box box-default collapsed-box"> | ||||
|             <div class="box-header with-border"> | ||||
|                 <h3 class="box-title">{{ trans('invoices.payments') }}</h3> | ||||
|         <div class="col-xs-6"> | ||||
|             <div class="box box-default collapsed-box"> | ||||
|                 <div class="box-header with-border"> | ||||
|                     <h3 class="box-title">{{ trans('invoices.payments') }}</h3> | ||||
|  | ||||
|                 <div class="box-tools pull-right"> | ||||
|                     <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button> | ||||
|                     <div class="box-tools pull-right"> | ||||
|                         <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button> | ||||
|                     </div> | ||||
|                     <!-- /.box-tools --> | ||||
|                 </div> | ||||
|                 <!-- /.box-tools --> | ||||
|             </div> | ||||
|             <div class="box-body"> | ||||
|                 <div class="table-responsive"> | ||||
|                     <table class="table"> | ||||
|                         <thead> | ||||
|                         <tr> | ||||
|                             <th>{{ trans('general.date') }}</th> | ||||
|                             <th>{{ trans('general.amount') }}</th> | ||||
|                             <th>{{ trans_choice('general.accounts', 1) }}</th> | ||||
|                             <th style="width: 15%;">{{ trans('general.actions') }}</th> | ||||
|                         </tr> | ||||
|                         </thead> | ||||
|                         <tbody> | ||||
|                         @foreach($invoice->payments as $payment) | ||||
|                 <div class="box-body"> | ||||
|                     <div class="table-responsive"> | ||||
|                         <table class="table"> | ||||
|                             <thead> | ||||
|                             <tr> | ||||
|                                 <td>{{ Date::parse($payment->paid_at)->format($date_format) }}</td> | ||||
|                                 <td>@money($payment->amount, $payment->currency_code, true)</td> | ||||
|                                 <td>{{ $payment->account->name }}</td> | ||||
|                                 <td> | ||||
|                                     <a href="{{ url('incomes/invoices/' . $payment->id . '') }}" class="btn btn-info btn-xs hidden"><i class="fa fa-eye" aria-hidden="true"></i> {{ trans('general.show') }}</a> | ||||
|                                     <a href="{{ url('incomes/revenues/' . $payment->id . '/edit') }}" class="btn btn-primary btn-xs  hidden"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {{ trans('general.edit') }}</a> | ||||
|                                     {!! Form::open([ | ||||
|                                         'id' => 'invoice-payment-' . $payment->id, | ||||
|                                         'method' => 'DELETE', | ||||
|                                         'url' => ['incomes/invoices/payment', $payment->id], | ||||
|                                         'style' => 'display:inline' | ||||
|                                     ]) !!} | ||||
|                                     {!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array( | ||||
|                                         'type'    => 'button', | ||||
|                                         'class'   => 'btn btn-danger btn-xs', | ||||
|                                         'title'   => trans('general.delete'), | ||||
|                                         'onclick' => 'confirmDelete("' . '#invoice-payment-' . $payment->id . '", "' . trans_choice('general.payments', 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . Date::parse($payment->paid_at)->format($date_format) . ' - ' . money($payment->amount, $payment->currency_code, true) . ' - ' . $payment->account->name . '</strong>', 'type' => strtolower(trans_choice('general.revenues', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")' | ||||
|                                     )) !!} | ||||
|                                     {!! Form::close() !!} | ||||
|                                 </td> | ||||
|                                 <th>{{ trans('general.date') }}</th> | ||||
|                                 <th>{{ trans('general.amount') }}</th> | ||||
|                                 <th>{{ trans_choice('general.accounts', 1) }}</th> | ||||
|                                 <th style="width: 15%;">{{ trans('general.actions') }}</th> | ||||
|                             </tr> | ||||
|                         @endforeach | ||||
|                         </tbody> | ||||
|                     </table> | ||||
|                             </thead> | ||||
|                             <tbody> | ||||
|                             @foreach($invoice->payments as $payment) | ||||
|                                 <tr> | ||||
|                                     <td>{{ Date::parse($payment->paid_at)->format($date_format) }}</td> | ||||
|                                     <td>@money($payment->amount, $payment->currency_code, true)</td> | ||||
|                                     <td>{{ $payment->account->name }}</td> | ||||
|                                     <td> | ||||
|                                         <a href="{{ url('incomes/invoices/' . $payment->id . '') }}" class="btn btn-info btn-xs hidden"><i class="fa fa-eye" aria-hidden="true"></i> {{ trans('general.show') }}</a> | ||||
|                                         <a href="{{ url('incomes/revenues/' . $payment->id . '/edit') }}" class="btn btn-primary btn-xs  hidden"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> {{ trans('general.edit') }}</a> | ||||
|                                         {!! Form::open([ | ||||
|                                             'id' => 'invoice-payment-' . $payment->id, | ||||
|                                             'method' => 'DELETE', | ||||
|                                             'url' => ['incomes/invoices/payment', $payment->id], | ||||
|                                             'style' => 'display:inline' | ||||
|                                         ]) !!} | ||||
|                                         {!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array( | ||||
|                                             'type'    => 'button', | ||||
|                                             'class'   => 'btn btn-danger btn-xs', | ||||
|                                             'title'   => trans('general.delete'), | ||||
|                                             'onclick' => 'confirmDelete("' . '#invoice-payment-' . $payment->id . '", "' . trans_choice('general.payments', 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . Date::parse($payment->paid_at)->format($date_format) . ' - ' . money($payment->amount, $payment->currency_code, true) . ' - ' . $payment->account->name . '</strong>', 'type' => strtolower(trans_choice('general.revenues', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")' | ||||
|                                         )) !!} | ||||
|                                         {!! Form::close() !!} | ||||
|                                     </td> | ||||
|                                 </tr> | ||||
|                             @endforeach | ||||
|                             </tbody> | ||||
|                         </table> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|   | ||||
| @@ -5,27 +5,29 @@ | ||||
| @section('content') | ||||
|     @include('partials.modules.bar') | ||||
|  | ||||
|     <div class="col-md-12 no-padding-left"> | ||||
|         <div class="content-header no-padding-left"> | ||||
|             <h3>{{ $title }}</h3> | ||||
|         </div> | ||||
|  | ||||
|         @if ($modules) | ||||
|             @foreach ($modules as $module) | ||||
|                 @include('partials.modules.item') | ||||
|             @endforeach | ||||
|         @else | ||||
|             <div class="box box-success"> | ||||
|                 <div class="box-body"> | ||||
|                     <p class="col-md-12" style="margin-top: 15px"> | ||||
|                         {{ trans('modules.no_apps') }} | ||||
|                     </p> | ||||
|                     <p class="col-md-12" style="margin-top: 20px"> | ||||
|                         <small>{!! trans('modules.developer') !!}</small> | ||||
|                     </p> | ||||
|                 </div> | ||||
|                 <!-- /.box-body --> | ||||
|     <div class="row"> | ||||
|         <div class="col-md-12"> | ||||
|             <div class="content-header no-padding-left"> | ||||
|                 <h3>{{ $title }}</h3> | ||||
|             </div> | ||||
|         @endif | ||||
|  | ||||
|             @if ($modules) | ||||
|                 @foreach ($modules as $module) | ||||
|                     @include('partials.modules.item') | ||||
|                 @endforeach | ||||
|             @else | ||||
|                 <div class="box box-success"> | ||||
|                     <div class="box-body"> | ||||
|                         <p class="col-md-12" style="margin-top: 15px"> | ||||
|                             {{ trans('modules.no_apps') }} | ||||
|                         </p> | ||||
|                         <p class="col-md-12" style="margin-top: 20px"> | ||||
|                             <small>{!! trans('modules.developer') !!}</small> | ||||
|                         </p> | ||||
|                     </div> | ||||
|                     <!-- /.box-body --> | ||||
|                 </div> | ||||
|             @endif | ||||
|         </div> | ||||
|     </div> | ||||
| @endsection | ||||
| @@ -19,19 +19,18 @@ | ||||
|         <link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/dist/css/skins/skin-green-light.min.css') }}"> | ||||
|     @else | ||||
|         <link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/dist/css/skins/skin-black.min.css') }}"> | ||||
|         <link rel="stylesheet" href="{{ asset('public/css/skin-black.css') }}"> | ||||
|         <link rel="stylesheet" href="{{ asset('public/css/skin-black.css?v=1.0') }}"> | ||||
|     @endif | ||||
|     <!-- Data Tables --> | ||||
|     <link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/datatables/dataTables.bootstrap.css') }}"> | ||||
|     <!-- App style --> | ||||
|     <link rel="stylesheet" href="{{ asset('public/css/app.css') }}"> | ||||
|     <link rel="stylesheet" href="{{ asset('public/css/akaunting-green.css') }}"> | ||||
|  | ||||
|     <!-- Select2 --> | ||||
|     <link rel="stylesheet" href="{{ asset('vendor/almasaeed2010/adminlte/plugins/select2/select2.min.css') }}"> | ||||
|     <!-- App style --> | ||||
|     <link rel="stylesheet" href="{{ asset('public/css/app.css?v=1.0') }}"> | ||||
|     <link rel="stylesheet" href="{{ asset('public/css/akaunting-green.css?v=1.0') }}"> | ||||
|      | ||||
|     <link rel="shortcut icon" href="{{ asset('public/img/favicon.ico') }}"> | ||||
|      | ||||
|  | ||||
|     @stack('css') | ||||
|  | ||||
|     @stack('stylesheet') | ||||
| @@ -60,7 +59,7 @@ | ||||
|     <!-- Select2 --> | ||||
|     <script src="{{ asset('vendor/almasaeed2010/adminlte/plugins/select2/select2.min.js') }}"></script> | ||||
|  | ||||
|     <script src="{{ asset('public/js/app.js') }}"></script> | ||||
|     <script src="{{ asset('public/js/app.js?v=1.0') }}"></script> | ||||
|  | ||||
|     <script type="text/javascript"><!-- | ||||
|         var url_search = '{{ url("search/search/search") }}'; | ||||
|   | ||||
| @@ -27,7 +27,7 @@ | ||||
|                         @endif | ||||
|                     </a> | ||||
|                     <ul class="dropdown-menu"> | ||||
|                         <li class="header">{{ trans_choice('header.notifications.counter', count($notifications), ['count' => count($notifications)]) }}</li> | ||||
|                         <li class="header">{{ trans_choice('header.notifications.counter', $notifications, ['count' => $notifications]) }}</li> | ||||
|                         <li> | ||||
|                             <!-- inner menu: contains the actual data --> | ||||
|                             <ul class="menu"> | ||||
|   | ||||
| @@ -1,17 +1,6 @@ | ||||
| <aside class="main-sidebar"> | ||||
|     <!-- sidebar: style can be found in sidebar.less --> | ||||
|     <section class="sidebar"> | ||||
|         <!-- Sidebar user panel --> | ||||
|         <div class="user-panel"> | ||||
|             @if ($customer->picture) | ||||
|             <div class="pull-left image"> | ||||
|                 <img src="{{ Storage::url($customer->picture) }}" class="img-circle" alt="{{ $customer->name }}"> | ||||
|             </div> | ||||
|             @endif | ||||
|             <div class="pull-left info"> | ||||
|                 <p>{{ $customer->name }}</p> | ||||
|             </div> | ||||
|         </div> | ||||
|         <!-- sidebar menu: : style can be found in sidebar.less --> | ||||
|         {!! Menu::get('CustomerMenu') !!} | ||||
|     </section> | ||||
|   | ||||
| @@ -1,6 +1,12 @@ | ||||
| <div class="pull-left" style="margin-top: 7px;"> | ||||
|     <small>{{ trans('pagination.showing', ['first' => $items->firstItem(), 'last' => $items->lastItem(), 'total' => $items->total(), 'type' => strtolower(trans_choice('general.' . $type, 2))]) }}</small> | ||||
| </div> | ||||
| <div class="pull-right"> | ||||
|     {!! $items->appends(request()->except('page'))->links() !!} | ||||
| </div> | ||||
| @if ($items->firstItem()) | ||||
|     <div class="pull-left" style="margin-top: 7px;"> | ||||
|         <small>{{ trans('pagination.showing', ['first' => $items->firstItem(), 'last' => $items->lastItem(), 'total' => $items->total(), 'type' => strtolower(trans_choice('general.' . $type, 2))]) }}</small> | ||||
|     </div> | ||||
|     <div class="pull-right"> | ||||
|         {!! $items->appends(request()->except('page'))->links() !!} | ||||
|     </div> | ||||
| @else | ||||
|     <div class="pull-left"> | ||||
|         <small>{{ trans('general.no_records') }}</small> | ||||
|     </div> | ||||
| @endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user