[document & fixes] document and test case rewrite

This commit is contained in:
Saurabh 2015-12-30 11:07:38 +05:30
parent 6fc408e974
commit 2ffea6ba94
11 changed files with 48 additions and 17 deletions

View File

@ -329,7 +329,7 @@
"unique": 0
},
{
"allow_on_submit": 1,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "message",
@ -484,7 +484,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-12-23 23:49:22.755235",
"modified": "2015-12-29 12:56:45.456546",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",

View File

@ -132,6 +132,9 @@ def make_payment_request(**args):
"reference_name": args.dn
})
if args.return_doc:
return pr
if args.submit_doc:
pr.insert(ignore_permissions=True)
pr.submit()
@ -146,14 +149,14 @@ def get_reference_doc_details(dt, dn):
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)
# 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)

View File

@ -72,9 +72,8 @@ class TestPaymentRequest(unittest.TestCase):
currency="USD", conversion_rate=50)
pr = make_payment_request(dt="Sales Invoice", dn=SI_USD.name, recipient_id="saurabh@erpnext.com",
mute_email=1, submit_doc=1, payemnt_gateway="_Test Gateway - USD")
jv = pr.set_paid()
mute_email=1, return_doc=1, payemnt_gateway="_Test Gateway - USD")
self.assertRaises(frappe.ValidationError, pr.save)
self.assertEquals(jv.accounts[0].account, "_Test Receivable USD - _TC")
self.assertEquals(jv.accounts[0].account_currency, "USD")
self.assertEquals(jv.accounts[1].account, pr.payment_account)

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

View File

@ -1,6 +1,7 @@
journal-entry
sales-invoice
purchase-invoice
payment-request
chart-of-accounts
making-payments
advance-payment-entry

View File

@ -0,0 +1,28 @@
Payment Request is mediator between payment gateway and erpnext. From Sales Order or Sales Invoice you can initiate Payment Request.
- Create Payment Request via Sales Order
<img class="screenshot" alt="Payment Request" src="{{docs_base_url}}/assets/img/accounts/pr-from-so.png">
- Create payment Request via Sales Invoice
<img class="screenshot" alt="Payment Request" src="{{docs_base_url}}/assets/img/accounts/pr-from-si.png">
---
Select appropriate Payment Gateway Account on Payment Request. Account head specified on payment gateway will
considered to create journal entry.
Note: Invoice/Order Currency and Payment Gateway Account corruncy should be same.
<img class="screenshot" alt="Payment Request" src="{{docs_base_url}}/assets/img/accounts/pr-details-1.png">
---
##### Notify Customer
You can notify customer from Payment Request with print format. If customer contact email is mentioned, it will automatically fetch email. If not so you can set email id on Payment Request.
<img class="screenshot" alt="Payment Request" src="{{docs_base_url}}/assets/img/accounts/pr-details-2.png">
##### Request Mail
<img class="screenshot" alt="Payment Request" src="{{docs_base_url}}/assets/img/accounts/pr-email.png">

View File

@ -2802,7 +2802,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-12-17 16:19:40.324514",
"modified": "2015-12-29 12:32:45.649349",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",