From 2cb4e3ae893aa37d68a4938884f3294ede62132f Mon Sep 17 00:00:00 2001 From: umer2001 Date: Tue, 12 Nov 2024 08:29:02 +0000 Subject: [PATCH] add: updates from muzamil.zaviago.com (2024-11-12) --- frappe/contacts/doctype/address/address.js | 19 +------------------ frappe/public/js/custom.js | 6 +++++- frappe/public/js/frappe/form/save.js | 8 +++++++- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/frappe/contacts/doctype/address/address.js b/frappe/contacts/doctype/address/address.js index cbd99e409d..aad8af1c16 100644 --- a/frappe/contacts/doctype/address/address.js +++ b/frappe/contacts/doctype/address/address.js @@ -13,9 +13,6 @@ frappe.ui.form.on("Address", { }, onload: function (frm) { if (frm.doc.__islocal) { - //bymuzammal - $("header").addClass("hide"); - //by muzammal const last_doc = frappe.contacts.get_last_doc(frm); if ( frappe.dynamic_link && @@ -98,18 +95,4 @@ frappe.ui.form.on("Address", { }, ]); }, -}); -//muzammal -$(document).ready(function () { - window.addEventListener('popstate', function (event) { - show_header() - }); - window.addEventListener('pushstate', function (event) { - show_header() - }); -}); -function show_header(){ - $("header").removeClass("hide"); - $("header").show(); -} -//muzammal \ No newline at end of file +}); \ No newline at end of file diff --git a/frappe/public/js/custom.js b/frappe/public/js/custom.js index c289249fd3..91579d24fc 100644 --- a/frappe/public/js/custom.js +++ b/frappe/public/js/custom.js @@ -1114,8 +1114,12 @@ $(document).ready(function () { if (left_sidebar.attr("style") == "display: none;"){ left_sidebar.attr("style", "") } - sidebar_wrapper.toggle(); + if (sidebar_wrapper.attr("style") == "display: block;"){ + $(".layout-main-section-wrapper").css("max-width","72%") + }else{ + $(".layout-main-section-wrapper").css("max-width","100%") + } }); var sidebar = $('#rightside'); diff --git a/frappe/public/js/frappe/form/save.js b/frappe/public/js/frappe/form/save.js index a95570c3a0..f610146b32 100644 --- a/frappe/public/js/frappe/form/save.js +++ b/frappe/public/js/frappe/form/save.js @@ -58,11 +58,17 @@ frappe.ui.form.save = function (frm, action, callback, btn) { var loadingFreeze = `
` var default_tabs = headers.html(); var imageslist = $(frm.$wrapper[0]).find('.images_list').html(); + let order_total=''; + if( frm.doc.disable_rounded_total ){ + order_total=frm.doc.grand_total + }else{ + order_total=frm.doc.rounded_total + } var creatingIcon = ` ` var svgimgs = ' '; - var structure = '
' + creatingIcon + '

'+(action === "Submit" ? (frm.doc.is_return ? "Submitting refund order" : "Submitting order") : (frm.doc.is_return ? "Creating refund order" : "Creating order"))+'

'+svgimgs+'
Total (THB) ฿ '+ frm.doc.base_grand_total.toFixed(2) +'
'+imageslist+'
'; + var structure = '
' + creatingIcon + '

'+(action === "Submit" ? (frm.doc.is_return ? "Submitting refund order" : "Submitting order") : (frm.doc.is_return ? "Creating refund order" : "Creating order"))+'

'+svgimgs+'
Total (THB) ฿ '+ order_total.toFixed(2) +'
'+imageslist+'
'; headers.html(structure); $("#body").append(loadingFreeze) $('body').css("overflow", "hidden")