fix: moved evaluation cancel button in a menu
This commit is contained in:
@@ -277,28 +277,20 @@
|
||||
"is_published_field": "published",
|
||||
"links": [
|
||||
{
|
||||
"group": "Chapters",
|
||||
"link_doctype": "LMS Enrollment",
|
||||
"link_fieldname": "course"
|
||||
},
|
||||
{
|
||||
"link_doctype": "Course Chapter",
|
||||
"link_fieldname": "course"
|
||||
},
|
||||
{
|
||||
"group": "Batches",
|
||||
"link_doctype": "LMS Batch Old",
|
||||
"link_fieldname": "course"
|
||||
},
|
||||
{
|
||||
"group": "Mentors",
|
||||
"link_doctype": "LMS Course Mentor Mapping",
|
||||
"link_fieldname": "course"
|
||||
},
|
||||
{
|
||||
"group": "Interests",
|
||||
"link_doctype": "LMS Course Interest",
|
||||
"link_doctype": "Course Lesson",
|
||||
"link_fieldname": "course"
|
||||
}
|
||||
],
|
||||
"make_attachments_public": 1,
|
||||
"modified": "2025-03-04 15:43:25.151554",
|
||||
"modified": "2025-03-13 16:01:19.105212",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Course",
|
||||
|
||||
@@ -44,13 +44,15 @@
|
||||
"fieldtype": "Currency",
|
||||
"in_list_view": 1,
|
||||
"label": "Amount",
|
||||
"options": "currency"
|
||||
"options": "currency",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Link",
|
||||
"label": "Currency",
|
||||
"options": "Currency"
|
||||
"options": "Currency",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_rqkd",
|
||||
@@ -70,7 +72,8 @@
|
||||
"fieldname": "address",
|
||||
"fieldtype": "Link",
|
||||
"label": "Address",
|
||||
"options": "Address"
|
||||
"options": "Address",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
@@ -124,13 +127,15 @@
|
||||
"fieldname": "payment_for_document_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Payment for Document Type",
|
||||
"options": "\nLMS Course\nLMS Batch"
|
||||
"options": "\nLMS Course\nLMS Batch",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "payment_for_document",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"label": "Payment for Document",
|
||||
"options": "payment_for_document_type"
|
||||
"options": "payment_for_document_type",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "source",
|
||||
@@ -156,7 +161,7 @@
|
||||
"link_fieldname": "payment"
|
||||
}
|
||||
],
|
||||
"modified": "2025-02-21 18:29:55.436611",
|
||||
"modified": "2025-03-13 15:31:38.019002",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Payment",
|
||||
|
||||
@@ -1889,16 +1889,16 @@ def update_payment_record(doctype, docname):
|
||||
|
||||
try:
|
||||
if payment_for_certificate:
|
||||
update_certificate_purchase(docname)
|
||||
update_certificate_purchase(docname, data.payment)
|
||||
elif doctype == "LMS Course":
|
||||
enroll_in_course(data.payment, docname)
|
||||
enroll_in_course(docname, data.payment)
|
||||
else:
|
||||
enroll_in_batch(docname, data.payment)
|
||||
except Exception as e:
|
||||
frappe.log_error(frappe.get_traceback(), _("Enrollment Failed"))
|
||||
|
||||
|
||||
def enroll_in_course(payment_name, course):
|
||||
def enroll_in_course(course, payment_name):
|
||||
if not frappe.db.exists(
|
||||
"LMS Enrollment", {"member": frappe.session.user, "course": course}
|
||||
):
|
||||
@@ -1950,12 +1950,14 @@ def enroll_in_batch(batch, payment_name=None):
|
||||
new_student.save()
|
||||
|
||||
|
||||
def update_certificate_purchase(course):
|
||||
def update_certificate_purchase(course, payment_name):
|
||||
frappe.db.set_value(
|
||||
"LMS Enrollment",
|
||||
{"member": frappe.session.user, "course": course},
|
||||
"purchased_certificate",
|
||||
1,
|
||||
{
|
||||
"purchased_certificate": 1,
|
||||
"payment": payment_name,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user