@@ -38,4 +33,6 @@
+
+
diff --git a/netforce_clinic/models/report_medical_summary.py b/netforce_clinic/models/report_medical_summary.py
index 9110b4b..a83c6e1 100644
--- a/netforce_clinic/models/report_medical_summary.py
+++ b/netforce_clinic/models/report_medical_summary.py
@@ -86,8 +86,12 @@ class ReportMedicalSummary(Model):
dom=[]
dom.append(['type','=','stock'])
dom.append(['report_visible','=',True])
- if prod_categ_id:
- dom.append(['categ_id.id','child_of',prod_categ_id])
+ st=get_model("clinic.setting").browse(1)
+ ct_ids=[]
+ for categ in st.product_categ_view:
+ ct_ids.append(categ.id)
+ if ct_ids:
+ dom.append(['categ_id.id','in',ct_ids])
categ_ids=set()
for prod in get_model("product").search_browse(dom):
prod_code=prod.code or ""
@@ -124,10 +128,6 @@ class ReportMedicalSummary(Model):
continue
if categ and categ.id not in list(categ_ids):
continue
- #if line.type=='fee' or prod.type=='service':
- #continue
- #if prod_categ_id and prod_categ_id != prod.categ_id.id:
- #continue
products[prod_code][patient_type_id]['qty']+=line.qty
lines=[]
diff --git a/netforce_clinic/models/setting.py b/netforce_clinic/models/setting.py
index 10ee472..907a73f 100644
--- a/netforce_clinic/models/setting.py
+++ b/netforce_clinic/models/setting.py
@@ -1,4 +1,3 @@
-import time
from datetime import datetime, timedelta
from calendar import monthrange
@@ -54,7 +53,6 @@ class ClinicSetting(Model):
'schd_to': fields.Date("To"),
'department_id': fields.Many2One("clinic.department","Department"),
'branch_id': fields.Many2One("clinic.branch","Branch"),
- 'shop_categs': fields.Many2Many("product.categ","Categs"),
'shop_type_id': fields.Many2One("clinic.patient.type","Patient Type"),
'skip_type_id': fields.Many2One("clinic.patient.type","Skip Type"), # Matching HD Case
"cash_account_id": fields.Many2One("account.account","Cash Account",multi_company=True),
@@ -65,6 +63,7 @@ class ClinicSetting(Model):
'next_date': fields.DateTime("Next Gen"),
'staff_from_id': fields.Many2One("clinic.staff","Staff From"),
'staff_to_id': fields.Many2One("clinic.staff","Staff To"),
+ 'product_categ_view': fields.Many2Many("product.categ","Product Category View"),
}
_defaults={
diff --git a/netforce_clinic/reports/report_cycle_item.xlsx b/netforce_clinic/reports/report_cycle_item.xlsx
index d867e67..fc1e5b1 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 b5b150a..5cab149 100644
--- a/netforce_clinic/templates/report_cycle_item.hbs
+++ b/netforce_clinic/templates/report_cycle_item.hbs
@@ -49,7 +49,7 @@
รวม |
|
{{no}} |
-
+ |
{{#each epo_items}}
{{name}} = {{qty}}
{{/each}}
|