-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37011 from frappe/mergify/bp/version-14-hotfix/pr…
…-36843 fix: show customer name for naming series in process soa (#36843)
- Loading branch information
Showing
4 changed files
with
90 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 35 additions & 2 deletions
37
erpnext/accounts/doctype/process_statement_of_accounts/test_process_statement_of_accounts.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,42 @@ | ||
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors | ||
# See license.txt | ||
|
||
# import frappe | ||
import unittest | ||
|
||
import frappe | ||
from frappe.utils import add_days, getdate, today | ||
|
||
from erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts import ( | ||
send_emails, | ||
) | ||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice | ||
|
||
|
||
class TestProcessStatementOfAccounts(unittest.TestCase): | ||
pass | ||
def setUp(self): | ||
self.si = create_sales_invoice() | ||
self.process_soa = create_process_soa() | ||
|
||
def test_auto_email_for_process_soa_ar(self): | ||
send_emails(self.process_soa.name, from_scheduler=True) | ||
self.process_soa.load_from_db() | ||
self.assertEqual(self.process_soa.posting_date, getdate(add_days(today(), 7))) | ||
|
||
def tearDown(self): | ||
frappe.delete_doc_if_exists("Process Statement Of Accounts", "Test Process SOA") | ||
|
||
|
||
def create_process_soa(): | ||
frappe.delete_doc_if_exists("Process Statement Of Accounts", "Test Process SOA") | ||
process_soa = frappe.new_doc("Process Statement Of Accounts") | ||
soa_dict = { | ||
"name": "Test Process SOA", | ||
"company": "_Test Company", | ||
} | ||
process_soa.update(soa_dict) | ||
process_soa.set("customers", [{"customer": "_Test Customer"}]) | ||
process_soa.enable_auto_email = 1 | ||
process_soa.frequency = "Weekly" | ||
process_soa.report = "Accounts Receivable" | ||
process_soa.save() | ||
return process_soa |