diff --git a/src/Http/DataTables/Tools/MoonsDataTable.php b/src/Http/DataTables/Tools/MoonsDataTable.php index ee2585448..5a69260c1 100644 --- a/src/Http/DataTables/Tools/MoonsDataTable.php +++ b/src/Http/DataTables/Tools/MoonsDataTable.php @@ -116,8 +116,8 @@ public function query() 'moon.solar_system.sovereignty.alliance', 'moon.solar_system.sovereignty.corporation', 'content') ->select() //this is not an SQL injection since $mining_volume is a constant int on a class - ->selectRaw('(SELECT SUM(rate * ? * ?/invTypes.volume*market_prices.adjusted_price) FROM universe_moon_contents JOIN invTypes ON invTypes.typeID=universe_moon_contents.type_id JOIN market_prices ON market_prices.type_id=universe_moon_contents.type_id WHERE moon_id=universe_moon_reports.moon_id) as raw_value', [$mining_volume, $hours_per_month]) - ->selectRaw('(select SUM((select SUM(invTypeMaterials.quantity*market_prices.adjusted_price) from invTypeMaterials join market_prices on market_prices.type_id=invTypeMaterials.materialTypeID where invTypeMaterials.typeID=universe_moon_contents.type_id) * universe_moon_contents.rate * ? * ? / invTypes.volume * ? / 100) from universe_moon_contents join invTypes on invTypes.typeID=universe_moon_contents.type_id where universe_moon_contents.moon_id=universe_moon_reports.moon_id) as refined_value', [$mining_volume, $hours_per_month, $reprocessing_yield]); + ->selectRaw('(SELECT SUM(rate * ? * ?/invTypes.volume*market_prices.sell_price) FROM universe_moon_contents JOIN invTypes ON invTypes.typeID=universe_moon_contents.type_id JOIN market_prices ON market_prices.type_id=universe_moon_contents.type_id WHERE moon_id=universe_moon_reports.moon_id) as raw_value', [$mining_volume, $hours_per_month]) + ->selectRaw('(select SUM((select SUM(invTypeMaterials.quantity*market_prices.sell_price) from invTypeMaterials join market_prices on market_prices.type_id=invTypeMaterials.materialTypeID where invTypeMaterials.typeID=universe_moon_contents.type_id) * universe_moon_contents.rate * ? * ? / invTypes.volume * ? / 100) from universe_moon_contents join invTypes on invTypes.typeID=universe_moon_contents.type_id where universe_moon_contents.moon_id=universe_moon_reports.moon_id) as refined_value', [$mining_volume, $hours_per_month, $reprocessing_yield]); } /** diff --git a/src/resources/views/tools/moons/modals/components/content.blade.php b/src/resources/views/tools/moons/modals/components/content.blade.php index a66e638ff..1b57cb096 100644 --- a/src/resources/views/tools/moons/modals/components/content.blade.php +++ b/src/resources/views/tools/moons/modals/components/content.blade.php @@ -58,7 +58,7 @@ {{ number_format($type->pivot->rate * 100, 2) }} % {{ number_format($type->pivot->rate * Seat\Eveapi\Models\Industry\CorporationIndustryMiningExtraction::BASE_DRILLING_VOLUME * 720, 2) }} m3 {{ number_format(($type->pivot->rate * Seat\Eveapi\Models\Industry\CorporationIndustryMiningExtraction::BASE_DRILLING_VOLUME * 720) / $type->volume) }} - {{ number_format((($type->pivot->rate * Seat\Eveapi\Models\Industry\CorporationIndustryMiningExtraction::BASE_DRILLING_VOLUME * 720) / $type->volume) * $type->price->adjusted_price, 2) }} + {{ number_format((($type->pivot->rate * Seat\Eveapi\Models\Industry\CorporationIndustryMiningExtraction::BASE_DRILLING_VOLUME * 720) / $type->volume) * $type->price->sell_price, 2) }} @endforeach @@ -99,7 +99,7 @@ {{ number_format($material->sum('pivot.quantity') * $material->first()->volume, 2) }} m3 {{ number_format($material->sum('pivot.quantity')) }} - {{ number_format($material->sum('pivot.quantity') * $material->first()->price->adjusted_price) }} + {{ number_format($material->sum('pivot.quantity') * $material->first()->price->sell_price) }} @endforeach