From 535d6c4d91951375c3e800805aa17bcd26d12cc4 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 4 Dec 2012 16:34:26 +0530 Subject: [PATCH] added client side functions and mode_of_payment defaults --- accounts/doctype/mode_of_payment/mode_of_payment.txt | 4 ++-- accounts/doctype/sales_invoice/sales_invoice.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/accounts/doctype/mode_of_payment/mode_of_payment.txt b/accounts/doctype/mode_of_payment/mode_of_payment.txt index 424fdc7192e..d865080ec06 100644 --- a/accounts/doctype/mode_of_payment/mode_of_payment.txt +++ b/accounts/doctype/mode_of_payment/mode_of_payment.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-07-03 13:30:49", "modified_by": "Administrator", - "modified": "2012-12-04 16:31:20" + "modified": "2012-12-04 16:33:37" }, { "autoname": "field:mode_of_payment", @@ -57,7 +57,7 @@ "options": "Company" }, { - "description": "Will be automatically updated in POS Invoice when this mode is selected.", + "description": "Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.", "colour": "White:FFF", "doctype": "DocField", "label": "Default Account", diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py index 3292be397fa..6b70d649aee 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.py +++ b/accounts/doctype/sales_invoice/sales_invoice.py @@ -900,7 +900,9 @@ def assign_task_to_owner(inv, msg, users): @webnotes.whitelist() def get_bank_cash_account(mode_of_payment): + val = webnotes.conn.get_value("Mode of Payment", mode_of_payment, "default_account") + if not val: + webnotes.msgprint("Default Account not set in Mode of Payment: ") return { - "cash_bank_account": webnotes.conn.get_value("Mode of Payment", - mode_of_payment, "default_account") + "cash_bank_account": val } \ No newline at end of file