mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
Check for prefix before return EcritureNum (#15629)
This commit is contained in:
committed by
Nabin Hait
parent
50447b195d
commit
6c743bebf2
@@ -105,9 +105,12 @@ def get_result_as_list(data, filters):
|
|||||||
|
|
||||||
for d in data:
|
for d in data:
|
||||||
|
|
||||||
JournalCode = re.split("-|/", d.get("voucher_no"))[0]
|
JournalCode = re.split("-|/|[0-9]", d.get("voucher_no"))[0]
|
||||||
|
|
||||||
EcritureNum = re.split("-|/", d.get("voucher_no"))[1]
|
if d.get("voucher_no").startswith("{0}-".format(JournalCode)) or d.get("voucher_no").startswith("{0}/".format(JournalCode)):
|
||||||
|
EcritureNum = re.split("-|/", d.get("voucher_no"))[1]
|
||||||
|
else:
|
||||||
|
EcritureNum = re.search("{0}(\d+)".format(JournalCode), d.get("voucher_no"), re.IGNORECASE).group(1)
|
||||||
|
|
||||||
EcritureDate = format_datetime(d.get("GlPostDate"), "yyyyMMdd")
|
EcritureDate = format_datetime(d.get("GlPostDate"), "yyyyMMdd")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user