fix: status inconsistencies in Clinical Procedure
This commit is contained in:
parent
0ed4cabb5d
commit
d244ac9c3a
@ -4,81 +4,86 @@
|
|||||||
frappe.ui.form.on('Clinical Procedure', {
|
frappe.ui.form.on('Clinical Procedure', {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.set_query('batch_no', 'items', function(doc, cdt, cdn) {
|
frm.set_query('batch_no', 'items', function(doc, cdt, cdn) {
|
||||||
var item = locals[cdt][cdn];
|
let item = locals[cdt][cdn];
|
||||||
if(!item.item_code) {
|
if (!item.item_code) {
|
||||||
frappe.throw(__("Please enter Item Code to get Batch Number"));
|
frappe.throw(__('Please enter Item Code to get Batch Number'));
|
||||||
} else {
|
} else {
|
||||||
if (frm.doc.status == 'In Progress') {
|
if (frm.doc.status == 'In Progress') {
|
||||||
var filters = {
|
let filters = {
|
||||||
'item_code': item.item_code,
|
'item_code': item.item_code,
|
||||||
'posting_date': frm.doc.start_date || frappe.datetime.nowdate()
|
'posting_date': frm.doc.start_date || frappe.datetime.nowdate()
|
||||||
};
|
};
|
||||||
if(frm.doc.warehouse) filters["warehouse"] = frm.doc.warehouse;
|
if (frm.doc.warehouse) filters['warehouse'] = frm.doc.warehouse;
|
||||||
} else {
|
} else {
|
||||||
filters = {
|
filters = {
|
||||||
'item_code': item.item_code
|
'item_code': item.item_code
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
query : "erpnext.controllers.queries.get_batch_no",
|
query : 'erpnext.controllers.queries.get_batch_no',
|
||||||
filters: filters
|
filters: filters
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frm.set_query("patient", function () {
|
frm.set_query('patient', function () {
|
||||||
return {
|
return {
|
||||||
filters: {"status": ["!=", "Disabled"]}
|
filters: {'status': ['!=', 'Disabled']}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
frm.set_query("appointment", function () {
|
|
||||||
|
frm.set_query('appointment', function () {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
"procedure_template": ["not in", null],
|
'procedure_template': ['not in', null],
|
||||||
"status": ['in', 'Open, Scheduled']
|
'status': ['in', 'Open, Scheduled']
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
frm.set_query("service_unit", function(){
|
|
||||||
|
frm.set_query('service_unit', function() {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
"is_group": false,
|
'is_group': false,
|
||||||
"allow_appointments": true
|
'allow_appointments': true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
frm.set_query("practitioner", function() {
|
|
||||||
|
frm.set_query('practitioner', function() {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
'department': frm.doc.medical_department
|
'department': frm.doc.medical_department
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
if(frm.doc.consume_stock){
|
|
||||||
|
if (frm.doc.consume_stock) {
|
||||||
frm.set_indicator_formatter('item_code',
|
frm.set_indicator_formatter('item_code',
|
||||||
function(doc) { return (doc.qty<=doc.actual_qty) ? "green" : "orange" ; });
|
function(doc) { return (doc.qty<=doc.actual_qty) ? 'green' : 'orange' ; });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!frm.doc.__islocal && frm.doc.status == 'In Progress'){
|
if (frm.doc.docstatus == 2 && frm.doc.status == 'In Progress') {
|
||||||
|
let btn_label = '';
|
||||||
if(frm.doc.consume_stock){
|
let msg = '';
|
||||||
var btn_label = 'Complete and Consume';
|
if (frm.doc.consume_stock) {
|
||||||
var msg = 'Complete '+frm.doc.name+' and Consume Stock?';
|
btn_label = 'Complete and Consume';
|
||||||
}else{
|
msg = 'Complete '+ frm.doc.name +' and Consume Stock?';
|
||||||
|
} else {
|
||||||
btn_label = 'Complete';
|
btn_label = 'Complete';
|
||||||
msg = 'Complete '+frm.doc.name+'?';
|
msg = 'Complete '+ frm.doc.name +'?';
|
||||||
}
|
}
|
||||||
|
|
||||||
frm.add_custom_button(__(btn_label), function () {
|
frm.add_custom_button(__(btn_label), function () {
|
||||||
frappe.confirm(
|
frappe.confirm(
|
||||||
__(msg),
|
__(msg),
|
||||||
function(){
|
function() {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
doc: frm.doc,
|
doc: frm.doc,
|
||||||
method: "complete",
|
method: 'complete',
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc){
|
if (!r.exc) {
|
||||||
cur_frm.reload_doc();
|
cur_frm.reload_doc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,31 +91,31 @@ frappe.ui.form.on('Clinical Procedure', {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}else if (frm.doc.status == 'Draft') {
|
} else if (frm.doc.docstatus == 2 && frm.doc.status == 'Pending') {
|
||||||
frm.add_custom_button(__("Start"), function () {
|
frm.add_custom_button(__('Start'), function () {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
doc: frm.doc,
|
doc: frm.doc,
|
||||||
method: "start",
|
method: 'start',
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc){
|
if (!r.exc) {
|
||||||
if(frm.doc.status == 'Draft'){
|
if (frm.doc.status == 'Draft') {
|
||||||
frappe.confirm(
|
frappe.confirm(
|
||||||
__("Stock quantity to start procedure is not available in the warehouse. Do you want to record a Stock Transfer"),
|
__('Stock quantity to start procedure is not available in the warehouse. Do you want to record a Stock Transfer'),
|
||||||
function(){
|
function() {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
doc: frm.doc,
|
doc: frm.doc,
|
||||||
method: "make_material_transfer",
|
method: 'make_material_transfer',
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc){
|
if (!r.exc) {
|
||||||
cur_frm.reload_doc();
|
cur_frm.reload_doc();
|
||||||
var doclist = frappe.model.sync(r.message);
|
let doclist = frappe.model.sync(r.message);
|
||||||
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
|
frappe.set_route('Form', doclist[0].doctype, doclist[0].name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}else{
|
} else {
|
||||||
cur_frm.reload_doc();
|
cur_frm.reload_doc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,130 +123,130 @@ frappe.ui.form.on('Clinical Procedure', {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (frm.doc.__islocal){
|
if (frm.doc.__islocal) {
|
||||||
frm.set_df_property("consumables", "hidden", 1);
|
frm.set_df_property('consumables', 'hidden', 1);
|
||||||
}else{
|
} else {
|
||||||
frm.set_df_property("consumables", "hidden", 0);
|
frm.set_df_property('consumables', 'hidden', 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onload: function(frm){
|
onload: function(frm) {
|
||||||
if(frm.doc.status == 'Completed'){
|
if (frm.doc.status == 'Completed') {
|
||||||
frm.set_df_property("items", "read_only", 1);
|
frm.set_df_property('items', 'read_only', 1);
|
||||||
}
|
}
|
||||||
if(frm.is_new()) {
|
if (frm.is_new()) {
|
||||||
frm.add_fetch("procedure_template", "medical_department", "medical_department");
|
frm.add_fetch('procedure_template', 'medical_department', 'medical_department');
|
||||||
frm.set_value("start_time", null);
|
frm.set_value('start_time', null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
patient: function(frm) {
|
patient: function(frm) {
|
||||||
if(frm.doc.patient){
|
if (frm.doc.patient) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
"method": "erpnext.healthcare.doctype.patient.patient.get_patient_detail",
|
'method': 'erpnext.healthcare.doctype.patient.patient.get_patient_detail',
|
||||||
args: {
|
args: {
|
||||||
patient: frm.doc.patient
|
patient: frm.doc.patient
|
||||||
},
|
},
|
||||||
callback: function (data) {
|
callback: function (data) {
|
||||||
let age = "";
|
let age = '';
|
||||||
if(data.message.dob){
|
if (data.message.dob) {
|
||||||
age = calculate_age(data.message.dob);
|
age = calculate_age(data.message.dob);
|
||||||
}else if (data.message.age){
|
}else if (data.message.age) {
|
||||||
age = data.message.age;
|
age = data.message.age;
|
||||||
if(data.message.age_as_on){
|
if (data.message.age_as_on) {
|
||||||
age = age+" as on "+data.message.age_as_on;
|
age = age+' as on '+data.message.age_as_on;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
frm.set_value("patient_age", age);
|
frm.set_value('patient_age', age);
|
||||||
frm.set_value("patient_sex", data.message.sex);
|
frm.set_value('patient_sex', data.message.sex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
frm.set_value("patient_age", "");
|
frm.set_value('patient_age', '');
|
||||||
frm.set_value("patient_sex", "");
|
frm.set_value('patient_sex', '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
appointment: function(frm) {
|
appointment: function(frm) {
|
||||||
if(frm.doc.appointment){
|
if (frm.doc.appointment) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
"method": "frappe.client.get",
|
'method': 'frappe.client.get',
|
||||||
args: {
|
args: {
|
||||||
doctype: "Patient Appointment",
|
doctype: 'Patient Appointment',
|
||||||
name: frm.doc.appointment
|
name: frm.doc.appointment
|
||||||
},
|
},
|
||||||
callback: function (data) {
|
callback: function(data) {
|
||||||
frm.set_value("patient", data.message.patient);
|
frm.set_value('patient', data.message.patient);
|
||||||
frm.set_value("procedure_template", data.message.procedure_template);
|
frm.set_value('procedure_template', data.message.procedure_template);
|
||||||
frm.set_value("medical_department", data.message.department);
|
frm.set_value('medical_department', data.message.department);
|
||||||
frm.set_value("start_date", data.message.appointment_date);
|
frm.set_value('start_date', data.message.appointment_date);
|
||||||
frm.set_value("start_time", data.message.appointment_time);
|
frm.set_value('start_time', data.message.appointment_time);
|
||||||
frm.set_value("notes", data.message.notes);
|
frm.set_value('notes', data.message.notes);
|
||||||
frm.set_value("service_unit", data.message.service_unit);
|
frm.set_value('service_unit', data.message.service_unit);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
procedure_template: function(frm) {
|
procedure_template: function(frm) {
|
||||||
if(frm.doc.procedure_template){
|
if (frm.doc.procedure_template) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
"method": "frappe.client.get",
|
'method': 'frappe.client.get',
|
||||||
args: {
|
args: {
|
||||||
doctype: "Clinical Procedure Template",
|
doctype: 'Clinical Procedure Template',
|
||||||
name: frm.doc.procedure_template
|
name: frm.doc.procedure_template
|
||||||
},
|
},
|
||||||
callback: function (data) {
|
callback: function (data) {
|
||||||
frm.set_value("medical_department", data.message.medical_department);
|
frm.set_value('medical_department', data.message.medical_department);
|
||||||
frm.set_value("consume_stock", data.message.consume_stock);
|
frm.set_value('consume_stock', data.message.consume_stock);
|
||||||
if(!frm.doc.warehouse){
|
if (!frm.doc.warehouse) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "frappe.client.get_value",
|
method: 'frappe.client.get_value',
|
||||||
args: {
|
args: {
|
||||||
doctype: "Stock Settings",
|
doctype: 'Stock Settings',
|
||||||
fieldname: "default_warehouse"
|
fieldname: 'default_warehouse'
|
||||||
},
|
},
|
||||||
callback: function (data) {
|
callback: function (data) {
|
||||||
frm.set_value("warehouse", data.message.default_warehouse);
|
frm.set_value('warehouse', data.message.default_warehouse);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
frm.set_value("consume_stock", 0);
|
frm.set_value('consume_stock', 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
service_unit: function(frm) {
|
service_unit: function(frm) {
|
||||||
if(frm.doc.service_unit){
|
if (frm.doc.service_unit) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "frappe.client.get_value",
|
method: 'frappe.client.get_value',
|
||||||
args:{
|
args:{
|
||||||
fieldname: "warehouse",
|
fieldname: 'warehouse',
|
||||||
doctype: "Healthcare Service Unit",
|
doctype: 'Healthcare Service Unit',
|
||||||
filters:{name: frm.doc.service_unit},
|
filters:{name: frm.doc.service_unit},
|
||||||
},
|
},
|
||||||
callback: function(data) {
|
callback: function(data) {
|
||||||
if(data.message){
|
if (data.message) {
|
||||||
frm.set_value("warehouse", data.message.warehouse);
|
frm.set_value('warehouse', data.message.warehouse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
practitioner: function(frm) {
|
practitioner: function(frm) {
|
||||||
if(frm.doc.practitioner){
|
if (frm.doc.practitioner) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
"method": "frappe.client.get",
|
'method': 'frappe.client.get',
|
||||||
args: {
|
args: {
|
||||||
doctype: "Healthcare Practitioner",
|
doctype: 'Healthcare Practitioner',
|
||||||
name: frm.doc.practitioner
|
name: frm.doc.practitioner
|
||||||
},
|
},
|
||||||
callback: function (data) {
|
callback: function (data) {
|
||||||
frappe.model.set_value(frm.doctype,frm.docname, "medical_department",data.message.department);
|
frappe.model.set_value(frm.doctype,frm.docname, 'medical_department',data.message.department);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
cur_frm.set_query("procedure_template", function(doc) {
|
cur_frm.set_query('procedure_template', function(doc) {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
'medical_department': doc.medical_department
|
'medical_department': doc.medical_department
|
||||||
@ -249,31 +254,31 @@ cur_frm.set_query("procedure_template", function(doc) {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
cur_frm.set_query("appointment", function() {
|
cur_frm.set_query('appointment', function() {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
status:['in',["Open"]]
|
status:['in',['Open']]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on('Clinical Procedure Item', {
|
frappe.ui.form.on('Clinical Procedure Item', {
|
||||||
qty: function(frm, cdt, cdn){
|
qty: function(frm, cdt, cdn) {
|
||||||
var d = locals[cdt][cdn];
|
let d = locals[cdt][cdn];
|
||||||
frappe.model.set_value(cdt, cdn, "transfer_qty", d.qty*d.conversion_factor);
|
frappe.model.set_value(cdt, cdn, 'transfer_qty', d.qty*d.conversion_factor);
|
||||||
},
|
},
|
||||||
uom: function(doc, cdt, cdn){
|
uom: function(doc, cdt, cdn) {
|
||||||
var d = locals[cdt][cdn];
|
let d = locals[cdt][cdn];
|
||||||
if(d.uom && d.item_code){
|
if (d.uom && d.item_code) {
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
method: "erpnext.stock.doctype.stock_entry.stock_entry.get_uom_details",
|
method: 'erpnext.stock.doctype.stock_entry.stock_entry.get_uom_details',
|
||||||
args: {
|
args: {
|
||||||
item_code: d.item_code,
|
item_code: d.item_code,
|
||||||
uom: d.uom,
|
uom: d.uom,
|
||||||
qty: d.qty
|
qty: d.qty
|
||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(r.message) {
|
if (r.message) {
|
||||||
frappe.model.set_value(cdt, cdn, r.message);
|
frappe.model.set_value(cdt, cdn, r.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -281,25 +286,25 @@ frappe.ui.form.on('Clinical Procedure Item', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
item_code: function(frm, cdt, cdn) {
|
item_code: function(frm, cdt, cdn) {
|
||||||
var d = locals[cdt][cdn];
|
let d = locals[cdt][cdn];
|
||||||
let args = null;
|
let args = null;
|
||||||
if(d.item_code) {
|
if (d.item_code) {
|
||||||
args = {
|
args = {
|
||||||
'doctype' : "Clinical Procedure",
|
'doctype' : 'Clinical Procedure',
|
||||||
'item_code' : d.item_code,
|
'item_code' : d.item_code,
|
||||||
'company' : frm.doc.company,
|
'company' : frm.doc.company,
|
||||||
'warehouse': frm.doc.warehouse
|
'warehouse': frm.doc.warehouse
|
||||||
};
|
};
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
method: "erpnext.stock.get_item_details.get_item_details",
|
method: 'erpnext.stock.get_item_details.get_item_details',
|
||||||
args: {args: args},
|
args: {args: args},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(r.message) {
|
if (r.message) {
|
||||||
frappe.model.set_value(cdt, cdn, "item_name", r.message.item_name);
|
frappe.model.set_value(cdt, cdn, 'item_name', r.message.item_name);
|
||||||
frappe.model.set_value(cdt, cdn, "stock_uom", r.message.stock_uom);
|
frappe.model.set_value(cdt, cdn, 'stock_uom', r.message.stock_uom);
|
||||||
frappe.model.set_value(cdt, cdn, "conversion_factor", r.message.conversion_factor);
|
frappe.model.set_value(cdt, cdn, 'conversion_factor', r.message.conversion_factor);
|
||||||
frappe.model.set_value(cdt, cdn, "actual_qty", r.message.actual_qty);
|
frappe.model.set_value(cdt, cdn, 'actual_qty', r.message.actual_qty);
|
||||||
refresh_field("items");
|
refresh_field('items');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -307,16 +312,16 @@ frappe.ui.form.on('Clinical Procedure Item', {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var calculate_age = function(birth) {
|
let calculate_age = function(birth) {
|
||||||
var ageMS = Date.parse(Date()) - Date.parse(birth);
|
let ageMS = Date.parse(Date()) - Date.parse(birth);
|
||||||
var age = new Date();
|
let age = new Date();
|
||||||
age.setTime(ageMS);
|
age.setTime(ageMS);
|
||||||
var years = age.getFullYear() - 1970;
|
let years = age.getFullYear() - 1970;
|
||||||
return years + " Year(s) " + age.getMonth() + " Month(s) " + age.getDate() + " Day(s)";
|
return years + ' Year(s) ' + age.getMonth() + ' Month(s) ' + age.getDate() + ' Day(s)';
|
||||||
};
|
};
|
||||||
|
|
||||||
// List Stock items
|
// List Stock items
|
||||||
cur_frm.set_query("item_code", "items", function() {
|
cur_frm.set_query('item_code', 'items', function() {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
is_stock_item:1
|
is_stock_item:1
|
||||||
|
@ -14,6 +14,7 @@ from erpnext.stock.get_item_details import get_item_details
|
|||||||
|
|
||||||
class ClinicalProcedure(Document):
|
class ClinicalProcedure(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
self.set_status()
|
||||||
if self.consume_stock and not self.status == 'Draft':
|
if self.consume_stock and not self.status == 'Draft':
|
||||||
if not self.warehouse:
|
if not self.warehouse:
|
||||||
frappe.throw(_("Set warehouse for Procedure {0} ").format(self.name))
|
frappe.throw(_("Set warehouse for Procedure {0} ").format(self.name))
|
||||||
@ -42,6 +43,15 @@ class ClinicalProcedure(Document):
|
|||||||
frappe.db.set_value("Clinical Procedure", self.name, "sample", sample_collection.name)
|
frappe.db.set_value("Clinical Procedure", self.name, "sample", sample_collection.name)
|
||||||
self.reload()
|
self.reload()
|
||||||
|
|
||||||
|
def set_status(self):
|
||||||
|
if self.docstatus == 0:
|
||||||
|
self.status = 'Draft'
|
||||||
|
elif self.docstatus == 1:
|
||||||
|
if self.status not in ['In Progress', 'Completed']:
|
||||||
|
self.status = 'Pending'
|
||||||
|
elif self.docstatus == 2:
|
||||||
|
self.status = 'Cancelled'
|
||||||
|
|
||||||
def complete(self):
|
def complete(self):
|
||||||
if self.consume_stock and self.items:
|
if self.consume_stock and self.items:
|
||||||
create_stock_entry(self)
|
create_stock_entry(self)
|
||||||
@ -83,7 +93,7 @@ class ClinicalProcedure(Document):
|
|||||||
self.status = 'In Progress'
|
self.status = 'In Progress'
|
||||||
insert_clinical_procedure_to_medical_record(self)
|
insert_clinical_procedure_to_medical_record(self)
|
||||||
else:
|
else:
|
||||||
self.status = 'Draft'
|
self.status = 'Pending'
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def set_actual_qty(self):
|
def set_actual_qty(self):
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
frappe.listview_settings['Clinical Procedure'] = {
|
||||||
|
get_indicator: function(doc) {
|
||||||
|
var colors = {
|
||||||
|
'Completed': 'green',
|
||||||
|
'In Progress': 'orange',
|
||||||
|
'Pending': 'orange',
|
||||||
|
'Cancelled': 'grey'
|
||||||
|
};
|
||||||
|
return [__(doc.status), colors[doc.status], 'status,=,' + doc.status];
|
||||||
|
}
|
||||||
|
};
|
@ -47,6 +47,7 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Item Code",
|
"label": "Item Code",
|
||||||
"options": "Item",
|
"options": "Item",
|
||||||
|
"read_only_depends_on": "eval: !doc.__islocal ",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -175,7 +176,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-02-28 13:20:23.692613",
|
"modified": "2020-02-28 14:16:13.184981",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Healthcare",
|
"module": "Healthcare",
|
||||||
"name": "Clinical Procedure Template",
|
"name": "Clinical Procedure Template",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user