check calculater

This commit is contained in:
2025-11-19 15:28:26 +03:30
parent 5672c6eb0d
commit f35dada874
3 changed files with 42 additions and 4 deletions

View File

@@ -101,4 +101,6 @@ HARIM_ENCRYPTION_IV="1111000011110101"
CHECKE_LIST_MACHINES_ACTIVITY_URL='fms.141.ir:7030/api/RMS/GetMovingVehicles', CHECKE_LIST_MACHINES_ACTIVITY_URL='fms.141.ir:7030/api/RMS/GetMovingVehicles',
CHECKE_LIST_MACHINES_ACTIVITY_PASSWORD= CHECKE_LIST_MACHINES_ACTIVITY_PASSWORD=
CHECKE_LIST_MACHINES_ACTIVITY_USERNAME= CHECKE_LIST_MACHINES_ACTIVITY_USERNAME=
HARIM_AMOUNT_PER=1

View File

@@ -29,10 +29,42 @@ class ComputingPaymentRequest extends FormRequest
'traffic' => 'required|numeric|decimal:0,1', 'traffic' => 'required|numeric|decimal:0,1',
'road_type' => 'required|numeric|decimal:0,1', 'road_type' => 'required|numeric|decimal:0,1',
'position' => 'required|numeric|decimal:0,1', 'position' => 'required|numeric|decimal:0,1',
'final_area_space' => 'required|numeric|decimal:0,2', 'final_area_space' => 'required|numeric|decimal:0,2', //عرصه
'final_plan_space' => 'required|numeric|decimal:0,2', 'final_plan_space' => 'required|numeric|decimal:0,2', // عیان
'payment_amount' => 'required|numeric|decimal:0,2', 'payment_amount' => 'required|numeric',
'expert_description' => 'required|string', 'expert_description' => 'required|string',
]; ];
} }
public function after(): array
{
return [
function () {
$fe = config('harim_web_services.Harim_Payment.per');
$arse = (
$this->traffic *
$this->road_type *
$this->position *
$fe*
$this->final_area_space
);
$ayan =(
$this->traffic *
$this->road_type *
$this->position *
$fe*
$this->final_plan_space
);
$result = floor($arse + $ayan);
if ($result !== $this->payment_amount) {
$this->validator->errors()->add(
'payment_amount',
'payment_amount مقادیر بدست امده صحیح نمی باشد.'
);
}
}
];
}
} }

View File

@@ -35,4 +35,8 @@ return [
'key' => env('HARIM_ENCRYPTION_KEY'), 'key' => env('HARIM_ENCRYPTION_KEY'),
'iv' => env('HARIM_ENCRYPTION_IV'), 'iv' => env('HARIM_ENCRYPTION_IV'),
], ],
'Harim_Payment' => [
'per' => env('HARIM_AMOUNT_PER'),
]
]; ];