Compare commits

...

9 Commits

Author SHA1 Message Date
B.Fatih KOZ
ced2012578
Update simbrief_briefing.blade.php (#1497)
Change in blade forms to SimBrief provided direct links.
2022-11-30 07:47:10 -06:00
fagidutt
00918f54aa
Fix division by Zero in pireps/show.blade.php (#1493)
* Fix division by Zero in pireps/show.blade.php

Division by Zero caused by possible null distance fixed by adding check.

* Update show.blade.php

* Update show.blade.php

* Update show.blade.php

Final form :)
2022-11-03 12:11:57 -04:00
Nabeel S
41bd325f9a
Revert "Bug fix #1414 (#1487)" (#1492)
This reverts commit b4311b861f.
2022-10-30 22:58:26 -04:00
Yash Govekar
b4311b861f
Bug fix #1414 (#1487)
* Update module migrate command to avoid errors.

* Fixed issue #1414
2022-10-24 11:11:00 -04:00
B.Fatih KOZ
2f9e8583f2
Flight Visibility Visuals (#1485)
Added "visible" field display and form checkbox to control it easily from admin side (instead of going through database)
2022-10-14 13:27:46 -04:00
John Cheng
2155979eb9
Patch currency subunit conversion (#1484)
* added parentheses around the conversion

* updated finance test

updated the following test:
- journal operations

fixed the following tests:
- pirep finances
- pirep finances specific expense
- pirep finances expenses multi airline
2022-10-09 08:13:11 -05:00
Toni Vicente
f30a3bc1ef
fix typo lang es-es (#1480) 2022-08-30 09:42:50 -04:00
B.Fatih KOZ
3461672f10
Fixes (#1481)
Fare Service : Return the note, do not force it to an empty string

Airport Importer : Make IATA nullable (as in the model)
2022-08-29 15:39:58 -04:00
B.Fatih KOZ
b4d5114ea2
Apply color customization (#1479) 2022-08-29 12:43:50 -04:00
10 changed files with 53 additions and 58 deletions

View File

@ -169,7 +169,7 @@ class FareService extends Service
}
}
$fare->notes = '';
// $fare->notes = '';
$fare->active = true;
return $fare;

View File

@ -18,7 +18,7 @@ class AirportImporter extends ImportExport
*/
public static $columns = [
'icao' => 'required',
'iata' => 'required',
'iata' => 'nullable',
'name' => 'required',
'location' => 'nullable',
'country' => 'nullable',

View File

@ -33,7 +33,7 @@ class Money
/**
* Create from a dollar amount
*
* @param mixed $amount The amount in pennies
* @param mixed $amount The amount in dollar
*
* @throws \UnexpectedValueException
* @throws \InvalidArgumentException
@ -52,12 +52,12 @@ class Money
*
* @param mixed $amount
*
* @return float|int
* @return int
*/
public static function convertToSubunit($amount)
{
$currency = setting('units.currency', 'USD');
return (int) $amount * config('money.'.$currency.'.subunit');
return (int) ($amount * config('money.'.$currency.'.subunit'));
}
/**

View File

@ -8,6 +8,6 @@ return [
'rejected' => 'Rechazado',
'on_leave' => 'En excedencia',
'suspended' => 'Suspendido',
'deleted' => 'Borrar',
'deleted' => 'Borrado',
],
];

View File

@ -270,7 +270,7 @@
<div class="row">
<!-- Active Field -->
<div class="col-sm-4">
<div class="col-sm-3">
<div class="checkbox">
<label class="checkbox-inline">
{{ Form::label('active', 'Active:') }}
@ -279,7 +279,17 @@
</label>
</div>
</div>
<div class="col-8">
<!-- Visible Field -->
<div class="col-sm-3">
<div class="checkbox">
<label class="checkbox-inline">
{{ Form::label('visible', 'Visible:') }}
<input name="visible" type="hidden" value="0" />
{{ Form::checkbox('visible') }}
</label>
</div>
</div>
<div class="col-6">
<div class="text-right">
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-info']) }}
</div>

View File

@ -9,6 +9,7 @@
<th>Arr Time</th>
<th>Notes</th>
<th style="text-align: center;">Active</th>
<th style="text-align: center;">Visible</th>
<th colspan="3" style="text-align: right;">Action</th>
</thead>
<tbody>
@ -37,6 +38,13 @@
<span class="label label-default">@lang('common.inactive')</span>
@endif
</td>
<td style="text-align: center;">
@if($flight->visible == 1)
<span class="text-success"><i class="fas fa-check fa2x" title="Visible"></i></span>
@else
<span class="text-danger"><i class="fas fa-times fa2x" title="Hidden"></i></span>
@endif
</td>
<td style="text-align: right;">
{{ Form::open(['route' => ['admin.flights.destroy', $flight->id], 'method' => 'delete']) }}
<a href="{{ route('admin.flights.edit', [$flight->id]) }}" class='btn btn-sm btn-success btn-icon'><i

View File

@ -12,6 +12,8 @@
route_points: {!! json_encode($map_features['route_points']) !!},
planned_route_line: {!! json_encode($map_features['planned_route_line']) !!},
metar_wms: {!! json_encode(config('map.metar_wms')) !!},
circle_color: '#056093',
flightplan_route_color: '#8B008B',
});
</script>
@endsection

View File

@ -213,43 +213,16 @@
<h6><i class="fas fa-info-circle"></i>&nbsp;Prefile ATC Flight Plan</h6>
<div class="form-container-body">
<div class="row">
<div class="col-4" align="center">
<form action="https://fpl.ivao.aero/api/fp/load" method="POST" target="_blank">
<input type="hidden" name="CALLSIGN" value="{{ $simbrief->xml->atc->callsign }}"/>
<input type="hidden" name="RULES" value="I"/>
<input type="hidden" name="FLIGHTTYPE" value="N"/>
<input type="hidden" name="NUMBER" value="1"/>
<input type="hidden" name="ACTYPE" value="{{ $simbrief->xml->aircraft->icaocode }}"/>
<input type="hidden" name="WAKECAT" value="{{ $wakecat }}"/>
<input type="hidden" name="EQUIPMENT" value="{{ $equipment }}"/>
<input type="hidden" name="TRANSPONDER" value="{{ $transponder }}"/>
<input type="hidden" name="DEPICAO" value="{{ $simbrief->xml->origin->icao_code}}"/>
<input type="hidden" name="DEPTIME" value="{{ date('Hi', $simbrief->xml->times->est_out->__toString()) }}"/>
<input type="hidden" name="SPEEDTYPE" value="{{ $simbrief->xml->atc->initial_spd_unit }}"/>
<input type="hidden" name="SPEED" value="{{ $simbrief->xml->atc->initial_spd }}"/>
<input type="hidden" name="LEVELTYPE" value="{{ $simbrief->xml->atc->initial_alt_unit }}"/>
<input type="hidden" name="LEVEL" value="{{ $simbrief->xml->atc->initial_alt }}"/>
<input type="hidden" name="ROUTE" value="{{ $simbrief->xml->general->route_ifps }}"/>
<input type="hidden" name="DESTICAO" value="{{ $simbrief->xml->destination->icao_code }}"/>
<input type="hidden" name="EET" value="@secstohhmm($simbrief->xml->times->est_time_enroute)"/>
<input type="hidden" name="ALTICAO" value="{{ $simbrief->xml->alternate->icao_code}}"/>
<input type="hidden" name="ALTICAO2" value="{{ $simbrief->xml->alternate2->icao_code}}"/>
<input type="hidden" name="OTHER" value="{{ $simbrief->xml->atc->section18 }}"/>
<input type="hidden" name="ENDURANCE" value="@secstohhmm($simbrief->xml->times->endurance)"/>
<input type="hidden" name="POB" value="{{ $simbrief->xml->weights->pax_count }}"/>
<input id="ivao_prefile" type="submit" class="btn btn-primary" value="File ATC on IVAO"/>
</form>
<div class="col-3" align="center">
<a href="{{ $simbrief->xml->prefile->ivao->link }}" target="_blank" class="btn btn-info">File > IVAO</a>
</div>
<div class="col-4" align="center">
<form action="https://my.vatsim.net/pilots/flightplan" method="GET" target="_blank">
<input type="hidden" name="raw" value="{{ $simbrief->xml->atc->flightplan_text }}">
<input type="hidden" name="fuel_time" value="@secstohhmm($simbrief->xml->times->endurance)">
<input type="hidden" name="speed" value="@if(substr($simbrief->xml->atc->initial_spd,0,1) === '0') {{ substr($simbrief->xml->atc->initial_spd,1) }} @else {{ $simbrief->xml->atc->initial_spd }} @endif">
<input type="hidden" name="altitude" value="{{ $simbrief->xml->general->initial_altitude }}">
<input id="vatsim_prefile" type="submit" class="btn btn-primary" value="File ATC on VATSIM"/>
</form>
<div class="col-3" align="center">
<a href="{{ $simbrief->xml->prefile->vatsim->link }}" target="_blank" class="btn btn-info">File > VATSIM</a>
</div>
<div class="col-4" align="center">
<div class="col-3" align="center">
<a href="{{ $simbrief->xml->prefile->poscon->link }}" target="_blank" class="btn btn-info">File > POSCON</a>
</div>
<div class="col-3" align="center">
<a
href="http://skyvector.com/?chart=304&amp;fpl={{ $simbrief->xml->origin->icao_code}} {{ $simbrief->xml->general->route }} {{ $simbrief->xml->destination->icao_code}}"
target="_blank" class="btn btn-info">View Route At SkyVector</a>

View File

@ -72,16 +72,18 @@
</div>
</div>
<div class="row">
<div class="col-12">
<div class="progress" style="margin: 20px 0;">
<div class="progress-bar progress-bar-success" role="progressbar"
aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"
style="width: {{$pirep->progress_percent}}%;">
@if(!empty($pirep->distance))
<div class="row">
<div class="col-12">
<div class="progress" style="margin: 20px 0;">
<div class="progress-bar progress-bar-success" role="progressbar"
aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"
style="width: {{$pirep->progress_percent}}%;">
</div>
</div>
</div>
</div>
</div>
@endif
<div class="row">
<div class="col-12">

View File

@ -712,20 +712,20 @@ class FinanceTest extends TestCase
$journalRepo->post(
$journal,
Money::createFromAmount(100),
Money::createFromAmount(100.5),
null,
$user
);
$balance = $journalRepo->getBalance($journal);
$this->assertEquals(100, $balance->getValue());
$this->assertEquals(100, $journal->balance->getValue());
$this->assertEquals(100.5, $balance->getValue());
$this->assertEquals(100.5, $journal->balance->getValue());
// add another transaction
$journalRepo->post(
$journal,
Money::createFromAmount(25),
Money::createFromAmount(24.5),
null,
$user
);
@ -912,7 +912,7 @@ class FinanceTest extends TestCase
// $this->assertCount(9, $transactions['transactions']);
$this->assertEquals(3020, $transactions['credits']->getValue());
$this->assertEquals(2050.0, $transactions['debits']->getValue());
$this->assertEquals(2050.4, $transactions['debits']->getValue());
// Check that all the different transaction types are there
// test by the different groups that exist
@ -967,7 +967,7 @@ class FinanceTest extends TestCase
// $this->assertCount(9, $transactions['transactions']);
$this->assertEquals(3020, $transactions['credits']->getValue());
$this->assertEquals(2050.0, $transactions['debits']->getValue());
$this->assertEquals(2050.4, $transactions['debits']->getValue());
// Check that all the different transaction types are there
// test by the different groups that exist
@ -1006,7 +1006,7 @@ class FinanceTest extends TestCase
$transactions = $journalRepo->getAllForObject($pirep2);
$this->assertEquals(3020, $transactions['credits']->getValue());
$this->assertEquals(2150.0, $transactions['debits']->getValue());
$this->assertEquals(2150.4, $transactions['debits']->getValue());
// Check that all the different transaction types are there
// test by the different groups that exist
@ -1115,6 +1115,6 @@ class FinanceTest extends TestCase
// $this->assertCount(9, $transactions['transactions']);
$this->assertEquals(3020, $transactions['credits']->getValue());
$this->assertEquals(2050.0, $transactions['debits']->getValue());
$this->assertEquals(2050.4, $transactions['debits']->getValue());
}
}