Merge branch 'main' of https://github.com/frappe/lms into lms-frappe-ui

This commit is contained in:
Jannat Patel
2023-12-21 14:05:59 +05:30
15 changed files with 85 additions and 27 deletions

View File

@@ -44,6 +44,7 @@ def get_context(context):
"published",
"allow_future",
"evaluation_end_date",
"meta_image",
],
as_dict=True,
)
@@ -156,7 +157,6 @@ def get_class_course_details(batch_courses):
"image",
"upcoming",
"short_introduction",
"image",
"paid_course",
"course_price",
"enable_certification",

View File

@@ -34,13 +34,17 @@ def get_context(context):
"meta_image",
"batch_details_raw",
"evaluation_end_date",
"amount_usd",
],
as_dict=1,
)
if context.batch_info.amount and context.batch_info.currency:
amount, currency = check_multicurrency(
context.batch_info.amount, context.batch_info.currency
context.batch_info.amount,
context.batch_info.currency,
None,
context.batch_info.amount_usd,
)
context.batch_info.amount = amount
context.batch_info.currency = currency

View File

@@ -26,6 +26,7 @@ def get_context(context):
"currency",
"seat_count",
"published",
"amount_usd",
],
order_by="start_date",
)
@@ -36,7 +37,9 @@ def get_context(context):
batch.course_count = frappe.db.count("Batch Course", {"parent": batch.name})
if batch.amount and batch.currency:
amount, currency = check_multicurrency(batch.amount, batch.currency)
amount, currency = check_multicurrency(
batch.amount, batch.currency, None, batch.amount_usd
)
batch.amount = amount
batch.currency = currency

View File

@@ -27,7 +27,7 @@ def get_context(context):
)
context.amount, context.currency = check_multicurrency(
context.amount, context.currency
context.amount, context.currency, None, context.amount_usd
)
context.address = get_address()
@@ -65,7 +65,7 @@ def get_billing_details(context):
details = frappe.db.get_value(
"LMS Course",
context.docname,
["title", "name", "paid_course", "course_price as amount", "currency"],
["title", "name", "paid_course", "course_price as amount", "currency", "amount_usd"],
as_dict=True,
)
@@ -76,7 +76,7 @@ def get_billing_details(context):
details = frappe.db.get_value(
"LMS Batch",
context.docname,
["title", "name", "paid_batch", "amount", "currency"],
["title", "name", "paid_batch", "amount", "currency", "amount_usd"],
as_dict=True,
)
@@ -88,6 +88,7 @@ def get_billing_details(context):
context.title = details.title
context.amount = details.amount
context.currency = details.currency
context.amount_usd = details.amount_usd
def get_address():

View File

@@ -56,6 +56,7 @@ def set_course_context(context, course_name):
"paid_course",
"course_price",
"currency",
"amount_usd",
"enable_certification",
"grant_certificate_after",
],
@@ -64,7 +65,7 @@ def set_course_context(context, course_name):
if course.course_price:
course.course_price, course.currency = check_multicurrency(
course.course_price, course.currency
course.course_price, course.currency, None, course.amount_usd
)
if frappe.form_dict.get("edit"):

View File

@@ -61,6 +61,7 @@ def get_courses():
"course_price",
"currency",
"creation",
"amount_usd",
],
)
@@ -72,7 +73,7 @@ def get_courses():
if course.course_price:
course.course_price, course.currency = check_multicurrency(
course.course_price, course.currency
course.course_price, course.currency, None, course.amount_usd
)
course.avg_rating = get_average_rating(course.name) or 0