Merge pull request #1860 from pateljannat/issues-152

fix: round the amount after exchange rate calculation
This commit is contained in:
Jannat Patel
2025-11-27 12:45:03 +05:30
committed by GitHub
10 changed files with 26 additions and 27 deletions

View File

@@ -33,7 +33,7 @@
"dayjs": "^1.11.6",
"dompurify": "^3.2.6",
"feather-icons": "^4.28.0",
"frappe-ui": "^0.1.216",
"frappe-ui": "^0.1.220",
"highlight.js": "^11.11.1",
"lucide-vue-next": "^0.383.0",
"markdown-it": "^14.0.0",

View File

@@ -222,8 +222,8 @@ watch(
watch(
() => profile.language,
(newVal, oldVal) => {
if (newVal !== oldVal) {
() => {
if (profile.language !== props.profile.data.language) {
hasLanguageChanged.value = true
}
}

View File

@@ -1,3 +1,3 @@
@import './assets/Inter/inter.css';
@import 'frappe-ui/src/style.css';
@import 'frappe-ui/style.css';
@import './styles/codemirror.css';

View File

@@ -1,7 +1,5 @@
import { io } from 'socket.io-client'
import { socketio_port } from '../../../../sites/common_site_config.json'
import { getCachedListResource } from 'frappe-ui/src/resources/listResource'
import { getCachedResource } from 'frappe-ui/src/resources/resources'
export function initSocket() {
let host = window.location.hostname
@@ -14,15 +12,5 @@ export function initSocket() {
withCredentials: true,
reconnectionAttempts: 5,
})
socket.on('refetch_resource', (data) => {
if (data.cache_key) {
let resource =
getCachedResource(data.cache_key) ||
getCachedListResource(data.cache_key)
if (resource) {
resource.reload()
}
}
})
return socket
}

View File

@@ -1,4 +1,4 @@
import frappeUIPreset from 'frappe-ui/src/tailwind/preset'
import frappeUIPreset from 'frappe-ui/tailwind'
export default {
presets: [frappeUIPreset],

View File

@@ -2938,10 +2938,10 @@ fraction.js@^5.3.4:
resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-5.3.4.tgz#8c0fcc6a9908262df4ed197427bdeef563e0699a"
integrity sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==
frappe-ui@^0.1.216:
version "0.1.216"
resolved "https://registry.yarnpkg.com/frappe-ui/-/frappe-ui-0.1.216.tgz#2297192cfcf13db7f9d4e374782fac1d42d54634"
integrity sha512-rBBa5CZdRaYGllxU95uz1luVddZlZQXWxoPB7InxKqt5W/t7ZDqAudm6Crbo1kBy3Hp7VPNNbB43jVKJhlcrPQ==
frappe-ui@^0.1.220:
version "0.1.220"
resolved "https://registry.yarnpkg.com/frappe-ui/-/frappe-ui-0.1.220.tgz#689731816f8e97e8574bad797caf1f09de94cbad"
integrity sha512-UOlndnoXxxpQM+FjlH7ybSXQgERxdDS0hZNyEna/GPUrm8xMTqKsgnWRqgyv1VLdv/qCDmQT/KNgo5TstHKLhg==
dependencies:
"@floating-ui/vue" "^1.1.6"
"@headlessui/vue" "^1.7.14"

View File

@@ -1678,7 +1678,18 @@ def get_profile_details(username):
details = frappe.db.get_value(
"User",
{"username": username},
["full_name", "name", "username", "user_image", "bio", "headline", "cover_image"],
[
"first_name",
"last_name",
"full_name",
"name",
"username",
"user_image",
"bio",
"headline",
"language",
"cover_image",
],
as_dict=True,
)

View File

@@ -19,7 +19,7 @@ class LMSCertificate(Document):
self.name = make_autoname("hash", self.doctype)
def after_insert(self):
if not frappe.flags.in_test:
if not frappe.in_test:
outgoing_email_account = frappe.get_cached_value(
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
)

View File

@@ -13,7 +13,6 @@ from frappe.desk.notifications import extract_mentions
from frappe.rate_limiter import rate_limit
from frappe.utils import (
add_months,
ceil,
cint,
cstr,
flt,
@@ -25,6 +24,7 @@ from frappe.utils import (
getdate,
nowtime,
pretty_date,
rounded,
)
from lms.lms.md import find_macros, markdown_to_html
@@ -928,7 +928,7 @@ def check_multicurrency(amount, currency, country=None, amount_usd=None):
if apply_rounding and amount % 100 != 0:
amount = amount + 100 - amount % 100
return ceil(amount), currency
return rounded(amount), currency
def apply_gst(amount, country=None):
@@ -1197,7 +1197,7 @@ def get_categorized_courses(courses):
@frappe.whitelist(allow_guest=True)
@rate_limit(limit=50, seconds=60 * 60)
@rate_limit(limit=200, seconds=60 * 60)
def get_course_outline(course, progress=False):
"""Returns the course outline."""
outline = []