conv_bal
watcha.h 2015-02-26 13:15:36 +07:00
parent 550a1a58a4
commit 9ab16318ad
11 changed files with 58 additions and 21 deletions

View File

@ -1,5 +1,5 @@
<action> <action>
<field name="string">Invoice Payment</field> <field name="string">Payment Invoice</field>
<field name="view_cls">multi_view</field> <field name="view_cls">multi_view</field>
<field name="model">clinic.invoice.payment</field> <field name="model">clinic.invoice.payment</field>
<field name="menu">account_menu</field> <field name="menu">account_menu</field>

View File

@ -1,5 +1,5 @@
<action> <action>
<field name="string">HD Cases Matching</field> <field name="string">Matching HD Cases</field>
<field name="view_cls">report</field> <field name="view_cls">report</field>
<field name="model">clinic.matching.hdcase</field> <field name="model">clinic.matching.hdcase</field>
<field name="report_template">matching_hdcase</field> <field name="report_template">matching_hdcase</field>

View File

@ -2,9 +2,9 @@
<item string="Settings" position="before"> <item string="Settings" position="before">
<item string="Ratchawat"> <item string="Ratchawat">
<item string="Labor Costs" action="clinic_labor_cost"/> <item string="Labor Costs" action="clinic_labor_cost"/>
<item string="Matching Payments" action="clinic_matching_payment"/> <item string="Payment Matching" action="clinic_matching_payment"/>
<item string="Invoice Payments" action="clinic_invoice_payment"/> <item string="Payment Invoices" action="clinic_invoice_payment"/>
<item string="Mathing HD Cases" action="clinic_matching_hdcase_acc"/> <item string="HD Cases Matching" action="clinic_matching_hdcase_acc"/>
<divider/> <divider/>
<header string="REPORTS"/> <header string="REPORTS"/>
<item string="Labor Cost Summary" action="clinic_report_labor_cost_summary"/> <item string="Labor Cost Summary" action="clinic_report_labor_cost_summary"/>

View File

@ -12,6 +12,7 @@
<field name="first_name" required="1"/> <field name="first_name" required="1"/>
<field name="last_name" required="1"/> <field name="last_name" required="1"/>
<field name="name_eng"/> <field name="name_eng"/>
<field name="categ_id" domain="[['type','=',type]]"/>
<!--<field name="name"/>--> <!--<field name="name"/>-->
<field name="company_id" invisible="1"/> <field name="company_id" invisible="1"/>
<tabs> <tabs>
@ -22,7 +23,6 @@
<field name="gender"/> <field name="gender"/>
<field name="birthday"/> <field name="birthday"/>
<field name="nation_id"/> <field name="nation_id"/>
<field name="categ_id" domain="[['type','=',type]]"/>
</group> </group>
<group span="6" columns="1"> <group span="6" columns="1">
<field name="image"/> <field name="image"/>

View File

@ -1,4 +1,4 @@
from . import clinic_setting from . import clinic_setting
from . import remove_conv_bal #from . import remove_conv_bal
from . import import_acc #from . import import_acc
#from . import update_labor_cost_line #from . import update_labor_cost_line

View File

@ -322,7 +322,7 @@ class HDCase(Model):
rmb_amt=0.0 rmb_amt=0.0
for line in data['lines']: for line in data['lines']:
amt=line['amount'] or 0.0 amt=line['amount'] or 0.0
reimbursable=line['reimbursable'] reimbursable=line.get('reimbursable','no')
if reimbursable=='yes': if reimbursable=='yes':
rmb_amt+=amt rmb_amt+=amt
else: else:

View File

@ -6,7 +6,7 @@ from netforce.access import get_active_company, get_active_user
class InvoicePayment(Model): class InvoicePayment(Model):
_name="clinic.invoice.payment" _name="clinic.invoice.payment"
_string="Invoice Payment" _string="Payment Invoice"
def _get_all(self,ids,context={}): def _get_all(self,ids,context={}):
res={} res={}

View File

@ -9,7 +9,8 @@ from . import utils
class MatchingPayment(Model): class MatchingPayment(Model):
_name="clinic.matching.payment" _name="clinic.matching.payment"
_transient=True _string="Payment Matching"
#_transient=True
def _get_store(self,ids,context={}): def _get_store(self,ids,context={}):
res={} res={}
@ -512,7 +513,7 @@ class MatchingPayment(Model):
def write(self,ids,vals,**kw): def write(self,ids,vals,**kw):
super().write(ids,vals,**kw) super().write(ids,vals,**kw)
self.function_store(ids) self.function_store(ids)
def get_data(self,context={}): def get_data(self,context={}):
data={} data={}
return data return data

View File

@ -110,15 +110,48 @@ class ClinicSetting(Model):
if user_id !=1: if user_id !=1:
print("Only admin!!") print("Only admin!!")
return return
cbv_id=24 for citem in get_model("clinic.cycle.item").search_browse([]):
cbv=get_model("conv.bal").browse(cbv_id) for line in citem.lines:
cbv.write({ nurse=line.nurse_id
'file': 'ap.csv', level=nurse.level_id
}) if level:
fname=get_file_path(cbv.file) line.write({
f=open(fname,"r") 'level_id': level.id
rows=f.read().split("\n") })
db=get_connection() print("Done!")
def update_departments(self,ids,context={}):
user_id=get_active_user()
if user_id !=1:
print("Only admin!!")
return
for st in get_model("clinic.staff").search_browse([]):
dpt_ids=set()
if st.departmet_id:
dpt_ids.update({st.departmet_id.id})
if st.type=='doctor':
for hdcase in st.hd_case_staffs:
dpt_ids.update({hdcase.department_id.id})
elif st.type=='nurse':
for citem in st.cycle_item_nurses:
dpt_ids.update({citem.department_id.id})
else:
continue
#FIXME
db=get_connection()
for dpt_id in dpt_ids:
if not dpt_id:
continue
sql="insert into m2m_clinic_department_clinic_staff values(%s,%s)"%(st.id, dpt_id)
# clinic_staff_id
# clinic_department_id
db.execute(sql)
#st.write({
#'departments': {'add': [1]},
#})
#break
print('update dpt %s'%st.name)
print("Done!") print("Done!")
def update_staff_contact(self,ids,context={}): def update_staff_contact(self,ids,context={}):

View File

@ -524,6 +524,8 @@ class Shop(Model):
is_draft=shop.state=='draft' and True or False is_draft=shop.state=='draft' and True or False
is_cheque=False is_cheque=False
pay_type=shop.pay_type or '' pay_type=shop.pay_type or ''
user_id=get_active_user()
user=get_model("base.user").browse(user_id)
data={ data={
'comp_name': comp.name or '', 'comp_name': comp.name or '',
'comp_addr': comp_addr or '', 'comp_addr': comp_addr or '',
@ -540,6 +542,7 @@ class Shop(Model):
'total_text': utils.num2word(amount_total), 'total_text': utils.num2word(amount_total),
'is_cheque': is_cheque, 'is_cheque': is_cheque,
'is_draft': is_draft, 'is_draft': is_draft,
'user_name': user.name or "",
} }
blank_dot='' blank_dot=''
if pay_type=='cash': if pay_type=='cash':