mining taxes

This commit is contained in:
2021-03-07 06:20:19 +09:00
parent e23c97f455
commit 59868bb63a
8 changed files with 129 additions and 22 deletions
@@ -123,10 +123,17 @@ class MiningTaxesInvoices extends Command
$body .= "Mining Taxes are due for the following ores mined from alliance moons: <br>";
foreach($ores as $ore => $quantity) {
$oreName = $lookup->ItemIdToName($ore);
$body .= $oreName . ": " . number_format($quantity, 0, ".", ",") . "<br>";
$body .= $oreName . ": " . number_format(round($quantity * $config['mining_tax']), 0, ".", ",") . "<br>";
}
$body .= "Please remit " . number_format($totalPrice, 2, ".", ",") . " ISK to Spatial Forces by " . $invoice->date_due . "<br>";
$body .= "Set the reason for transfer as MMT: " . $invoice->invoice_id . "<br>";
$body .= "<br><br>";
$body .= "You can also send a contract with the following ores in the contract with the reason set as MMT: " . $invoice->invoice_id . "<br>";
foreach($ores as $ore => $quantity) {
$oreName = $lookup->ItemIdToName($ore);
$body .= $oreName . ": " . number_format(round($quantity * $config['mining_tax']), ".", ",") . "<br>";
}
$body .= "<br>";
$body .= "<br>Sincerely,<br>Warped Intentions Leadership<br>";
//Mail the invoice to the character if the character is in
@@ -2,6 +2,7 @@
namespace App\Console\Commands\MiningTaxes;
//Internal Library
use Illuminate\Console\Command;
use Log;
use Carbon\Carbon;
@@ -9,6 +10,8 @@ use Carbon\Carbon;
//Application Library
use Commands\Library\CommandHelper;
use App\Library\Lookup\LookupHelper;
use Seat\Eseye\Exceptions\RequestFailedException;
use App\Library\Esi\Esi;
//Models
use App\Models\MiningTaxes\Invoice;
@@ -122,7 +125,7 @@ class MiningTaxesPayments extends Command
} else {
//If we didn't found a journal entry, then we shall check the contracts for a correct entry
foreach($contracts as $contract) {
if(($contract->title == $invoice->invoice_id) && ($currentTime->lessThanOrEqualTo($invoice->due_date))) {
if(($contract->title == ("MMT: " . $invoice->invoice_id)) && ($currentTime->lessThanOrEqualTo($invoice->due_date))) {
Invoice::where([
'invoice_i' => $invoice->invoice_id,
])->update([
@@ -130,7 +133,7 @@ class MiningTaxesPayments extends Command
]);
}
if(($contract->title == $invoice_id) && ($currentTime->greaterThan($invoice->due_date))) {
if(($contract->title == ("MMT: " . $invoice_id)) && ($currentTime->greaterThan($invoice->due_date))) {
Invoice::where([
'invoice_id' => $invoice->invoice_id,
])->update([
+6 -5
View File
@@ -71,14 +71,15 @@ class Kernel extends ConsoleKernel
->dailyAt('22:00')
->withoutOverlapping();
$schedule->command('MiningTaxes:Ledgers')
->hourlyAt('05')
->dailyAt('20:00')
->withoutOverlapping();
/*
$schedule->command('MiningTaxes:Invoices')
->dailyAt('23:00');
->weeklyOn(1, '8:00')
->withoutOverlapping();
$schedule->command('MiningTaxes:Payments')
->dailyAt('23:50');
*/
->hourlyAt('15')
->withoutOverlapping();
}
/**