mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 04:09:11 +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 frappe.test_runner import make_test_objects
|
||||||
|
|
||||||
from erpnext.accounts.party import get_party_shipping_address
|
from erpnext.accounts.party import get_party_shipping_address
|
||||||
|
<<<<<<< HEAD
|
||||||
from erpnext.accounts.utils import (
|
from erpnext.accounts.utils import (
|
||||||
get_future_stock_vouchers,
|
get_future_stock_vouchers,
|
||||||
get_voucherwise_gl_entries,
|
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.item.test_item import make_item
|
||||||
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import make_purchase_receipt
|
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.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):
|
class TestUtils(unittest.TestCase):
|
||||||
@@ -50,6 +55,7 @@ class TestUtils(unittest.TestCase):
|
|||||||
posting_date = "2021-01-01"
|
posting_date = "2021-01-01"
|
||||||
gl_entries = get_voucherwise_gl_entries(future_vouchers, posting_date)
|
gl_entries = get_voucherwise_gl_entries(future_vouchers, posting_date)
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
|
<<<<<<< HEAD
|
||||||
voucher_type_and_no in gl_entries,
|
voucher_type_and_no in gl_entries,
|
||||||
msg="get_voucherwise_gl_entries not returning expected GLes",
|
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)))
|
sorted_vouchers = sort_stock_vouchers_by_posting_date(list(reversed(vouchers)))
|
||||||
self.assertEqual(sorted_vouchers, 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 = [
|
ADDRESS_RECORDS = [
|
||||||
|
|||||||
@@ -1302,7 +1302,11 @@ def get_voucherwise_gl_entries(future_stock_vouchers, posting_date):
|
|||||||
Check compare_existing_and_expected_gle function below.
|
Check compare_existing_and_expected_gle function below.
|
||||||
|
|
||||||
returns:
|
returns:
|
||||||
|
<<<<<<< HEAD
|
||||||
Dict[Tuple[voucher_type, voucher_no], List[GL Entries]]
|
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 = {}
|
gl_entries = {}
|
||||||
if not future_stock_vouchers:
|
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]
|
voucher_nos = [d[1] for d in future_stock_vouchers]
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
gles = frappe.db.sql(
|
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
|
select name, account, credit, debit, cost_center, project, voucher_type, voucher_no
|
||||||
from `tabGL Entry`
|
from `tabGL Entry`
|
||||||
where
|
where
|
||||||
|
|||||||
Reference in New Issue
Block a user