[fix] process payroll
This commit is contained in:
parent
0a0c267edb
commit
64e31e9a4e
@ -168,7 +168,11 @@ def get_pricing_rules(args):
|
||||
field = frappe.scrub(parenttype)
|
||||
condition = ""
|
||||
if args.get(field):
|
||||
lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"])
|
||||
try:
|
||||
lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"])
|
||||
except TypeError:
|
||||
frappe.throw(_("Invalid {0}").format(args[field]))
|
||||
|
||||
parent_groups = frappe.db.sql_list("""select name from `tab%s`
|
||||
where lft<=%s and rgt>=%s""" % (parenttype, '%s', '%s'), (lft, rgt))
|
||||
|
||||
|
@ -196,11 +196,11 @@ class ProcessPayroll(Document):
|
||||
journal_entry.set("accounts", [
|
||||
{
|
||||
"account": salary_account,
|
||||
"debit": amount
|
||||
"debit_in_account_currency": amount
|
||||
},
|
||||
{
|
||||
"account": default_bank_account,
|
||||
"credit": amount
|
||||
"credit_in_account_currency": amount
|
||||
},
|
||||
])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user