Skip to content

Commit

Permalink
اصلاح دالة التحويل وتطبيق الزكاة في نموذج قواعد البيانات
Browse files Browse the repository at this point in the history
  • Loading branch information
vzool committed Nov 21, 2024
1 parent 4364259 commit b034c71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build
*.pickle
*.camel
*.sqlite
*.sqlite-journal
tmp
*.json
*.pyc
Expand All @@ -15,4 +16,5 @@ __pycache__
*.DS_Store
uploads
*.txt
*.db
*.db
*.db-journal
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
description='A Python Library for Islamic Financial Management.',
author='Abdelaziz Elrashed Elshaikh Mohamed',
author_email='[email protected]',
classifiers = [
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3',
Expand All @@ -26,4 +26,4 @@
'camelx',
'pony',
],
)
)
12 changes: 6 additions & 6 deletions zakat/zakat_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3223,8 +3223,8 @@ def _transfer(self, unscaled_amount: float | int | Decimal, from_account: int, t
''')
y = self._log(value=target_amount, desc=f'TRANSFER {from_account} -> {to_account}',
account_id=to_account,
created=new_age, ref=None, debug=debug)
times.append((new_age, y))
created=None, ref=None, debug=debug)
times.append((age, y))
continue
else:
box = Box.get(account=to_account, record_date=age)
Expand All @@ -3239,8 +3239,8 @@ def _transfer(self, unscaled_amount: float | int | Decimal, from_account: int, t
box.rest += target_amount
y = self._log(value=target_amount, desc=f'TRANSFER {from_account} -> {to_account}',
account_id=to_account,
created=new_age, ref=None, debug=debug)
times.append((new_age, y))
created=None, ref=None, debug=debug)
times.append((age, y))
continue
if debug:
print(
Expand Down Expand Up @@ -3544,7 +3544,7 @@ def _zakat(
if not parts_exist:
db.execute(f'''
UPDATE box
SET rest = rest - {box['rest']}
SET rest = rest - {box['box_rest']}
WHERE id = {box['ref']};
''')
self.log(-float(amount), desc='zakat-زكاة', account_id=x, created=None, ref=box['box_time'], debug=debug)
Expand Down Expand Up @@ -3643,7 +3643,7 @@ def vault(self, section: Vault = Vault.ALL) -> dict:
}

def snapshot(self) -> bool:
pass
return True

def ext(self) -> str | None:
return 'sqlite' if self._file_exists else None
Expand Down

0 comments on commit b034c71

Please sign in to comment.