[fix] Default cost center as per company
This commit is contained in:
parent
283b55f88c
commit
8372c44262
@ -699,13 +699,15 @@ def get_payment_entry_from_purchase_order(purchase_order):
|
|||||||
|
|
||||||
def get_payment_entry(doc):
|
def get_payment_entry(doc):
|
||||||
bank_account = get_default_bank_cash_account(doc.company, "Bank Entry")
|
bank_account = get_default_bank_cash_account(doc.company, "Bank Entry")
|
||||||
|
cost_center = frappe.db.get_value("Company", doc.company, "cost_center")
|
||||||
|
|
||||||
jv = frappe.new_doc('Journal Entry')
|
jv = frappe.new_doc('Journal Entry')
|
||||||
jv.voucher_type = 'Bank Entry'
|
jv.voucher_type = 'Bank Entry'
|
||||||
jv.company = doc.company
|
jv.company = doc.company
|
||||||
jv.fiscal_year = doc.fiscal_year
|
jv.fiscal_year = doc.fiscal_year
|
||||||
|
|
||||||
jv.append("accounts")
|
d1 = jv.append("accounts")
|
||||||
|
d1.cost_center = cost_center
|
||||||
d2 = jv.append("accounts")
|
d2 = jv.append("accounts")
|
||||||
|
|
||||||
if bank_account:
|
if bank_account:
|
||||||
@ -715,6 +717,7 @@ def get_payment_entry(doc):
|
|||||||
d2.account_type = bank_account["account_type"]
|
d2.account_type = bank_account["account_type"]
|
||||||
d2.exchange_rate = get_exchange_rate(bank_account["account"],
|
d2.exchange_rate = get_exchange_rate(bank_account["account"],
|
||||||
bank_account["account_currency"], doc.company)
|
bank_account["account_currency"], doc.company)
|
||||||
|
d2.cost_center = cost_center
|
||||||
|
|
||||||
return jv
|
return jv
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user