Fix bugs
This commit is contained in:
parent
1769c410d0
commit
aff5c3eaae
|
@ -939,24 +939,27 @@ class HealthCareSheetController extends Controller
|
||||||
'practitioner_lastname' => 'required|string',
|
'practitioner_lastname' => 'required|string',
|
||||||
'practitioner_firstname' => 'nullable|string',
|
'practitioner_firstname' => 'nullable|string',
|
||||||
'practitioner_provider_class_id' => 'required|integer',
|
'practitioner_provider_class_id' => 'required|integer',
|
||||||
'prescriptions' => 'nullable|array',
|
'prescriptions' => 'required_without:exams|array',
|
||||||
'prescriptions.*.id' => 'required|integer|exists:nh_medical_prescriptions,id',
|
'prescriptions.*.id' => 'required|integer|exists:nh_medical_prescriptions,id',
|
||||||
'prescriptions.*.unit_price' => 'required|numeric',
|
'prescriptions.*.unit_price' => 'required|numeric',
|
||||||
'exams' => 'nullable|array',
|
'exams' => 'required_without:prescriptions|array',
|
||||||
'exams.*.id' => 'required|integer|exists:nh_exams,id',
|
'exams.*.id' => 'required|integer|exists:nh_exams,id',
|
||||||
'exams.*.unit_price' => 'required|numeric',
|
'exams.*.unit_price' => 'required|numeric',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$prescriptions = $request->input('prescriptions', []);
|
$prescriptions = $request->input('prescriptions', []);
|
||||||
$exams = $request->input('exams', []);
|
$exams = $request->input('exams', []);
|
||||||
|
if (sizeof($prescriptions) >= 1 && sizeof($exams) >= 1) {
|
||||||
|
return $this->errorResponse(trans('errors.execution_rule'));
|
||||||
|
}
|
||||||
|
|
||||||
$sheet = NhHealthCareSheet::findOrFail($request->input('health_care_sheet_id'));
|
$sheet = NhHealthCareSheet::findOrFail($request->input('health_care_sheet_id'));
|
||||||
if ($sheet->state != InsuranceSubscriptionState::ACCEPTED) {
|
if ($sheet->state != InsuranceSubscriptionState::ACCEPTED) {
|
||||||
return $this->errorResponse("Cette feuille de soin n'a pas été accepte");
|
return $this->errorResponse(trans('errors.sheet_not_accepted'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sheet->type != HealthCareSheetType::CONSULTATION) {
|
if ($sheet->type != HealthCareSheetType::CONSULTATION) {
|
||||||
return $this->errorResponse("Cette feuille de soin ne provient pas d'une consultation");
|
return $this->errorResponse(trans('errors.sheet_not_comes_from_consultation'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->agentCredentialsVerification($request->input('network_agent_id'), $request->input('password'));
|
$this->agentCredentialsVerification($request->input('network_agent_id'), $request->input('password'));
|
||||||
|
@ -2263,7 +2266,7 @@ class HealthCareSheetController extends Controller
|
||||||
|
|
||||||
NhTmpHealthCareSheet::create([
|
NhTmpHealthCareSheet::create([
|
||||||
'sheet_id' => $request->input('tmp_sheet_id'),
|
'sheet_id' => $request->input('tmp_sheet_id'),
|
||||||
'insurance_amount' => $insurance_amount
|
'insurance_amount' => $insurance_amount - $current_insurance_amount
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->successResponse("Can be applied");
|
return $this->successResponse("Can be applied");
|
||||||
|
|
|
@ -55,5 +55,8 @@ return [
|
||||||
'month_price_grid_not_found' => "La grille tarifaire de ce mois n'existe pas",
|
'month_price_grid_not_found' => "La grille tarifaire de ce mois n'existe pas",
|
||||||
"insurance_coverage_amount_exceeded" => "La limite autorisée est dépassée.
|
"insurance_coverage_amount_exceeded" => "La limite autorisée est dépassée.
|
||||||
Consommation : :consommation
|
Consommation : :consommation
|
||||||
Reste : :remaining"
|
Reste : :remaining",
|
||||||
|
"execution_rule" => "An execution can only be made on examinations or medical prescriptions.",
|
||||||
|
"sheet_not_accepted" => "This treatment sheet has not been accepted",
|
||||||
|
"sheet_not_comes_from_consultation" => "This health care sheet is not from a consultation"
|
||||||
];
|
];
|
||||||
|
|
|
@ -55,5 +55,8 @@ return [
|
||||||
'month_price_grid_not_found' => "La grille tarifaire de ce mois n'existe pas",
|
'month_price_grid_not_found' => "La grille tarifaire de ce mois n'existe pas",
|
||||||
"insurance_coverage_amount_exceeded" => "La limite autorisée est dépassée.
|
"insurance_coverage_amount_exceeded" => "La limite autorisée est dépassée.
|
||||||
Consommation : :consumption
|
Consommation : :consumption
|
||||||
Reste : :remaining"
|
Reste : :remaining",
|
||||||
|
"execution_rule" => "Une exécution ne peut être faite que sur les examens ou sur les prescriptions médicales.",
|
||||||
|
"sheet_not_accepted" => "Cette feuille de soins n'a pas été acceptée",
|
||||||
|
"sheet_not_comes_from_consultation" => "Cette feuille de soins ne provient pas d'une consultation"
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue