Simplified the code in the sort_form_transaction_records() utility in the accounting application.
This commit is contained in:
parent
3873f131ef
commit
0b0624b709
@ -416,13 +416,8 @@ def sort_form_transaction_records(form):
|
|||||||
new_form[F"credit-{no}-{attr}"]\
|
new_form[F"credit-{no}-{attr}"]\
|
||||||
= form[F"credit-{old_no}-{attr}"]
|
= form[F"credit-{old_no}-{attr}"]
|
||||||
# Purges the old form and fills it with the new form
|
# Purges the old form and fills it with the new form
|
||||||
old_keys = []
|
old_keys = [x for x in form.keys() if re.match(
|
||||||
for key in form.keys():
|
"^(debit|credit)-([1-9][0-9]*)-(sn|ord|account|summary|amount)", x)]
|
||||||
m = re.match(
|
|
||||||
"^(debit|credit)-([1-9][0-9]*)-(sn|ord|account|summary|amount)",
|
|
||||||
key)
|
|
||||||
if m is not None:
|
|
||||||
old_keys.append(key)
|
|
||||||
for x in old_keys:
|
for x in old_keys:
|
||||||
del form[x]
|
del form[x]
|
||||||
for key in new_form.keys():
|
for key in new_form.keys():
|
||||||
|
Loading…
Reference in New Issue
Block a user