Skip to content

Commit

Permalink
fixup! Lookup missing BIC when returning bank account activities
Browse files Browse the repository at this point in the history
  • Loading branch information
FestplattenSchnitzel committed Jul 8, 2024
1 parent 4fe52b1 commit 56ed8d9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
9 changes: 6 additions & 3 deletions pycroft/lib/finance/retransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from pycroft import config
from pycroft.helpers.utc import ensure_tz
from pycroft.model.finance import BankAccountActivity
from pycroft.model.user import User

from .transaction_crud import simple_transaction


def get_activities_to_return(session: Session) -> Sequence[BankAccountActivity]:
Expand Down Expand Up @@ -51,18 +54,18 @@ def generate_activities_return_sepaxml(activities: list[BankAccountActivity]) ->


def attribute_activities_as_returned(
session: Session, activities: list[BankAccountActivity]
session: Session, activities: list[BankAccountActivity], author: User
) -> None:
for activity in activities:
debit_account = config.non_attributable_transactions_account
credit_account = activity.bank_account.account

transaction = finance.simple_transaction(
transaction = simple_transaction(
description=activity.reference,
debit_account=debit_account,
credit_account=credit_account,
amount=activity.amount,
author=current_user,
author=author,
valid_on=activity.valid_on,
confirmed=False,
)
Expand Down
15 changes: 15 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@ idna==3.7 \
# email-validator
# requests
# yarl
importlib-resources==6.4.0 \
--hash=sha256:50d10f043df931902d4194ea07ec57960f66a80449ff867bfe782b4c486ba78c \
--hash=sha256:cdb2b453b8046ca4e3798eb1d84f3cce1446a0e8e7b5ef4efb600f19fc398145
# via schwifty
itsdangerous==2.1.2 \
--hash=sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44 \
--hash=sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a
Expand Down Expand Up @@ -801,6 +805,10 @@ pyasn1==0.6.0 \
--hash=sha256:3a35ab2c4b5ef98e17dfdec8ab074046fbda76e281c5a706ccd82328cfc8f64c \
--hash=sha256:cca4bb0f2df5504f02f6f8a775b6e416ff9b0b3b16f7ee80b5a3153d9b804473
# via ldap3
pycountry==24.6.1 \
--hash=sha256:b61b3faccea67f87d10c1f2b0fc0be714409e8fcdcc1315613174f6466c10221 \
--hash=sha256:f1a4fb391cd7214f8eefd39556d740adcc233c778a27f8942c8dca351d6ce06f
# via schwifty
pydantic==2.4.2 \
--hash=sha256:94f336138093a5d7f426aac732dcfe7ab4eb4da243c88f891d65deb4a2556ee7 \
--hash=sha256:bc3ddf669d234f4220e6e1c4d96b061abe0998185a8d7855c0126782b7abc8c1
Expand Down Expand Up @@ -1006,6 +1014,13 @@ requests==2.32.2 \
--hash=sha256:dd951ff5ecf3e3b3aa26b40703ba77495dab41da839ae72ef3c8e5d8e2433289 \
--hash=sha256:fc06670dd0ed212426dfeb94fc1b983d917c4f9847c863f313c9dfaaffb7c23c
# via fints
rstr==3.2.2 \
--hash=sha256:c4a564d4dfb4472d931d145c43d1cf1ad78c24592142e7755b8866179eeac012 \
--hash=sha256:f39195d38da1748331eeec52f1276e71eb6295e7949beea91a5e9af2340d7b3b
# via schwifty
schwifty==2024.6.1 \
--hash=sha256:d1fa1cd142e4b4c74c1578f098f4f41561e8513625a2a5a8486897441006d4ac \
--hash=sha256:df6f98a4321772095dc2dc54e6cf55e9ca2783bd048b21207fd402358744be9d
sentry-sdk==1.29.2 \
--hash=sha256:3e17215d8006612e2df02b0e73115eb8376c37e3f586d8436fa41644e605074d \
--hash=sha256:a99ee105384788c3f228726a88baf515fe7b5f1d2d0f215a03d194369f158df7
Expand Down
2 changes: 1 addition & 1 deletion web/blueprints/finance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def bank_account_activities_return_do() -> ResponseReturnValue:

sepa_xml: bytes = generate_activities_return_sepaxml(selected_activities)

attribute_activities_as_returned(session, selected_activities)
attribute_activities_as_returned(session, selected_activities, current_user)

return send_file(
BytesIO(sepa_xml),
Expand Down

0 comments on commit 56ed8d9

Please sign in to comment.