From 67dfffdd58307671918382f6cd9fbe865cc5e3c6 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 13 Dec 2023 10:41:15 +0530 Subject: [PATCH 1/5] fix: calendar day view range --- lms/www/batches/batch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/www/batches/batch.js b/lms/www/batches/batch.js index 155b762d..3ac054d2 100644 --- a/lms/www/batches/batch.js +++ b/lms/www/batches/batch.js @@ -812,7 +812,7 @@ const set_calendar_range = (calendar, events) => { ); $(".calendar-range").text(`${calendar_date}`); - if (moment(events[0].date).isSameOrBefore(moment(calendar))) + if (moment(calendar_date).isSameOrBefore(moment(events[0].date))) $("#prev-week").hide(); else $("#prev-week").show(); From 85c850e5bf2b6456f1acc5663601b28171631e3a Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 14 Dec 2023 15:08:42 +0530 Subject: [PATCH 2/5] fix: cohorts --- lms/www/cohorts/cohort.html | 4 ++-- lms/www/cohorts/index.html | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lms/www/cohorts/cohort.html b/lms/www/cohorts/cohort.html index 7e1672a1..f604ce2d 100644 --- a/lms/www/cohorts/cohort.html +++ b/lms/www/cohorts/cohort.html @@ -6,8 +6,8 @@ course.title }} {% endblock %} {% block page_content %} {{ frappe.db.count("Cohort Subgroup", {"cohort": cohort.name}) }} {{ _("Subgroups") }} | {{ frappe.db.count("Cohort Mentor", {"cohort": cohort.name}) }} {{ _("Mentors") }} | {{ frappe.db.count("LMS Enrollment", - {"cohort": cohort.name}) }} {{ _("Students") }} | {{ frappe.db.count("Cohort - Join Request", {"cohort": cohort.name}) }} {{ _("Join Requests") }} + {"cohort": cohort.name}) }} {{ _("Students") }} + | {{ frappe.db.count("Cohort Join Request", {"cohort": cohort.name}) }} {{ _("Join Requests") }}

{% if is_mentor %} {% set sg = mentor.get_subgroup() %} diff --git a/lms/www/cohorts/index.html b/lms/www/cohorts/index.html index 55c3233f..c9d4f287 100644 --- a/lms/www/cohorts/index.html +++ b/lms/www/cohorts/index.html @@ -24,9 +24,9 @@ course.title }} {% endblock %} {% block page_content %} {% if cohorts %}

{{ frappe.db.count("Cohort Subgroup", {"cohort": cohort.name}) }} {{ _("Subgroups") }} | {{ frappe.db.count("Cohort Mentor", {"cohort": - cohort.name}) }} {{ _("Mentors") }} | {{ frappe.db.count("LMS - Enrollment", {"cohort": cohort.name}) }} {{ _("Students") }} | {{ - frappe.db.count("Cohort Join Request", {"cohort": cohort.name}) }} + cohort.name}) }} {{ _("Mentors") }} + | {{ frappe.db.count("LMS Enrollment", {"cohort": cohort.name}) }} {{ _("Students") }} + | {{ frappe.db.count("Cohort Join Request", {"cohort": cohort.name}) }} {{ _("Join Requests") }}

From 01f7fc3cff81d8f23107cfd0c5d5965b0d07f379 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 14 Dec 2023 15:12:23 +0530 Subject: [PATCH 3/5] fix: razorpay payment in other currency --- lms/lms/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 1c36c2a9..bb071b7b 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -920,7 +920,7 @@ def get_payment_options(doctype, docname, phone, country): "name": frappe.db.get_single_value("Website Settings", "app_name"), "description": _("Payment for {0} course").format(details["title"]), "order_id": order["id"], - "amount": order["amount"] * 100, + "amount": order["amount"], "currency": order["currency"], "prefill": { "name": frappe.db.get_value("User", frappe.session.user, "full_name"), From ac74cbdf72371865f333c470fa77ac33e001ed1b Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 14 Dec 2023 15:53:07 +0530 Subject: [PATCH 4/5] fix: razorpay payment in other currency --- lms/lms/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lms/lms/utils.py b/lms/lms/utils.py index bb071b7b..c8f84425 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -920,7 +920,7 @@ def get_payment_options(doctype, docname, phone, country): "name": frappe.db.get_single_value("Website Settings", "app_name"), "description": _("Payment for {0} course").format(details["title"]), "order_id": order["id"], - "amount": order["amount"], + "amount": order["amount"] * 100, "currency": order["currency"], "prefill": { "name": frappe.db.get_value("User", frappe.session.user, "full_name"), @@ -1034,13 +1034,15 @@ def create_order(client, amount, currency): try: return client.order.create( { - "amount": amount * 100, + "amount": amount, "currency": currency, } ) except Exception as e: frappe.throw( - _("Error during payment: {0}. Please contact the Administrator.").format(e) + _( + "Error during payment: {0} Please contact the Administrator. Amount {1} Currency {2}" + ).format(e, amount, currency) ) From d5118cc91faa81d48aa562b2ccd1385c88695240 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 14 Dec 2023 16:08:07 +0530 Subject: [PATCH 5/5] fix: razorpay payment in other currency --- lms/lms/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lms/lms/utils.py b/lms/lms/utils.py index c8f84425..3f5ec9f5 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -920,7 +920,7 @@ def get_payment_options(doctype, docname, phone, country): "name": frappe.db.get_single_value("Website Settings", "app_name"), "description": _("Payment for {0} course").format(details["title"]), "order_id": order["id"], - "amount": order["amount"] * 100, + "amount": cint(order["amount"]) * 100, "currency": order["currency"], "prefill": { "name": frappe.db.get_value("User", frappe.session.user, "full_name"), @@ -1034,15 +1034,15 @@ def create_order(client, amount, currency): try: return client.order.create( { - "amount": amount, + "amount": cint(amount) * 100, "currency": currency, } ) except Exception as e: frappe.throw( _( - "Error during payment: {0} Please contact the Administrator. Amount {1} Currency {2}" - ).format(e, amount, currency) + "Error during payment: {0} Please contact the Administrator. Amount {1} Currency {2} Formatted {3}" + ).format(e, amount, currency, cint(amount)) )