modified table for moons and made a tax summary

This commit is contained in:
2019-02-27 22:15:14 -06:00
parent 2e545464b1
commit b880dab1bf
8 changed files with 295 additions and 79 deletions

View File

@@ -31,56 +31,6 @@ class StructureController extends Controller
$this->middleware('permission:structure.operator');
}
public function displayReprocessingTaxes() {
$this->middleware('role:Admin');
$months = 3;
$taxes = array();
$corpId = 98287666;
//Declare the structure tax helper class
$sHelper = new StructureTaxHelper();
//Get the dates we are working with
$dates = $sHelper->GetTimeFrameInMonths($months);
foreach($dates as $date) {
$taxes[] = [
'date' => $date['start']->toFormattedDateString(),
'tax' => number_format($sHelper->GetTaxes($corpId, 'Refinery', $date['start'], $date['end']), 2, '.', ','),
'revenue' => number_format($sHelper->GetRevenue($corpId, 'Refinery', $date['start'], $date['end']), 2, '.', ',')
];
}
//Return the view with the data passed to it
return view('structures/user/reprocessingtaxes')->with('taxes', $taxes);
}
public function displayIndustryTaxes() {
$this->middleware('role:Admin');
$months = 3;
$taxes = array();
//Declare the structure tax helper class
$sHelper = new StructureTaxHelper();
//Get the dates we are working with
$dates = $sHelper->GetTimeFrameInMonths($months);
foreach($dates as $date) {
$tax = StructureIndustryTaxJournal::select('amount')
->whereBetween('date', [$date['start'], $date['end']])
->sum('amount');
$taxes[] = [
'date' => $date['start']->toFormattedDateString(),
'tax' => number_format($tax, 2, '.', ',')
];
}
return view('structures.user.industrytaxes')->with('taxes', $taxes);
}
public function chooseCorpTaxes() {
$this->middleware('role:Admin');