@@ -46,6 +46,7 @@ <h1 class="mt-4 text-3xl font-semibold tracking-tight sm:text-4xl">
4646 showEvaluationModal : false ,
4747 activeStep : 0 ,
4848 band : 'band2' ,
49+ exampleACV : 100000 ,
4950 salesCycle : {
5051 stages : {
5152 PQL : {
@@ -529,6 +530,7 @@ <h1 class="mt-4 text-3xl font-semibold tracking-tight sm:text-4xl">
529530 const key = STATE . partnerType === "Registered" ? "Registered" : "Preferred|Premier" ;
530531 const rules = universe [ key ] ;
531532 const fullMarginValue = STATE . partnerType === "Registered" ? "5%" : STATE . commitment === "Annual" ? "30%" : "20%" ;
533+ const fullMarginRate = parseFloat ( fullMarginValue ) ;
532534 let html = '<h2 class="text-2xl font-bold mb-6 flex items-center gap-3"><i data-lucide="dollar-sign" class="h-6 w-6 stroke-[#0070F3]"></i>Margins</h2>' ;
533535 html += '<div class="flex flex-wrap items-center gap-4 mb-6">' ;
534536 html += `<label class="flex items-center gap-3 text-sm font-medium ${ disabled ? "opacity-50 cursor-not-allowed" : "" } ">
@@ -565,6 +567,47 @@ <h3 class="text-lg font-semibold flex items-center gap-2"><i data-lucide="zap" c
565567 html += '</tbody></table></div>' ;
566568 html += '<p class="text-xs text-[#4A5568]">“Up to” indicates the maximum eligible margin given qualifiers & program standing.</p>' ;
567569 }
570+ html += '<div class="mt-8">' ;
571+ html += '<h3 class="text-xl font-semibold mb-4 flex items-center gap-2"><i data-lucide="calculator" class="h-5 w-5 stroke-[#0070F3]"></i>Example Margin Calculation</h3>' ;
572+ html += '<div class="flex items-center gap-4 mb-4">' ;
573+ html += '<label for="exampleACV" class="text-sm font-medium">ACV:</label>' ;
574+ html += `<input id="exampleACV" type="number" value="${ STATE . exampleACV } " class="w-40 rounded-lg border border-[#E2E8F0] bg-white px-4 py-2.5 text-sm focus:border-[#0070F3] focus:ring-2 focus:ring-[#0070F3] focus:ring-opacity-50">` ;
575+ html += '</div>' ;
576+ html += '<div class="grid grid-cols-1 md:grid-cols-2 gap-6">' ;
577+ const acv = STATE . exampleACV ;
578+ if ( STATE . newPartner && STATE . dealType === "Net New" && ! disabled ) {
579+ const marginAmt = ( fullMarginRate / 100 ) * acv ;
580+ const net = acv - marginAmt ;
581+ html += `
582+ <div class="rounded-xl border border-[#E2E8F0] p-4 bg-white shadow-md">
583+ <h4 class="font-medium mb-2">New Partner Boost - Up to ${ fullMarginValue } </h4>
584+ <ul class="space-y-2 text-sm text-[#4A5568]">
585+ <li>Gross ACV: $${ acv . toLocaleString ( ) } </li>
586+ <li>Margin Rate: ${ fullMarginRate } %</li>
587+ <li>Margin Amount: $${ marginAmt . toLocaleString ( ) } </li>
588+ <li>Net to Recast: $${ net . toLocaleString ( ) } </li>
589+ </ul>
590+ </div>
591+ ` ;
592+ } else {
593+ rules . forEach ( ( r ) => {
594+ const rate = parseFloat ( r . upTo ) ;
595+ const marginAmt = ( rate / 100 ) * acv ;
596+ const net = acv - marginAmt ;
597+ html += `
598+ <div class="rounded-xl border border-[#E2E8F0] p-4 bg-white shadow-md">
599+ <h4 class="font-medium mb-2">${ r . band } - Up to ${ r . upTo } </h4>
600+ <ul class="space-y-2 text-sm text-[#4A5568]">
601+ <li>Gross ACV: $${ acv . toLocaleString ( ) } </li>
602+ <li>Margin Rate: ${ rate } %</li>
603+ <li>Margin Amount: $${ marginAmt . toLocaleString ( ) } </li>
604+ <li>Net to Recast: $${ net . toLocaleString ( ) } </li>
605+ </ul>
606+ </div>
607+ ` ;
608+ } ) ;
609+ }
610+ html += '</div></div>' ;
568611 return html ;
569612 }
570613 function renderDetailsContent ( specific ) {
@@ -982,6 +1025,13 @@ <h2 class="text-2xl font-bold mb-6 flex items-center gap-3"><i data-lucide="scal
9821025 render ( ) ;
9831026 } ) ;
9841027 }
1028+ const exampleACVInput = document . getElementById ( 'exampleACV' ) ;
1029+ if ( exampleACVInput ) {
1030+ exampleACVInput . addEventListener ( 'input' , ( e ) => {
1031+ STATE . exampleACV = parseFloat ( e . target . value ) || 100000 ;
1032+ render ( ) ;
1033+ } ) ;
1034+ }
9851035 const modals = document . querySelectorAll ( '#businessPlanModal, #evaluationModal' ) ;
9861036 modals . forEach ( modal => {
9871037 modal . addEventListener ( 'click' , ( e ) => {
0 commit comments