diff --git a/netforce_clinic/layouts/clinic_cycle_dialy_form.xml b/netforce_clinic/layouts/clinic_cycle_dialy_form.xml index bc256ab..1810c58 100644 --- a/netforce_clinic/layouts/clinic_cycle_dialy_form.xml +++ b/netforce_clinic/layouts/clinic_cycle_dialy_form.xml @@ -15,8 +15,8 @@ - - + +
diff --git a/netforce_clinic/models/cycle_dialy.py b/netforce_clinic/models/cycle_dialy.py index 574ef04..aa3fb21 100644 --- a/netforce_clinic/models/cycle_dialy.py +++ b/netforce_clinic/models/cycle_dialy.py @@ -2,6 +2,7 @@ import time from netforce.model import Model, fields from netforce.access import get_active_company, get_active_user +from netforce.utils import get_data_path class CycleDialy(Model): _name="clinic.cycle.dialy" @@ -93,5 +94,20 @@ class CycleDialy(Model): }, 'flash':'Draft!', } + + def onchange_line(self,context={}): + data=context['data'] + path=context['path'] + line=get_data_path(data,path,parent=True) + qty=line['qty'] + rate=line['rate'] + line['amount']=qty*rate + total=0.0 + for line in data['lines']: + qty=line['qty'] + rate=line['rate'] + total+=qty*rate + data['total']=total + return data CycleDialy.register() diff --git a/netforce_clinic/reports/report_nurse_fee_detail.xlsx b/netforce_clinic/reports/report_nurse_fee_detail.xlsx index 74f749f..57c7747 100644 Binary files a/netforce_clinic/reports/report_nurse_fee_detail.xlsx and b/netforce_clinic/reports/report_nurse_fee_detail.xlsx differ diff --git a/netforce_clinic/reports/report_nurse_fee_sum.xlsx b/netforce_clinic/reports/report_nurse_fee_sum.xlsx index 74f749f..68697ad 100644 Binary files a/netforce_clinic/reports/report_nurse_fee_sum.xlsx and b/netforce_clinic/reports/report_nurse_fee_sum.xlsx differ