added client side functions and mode_of_payment defaults
diff --git a/accounts/doctype/mode_of_payment/mode_of_payment.txt b/accounts/doctype/mode_of_payment/mode_of_payment.txt
index 424fdc7..d865080 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 3292be3..6b70d64 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/accounts/doctype/sales_invoice/sales_invoice.py
@@ -900,7 +900,9 @@
@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