diff --git a/netforce_clinic/layouts/clinic_hd_case_form.xml b/netforce_clinic/layouts/clinic_hd_case_form.xml
index 00037d3..12ee378 100644
--- a/netforce_clinic/layouts/clinic_hd_case_form.xml
+++ b/netforce_clinic/layouts/clinic_hd_case_form.xml
@@ -16,6 +16,7 @@
+
@@ -106,16 +107,13 @@
-
-
-
-
-
+
+
diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py
index 31479ff..3614be8 100644
--- a/netforce_clinic/models/hd_case.py
+++ b/netforce_clinic/models/hd_case.py
@@ -120,6 +120,7 @@ class HDCase(Model):
'nu': fields.Char("N/U"),
"invoice_policy": fields.Selection([("fee","Only Fee"),("fee_mdc","Fee & Medicine")],"Government pay for:"),
"invoice_option": fields.Selection([("fee_mdc_plus","Combine Fee & Medicine"),("fee_mdc_split","Split Fee & Medicine")],"Invoice:"),
+ 'req_fee': fields.Integer("Request Expense"),
}
def _get_number(self,context={}):
@@ -151,6 +152,7 @@ class HDCase(Model):
'fee_paid': False,
'invoice_option': 'fee',
'invoice_policy': 'fee',
+ 'req_fee': 0,
}
_order="date desc,number desc"
@@ -377,6 +379,10 @@ class HDCase(Model):
if not uom:
raise Exception("Unit not found in uom")
obj=self.browse(ids[0])
+ if obj.invoices:
+ for inv in obj.invoices:
+ inv.void()
+
due_date=obj.date[0:10] # XXX
# cash, credit
make_invoice=context.get('make_invoice',True)
@@ -737,19 +743,27 @@ class HDCase(Model):
},
}
- def pay(self,ids,context={}):
+ def request_fee(self,ids,context={}):
obj=self.browse(ids)[0]
- if not obj.amount:
- obj.update_usetime()
- if not obj.amount:
- obj.complete()
- else:
- return {
- 'next': {
- 'name': 'clinic_payment',
- 'refer_id': ids[0], #XXX
- }
+ obj.update_usetime()
+ #if not obj.amount:
+ obj.complete()
+ # send some message to anyboby: patient
+ return {
+ 'next': {
+ 'name': 'clinic_hd_case',
+ 'mode': 'form',
+ 'active_id': obj.id,
}
+ }
+
+ def pay(self,ids,context={}):
+ return {
+ 'next': {
+ 'name': 'clinic_payment',
+ 'refer_id': ids[0], #XXX
+ }
+ }
def done(self,ids,context={}):
obj=self.browse(ids)[0]
@@ -933,6 +947,10 @@ class HDCase(Model):
# when change patient
#vals=self.get_staff_fee(vals,patient_id)
vals=self.get_invoice_policy(vals,patient_id)
+ # if not other expense request fee
+ obj=self.browse(ids)[0]
+ if not obj.amount:
+ vals['req_fee']=1
super().write(ids,vals,**kw)
def approve(self,ids,context={}):
diff --git a/netforce_clinic/models/import_payment.py b/netforce_clinic/models/import_payment.py
index 420805b..cab9b77 100644
--- a/netforce_clinic/models/import_payment.py
+++ b/netforce_clinic/models/import_payment.py
@@ -161,8 +161,8 @@ class ImportPayment(Model):
return ''.join(h for h in hn if h.isdigit())
def import_payment_pks(self,ids,context={}):
- fmt='%Y-%m-%d %H:%M:%S'
- start_time=time.strftime(fmt)
+ #fmt='%Y-%m-%d %H:%M:%S'
+ #start_time=time.strftime(fmt)
obj=self.browse(ids)[0]
fname=obj.file
fpath=get_file_path(fname)
diff --git a/netforce_clinic/todo.txt b/netforce_clinic/todo.txt
index 1557a7b..e19135d 100644
--- a/netforce_clinic/todo.txt
+++ b/netforce_clinic/todo.txt
@@ -2,7 +2,8 @@
- matching
- report expense
-- cost nurse / doctor
-
+-XXXX
+- reqeust fee again after request
- missing
- import schedule -> wait K. Ekk