From bf36890bd3f65d7c1d464382022d3addcded16c6 Mon Sep 17 00:00:00 2001 From: Joedeep Singh Date: Sun, 12 Oct 2025 17:07:42 +0000 Subject: [PATCH 001/189] feat: added coupon code functionality --- frontend/components.d.ts | 2 + .../src/components/Settings/CouponDetails.vue | 157 +++++++++++++++++ frontend/src/components/Settings/Coupons.vue | 92 ++++++++++ frontend/src/components/Settings/Settings.vue | 7 + .../Settings/TransactionDetails.vue | 52 +++++- frontend/src/pages/Billing.vue | 48 ++++- lms/lms/doctype/lms_coupon/__init__.py | 0 lms/lms/doctype/lms_coupon/lms_coupon.js | 8 + lms/lms/doctype/lms_coupon/lms_coupon.json | 166 ++++++++++++++++++ lms/lms/doctype/lms_coupon/lms_coupon.py | 56 ++++++ lms/lms/doctype/lms_coupon/test_lms_coupon.py | 22 +++ lms/lms/doctype/lms_coupon_item/__init__.py | 0 .../lms_coupon_item/lms_coupon_item.json | 43 +++++ .../lms_coupon_item/lms_coupon_item.py | 9 + lms/lms/doctype/lms_payment/lms_payment.json | 27 +++ lms/lms/payments.py | 72 +++++--- lms/lms/utils.py | 83 +++++++++ 17 files changed, 821 insertions(+), 23 deletions(-) create mode 100644 frontend/src/components/Settings/CouponDetails.vue create mode 100644 frontend/src/components/Settings/Coupons.vue create mode 100644 lms/lms/doctype/lms_coupon/__init__.py create mode 100644 lms/lms/doctype/lms_coupon/lms_coupon.js create mode 100644 lms/lms/doctype/lms_coupon/lms_coupon.json create mode 100644 lms/lms/doctype/lms_coupon/lms_coupon.py create mode 100644 lms/lms/doctype/lms_coupon/test_lms_coupon.py create mode 100644 lms/lms/doctype/lms_coupon_item/__init__.py create mode 100644 lms/lms/doctype/lms_coupon_item/lms_coupon_item.json create mode 100644 lms/lms/doctype/lms_coupon_item/lms_coupon_item.py diff --git a/frontend/components.d.ts b/frontend/components.d.ts index b9411e86..c205bb11 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -42,6 +42,8 @@ declare module 'vue' { CodeEditor: typeof import('./src/components/Controls/CodeEditor.vue')['default'] CollapseSidebar: typeof import('./src/components/Icons/CollapseSidebar.vue')['default'] ColorSwatches: typeof import('./src/components/Controls/ColorSwatches.vue')['default'] + CouponDetails: typeof import('./src/components/Settings/CouponDetails.vue')['default'] + Coupons: typeof import('./src/components/Settings/Coupons.vue')['default'] CourseCard: typeof import('./src/components/CourseCard.vue')['default'] CourseCardOverlay: typeof import('./src/components/CourseCardOverlay.vue')['default'] CourseInstructors: typeof import('./src/components/CourseInstructors.vue')['default'] diff --git a/frontend/src/components/Settings/CouponDetails.vue b/frontend/src/components/Settings/CouponDetails.vue new file mode 100644 index 00000000..3e3fff36 --- /dev/null +++ b/frontend/src/components/Settings/CouponDetails.vue @@ -0,0 +1,157 @@ + + + diff --git a/frontend/src/components/Settings/Coupons.vue b/frontend/src/components/Settings/Coupons.vue new file mode 100644 index 00000000..078f4846 --- /dev/null +++ b/frontend/src/components/Settings/Coupons.vue @@ -0,0 +1,92 @@ + + + diff --git a/frontend/src/components/Settings/Settings.vue b/frontend/src/components/Settings/Settings.vue index 57c40f3e..f660fab4 100644 --- a/frontend/src/components/Settings/Settings.vue +++ b/frontend/src/components/Settings/Settings.vue @@ -81,6 +81,7 @@ import Categories from '@/components/Settings/Categories.vue' import EmailTemplates from '@/components/Settings/EmailTemplates.vue' import BrandSettings from '@/components/Settings/BrandSettings.vue' import PaymentGateways from '@/components/Settings/PaymentGateways.vue' +import Coupons from '@/components/Settings/Coupons.vue' import Transactions from '@/components/Settings/Transactions.vue' import ZoomSettings from '@/components/Settings/ZoomSettings.vue' import Badges from '@/components/Settings/Badges.vue' @@ -230,6 +231,12 @@ const tabsStructure = computed(() => { template: markRaw(PaymentGateways), description: 'Add and manage all your payment gateways', }, + { + label: 'Coupons', + icon: 'Tag', + template: markRaw(Coupons), + description: 'Create and manage coupon codes', + }, { label: 'Transactions', icon: 'Landmark', diff --git a/frontend/src/components/Settings/TransactionDetails.vue b/frontend/src/components/Settings/TransactionDetails.vue index b996b02d..a3e38933 100644 --- a/frontend/src/components/Settings/TransactionDetails.vue +++ b/frontend/src/components/Settings/TransactionDetails.vue @@ -72,6 +72,40 @@ /> +
+
+ {{ __('Coupon (if applied)') }} +
+
+ + + + +
+
+
@@ -100,7 +134,7 @@ diff --git a/frontend/src/components/Settings/TransactionDetails.vue b/frontend/src/components/Settings/TransactionDetails.vue index a3e38933..ac5b8e1d 100644 --- a/frontend/src/components/Settings/TransactionDetails.vue +++ b/frontend/src/components/Settings/TransactionDetails.vue @@ -67,43 +67,32 @@ />
-
-
- {{ __('Coupon (if applied)') }} -
-
- - - - -
+
+ + +
@@ -114,6 +103,13 @@ v-model="transactionData.payment_id" />
+ +
+ +
- diff --git a/frontend/src/components/Settings/TransactionDetails.vue b/frontend/src/components/Settings/TransactionDetails.vue index 07d97e90..d9aa5e5e 100644 --- a/frontend/src/components/Settings/TransactionDetails.vue +++ b/frontend/src/components/Settings/TransactionDetails.vue @@ -88,7 +88,10 @@ :disabled="true" />
- {{ getCurrencySymbol(row['currency']) }} {{ row['total_amount'] }} + {{ getCurrencySymbol(row['currency']) }} + {{ row['total_amount'] }}
{{ row[column.key] }} diff --git a/frontend/src/pages/Billing.vue b/frontend/src/pages/Billing.vue index bf7ff3cd..8e6c8320 100644 --- a/frontend/src/pages/Billing.vue +++ b/frontend/src/pages/Billing.vue @@ -35,7 +35,10 @@ {{ orderSummary.data.original_amount_formatted }}
-
+
{{ __('Discount') }}
-{{ orderSummary.data.discount_amount_formatted }}
@@ -61,11 +64,32 @@
-
- {{ __('Coupon') }} - - - +
+ {{ + __('Coupon') + }} + + +
@@ -268,7 +292,7 @@ const setBillingDetails = (data) => { const paymentLink = createResource({ url: 'lms.lms.payments.get_payment_link', makeParams(values) { - let data={ + let data = { doctype: props.type == 'batch' ? 'LMS Batch' : 'LMS Course', docname: props.name, title: orderSummary.data.title, diff --git a/lms/lms/doctype/lms_coupon/lms_coupon.py b/lms/lms/doctype/lms_coupon/lms_coupon.py index abb0ee55..d5328d84 100644 --- a/lms/lms/doctype/lms_coupon/lms_coupon.py +++ b/lms/lms/doctype/lms_coupon/lms_coupon.py @@ -2,75 +2,75 @@ # For license information, please see license.txt import frappe -from frappe.model.document import Document from frappe import _ +from frappe.model.document import Document from frappe.utils import nowdate class LMSCoupon(Document): - def validate(self): - if self.code: - self.code = self.code.strip().upper() + def validate(self): + if self.code: + self.code = self.code.strip().upper() - if not self.code: - frappe.throw(_("Coupon code is required")) + if not self.code: + frappe.throw(_("Coupon code is required")) - if len(self.code) < 6: - frappe.throw(_("Coupon code must be atleast 6 characters")) + if len(self.code) < 6: + frappe.throw(_("Coupon code must be atleast 6 characters")) - if self.name: - existing = frappe.db.exists( - "LMS Coupon", - { - "code": self.code, - "name": ["!=", self.name], - }, - ) - else: - existing = frappe.db.exists("LMS Coupon", {"code": self.code}) - - if existing: - frappe.throw(_("Coupon code is already taken. Use a different one")) + if self.name: + existing = frappe.db.exists( + "LMS Coupon", + { + "code": self.code, + "name": ["!=", self.name], + }, + ) + else: + existing = frappe.db.exists("LMS Coupon", {"code": self.code}) - if not self.discount_type: - frappe.throw(_("Discount type is required")) + if existing: + frappe.throw(_("Coupon code is already taken. Use a different one")) - if self.discount_type == "Percent": - if not self.percent_off or self.percent_off == "": - frappe.throw(_("Discount percentage is required")) - try: - percent_value = float(self.percent_off) - if not (0 < percent_value <= 100): - frappe.throw(_("Discount percentage must be between 1 and 100")) - except (ValueError, TypeError): - frappe.throw(_("Discount percentage must be a valid number")) - self.amount_off = None + if not self.discount_type: + frappe.throw(_("Discount type is required")) - if self.discount_type == "Amount": - if not self.amount_off or self.amount_off == "": - frappe.throw(_("Discount amount is required")) - try: - amount_value = float(self.amount_off) - if amount_value < 0: - frappe.throw(_("Discount amount cannot be negative")) - except (ValueError, TypeError): - frappe.throw(_("Discount amount must be a valid number")) - self.percent_off = None + if self.discount_type == "Percent": + if not self.percent_off or self.percent_off == "": + frappe.throw(_("Discount percentage is required")) + try: + percent_value = float(self.percent_off) + if not (0 < percent_value <= 100): + frappe.throw(_("Discount percentage must be between 1 and 100")) + except (ValueError, TypeError): + frappe.throw(_("Discount percentage must be a valid number")) + self.amount_off = None - if self.usage_limit is not None and self.usage_limit != "": - try: - usage_value = int(self.usage_limit) - if usage_value < 0: - frappe.throw(_("Usage limit cannot be negative")) - except (ValueError, TypeError): - frappe.throw(_("Usage limit must be a valid number")) + if self.discount_type == "Amount": + if not self.amount_off or self.amount_off == "": + frappe.throw(_("Discount amount is required")) + try: + amount_value = float(self.amount_off) + if amount_value < 0: + frappe.throw(_("Discount amount cannot be negative")) + except (ValueError, TypeError): + frappe.throw(_("Discount amount must be a valid number")) + self.percent_off = None - if self.expires_on and str(self.expires_on) < nowdate(): - frappe.throw(_("Expiry date cannot be in the past")) + if self.usage_limit is not None and self.usage_limit != "": + try: + usage_value = int(self.usage_limit) + if usage_value < 0: + frappe.throw(_("Usage limit cannot be negative")) + except (ValueError, TypeError): + frappe.throw(_("Usage limit must be a valid number")) - if not self.get("applicable_items") or len(self.get("applicable_items")) == 0: - frappe.throw(_("Please select atleast one course or batch")) + if self.expires_on and str(self.expires_on) < nowdate(): + frappe.throw(_("Expiry date cannot be in the past")) - for item in self.get("applicable_items"): - if not item.get("reference_name"): - frappe.throw(_("Please select a valid course or batch")) + if not self.get("applicable_items") or len(self.get("applicable_items")) == 0: + frappe.throw(_("Please select atleast one course or batch")) + + for item in self.get("applicable_items"): + if not item.get("reference_name"): + frappe.throw(_("Please select a valid course or batch")) diff --git a/lms/lms/doctype/lms_coupon/test_lms_coupon.py b/lms/lms/doctype/lms_coupon/test_lms_coupon.py index 11cdf628..58e26892 100644 --- a/lms/lms/doctype/lms_coupon/test_lms_coupon.py +++ b/lms/lms/doctype/lms_coupon/test_lms_coupon.py @@ -4,7 +4,6 @@ # import frappe from frappe.tests import IntegrationTestCase - # On IntegrationTestCase, the doctype test records and all # link-field test record dependencies are recursively loaded # Use these module variables to add/remove to/from that list @@ -12,7 +11,6 @@ EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"] IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"] - class IntegrationTestLMSCoupon(IntegrationTestCase): """ Integration tests for LMSCoupon. diff --git a/lms/lms/doctype/lms_payment/lms_payment.py b/lms/lms/doctype/lms_payment/lms_payment.py index 710cc304..49e1c3d1 100644 --- a/lms/lms/doctype/lms_payment/lms_payment.py +++ b/lms/lms/doctype/lms_payment/lms_payment.py @@ -5,7 +5,7 @@ import frappe from frappe import _ from frappe.email.doctype.email_template.email_template import get_email_template from frappe.model.document import Document -from frappe.utils import add_days, nowdate, flt +from frappe.utils import add_days, flt, nowdate class LMSPayment(Document): @@ -15,6 +15,7 @@ class LMSPayment(Document): gst = flt(self.gst_amount or 0, self.precision("gst_amount")) self.total_amount = flt(amount - discount + gst, self.precision("total_amount")) + def send_payment_reminder(): outgoing_email_account = frappe.get_cached_value( "Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name" diff --git a/lms/lms/payments.py b/lms/lms/payments.py index f69137aa..cfe75347 100644 --- a/lms/lms/payments.py +++ b/lms/lms/payments.py @@ -1,5 +1,6 @@ import frappe + def get_payment_gateway(): return frappe.db.get_single_value("LMS Settings", "payment_gateway") @@ -18,17 +19,17 @@ def validate_currency(payment_gateway, currency): @frappe.whitelist() def get_payment_link( - doctype, - docname, - title, - amount, + doctype, + docname, + title, + amount, discount_amount, - gst_amount, - currency, - address, - redirect_to, - payment_for_certificate, - coupon_code=None, + gst_amount, + currency, + address, + redirect_to, + payment_for_certificate, + coupon_code=None, ): payment_gateway = get_payment_gateway() address = frappe._dict(address) @@ -37,21 +38,22 @@ def get_payment_link( if doctype in ["LMS Course", "LMS Batch"] and coupon_code: try: from lms.lms.utils import apply_coupon + coupon_context = apply_coupon(doctype, docname, coupon_code) except Exception: pass payment = record_payment( - address, - doctype, - docname, - amount, - currency, - discount_amount, - gst_amount, - payment_for_certificate, - coupon_context, - ) + address, + doctype, + docname, + amount, + currency, + discount_amount, + gst_amount, + payment_for_certificate, + coupon_context, + ) controller = get_controller(payment_gateway) payment_details = { @@ -79,15 +81,15 @@ def get_payment_link( def record_payment( - address, - doctype, - docname, - amount, - currency, - discount_amount=0, - gst_amount=0, - payment_for_certificate=0, - coupon_context=None, + address, + doctype, + docname, + amount, + currency, + discount_amount=0, + gst_amount=0, + payment_for_certificate=0, + coupon_context=None, ): address = frappe._dict(address) address_name = save_address(address) diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 50f54cfd..7ed54954 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -953,74 +953,74 @@ def get_current_exchange_rate(source, target="USD"): @frappe.whitelist() def apply_coupon(doctype, docname, code, country=None): - # Validate doctype - if doctype not in ["LMS Course", "LMS Batch"]: - frappe.throw(_("Invalid doctype for coupon application.")) + # Validate doctype + if doctype not in ["LMS Course", "LMS Batch"]: + frappe.throw(_("Invalid doctype for coupon application.")) - if not code: - frappe.throw(_("Coupon code is required.")) + if not code: + frappe.throw(_("Coupon code is required.")) - summary = get_order_summary(doctype, docname, country) + summary = get_order_summary(doctype, docname, country) - base_amount = summary.original_amount - currency = summary.currency + base_amount = summary.original_amount + currency = summary.currency - # Fetch coupon case-insensitively - coupon_name = frappe.db.get_value("LMS Coupon", {"code": code.strip().upper(), "active": 1}, "name") - if not coupon_name: - frappe.throw(_("Invalid or inactive coupon code.")) + # Fetch coupon case-insensitively + coupon_name = frappe.db.get_value("LMS Coupon", {"code": code.strip().upper(), "active": 1}, "name") + if not coupon_name: + frappe.throw(_("Invalid or inactive coupon code.")) - coupon = frappe.get_doc("LMS Coupon", coupon_name) + coupon = frappe.get_doc("LMS Coupon", coupon_name) - # Expiry - if coupon.expires_on and getdate(coupon.expires_on) < getdate(): - frappe.throw(_("This coupon has expired.")) + # Expiry + if coupon.expires_on and getdate(coupon.expires_on) < getdate(): + frappe.throw(_("This coupon has expired.")) - # Usage limit - if coupon.usage_limit and cint(coupon.times_redeemed) >= cint(coupon.usage_limit): - frappe.throw(_("This coupon has reached its usage limit.")) + # Usage limit + if coupon.usage_limit and cint(coupon.times_redeemed) >= cint(coupon.usage_limit): + frappe.throw(_("This coupon has reached its usage limit.")) - # Applicability (if rows exist, must match; if none, applies to all) - applicable = True - if len(coupon.applicable_items): - applicable = any( - (row.reference_doctype == doctype and row.reference_name == docname) - for row in coupon.applicable_items - ) - if not applicable: - frappe.throw(_("This coupon is not applicable to this item.")) + # Applicability (if rows exist, must match; if none, applies to all) + applicable = True + if len(coupon.applicable_items): + applicable = any( + (row.reference_doctype == doctype and row.reference_name == docname) + for row in coupon.applicable_items + ) + if not applicable: + frappe.throw(_("This coupon is not applicable to this item.")) - # Compute discount before tax - discount_amount = 0 - if coupon.discount_type == "Percent": - discount_amount = cint(flt(base_amount) * flt(coupon.percent_off) / 100) - else: - discount_amount = min(flt(coupon.amount_off), flt(base_amount)) + # Compute discount before tax + discount_amount = 0 + if coupon.discount_type == "Percent": + discount_amount = cint(flt(base_amount) * flt(coupon.percent_off) / 100) + else: + discount_amount = min(flt(coupon.amount_off), flt(base_amount)) - subtotal = max(flt(base_amount) - flt(discount_amount), 0) + subtotal = max(flt(base_amount) - flt(discount_amount), 0) - gst_applied = 0 - final_amount = subtotal - if currency == "INR": - final_amount, gst_applied = apply_gst(subtotal, country) + gst_applied = 0 + final_amount = subtotal + if currency == "INR": + final_amount, gst_applied = apply_gst(subtotal, country) - return { - "title": summary.title, - "name": summary.name, - "currency": currency, - "original_amount": base_amount, - "original_amount_formatted": fmt_money(base_amount, 0, currency), - "discount_amount": discount_amount, - "discount_amount_formatted": fmt_money(discount_amount, 0, currency), - "amount": final_amount, - "gst_applied": gst_applied, - "gst_amount_formatted": fmt_money(gst_applied, 0, currency) if gst_applied else None, - "total_amount_formatted": fmt_money(final_amount, 0, currency), - "coupon": coupon.name, - "coupon_code": coupon.code, - "discount_type": coupon.discount_type, - "discount_percent": coupon.percent_off if coupon.discount_type == "Percent" else None, - } + return { + "title": summary.title, + "name": summary.name, + "currency": currency, + "original_amount": base_amount, + "original_amount_formatted": fmt_money(base_amount, 0, currency), + "discount_amount": discount_amount, + "discount_amount_formatted": fmt_money(discount_amount, 0, currency), + "amount": final_amount, + "gst_applied": gst_applied, + "gst_amount_formatted": fmt_money(gst_applied, 0, currency) if gst_applied else None, + "total_amount_formatted": fmt_money(final_amount, 0, currency), + "coupon": coupon.name, + "coupon_code": coupon.code, + "discount_type": coupon.discount_type, + "discount_percent": coupon.percent_off if coupon.discount_type == "Percent" else None, + } @frappe.whitelist() From 0f24fd6edc8d67b210340a267c9a406e0a3f5a8d Mon Sep 17 00:00:00 2001 From: Joedeep Singh Date: Mon, 13 Oct 2025 14:54:03 +0000 Subject: [PATCH 005/189] feat(coupon-details): prevent duplicate course/batch selections and clear name on type change --- .../src/components/Settings/CouponDetails.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/frontend/src/components/Settings/CouponDetails.vue b/frontend/src/components/Settings/CouponDetails.vue index 8a552af4..671d2f0c 100644 --- a/frontend/src/components/Settings/CouponDetails.vue +++ b/frontend/src/components/Settings/CouponDetails.vue @@ -65,10 +65,12 @@ { label: 'Course ', value: 'LMS Course' }, { label: 'Batch ', value: 'LMS Batch' }, ]" + @change="(val) => (row.reference_name = null)" /> i !== idx && r.reference_doctype === doctype && r.reference_name + ) + .map((r) => r.reference_name) + if (selectedNames.length === 0) return {} + return { + name: ['not in', selectedNames], + } +} + const saveDoc = createResource({ url: 'frappe.client.save', makeParams(values) { From acb5e5e1c978c6b53cfe4184556f04a2948e0f3a Mon Sep 17 00:00:00 2001 From: Joedeep Singh Date: Mon, 13 Oct 2025 15:35:56 +0000 Subject: [PATCH 006/189] chore: removed unnecessary comments and log statements --- frontend/src/pages/Billing.vue | 1 - lms/lms/utils.py | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/frontend/src/pages/Billing.vue b/frontend/src/pages/Billing.vue index 8e6c8320..c61461fd 100644 --- a/frontend/src/pages/Billing.vue +++ b/frontend/src/pages/Billing.vue @@ -264,7 +264,6 @@ const applyCoupon = createResource({ }, onSuccess(data) { orderSummary.data = data - console.log('orderSummary.data - ', orderSummary.data) appliedCoupon.value = couponCode.value toast.success(__('Coupon applied')) }, diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 7ed54954..562544cb 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -953,7 +953,6 @@ def get_current_exchange_rate(source, target="USD"): @frappe.whitelist() def apply_coupon(doctype, docname, code, country=None): - # Validate doctype if doctype not in ["LMS Course", "LMS Batch"]: frappe.throw(_("Invalid doctype for coupon application.")) @@ -965,22 +964,19 @@ def apply_coupon(doctype, docname, code, country=None): base_amount = summary.original_amount currency = summary.currency - # Fetch coupon case-insensitively coupon_name = frappe.db.get_value("LMS Coupon", {"code": code.strip().upper(), "active": 1}, "name") if not coupon_name: frappe.throw(_("Invalid or inactive coupon code.")) coupon = frappe.get_doc("LMS Coupon", coupon_name) - # Expiry if coupon.expires_on and getdate(coupon.expires_on) < getdate(): frappe.throw(_("This coupon has expired.")) - # Usage limit if coupon.usage_limit and cint(coupon.times_redeemed) >= cint(coupon.usage_limit): frappe.throw(_("This coupon has reached its usage limit.")) - # Applicability (if rows exist, must match; if none, applies to all) + # check applicability applicable = True if len(coupon.applicable_items): applicable = any( @@ -990,7 +986,6 @@ def apply_coupon(doctype, docname, code, country=None): if not applicable: frappe.throw(_("This coupon is not applicable to this item.")) - # Compute discount before tax discount_amount = 0 if coupon.discount_type == "Percent": discount_amount = cint(flt(base_amount) * flt(coupon.percent_off) / 100) From a1a302f22265181388f4327dbfd1f7e81c3096bf Mon Sep 17 00:00:00 2001 From: Rehan Ansari Date: Mon, 20 Oct 2025 11:17:02 +0530 Subject: [PATCH 007/189] feat: show job applications on frontend --- frontend/src/pages/JobApplications.vue | 234 +++++++++++++++++++++++++ frontend/src/pages/JobDetail.vue | 28 ++- frontend/src/router.js | 6 + lms/lms/api.py | 50 ++++++ 4 files changed, 317 insertions(+), 1 deletion(-) create mode 100644 frontend/src/pages/JobApplications.vue diff --git a/frontend/src/pages/JobApplications.vue b/frontend/src/pages/JobApplications.vue new file mode 100644 index 00000000..a54f6865 --- /dev/null +++ b/frontend/src/pages/JobApplications.vue @@ -0,0 +1,234 @@ + + + diff --git a/frontend/src/pages/JobDetail.vue b/frontend/src/pages/JobDetail.vue index dea21e94..4d337ac4 100644 --- a/frontend/src/pages/JobDetail.vue +++ b/frontend/src/pages/JobDetail.vue @@ -20,6 +20,23 @@ v-if="user.data?.name && !readOnlyMode" class="flex items-center space-x-2" > + + + Date: Mon, 20 Oct 2025 13:21:52 +0530 Subject: [PATCH 008/189] fix: set job owner as reply-to for job emails --- lms/lms/api.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lms/lms/api.py b/lms/lms/api.py index 8071f66c..c5f51daf 100644 --- a/lms/lms/api.py +++ b/lms/lms/api.py @@ -1686,15 +1686,19 @@ def get_job_applications(job): @frappe.whitelist() def send_email_to_applicant(applicant_email, subject, message, job): """Send email to job applicant. Only job owners or system managers can send emails.""" + job_owner = frappe.db.get_value("Job Opportunity", job, "owner") + if "System Manager" not in frappe.get_roles(): - job_owner = frappe.db.get_value("Job Opportunity", job, "owner") if job_owner != frappe.session.user: frappe.throw(_("You don't have permission to send emails for this job")) + job_owner_email = frappe.db.get_value("User", job_owner, "email") + frappe.sendmail( recipients=[applicant_email], subject=subject, message=message, + reply_to=job_owner_email, now=True, ) From f5188829260cc00403c36cdfa8263ae77a128d81 Mon Sep 17 00:00:00 2001 From: Jannat Patel <31363128+pateljannat@users.noreply.github.com> Date: Wed, 22 Oct 2025 21:17:42 +0530 Subject: [PATCH 009/189] chore: Serbian (Cyrillic) translations --- lms/locale/sr.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lms/locale/sr.po b/lms/locale/sr.po index db1689e5..1e6d78e7 100644 --- a/lms/locale/sr.po +++ b/lms/locale/sr.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: frappe\n" "Report-Msgid-Bugs-To: jannat@frappe.io\n" "POT-Creation-Date: 2025-10-17 16:04+0000\n" -"PO-Revision-Date: 2025-10-20 15:19\n" +"PO-Revision-Date: 2025-10-22 15:47\n" "Last-Translator: jannat@frappe.io\n" "Language-Team: Serbian (Cyrillic)\n" "MIME-Version: 1.0\n" @@ -2655,7 +2655,7 @@ msgstr "Неуспешно преузимање података о присус #: frontend/src/components/ContactUsEmail.vue:63 msgid "Failed to send email" -msgstr "" +msgstr "Слање имејла није успело" #: frontend/src/pages/ProgrammingExercises/ProgrammingExerciseSubmission.vue:358 msgid "Failed to submit. Please try again. {0}" @@ -6779,7 +6779,7 @@ msgstr "Временска зона" #: lms/lms/doctype/lms_course/lms_course.py:72 msgid "Timezone is required for paid certificates." -msgstr "" +msgstr "Временска зона је обавезна за плаћене сертификате." #: lms/templates/emails/batch_confirmation.html:21 #: lms/templates/emails/batch_start_reminder.html:16 @@ -7393,7 +7393,7 @@ msgstr "Добили сте резултат од {0} на квизу {1}" #: frontend/src/pages/ProfileCertificates.vue:26 msgid "You have not received any certificates yet." -msgstr "" +msgstr "Још увек нисте примили ниједан сертификат." #: lms/lms/widgets/NoPreviewModal.html:12 msgid "You have opted to be notified for this course. You will receive an email when the course becomes available." @@ -7595,7 +7595,7 @@ msgstr "дани" #: frontend/src/pages/CourseForm.vue:290 msgid "e.g. IST, UTC, GMT..." -msgstr "" +msgstr "нпр. IST, UTC, GMT..." #: frontend/src/pages/Home/Home.vue:101 frontend/src/pages/Home/Home.vue:124 msgid "evaluation" From 73fa1f9cfe14b6f0fb8f084463ecaf7e8f0c0cdb Mon Sep 17 00:00:00 2001 From: Jannat Patel <31363128+pateljannat@users.noreply.github.com> Date: Wed, 22 Oct 2025 21:17:52 +0530 Subject: [PATCH 010/189] chore: Serbian (Latin) translations --- lms/locale/sr_CS.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lms/locale/sr_CS.po b/lms/locale/sr_CS.po index ec969698..f59069a6 100644 --- a/lms/locale/sr_CS.po +++ b/lms/locale/sr_CS.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: frappe\n" "Report-Msgid-Bugs-To: jannat@frappe.io\n" "POT-Creation-Date: 2025-10-17 16:04+0000\n" -"PO-Revision-Date: 2025-10-20 15:19\n" +"PO-Revision-Date: 2025-10-22 15:47\n" "Last-Translator: jannat@frappe.io\n" "Language-Team: Serbian (Latin)\n" "MIME-Version: 1.0\n" @@ -2655,7 +2655,7 @@ msgstr "Neuspešno preuzimanje podataka o prisustvu za Zoom za predavanje {0}: { #: frontend/src/components/ContactUsEmail.vue:63 msgid "Failed to send email" -msgstr "" +msgstr "Slanje imejla nije uspelo" #: frontend/src/pages/ProgrammingExercises/ProgrammingExerciseSubmission.vue:358 msgid "Failed to submit. Please try again. {0}" @@ -6779,7 +6779,7 @@ msgstr "Vremenska zona" #: lms/lms/doctype/lms_course/lms_course.py:72 msgid "Timezone is required for paid certificates." -msgstr "" +msgstr "Vremenska zona je obavezna za plaćene sertifikate." #: lms/templates/emails/batch_confirmation.html:21 #: lms/templates/emails/batch_start_reminder.html:16 @@ -7393,7 +7393,7 @@ msgstr "Dobili ste rezultat od {0} na kvizu {1}" #: frontend/src/pages/ProfileCertificates.vue:26 msgid "You have not received any certificates yet." -msgstr "" +msgstr "Još uvek niste primili nijedan sertifikat." #: lms/lms/widgets/NoPreviewModal.html:12 msgid "You have opted to be notified for this course. You will receive an email when the course becomes available." @@ -7595,7 +7595,7 @@ msgstr "dani" #: frontend/src/pages/CourseForm.vue:290 msgid "e.g. IST, UTC, GMT..." -msgstr "" +msgstr "npr. IST, UTC, GMT..." #: frontend/src/pages/Home/Home.vue:101 frontend/src/pages/Home/Home.vue:124 msgid "evaluation" From 068adb62a723e9003359a7b4cda0ad07f67b07fd Mon Sep 17 00:00:00 2001 From: Rehan Ansari Date: Wed, 22 Oct 2025 21:55:03 +0530 Subject: [PATCH 011/189] fix: improve visibility in dark mode --- frontend/src/pages/Home/Streak.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/Home/Streak.vue b/frontend/src/pages/Home/Streak.vue index 49ba31a9..0011d8ee 100644 --- a/frontend/src/pages/Home/Streak.vue +++ b/frontend/src/pages/Home/Streak.vue @@ -20,7 +20,7 @@ }} {{ __(' you are on a') }} -
+
{{ streakInfo.data?.current_streak }} {{ __('day streak') }}
@@ -33,7 +33,7 @@
{{ __('Current Streak') }}
-
+
{{ streakInfo.data?.current_streak }} {{ __('days') }}
@@ -41,7 +41,7 @@
{{ __('Longest Streak') }}
-
+
{{ streakInfo.data?.longest_streak }} {{ __('days') }}
From 574913e9e41e89944eaa1284bf860c5e8697799c Mon Sep 17 00:00:00 2001 From: Rehan Ansari Date: Wed, 22 Oct 2025 22:35:01 +0530 Subject: [PATCH 012/189] fix: improve visibility in billing page --- frontend/src/pages/Billing.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/Billing.vue b/frontend/src/pages/Billing.vue index 551e041d..f23d3792 100644 --- a/frontend/src/pages/Billing.vue +++ b/frontend/src/pages/Billing.vue @@ -20,7 +20,7 @@
{{ __('Payment for ') }} {{ type }}:
-
+
{{ orderSummary.data.title }}
@@ -31,7 +31,7 @@
{{ __('Original Amount') }}
-
+
{{ orderSummary.data.original_amount_formatted }}
@@ -42,17 +42,17 @@
{{ __('GST Amount') }}
-
+
{{ orderSummary.data.gst_amount_formatted }}
-
+
{{ __('Total') }}
-
+
{{ orderSummary.data.total_amount_formatted }}
@@ -60,7 +60,7 @@
-
+
{{ __('Address') }}
From 0508e718cb04e01d3c165980356267688343a071 Mon Sep 17 00:00:00 2001 From: Rehan Ansari Date: Wed, 22 Oct 2025 22:56:54 +0530 Subject: [PATCH 013/189] fix: job modal text in dark mode --- frontend/src/components/Modals/JobApplicationModal.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Modals/JobApplicationModal.vue b/frontend/src/components/Modals/JobApplicationModal.vue index f4d66e8c..1f7cf0fc 100644 --- a/frontend/src/components/Modals/JobApplicationModal.vue +++ b/frontend/src/components/Modals/JobApplicationModal.vue @@ -18,7 +18,7 @@ > diff --git a/frontend/src/pages/Billing.vue b/frontend/src/pages/Billing.vue index dc89a738..dd952ee7 100644 --- a/frontend/src/pages/Billing.vue +++ b/frontend/src/pages/Billing.vue @@ -70,6 +70,7 @@ @input="appliedCoupon = $event.target.value.toUpperCase()" @keydown.enter="applyCouponCode" placeholder="COUPON2025" + autocomplete="off" class="flex-1 [&_input]:bg-white" />