diff --git a/netforce_clinic/models/account_payment.py b/netforce_clinic/models/account_payment.py index 1a4b701..e8f1172 100644 --- a/netforce_clinic/models/account_payment.py +++ b/netforce_clinic/models/account_payment.py @@ -80,7 +80,6 @@ class AccountPayment(Model): 'partner_id': partner_id } res[account_id]['credit']+=amt - settings=get_model("settings").browse(1) if obj.type=="in": journal_id=obj.journal_id.id or settings.pay_in_journal_id.id diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index 4df3ce9..4e260de 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -82,19 +82,25 @@ class HDCase(Model): for dlz in obj.dialyzers: dz=dlz.dialyzer_id dlz_id=dz.id - name=dz.name or "" - name=name.split()[-1] + prod=dz.product_id + #name=dz.name or "" + #name=name.split()[-1] + name=prod.description dlz_name.append(name) dlz_use+=dlz.use_time or 0 dlz_max+=dlz.max_use_time or 0 dlz_name=','.join([dlz for dlz in dlz_name]) names=[] fee=0 + sign=1 + if obj.state=='waiting_payment': + sign=-1 for line in obj.lines: amt=line.amount or 0 prod=line.product_id categ=line.product_categ_id - if categ and prod and line.reimbursable=='yes': + if categ and prod: + #if categ and prod and line.reimbursable=='yes': if categ.code=='EPO': name=prod.name or "" name=name.split("-") #XXX @@ -102,7 +108,7 @@ class HDCase(Model): name=name[0].title() names.append(name) elif categ.code=='FEE': - fee+=amt + fee+=amt*sign res[obj.id]={ 'epo': ','.join([n for n in names]), 'fee': fee, diff --git a/netforce_clinic/models/import_payment.py b/netforce_clinic/models/import_payment.py index 358b16f..9911102 100644 --- a/netforce_clinic/models/import_payment.py +++ b/netforce_clinic/models/import_payment.py @@ -350,5 +350,4 @@ class ImportPayment(Model): data['is_uc']=is_uc return data - ImportPayment.register() diff --git a/netforce_clinic/models/report_cycle_item.py b/netforce_clinic/models/report_cycle_item.py index 734d207..c7784e0 100644 --- a/netforce_clinic/models/report_cycle_item.py +++ b/netforce_clinic/models/report_cycle_item.py @@ -92,9 +92,16 @@ class ReportCycleItem(Model): cycle=hdcase.cycle_id dpt=hdcase.department_id dlz_use=hdcase.dlz_use or 0 + dlz_drop=False if dlz_use==hdcase.dlz_max: dlz_use="%sทิ้ง"%dlz_use + dlz_drop=True + cancel=False + if hdcase.state=='cancelled': + cancel=True lines.append({ + 'dlz_drop': dlz_drop, + 'cancel': cancel, 'pname': patient.name or '', 'pid': patient.id or '', 'hn': patient.hn_no, diff --git a/netforce_clinic/reports/report_cycle_item.xlsx b/netforce_clinic/reports/report_cycle_item.xlsx index dc677d6..52d8efc 100644 Binary files a/netforce_clinic/reports/report_cycle_item.xlsx and b/netforce_clinic/reports/report_cycle_item.xlsx differ diff --git a/netforce_clinic/templates/report_cycle_item.hbs b/netforce_clinic/templates/report_cycle_item.hbs index 87fdc25..2975869 100644 --- a/netforce_clinic/templates/report_cycle_item.hbs +++ b/netforce_clinic/templates/report_cycle_item.hbs @@ -21,14 +21,18 @@ {{#each lines }} + {{#if cancel}} + + {{else}} + {{/if}} {{no}} {{date}} {{cname}} {{pname}} {{dname}} {{tname}} - {{currency fee zero=""}} + {{fee}} {{epo}} {{dlz_name}} {{dlz_use}} diff --git a/netforce_clinic/todo.txt b/netforce_clinic/todo.txt index 83a1ba0..7a920c0 100644 --- a/netforce_clinic/todo.txt +++ b/netforce_clinic/todo.txt @@ -1,11 +1,14 @@ - report - walkin -- receipt -- merge data +- receipt ** + - +- updaete & merge data - patient - doctor - +- *** template: + - change company name in all report template ==== -ต้องมี เมนู + +improvement: 1. ย้ายผู้ป่วย 2. ปรับ level