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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 108 additions and 94 deletions

View File

@ -22,6 +22,7 @@ class Fare extends Model
protected $fillable = [
'code',
'name',
'type',
'price',
'cost',
'capacity',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,14 +1,14 @@
{
"/assets/frontend/js/app.js": "/assets/frontend/js/app.js?id=ccb02e6ada8be5b91964",
"/assets/frontend/css/now-ui-kit.css": "/assets/frontend/css/now-ui-kit.css?id=20b82d8dbacf7e058df2",
"/assets/admin/css/vendor.min.css": "/assets/admin/css/vendor.min.css?id=9f24c5e6612e74065901",
"/assets/frontend/js/app.js.map": "/assets/frontend/js/app.js.map?id=e6c5ea104bd4a4998fe5",
"/assets/admin/css/vendor.min.css": "/assets/admin/css/vendor.min.css?id=f061660f5c4070d3d0ff",
"/assets/frontend/js/app.js.map": "/assets/frontend/js/app.js.map?id=576b33c9aa533da9b6a3",
"/assets/frontend/css/now-ui-kit.css.map": "/assets/frontend/css/now-ui-kit.css.map?id=fdc4f42ad9047d073145",
"/assets/admin/css/vendor.min.css.map": "/assets/admin/css/vendor.min.css.map?id=c266c31652dea865307c",
"/assets/admin/css/vendor.min.css.map": "/assets/admin/css/vendor.min.css.map?id=bbc90660cdfd2b9b9009",
"/assets/admin/js/app.js": "/assets/admin/js/app.js?id=53dbfe0b2d69322a270a",
"/assets/admin/js/app.js.map": "/assets/admin/js/app.js.map?id=ecc14ecd8c9f04ff4645",
"/assets/admin/js/app.js.map": "/assets/admin/js/app.js.map?id=c28b2b55cdafc2a5b414",
"/assets/installer/js/app.js": "/assets/installer/js/app.js?id=62e02c2328c69e0bb6fb",
"/assets/installer/js/app.js.map": "/assets/installer/js/app.js.map?id=e05cf0c11d7387d5215e",
"/assets/installer/js/app.js.map": "/assets/installer/js/app.js.map?id=7bda13b284c53f56ff4a",
"/assets/fonts/glyphicons-halflings-regular.woff2": "/assets/fonts/glyphicons-halflings-regular.woff2?id=349344e92fb16221dd56",
"/assets/admin/fonts/glyphicons-halflings-regular.woff2": "/assets/admin/fonts/glyphicons-halflings-regular.woff2?id=349344e92fb16221dd56",
"/assets/admin/img/clear.png": "/assets/admin/img/clear.png?id=63b3af84650a0145d61a",
@ -17,7 +17,7 @@
"/assets/admin/css/blue.png": "/assets/admin/css/blue.png?id=39437a6200d8066a49d4",
"/assets/admin/css/blue@2x.png": "/assets/admin/css/blue@2x.png?id=127d7cfbb176dc559854",
"/assets/frontend/js/vendor.js": "/assets/frontend/js/vendor.js?id=0f56f07ddfc52e0265ea",
"/assets/admin/css/vendor.css": "/assets/admin/css/vendor.css?id=3faf0c4cbfe14c8b99cf",
"/assets/admin/css/vendor.css": "/assets/admin/css/vendor.css?id=da3d6e838ded26ce93ae",
"/assets/admin/js/vendor.js": "/assets/admin/js/vendor.js?id=63a4fc6da97448db5b67",
"/assets/installer/css/vendor.css": "/assets/installer/css/vendor.css?id=b484734ef5549fc2baae",
"/assets/installer/js/vendor.js": "/assets/installer/js/vendor.js?id=e191958da1971cc63bd9",

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>