{"id":23,"date":"2024-08-13T17:18:18","date_gmt":"2024-08-13T15:18:18","guid":{"rendered":"https:\/\/www.dynamics365blog.de\/?page_id=23"},"modified":"2024-08-14T09:49:42","modified_gmt":"2024-08-14T07:49:42","slug":"elementor-23","status":"publish","type":"page","link":"https:\/\/www.dynamics365blog.de\/en\/elementor-23\/","title":{"rendered":"Elementor #23"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"23\" class=\"elementor elementor-23\">\n\t\t\t\t<div class=\"elementor-element elementor-element-25d1b78 e-flex e-con-boxed e-con e-parent\" data-id=\"25d1b78\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-8d31933 elementor-widget elementor-widget-html\" data-id=\"8d31933\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<div id=\"pricegenerator\">\n        <h2>Pricing Table Generator<\/h2>\n        <form id=\"pricingForm\" action=\"\">\n            <label for=\"regularPrice\">Regular Price (EUR):<\/label>\n            <input type=\"number\" id=\"regularPrice\" name=\"regularPrice\" value=\"100\" step=\"0.01\" required><br>\n\n            <label for=\"initialPremiumFactor\">Initial Premium Factor:<\/label>\n            <input type=\"number\" id=\"initialPremiumFactor\" name=\"initialPremiumFactor\" value=\"1.6\" step=\"0.01\" required><br>\n\n            <label for=\"goalPremiumFactor\">Goal Premium Factor:<\/label>\n            <input type=\"number\" id=\"goalPremiumFactor\" name=\"goalPremiumFactor\" value=\"1.28\" step=\"0.01\" required><br>\n\n            <label for=\"initialEnterpriseFactor\">Initial Enterprise Factor:<\/label>\n            <input type=\"number\" id=\"initialEnterpriseFactor\" name=\"initialEnterpriseFactor\" value=\"2\" step=\"0.01\" required><br>\n\n            <label for=\"goalEnterpriseFactor\">Goal Enterprise Factor:<\/label>\n            <input type=\"number\" id=\"goalEnterpriseFactor\" name=\"goalEnterpriseFactor\" value=\"1.12\" step=\"0.01\" required><br>\n\n            <label for=\"maxUsers\">Maximum Users:<\/label>\n            <input type=\"number\" id=\"maxUsers\" name=\"maxUsers\" value=\"250\" required><br>\n\n            <label for=\"discountFactor\">Yearly Discount Factor:<\/label>\n            <input type=\"number\" id=\"discountFactor\" name=\"discountFactor\" value=\"0.1\" step=\"0.01\" required><br>\n        <input type=\"hidden\" name=\"trp-form-language\" value=\"en\"\/><\/form>\n\n        <h3>Pricing Table:<\/h3>\n        <table id=\"pricingTable\" border=\"1\">\n            <!-- Table will be dynamically generated here -->\n        <\/table>\n    <\/div>\n\n<script>\n    function calculateDecayRate(initialPrice, priceAt100Users, usersAt100) {\n        return (initialPrice - priceAt100Users) \/ (usersAt100 - 1);\n    }\n\n    function calculatePricePerUser(users, initialPrice, decayRate) {\n        return initialPrice - (decayRate * (users - 1));\n    }\n\n    function generatePricingTable() {\n        const regularPrice = parseFloat(document.getElementById(\"regularPrice\").value);\n        const initialPremiumFactor = parseFloat(document.getElementById(\"initialPremiumFactor\").value);\n        const goalPremiumFactor = parseFloat(document.getElementById(\"goalPremiumFactor\").value);\n        const initialEnterpriseFactor = parseFloat(document.getElementById(\"initialEnterpriseFactor\").value);\n        const goalEnterpriseFactor = parseFloat(document.getElementById(\"goalEnterpriseFactor\").value);\n        const maxUsers = parseInt(document.getElementById(\"maxUsers\").value);\n        const discountFactor = parseFloat(document.getElementById(\"discountFactor\").value);\n        const exchangeRateUsdToEur = 1.10;\n\n        \/\/ Calculate initial prices\n        const regularPriceUsd = regularPrice \/ exchangeRateUsdToEur;\n\n        const priceAt100UsersRegularEur = regularPrice * 0.5;\n        const priceAt100UsersRegularUsd = priceAt100UsersRegularEur \/ exchangeRateUsdToEur;\n\n        const decayRateRegularEur = calculateDecayRate(regularPrice, priceAt100UsersRegularEur, maxUsers);\n        const decayRateRegularUsd = calculateDecayRate(regularPriceUsd, priceAt100UsersRegularUsd, maxUsers);\n\n        const initialPricePremiumEur = regularPrice * initialPremiumFactor;\n        const initialPricePremiumUsd = initialPricePremiumEur \/ exchangeRateUsdToEur;\n        const priceAt100UsersPremiumEur = priceAt100UsersRegularEur * goalPremiumFactor;\n        const priceAt100UsersPremiumUsd = priceAt100UsersPremiumEur \/ exchangeRateUsdToEur;\n        const decayRatePremiumEur = calculateDecayRate(initialPricePremiumEur, priceAt100UsersPremiumEur, maxUsers);\n        const decayRatePremiumUsd = calculateDecayRate(initialPricePremiumUsd, priceAt100UsersPremiumUsd, maxUsers);\n\n        const initialPriceEnterpriseEur = regularPrice * initialEnterpriseFactor;\n        const initialPriceEnterpriseUsd = initialPriceEnterpriseEur \/ exchangeRateUsdToEur;\n        const priceAt100UsersEnterpriseEur = priceAt100UsersRegularEur * goalEnterpriseFactor;\n        const priceAt100UsersEnterpriseUsd = priceAt100UsersEnterpriseEur \/ exchangeRateUsdToEur;\n        const decayRateEnterpriseEur = calculateDecayRate(initialPriceEnterpriseEur, priceAt100UsersEnterpriseEur, maxUsers);\n        const decayRateEnterpriseUsd = calculateDecayRate(initialPriceEnterpriseUsd, priceAt100UsersEnterpriseUsd, maxUsers);\n\n        \/\/ Clear previous table content\n        const table = document.getElementById(\"pricingTable\");\n        table.innerHTML = \"\";\n\n        \/\/ Add table headers\n        const headers = [\n            \"User Count\", \"Regular Price Monthly (EUR)\", \"Regular Price Yearly (EUR)\", \"Cumulative Regular Yearly (EUR)\",\n            \"Premium Price Monthly (EUR)\", \"Premium Price Yearly (EUR)\", \"Cumulative Premium Yearly (EUR)\",\n            \"Enterprise Price Monthly (EUR)\", \"Enterprise Price Yearly (EUR)\", \"Cumulative Enterprise Yearly (EUR)\",\n            \"Regular Price Monthly (USD)\", \"Regular Price Yearly (USD)\", \"Cumulative Regular Yearly (USD)\",\n            \"Premium Price Monthly (USD)\", \"Premium Price Yearly (USD)\", \"Cumulative Premium Yearly (USD)\",\n            \"Enterprise Price Monthly (USD)\", \"Enterprise Price Yearly (USD)\", \"Cumulative Enterprise Yearly (USD)\"\n        ];\n        const headerRow = document.createElement(\"tr\");\n        headers.forEach(header => {\n            const th = document.createElement(\"th\");\n            th.innerText = header;\n            headerRow.appendChild(th);\n        });\n        table.appendChild(headerRow);\n\n        \/\/ Generate table rows\n        for (let users = 1; users <= maxUsers; users++) {\n            const regularPriceEurMonthly = calculatePricePerUser(users, regularPrice, decayRateRegularEur);\n            const premiumPriceEurMonthly = calculatePricePerUser(users, initialPricePremiumEur, decayRatePremiumEur);\n            const enterprisePriceEurMonthly = calculatePricePerUser(users, initialPriceEnterpriseEur, decayRateEnterpriseEur);\n\n            const regularPriceEurYearly = regularPriceEurMonthly * 12 * (1 - discountFactor);\n            const premiumPriceEurYearly = premiumPriceEurMonthly * 12 * (1 - discountFactor);\n            const enterprisePriceEurYearly = enterprisePriceEurMonthly * 12 * (1 - discountFactor);\n\n            const regularPriceUsdMonthly = calculatePricePerUser(users, regularPriceUsd, decayRateRegularUsd);\n            const premiumPriceUsdMonthly = calculatePricePerUser(users, initialPricePremiumUsd, decayRatePremiumUsd);\n            const enterprisePriceUsdMonthly = calculatePricePerUser(users, initialPriceEnterpriseUsd, decayRateEnterpriseUsd);\n\n            const regularPriceUsdYearly = regularPriceUsdMonthly * 12 * (1 - discountFactor);\n            const premiumPriceUsdYearly = premiumPriceUsdMonthly * 12 * (1 - discountFactor);\n            const enterprisePriceUsdYearly = enterprisePriceUsdMonthly * 12 * (1 - discountFactor);\n\n            \/\/ Calculate cumulative totals based on monthly prices\n            const cumulativeRegularEurYearly = users * regularPriceEurMonthly * 12;\n            const cumulativePremiumEurYearly = users * premiumPriceEurMonthly * 12;\n            const cumulativeEnterpriseEurYearly = users * enterprisePriceEurMonthly * 12;\n            const cumulativeRegularUsdYearly = users * regularPriceUsdMonthly * 12;\n            const cumulativePremiumUsdYearly = users * premiumPriceUsdMonthly * 12;\n            const cumulativeEnterpriseUsdYearly = users * enterprisePriceUsdMonthly * 12;\n\n            const row = document.createElement(\"tr\");\n            const rowData = [\n                users,\n                regularPriceEurMonthly.toFixed(2), regularPriceEurYearly.toFixed(2), cumulativeRegularEurYearly.toFixed(2),\n                premiumPriceEurMonthly.toFixed(2), premiumPriceEurYearly.toFixed(2), cumulativePremiumEurYearly.toFixed(2),\n                enterprisePriceEurMonthly.toFixed(2), enterprisePriceEurYearly.toFixed(2), cumulativeEnterpriseEurYearly.toFixed(2),\n                regularPriceUsdMonthly.toFixed(2), regularPriceUsdYearly.toFixed(2), cumulativeRegularUsdYearly.toFixed(2),\n                premiumPriceUsdMonthly.toFixed(2), premiumPriceUsdYearly.toFixed(2), cumulativePremiumUsdYearly.toFixed(2),\n                enterprisePriceUsdMonthly.toFixed(2), enterprisePriceUsdYearly.toFixed(2), cumulativeEnterpriseUsdYearly.toFixed(2)\n            ];\n            rowData.forEach(data => {\n                const td = document.createElement(\"td\");\n                td.innerText = data;\n                row.appendChild(td);\n            });\n            table.appendChild(row);\n        }\n    }\n\n    \/\/ Attach event listeners to all input fields to trigger table generation on input change\n    document.querySelectorAll('#pricingForm input').forEach(input => {\n        input.addEventListener('input', generatePricingTable);\n    });\n\n    \/\/ Initial generation of the table\n    generatePricingTable();\n\n<\/script>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Pricing Table Generator Regular Price (EUR): Initial Premium Factor: Goal Premium Factor: Initial Enterprise Factor: Goal Enterprise Factor: Maximum Users: Yearly Discount Factor: Pricing Table:<\/p>","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/www.dynamics365blog.de\/en\/wp-json\/wp\/v2\/pages\/23"}],"collection":[{"href":"https:\/\/www.dynamics365blog.de\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.dynamics365blog.de\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.dynamics365blog.de\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dynamics365blog.de\/en\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":16,"href":"https:\/\/www.dynamics365blog.de\/en\/wp-json\/wp\/v2\/pages\/23\/revisions"}],"predecessor-version":[{"id":40,"href":"https:\/\/www.dynamics365blog.de\/en\/wp-json\/wp\/v2\/pages\/23\/revisions\/40"}],"wp:attachment":[{"href":"https:\/\/www.dynamics365blog.de\/en\/wp-json\/wp\/v2\/media?parent=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}