[fixes] print format listing
This commit is contained in:
parent
b109ee96de
commit
cb98d9ec5f
@ -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"])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
@ -218,7 +218,7 @@
|
|||||||
"label": "Print Format",
|
"label": "Print Format",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Standard\nPOS Invoice",
|
"options": "",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
@ -410,7 +410,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2015-12-16 17:31:37.319394",
|
"modified": "2015-12-17 09:41:59.801913",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Request",
|
"name": "Payment Request",
|
||||||
|
@ -7,10 +7,10 @@ import frappe
|
|||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.utils import flt, today
|
from frappe.utils import flt, today
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from erpnext.accounts.doctype.journal_entry.journal_entry import (get_payment_entry_against_order,
|
from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry
|
||||||
get_payment_entry_against_invoice, get_payment_entry)
|
|
||||||
from erpnext.accounts.party import get_party_account
|
from erpnext.accounts.party import get_party_account
|
||||||
from erpnext.accounts.utils import get_account_currency, get_balance_on
|
from erpnext.accounts.utils import get_account_currency, get_balance_on
|
||||||
|
from itertools import chain
|
||||||
|
|
||||||
class PaymentRequest(Document):
|
class PaymentRequest(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
@ -135,6 +135,8 @@ def make_payment_request(dt, dn, recipient_id=None):
|
|||||||
"reference_doctype": dt,
|
"reference_doctype": dt,
|
||||||
"reference_name": dn
|
"reference_name": dn
|
||||||
}).insert()
|
}).insert()
|
||||||
|
|
||||||
|
return pr.name
|
||||||
|
|
||||||
def get_reference_doc_details(dt, dn):
|
def get_reference_doc_details(dt, dn):
|
||||||
""" return reference doc Sales Order/Sales Invoice"""
|
""" return reference doc Sales Order/Sales Invoice"""
|
||||||
@ -155,4 +157,16 @@ def get_amount(ref_doc, dt):
|
|||||||
|
|
||||||
def get_gateway_details():
|
def get_gateway_details():
|
||||||
"""return gateway and payment account of default payment gateway"""
|
"""return gateway and payment account of default payment gateway"""
|
||||||
return frappe.db.get_value("Payment Gateway", {"is_default": 1}, ["gateway", "payment_account"])
|
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
|
||||||
|
}
|
||||||
|
|
@ -299,7 +299,9 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
|||||||
"recipient_id": cur_frm.doc.contact_email
|
"recipient_id": cur_frm.doc.contact_email
|
||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
|
if(!r.exc){
|
||||||
|
frappe.msgprint(__("payment Request generated"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user