fix: check seats of a batch at the time of billing

This commit is contained in:
Jannat Patel
2025-03-20 11:03:08 +05:30
parent 04cbd6a1d8
commit 7ae3cf5d95
6 changed files with 1375 additions and 14 deletions

View File

@@ -110,7 +110,7 @@ import { useSidebar } from '@/stores/sidebar'
import { useSettings } from '@/stores/settings'
import { ChevronRight, Plus } from 'lucide-vue-next'
import { Button, createResource } from 'frappe-ui'
import { TrialBanner } from "frappe-ui/frappe"
import { TrialBanner } from 'frappe-ui/frappe'
import PageModal from '@/components/Modals/PageModal.vue'
const { user, sidebarSettings } = sessionStore()

View File

@@ -28,10 +28,7 @@
<div
class="flex flex-col space-y-2 lg:space-y-0 lg:flex-row lg:items-center lg:space-x-4"
>
<TabButtons
:buttons="courseTabs"
v-model="currentTab"
/>
<TabButtons :buttons="courseTabs" v-model="currentTab" />
<FormControl
v-model="certification"
:label="__('Certification')"

View File

@@ -174,6 +174,12 @@ export function getEditorTools() {
preserveBlank: true,
},
},
codeBox: {
class: CodeBox,
config: {
useDefaultTheme: 'dark',
},
},
list: {
class: NestedList,
inlineToolbar: true,

View File

@@ -11,8 +11,7 @@ export default defineConfig({
lucideIcons: true,
jinjaBootData: true,
frappeTypes: {
input: {
},
input: {},
},
buildConfig: {
indexHtmlPath: '../lms/www/lms.html',
@@ -40,7 +39,7 @@ export default defineConfig({
'showdown',
'engine.io-client',
'tailwind.config.js',
'highlight.js'
'highlight.js',
],
},
})

View File

@@ -56,14 +56,19 @@ def has_paid_later(payment):
def is_batch_sold_out(payment):
if payment.payment_for_document_type == "LMS Batch":
seat_count = frappe.get_cached_value("LMS Batch", payment.payment_for_document, "seat_count")
number_of_students = frappe.db.count("LMS Batch Enrollment", {"batch": payment.payment_for_document})
seat_count = frappe.get_cached_value(
"LMS Batch", payment.payment_for_document, "seat_count"
)
number_of_students = frappe.db.count(
"LMS Batch Enrollment", {"batch": payment.payment_for_document}
)
if seat_count <= number_of_students:
return True
return False
def send_mail(payment):
subject = _("Complete Your Enrollment - Don't miss out!")
template = "payment_reminder"

1354
yarn.lock Normal file

File diff suppressed because it is too large Load Diff