done restructure calculation retribution

This commit is contained in:
arifal
2025-06-19 13:48:35 +07:00
parent 4c3443c2d6
commit 285e89d5d0
27 changed files with 791 additions and 3161 deletions

View File

@@ -150,9 +150,11 @@ class TestRetributionCalculation extends Command
protected function performCalculation($buildingTypeId, $floor, $area)
{
try {
$result = $this->calculatorService->calculate($buildingTypeId, $floor, $area, false);
// Round area to 2 decimal places to match database storage format
$roundedArea = round($area, 2);
$result = $this->calculatorService->calculate($buildingTypeId, $floor, $roundedArea, false);
$this->displayResults($result, $area, $floor);
$this->displayResults($result, $roundedArea, $floor);
} catch (\Exception $e) {
$this->error('❌ Error: ' . $e->getMessage());
@@ -208,7 +210,7 @@ class TestRetributionCalculation extends Command
protected function testAllBuildingTypes()
{
$area = $this->option('area') ?: 100;
$area = round($this->option('area') ?: 100, 2);
$floor = $this->option('floor') ?: 2;
$this->info("🧪 TESTING SEMUA BUILDING TYPES");