1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/resources/views/payments/edit.blade.php

97 lines
2.9 KiB
PHP
Raw Normal View History

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