From af9f4d4b1eed00e4db70668426ed165976e2d33c Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 17 Oct 2023 22:17:28 +0530 Subject: [PATCH 1/2] fix: remove unused import --- lms/lms/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lms/lms/utils.py b/lms/lms/utils.py index f7dbe489..2d642be5 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -4,7 +4,6 @@ import frappe import json import razorpay import requests -import base64 from frappe import _ from frappe.desk.doctype.dashboard_chart.dashboard_chart import get_result from frappe.desk.doctype.notification_log.notification_log import make_notification_logs From 230cca63f35aa4ffa970e6291fa6a17f19e08948 Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 17 Oct 2023 23:18:43 +0530 Subject: [PATCH 2/2] feat: store batch/course in LMS payment --- lms/lms/doctype/lms_payment/lms_payment.json | 16 +++++++++++++++- lms/lms/utils.py | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lms/lms/doctype/lms_payment/lms_payment.json b/lms/lms/doctype/lms_payment/lms_payment.json index 696d5af9..c0019aef 100644 --- a/lms/lms/doctype/lms_payment/lms_payment.json +++ b/lms/lms/doctype/lms_payment/lms_payment.json @@ -8,8 +8,10 @@ "editable_grid": 1, "engine": "InnoDB", "field_order": [ + "payment_for_document_type", "member", "column_break_rqkd", + "payment_for_document", "billing_name", "payment_received", "payment_details_section", @@ -115,11 +117,23 @@ "fieldname": "amount_with_gst", "fieldtype": "Currency", "label": "Amount with GST" + }, + { + "fieldname": "payment_for_document_type", + "fieldtype": "Select", + "label": "Payment for Document Type", + "options": "\nLMS Course\nLMS Batch" + }, + { + "fieldname": "payment_for_document", + "fieldtype": "Dynamic Link", + "label": "Payment for Document", + "options": "payment_for_document_type" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-09-12 10:40:22.721371", + "modified": "2023-10-17 23:17:50.334975", "modified_by": "Administrator", "module": "LMS", "name": "LMS Payment", diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 2d642be5..b41af0dd 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -1028,6 +1028,8 @@ def record_payment(address, response, client, doctype, docname): "amount_with_gst": payment_details["amount_with_gst"], "gstin": address.gstin, "pan": address.pan, + "payment_for_document_type": doctype, + "payment_for_document": docname, } ) payment_doc.save(ignore_permissions=True)