added remove renter functionality to update moon
This commit is contained in:
@@ -116,7 +116,6 @@ class MoonMailerCommand extends Command
|
||||
if($today > $rental->Paid_Until)
|
||||
$this->UpdateNotPaid($rental);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Mark the job as finished
|
||||
|
||||
@@ -82,8 +82,22 @@ class MoonsAdminController extends Controller
|
||||
'Contact' => $contact,
|
||||
])->first();
|
||||
|
||||
//If the entry is found, we are most likely just updating an entry to include new paid until data
|
||||
if($found) {
|
||||
if($found && $request->removal == true) {
|
||||
MoonRental::where([
|
||||
'System' => $request->system,
|
||||
'Planet' => $request->planet,
|
||||
'Moon' => $request->moon,
|
||||
])->delete();
|
||||
|
||||
MoonRental::insert([
|
||||
'System' => $request->system,
|
||||
'Planet' => $request->planet,
|
||||
'Moon' => $request->moon,
|
||||
'Contact' => 'None',
|
||||
'Paid' => 'No',
|
||||
'Paid_Until' => Carbon::now()->endOfMonth(),
|
||||
]);
|
||||
} else if($found && $request->removal != true) {
|
||||
if($allianceId = 99004116) {
|
||||
MoonRental::where([
|
||||
'System' => $request->system,
|
||||
@@ -116,7 +130,7 @@ class MoonsAdminController extends Controller
|
||||
'RentalEnd' => $date,
|
||||
'Contact' => $contact,
|
||||
'Price' => $price['outofalliance'],
|
||||
'Type' => 'alliance',
|
||||
'Type' => 'outofalliance',
|
||||
'Paid' => $paid,
|
||||
'Paid_Until' => $request->paid_until,
|
||||
]);
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
{{ Form::label('paid', 'Yes') }}
|
||||
{{ Form::radio('paid', 'Yes') }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('removal', 'Remove Renter') }}
|
||||
{{ Form::checkbox('removal', true, false, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user