fix: set company while creating encounter, fields rearranged
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js
index efa6b24..de8dc0e 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js
@@ -193,7 +193,6 @@
d.hide();
frm.enable_save();
frm.save();
- frm.enable_save();
d.get_primary_btn().attr('disabled', true);
}
});
@@ -400,6 +399,7 @@
frappe.route_options = {
'patient': frm.doc.patient,
'appointment': frm.doc.name,
+ 'company': frm.doc.company
};
frappe.new_doc('Vital Signs');
};
@@ -432,6 +432,7 @@
callback: function (data) {
frappe.model.set_value(frm.doctype, frm.docname, 'department', data.message.department);
frappe.model.set_value(frm.doctype, frm.docname, 'paid_amount', data.message.op_consulting_charge);
+ frappe.model.set_value(frm.doctype, frm.docname, 'billing_item', data.message.op_consulting_charge_item);
}
});
}
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
index 7f9a671..81f7597 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
@@ -14,13 +14,16 @@
"patient_name",
"patient_sex",
"patient_age",
- "inpatient_record",
"column_break_1",
- "status",
- "procedure_template",
- "get_procedure_from_encounter",
- "procedure_prescription",
+ "inpatient_record",
+ "company",
"service_unit",
+ "status",
+ "section_break_11",
+ "get_procedure_from_encounter",
+ "column_break_13",
+ "procedure_template",
+ "procedure_prescription",
"section_break_12",
"practitioner",
"department",
@@ -32,9 +35,9 @@
"duration",
"section_break_16",
"mode_of_payment",
- "paid_amount",
- "company",
+ "billing_item",
"column_break_2",
+ "paid_amount",
"invoiced",
"ref_sales_invoice",
"section_break_3",
@@ -114,7 +117,8 @@
"label": "Procedure Prescription",
"no_copy": 1,
"options": "Procedure Prescription",
- "print_hide": 1
+ "print_hide": 1,
+ "read_only": 1
},
{
"fieldname": "service_unit",
@@ -140,6 +144,7 @@
"set_only_once": 1
},
{
+ "fetch_from": "practitioner.department",
"fieldname": "department",
"fieldtype": "Link",
"ignore_user_permissions": 1,
@@ -234,12 +239,9 @@
{
"fieldname": "company",
"fieldtype": "Link",
- "hidden": 1,
"label": "Company",
"no_copy": 1,
- "options": "Company",
- "print_hide": 1,
- "report_hide": 1
+ "options": "Company"
},
{
"collapsible": 1,
@@ -282,10 +284,25 @@
"label": "Series",
"options": "HLC-APP-.YYYY.-",
"set_only_once": 1
+ },
+ {
+ "fieldname": "section_break_11",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "column_break_13",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "billing_item",
+ "fieldtype": "Link",
+ "label": "Billing Item",
+ "options": "Item",
+ "read_only": 1
}
],
"links": [],
- "modified": "2020-03-27 11:27:33.773195",
+ "modified": "2020-04-07 11:16:34.981240",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Patient Appointment",
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
index a2d9d02..3786bf2 100755
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
@@ -340,7 +340,8 @@
['medical_department', 'department'],
['patient_sex', 'patient_sex'],
['encounter_date', 'appointment_date'],
- ['invoiced', 'invoiced']
+ ['invoiced', 'invoiced'],
+ ['company', 'company']
]
}
}, target_doc)