From b034c71b7e9f5534226403749305190af0d2bbc4 Mon Sep 17 00:00:00 2001 From: Abdelaziz Elrashed Date: Thu, 21 Nov 2024 09:27:58 +0300 Subject: [PATCH] =?UTF-8?q?=D8=A7=D8=B5=D9=84=D8=A7=D8=AD=20=D8=AF=D8=A7?= =?UTF-8?q?=D9=84=D8=A9=20=D8=A7=D9=84=D8=AA=D8=AD=D9=88=D9=8A=D9=84=20?= =?UTF-8?q?=D9=88=D8=AA=D8=B7=D8=A8=D9=8A=D9=82=20=D8=A7=D9=84=D8=B2=D9=83?= =?UTF-8?q?=D8=A7=D8=A9=20=D9=81=D9=8A=20=D9=86=D9=85=D9=88=D8=B0=D8=AC=20?= =?UTF-8?q?=D9=82=D9=88=D8=A7=D8=B9=D8=AF=20=D8=A7=D9=84=D8=A8=D9=8A=D8=A7?= =?UTF-8?q?=D9=86=D8=A7=D8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++- setup.py | 4 ++-- zakat/zakat_tracker.py | 12 ++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 6284626..a0ea4b7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ build *.pickle *.camel *.sqlite +*.sqlite-journal tmp *.json *.pyc @@ -15,4 +16,5 @@ __pycache__ *.DS_Store uploads *.txt -*.db \ No newline at end of file +*.db +*.db-journal diff --git a/setup.py b/setup.py index 7b9bab1..6277710 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ description='A Python Library for Islamic Financial Management.', author='Abdelaziz Elrashed Elshaikh Mohamed', author_email='aeemh.sdn@gmail.com', - classifiers = [ + classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'Programming Language :: Python :: 3', @@ -26,4 +26,4 @@ 'camelx', 'pony', ], -) \ No newline at end of file +) diff --git a/zakat/zakat_tracker.py b/zakat/zakat_tracker.py index 5333c42..7ed40bc 100644 --- a/zakat/zakat_tracker.py +++ b/zakat/zakat_tracker.py @@ -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) @@ -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( @@ -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) @@ -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