added new structure controller function

This commit is contained in:
2019-01-05 04:28:57 -06:00
parent e022d2881a
commit 1c9efc5e01
9 changed files with 268 additions and 6 deletions
@@ -12,6 +12,7 @@ use App\Models\User\UserPermission;
use App\Models\Corporation\CorpStructure;
use App\Models\Finances\CorpMarketJournal;
use App\Models\Finances\ReprocessingTaxJournal;
use App\Models\Finances\StructureIndustryTaxJournal;
class StructureTaxHelper {
private $corpId;
@@ -62,6 +63,16 @@ class StructureTaxHelper {
return $taxOwed;
}
public function GetIndustryRevenue($start, $end) {
$revenue = 0.00;
$revenue = StructureIndustryTaxJournal::where(['ref_type' => 'facility_industry_tax', 'second_party_id' => '98287666'])
->whereBetween('date', [$start, $end])
->sum('amount');
return $revenue;
}
public function GetRevenue($corpId, $refType, $start, $end) {
$revenue = 0.00;
if($refType == 'Market') {