conv_bal
chayut.s 2014-10-22 10:42:50 +07:00
commit bc79168aca
4 changed files with 21 additions and 7 deletions

View File

@ -1,7 +1,15 @@
<inherit inherit="account_menu">
<item string="Settings" position="before">
<item string="Ratchawat">
<item string="Import Payments" action="clinic_import_payment"/>
<header string="IMPORT PAYMENT"/>
<item string="Medical Government" action="clinic_import_payment"/>
<item string="Social Security" action="clinic_import_payment"/>
<item string="NHSO 30฿" action="clinic_import_payment"/>
<divider/>
<header string="REPORTS"/>
<item string="Medical Government" action="clinic_import_payment"/>
<item string="Social Security" action="clinic_import_payment"/>
<item string="NHSO 30฿" action="clinic_import_payment"/>
</item>
</item>
</inherit>

View File

@ -12,7 +12,6 @@ from . import patient_cause_line
from . import patient_comorbidity_line
from . import patient_morbidity_line
from . import race
#from . import schedule
from . import setting
from . import visit
from . import visit_line

View File

@ -205,6 +205,8 @@ class HDcase(Model):
def make_payment(self,ids,context={}):
obj=self.browse(ids)[0]
if not obj.total:
return
remaining_amt=0.0
for line in obj.lines:
remaining_amt+=line.amount or 0.0
@ -215,6 +217,8 @@ class HDcase(Model):
raise Exception("No contact on this patient")
company_id=get_active_company()
account_id=obj.pay_account_id.id
if not account_id:
raise Exception("No Account for payment")
vals={
"partner_id": partner_id,
"company_id": company_id,
@ -352,7 +356,7 @@ class HDcase(Model):
# XXX
if obj.fee_partner_id.account_receivable_id:
account_id=obj.fee_partner_id.account_receivable_id.id or account_receivable_id
if not account_receivable_id:
if not account_id:
raise Exception("%s not found account recievable %s"%obj.fee_partner_id.name)
for line in obj.gm_lines:
prod=line.product_id
@ -534,7 +538,9 @@ class HDcase(Model):
def onchange_hct(self,context={}):
data=context['data']
hct=data.get("hct",0)
if not data.get("hct"):
data['hct']=0
hct=data["hct"]
msg=""
if(hct<=36):
msg="Reimbursement of medicines : 1,125/Week"

View File

@ -62,7 +62,6 @@ class Visit(Model):
def _get_nurse(self,context={}):
user_id=get_active_user()
print("user_id ",user_id)
nurse_ids=get_model("clinic.nurse").search([['user_id','=',user_id]])
if nurse_ids:
return nurse_ids[0]
@ -71,18 +70,20 @@ class Visit(Model):
def _get_time_start(self,context={}):
now=datetime.now()
starttime=now.strftime("%Y-%m-%d %H:%M:%S")
print(":>> ", starttime)
return starttime
def _get_time_stop(self,context={}):
hr=timedelta(seconds=3600)
now=datetime.now()
stoptime=(now+hr).strftime("%Y-%m-%d %H:%M:%S")
print('::: ', stoptime)
return stoptime
_defaults={
"state": "draft",
'time_start': _get_time_start,
'time_stop': _get_time_stop,
#'time_start': _get_time_start,
#'time_stop': _get_time_stop,
"number": "/",
"company_id": lambda *a: get_active_company(),
'nurse_id': _get_nurse,