Patch fixed
This commit is contained in:
parent
3cdc74e3b0
commit
f79d7188de
@ -5,8 +5,17 @@ def execute():
|
||||
frappe.reload_doc('accounts', 'doctype', 'sales_invoice_timesheet')
|
||||
frappe.reload_doc('accounts', 'doctype', 'sales_invoice_payment')
|
||||
|
||||
for data in frappe.db.sql("""select name, mode_of_payment, cash_bank_account, paid_amount from
|
||||
`tabSales Invoice` where is_pos = 1 and docstatus < 2 and cash_bank_account is not null""", as_dict=1):
|
||||
for data in frappe.db.sql("""select name, mode_of_payment, cash_bank_account, paid_amount, company
|
||||
from `tabSales Invoice`
|
||||
where is_pos = 1 and docstatus < 2
|
||||
and cash_bank_account is not null and cash_bank_account != ''""", as_dict=1):
|
||||
|
||||
if not data.mode_of_payment and not frappe.db.exists("Mode of Payment", "Cash"):
|
||||
mop = frappe.new_doc("Mode of Payment")
|
||||
mop.mode_of_payment = "Cash"
|
||||
mop.type = "Cash"
|
||||
mop.save()
|
||||
|
||||
si_doc = frappe.get_doc('Sales Invoice', data.name)
|
||||
si_doc.append('payments', {
|
||||
'mode_of_payment': data.mode_of_payment or 'Cash',
|
||||
|
@ -9,7 +9,8 @@ def execute():
|
||||
return
|
||||
|
||||
for expense_claim_type in frappe.get_all("Expense Claim Type", fields=["name", "default_account"]):
|
||||
if expense_claim_type.default_account:
|
||||
if expense_claim_type.default_account \
|
||||
and frappe.db.exists("Account", expense_claim_type.default_account):
|
||||
doc = frappe.get_doc("Expense Claim Type", expense_claim_type.name)
|
||||
doc.append("accounts", {
|
||||
"company": frappe.db.get_value("Account", expense_claim_type.default_account, "company"),
|
||||
|
Loading…
Reference in New Issue
Block a user