diff --git a/app/Http/Controllers/HealthCareSheetController.php b/app/Http/Controllers/HealthCareSheetController.php index 2b81b0e..4a080de 100755 --- a/app/Http/Controllers/HealthCareSheetController.php +++ b/app/Http/Controllers/HealthCareSheetController.php @@ -181,10 +181,10 @@ class HealthCareSheetController extends Controller 'performances.*.amount' => 'required|numeric', 'performances.*.home_visit_fees' => 'nullable|numeric', 'prescriptions' => 'nullable|array', - 'prescriptions.*.drug_or_device_id' => 'required|integer|exists:', + 'prescriptions.*.drug_or_device_id' => 'required|integer|exists:nh_drugs_and_devices,id', 'prescriptions.*.dosage' => 'required|string', 'prescriptions.*.quantity' => 'required|integer', - 'performances.*.unit_price' => 'required|numeric' + 'prescriptions.*.unit_price' => 'required|numeric' ]); $insurance = NhInsurance::where('insured_id', $request->input('insured_id'))->where('state', InsuranceState::PAID)->first(); @@ -241,11 +241,11 @@ class HealthCareSheetController extends Controller ])); foreach ($request->input('performances', []) as $p) { - $act = NhAct::where('code', $p['code'])->first(); + $act = NhAct::where('code', $p['act_code'])->first(); $performance = NhPerformance::create([ 'act_id' => $act->id, 'amount' => $p['amount'], - 'home_visit_fees' => $p['home_visit_fees'], + 'home_visit_fees' => $p['home_visit_fees'] ?? null, 'moderator_ticket' => $insuredPart * $p['amount'], // to calculate, 'insurance_amount' => $insurerPart * $p['amount'], // to calculate, montant de l'assurance 'created_at' => $datetime, 'updated_at' => $datetime, diff --git a/database/migrations/2021_11_23_132525_move_nh_provider_class_id_to_agents_table_in_networks_agents_table.php b/database/migrations/2021_11_23_132525_move_nh_provider_class_id_to_agents_table_in_networks_agents_table.php new file mode 100644 index 0000000..b4bbe3f --- /dev/null +++ b/database/migrations/2021_11_23_132525_move_nh_provider_class_id_to_agents_table_in_networks_agents_table.php @@ -0,0 +1,40 @@ +dropColumn('nh_provider_class_id'); + }); + + Schema::table('networks_agents', function (Blueprint $table) { + $table->integer('nh_provider_class_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('agents', function (Blueprint $table) { + $table->integer('nh_provider_class_id')->nullable(); + }); + + Schema::table('networks_agents', function (Blueprint $table) { + $table->dropColumn('nh_provider_class_id'); + }); + } +} diff --git a/database/migrations/2021_11_23_132557_update_agent_plus_view3.php b/database/migrations/2021_11_23_132557_update_agent_plus_view3.php new file mode 100644 index 0000000..c10fc9e --- /dev/null +++ b/database/migrations/2021_11_23_132557_update_agent_plus_view3.php @@ -0,0 +1,70 @@ +