<h2>How does Total cost being calculated for Entitlements?</h2><br/><div style="overflow-x:auto"><style type="text/css"><!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } </style> <div class="ns-kb-css-body-editor-container"> <p style="margin: 0in; font-family: 'Segoe UI Symbol'; font-size: 11.0pt;">☞ The Total cost is NOT just calculated as unit cost * purchased rights, instead it is unit cost * purchased rights * timeSpan.<br /><br /></p> <p style="margin: 0in; font-family: 'Segoe UI Symbol'; font-size: 11.0pt;">☞ Here timeSpan is calculated based on the start date and end date and subscription period. See the below code snippet from the UI script (CalculateTotalCost):<br /><a href="https://genpactdevelop.service-now.com/nav_to.do?uri=sys_ui_script.do?sys_id=e23df8f5e70b0300ab270558d2f6a93b">/sys_ui_script.do?sys_id=e23df8f5e70b0300ab270558d2f6a93b</a><br /><br />var value = unitCost * purchasedRights;<br />var inputStartDate = getDateFromFormat(g_form.getValue('start_date'), g_user_date_format);<br />var inputEndDate = getDateFromFormat(g_form.getValue('end_date'), g_user_date_format);<br />var timeSpan = this.getTimeSpan(inputStartDate, inputEndDate, g_form.getValue('subscription_period'));<br />value *= timeSpan;<br />.<br />.<br />.<br />if (subscriptioPeriod === 'annually') {<!-- --><br />startDate = this._addTimeSpan(startDate, yearDiff, 0);<br />leftDays = this._subtractDays(startDate, endDate);<br />timeSpan = yearDiff + leftDays / 365;<br />} else if (subscriptioPeriod === 'quarterly') {<!-- --><br />startDate = this._addTimeSpan(startDate, yearDiff, leftQuarter * 3);<br />leftDays = this._subtractDays(startDate, endDate);<br />timeSpan = totalQuarter + leftDays / 91;<br />} else if (subscriptioPeriod === 'monthly') {<!-- --><br />var daysInStartMonth = this._getDaysInMonth(startDate);<br />startDate = this._addTimeSpan(startDate, yearDiff, monthDiff);<br />leftDays = this._subtractDays(startDate, endDate);<br />timeSpan = yearDiff * 12 + monthDiff + leftDays / daysInStartMonth;<br />} else { // Entire subscription period<br />timeSpan = 1;<br />}<br /><br /></p> <p style="margin: 0in; font-family: 'Segoe UI Symbol'; font-size: 11.0pt;">☞ Refer:<br /><a href="https://www.servicenow.com/docs/csh?topicname=software-entitlement-fields.html&version=latest" target="_blank" rel="noopener noreferrer">https://www.servicenow.com/docs/csh?topicname=software-entitlement-fields.html&version=latest</a></p> <p style="margin: 0in; font-family: 'Segoe UI Symbol'; font-size: 11.0pt;"><br />☞ Below examples for easier calculation:<br /><br />Unit cost: 50<br />Purchased rights: 100<br />Subscription period: Monthly<br />Start date: 2023-01-01<br />End date: 2024-12-31<br /><br />The above timespan is exactly for 2 years<br />Total cost = [ unit price * purchased rights * timeSpan ]<br />i.e. Total cost = 50 * 100 * 24 months = 120,000.00<br /><br />If Subscription period: Annually, then:<br />i.e. Total cost = [50 * 12] * 100 * 2 years = 120,000.00<br /><br />If Subscription period: Quarterly, then:<br />i.e. Total cost = [50 * 12/4] * 100 * 8 quarters = 120,000.00<br /><br />If Subscription period: Entire Subscription Period, then:<br />i.e. Total cost = [50 * 24] * 100 * 1 = 120,000.00<br /><br />☞ But if you want to use Subscription Period as "Annually" when the timestamp is 39 months for example. This is not how it is designed.<br /><br />You are providing 39 months as a timeSpan and expecting that Annually should calculate the Unit Cost for 3 years and 3 months, which is not feasible.<br /><br />If you have 39 months, then provide Subscription Period as either "Monthly" or "Entire Subscription Period" to get exact Total Cost value. And opt for Annually when you want to calculate yearly. ex 12, 24, 36 months<br /><br />In the example,<br />Start Date: 22/06/2024<br />End Date: 21/09/2027<br /><br />Which is exactly 39 months.<br /><br />So go with:<br />Subscription Period as "Monthly" and Unit Cost as "21.84". --> Total Cost will be $2,342,340.00<br />Subscription Period as "Entire Subscription Period" and Unit Cost as "21.84 * 39 = 851.76". --> Total Cost will be $2,342,340.00</p> <span id="ns-kb-css-end-div-identifier" style="display: none; pointer-events: none;"></span></div></div>