[fixes] print format listing
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.js b/erpnext/accounts/doctype/payment_request/payment_request.js
new file mode 100644
index 0000000..142eacf
--- /dev/null
+++ b/erpnext/accounts/doctype/payment_request/payment_request.js
@@ -0,0 +1,9 @@
+frappe.ui.form.on("Payment Request", "onload", function(frm, dt, dn){
+ frappe.call({
+ method:"erpnext.accounts.doctype.payment_request.payment_request.get_print_format_list",
+ args: {"ref_doctype": frm.doc.reference_doctype},
+ callback:function(r){
+ set_field_options("print_format", r.message["print_format"])
+ }
+ })
+})
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.json b/erpnext/accounts/doctype/payment_request/payment_request.json
index add555e..25f786a 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.json
+++ b/erpnext/accounts/doctype/payment_request/payment_request.json
@@ -218,7 +218,7 @@
"label": "Print Format",
"length": 0,
"no_copy": 0,
- "options": "Standard\nPOS Invoice",
+ "options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -410,7 +410,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-12-16 17:31:37.319394",
+ "modified": "2015-12-17 09:41:59.801913",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py
index e8c824a..d1bfc9f 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.py
+++ b/erpnext/accounts/doctype/payment_request/payment_request.py
@@ -7,10 +7,10 @@
from frappe.model.document import Document
from frappe.utils import flt, today
from frappe import _
-from erpnext.accounts.doctype.journal_entry.journal_entry import (get_payment_entry_against_order,
-get_payment_entry_against_invoice, get_payment_entry)
+from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry
from erpnext.accounts.party import get_party_account
from erpnext.accounts.utils import get_account_currency, get_balance_on
+from itertools import chain
class PaymentRequest(Document):
def validate(self):
@@ -135,6 +135,8 @@
"reference_doctype": dt,
"reference_name": dn
}).insert()
+
+ return pr.name
def get_reference_doc_details(dt, dn):
""" return reference doc Sales Order/Sales Invoice"""
@@ -155,4 +157,16 @@
def get_gateway_details():
"""return gateway and payment account of default payment gateway"""
- return frappe.db.get_value("Payment Gateway", {"is_default": 1}, ["gateway", "payment_account"])
\ No newline at end of file
+ return frappe.db.get_value("Payment Gateway", {"is_default": 1}, ["gateway", "payment_account"])
+
+@frappe.whitelist()
+def get_print_format_list(ref_doctype):
+ print_format_list = ["Standard"]
+
+ print_format_list.extend(list(chain.from_iterable(frappe.db.sql("""select name from `tabPrint Format`
+ where doc_type=%s""", ref_doctype, as_list=1))))
+
+ return {
+ "print_format": print_format_list
+ }
+
\ No newline at end of file
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 0446382..66422f0 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -299,7 +299,9 @@
"recipient_id": cur_frm.doc.contact_email
},
callback: function(r) {
-
+ if(!r.exc){
+ frappe.msgprint(__("payment Request generated"))
+ }
}
})
}