Check for prefix before return EcritureNum (#15629)
This commit is contained in:
parent
50447b195d
commit
6c743bebf2
@ -105,9 +105,12 @@ def get_result_as_list(data, filters):
|
||||
|
||||
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")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user