improve
parent
550a1a58a4
commit
9ab16318ad
|
@ -1,5 +1,5 @@
|
|||
<action>
|
||||
<field name="string">Invoice Payment</field>
|
||||
<field name="string">Payment Invoice</field>
|
||||
<field name="view_cls">multi_view</field>
|
||||
<field name="model">clinic.invoice.payment</field>
|
||||
<field name="menu">account_menu</field>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<action>
|
||||
<field name="string">HD Cases Matching</field>
|
||||
<field name="string">Matching HD Cases</field>
|
||||
<field name="view_cls">report</field>
|
||||
<field name="model">clinic.matching.hdcase</field>
|
||||
<field name="report_template">matching_hdcase</field>
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<item string="Settings" position="before">
|
||||
<item string="Ratchawat">
|
||||
<item string="Labor Costs" action="clinic_labor_cost"/>
|
||||
<item string="Matching Payments" action="clinic_matching_payment"/>
|
||||
<item string="Invoice Payments" action="clinic_invoice_payment"/>
|
||||
<item string="Mathing HD Cases" action="clinic_matching_hdcase_acc"/>
|
||||
<item string="Payment Matching" action="clinic_matching_payment"/>
|
||||
<item string="Payment Invoices" action="clinic_invoice_payment"/>
|
||||
<item string="HD Cases Matching" action="clinic_matching_hdcase_acc"/>
|
||||
<divider/>
|
||||
<header string="REPORTS"/>
|
||||
<item string="Labor Cost Summary" action="clinic_report_labor_cost_summary"/>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<field name="first_name" required="1"/>
|
||||
<field name="last_name" required="1"/>
|
||||
<field name="name_eng"/>
|
||||
<field name="categ_id" domain="[['type','=',type]]"/>
|
||||
<!--<field name="name"/>-->
|
||||
<field name="company_id" invisible="1"/>
|
||||
<tabs>
|
||||
|
@ -22,7 +23,6 @@
|
|||
<field name="gender"/>
|
||||
<field name="birthday"/>
|
||||
<field name="nation_id"/>
|
||||
<field name="categ_id" domain="[['type','=',type]]"/>
|
||||
</group>
|
||||
<group span="6" columns="1">
|
||||
<field name="image"/>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from . import clinic_setting
|
||||
from . import remove_conv_bal
|
||||
from . import import_acc
|
||||
#from . import remove_conv_bal
|
||||
#from . import import_acc
|
||||
#from . import update_labor_cost_line
|
||||
|
|
|
@ -322,7 +322,7 @@ class HDCase(Model):
|
|||
rmb_amt=0.0
|
||||
for line in data['lines']:
|
||||
amt=line['amount'] or 0.0
|
||||
reimbursable=line['reimbursable']
|
||||
reimbursable=line.get('reimbursable','no')
|
||||
if reimbursable=='yes':
|
||||
rmb_amt+=amt
|
||||
else:
|
||||
|
|
|
@ -6,7 +6,7 @@ from netforce.access import get_active_company, get_active_user
|
|||
|
||||
class InvoicePayment(Model):
|
||||
_name="clinic.invoice.payment"
|
||||
_string="Invoice Payment"
|
||||
_string="Payment Invoice"
|
||||
|
||||
def _get_all(self,ids,context={}):
|
||||
res={}
|
||||
|
|
|
@ -9,7 +9,8 @@ from . import utils
|
|||
|
||||
class MatchingPayment(Model):
|
||||
_name="clinic.matching.payment"
|
||||
_transient=True
|
||||
_string="Payment Matching"
|
||||
#_transient=True
|
||||
|
||||
def _get_store(self,ids,context={}):
|
||||
res={}
|
||||
|
@ -512,7 +513,7 @@ class MatchingPayment(Model):
|
|||
def write(self,ids,vals,**kw):
|
||||
super().write(ids,vals,**kw)
|
||||
self.function_store(ids)
|
||||
|
||||
|
||||
def get_data(self,context={}):
|
||||
data={}
|
||||
return data
|
||||
|
|
|
@ -110,15 +110,48 @@ class ClinicSetting(Model):
|
|||
if user_id !=1:
|
||||
print("Only admin!!")
|
||||
return
|
||||
cbv_id=24
|
||||
cbv=get_model("conv.bal").browse(cbv_id)
|
||||
cbv.write({
|
||||
'file': 'ap.csv',
|
||||
})
|
||||
fname=get_file_path(cbv.file)
|
||||
f=open(fname,"r")
|
||||
rows=f.read().split("\n")
|
||||
db=get_connection()
|
||||
for citem in get_model("clinic.cycle.item").search_browse([]):
|
||||
for line in citem.lines:
|
||||
nurse=line.nurse_id
|
||||
level=nurse.level_id
|
||||
if level:
|
||||
line.write({
|
||||
'level_id': level.id
|
||||
})
|
||||
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!")
|
||||
|
||||
def update_staff_contact(self,ids,context={}):
|
||||
|
|
|
@ -524,6 +524,8 @@ class Shop(Model):
|
|||
is_draft=shop.state=='draft' and True or False
|
||||
is_cheque=False
|
||||
pay_type=shop.pay_type or ''
|
||||
user_id=get_active_user()
|
||||
user=get_model("base.user").browse(user_id)
|
||||
data={
|
||||
'comp_name': comp.name or '',
|
||||
'comp_addr': comp_addr or '',
|
||||
|
@ -540,6 +542,7 @@ class Shop(Model):
|
|||
'total_text': utils.num2word(amount_total),
|
||||
'is_cheque': is_cheque,
|
||||
'is_draft': is_draft,
|
||||
'user_name': user.name or "",
|
||||
}
|
||||
blank_dot=''
|
||||
if pay_type=='cash':
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue