process mining payments
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\MoonRental;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Log;
|
||||||
|
|
||||||
|
class MoonRentalAdminController extends Controller
|
||||||
|
{
|
||||||
|
//Constructor
|
||||||
|
public function __construct() {
|
||||||
|
$this->middleware('role:Admin');
|
||||||
|
$this->middleware('permission:moon.rental.manager');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display rental requests
|
||||||
|
*/
|
||||||
|
public function displayRentalRequests() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create monthly moon rental
|
||||||
|
*/
|
||||||
|
public function storeRentalRequest() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete / remove monthly moon rental
|
||||||
|
*/
|
||||||
|
public function updateRentalRequest() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display current monthly moon rentals
|
||||||
|
*/
|
||||||
|
public function displayCurrentRentals() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
44
app/Http/Controllers/MoonRental/MoonRentalController.php
Normal file
44
app/Http/Controllers/MoonRental/MoonRentalController.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\MoonRental;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Log;
|
||||||
|
|
||||||
|
class MoonRentalController extends Controller
|
||||||
|
{
|
||||||
|
//Constructor
|
||||||
|
public function __construct() {
|
||||||
|
$this->middleware('role:user');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display all of the available moons for rental
|
||||||
|
*/
|
||||||
|
public function displayMoons() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display form to request new moon structure be placed
|
||||||
|
*/
|
||||||
|
public function displayNewMoonRequestForm() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display moon rental request form
|
||||||
|
*/
|
||||||
|
public function displayMoonRentalRequestForm() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store moon rental from the request form
|
||||||
|
*/
|
||||||
|
public function storeMoonRentalRequest() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,6 +58,35 @@ class ProcessMiningTaxesPayments implements ShouldQueue
|
|||||||
])->count();
|
])->count();
|
||||||
|
|
||||||
//If we have received the invoice, then mark the invoice as paid
|
//If we have received the invoice, then mark the invoice as paid
|
||||||
|
if($found > 0) {
|
||||||
|
//If we have the count, then grab the journal entry in order to do some things with it
|
||||||
|
$journal = AllianceWalletJournal::where([
|
||||||
|
'reason' => "MMT: " . $invoice->invoice_id,
|
||||||
|
])->orWhere([
|
||||||
|
'reason' => $invoice->invoice_id,
|
||||||
|
])->first();
|
||||||
|
|
||||||
|
//If the bill is paid on time, then update the invoice as such
|
||||||
|
if($currentTime->lessThanOrEqualTo($journal->inserted_at)) {
|
||||||
|
Invoice::where([
|
||||||
|
'invoice_id' => $invoice->invoice_id,
|
||||||
|
])->update([
|
||||||
|
'status' => 'Paid',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($currentTime->greaterThan($journal->inserted_at)) {
|
||||||
|
Invoice::where([
|
||||||
|
'invoice_id' => $invoice->invoice_id,
|
||||||
|
])->update([
|
||||||
|
'status' => 'Paid Late',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$count = AllianceWalletJournal::where([
|
||||||
|
'reason' => $invoice->invoice_id,
|
||||||
|
])->count();
|
||||||
|
|
||||||
if($count > 0) {
|
if($count > 0) {
|
||||||
//If we have the count, then grab the journal entry in order to do some things with it
|
//If we have the count, then grab the journal entry in order to do some things with it
|
||||||
$journal = AllianceWalletJournal::where([
|
$journal = AllianceWalletJournal::where([
|
||||||
@@ -84,6 +113,7 @@ class ProcessMiningTaxesPayments implements ShouldQueue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Use the contract descriptions from the esi to see if the invoice_id is present.
|
//Use the contract descriptions from the esi to see if the invoice_id is present.
|
||||||
//If the invoice is present, then mark it off as sent in correctly
|
//If the invoice is present, then mark it off as sent in correctly
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ Route::group(['middleware' => ['auth']], function(){
|
|||||||
Route::get('/miningtax/admin/display/paid', 'MiningTaxes\MiningTaxesAdminController@DisplayPaidInvoices');
|
Route::get('/miningtax/admin/display/paid', 'MiningTaxes\MiningTaxesAdminController@DisplayPaidInvoices');
|
||||||
Route::any('/miningtax/admin/display/unpaid/search', 'MiningTaxes\MiningTaxesAdminController@SearchUnpaidInvoice');
|
Route::any('/miningtax/admin/display/unpaid/search', 'MiningTaxes\MiningTaxesAdminController@SearchUnpaidInvoice');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Moon Rental display pages
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scopes Controller display pages
|
* Scopes Controller display pages
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user