-
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.
* fix(Warehouse): add buttons only if the user can use them (cherry picked from commit 10ae5aa) * fix: missing discount on POS Credit Notes (cherry picked from commit 1049550) * chore: rename test suite for payable report (cherry picked from commit 9474f72) * refactor: test suite for item-wise sales register (cherry picked from commit 3aaa22e) * refactor(test): use each instance UOM for assertion (cherry picked from commit cf4fbfb) * fix: slowness in reposting dependent vouchers. (backport #42282) (#42292) fix: slowness in reposting dependent vouchers. (#42282) (cherry picked from commit b17696a) Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com> * refactor(test): clear old records * fix: keep status as In Progress for RIV for Timeout Error (backport #42274) (#42296) fix: keep status as In Progress for RIV for Timeout Error (#42274) (cherry picked from commit 10280d6) Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com> * fix: cost center filter by company (backport #42297) (#42299) fix: cost center filter by company (#42297) (cherry picked from commit 9838f7e) Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com> * feat: configurable depreciation calculation via accounts settings (#42276) * feat: configurable depreciation calculation via accounts settings * refactor: code optimization * style: changes in description and label (cherry picked from commit b04da63) * fix: not able to submit LCV entry (backport #42303) (#42304) fix: not able to submit LCV entry (#42303) (cherry picked from commit 9cf92ea) Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com> * fix: While submitting PCV ensure previous FY is closed (backport #42284) (#42300) fix: While submitting PCV ensure previous FY is closed (#42284) (cherry picked from commit d0bbc8c) Co-authored-by: Nabin Hait <nabinhait@gmail.com> --------- Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com> Co-authored-by: ruthra kumar <ruthra@erpnext.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com> Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
- Loading branch information
1 parent
f975333
commit ce8b423
Showing
15 changed files
with
354 additions
and
37 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
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
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
65 changes: 65 additions & 0 deletions
65
erpnext/accounts/report/item_wise_sales_register/test_item_wise_sales_register.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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import frappe | ||
from frappe.tests.utils import FrappeTestCase | ||
from frappe.utils import getdate, today | ||
|
||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice | ||
from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import execute | ||
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin | ||
|
||
|
||
class TestItemWiseSalesRegister(AccountsTestMixin, FrappeTestCase): | ||
def setUp(self): | ||
self.create_company() | ||
self.create_customer() | ||
self.create_item() | ||
self.clear_old_entries() | ||
|
||
def tearDown(self): | ||
frappe.db.rollback() | ||
|
||
def create_sales_invoice(self, do_not_submit=False): | ||
si = create_sales_invoice( | ||
item=self.item, | ||
company=self.company, | ||
customer=self.customer, | ||
debit_to=self.debit_to, | ||
posting_date=today(), | ||
parent_cost_center=self.cost_center, | ||
cost_center=self.cost_center, | ||
rate=100, | ||
price_list_rate=100, | ||
do_not_save=1, | ||
) | ||
si = si.save() | ||
if not do_not_submit: | ||
si = si.submit() | ||
return si | ||
|
||
def test_basic_report_output(self): | ||
si = self.create_sales_invoice() | ||
|
||
filters = frappe._dict({"from_date": today(), "to_date": today(), "company": self.company}) | ||
report = execute(filters) | ||
|
||
self.assertEqual(len(report[1]), 1) | ||
|
||
expected_result = { | ||
"item_code": si.items[0].item_code, | ||
"invoice": si.name, | ||
"posting_date": getdate(), | ||
"customer": si.customer, | ||
"debit_to": si.debit_to, | ||
"company": self.company, | ||
"income_account": si.items[0].income_account, | ||
"stock_qty": 1.0, | ||
"stock_uom": si.items[0].stock_uom, | ||
"rate": 100.0, | ||
"amount": 100.0, | ||
"total_tax": 0, | ||
"total_other_charges": 0, | ||
"total": 100.0, | ||
"currency": "INR", | ||
} | ||
|
||
report_output = {k: v for k, v in report[1][0].items() if k in expected_result} | ||
self.assertDictEqual(report_output, expected_result) |
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
Oops, something went wrong.