diff --git a/clinic.egg-info/PKG-INFO b/clinic.egg-info/PKG-INFO
new file mode 100644
index 0000000..14a4774
--- /dev/null
+++ b/clinic.egg-info/PKG-INFO
@@ -0,0 +1,10 @@
+Metadata-Version: 1.0
+Name: clinic
+Version: 0.1.0
+Summary: Ratchawat Clinic module
+Home-page: UNKNOWN
+Author: UNKNOWN
+Author-email: UNKNOWN
+License: UNKNOWN
+Description: UNKNOWN
+Platform: UNKNOWN
diff --git a/clinic.egg-info/SOURCES.txt b/clinic.egg-info/SOURCES.txt
new file mode 100644
index 0000000..c09962f
--- /dev/null
+++ b/clinic.egg-info/SOURCES.txt
@@ -0,0 +1,9 @@
+setup.py
+clinic/__init__.py
+clinic.egg-info/PKG-INFO
+clinic.egg-info/SOURCES.txt
+clinic.egg-info/dependency_links.txt
+clinic.egg-info/top_level.txt
+clinic/controllers/__init__.py
+clinic/models/__init__.py
+clinic/models/clinic_patients.py
\ No newline at end of file
diff --git a/clinic.egg-info/dependency_links.txt b/clinic.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/clinic.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/clinic.egg-info/top_level.txt b/clinic.egg-info/top_level.txt
new file mode 100644
index 0000000..7facd1c
--- /dev/null
+++ b/clinic.egg-info/top_level.txt
@@ -0,0 +1 @@
+clinic
diff --git a/clinic/__init__.py b/clinic/__init__.py
new file mode 100644
index 0000000..f7209b1
--- /dev/null
+++ b/clinic/__init__.py
@@ -0,0 +1,2 @@
+from . import models
+from . import controllers
diff --git a/clinic/__pycache__/__init__.cpython-32.pyc b/clinic/__pycache__/__init__.cpython-32.pyc
new file mode 100644
index 0000000..b8109a4
Binary files /dev/null and b/clinic/__pycache__/__init__.cpython-32.pyc differ
diff --git a/clinic/actions/clinic_board.xml b/clinic/actions/clinic_board.xml
new file mode 100644
index 0000000..304c6f0
--- /dev/null
+++ b/clinic/actions/clinic_board.xml
@@ -0,0 +1,7 @@
+
+ clinic_board
+ clinic board
+ board
+ clinic_board
+ clinic_menu
+
diff --git a/clinic/actions/clinic_doctor.xml b/clinic/actions/clinic_doctor.xml
new file mode 100644
index 0000000..1394a78
--- /dev/null
+++ b/clinic/actions/clinic_doctor.xml
@@ -0,0 +1,7 @@
+
+ Doctor
+ multi_view
+ clinic.doctor
+ [["All",[]],["Draft",[["state","=","draft"]]],["Active",[["state","=","active"]]],["Deactive",[["state","=","deactive"]]]]
+ clinic_menu
+
diff --git a/clinic/actions/clinic_nurse.xml b/clinic/actions/clinic_nurse.xml
new file mode 100644
index 0000000..d321c1b
--- /dev/null
+++ b/clinic/actions/clinic_nurse.xml
@@ -0,0 +1,7 @@
+
+ Nurse
+ multi_view
+ clinic.nurse
+ [["All",[]],["Draft",[["state","=","draft"]]],["Active",[["state","=","active"]]],["Deactive",[["state","=","deactive"]]]]
+ clinic_menu
+
diff --git a/clinic/actions/clinic_patient.xml b/clinic/actions/clinic_patient.xml
new file mode 100644
index 0000000..af9dd00
--- /dev/null
+++ b/clinic/actions/clinic_patient.xml
@@ -0,0 +1,7 @@
+
+ Patient
+ multi_view
+ clinic.patient
+ [["All",[]],["Draft",[["state","=","draft"]]],["Active",[["state","=","active"]]],["Deactive",[["state","=","deactive"]]]]
+ clinic_menu
+
diff --git a/clinic/actions/clinic_visit.xml b/clinic/actions/clinic_visit.xml
new file mode 100644
index 0000000..6afafb2
--- /dev/null
+++ b/clinic/actions/clinic_visit.xml
@@ -0,0 +1,8 @@
+
+ Visit
+ multi_view
+ clinic.visit
+ [["All",[]],["Draft",[["state","=","draft"]]],["Pending",[["state","=","pending"]]],["Confirm",[["state","=","corfirmed"]]]]
+ list,calendar,page,form
+ clinic_menu
+
diff --git a/clinic/actions/clinic_visit_cal_widget.xml b/clinic/actions/clinic_visit_cal_widget.xml
new file mode 100644
index 0000000..22499c3
--- /dev/null
+++ b/clinic/actions/clinic_visit_cal_widget.xml
@@ -0,0 +1,5 @@
+
+ calendar_view
+ Visits
+ clinic.visit
+
diff --git a/clinic/controllers/__init__.py b/clinic/controllers/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/clinic/controllers/__pycache__/__init__.cpython-32.pyc b/clinic/controllers/__pycache__/__init__.cpython-32.pyc
new file mode 100644
index 0000000..0763e0a
Binary files /dev/null and b/clinic/controllers/__pycache__/__init__.cpython-32.pyc differ
diff --git a/clinic/layouts/clinic_board.xml b/clinic/layouts/clinic_board.xml
new file mode 100644
index 0000000..978c5db
--- /dev/null
+++ b/clinic/layouts/clinic_board.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/clinic/layouts/clinic_doctor_form.xml b/clinic/layouts/clinic_doctor_form.xml
new file mode 100644
index 0000000..2aab969
--- /dev/null
+++ b/clinic/layouts/clinic_doctor_form.xml
@@ -0,0 +1,28 @@
+
diff --git a/clinic/layouts/clinic_doctor_list.xml b/clinic/layouts/clinic_doctor_list.xml
new file mode 100644
index 0000000..e3fb4d1
--- /dev/null
+++ b/clinic/layouts/clinic_doctor_list.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/clinic/layouts/clinic_main_menu.xml b/clinic/layouts/clinic_main_menu.xml
new file mode 100644
index 0000000..f0c25ec
--- /dev/null
+++ b/clinic/layouts/clinic_main_menu.xml
@@ -0,0 +1,5 @@
+
+ -
+
+
+
diff --git a/clinic/layouts/clinic_menu.xml b/clinic/layouts/clinic_menu.xml
new file mode 100644
index 0000000..0683d88
--- /dev/null
+++ b/clinic/layouts/clinic_menu.xml
@@ -0,0 +1,15 @@
+
diff --git a/clinic/layouts/clinic_nurse_form.xml b/clinic/layouts/clinic_nurse_form.xml
new file mode 100644
index 0000000..a0c4491
--- /dev/null
+++ b/clinic/layouts/clinic_nurse_form.xml
@@ -0,0 +1,29 @@
+
diff --git a/clinic/layouts/clinic_nurse_list.xml b/clinic/layouts/clinic_nurse_list.xml
new file mode 100644
index 0000000..70825a6
--- /dev/null
+++ b/clinic/layouts/clinic_nurse_list.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/clinic/layouts/clinic_patient_form.xml b/clinic/layouts/clinic_patient_form.xml
new file mode 100644
index 0000000..df30526
--- /dev/null
+++ b/clinic/layouts/clinic_patient_form.xml
@@ -0,0 +1,71 @@
+
diff --git a/clinic/layouts/clinic_patient_list.xml b/clinic/layouts/clinic_patient_list.xml
new file mode 100644
index 0000000..0683595
--- /dev/null
+++ b/clinic/layouts/clinic_patient_list.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/clinic/layouts/clinic_visit_calendar.xml b/clinic/layouts/clinic_visit_calendar.xml
new file mode 100644
index 0000000..24aac59
--- /dev/null
+++ b/clinic/layouts/clinic_visit_calendar.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/clinic/layouts/clinic_visit_form.xml b/clinic/layouts/clinic_visit_form.xml
new file mode 100644
index 0000000..e046c34
--- /dev/null
+++ b/clinic/layouts/clinic_visit_form.xml
@@ -0,0 +1,22 @@
+
diff --git a/clinic/layouts/clinic_visit_list.xml b/clinic/layouts/clinic_visit_list.xml
new file mode 100644
index 0000000..258104b
--- /dev/null
+++ b/clinic/layouts/clinic_visit_list.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/clinic/models/__init__.py b/clinic/models/__init__.py
new file mode 100644
index 0000000..affba20
--- /dev/null
+++ b/clinic/models/__init__.py
@@ -0,0 +1,4 @@
+from . import clinic_patient
+from . import clinic_doctor
+from . import clinic_nurse
+from . import clinic_visit
diff --git a/clinic/models/__pycache__/__init__.cpython-32.pyc b/clinic/models/__pycache__/__init__.cpython-32.pyc
new file mode 100644
index 0000000..4aadd5b
Binary files /dev/null and b/clinic/models/__pycache__/__init__.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/clinic_doctor.cpython-32.pyc b/clinic/models/__pycache__/clinic_doctor.cpython-32.pyc
new file mode 100644
index 0000000..71d3587
Binary files /dev/null and b/clinic/models/__pycache__/clinic_doctor.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/clinic_nurse.cpython-32.pyc b/clinic/models/__pycache__/clinic_nurse.cpython-32.pyc
new file mode 100644
index 0000000..b94fc05
Binary files /dev/null and b/clinic/models/__pycache__/clinic_nurse.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/clinic_patient.cpython-32.pyc b/clinic/models/__pycache__/clinic_patient.cpython-32.pyc
new file mode 100644
index 0000000..6e6bc30
Binary files /dev/null and b/clinic/models/__pycache__/clinic_patient.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/clinic_patients.cpython-32.pyc b/clinic/models/__pycache__/clinic_patients.cpython-32.pyc
new file mode 100644
index 0000000..2e9d508
Binary files /dev/null and b/clinic/models/__pycache__/clinic_patients.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/clinic_visit.cpython-32.pyc b/clinic/models/__pycache__/clinic_visit.cpython-32.pyc
new file mode 100644
index 0000000..ef35f80
Binary files /dev/null and b/clinic/models/__pycache__/clinic_visit.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/competitor.cpython-32.pyc b/clinic/models/__pycache__/competitor.cpython-32.pyc
new file mode 100644
index 0000000..6479df0
Binary files /dev/null and b/clinic/models/__pycache__/competitor.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/convert_lead.cpython-32.pyc b/clinic/models/__pycache__/convert_lead.cpython-32.pyc
new file mode 100644
index 0000000..0222461
Binary files /dev/null and b/clinic/models/__pycache__/convert_lead.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/lead_analysis.cpython-32.pyc b/clinic/models/__pycache__/lead_analysis.cpython-32.pyc
new file mode 100644
index 0000000..ff4f6f4
Binary files /dev/null and b/clinic/models/__pycache__/lead_analysis.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/opport_analysis.cpython-32.pyc b/clinic/models/__pycache__/opport_analysis.cpython-32.pyc
new file mode 100644
index 0000000..e5f23fe
Binary files /dev/null and b/clinic/models/__pycache__/opport_analysis.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/opport_compet.cpython-32.pyc b/clinic/models/__pycache__/opport_compet.cpython-32.pyc
new file mode 100644
index 0000000..9cbdc0e
Binary files /dev/null and b/clinic/models/__pycache__/opport_compet.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/pricelist_add.cpython-32.pyc b/clinic/models/__pycache__/pricelist_add.cpython-32.pyc
new file mode 100644
index 0000000..a1917f5
Binary files /dev/null and b/clinic/models/__pycache__/pricelist_add.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/rch_patient.cpython-32.pyc b/clinic/models/__pycache__/rch_patient.cpython-32.pyc
new file mode 100644
index 0000000..49a97b1
Binary files /dev/null and b/clinic/models/__pycache__/rch_patient.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/report_sale.cpython-32.pyc b/clinic/models/__pycache__/report_sale.cpython-32.pyc
new file mode 100644
index 0000000..92f3aed
Binary files /dev/null and b/clinic/models/__pycache__/report_sale.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_analysis.cpython-32.pyc b/clinic/models/__pycache__/sale_analysis.cpython-32.pyc
new file mode 100644
index 0000000..d5ebc67
Binary files /dev/null and b/clinic/models/__pycache__/sale_analysis.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_cost.cpython-32.pyc b/clinic/models/__pycache__/sale_cost.cpython-32.pyc
new file mode 100644
index 0000000..01489c5
Binary files /dev/null and b/clinic/models/__pycache__/sale_cost.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_coupon.cpython-32.pyc b/clinic/models/__pycache__/sale_coupon.cpython-32.pyc
new file mode 100644
index 0000000..7b38c03
Binary files /dev/null and b/clinic/models/__pycache__/sale_coupon.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_coupon_count.cpython-32.pyc b/clinic/models/__pycache__/sale_coupon_count.cpython-32.pyc
new file mode 100644
index 0000000..97e55b9
Binary files /dev/null and b/clinic/models/__pycache__/sale_coupon_count.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_lead.cpython-32.pyc b/clinic/models/__pycache__/sale_lead.cpython-32.pyc
new file mode 100644
index 0000000..aef2dc3
Binary files /dev/null and b/clinic/models/__pycache__/sale_lead.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_opportunity.cpython-32.pyc b/clinic/models/__pycache__/sale_opportunity.cpython-32.pyc
new file mode 100644
index 0000000..580ea4a
Binary files /dev/null and b/clinic/models/__pycache__/sale_opportunity.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_order.cpython-32.pyc b/clinic/models/__pycache__/sale_order.cpython-32.pyc
new file mode 100644
index 0000000..7051c1a
Binary files /dev/null and b/clinic/models/__pycache__/sale_order.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_order_line.cpython-32.pyc b/clinic/models/__pycache__/sale_order_line.cpython-32.pyc
new file mode 100644
index 0000000..c673302
Binary files /dev/null and b/clinic/models/__pycache__/sale_order_line.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_quot.cpython-32.pyc b/clinic/models/__pycache__/sale_quot.cpython-32.pyc
new file mode 100644
index 0000000..c830058
Binary files /dev/null and b/clinic/models/__pycache__/sale_quot.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_quot_line.cpython-32.pyc b/clinic/models/__pycache__/sale_quot_line.cpython-32.pyc
new file mode 100644
index 0000000..8036317
Binary files /dev/null and b/clinic/models/__pycache__/sale_quot_line.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_stage.cpython-32.pyc b/clinic/models/__pycache__/sale_stage.cpython-32.pyc
new file mode 100644
index 0000000..4efc8f9
Binary files /dev/null and b/clinic/models/__pycache__/sale_stage.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/sale_target.cpython-32.pyc b/clinic/models/__pycache__/sale_target.cpython-32.pyc
new file mode 100644
index 0000000..0c263db
Binary files /dev/null and b/clinic/models/__pycache__/sale_target.cpython-32.pyc differ
diff --git a/clinic/models/__pycache__/utils.cpython-32.pyc b/clinic/models/__pycache__/utils.cpython-32.pyc
new file mode 100644
index 0000000..5bbf221
Binary files /dev/null and b/clinic/models/__pycache__/utils.cpython-32.pyc differ
diff --git a/clinic/models/clinic_doctor.py b/clinic/models/clinic_doctor.py
new file mode 100644
index 0000000..fca0ddb
--- /dev/null
+++ b/clinic/models/clinic_doctor.py
@@ -0,0 +1,54 @@
+from netforce.model import Model, fields, get_model
+from netforce.utils import get_data_path
+import time
+from netforce.access import get_active_user
+from netforce.access import get_active_company
+
+class Doctor(Model):
+ _name="clinic.doctor"
+ _string="Doctor"
+ _audit_log=True
+ _name_field="name"
+ _multi_company=True
+ _fields={
+ "number": fields.Char("Number",required=True,search=True),
+ "name": fields.Char("Name Surname",required=True,search=True),
+ "date": fields.Date("Create Date",required=True,search=True),
+ "birthday": fields.Date("BirthDay",required=True,search=True),
+ "telephone": fields.Char("Telephone",required=True,search=True),
+ "department": fields.Char("Department",required=True,search=True),
+ "mobile": fields.Char("Mobile",required=True,search=True),
+ "state": fields.Selection([("draft","Draft"),("active","Active"),("deactive","Deactive")],"Status",required=True),
+ "addresses": fields.One2Many("address","related_id","Addresses"),
+ "comments": fields.One2Many("message","related_id","Comments"),
+ "patients": fields.Many2Many("clinic.patient","Patients"),
+ "company_id": fields.Many2One("company","Company"),
+ }
+
+ def _get_number(self,context={}):
+ while 1:
+ num=get_model("sequence").get_number("sale_order")
+ if not num:
+ return None
+ res=self.search([["number","=",num]])
+ if not res:
+ return num
+ get_model("sequence").increment("sale_order")
+
+
+ _defaults={
+ "state": "draft",
+ "date": lambda *a: time.strftime("%Y-%m-%d"),
+ "number": _get_number,
+ "company_id": lambda *a: get_active_company(),
+ }
+ _order="date desc,number desc"
+
+
+
+ def void(self,ids,context={}):
+ obj=self.browse(ids)[0]
+ obj.write({"state":"voided"})
+
+
+Doctor.register()
diff --git a/clinic/models/clinic_nurse.py b/clinic/models/clinic_nurse.py
new file mode 100644
index 0000000..99a836e
--- /dev/null
+++ b/clinic/models/clinic_nurse.py
@@ -0,0 +1,54 @@
+from netforce.model import Model, fields, get_model
+from netforce.utils import get_data_path
+import time
+from netforce.access import get_active_user
+from netforce.access import get_active_company
+
+class Nurse(Model):
+ _name="clinic.nurse"
+ _string="Nurse"
+ _audit_log=True
+ _name_field="name"
+ _multi_company=True
+ _fields={
+ "number": fields.Char("Number",required=True,search=True),
+ "name": fields.Char("Name Surname",required=True,search=True),
+ "date": fields.Date("Create Date",required=True,search=True),
+ "birthday": fields.Date("BirthDay",required=True,search=True),
+ "telephone": fields.Char("Telephone",required=True,search=True),
+ "department": fields.Char("Department",required=True,search=True),
+ "mobile": fields.Char("Mobile",required=True,search=True),
+ "state": fields.Selection([("draft","Draft"),("active","Active"),("deactive","Deactive")],"Status",required=True),
+ "addresses": fields.One2Many("address","related_id","Addresses"),
+ "comments": fields.One2Many("message","related_id","Comments"),
+ "patients": fields.Many2Many("clinic.patient","Patients"),
+ "company_id": fields.Many2One("company","Company"),
+ }
+
+ def _get_number(self,context={}):
+ while 1:
+ num=get_model("sequence").get_number("sale_order")
+ if not num:
+ return None
+ res=self.search([["number","=",num]])
+ if not res:
+ return num
+ get_model("sequence").increment("sale_order")
+
+
+ _defaults={
+ "state": "draft",
+ "date": lambda *a: time.strftime("%Y-%m-%d"),
+ "number": _get_number,
+ "company_id": lambda *a: get_active_company(),
+ }
+ _order="date desc,number desc"
+
+
+
+ def void(self,ids,context={}):
+ obj=self.browse(ids)[0]
+ obj.write({"state":"voided"})
+
+
+Nurse.register()
diff --git a/clinic/models/clinic_patient.py b/clinic/models/clinic_patient.py
new file mode 100644
index 0000000..7731f7b
--- /dev/null
+++ b/clinic/models/clinic_patient.py
@@ -0,0 +1,98 @@
+from netforce.model import Model, fields, get_model
+from netforce.utils import get_data_path
+import time
+from netforce.access import get_active_user
+from netforce.access import get_active_company
+
+class Patient(Model):
+ _name="clinic.patient"
+ _string="Partients"
+ _audit_log=True
+ _name_field="number"
+ _multi_company=True
+ _fields={
+ "number": fields.Char("Number",required=True,search=True),
+ "name": fields.Char("Name Surname",required=True,search=True),
+ "date": fields.Date("Create Date",required=True,search=True),
+ "birthday": fields.Date("BirthDay",required=True,search=True),
+ "telephone": fields.Char("Telephone",required=True,search=True),
+ "mobile": fields.Char("Mobile",required=True,search=True),
+ "job": fields.Char("Job"),
+ "age": fields.Integer("Age"),
+ "weight": fields.Integer("Weight (cm)"),
+ "height": fields.Integer("Height (Kg)"),
+ "card_type": fields.Selection([("iden_id","Identity Card"),("passport","Passport")],"ID From",required=True),
+ 'iden_id' : fields.Char("Identity ID"),
+ "app_no": fields.Char("Application No."),
+ "salary": fields.Float("Salary"),
+ 'exp_id' : fields.Date("Expiry Date"),
+ "state": fields.Selection([("draft","Draft"),("active","Active"),("deactive","Deactive")],"Status",required=True),
+ "addresses": fields.One2Many("address","related_id","Addresses"),
+ "gender": fields.Selection([("male","Male"),("female","Female")],"Gendel",required=True),
+ "marital_status": fields.Selection([("single","Single"),("marry","Marry"),("divorce","Divorce"),("separated","Saparated"),("widowed","Widowed")],"Marital Status",required=True),
+ "nationality": fields.Char("Nationality",search=True),
+ "race": fields.Char("Race",search=True),
+ "smoke": fields.Boolean("Smoke ?"),
+ "first_hemodialysis": fields.Date("First time Hemodialysis",required=True),
+ "hemodialysis": fields.Char("First Hemodialysis",required=True),
+ "clinic_after": fields.Selection([("small","Small"),("medium","Medium"),("large","Large")],"Clinic Lastime",required=True),
+ "clinic_after_name": fields.Char("Clinic after name",required=True),
+ "first_permanent_vascular_access": fields.Date("First time Permanent Vascular",required=True),
+ "first_tenckhoff_catheters": fields.Date("First time Tenckhoff Catheters",required=True),
+ "start_date_clinic": fields.Date("Start Date Clinic",required=True),
+ "waiting_transplantation": fields.Boolean("Kidney Transplantation Waiting ?"),
+ "who_transplantation": fields.Char("Who is Transplantation?"),
+ "reason_of_chronic_renal_failure": fields.Char("Reason chronic renal failure ?"),
+ "ac_mi": fields.Boolean("Acute MI"),
+ "co_an": fields.Boolean("Coronary Angioplasty"),
+ "ce_ac": fields.Boolean("Cerebrovascular Accident"),
+ "pvd": fields.Boolean("PVD or Amputation"),
+ "co_he": fields.Boolean("Congestive heart failure"),
+ "hypertnsion": fields.Boolean("Hypertension"),
+ "dia": fields.Boolean("Diabetes"),
+ "copd": fields.Boolean("Copd"),
+ "asthma": fields.Boolean("Asthma"),
+ "pul_tub": fields.Boolean("Pulmonary tuberculosis"),
+ "cancer": fields.Boolean("Cancer"),
+ "cirrhosis": fields.Boolean("Cirrhosis"),
+ "dyslip": fields.Boolean("Dyslipidemia"),
+ "prca": fields.Boolean("PRCA"),
+ "hyperucemia": fields.Boolean("Hyperurinencemia"),
+ "cga": fields.Boolean("Chronic gouty arthitis"),
+ "parathy": fields.Boolean("Parathyroidectomy"),
+ "comarbid": fields.Char("Co-morbid 1"),
+ "comarbid2": fields.Char("Co-morbid 2"),
+ "comments": fields.One2Many("message","related_id","Comments"),
+ "company_id": fields.Many2One("company","Company"),
+ "doctorsss": fields.Many2Many("clinic.doctor","Doctors"),
+ "nurses": fields.Many2Many("clinic.nurse","Nurses"),
+ "visits": fields.One2Many("clinic.visit","patient_id","Visits"),
+ }
+
+ def _get_number(self,context={}):
+ while 1:
+ num=get_model("sequence").get_number("sale_order")
+ if not num:
+ return None
+ res=self.search([["number","=",num]])
+ if not res:
+ return num
+ get_model("sequence").increment("sale_order")
+
+
+ _defaults={
+ "state": "draft",
+ "date": lambda *a: time.strftime("%Y-%m-%d"),
+ "number": _get_number,
+ "company_id": lambda *a: get_active_company(),
+ }
+ _order="date desc,number desc"
+
+
+
+ def void(self,ids,context={}):
+ obj=self.browse(ids)[0]
+ obj.write({"state":"voided"})
+
+
+Patient.register()
diff --git a/clinic/models/clinic_visit.py b/clinic/models/clinic_visit.py
new file mode 100644
index 0000000..16d9b81
--- /dev/null
+++ b/clinic/models/clinic_visit.py
@@ -0,0 +1,51 @@
+from netforce.model import Model, fields, get_model
+from netforce.utils import get_data_path
+import time
+from netforce.access import get_active_user
+from netforce.access import get_active_company
+
+class Visit(Model):
+ _name="clinic.visit"
+ _string="Visit"
+ _audit_log=True
+ _name_field="number"
+ _multi_company=True
+ _fields={
+ "number": fields.Char("Number",required=True,search=True),
+ "patient_id": fields.Many2One("clinic.patient","Patients",required=True,search=True),
+ "doctor_id": fields.Many2One("clinic.doctor","Doctor",search=True),
+ "nurse_id": fields.Many2One("clinic.nurse","Nurse",search=True),
+ "date": fields.Date("Create Date",required=True,search=True),
+ "department": fields.Char("Department",required=True,search=True),
+ "state": fields.Selection([("draft","Draft"),("pending","Pending"),("confirmed","Confirmed"),("canceled","Canceled")],"Status",required=True),
+ "comments": fields.One2Many("message","related_id","Comments"),
+ "company_id": fields.Many2One("company","Company"),
+ }
+
+ def _get_number(self,context={}):
+ while 1:
+ num=get_model("sequence").get_number("sale_order")
+ if not num:
+ return None
+ res=self.search([["number","=",num]])
+ if not res:
+ return num
+ get_model("sequence").increment("sale_order")
+
+
+ _defaults={
+ "state": "draft",
+ "date": lambda *a: time.strftime("%Y-%m-%d"),
+ "number": _get_number,
+ "company_id": lambda *a: get_active_company(),
+ }
+ _order="date desc,number desc"
+
+
+
+ def void(self,ids,context={}):
+ obj=self.browse(ids)[0]
+ obj.write({"state":"voided"})
+
+
+Visit.register()
diff --git a/clinic/reports/.~lock.quot_form_disc.odt# b/clinic/reports/.~lock.quot_form_disc.odt#
new file mode 100644
index 0000000..34544d8
--- /dev/null
+++ b/clinic/reports/.~lock.quot_form_disc.odt#
@@ -0,0 +1 @@
+cash ,cash,cash-Inspiron,16.06.2014 16:46,file:///home/cash/.config/libreoffice/3;
\ No newline at end of file
diff --git a/clinic/reports/.~lock.sale_form.docx# b/clinic/reports/.~lock.sale_form.docx#
new file mode 100644
index 0000000..3f47279
--- /dev/null
+++ b/clinic/reports/.~lock.sale_form.docx#
@@ -0,0 +1 @@
+David Janssens,datrus,len,19.07.2013 16:42,file:///home/datrus/.config/libreoffice/3;
\ No newline at end of file
diff --git a/clinic/reports/quot_form.odt b/clinic/reports/quot_form.odt
new file mode 100644
index 0000000..a201363
Binary files /dev/null and b/clinic/reports/quot_form.odt differ
diff --git a/clinic/reports/quot_form_disc.odt b/clinic/reports/quot_form_disc.odt
new file mode 100644
index 0000000..e0fe1ee
Binary files /dev/null and b/clinic/reports/quot_form_disc.odt differ
diff --git a/clinic/reports/sale_form.odt b/clinic/reports/sale_form.odt
new file mode 100644
index 0000000..06e7f4f
Binary files /dev/null and b/clinic/reports/sale_form.odt differ
diff --git a/clinic/templates/activ_form_call.xml b/clinic/templates/activ_form_call.xml
new file mode 100644
index 0000000..29ed6fd
--- /dev/null
+++ b/clinic/templates/activ_form_call.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/activ_form_email.xml b/clinic/templates/activ_form_email.xml
new file mode 100644
index 0000000..551d587
--- /dev/null
+++ b/clinic/templates/activ_form_email.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{#ifeq context.data.state "new"}}
+
+
+
+ {{/ifeq}}
+
+
+
diff --git a/clinic/templates/activ_form_event.xml b/clinic/templates/activ_form_event.xml
new file mode 100644
index 0000000..e3a3a78
--- /dev/null
+++ b/clinic/templates/activ_form_event.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/activ_form_meeting.xml b/clinic/templates/activ_form_meeting.xml
new file mode 100644
index 0000000..3451a94
--- /dev/null
+++ b/clinic/templates/activ_form_meeting.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/activ_form_task.xml b/clinic/templates/activ_form_task.xml
new file mode 100644
index 0000000..8cc0450
--- /dev/null
+++ b/clinic/templates/activ_form_task.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/activ_list.xml b/clinic/templates/activ_list.xml
new file mode 100644
index 0000000..082b25b
--- /dev/null
+++ b/clinic/templates/activ_list.xml
@@ -0,0 +1,14 @@
+
+{{include "activ_search" context=context}}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/activ_page.xml b/clinic/templates/activ_page.xml
new file mode 100644
index 0000000..311b3eb
--- /dev/null
+++ b/clinic/templates/activ_page.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/activ_search.xml b/clinic/templates/activ_search.xml
new file mode 100644
index 0000000..a58f31b
--- /dev/null
+++ b/clinic/templates/activ_search.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/clinic/templates/activ_widget.xml b/clinic/templates/activ_widget.xml
new file mode 100644
index 0000000..9510de9
--- /dev/null
+++ b/clinic/templates/activ_widget.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/convert_lead.xml b/clinic/templates/convert_lead.xml
new file mode 100644
index 0000000..b57b829
--- /dev/null
+++ b/clinic/templates/convert_lead.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/exp_revenue_widget.xml b/clinic/templates/exp_revenue_widget.xml
new file mode 100644
index 0000000..8798747
--- /dev/null
+++ b/clinic/templates/exp_revenue_widget.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/clinic/templates/lead_analysis.xml b/clinic/templates/lead_analysis.xml
new file mode 100644
index 0000000..e4e4eed
--- /dev/null
+++ b/clinic/templates/lead_analysis.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{#if context.data.hide_details}}
+
+ {{else}}
+
+ {{/if}}
+
+
+
+
+
+
+ {{#if context.data.domain_str}}
+
+ Filtered By:
+
{{{context.data.domain_str}}}
+
+ {{/if}}
+
+ {{view "action" options=context.data.report_action context=context}}
+
diff --git a/clinic/templates/lead_form.xml b/clinic/templates/lead_form.xml
new file mode 100644
index 0000000..696bca0
--- /dev/null
+++ b/clinic/templates/lead_form.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+ {{#if context.data.id}}
+
+
+
+
+
+ {{#ifeq context.data.state "qualified"}}
+
+ {{/ifeq}}
+
+
+
+
+
+
+ {{/if}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{#ifeq context.data.state "new"}}
+
+ {{/ifeq}}
+
+
+
+
diff --git a/clinic/templates/lead_list.xml b/clinic/templates/lead_list.xml
new file mode 100644
index 0000000..ccee909
--- /dev/null
+++ b/clinic/templates/lead_list.xml
@@ -0,0 +1,14 @@
+
+{{include "lead_search" context=context}}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/lead_page.xml b/clinic/templates/lead_page.xml
new file mode 100644
index 0000000..2266fd8
--- /dev/null
+++ b/clinic/templates/lead_page.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/lead_report_list.xml b/clinic/templates/lead_report_list.xml
new file mode 100644
index 0000000..1f08053
--- /dev/null
+++ b/clinic/templates/lead_report_list.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/lead_search.xml b/clinic/templates/lead_search.xml
new file mode 100644
index 0000000..e68eeb0
--- /dev/null
+++ b/clinic/templates/lead_search.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/clinic/templates/lead_to_contact.xml b/clinic/templates/lead_to_contact.xml
new file mode 100644
index 0000000..633dd69
--- /dev/null
+++ b/clinic/templates/lead_to_contact.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/lead_to_partner.xml b/clinic/templates/lead_to_partner.xml
new file mode 100644
index 0000000..7f5128c
--- /dev/null
+++ b/clinic/templates/lead_to_partner.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/opport_analysis.xml b/clinic/templates/opport_analysis.xml
new file mode 100644
index 0000000..034da1b
--- /dev/null
+++ b/clinic/templates/opport_analysis.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{#if context.data.hide_details}}
+
+ {{else}}
+
+ {{/if}}
+
+
+
+
+
+
+ {{#if context.data.domain_str}}
+
+ Filtered By:
+
{{{context.data.domain_str}}}
+
+ {{/if}}
+
+ {{view "action" options=context.data.report_action context=context}}
+
diff --git a/clinic/templates/opport_form.xml b/clinic/templates/opport_form.xml
new file mode 100644
index 0000000..447caf6
--- /dev/null
+++ b/clinic/templates/opport_form.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+ {{field_value "state" context=context}}
+
+ {{#if context.data.id}}
+
+
+
+
+
+
+
+
+ {{/if}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{#ifeq context.data.state "open"}}
+
+
+ {{/ifeq}}
+ {{#ifin context.data.state "won" "lost"}}
+
+ {{/ifin}}
+
+
+ {{#if context.data.id}}
+
+ {{/if}}
+
+
diff --git a/clinic/templates/opport_list.xml b/clinic/templates/opport_list.xml
new file mode 100644
index 0000000..dde5298
--- /dev/null
+++ b/clinic/templates/opport_list.xml
@@ -0,0 +1,14 @@
+
+{{include "opport_search" context=context}}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/opport_page.xml b/clinic/templates/opport_page.xml
new file mode 100644
index 0000000..3a6edf9
--- /dev/null
+++ b/clinic/templates/opport_page.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/opport_report_list.xml b/clinic/templates/opport_report_list.xml
new file mode 100644
index 0000000..34dc470
--- /dev/null
+++ b/clinic/templates/opport_report_list.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/opport_search.xml b/clinic/templates/opport_search.xml
new file mode 100644
index 0000000..fc493b8
--- /dev/null
+++ b/clinic/templates/opport_search.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/clinic/templates/opport_stage_widget.xml b/clinic/templates/opport_stage_widget.xml
new file mode 100644
index 0000000..61a0b51
--- /dev/null
+++ b/clinic/templates/opport_stage_widget.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/clinic/templates/opport_widget.xml b/clinic/templates/opport_widget.xml
new file mode 100644
index 0000000..93034aa
--- /dev/null
+++ b/clinic/templates/opport_widget.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/pricelist_add.xml b/clinic/templates/pricelist_add.xml
new file mode 100644
index 0000000..2c677d9
--- /dev/null
+++ b/clinic/templates/pricelist_add.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/pricelist_form.xml b/clinic/templates/pricelist_form.xml
new file mode 100644
index 0000000..c6c03c9
--- /dev/null
+++ b/clinic/templates/pricelist_form.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ {{#if context.data.id}}
+
+
+
+
+
+
+
+ {{/if}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/pricelist_item_form.xml b/clinic/templates/pricelist_item_form.xml
new file mode 100644
index 0000000..9df8916
--- /dev/null
+++ b/clinic/templates/pricelist_item_form.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/pricelist_item_list.xml b/clinic/templates/pricelist_item_list.xml
new file mode 100644
index 0000000..1defa1e
--- /dev/null
+++ b/clinic/templates/pricelist_item_list.xml
@@ -0,0 +1,9 @@
+
+{{include "pricelist_item_search" context=context}}
+
+
+
+
+
+
+
diff --git a/clinic/templates/pricelist_item_page.xml b/clinic/templates/pricelist_item_page.xml
new file mode 100644
index 0000000..0209e62
--- /dev/null
+++ b/clinic/templates/pricelist_item_page.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/pricelist_item_search.xml b/clinic/templates/pricelist_item_search.xml
new file mode 100644
index 0000000..3ab4fa5
--- /dev/null
+++ b/clinic/templates/pricelist_item_search.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/clinic/templates/pricelist_list.xml b/clinic/templates/pricelist_list.xml
new file mode 100644
index 0000000..8fba2fb
--- /dev/null
+++ b/clinic/templates/pricelist_list.xml
@@ -0,0 +1,9 @@
+
+{{include "pricelist_search" context=context}}
+
+
+
+
+
+
+
diff --git a/clinic/templates/pricelist_page.xml b/clinic/templates/pricelist_page.xml
new file mode 100644
index 0000000..e0c3e61
--- /dev/null
+++ b/clinic/templates/pricelist_page.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/pricelist_search.xml b/clinic/templates/pricelist_search.xml
new file mode 100644
index 0000000..a12607f
--- /dev/null
+++ b/clinic/templates/pricelist_search.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/clinic/templates/quot_form.xml b/clinic/templates/quot_form.xml
new file mode 100644
index 0000000..1d0d0f8
--- /dev/null
+++ b/clinic/templates/quot_form.xml
@@ -0,0 +1,80 @@
+
+
+ {{#ifeq context.data.state "draft"}}
+
+ {{/ifeq}}
+ {{#ifeq context.data.state "waiting_approval"}}
+
+ {{/ifeq}}
+ {{#ifeq context.data.state "approved"}}
+
+ {{/ifeq}}
+ {{#ifeq context.data.state "won"}}
+
+ {{/ifeq}}
+ {{#ifeq context.data.state "lost"}}
+
+ {{/ifeq}}
+
+
+
+
+
+ {{field_value "state" context=context}}
+ {{#if context.data.id}}
+
+
+
+
+
+
+
+
+
+
+
+ {{/if}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{#ifin context.data.state "draft" "waiting_approval"}}
+
+
+
+
+ {{/ifin}}
+ {{#ifeq context.data.state "approved"}}
+
+
+ {{/ifeq}}
+ {{#ifin context.data.state "won" "lost"}}
+
+ {{/ifin}}
+
+
+
+
diff --git a/clinic/templates/quot_line_sheet.xml b/clinic/templates/quot_line_sheet.xml
new file mode 100644
index 0000000..8da42c7
--- /dev/null
+++ b/clinic/templates/quot_line_sheet.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/quot_list.xml b/clinic/templates/quot_list.xml
new file mode 100644
index 0000000..a9b17b0
--- /dev/null
+++ b/clinic/templates/quot_list.xml
@@ -0,0 +1,15 @@
+
+{{include "quot_search" context=context}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/quot_page.xml b/clinic/templates/quot_page.xml
new file mode 100644
index 0000000..3b4a57f
--- /dev/null
+++ b/clinic/templates/quot_page.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/quot_rlist.xml b/clinic/templates/quot_rlist.xml
new file mode 100644
index 0000000..f2e0a36
--- /dev/null
+++ b/clinic/templates/quot_rlist.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/quot_search.xml b/clinic/templates/quot_search.xml
new file mode 100644
index 0000000..fb12a0e
--- /dev/null
+++ b/clinic/templates/quot_search.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/clinic/templates/quot_to_sale.xml b/clinic/templates/quot_to_sale.xml
new file mode 100644
index 0000000..12c240a
--- /dev/null
+++ b/clinic/templates/quot_to_sale.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/quot_widget.xml b/clinic/templates/quot_widget.xml
new file mode 100644
index 0000000..fc4d5c1
--- /dev/null
+++ b/clinic/templates/quot_widget.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/report_opport_user.xml b/clinic/templates/report_opport_user.xml
new file mode 100644
index 0000000..0ddaca6
--- /dev/null
+++ b/clinic/templates/report_opport_user.xml
@@ -0,0 +1,40 @@
+
+
+ Opportunities by Salesperson
+
+
+ {{context.company_name}}
+
+ From {{context.data.date_from}} to {{context.data.date_to}}
+
+
+
+
+
+
+ Salesperson
+ |
+ {{#each context.data.stages}}
+
+ {{this}}
+ |
+ {{/each}}
+
+
+
+ {{#each context.data.lines}}
+
+
+
+ {{user_name}}
+
+ |
+ {{#each amounts}}
+
+ {{this}}
+ |
+ {{/each}}
+
+ {{/each}}
+
+
diff --git a/clinic/templates/report_opport_user_page.xml b/clinic/templates/report_opport_user_page.xml
new file mode 100644
index 0000000..de348d2
--- /dev/null
+++ b/clinic/templates/report_opport_user_page.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/report_sale_cust.xml b/clinic/templates/report_sale_cust.xml
new file mode 100644
index 0000000..406ec56
--- /dev/null
+++ b/clinic/templates/report_sale_cust.xml
@@ -0,0 +1,67 @@
+
+
+ Sales by Customer
+
+
+ {{context.company_name}}
+
+ For the month ended {{context.data.date_to}}
+
+
+
+
+
+
+ Partner
+ |
+
+ {{context.data.month0}}
+ |
+
+ {{context.data.month1}}
+ |
+
+ {{context.data.month2}}
+ |
+
+ {{context.data.month3}}
+ |
+
+ Total
+ |
+
+
+
+ {{#each_group context.data.lines "categ_name"}}
+
+
+ {{categ_name}}
+ |
+
+ {{#each group_items}}
+
+
+
+ {{partner_name}}
+
+ |
+
+ {{month0}}
+ |
+
+ {{month1}}
+ |
+
+ {{month2}}
+ |
+
+ {{month3}}
+ |
+
+ {{total}}
+ |
+
+ {{/each}}
+ {{/each_group}}
+
+
diff --git a/clinic/templates/report_sale_cust_page.xml b/clinic/templates/report_sale_cust_page.xml
new file mode 100644
index 0000000..1370b07
--- /dev/null
+++ b/clinic/templates/report_sale_cust_page.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/report_sale_prod.xml b/clinic/templates/report_sale_prod.xml
new file mode 100644
index 0000000..3e425c0
--- /dev/null
+++ b/clinic/templates/report_sale_prod.xml
@@ -0,0 +1,91 @@
+
+
+ Sales by Product
+
+
+ {{context.company_name}}
+
+ From {{context.data.date_from}} to {{context.data.date_to}}
+
+
+
+
+
+
+ Product
+ |
+
+ Current Unit Price
+ |
+
+ Qty Sold
+ |
+
+ Total
+ |
+
+ Avg. Price
+ |
+
+
+
+ {{#each_group context.data.lines "categ_name" sum="amount"}}
+
+
+ {{categ_name}}
+ |
+
+ {{#each group_items}}
+
+
+
+ {{product_name}}
+
+ |
+
+ {{product_price}}
+ |
+
+
+ {{qty}}
+
+ |
+
+
+ {{currency amount}}
+
+ |
+
+
+ {{currency avg_price}}
+
+ |
+
+ {{/each}}
+
+
+ Total {{categ_name}}
+ |
+ |
+ |
+ {{sum.amount}} |
+
+ {{/each_group}}
+
+
+
+
+ Total
+ |
+
+ {{context.data.total_qty}}
+ |
+
+ {{currency context.data.total_amount}}
+ |
+
+ {{currency context.data.total_avg_price}}
+ |
+
+
+
diff --git a/clinic/templates/report_sale_prod_page.xml b/clinic/templates/report_sale_prod_page.xml
new file mode 100644
index 0000000..0bfc32a
--- /dev/null
+++ b/clinic/templates/report_sale_prod_page.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/report_sale_user.xml b/clinic/templates/report_sale_user.xml
new file mode 100644
index 0000000..580de74
--- /dev/null
+++ b/clinic/templates/report_sale_user.xml
@@ -0,0 +1,60 @@
+
+
+ Sales by Salesperson
+
+
+ {{context.company_name}}
+
+ For the month ended {{context.data.date_to}}
+
+
+
+
+
+
+ Salesperson
+ |
+
+ {{context.data.month0}}
+ |
+
+ {{context.data.month1}}
+ |
+
+ {{context.data.month2}}
+ |
+
+ {{context.data.month3}}
+ |
+
+ Total
+ |
+
+
+
+ {{#each context.data.lines}}
+
+
+
+ {{user_name}}
+
+ |
+
+ {{month0}}
+ |
+
+ {{month1}}
+ |
+
+ {{month2}}
+ |
+
+ {{month3}}
+ |
+
+ {{total}}
+ |
+
+ {{/each}}
+
+
diff --git a/clinic/templates/report_sale_user_page.xml b/clinic/templates/report_sale_user_page.xml
new file mode 100644
index 0000000..a2ef2b7
--- /dev/null
+++ b/clinic/templates/report_sale_user_page.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_analysis.xml b/clinic/templates/sale_analysis.xml
new file mode 100644
index 0000000..bd58349
--- /dev/null
+++ b/clinic/templates/sale_analysis.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{#if context.data.hide_details}}
+
+ {{else}}
+
+ {{/if}}
+
+
+
+
+
+
+ {{#if context.data.domain_str}}
+
+ Filtered By:
+
{{{context.data.domain_str}}}
+
+ {{/if}}
+
+ {{view "action" options=context.data.report_action context=context}}
+
diff --git a/clinic/templates/sale_board.xml b/clinic/templates/sale_board.xml
new file mode 100644
index 0000000..04c0de5
--- /dev/null
+++ b/clinic/templates/sale_board.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_contact_form.xml b/clinic/templates/sale_contact_form.xml
new file mode 100644
index 0000000..932d277
--- /dev/null
+++ b/clinic/templates/sale_contact_form.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_contact_list.xml b/clinic/templates/sale_contact_list.xml
new file mode 100644
index 0000000..ae2f4e9
--- /dev/null
+++ b/clinic/templates/sale_contact_list.xml
@@ -0,0 +1,9 @@
+
+{{#if context.data}}
+
+{{/if}}
+
+
+
+
+
diff --git a/clinic/templates/sale_contact_page.xml b/clinic/templates/sale_contact_page.xml
new file mode 100644
index 0000000..629f63a
--- /dev/null
+++ b/clinic/templates/sale_contact_page.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/sale_customer_widget.xml b/clinic/templates/sale_customer_widget.xml
new file mode 100644
index 0000000..8ce752e
--- /dev/null
+++ b/clinic/templates/sale_customer_widget.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/clinic/templates/sale_form.xml b/clinic/templates/sale_form.xml
new file mode 100644
index 0000000..b9d8175
--- /dev/null
+++ b/clinic/templates/sale_form.xml
@@ -0,0 +1,87 @@
+
+
+ {{#ifeq context.data.state "draft"}}
+
+ {{/ifeq}}
+ {{#ifeq context.data.state "confirmed"}}
+
+ {{/ifeq}}
+ {{#ifeq context.data.state "done"}}
+
+ {{/ifeq}}
+
+
+
+
+
+ {{field_value "state" context=context}}
+
+ {{#if context.data.id}}
+
+ {{/if}}
+
+ {{#ifeq context.data.state "draft"}}
+
+ {{/ifeq}}
+ {{#if context.data.id}}
+ {{#ifeq context.data.state "confirmed"}}
+
+
+ {{/ifeq}}
+
+ {{#ifin context.data.state "confirmed" "done"}}
+
+
+ {{/ifin}}
+
+
+
+
+ {{/if}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{#ifin context.data.state "draft"}}
+
+
+
+
+ {{/ifin}}
+
+ {{#if context.data.id}}
+
+
+ {{/if}}
+
+
diff --git a/clinic/templates/sale_invoice_rlist.xml b/clinic/templates/sale_invoice_rlist.xml
new file mode 100644
index 0000000..b07487c
--- /dev/null
+++ b/clinic/templates/sale_invoice_rlist.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_layout.xml b/clinic/templates/sale_layout.xml
new file mode 100644
index 0000000..bd7e798
--- /dev/null
+++ b/clinic/templates/sale_layout.xml
@@ -0,0 +1,11 @@
+
+
+ {{{context.content}}}
+
+
diff --git a/clinic/templates/sale_line_list.xml b/clinic/templates/sale_line_list.xml
new file mode 100644
index 0000000..7c3eefd
--- /dev/null
+++ b/clinic/templates/sale_line_list.xml
@@ -0,0 +1,13 @@
+
+
+ active_id={{context.data.order_id.0.}}
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_line_list_to_deliver.xml b/clinic/templates/sale_line_list_to_deliver.xml
new file mode 100644
index 0000000..f32b92e
--- /dev/null
+++ b/clinic/templates/sale_line_list_to_deliver.xml
@@ -0,0 +1,18 @@
+{{#if context.data}}
+
+
+
+{{/if}}
+
+
+ active_id={{context.data.order_id.0.}}
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_line_list_to_invoice.xml b/clinic/templates/sale_line_list_to_invoice.xml
new file mode 100644
index 0000000..ad4c894
--- /dev/null
+++ b/clinic/templates/sale_line_list_to_invoice.xml
@@ -0,0 +1,18 @@
+
+{{#if context.data}}
+
+
+
+{{/if}}
+
+ active_id={{context.data.order_id.0.}}
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_line_page.xml b/clinic/templates/sale_line_page.xml
new file mode 100644
index 0000000..947fd8a
--- /dev/null
+++ b/clinic/templates/sale_line_page.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/sale_list.xml b/clinic/templates/sale_list.xml
new file mode 100644
index 0000000..09f67c8
--- /dev/null
+++ b/clinic/templates/sale_list.xml
@@ -0,0 +1,15 @@
+
+{{include "sale_search" context=context}}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_month_widget.xml b/clinic/templates/sale_month_widget.xml
new file mode 100644
index 0000000..c88f9af
--- /dev/null
+++ b/clinic/templates/sale_month_widget.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/clinic/templates/sale_order_line_sheet.xml b/clinic/templates/sale_order_line_sheet.xml
new file mode 100644
index 0000000..1433ba1
--- /dev/null
+++ b/clinic/templates/sale_order_line_sheet.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_page.xml b/clinic/templates/sale_page.xml
new file mode 100644
index 0000000..36d53a8
--- /dev/null
+++ b/clinic/templates/sale_page.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/sale_pick_rlist.xml b/clinic/templates/sale_pick_rlist.xml
new file mode 100644
index 0000000..95c6af6
--- /dev/null
+++ b/clinic/templates/sale_pick_rlist.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/clinic/templates/sale_prod_categ_widget.xml b/clinic/templates/sale_prod_categ_widget.xml
new file mode 100644
index 0000000..44adae4
--- /dev/null
+++ b/clinic/templates/sale_prod_categ_widget.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/clinic/templates/sale_product_form.xml b/clinic/templates/sale_product_form.xml
new file mode 100644
index 0000000..7a2ab82
--- /dev/null
+++ b/clinic/templates/sale_product_form.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_product_list.xml b/clinic/templates/sale_product_list.xml
new file mode 100644
index 0000000..b0f2623
--- /dev/null
+++ b/clinic/templates/sale_product_list.xml
@@ -0,0 +1,11 @@
+
+{{#if context.data}}
+
+{{/if}}
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_product_page.xml b/clinic/templates/sale_product_page.xml
new file mode 100644
index 0000000..5f70159
--- /dev/null
+++ b/clinic/templates/sale_product_page.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/sale_report_list.xml b/clinic/templates/sale_report_list.xml
new file mode 100644
index 0000000..ecd20bb
--- /dev/null
+++ b/clinic/templates/sale_report_list.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_search.xml b/clinic/templates/sale_search.xml
new file mode 100644
index 0000000..3a15d25
--- /dev/null
+++ b/clinic/templates/sale_search.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/clinic/templates/sale_target_form.xml b/clinic/templates/sale_target_form.xml
new file mode 100644
index 0000000..4fba4c0
--- /dev/null
+++ b/clinic/templates/sale_target_form.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_target_list.xml b/clinic/templates/sale_target_list.xml
new file mode 100644
index 0000000..c7539f7
--- /dev/null
+++ b/clinic/templates/sale_target_list.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_target_page.xml b/clinic/templates/sale_target_page.xml
new file mode 100644
index 0000000..f687759
--- /dev/null
+++ b/clinic/templates/sale_target_page.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/sale_to_inv.xml b/clinic/templates/sale_to_inv.xml
new file mode 100644
index 0000000..3f5acac
--- /dev/null
+++ b/clinic/templates/sale_to_inv.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_to_pick.xml b/clinic/templates/sale_to_pick.xml
new file mode 100644
index 0000000..2978199
--- /dev/null
+++ b/clinic/templates/sale_to_pick.xml
@@ -0,0 +1,17 @@
+
+
+
+ Select sale order:
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/sale_widget.xml b/clinic/templates/sale_widget.xml
new file mode 100644
index 0000000..925cfe8
--- /dev/null
+++ b/clinic/templates/sale_widget.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/stage_form.xml b/clinic/templates/stage_form.xml
new file mode 100644
index 0000000..57c834e
--- /dev/null
+++ b/clinic/templates/stage_form.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clinic/templates/stage_list.xml b/clinic/templates/stage_list.xml
new file mode 100644
index 0000000..4b0c079
--- /dev/null
+++ b/clinic/templates/stage_list.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/clinic/templates/stage_page.xml b/clinic/templates/stage_page.xml
new file mode 100644
index 0000000..60f6851
--- /dev/null
+++ b/clinic/templates/stage_page.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+ {{{context.content}}}
+
diff --git a/clinic/templates/view_quot.xml b/clinic/templates/view_quot.xml
new file mode 100644
index 0000000..8d76932
--- /dev/null
+++ b/clinic/templates/view_quot.xml
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+ {{#if logo}}
+
+ {{/if}}
+
+
+
+
+
+
diff --git a/setup.py b/setup.py
new file mode 100755
index 0000000..65f148e
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,8 @@
+#!/usr/bin/env python3
+from netforce.setup import setup
+
+setup(
+ name="clinic",
+ version="0.1.0",
+ description="Ratchawat Clinic module",
+)