Skip to content

Commit

Permalink
Merge pull request #95 from theflyingmachine/dev-fix-trans-lable
Browse files Browse the repository at this point in the history
Refund notes lable fix
  • Loading branch information
theflyingmachine authored Apr 11, 2023
2 parents 14dd6fa + 65da771 commit c4cc576
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion register/templates/register/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ <h5 class="p-2 text-nowrap text-right font-weight-bold">
href="{% url 'check_txn_status' entry.transaction_id %}">{{ entry.payment_mode }}</a>{% else %}
<span class="text-info">{{ entry.payment_mode }}{% endif %}</span></td>
<td class="p-2 col-4">{{ entry.amount }}
<span class="text-info">{{ entry.refund_notes }}</span>
{% if entry.refund_notes %}
<span class="text-info">{{ entry.refund_notes }}</span>
{% endif %}
{% if forloop.last and is_revertible %}
<button id="reverttransactionbuttonmain" type="button"
class="btn btn-danger mb-1"
Expand Down
2 changes: 2 additions & 0 deletions register/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ def accept_payment(request, year=None, month=None, return_url=None):
@login_required
@transaction.atomic
def revert_transaction(request):
""" This function is used to revert the last transaction within 30 days. """
c_id = request.POST.get("c_id")
customer = Customer.objects.filter(tenant_id=request.user.id, id=c_id).first()
bal = Balance.objects.filter(customer=customer).exclude(last_balance_amount=None).first()
Expand Down Expand Up @@ -1600,6 +1601,7 @@ def customer_settle_up(request):
@login_required()
@transaction.atomic()
def customer_refund(request):
""" This function is used to refund the balance amount if the customer has paid advance """
c_id = request.POST.get("c_id", None)
customer = Customer.objects.filter(tenant_id=request.user.id, id=c_id).first()
if customer:
Expand Down

0 comments on commit c4cc576

Please sign in to comment.