feat:evaluation end date from lms portal
This commit is contained in:
@@ -29,6 +29,7 @@ class LMSBatch(Document):
|
|||||||
self.validate_membership()
|
self.validate_membership()
|
||||||
self.validate_timetable()
|
self.validate_timetable()
|
||||||
self.send_confirmation_mail()
|
self.send_confirmation_mail()
|
||||||
|
self.validate_evaluation_end_date()
|
||||||
|
|
||||||
def validate_duplicate_students(self):
|
def validate_duplicate_students(self):
|
||||||
students = [row.student for row in self.students]
|
students = [row.student for row in self.students]
|
||||||
@@ -68,6 +69,10 @@ class LMSBatch(Document):
|
|||||||
self.send_mail(student)
|
self.send_mail(student)
|
||||||
student.confirmation_email_sent = 1
|
student.confirmation_email_sent = 1
|
||||||
|
|
||||||
|
def validate_evaluation_end_date(self):
|
||||||
|
if self.evaluation_end_date and self.evaluation_end_date < self.end_date:
|
||||||
|
frappe.throw(_("Evaluation end date cannot be less than the batch end date."))
|
||||||
|
|
||||||
def send_mail(self, student):
|
def send_mail(self, student):
|
||||||
subject = _("Enrollment Confirmation for the Next Training Batch")
|
subject = _("Enrollment Confirmation for the Next Training Batch")
|
||||||
template = "batch_confirmation"
|
template = "batch_confirmation"
|
||||||
@@ -253,6 +258,7 @@ def create_batch(
|
|||||||
currency=None,
|
currency=None,
|
||||||
name=None,
|
name=None,
|
||||||
published=0,
|
published=0,
|
||||||
|
evaluation_end_date=None,
|
||||||
):
|
):
|
||||||
frappe.only_for("Moderator")
|
frappe.only_for("Moderator")
|
||||||
if name:
|
if name:
|
||||||
@@ -278,6 +284,7 @@ def create_batch(
|
|||||||
"amount": amount,
|
"amount": amount,
|
||||||
"currency": currency,
|
"currency": currency,
|
||||||
"published": published,
|
"published": published,
|
||||||
|
"evaluation_end_date": evaluation_end_date,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
doc.save()
|
doc.save()
|
||||||
|
|||||||
@@ -267,15 +267,6 @@ const open_batch_dialog = () => {
|
|||||||
fieldname: "published",
|
fieldname: "published",
|
||||||
default: batch_info && batch_info.published,
|
default: batch_info && batch_info.published,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
fieldtype: "Column Break",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
fieldtype: "Int",
|
|
||||||
label: __("Seat Count"),
|
|
||||||
fieldname: "seat_count",
|
|
||||||
default: batch_info && batch_info.seat_count,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
fieldtype: "Section Break",
|
fieldtype: "Section Break",
|
||||||
},
|
},
|
||||||
@@ -293,13 +284,6 @@ const open_batch_dialog = () => {
|
|||||||
reqd: 1,
|
reqd: 1,
|
||||||
default: batch_info && batch_info.end_date,
|
default: batch_info && batch_info.end_date,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
fieldtype: "Select",
|
|
||||||
label: __("Medium"),
|
|
||||||
fieldname: "medium",
|
|
||||||
options: ["Online", "Offline"],
|
|
||||||
default: (batch_info && batch_info.medium) || "Online",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
fieldtype: "Column Break",
|
fieldtype: "Column Break",
|
||||||
},
|
},
|
||||||
@@ -317,6 +301,16 @@ const open_batch_dialog = () => {
|
|||||||
default: batch_info && batch_info.end_time,
|
default: batch_info && batch_info.end_time,
|
||||||
reqd: 1,
|
reqd: 1,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldtype: "Section Break",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldtype: "Select",
|
||||||
|
label: __("Medium"),
|
||||||
|
fieldname: "medium",
|
||||||
|
options: ["Online", "Offline"],
|
||||||
|
default: (batch_info && batch_info.medium) || "Online",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldtype: "Link",
|
fieldtype: "Link",
|
||||||
label: __("Category"),
|
label: __("Category"),
|
||||||
@@ -325,6 +319,21 @@ const open_batch_dialog = () => {
|
|||||||
only_select: 1,
|
only_select: 1,
|
||||||
default: batch_info && batch_info.category,
|
default: batch_info && batch_info.category,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldtype: "Column Break",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldtype: "Int",
|
||||||
|
label: __("Seat Count"),
|
||||||
|
fieldname: "seat_count",
|
||||||
|
default: batch_info && batch_info.seat_count,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldtype: "Date",
|
||||||
|
label: __("Evaluation End Date"),
|
||||||
|
fieldname: "evaluation_end_date",
|
||||||
|
default: batch_info && batch_info.evaluation_end_date,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldtype: "Section Break",
|
fieldtype: "Section Break",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user