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 //Get the market taxes for the date range
$markets[] = [ $markets[] = [
'date' => $date['start']->toFormattedDateString(), '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 //Get the jump gate taxes for the date range
$jumpgates[] = [ $jumpgates[] = [

View File

@@ -21,7 +21,8 @@ use App\Models\Mail\EveMail;
//Library //Library
use App\Library\Esi\Esi; 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\MarketTax;
use App\Library\Finances\PlayerDonation; use App\Library\Finances\PlayerDonation;
use App\Library\Finances\ReprocessingTax; 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\CorpMarketJournal;
use App\Models\Finances\JumpBridgeJournal; use App\Models\Finances\JumpBridgeJournal;
use App\Models\Finances\PISaleJournal; use App\Models\Finances\PISaleJournal;
use App\Models\Finances\AllianceMarketJournal;
use App\Models\Finances\CorpMarketJournal;
use App\Models\Finances\CorpMarketStructure;
class TaxesHelper { class TaxesHelper {
@@ -31,10 +34,21 @@ class TaxesHelper {
$this->end = $en; $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) { public function GetStructureMarketGross($start, $end, $corpId) {
$revenue = 0.00; $revenue = 0.00;
$revenu = CorpMarketJournal::where([ $revenue = CorpMarketJournal::where([
'second_party_id' => $corpId, 'second_party_id' => $corpId,
])->whereBetween('date', [$start, $end]) ])->whereBetween('date', [$start, $end])
->sum('amount'); ->sum('amount');