From af9f4d4b1eed00e4db70668426ed165976e2d33c Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 17 Oct 2023 22:17:28 +0530 Subject: [PATCH 1/5] 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/5] 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) From 6310845cdd1fb8eda5de7a8c356ffbcd1f6a9601 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 18 Oct 2023 11:47:15 +0530 Subject: [PATCH 3/5] chore: bunped down paragraph plugin of editor js --- lms/www/batch/edit.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/www/batch/edit.html b/lms/www/batch/edit.html index 60b886fa..312e060f 100644 --- a/lms/www/batch/edit.html +++ b/lms/www/batch/edit.html @@ -127,7 +127,7 @@ {%- block script %} {{ super() }} - + {% endblock %} From 697e81df10cd20368fe4244aeb3dbc8c943f7976 Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 17 Oct 2023 22:01:04 +0530 Subject: [PATCH 4/5] feat: add reply_to in email students --- lms/lms/doctype/lms_batch/lms_batch.py | 5 +++-- lms/www/batches/batch.js | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lms/lms/doctype/lms_batch/lms_batch.py b/lms/lms/doctype/lms_batch/lms_batch.py index 68ac25a7..33942505 100644 --- a/lms/lms/doctype/lms_batch/lms_batch.py +++ b/lms/lms/doctype/lms_batch/lms_batch.py @@ -384,11 +384,12 @@ def get_timetable_details(timetable): @frappe.whitelist() -def send_email_to_students(batch, subject, message): +def send_email_to_students(batch, subject, reply_to, message): frappe.only_for("Moderator") students = frappe.get_all("Batch Student", {"parent": batch}, pluck="student") frappe.sendmail( recipients=students, subject=subject, - message=message, + reply_to=reply_to, + message=message ) diff --git a/lms/www/batches/batch.js b/lms/www/batches/batch.js index 9614a924..7eb1e7fb 100644 --- a/lms/www/batches/batch.js +++ b/lms/www/batches/batch.js @@ -784,6 +784,12 @@ const email_to_students = () => { label: __("Subject"), reqd: 1, }, + { + fieldtype: "Data", + fieldname: "reply_to", + label: __("Reply To"), + reqd: 0, + }, { fieldtype: "Text Editor", fieldname: "message", @@ -806,6 +812,7 @@ const send_email = (values) => { args: { batch: $(".class-details").data("batch"), subject: values.subject, + reply_to: values.reply_to, message: values.message, }, callback: (r) => { From 2bffabff054813cfa263ce01de5c1f6458d677ee Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 17 Oct 2023 23:23:09 +0530 Subject: [PATCH 5/5] style: fix linter --- lms/lms/doctype/lms_batch/lms_batch.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lms/lms/doctype/lms_batch/lms_batch.py b/lms/lms/doctype/lms_batch/lms_batch.py index 33942505..8cd2c7d8 100644 --- a/lms/lms/doctype/lms_batch/lms_batch.py +++ b/lms/lms/doctype/lms_batch/lms_batch.py @@ -388,8 +388,5 @@ def send_email_to_students(batch, subject, reply_to, message): frappe.only_for("Moderator") students = frappe.get_all("Batch Student", {"parent": batch}, pluck="student") frappe.sendmail( - recipients=students, - subject=subject, - reply_to=reply_to, - message=message + recipients=students, subject=subject, reply_to=reply_to, message=message )