[Fixes] payment request url fixes
diff --git a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.json b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.json
index 96b3fcc..d095064 100644
--- a/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.json
+++ b/erpnext/accounts/doctype/payment_gateway_account/payment_gateway_account.json
@@ -177,55 +177,6 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "reminder_settings",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Reminder Settings",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "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,
- "description": "In Days",
- "fieldname": "reminder_after",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Reminder After",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "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
}
],
"hide_heading": 0,
@@ -237,8 +188,8 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2015-12-24 21:41:05.123141",
- "modified_by": "Administrator",
+ "modified": "2015-12-30 15:08:47.042197",
+ "modified_by": "saurabh6790@gmail.com",
"module": "Accounts",
"name": "Payment Gateway Account",
"name_case": "",
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py
index 207872a..4086a3c 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.py
+++ b/erpnext/accounts/doctype/payment_request/payment_request.py
@@ -5,7 +5,7 @@
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
-from frappe.utils import flt, nowdate, get_url
+from frappe.utils import flt, nowdate, get_url, cstr
from frappe import _
from erpnext.accounts.doctype.journal_entry.journal_entry import (get_payment_entry_against_invoice,
get_payment_entry_against_order)
@@ -46,7 +46,6 @@
def send_payment_request(self):
self.payment_url = get_url("/api/method/erpnext.accounts.doctype.payment_request.payment_request.gererate_payemnt_request?name={0}".format(self.name))
-
if self.payment_url:
frappe.db.set_value(self.doctype, self.name, "status", "Initiated")
@@ -90,7 +89,7 @@
def get_message(self):
"""return message with payment gateway link"""
- return self.message + self.payment_url if self.payment_url else ""
+ return self.message + """ <a href="%s"> Click here to pay </a>"""%self.payment_url
def set_failed(self):
pass
@@ -149,14 +148,8 @@
def get_amount(ref_doc, dt):
"""get amount based on doctype"""
if dt == "Sales Order":
- # party_account = get_party_account("Customer", ref_doc.get('customer'), ref_doc.company)
-# party_account_currency = get_account_currency(party_account)
-
- # if party_account_currency == ref_doc.company_currency:
amount = flt(ref_doc.base_grand_total) - flt(ref_doc.advance_paid)
- # else:
-# amount = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid)
-#
+
if dt == "Sales Invoice":
amount = abs(ref_doc.outstanding_amount)
diff --git a/erpnext/docs/user/manual/en/accounts/pyament-request.md b/erpnext/docs/user/manual/en/accounts/pyament-request.md
index de97470..ca696c6 100644
--- a/erpnext/docs/user/manual/en/accounts/pyament-request.md
+++ b/erpnext/docs/user/manual/en/accounts/pyament-request.md
@@ -1,4 +1,4 @@
-Payment Request is mediator between payment gateway and erpnext. From Sales Order or Sales Invoice you can initiate Payment Request.
+Payment Request will act as mediator between Payment Gateway and ERPNext. You can create payment request via Sales Order or Sales Invoice.
- Create Payment Request via Sales Order
<img class="screenshot" alt="Payment Request" src="{{docs_base_url}}/assets/img/accounts/pr-from-so.png">