diff --git a/lms/lms/doctype/lms_certificate/lms_certificate.json b/lms/lms/doctype/lms_certificate/lms_certificate.json
index 263c7034..39206779 100644
--- a/lms/lms/doctype/lms_certificate/lms_certificate.json
+++ b/lms/lms/doctype/lms_certificate/lms_certificate.json
@@ -58,13 +58,13 @@
"fieldname": "batch_name",
"fieldtype": "Link",
"in_standard_filter": 1,
- "label": "Batch Name",
+ "label": "Batch",
"options": "LMS Batch"
}
],
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2023-08-23 14:48:49.351395",
+ "modified": "2023-08-29 15:23:08.637215",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate",
@@ -81,6 +81,18 @@
"role": "System Manager",
"share": 1,
"write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Moderator",
+ "share": 1,
+ "write": 1
}
],
"sort_field": "modified",
diff --git a/lms/www/batches/batch.html b/lms/www/batches/batch.html
index 38e547df..b6398a26 100644
--- a/lms/www/batches/batch.html
+++ b/lms/www/batches/batch.html
@@ -116,6 +116,7 @@
{% endif %}
+ {% if is_moderator %}
{{ _("Students") }}
@@ -125,7 +126,6 @@
- {% if is_moderator %}
{{ _("Assessments") }}
@@ -175,11 +175,11 @@
{% endif %}
+ {% if is_moderator %}
{{ StudentsSection(batch_info, batch_students) }}
- {% if is_moderator %}
{{ AssessmentsSection(batch_info) }}
diff --git a/lms/www/batches/progress.html b/lms/www/batches/progress.html
index 221264f7..533f9c6c 100644
--- a/lms/www/batches/progress.html
+++ b/lms/www/batches/progress.html
@@ -27,7 +27,7 @@
- {{ batch.name }}
+ {{ batch.title }}
@@ -46,6 +46,9 @@
{% endif %}
{% if is_moderator %}
+
{{ _("Evaluate") }}
@@ -86,5 +89,4 @@
let courses = {{ courses | json }};
let batch_name = "{{ batch.name }}";
- {{ include_script('controls.bundle.js') }}
{% endblock %}
\ No newline at end of file
diff --git a/lms/www/batches/progress.js b/lms/www/batches/progress.js
index 6c136c9a..6b65f70a 100644
--- a/lms/www/batches/progress.js
+++ b/lms/www/batches/progress.js
@@ -1,5 +1,45 @@
frappe.ready(() => {
+ frappe.require("controls.bundle.js");
+
$(".clickable-row").click((e) => {
window.location.href = $(e.currentTarget).data("href");
});
+
+ $(".btn-certification").click((e) => {
+ show_certificate_dialog(e);
+ });
});
+
+const show_certificate_dialog = (e) => {
+ this.certificate_dialog = new frappe.ui.Dialog({
+ title: __("Grant Certificate"),
+ fields: [
+ {
+ fieldtype: "Link",
+ fieldname: "course",
+ label: __("Course"),
+ options: "LMS Course",
+ reqd: 1,
+ filters: {
+ name: ["in", courses],
+ },
+ filter_description: " ",
+ only_select: 1,
+ },
+ {
+ fieldtype: "Date",
+ fieldname: "issue_date",
+ label: __("Issue Date"),
+ reqd: 1,
+ default: frappe.datetime.get_today(),
+ },
+ {
+ fieldtype: "Date",
+ fieldname: "expiry_date",
+ label: __("Expiry Date"),
+ },
+ ],
+ });
+
+ this.certificate_dialog.show();
+};
diff --git a/lms/www/batches/progress.py b/lms/www/batches/progress.py
index 9f6c29ee..230912e9 100644
--- a/lms/www/batches/progress.py
+++ b/lms/www/batches/progress.py
@@ -29,7 +29,9 @@ def get_context(context):
):
raise frappe.PermissionError(_("You don't have permission to access this page."))
- context.batch = frappe.db.get_value("LMS Batch", batch_name, ["name"], as_dict=True)
+ context.batch = frappe.db.get_value(
+ "LMS Batch", batch_name, ["name", "title"], as_dict=True
+ )
context.courses = frappe.get_all(
"Batch Course", {"parent": batch_name}, pluck="course"
diff --git a/lms/www/billing/billing.py b/lms/www/billing/billing.py
index 11fe243d..6cb9ec60 100644
--- a/lms/www/billing/billing.py
+++ b/lms/www/billing/billing.py
@@ -16,6 +16,7 @@ def get_context(context):
context.module = module
context.docname = docname
context.doctype = doctype
+ context.apply_gst = frappe.db.get_single_value("LMS Settings", "apply_gst")
if not frappe.db.exists(doctype, docname):
raise ValueError(_("Module Name is incorrect or does not exist."))
@@ -65,3 +66,6 @@ def get_context(context):
context.title = batch.title
context.amount = batch.amount
context.currency = batch.currency
+
+ if context.apply_gst:
+ context.gst_amount = context.amount * 1.18
diff --git a/lms/www/courses/outline.html b/lms/www/courses/outline.html
index 7d7805f3..2e662d81 100644
--- a/lms/www/courses/outline.html
+++ b/lms/www/courses/outline.html
@@ -146,7 +146,7 @@
{{ _("Short Description") }}
- {{ _("A breif description about this chapter.") }}
+ {{ _("A brief description about this chapter.") }}