⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
erp.dev-unit.com
/
public
/
js
/
View File Name :
custom.js
/** * * You can write your JS code here, DO NOT touch the default style file * because it will make it harder for you to update. * */ "use strict"; $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, cache: false, complete: function () { $('[data-toggle="tooltip"]').tooltip(); }, }); $(function () { if ($('.custom-scroll').length) { $(".custom-scroll").niceScroll(); $(".custom-scroll-horizontal").niceScroll(); } if ($('.activity-wrap').length) { $(".activity-wrap").niceScroll(); } // if ($(".select2").length > 0) { // $(".select2").select2({ // disableOnMobile: false, // nativeOnMobile: false // }); // } }); function validation() { var forms = document.querySelectorAll('.needs-validation'); Array.prototype.forEach.call(forms, function (form) { form.addEventListener('submit', function (event) { var submitButton = form.querySelector('button[type="submit"], input[type="submit"]'); if (submitButton) { submitButton.disabled = true; } if (form.checkValidity() === false) { event.preventDefault(); event.stopPropagation(); //for debug // var invalidInputs = Array.from(form.elements).filter(function (input) { // return input.validity.valid === false && input.type !== "submit"; // Exclude submit buttons // }); // invalidInputs.forEach(function (input) { // console.log('Invalid input:', input.name || input.id || input.placeholder); // }); if (submitButton) { submitButton.disabled = false; } } form.classList.add('was-validated'); }, false); }); } $(document).ready(function () { if ($(".pc-dt-simple").length > 0) { $($(".pc-dt-simple")).each(function (index, element) { var id = $(element).attr('id'); const dataTable = new simpleDatatables.DataTable("#" + id); }); } if ($(".needs-validation").length > 0) { validation(); } common_bind(); summernote(); // for Choose file $(document).on('change', 'input[type=file]', function () { var fileclass = $(this).attr('data-filename'); var finalname = $(this).val().split('\\').pop(); $('.' + fileclass).html(finalname); }); }); function summernote() { if ($(".summernote").length > 0) { $( $(".summernote") ).each(function( index,element ) { var id = $(element).attr('id'); $('#'+id).summernote({ placeholder: "Write Here⦠", tabsize: 2, minHeight: 200, maxHeight: 250, toolbar: [ ['style', ['style']], ['color', ['color']], ['font', ['bold', 'italic', 'underline', 'strikethrough']], ['list', ['ul', 'ol', 'paragraph']], ['insert', ['link', 'unlink']], ] }); }); } } function toastrs(text, message, type) { var f = document.getElementById('liveToast'); var a = new bootstrap.Toast(f).show(); if (type == 'success') { $('#liveToast').addClass('bg-primary'); } else { $('#liveToast').addClass('bg-danger'); } $('#liveToast .toast-body').html(message); } // sidebar search $(document).on('input', '.sidebar-search-input', function() { const searchQuery = $(this).val().toLowerCase(); const $navbarContent = $('.navbar-content'); const $navbarItems = $('.navbar-wrapper .navbar-content .dash-hasmenu'); $navbarContent.scrollTop(0); $navbarItems.each(function() { const $item = $(this); const itemText = $item.text().toLowerCase(); const hasMenu = $item.hasClass('dash-hasmenu'); const $submenu = $item.find('.dash-submenu'); if (itemText.includes(searchQuery)) { $item.removeClass('d-none'); if($item.find('.dash-mtext').text().toLowerCase().includes(searchQuery)) { if (hasMenu && $submenu.length > 0) { $submenu.find('.dash-item').removeClass('d-none'); } } else { $submenu.find('.dash-item').each(function() { var subItemText = $(this).text().toLowerCase(); if (subItemText.includes(searchQuery)) { $(this).removeClass('d-none') } else { $(this).addClass('d-none'); } }); } } else { $item.addClass('d-none'); if (hasMenu) { $submenu.find('.dash-item').addClass('d-none'); } } }); }); $(document).on('click', 'a[data-ajax-popup="true"], button[data-ajax-popup="true"], div[data-ajax-popup="true"]', function () { var title = $(this).data('title'); var size = ($(this).data('size') == '') ? 'md' : $(this).data('size'); var url = $(this).data('url'); $("#commonModal .modal-title").html(title); $("#commonModal .modal-dialog").addClass('modal-' + size); $.ajax({ url: url, beforeSend: function () { $(".loader-wrapper").removeClass('d-none'); }, success: function (data) { $(".loader-wrapper").addClass('d-none'); $('#commonModal .body').html(data); $("#commonModal").modal('show'); summernote(); taskCheckbox(); common_bind("#commonModal"); validation(); }, error: function (xhr) { $(".loader-wrapper").addClass('d-none'); toastrs('Error', xhr.responseJSON.error, 'error') } }); }); $(document).on('click', 'a[data-ajax-popup-over="true"], button[data-ajax-popup-over="true"], div[data-ajax-popup-over="true"]', function () { var validate = $(this).attr('data-validate'); var id = ''; if (validate) { id = $(validate).val(); } var title = $(this).data('title'); var size = ($(this).data('size') == '') ? 'md' : $(this).data('size'); var url = $(this).data('url'); $("#commonModalOver .modal-title").html(title); $("#commonModalOver .modal-dialog").addClass('modal-' + size); $.ajax({ url: url + '?id=' + id, beforeSend: function () { $(".loader-wrapper").removeClass('d-none'); }, success: function (data) { $(".loader-wrapper").addClass('d-none'); $('#commonModalOver .body').html(data); $("#commonModalOver").modal('show'); summernote(); taskCheckbox(); validation(); }, error: function (xhr) { $(".loader-wrapper").addClass('d-none'); toastrs('Error', xhr.responseJSON.error, 'error') } }); }); function arrayToJson(form) { var data = $(form).serializeArray(); var indexed_array = {}; $.map(data, function (n, i) { indexed_array[n['name']] = n['value']; }); return indexed_array; } $(document).on("submit", "#commonModalOver form", function (e) { e.preventDefault(); var data = arrayToJson($(this)); data.ajax = true; var url = $(this).attr('action'); $.ajax({ url: url, data: data, type: 'POST', success: function (data) { toastrs('Success', data.success, 'success'); $(data.target).append('<option value="' + data.record.id + '">' + data.record.name + '</option>'); $(data.target).val(data.record.id); $(data.target).trigger('change'); $("#commonModalOver").modal('hide'); }, error: function (data) { data = data.responseJSON; toastrs('Error', data.error, 'error') } }); }); function common_bind(selector = "body") { var $datepicker = $(selector + ' .datepicker'); if ($(".datepicker-input").length) { const d_disable = new Datepicker(document.querySelector('.datepicker-input'), { buttonClass: 'btn', autohide: true }); } if ($(".flatpickr-time-input").length) { $(".flatpickr-time-input").flatpickr({ enableTime: true, dateFormat: "Y-m-d H:i", }); } if ($(".flatpickr-input").length) { $(".flatpickr-input").flatpickr({ enableTime: false, dateFormat: "Y-m-d", }); } if ($(".multi-flatpickr-input").length) { $(".multi-flatpickr-input").flatpickr({ mode: "multiple", enableTime: false, dateFormat: "Y-m-d", }); } if ($(".pc-timepicker-2").length) { document.querySelector(".pc-timepicker-2").flatpickr({ enableTime: true, noCalendar: true, }); } if ($(".flatpickr-with-datetime").length) { $(".flatpickr-with-datetime").flatpickr({ enableTime: true, dateFormat: "Y-m-d H:i", }); } if ($(".flatpickr-to-input").length) { $(".flatpickr-to-input").flatpickr({ mode: "range", dateFormat: "Y-m-d", }); } if ($(".custom-datepicker").length) { $('.custom-datepicker').daterangepicker({ singleDatePicker: true, format: 'Y-MM', locale: { format: 'Y-MM' } }); } if ($(".choices").length > 0) { $($(".choices")).each(function (index, element) { var id = $(element).attr('id'); var searchEnabled = $(element).attr('searchEnabled'); if (searchEnabled == undefined) { searchEnabled = false; } else if (searchEnabled == 'true') { searchEnabled = true; } else { searchEnabled = false; } if (id !== undefined) { var multipleCancelButton = new Choices( '#' + id, { loadingText: 'Loading...', searchEnabled: searchEnabled, placeholder: true, placeholderValue: "Please Select", removeItemButton: true, } ); } }); } if ($(".jscolor").length) { jscolor.installByClassName("jscolor"); } if ($("[avatar]").length) { LetterAvatar.transform(); } } function choices(id = null) { if ($(".choices").length > 0) { $($(".choices")).each(function (index, element) { var searchEnabled = $(element).attr('searchEnabled'); if (searchEnabled == undefined) { searchEnabled = false; } else if (searchEnabled == 'true') { searchEnabled = true; } else { searchEnabled = false; } if (id != null) { var id = id; } else { var id = $(element).attr('id'); } if (id !== undefined) { var multipleCancelButton = new Choices( '#' + id, { removeItemButton: true, loadingText: 'Loading...', searchEnabled: searchEnabled, placeholder: true, placeholderValue: "Please Select", } ); } }); } } function common_bind_confirmation() { if ($("[data-confirm]").length) { $('[data-confirm]').each(function () { var me = $(this), me_data = me.data('confirm'); me_data = me_data.split("|"); me.fireModal({ title: me_data[0], body: me_data[1], buttons: [ { text: me.data('confirm-text-yes') || 'Yes', class: 'btn btn-sm btn-danger rounded-pill', handler: function () { eval(me.data('confirm-yes')); } }, { text: me.data('confirm-text-cancel') || 'Cancel', class: 'btn btn-sm btn-secondary rounded-pill', handler: function (modal) { $.destroyModal(modal); eval(me.data('confirm-no')); } } ] }) }); } } function JsSearchBox() { if ($(".js-searchBox").length) { $(".js-searchBox").each(function (index) { if ($(this).parent().find('.formTextbox').length == 0) { $(this).searchBox({ elementWidth: '250' }); } }); } } function taskCheckbox() { var checked = 0; var count = 0; var percentage = 0; count = $("#check-list input[type=checkbox]").length; checked = $("#check-list input[type=checkbox]:checked").length; percentage = parseInt(((checked / count) * 100), 10); if (isNaN(percentage)) { percentage = 0; } $(".custom-label").text(percentage + "%"); $('#taskProgress').css('width', percentage + '%'); $('#taskProgress').removeClass('bg-warning'); $('#taskProgress').removeClass('bg-primary'); $('#taskProgress').removeClass('bg-success'); $('#taskProgress').removeClass('bg-danger'); if (percentage <= 15) { $('#taskProgress').addClass('bg-danger'); } else if (percentage > 15 && percentage <= 33) { $('#taskProgress').addClass('bg-warning'); } else if (percentage > 33 && percentage <= 70) { $('#taskProgress').addClass('bg-primary'); } else { $('#taskProgress').addClass('bg-success'); } } (function ($, window, i) { // Bootstrap 4 Modal $.fn.fireModal = function (options) { var options = $.extend({ size: 'modal-md', center: false, animation: true, title: 'Modal Title', closeButton: false, header: true, bodyClass: '', footerClass: '', body: '', buttons: [], autoFocus: true, created: function () { }, appended: function () { }, onFormSubmit: function () { }, modal: {} }, options); this.each(function () { i++; var id = 'fire-modal-' + i, trigger_class = 'trigger--' + id, trigger_button = $('.' + trigger_class); $(this).addClass(trigger_class); // Get modal body let body = options.body; if (typeof body == 'object') { if (body.length) { let part = body; body = body.removeAttr('id').clone().removeClass('modal-part'); part.remove(); } else { body = '<div class="text-danger">Modal part element not found!</div>'; } } // Modal base template var modal_template = ' <div class="modal' + (options.animation == true ? ' fade' : '') + '" tabindex="-1" role="dialog" id="' + id + '"> ' + ' <div class="modal-dialog ' + options.size + (options.center ? ' modal-dialog-centered' : '') + '" role="document"> ' + ' <div class="modal-content"> ' + ((options.header == true) ? ' <div class="modal-header"> ' + ' <h5 class="modal-title mx-auto">' + options.title + '</h5> ' + ((options.closeButton == true) ? ' <button type="button" class="close" data-dismiss="modal" aria-label="Close"> ' + ' <span aria-hidden="true">×</span> ' + ' </button> ' : '') + ' </div> ' : '') + ' <div class="modal-body text-center text-dark"> ' + ' </div> ' + (options.buttons.length > 0 ? ' <div class="modal-footer mx-auto"> ' + ' </div> ' : '') + ' </div> ' + ' </div> ' + ' </div> '; // Convert modal to object var modal_template = $(modal_template); // Start creating buttons from 'buttons' option var this_button; options.buttons.forEach(function (item) { // get option 'id' let id = "id" in item ? item.id : ''; // Button template this_button = '<button type="' + ("submit" in item && item.submit == true ? 'submit' : 'button') + '" class="' + item.class + '" id="' + id + '">' + item.text + '</button>'; // add click event to the button this_button = $(this_button).off('click').on("click", function () { // execute function from 'handler' option item.handler.call(this, modal_template); }); // append generated buttons to the modal footer $(modal_template).find('.modal-footer').append(this_button); }); // append a given body to the modal $(modal_template).find('.modal-body').append(body); // add additional body class if (options.bodyClass) $(modal_template).find('.modal-body').addClass(options.bodyClass); // add footer body class if (options.footerClass) $(modal_template).find('.modal-footer').addClass(options.footerClass); // execute 'created' callback options.created.call(this, modal_template, options); // modal form and submit form button let modal_form = $(modal_template).find('.modal-body form'), form_submit_btn = modal_template.find('button[type=submit]'); // append generated modal to the body $("body").append(modal_template); // execute 'appended' callback options.appended.call(this, $('#' + id), modal_form, options); // if modal contains form elements if (modal_form.length) { // if `autoFocus` option is true if (options.autoFocus) { // when modal is shown $(modal_template).on('shown.bs.modal', function () { // if type of `autoFocus` option is `boolean` if (typeof options.autoFocus == 'boolean') modal_form.find('input:eq(0)').focus(); // the first input element will be focused // if type of `autoFocus` option is `string` and `autoFocus` option is an HTML element else if (typeof options.autoFocus == 'string' && modal_form.find(options.autoFocus).length) modal_form.find(options.autoFocus).focus(); // find elements and focus on that }); } // form object let form_object = { startProgress: function () { modal_template.addClass('modal-progress'); }, stopProgress: function () { modal_template.removeClass('modal-progress'); } }; // if form is not contains button element if (!modal_form.find('button').length) $(modal_form).append('<button class="d-none" id="' + id + '-submit"></button>'); // add click event form_submit_btn.click(function () { modal_form.submit(); }); // add submit event modal_form.submit(function (e) { // start form progress form_object.startProgress(); // execute `onFormSubmit` callback options.onFormSubmit.call(this, modal_template, e, form_object); }); } $(document).on("click", '.' + trigger_class, function () { $('#' + id).modal(options.modal); return false; }); }); } // Bootstrap Modal Destroyer $.destroyModal = function (modal) { modal.modal('hide'); modal.on('hidden.bs.modal', function () { }); } })(jQuery, this, 0); var Charts = (function () { // Variable var $toggle = $('[data-toggle="chart"]'); var mode = 'light';//(themeMode) ? themeMode : 'light'; var fonts = { base: 'Open Sans' } // Colors var colors = { gray: { 100: '#f6f9fc', 200: '#e9ecef', 300: '#dee2e6', 400: '#ced4da', 500: '#adb5bd', 600: '#8898aa', 700: '#525f7f', 800: '#32325d', 900: '#212529' }, theme: { 'default': '#172b4d', 'primary': '#5e72e4', 'secondary': '#f4f5f7', 'info': '#11cdef', 'success': '#2dce89', 'danger': '#f5365c', 'warning': '#fb6340' }, black: '#12263F', white: '#FFFFFF', transparent: 'transparent', }; // Methods // Chart.js global options function chartOptions() { // Options var options = { defaults: { global: { responsive: true, maintainAspectRatio: false, defaultColor: (mode == 'dark') ? colors.gray[700] : colors.gray[600], defaultFontColor: (mode == 'dark') ? colors.gray[700] : colors.gray[600], defaultFontFamily: fonts.base, defaultFontSize: 13, layout: { padding: 0 }, legend: { display: false, position: 'bottom', labels: { usePointStyle: true, padding: 16 } }, elements: { point: { radius: 0, backgroundColor: colors.theme['primary'] }, line: { tension: .4, borderWidth: 4, borderColor: colors.theme['primary'], backgroundColor: colors.transparent, borderCapStyle: 'rounded' }, rectangle: { backgroundColor: colors.theme['warning'] }, arc: { backgroundColor: colors.theme['primary'], borderColor: (mode == 'dark') ? colors.gray[800] : colors.white, borderWidth: 4 } }, tooltips: { enabled: true, mode: 'index', intersect: false, } }, doughnut: { cutoutPercentage: 83, legendCallback: function (chart) { var data = chart.data; var content = ''; data.labels.forEach(function (label, index) { var bgColor = data.datasets[0].backgroundColor[index]; content += '<span class="chart-legend-item">'; content += '<i class="chart-legend-indicator" style="background-color: ' + bgColor + '"></i>'; content += label; content += '</span>'; }); return content; } } } } // yAxes Chart.scaleService.updateScaleDefaults('linear', { gridLines: { borderDash: [2], borderDashOffset: [2], color: (mode == 'dark') ? colors.gray[900] : colors.gray[300], drawBorder: false, drawTicks: false, drawOnChartArea: true, zeroLineWidth: 0, zeroLineColor: 'rgba(0,0,0,0)', zeroLineBorderDash: [2], zeroLineBorderDashOffset: [2] }, ticks: { beginAtZero: true, padding: 10, callback: function (value) { if (!(value % 10)) { return value } } } }); // xAxes Chart.scaleService.updateScaleDefaults('category', { gridLines: { drawBorder: false, drawOnChartArea: false, drawTicks: false }, ticks: { padding: 20 }, maxBarThickness: 10 }); return options; } // Parse global options function parseOptions(parent, options) { for (var item in options) { if (typeof options[item] !== 'object') { parent[item] = options[item]; } else { parseOptions(parent[item], options[item]); } } } // Push options function pushOptions(parent, options) { for (var item in options) { if (Array.isArray(options[item])) { options[item].forEach(function (data) { parent[item].push(data); }); } else { pushOptions(parent[item], options[item]); } } } // Pop options function popOptions(parent, options) { for (var item in options) { if (Array.isArray(options[item])) { options[item].forEach(function (data) { parent[item].pop(); }); } else { popOptions(parent[item], options[item]); } } } // Toggle options function toggleOptions(elem) { var options = elem.data('add'); var $target = $(elem.data('target')); var $chart = $target.data('chart'); if (elem.is(':checked')) { // Add options pushOptions($chart, options); // Update chart $chart.update(); } else { // Remove options popOptions($chart, options); // Update chart $chart.update(); } } // Update options function updateOptions(elem) { var options = elem.data('update'); var $target = $(elem.data('target')); var $chart = $target.data('chart'); // Parse options parseOptions($chart, options); // Toggle ticks toggleTicks(elem, $chart); // Update chart $chart.update(); } // Toggle ticks function toggleTicks(elem, $chart) { if (elem.data('prefix') !== undefined || elem.data('prefix') !== undefined) { var prefix = elem.data('prefix') ? elem.data('prefix') : ''; var suffix = elem.data('suffix') ? elem.data('suffix') : ''; // Update ticks $chart.options.scales.yAxes[0].ticks.callback = function (value) { if (!(value % 10)) { return prefix + value + suffix; } } // Update tooltips $chart.options.tooltips.callbacks.label = function (item, data) { var label = data.datasets[item.datasetIndex].label || ''; var yLabel = item.yLabel; var content = ''; if (data.datasets.length > 1) { content += '<span class="popover-body-label mr-auto">' + label + '</span>'; } content += '<span class="popover-body-value">' + prefix + yLabel + suffix + '</span>'; return content; } } } $('.remove_workspace').click(function (event) { var form = $(this).closest("form"); const swalWithBootstrapButtons = Swal.mixin({ customClass: { confirmButton: 'btn btn-success', cancelButton: 'btn btn-danger' }, buttonsStyling: false }) swalWithBootstrapButtons.fire({ title: 'Are you sure?', text: "This action can not be undone. Do you want to continue?", icon: 'warning', showCancelButton: true, confirmButtonText: 'Yes', cancelButtonText: 'No', reverseButtons: true }).then((result) => { if (result.isConfirmed) { form.submit(); } }) }); $(document).on('click', '.show_confirm', function () { var form = $(this).closest("form"); var title = $(this).attr("data-confirm"); var text = $(this).attr("data-text"); if (title == '' || title == undefined) { title = "Are you sure?"; } if (text == '' || text == undefined) { text = "This action can not be undone. Do you want to continue?"; } const swalWithBootstrapButtons = Swal.mixin({ customClass: { confirmButton: 'btn btn-success', cancelButton: 'btn btn-danger' }, buttonsStyling: false }) swalWithBootstrapButtons.fire({ title: title, text: text, icon: 'warning', showCancelButton: true, confirmButtonText: 'Yes', cancelButtonText: 'No', reverseButtons: true }).then((result) => { if (result.isConfirmed) { form.submit(); } }) }); // Events // Parse global options if (window.Chart) { parseOptions(Chart, chartOptions()); } // Toggle options $toggle.on({ 'change': function () { var $this = $(this); if ($this.is('[data-add]')) { toggleOptions($this); } }, 'click': function () { var $this = $(this); if ($this.is('[data-update]')) { updateOptions($this); } } }); // Return return { colors: colors, fonts: fonts, mode: mode }; })(); function postAjax(url, data, cb) { var token = $('meta[name="csrf-token"]').attr('content'); var jdata = { _token: token }; for (var k in data) { jdata[k] = data[k]; } $.ajax({ type: 'POST', url: url, data: jdata, success: function (data) { if (typeof (data) === 'object') { cb(data); } else { cb(data); } }, }); } function deleteAjax(url, data, cb) { var token = $('meta[name="csrf-token"]').attr('content'); var jdata = { _token: token }; for (var k in data) { jdata[k] = data[k]; } $.ajax({ type: 'DELETE', url: url, data: jdata, success: function (data) { if (typeof (data) === 'object') { cb(data); } else { cb(data); } }, }); } // Import Data function SetData(params, count = 0) { if (count < 8) { var process_area = document.getElementById("process_area"); if (process_area) { $('#process_area').html(params); } else { setTimeout(function () { SetData(params, count + 1); }, 500); } } else { toastrs('Success', '{{ __("Something went wrong please try again!") }}', 'success'); } } function decodeHtmlEntities(str) { const txt = document.createElement('textarea'); txt.innerHTML = str; return txt.value; } function formatCurrency(price, settingsEntity) { let symbolPosition = 'pre'; let currencySpace = null; let symbol = '$'; let format = 2; let decimalSeparator = ','; let thousandSeparator = '.'; const decodedString = decodeHtmlEntities(settingsEntity); const settings = JSON.parse(decodedString); price = parseFloat(price); if (isNaN(price)) { price = 0; } let length = price.toFixed(format).split('.')[0].length; if (settings) { if (settings.site_currency_symbol_position === 'post') { symbolPosition = 'post'; } if (settings.defult_currancy_symbol) { symbol = settings.defult_currancy_symbol; } if (settings.currency_format) { format = parseInt(settings.currency_format, 10); } if (settings.currency_space) { currencySpace = settings.currency_space; } if (settings.site_currency_symbol_name) { symbol = settings.site_currency_symbol_name === 'symbol' ? settings.defult_currancy_symbol : settings.defult_currancy; } if (length > 3) { decimalSeparator = settings.float_number && settings.float_number !== 'dot' ? ',' : '.'; } else { decimalSeparator = settings.decimal_separator && settings.decimal_separator !== 'dot' ? ',' : '.'; } thousandSeparator = settings.thousand_separator === 'dot' ? '.' : ','; } let [integerPart, fractionalPart] = price.toFixed(format).split('.'); integerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, thousandSeparator); let formattedPrice = integerPart + (fractionalPart ? decimalSeparator + fractionalPart : ''); return ( (symbolPosition === 'pre' ? symbol : '') + (currencySpace === 'withspace' ? ' ' : '') + formattedPrice + (currencySpace === 'withspace' ? ' ' : '') + (symbolPosition === 'post' ? symbol : '') ); }