Skip to content

Commit

Permalink
Transaction comments and user log for limited services
Browse files Browse the repository at this point in the history
Added transactino comments and userlog enteries for maximum services.
Currently if basic transaction or custominvoice limits are reached
nothing happens. If main service gets paid, child service gets paid
to maximum limit.

Signed-off-by: Erkki Hietaranta <erkki.hietaranta@gmail.com>
  • Loading branch information
sbeach92 committed Feb 25, 2024
1 parent 3770538 commit 733201d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions utils/businesslogic.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,12 @@ def _check_transaction_pays_custominvoice(transaction):
)
if inlimit == True:
BusinessLogic._service_paid_by_transaction(subscription, transaction, invoice.days)
transaction.comment = transaction.comment + f" by {invoice}"
transaction.save()
else:
subscription.user.log(
f"Payment of {invoice} would extend {subscription.service} paid to date over maximum by {inlimit} days. Transaction is not used"
)
transaction.comment = (
f"Service {subscription.service} paid untill date would get over maximum limit by {inlimit} days. Transaction is not used"
transaction.comment += (
f"Service {subscription.service} paid untill date would get over maximum limit by {inlimit} days. Transaction is not used\n"
)
transaction.save()
else:
Expand Down Expand Up @@ -390,8 +388,8 @@ def _updatesubscription(user, subscription, servicesubscriptions):
f"Payment would extend {subscription.service} paid to date over maximum by {inlimit} days. {transaction} is not used"
)
transaction.user = subscription.user
transaction.comment = (
f"Service {subscription.service} paid untill date would get over maximum limit by {inlimit} days. Transaction is not used"
transaction.comment += (
f"Service {subscription.service} paid untill date would get over maximum limit by {inlimit} days. Transaction is not used\n"
)
transaction.save()
else:
Expand Down

0 comments on commit 733201d

Please sign in to comment.