taxes helper

This commit is contained in:
2019-08-04 01:30:03 -05:00
parent 396d02e7a3
commit dfc5337b06
3 changed files with 18 additions and 3 deletions

View File

@@ -65,7 +65,7 @@ class AdminController extends Controller
//Get the market taxes for the date range
$markets[] = [
'date' => $date['start']->toFormattedDateString(),
'gross' => number_format($tHelper->GetMarketGross($date['start'], $date['end']), 2, ".", ","),
'gross' => number_format($tHelper->GetAllianceMarketGross($date['start'], $date['end']), 2, ".", ","),
];
//Get the jump gate taxes for the date range
$jumpgates[] = [

View File

@@ -21,7 +21,8 @@ use App\Models\Mail\EveMail;
//Library
use App\Library\Esi\Esi;
use App\Library\Finances\CorpMarketJournal;
use App\Library\Finances\AllianceMarketTax;
use App\Library\Finances\CorpMarketTax;
use App\Library\Finances\MarketTax;
use App\Library\Finances\PlayerDonation;
use App\Library\Finances\ReprocessingTax;

View File

@@ -16,6 +16,9 @@ use App\Models\Finances\OfficeFeesJournal;
use App\Models\Finances\CorpMarketJournal;
use App\Models\Finances\JumpBridgeJournal;
use App\Models\Finances\PISaleJournal;
use App\Models\Finances\AllianceMarketJournal;
use App\Models\Finances\CorpMarketJournal;
use App\Models\Finances\CorpMarketStructure;
class TaxesHelper {
@@ -31,10 +34,21 @@ class TaxesHelper {
$this->end = $en;
}
public function GetAllianceMarketGross($start, $end, $corpId) {
$revenue = 0.00;
$revenue = AllianceMarketJournal::where([
'second_party_id' => $corpId,
])->whereBetween('date', [$start, $end])
->sum('amount');
return $revenue;
}
public function GetStructureMarketGross($start, $end, $corpId) {
$revenue = 0.00;
$revenu = CorpMarketJournal::where([
$revenue = CorpMarketJournal::where([
'second_party_id' => $corpId,
])->whereBetween('date', [$start, $end])
->sum('amount');