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 { 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()
|
||||
|
||||
@@ -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')"
|
||||
|
||||
@@ -174,6 +174,12 @@ export function getEditorTools() {
|
||||
preserveBlank: true,
|
||||
},
|
||||
},
|
||||
codeBox: {
|
||||
class: CodeBox,
|
||||
config: {
|
||||
useDefaultTheme: 'dark',
|
||||
},
|
||||
},
|
||||
list: {
|
||||
class: NestedList,
|
||||
inlineToolbar: true,
|
||||
|
||||
@@ -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',
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user