clear
parent
89b7542ea3
commit
522aeb5ad5
|
@ -12,11 +12,13 @@
|
||||||
<field name="products" nolabel="1">
|
<field name="products" nolabel="1">
|
||||||
<list>
|
<list>
|
||||||
<field name="patient_type_id" onchange="onchange_ptype"/>
|
<field name="patient_type_id" onchange="onchange_ptype"/>
|
||||||
<field name="type_code" invisible="1"/>
|
<field name="type_code" invisible="1" readonly="1"/>
|
||||||
<field name="product_categ_id"/>
|
<field name="product_categ_id"/>
|
||||||
<field name="product_id" domain='[["categ_id.id","=",product_categ_id],["code","like",type_code]]' onchange="onchange_product"/>
|
<field name="product_id" domain='[["categ_id.id","=",product_categ_id],["code","like",type_code]]' onchange="onchange_product"/>
|
||||||
<field name="description"/>
|
<field name="description"/>
|
||||||
<field name="account_id"/>
|
<!--<field name="account_id"/>-->
|
||||||
|
<field name="ar_credit_id"/>
|
||||||
|
<field name="ar_debit_id"/>
|
||||||
<field name="reimbursable"/>
|
<field name="reimbursable"/>
|
||||||
<field name="uom_id"/>
|
<field name="uom_id"/>
|
||||||
<field name="price" onchange="onchange_setting_line"/>
|
<field name="price" onchange="onchange_setting_line"/>
|
||||||
|
|
|
@ -389,6 +389,8 @@ class HDCase(Model):
|
||||||
for line in obj.lines:
|
for line in obj.lines:
|
||||||
if line.state!='draft':
|
if line.state!='draft':
|
||||||
continue
|
continue
|
||||||
|
if line.amount < 1:
|
||||||
|
continue #XXX
|
||||||
prod=line.product_id
|
prod=line.product_id
|
||||||
# 1.find in line
|
# 1.find in line
|
||||||
account_id=line.account_id.id
|
account_id=line.account_id.id
|
||||||
|
@ -397,7 +399,8 @@ class HDCase(Model):
|
||||||
for sline in cst.products:
|
for sline in cst.products:
|
||||||
stype=sline.patient_type_id
|
stype=sline.patient_type_id
|
||||||
if stype.id==obj.patient_type_id.id and prod.id==sline.product_id.id:
|
if stype.id==obj.patient_type_id.id and prod.id==sline.product_id.id:
|
||||||
account_id=sline.account_id.id
|
#account_id=sline.account_id.id
|
||||||
|
account_id=sline.ar_credit_id.id
|
||||||
break
|
break
|
||||||
# 3.find in product(tab accounting)
|
# 3.find in product(tab accounting)
|
||||||
if not account_id:
|
if not account_id:
|
||||||
|
@ -432,10 +435,6 @@ class HDCase(Model):
|
||||||
partner=ptype.contact_id
|
partner=ptype.contact_id
|
||||||
if not partner:
|
if not partner:
|
||||||
raise Exception("No contact for patient type %s"%obj.ptype.name)
|
raise Exception("No contact for patient type %s"%obj.ptype.name)
|
||||||
account_mdc_id=partner.account_mdc_id.id
|
|
||||||
account_fee_id=partner.account_fee_id.id
|
|
||||||
account_service_id=partner.account_service_id.id
|
|
||||||
print('>>>> ', partner.id, account_service_id, account_mdc_id, account_fee_id, ' <<<')
|
|
||||||
vals={
|
vals={
|
||||||
"type": "out",
|
"type": "out",
|
||||||
"inv_type": "invoice",
|
"inv_type": "invoice",
|
||||||
|
@ -539,6 +538,8 @@ class HDCase(Model):
|
||||||
if line.state!='draft':
|
if line.state!='draft':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if line.qty < 1:
|
||||||
|
continue
|
||||||
prod=line.product_id
|
prod=line.product_id
|
||||||
if prod.type != 'stock':
|
if prod.type != 'stock':
|
||||||
continue
|
continue
|
||||||
|
@ -558,7 +559,7 @@ class HDCase(Model):
|
||||||
|
|
||||||
line_vals={
|
line_vals={
|
||||||
"product_id": prod.id,
|
"product_id": prod.id,
|
||||||
"qty": 1,
|
"qty": line.qty,
|
||||||
"uom_id": prod.uom_id.id,
|
"uom_id": prod.uom_id.id,
|
||||||
"location_from_id": wh_loc_id,
|
"location_from_id": wh_loc_id,
|
||||||
"location_to_id": cust_loc_id,
|
"location_to_id": cust_loc_id,
|
||||||
|
@ -983,7 +984,8 @@ class HDCase(Model):
|
||||||
price=st_prod.price
|
price=st_prod.price
|
||||||
qty=st_prod.qty
|
qty=st_prod.qty
|
||||||
amt=st_prod.amount
|
amt=st_prod.amount
|
||||||
account_id=st_prod.account_id.id
|
#account_id=st_prod.account_id.id
|
||||||
|
account_id=st_prod.ar_credit_id.id
|
||||||
if not account_id:
|
if not account_id:
|
||||||
account_id=prod.sale_account_id.id
|
account_id=prod.sale_account_id.id
|
||||||
if not account_id:
|
if not account_id:
|
||||||
|
|
|
@ -49,7 +49,6 @@ class HDCasePayment(Model):
|
||||||
vals={
|
vals={
|
||||||
'state': 'paid',
|
'state': 'paid',
|
||||||
}
|
}
|
||||||
#hd_case.update_usetime()
|
|
||||||
else:
|
else:
|
||||||
vals={
|
vals={
|
||||||
'state': 'waiting_payment',
|
'state': 'waiting_payment',
|
||||||
|
@ -75,7 +74,6 @@ class HDCasePayment(Model):
|
||||||
hd_case.make_invoices(context=context)
|
hd_case.make_invoices(context=context)
|
||||||
hd_case.post_invoices()
|
hd_case.post_invoices()
|
||||||
hd_case.create_cycle_item()
|
hd_case.create_cycle_item()
|
||||||
#hd_case.update_usetime()
|
|
||||||
hd_case.do_expense()
|
hd_case.do_expense()
|
||||||
return {
|
return {
|
||||||
'next': {
|
'next': {
|
||||||
|
|
|
@ -106,6 +106,7 @@ class ClinicSetting(Model):
|
||||||
for prod in obj.products:
|
for prod in obj.products:
|
||||||
prod.write({
|
prod.write({
|
||||||
'type_code': prod.patient_type_id.code,
|
'type_code': prod.patient_type_id.code,
|
||||||
|
'ar_credit_id': prod.account_id.id,
|
||||||
})
|
})
|
||||||
print("Done! ")
|
print("Done! ")
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,8 @@ class SettingProduct(Model):
|
||||||
'qty': fields.Integer("Qty"),
|
'qty': fields.Integer("Qty"),
|
||||||
'amount': fields.Float("Amount"),
|
'amount': fields.Float("Amount"),
|
||||||
"account_id": fields.Many2One("account.account","Account",multi_company=True),
|
"account_id": fields.Many2One("account.account","Account",multi_company=True),
|
||||||
|
"ar_credit_id": fields.Many2One("account.account","AR Credit",multi_company=True),
|
||||||
|
"ar_debit_id": fields.Many2One("account.account","AR Debit",multi_company=True),
|
||||||
'company_id': fields.Many2One("company","Company"),
|
'company_id': fields.Many2One("company","Company"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,4 @@
|
||||||
todo:
|
todo:
|
||||||
- filter product by
|
|
||||||
1. company
|
|
||||||
2. category
|
|
||||||
3. code
|
|
||||||
- cycle item
|
|
||||||
- copy nurse only in the list
|
|
||||||
- problem after confirm visit
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- accounting
|
- accounting
|
||||||
- invoice line -> account -> credit
|
- invoice line -> account -> credit
|
||||||
- debit from hd case setting
|
- debit from hd case setting
|
||||||
|
@ -16,6 +6,14 @@ todo:
|
||||||
- credit <= product -> tab -> accounting -> sale -> sale account
|
- credit <= product -> tab -> accounting -> sale -> sale account
|
||||||
- debit <= 1. contact -> tab accounting -> account receiaveble , 2. finacial setting -> account receiable
|
- debit <= 1. contact -> tab accounting -> account receiaveble , 2. finacial setting -> account receiable
|
||||||
- sale medicine
|
- sale medicine
|
||||||
|
|
||||||
|
- filter product by
|
||||||
|
1. company -> ok
|
||||||
|
2. category -> ok
|
||||||
|
3. code -> ok
|
||||||
|
- cycle item
|
||||||
|
- copy nurse only in the list -> ok
|
||||||
|
- problem after confirm visit -> ok
|
||||||
|
|
||||||
- import hd case ***
|
- import hd case ***
|
||||||
- add script
|
- add script
|
||||||
|
|
Loading…
Reference in New Issue