fix: check seats of a batch at the time of billing
This commit is contained in:
@@ -110,7 +110,7 @@ import { useSidebar } from '@/stores/sidebar'
|
|||||||
import { useSettings } from '@/stores/settings'
|
import { useSettings } from '@/stores/settings'
|
||||||
import { ChevronRight, Plus } from 'lucide-vue-next'
|
import { ChevronRight, Plus } from 'lucide-vue-next'
|
||||||
import { Button, createResource } from 'frappe-ui'
|
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'
|
import PageModal from '@/components/Modals/PageModal.vue'
|
||||||
|
|
||||||
const { user, sidebarSettings } = sessionStore()
|
const { user, sidebarSettings } = sessionStore()
|
||||||
|
|||||||
@@ -28,10 +28,7 @@
|
|||||||
<div
|
<div
|
||||||
class="flex flex-col space-y-2 lg:space-y-0 lg:flex-row lg:items-center lg:space-x-4"
|
class="flex flex-col space-y-2 lg:space-y-0 lg:flex-row lg:items-center lg:space-x-4"
|
||||||
>
|
>
|
||||||
<TabButtons
|
<TabButtons :buttons="courseTabs" v-model="currentTab" />
|
||||||
:buttons="courseTabs"
|
|
||||||
v-model="currentTab"
|
|
||||||
/>
|
|
||||||
<FormControl
|
<FormControl
|
||||||
v-model="certification"
|
v-model="certification"
|
||||||
:label="__('Certification')"
|
:label="__('Certification')"
|
||||||
|
|||||||
@@ -174,6 +174,12 @@ export function getEditorTools() {
|
|||||||
preserveBlank: true,
|
preserveBlank: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
codeBox: {
|
||||||
|
class: CodeBox,
|
||||||
|
config: {
|
||||||
|
useDefaultTheme: 'dark',
|
||||||
|
},
|
||||||
|
},
|
||||||
list: {
|
list: {
|
||||||
class: NestedList,
|
class: NestedList,
|
||||||
inlineToolbar: true,
|
inlineToolbar: true,
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ export default defineConfig({
|
|||||||
lucideIcons: true,
|
lucideIcons: true,
|
||||||
jinjaBootData: true,
|
jinjaBootData: true,
|
||||||
frappeTypes: {
|
frappeTypes: {
|
||||||
input: {
|
input: {},
|
||||||
},
|
|
||||||
},
|
},
|
||||||
buildConfig: {
|
buildConfig: {
|
||||||
indexHtmlPath: '../lms/www/lms.html',
|
indexHtmlPath: '../lms/www/lms.html',
|
||||||
@@ -40,7 +39,7 @@ export default defineConfig({
|
|||||||
'showdown',
|
'showdown',
|
||||||
'engine.io-client',
|
'engine.io-client',
|
||||||
'tailwind.config.js',
|
'tailwind.config.js',
|
||||||
'highlight.js'
|
'highlight.js',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -56,14 +56,19 @@ def has_paid_later(payment):
|
|||||||
|
|
||||||
def is_batch_sold_out(payment):
|
def is_batch_sold_out(payment):
|
||||||
if payment.payment_for_document_type == "LMS Batch":
|
if payment.payment_for_document_type == "LMS Batch":
|
||||||
seat_count = frappe.get_cached_value("LMS Batch", payment.payment_for_document, "seat_count")
|
seat_count = frappe.get_cached_value(
|
||||||
number_of_students = frappe.db.count("LMS Batch Enrollment", {"batch": payment.payment_for_document})
|
"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:
|
if seat_count <= number_of_students:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def send_mail(payment):
|
def send_mail(payment):
|
||||||
subject = _("Complete Your Enrollment - Don't miss out!")
|
subject = _("Complete Your Enrollment - Don't miss out!")
|
||||||
template = "payment_reminder"
|
template = "payment_reminder"
|
||||||
|
|||||||
Reference in New Issue
Block a user