Permalink
Browse files

Don't autofill invoice sent and due fields

Also fix Vue warnings related to model binding.
  • Loading branch information...
lovett committed Jan 18, 2017
1 parent c47856d commit ed7b6d978fc69355ca2229817a62697ccca57b07
View
@@ -242,6 +242,8 @@ public function attachTime()
*/
public function toSuggestion()
{
$now = Carbon::now();
$suggestion = [
'previous' => [
'amount' => $this->amount,
@@ -254,7 +256,7 @@ public function toSuggestion()
'amount' => $this->amount,
'name' => $this->name,
'summary' => $this->summary,
'end' => TimeHelper::dateField(Carbon::now()),
'end' => TimeHelper::dateField($now),
// Suggested start is the next day after the previous end.
'start' => TimeHelper::dateField($this->end->addDay()),
],
@@ -4,7 +4,7 @@
@include('partials.error-alert')
<autofill inline-template url="{{ route('invoices.suggestByProject') }}" fields="start, end, name, summary, amount, sent, due">
<autofill inline-template url="{{ route('invoices.suggestByProject') }}" fields="start, end, name, summary, amount">
{!! Form::model($model, ['route' => $submission_route, 'method' => $submission_method, 'class' => 'invoice-form form-horizontal']) !!}
@@ -34,7 +34,7 @@
</div>
</div>
@include('partials.formgroup-date', ['name' => 'sent', 'label' => 'Sent', 'ranges' => TimeHelper::ranges(), 'autofill' => true])
@include('partials.formgroup-date', ['name' => 'sent', 'label' => 'Sent', 'ranges' => TimeHelper::ranges()])
@include('partials.formgroup-date', ['name' => 'due', 'label' => 'Due', 'ranges' => TimeHelper::ranges(), 'autofill' => true])
@@ -4,7 +4,7 @@
@endif
<div class="col-sm-10 {{ $label ? '' : 'col-sm-offset-2' }}">
{!! Form::text($name, TimeHelper::dateField($model->$name), ['class' => 'form-control', 'v-model' => 'pickResult']) !!}
{!! Form::text($name, TimeHelper::dateField($model->$name), ['class' => 'form-control']) !!}
@if (isset($autofill))
<autofill-hint target="INPUT[name={{ $name }}]" v-bind:value="suggested{{ ucfirst($name) }}" v-bind:previous="previous{{ ucfirst($name) }}"></autofill-hint>
@@ -4,7 +4,7 @@
@endif
<div class="col-sm-10 {{ $label ? '' : 'col-sm-offset-2' }}">
{!! Form::text($fieldName, TimeHelper::timeField($model->$name), ['class' => 'form-control', 'v-model' => 'pickResult']) !!}
{!! Form::text($fieldName, TimeHelper::timeField($model->$name), ['class' => 'form-control']) !!}
<pickable inline-template format="hh:mm AA" initial-value="{{ date('h:i A') }}" target="INPUT[name={{ $fieldName }}]">
<div>

0 comments on commit ed7b6d9

Please sign in to comment.