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)
|
if($today > $rental->Paid_Until)
|
||||||
$this->UpdateNotPaid($rental);
|
$this->UpdateNotPaid($rental);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Mark the job as finished
|
//Mark the job as finished
|
||||||
|
|||||||
@@ -82,8 +82,22 @@ class MoonsAdminController extends Controller
|
|||||||
'Contact' => $contact,
|
'Contact' => $contact,
|
||||||
])->first();
|
])->first();
|
||||||
|
|
||||||
//If the entry is found, we are most likely just updating an entry to include new paid until data
|
if($found && $request->removal == true) {
|
||||||
if($found) {
|
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) {
|
if($allianceId = 99004116) {
|
||||||
MoonRental::where([
|
MoonRental::where([
|
||||||
'System' => $request->system,
|
'System' => $request->system,
|
||||||
@@ -116,7 +130,7 @@ class MoonsAdminController extends Controller
|
|||||||
'RentalEnd' => $date,
|
'RentalEnd' => $date,
|
||||||
'Contact' => $contact,
|
'Contact' => $contact,
|
||||||
'Price' => $price['outofalliance'],
|
'Price' => $price['outofalliance'],
|
||||||
'Type' => 'alliance',
|
'Type' => 'outofalliance',
|
||||||
'Paid' => $paid,
|
'Paid' => $paid,
|
||||||
'Paid_Until' => $request->paid_until,
|
'Paid_Until' => $request->paid_until,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -30,6 +30,10 @@
|
|||||||
{{ Form::label('paid', 'Yes') }}
|
{{ Form::label('paid', 'Yes') }}
|
||||||
{{ Form::radio('paid', 'Yes') }}
|
{{ Form::radio('paid', 'Yes') }}
|
||||||
</div>
|
</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::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||||
{!! Form::close() !!}
|
{!! Form::close() !!}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user