mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-09 00:01:18 +00:00
fix: missed to add voucher_type, voucher_no to get GL Entries (#27368)
* fix: missed to add voucher_type, voucher_no to get gl entries
* test: get voucherwise details utilities
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
(cherry picked from commit 058d98342a)
# Conflicts:
# erpnext/accounts/test/test_utils.py
# erpnext/accounts/utils.py
This commit is contained in:
@@ -4,6 +4,7 @@ import frappe
|
||||
from frappe.test_runner import make_test_objects
|
||||
|
||||
from erpnext.accounts.party import get_party_shipping_address
|
||||
<<<<<<< HEAD
|
||||
from erpnext.accounts.utils import (
|
||||
get_future_stock_vouchers,
|
||||
get_voucherwise_gl_entries,
|
||||
@@ -12,6 +13,10 @@ from erpnext.accounts.utils import (
|
||||
from erpnext.stock.doctype.item.test_item import make_item
|
||||
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
|
||||
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
|
||||
=======
|
||||
from erpnext.accounts.utils import get_future_stock_vouchers, get_voucherwise_gl_entries
|
||||
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
|
||||
>>>>>>> 058d98342a (fix: missed to add voucher_type, voucher_no to get GL Entries (#27368))
|
||||
|
||||
|
||||
class TestUtils(unittest.TestCase):
|
||||
@@ -50,6 +55,7 @@ class TestUtils(unittest.TestCase):
|
||||
posting_date = "2021-01-01"
|
||||
gl_entries = get_voucherwise_gl_entries(future_vouchers, posting_date)
|
||||
self.assertTrue(
|
||||
<<<<<<< HEAD
|
||||
voucher_type_and_no in gl_entries,
|
||||
msg="get_voucherwise_gl_entries not returning expected GLes",
|
||||
)
|
||||
@@ -72,6 +78,10 @@ class TestUtils(unittest.TestCase):
|
||||
|
||||
sorted_vouchers = sort_stock_vouchers_by_posting_date(list(reversed(vouchers)))
|
||||
self.assertEqual(sorted_vouchers, vouchers)
|
||||
=======
|
||||
voucher_type_and_no in gl_entries, msg="get_voucherwise_gl_entries not returning expected GLes",
|
||||
)
|
||||
>>>>>>> 058d98342a (fix: missed to add voucher_type, voucher_no to get GL Entries (#27368))
|
||||
|
||||
|
||||
ADDRESS_RECORDS = [
|
||||
|
||||
@@ -1302,7 +1302,11 @@ def get_voucherwise_gl_entries(future_stock_vouchers, posting_date):
|
||||
Check compare_existing_and_expected_gle function below.
|
||||
|
||||
returns:
|
||||
<<<<<<< HEAD
|
||||
Dict[Tuple[voucher_type, voucher_no], List[GL Entries]]
|
||||
=======
|
||||
Dict[Tuple[voucher_type, voucher_no], List[GL Entries]]
|
||||
>>>>>>> 058d98342a (fix: missed to add voucher_type, voucher_no to get GL Entries (#27368))
|
||||
"""
|
||||
gl_entries = {}
|
||||
if not future_stock_vouchers:
|
||||
@@ -1310,8 +1314,12 @@ def get_voucherwise_gl_entries(future_stock_vouchers, posting_date):
|
||||
|
||||
voucher_nos = [d[1] for d in future_stock_vouchers]
|
||||
|
||||
<<<<<<< HEAD
|
||||
gles = frappe.db.sql(
|
||||
"""
|
||||
=======
|
||||
gles = frappe.db.sql("""
|
||||
>>>>>>> 058d98342a (fix: missed to add voucher_type, voucher_no to get GL Entries (#27368))
|
||||
select name, account, credit, debit, cost_center, project, voucher_type, voucher_no
|
||||
from `tabGL Entry`
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user