delete payment code updated by prajakta #11

Merged
pjpatil12 merged 1 commits from pankaj-dev into main 2026-03-24 07:21:48 +00:00
2 changed files with 8 additions and 10 deletions
Showing only changes of commit 94b5563d15 - Show all commits

View File

@@ -86,12 +86,12 @@ def edit_payment(payment_id):
return render_template('edit_payment.html', payment_data=payment_data)
# ------------------- Delete Payment -------------------
@payment_bp.route('/delete_payment/<int:payment_id>', methods=['POST'])
@payment_bp.route('/delete_payment/<int:payment_id>', methods=['GET'])
@login_required
def delete_payment(payment_id):
success, pmc_no, invoice_no = Paymentmodel.delete_payment(payment_id)
if not success:
flash("Payment not found or failed to delete", "error")
else:

View File

@@ -97,15 +97,13 @@
<td><a href="/edit_payment/{{ payment[0] }}"><img
src="{{ url_for('static', filename='images/icons/pen_blue_icon.png') }}" alt="Edit"
class="icon"></a></td>
<td>
<form action="{{ url_for('payment_bp.delete_payment', payment_id=payment[0]) }}" method="POST"
style="display:inline;">
<button type="submit"
onclick="return confirm('Are you sure you want to delete this payment?')">
<img src="{{ url_for('static', filename='images/icons/bin_red_icon.png') }}"
alt="Delete" class="icon">
</button>
</form>
<a href="{{ url_for('payment_bp.delete_payment', payment_id=payment[0]) }}"
onclick="return confirm('Are you sure you want to delete this Payment?')">
<img src="{{ url_for('static', filename='images/icons/bin_red_icon.png') }}" alt="Delete"
class="icon">
</a>
</td>
</tr>
<!-- <tr>