Fix saving of fare #621 (#624)

This commit is contained in:
Nabeel S
2020-03-06 16:54:53 -05:00
committed by GitHub
parent 632c5782de
commit 2846a78d2a
13 changed files with 108 additions and 94 deletions

View File

@@ -25,9 +25,9 @@ $black-color: #333333 !default;
$black-hr: #444444 !default;
$white-background-color: #FFFFFF !default;
//$black-background-color: #212120 !default;
$black-background-color: #212120 !default;
//$black-background-color: #1a2932 !default;
$black-background-color: #0c1419 !default;
//$black-background-color: #0c1419 !default;
$light-gray: #E3E3E3 !default;
@@ -48,7 +48,7 @@ $default-bg: #FFFFFF !default;
$default-states-color: #403D39 !default;
//$primary-color: #7A9E9F !default;
$primary-color: #f96332 !default;
$primary-color: #067ec1 !default;
$primary-bg: darken($primary-color, 5%) !default;
$primary-states-color: #427C89 !default;

View File

@@ -1,84 +1,98 @@
<div class="row">
<div class="col-md-12">
<div class="callout callout-success">
When a fare is assigned to a subfleet, the price, cost and capacity can be overridden,
so you can create default values that will apply to most of your subfleets, and change
them where they will differ.
<div class="form-container">
<h6><i class="fas fa-info-circle"></i>
&nbsp;Fare Information
</h6>
<div class="form-container-body">
<div class="row">
<div class="col-md-12">
<div class="callout callout-success">
When a fare is assigned to a subfleet, the price, cost and capacity can be overridden,
so you can create default values that will apply to most of your subfleets, and change
them where they will differ.
</div>
<br/>
</div>
</div>
<br/>
</div>
</div>
<div class="row">
<div class="form-group col-sm-4">
{{ Form::label('code', 'Code:') }}&nbsp;<span class="required">*</span>
@component('admin.components.info')
How this fare class will show up on a ticket
@endcomponent
{{ Form::text('code', null, ['class' => 'form-control']) }}
<p class="text-danger">{{ $errors->first('code') }}</p>
</div>
<div class="row">
<div class="form-group col-sm-4">
{{ Form::label('code', 'Code:') }}&nbsp;<span class="required">*</span>
@component('admin.components.info')
How this fare class will show up on a ticket
@endcomponent
{{ Form::text('code', null, ['class' => 'form-control']) }}
<p class="text-danger">{{ $errors->first('code') }}</p>
</div>
<div class="form-group col-sm-4">
{{ Form::label('name', 'Name:') }}&nbsp;<span class="required">*</span>
@component('admin.components.info')
The fare class name, E.g, "Economy" or "First"
@endcomponent
{{ Form::text('name', null, ['class' => 'form-control']) }}
<p class="text-danger">{{ $errors->first('name') }}</p>
</div>
<div class="form-group col-sm-4">
{{ Form::label('name', 'Name:') }}&nbsp;<span class="required">*</span>
@component('admin.components.info')
The fare class name, E.g, "Economy" or "First"
@endcomponent
{{ Form::text('name', null, ['class' => 'form-control']) }}
<p class="text-danger">{{ $errors->first('name') }}</p>
</div>
<div class="form-group col-sm-4">
{{ Form::label('type', 'Fare Type:') }}&nbsp;<span class="required">*</span>
@component('admin.components.info')
If this is a passenger or cargo fare
@endcomponent
{{ Form::select('type', $fare_types, null , [
'id' => 'type',
'class' => 'form-control select2'
]) }}
<p class="text-danger">{{ $errors->first('type') }}</p>
</div>
<div class="form-group col-sm-4">
{{ Form::label('type', 'Fare Type:') }}&nbsp;<span class="required">*</span>
@component('admin.components.info')
If this is a passenger or cargo fare
@endcomponent
{{ Form::select('type', $fare_types, null , [
'id' => 'type',
'class' => 'form-control select2'
]) }}
<p class="text-danger">{{ $errors->first('type') }}</p>
</div>
</div>
<div class="row">
<div class="form-group col-sm-6">
{{ Form::label('price', 'Price:') }}
@component('admin.components.info')
This is the price of a ticket or price per {{ setting('units.weight') }}
@endcomponent
{{ Form::text('price', null, ['class' => 'form-control', 'placeholder' => 0]) }}
<p class="text-danger">{{ $errors->first('price') }}</p>
</div>
</div>
<div class="form-group col-sm-6">
{{ Form::label('cost', 'Cost:') }}
@component('admin.components.info')
The operating cost per unit (passenger or {{ setting('units.weight') }})
@endcomponent
{{ Form::number('cost', null, ['class' => 'form-control', 'placeholder' => 0, 'step' => '0.01']) }}
<p class="text-danger">{{ $errors->first('cost') }}</p>
</div>
</div>
<div class="row">
<div class="form-group col-sm-6">
{{ Form::label('capacity', 'Capacity:') }}
@component('admin.components.info')
Max seats or capacity available. This can be adjusted in the subfleet
@endcomponent
{{ Form::number('capacity', null, ['class' => 'form-control', 'min' => 0]) }}
<p class="text-danger">{{ $errors->first('capacity') }}</p>
</div>
<div class="form-container">
<h6><i class="fas fa-info-circle"></i>
&nbsp;Base Fare Finances
</h6>
<div class="form-container-body">
<div class="row">
<div class="form-group col-sm-6">
{{ Form::label('notes', 'Notes:') }}
@component('admin.components.info')
Notes for this fare
@endcomponent
{{ Form::text('notes', null, ['class' => 'form-control']) }}
<p class="text-danger">{{ $errors->first('notes') }}</p>
</div>
<div class="form-group col-sm-6">
{{ Form::label('price', 'Price:') }}
@component('admin.components.info')
This is the price of a ticket or price per {{ setting('units.weight') }}
@endcomponent
{{ Form::text('price', null, ['class' => 'form-control', 'placeholder' => 0]) }}
<p class="text-danger">{{ $errors->first('price') }}</p>
</div>
<div class="form-group col-sm-6">
{{ Form::label('cost', 'Cost:') }}
@component('admin.components.info')
The operating cost per unit (passenger or {{ setting('units.weight') }})
@endcomponent
{{ Form::number('cost', null, ['class' => 'form-control', 'placeholder' => 0, 'step' => '0.01']) }}
<p class="text-danger">{{ $errors->first('cost') }}</p>
</div>
</div>
<div class="row">
<div class="form-group col-sm-6">
{{ Form::label('capacity', 'Capacity:') }}
@component('admin.components.info')
Max seats or capacity available. This can be adjusted in the subfleet
@endcomponent
{{ Form::number('capacity', null, ['class' => 'form-control', 'min' => 0]) }}
<p class="text-danger">{{ $errors->first('capacity') }}</p>
</div>
<div class="form-group col-sm-6">
{{ Form::label('notes', 'Notes:') }}
@component('admin.components.info')
Notes for this fare
@endcomponent
{{ Form::text('notes', null, ['class' => 'form-control']) }}
<p class="text-danger">{{ $errors->first('notes') }}</p>
</div>
</div>
</div>
</div>
<div class="row">
<!-- Active Field -->
@@ -94,8 +108,7 @@
<!-- Submit Field -->
<div class="form-group col-sm-12">
<div class="pull-right">
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }}
<a href="{{ route('admin.fares.index') }}" class="btn btn-warn">Cancel</a>
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-info']) }}
</div>
</div>
</div>

View File

@@ -2,6 +2,7 @@
<thead>
<th>Code</th>
<th>Name</th>
<th>Type</th>
<th>Price</th>
<th>Cost</th>
<th>Notes</th>
@@ -13,6 +14,7 @@
<tr>
<td><a href="{{ route('admin.fares.edit', [$fare->id]) }}">{{ $fare->code }}</a></td>
<td>{{ $fare->name }}</td>
<td>{{ \App\Models\Enums\FareType::label($fare->type) }}</td>
<td>{{ $fare->price }}</td>
<td>{{ $fare->cost }}</td>
<td>{{ $fare->notes }}</td>

View File

@@ -277,8 +277,7 @@
</div>
<div class="col-8">
<div class="text-right">
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }}
<a href="{{ route('admin.flights.index') }}" class="btn btn-default">Cancel</a>
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-info']) }}
</div>
</div>
</div>

View File

@@ -266,8 +266,7 @@
<div class="row">
<div class="form-group col-sm-12">
<div class="pull-right">
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }}
<a href="{{ route('admin.pireps.index') }}" class="btn btn-warn">Cancel</a>
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-info']) }}
</div>
</div>
</div>