added moon rentals into tax performance metrics

This commit is contained in:
2021-07-18 00:39:02 -05:00
parent bca5179cc3
commit 3da0cec4a1
2 changed files with 15 additions and 0 deletions

View File

@@ -239,6 +239,11 @@ class AdminDashboardController extends Controller
'date' => $date['start']->toFormattedDateString(),
'gross' => number_format($tHelper->GetMoonMiningTaxesLateGross($date['start'], $date['end']), 2, ".", ","),
];
$moonRentalTaxes[] = [
'date' => $date['start']->toFormattedDateString(),
'gross' => number_format($tHelper->GetMoonRentalTaxesGross($date['start'], $date['end']), 2, ".", ","),
];
}
return view('admin.dashboards.taxes')->with('pis', $pis)

View File

@@ -11,6 +11,7 @@ use App\Models\User\UserRole;
use App\Models\User\UserPermission;
use App\Models\Finances\AllianceWalletJournal;
use App\Models\MiningTax\Invoice;
use App\Models\MoonRental\AllianceMoonRental;
class TaxesHelper {
@@ -26,6 +27,15 @@ class TaxesHelper {
$this->end = $en;
}
public function GetMoonRentalTaxesGross($start, $end) {
$revenue = 0.00;
$revenue = AllianceMoonRental::whereBetween('rental_start', [$start, $end])
->sum('rental_amount');
return $revenue;
}
public function GetMoonMiningTaxesGross($start, $end) {
$revenue = 0.00;