diff --git a/netforce_clinic/actions/clinic_invoice_payment.xml b/netforce_clinic/actions/clinic_invoice_payment.xml index b1da7a7..a27ada9 100644 --- a/netforce_clinic/actions/clinic_invoice_payment.xml +++ b/netforce_clinic/actions/clinic_invoice_payment.xml @@ -1,5 +1,5 @@ - Invoice Payment + Payment Invoice multi_view clinic.invoice.payment account_menu diff --git a/netforce_clinic/actions/clinic_matching_hdcase_acc.xml b/netforce_clinic/actions/clinic_matching_hdcase_acc.xml index a8f9999..643723a 100644 --- a/netforce_clinic/actions/clinic_matching_hdcase_acc.xml +++ b/netforce_clinic/actions/clinic_matching_hdcase_acc.xml @@ -1,5 +1,5 @@ - HD Cases Matching + Matching HD Cases report clinic.matching.hdcase matching_hdcase diff --git a/netforce_clinic/layouts/clinic_account_menu.xml b/netforce_clinic/layouts/clinic_account_menu.xml index 2dc7e89..12fd036 100644 --- a/netforce_clinic/layouts/clinic_account_menu.xml +++ b/netforce_clinic/layouts/clinic_account_menu.xml @@ -2,9 +2,9 @@ - - - + + +
diff --git a/netforce_clinic/layouts/clinic_staff_form.xml b/netforce_clinic/layouts/clinic_staff_form.xml index 5a0b1a7..373e897 100644 --- a/netforce_clinic/layouts/clinic_staff_form.xml +++ b/netforce_clinic/layouts/clinic_staff_form.xml @@ -12,6 +12,7 @@ + @@ -22,7 +23,6 @@ - diff --git a/netforce_clinic/migrations/__init__.py b/netforce_clinic/migrations/__init__.py index 26a92cc..bde9b20 100644 --- a/netforce_clinic/migrations/__init__.py +++ b/netforce_clinic/migrations/__init__.py @@ -1,4 +1,4 @@ from . import clinic_setting -from . import remove_conv_bal -from . import import_acc +#from . import remove_conv_bal +#from . import import_acc #from . import update_labor_cost_line diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index bbd8bd0..4a01097 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -322,7 +322,7 @@ class HDCase(Model): rmb_amt=0.0 for line in data['lines']: amt=line['amount'] or 0.0 - reimbursable=line['reimbursable'] + reimbursable=line.get('reimbursable','no') if reimbursable=='yes': rmb_amt+=amt else: diff --git a/netforce_clinic/models/invoice_payment.py b/netforce_clinic/models/invoice_payment.py index 7210130..6442e07 100644 --- a/netforce_clinic/models/invoice_payment.py +++ b/netforce_clinic/models/invoice_payment.py @@ -6,7 +6,7 @@ from netforce.access import get_active_company, get_active_user class InvoicePayment(Model): _name="clinic.invoice.payment" - _string="Invoice Payment" + _string="Payment Invoice" def _get_all(self,ids,context={}): res={} diff --git a/netforce_clinic/models/matching_payment.py b/netforce_clinic/models/matching_payment.py index 59c3e86..644c886 100644 --- a/netforce_clinic/models/matching_payment.py +++ b/netforce_clinic/models/matching_payment.py @@ -9,7 +9,8 @@ from . import utils class MatchingPayment(Model): _name="clinic.matching.payment" - _transient=True + _string="Payment Matching" + #_transient=True def _get_store(self,ids,context={}): res={} @@ -512,7 +513,7 @@ class MatchingPayment(Model): def write(self,ids,vals,**kw): super().write(ids,vals,**kw) self.function_store(ids) - + def get_data(self,context={}): data={} return data diff --git a/netforce_clinic/models/setting.py b/netforce_clinic/models/setting.py index f891ec3..8820633 100644 --- a/netforce_clinic/models/setting.py +++ b/netforce_clinic/models/setting.py @@ -110,15 +110,48 @@ class ClinicSetting(Model): if user_id !=1: print("Only admin!!") return - cbv_id=24 - cbv=get_model("conv.bal").browse(cbv_id) - cbv.write({ - 'file': 'ap.csv', - }) - fname=get_file_path(cbv.file) - f=open(fname,"r") - rows=f.read().split("\n") - db=get_connection() + for citem in get_model("clinic.cycle.item").search_browse([]): + for line in citem.lines: + nurse=line.nurse_id + level=nurse.level_id + if level: + line.write({ + 'level_id': level.id + }) + print("Done!") + + def update_departments(self,ids,context={}): + user_id=get_active_user() + if user_id !=1: + print("Only admin!!") + return + for st in get_model("clinic.staff").search_browse([]): + dpt_ids=set() + if st.departmet_id: + dpt_ids.update({st.departmet_id.id}) + if st.type=='doctor': + for hdcase in st.hd_case_staffs: + dpt_ids.update({hdcase.department_id.id}) + elif st.type=='nurse': + for citem in st.cycle_item_nurses: + dpt_ids.update({citem.department_id.id}) + else: + continue + #FIXME + db=get_connection() + for dpt_id in dpt_ids: + if not dpt_id: + continue + sql="insert into m2m_clinic_department_clinic_staff values(%s,%s)"%(st.id, dpt_id) + # clinic_staff_id + # clinic_department_id + db.execute(sql) + #st.write({ + #'departments': {'add': [1]}, + #}) + #break + print('update dpt %s'%st.name) + print("Done!") def update_staff_contact(self,ids,context={}): diff --git a/netforce_clinic/models/shop.py b/netforce_clinic/models/shop.py index f3f7ab0..45607a5 100644 --- a/netforce_clinic/models/shop.py +++ b/netforce_clinic/models/shop.py @@ -524,6 +524,8 @@ class Shop(Model): is_draft=shop.state=='draft' and True or False is_cheque=False pay_type=shop.pay_type or '' + user_id=get_active_user() + user=get_model("base.user").browse(user_id) data={ 'comp_name': comp.name or '', 'comp_addr': comp_addr or '', @@ -540,6 +542,7 @@ class Shop(Model): 'total_text': utils.num2word(amount_total), 'is_cheque': is_cheque, 'is_draft': is_draft, + 'user_name': user.name or "", } blank_dot='' if pay_type=='cash': diff --git a/netforce_clinic/reports/cust_payment.odt b/netforce_clinic/reports/cust_payment.odt index 6d350f5..70f9b65 100644 Binary files a/netforce_clinic/reports/cust_payment.odt and b/netforce_clinic/reports/cust_payment.odt differ