invoiceninja/resources/views/payments/edit.blade.php

103 lines
3 KiB
PHP
Raw Normal View History

2015-03-17 07:45:25 +10:00
@extends('header')
@section('head')
@parent
@include('money_script')
@stop
2015-03-17 07:45:25 +10:00
@section('content')
2015-03-31 20:42:37 +03:00
{!! Former::open($url)->addClass('col-md-10 col-md-offset-1 warn-on-exit')->method($method)->rules(array(
2015-03-17 07:45:25 +10:00
'client' => 'required',
'invoice' => 'required',
'amount' => 'required',
2015-03-31 20:42:37 +03:00
)) !!}
2015-03-17 07:45:25 +10:00
@if ($payment)
2015-04-06 10:28:43 +10:00
{!! Former::populate($payment) !!}
2015-03-17 07:45:25 +10:00
@endif
2015-04-20 17:34:23 +03:00
2015-10-28 21:22:07 +02:00
<span style="display:none">
{!! Former::text('public_id') !!}
</span>
2015-03-17 07:45:25 +10:00
<div class="row">
2015-04-22 22:21:04 +03:00
<div class="col-md-10 col-md-offset-1">
2015-04-20 17:34:23 +03:00
<div class="panel panel-default">
<div class="panel-body">
2015-03-17 07:45:25 +10:00
2015-05-09 21:25:16 +03:00
@if (!$payment)
2015-03-31 20:42:37 +03:00
{!! Former::select('client')->addOption('', '')->addGroupClass('client-select') !!}
{!! Former::select('invoice')->addOption('', '')->addGroupClass('invoice-select') !!}
{!! Former::text('amount') !!}
2015-11-04 09:48:47 +02:00
@if (isset($paymentTypeId) && $paymentTypeId)
{!! Former::populateField('payment_type_id', $paymentTypeId) !!}
@endif
2015-03-17 07:45:25 +10:00
@endif
2015-06-10 11:34:20 +03:00
@if (!$payment || !$payment->account_gateway_id)
2015-09-01 21:40:30 +03:00
{!! Former::select('payment_type_id')
->addOption('','')
->fromQuery($paymentTypes, 'name', 'id')
->addGroupClass('payment-type-select') !!}
2015-06-10 11:34:20 +03:00
@endif
2015-09-07 12:07:55 +03:00
{!! Former::text('payment_date')
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT))
->addGroupClass('payment_date')
->append('<i class="glyphicon glyphicon-calendar"></i>') !!}
2015-03-31 20:42:37 +03:00
{!! Former::text('transaction_reference') !!}
2015-03-17 07:45:25 +10:00
@if (!$payment)
{!! Former::checkbox('email_receipt')->label('&nbsp;')->text(trans('texts.email_receipt')) !!}
@endif
2015-04-20 17:34:23 +03:00
</div>
</div>
2015-03-17 07:45:25 +10:00
</div>
</div>
2015-04-20 17:34:23 +03:00
2015-03-17 07:45:25 +10:00
<center class="buttons">
2015-06-04 23:53:58 +03:00
{!! Button::normal(trans('texts.cancel'))->appendIcon(Icon::create('remove-circle'))->asLinkTo(URL::to('/payments'))->large() !!}
2015-03-31 20:42:37 +03:00
{!! Button::success(trans('texts.save'))->appendIcon(Icon::create('floppy-disk'))->submit()->large() !!}
2015-03-17 07:45:25 +10:00
</center>
2015-03-31 20:42:37 +03:00
{!! Former::close() !!}
2015-03-17 07:45:25 +10:00
<script type="text/javascript">
2015-03-31 20:42:37 +03:00
var invoices = {!! $invoices !!};
var clients = {!! $clients !!};
2015-03-17 07:45:25 +10:00
$(function() {
@if ($payment)
$('#payment_date').datepicker('update', '{{ $payment->payment_date }}')
@else
$('#payment_date').datepicker('update', new Date());
populateInvoiceComboboxes({{ $clientPublicId }}, {{ $invoicePublicId }});
@endif
$('#payment_type_id').combobox();
2015-05-10 22:02:35 +03:00
@if (!$payment && !$clientPublicId)
2015-05-09 21:25:16 +03:00
$('.client-select input.form-control').focus();
2015-05-10 22:02:35 +03:00
@elseif (!$payment && !$invoicePublicId)
2015-05-09 21:25:16 +03:00
$('.invoice-select input.form-control').focus();
@elseif (!$payment)
$('#amount').focus();
@endif
2015-09-07 12:07:55 +03:00
$('.payment_date .input-group-addon').click(function() {
toggleDatePicker('payment_date');
});
2015-03-17 07:45:25 +10:00
});
</script>
2015-05-09 21:25:16 +03:00
@stop