[fixes] removed base_grand_total from payment request
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.json b/erpnext/accounts/doctype/payment_request/payment_request.json
index 14daba7..e916034 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.json
+++ b/erpnext/accounts/doctype/payment_request/payment_request.json
@@ -17,6 +17,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Payment Details",
@@ -41,6 +42,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Transaction Currency",
@@ -67,6 +69,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Grand Total",
@@ -88,35 +91,11 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "Amount in company's currency",
- "fieldname": "base_grand_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Base Grand Total",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "2",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
"fieldname": "column_break_5",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -141,6 +120,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Status",
@@ -167,6 +147,7 @@
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Make Sales Invoice",
@@ -191,6 +172,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -214,6 +196,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Payment Gateway Account",
@@ -239,6 +222,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -262,6 +246,7 @@
"fieldtype": "Read Only",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Payment Gateway",
@@ -287,6 +272,7 @@
"fieldtype": "Read Only",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Payment Account",
@@ -312,6 +298,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Recipient and Message",
@@ -337,6 +324,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Print Format",
@@ -362,6 +350,7 @@
"fieldtype": "Check",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Mute Email",
@@ -386,6 +375,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Email To",
@@ -410,6 +400,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Subject",
@@ -434,6 +425,7 @@
"fieldtype": "Text Editor",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Message",
@@ -458,6 +450,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Payment URL Message",
@@ -482,6 +475,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "payment_url",
@@ -506,6 +500,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Details",
@@ -530,6 +525,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Doctype",
@@ -555,6 +551,7 @@
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Name",
@@ -580,6 +577,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -606,7 +604,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-19 16:19:55.933694",
+ "modified": "2016-02-24 16:49:46.832403",
"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 86aeba3..bd4cc4d 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.py
+++ b/erpnext/accounts/doctype/payment_request/payment_request.py
@@ -87,7 +87,10 @@
debit_in_account_currency = 0.0
if party_account_currency == ref_doc.company_currency:
- amount = self.base_grand_total
+ amount = flt(flt(self.grand_total) * \
+ flt(ref_doc.conversion_rate, ref_doc.precision("conversion_rate")), \
+ ref_doc.precision("base_grand_total"))
+
if self.currency != ref_doc.company_currency:
debit_in_account_currency = self.grand_total
@@ -158,7 +161,7 @@
gateway_account = get_gateway_details(args)
- base_grand_total, grand_total = get_amount(ref_doc, args.dt)
+ grand_total = get_amount(ref_doc, args.dt)
existing_payment_request = frappe.db.get_value("Payment Request",
{"reference_doctype": args.dt, "reference_name": args.dn})
@@ -174,7 +177,6 @@
"payment_account": gateway_account.payment_account,
"currency": ref_doc.currency,
"make_sales_invoice": args.cart or 0,
- "base_grand_total": base_grand_total,
"grand_total": grand_total,
"mute_email": args.mute_email or 0,
"email_to": args.recipient_id or "",
@@ -206,15 +208,13 @@
def get_amount(ref_doc, dt):
"""get amount based on doctype"""
if dt == "Sales Order":
- base_grand_total = flt(ref_doc.base_grand_total)
- grand_total = (flt(ref_doc.base_grand_total) - flt(ref_doc.advance_paid)) / flt(ref_doc.conversion_rate, 2)
+ grand_total = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid)
if dt == "Sales Invoice":
- base_grand_total = flt(ref_doc.base_grand_total)
grand_total = flt(ref_doc.outstanding_amount)
- if base_grand_total > 0 and grand_total > 0 :
- return base_grand_total, grand_total
+ if grand_total > 0 :
+ return grand_total
else:
frappe.throw(_("Payment Entry is already created"))