bank updated
This commit is contained in:
@@ -148,10 +148,9 @@ def account_get_people_and_living_space_info_via_iban() -> dict:
|
||||
if living_space.person_id
|
||||
]
|
||||
people_list = People.filter_all(
|
||||
People.id.in_(living_spaces_people),
|
||||
system=True
|
||||
People.id.in_(living_spaces_people), system=True
|
||||
).data
|
||||
print('build_parts', build_parts)
|
||||
print("build_parts", build_parts)
|
||||
build_living_space_dict[str(account_records_iban[0])] = {
|
||||
"people": list(people_list),
|
||||
"living_space": list(living_spaces),
|
||||
@@ -310,7 +309,9 @@ def send_accounts_to_decision_payment():
|
||||
AccountRecords.receive_debit == receive_enum.id,
|
||||
).data
|
||||
for account_record in account_records_list:
|
||||
current_currency_value = pay_the_registration(account_record, receive_enum, debit_enum)
|
||||
current_currency_value = pay_the_registration(
|
||||
account_record, receive_enum, debit_enum
|
||||
)
|
||||
if current_currency_value > 0:
|
||||
pay_the_registration(account_record, receive_enum, debit_enum, True)
|
||||
if abs(float(Decimal(account_record.remainder_balance))) == abs(
|
||||
|
||||
@@ -4,5 +4,5 @@ class AccountConfig:
|
||||
"DAIRE": ["daire", "dagire", "daare", "nolu daire", "no", "nolu dairenin"],
|
||||
"APARTMAN": ["apartman", "aparman", "aprmn"],
|
||||
"VILLA": ["villa", "vlla"],
|
||||
"BINA": ["bina", "binna"]
|
||||
"BINA": ["bina", "binna"],
|
||||
}
|
||||
|
||||
@@ -11,13 +11,24 @@ def word_straighten(word, ref_list, threshold=0.8):
|
||||
|
||||
def category_finder(text, output_template="{kategori} {numara}"):
|
||||
categories = AccountConfig.CATEGORIES
|
||||
result = {category: [] for category in categories} # Sonuçları depolamak için bir sözlük
|
||||
result = {
|
||||
category: [] for category in categories
|
||||
} # Sonuçları depolamak için bir sözlük
|
||||
for category, patterns in categories.items():
|
||||
words = re.split(r'\W+', text)
|
||||
words = re.split(r"\W+", text)
|
||||
straighten_words = [word_straighten(word, patterns) for word in words]
|
||||
straighten_text = ' '.join(straighten_words)
|
||||
pattern = r'(?:\b|\s|^)(?:' + '|'.join(map(re.escape, patterns)) + r')(?:\s*|:|\-|\#)*(\d+)(?:\b|$)'
|
||||
straighten_text = " ".join(straighten_words)
|
||||
pattern = (
|
||||
r"(?:\b|\s|^)(?:"
|
||||
+ "|".join(map(re.escape, patterns))
|
||||
+ r")(?:\s*|:|\-|\#)*(\d+)(?:\b|$)"
|
||||
)
|
||||
if founds_list := re.findall(pattern, straighten_text, re.IGNORECASE):
|
||||
list_of_output = [output_template.format(kategori=category, numara=num) for num in founds_list]
|
||||
result[category].extend([i for i in list_of_output if str(i).replace(' ', '')])
|
||||
list_of_output = [
|
||||
output_template.format(kategori=category, numara=num)
|
||||
for num in founds_list
|
||||
]
|
||||
result[category].extend(
|
||||
[i for i in list_of_output if str(i).replace(" ", "")]
|
||||
)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user