Subversion Repositories SmartDukaan

Rev

Rev 37561 | Rev 37573 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37561 Rev 37570
Line 1987... Line 1987...
1987
      font-weight: 600
1987
      font-weight: 600
1988
    }
1988
    }
1989
 
1989
 
1990
    /* --- data cells --- */
1990
    /* --- data cells --- */
1991
    #rdrrPmWrap .pm-cell {
1991
    #rdrrPmWrap .pm-cell {
1992
      padding: 8px 14px;
1992
      padding: 14px 16px;
1993
      min-width: 140px;
1993
      min-width: 150px;
1994
      text-align: right;
1994
      text-align: right;
1995
      vertical-align: middle;
1995
      vertical-align: middle;
1996
      font-variant-numeric: tabular-nums;
1996
      font-variant-numeric: tabular-nums;
1997
      color: var(--ink)
1997
      color: var(--ink)
1998
    }
1998
    }
1999
 
1999
 
2000
    #rdrrPmWrap .pm-cell-zero {
2000
    #rdrrPmWrap .pm-cell-zero {
2001
      color: #cbd0d9;
2001
      color: #cbd0d9;
2002
      font-size: 15px;
2002
      font-size: 17px;
2003
      font-weight: 500;
2003
      font-weight: 500;
2004
      text-align: center
2004
      text-align: center
2005
    }
2005
    }
2006
 
2006
 
-
 
2007
    /* Stacked cell content: partner count on top, PO in middle, Billed at bottom (primary) */
2007
    #rdrrPmWrap .pm-billed {
2008
    #rdrrPmWrap .pm-partners {
-
 
2009
      font-size: 12px;
2008
      font-weight: 700;
2010
      font-weight: 600;
2009
      font-size: 14px;
2011
      color: #177a3a;
2010
      line-height: 1.15;
2012
      line-height: 1.15;
2011
      color: var(--ink);
2013
      margin-bottom: 4px;
2012
      white-space: nowrap
2014
      white-space: nowrap
2013
    }
2015
    }
2014
 
2016
 
2015
    #rdrrPmWrap .pm-meta {
2017
    #rdrrPmWrap .pm-po {
2016
      margin-top: 3px;
-
 
2017
      font-size: 11px;
2018
      font-size: 12px;
2018
      color: var(--soft);
-
 
2019
      font-weight: 500;
2019
      font-weight: 500;
-
 
2020
      color: #4a55a8;
2020
      line-height: 1.15;
2021
      line-height: 1.15;
-
 
2022
      margin-bottom: 4px;
2021
      white-space: nowrap
2023
      white-space: nowrap
2022
    }
2024
    }
2023
 
2025
 
2024
    #rdrrPmWrap .pm-partners {
2026
    #rdrrPmWrap .pm-billed {
2025
      color: #177a3a
2027
      font-weight: 800;
2026
    }
2028
      font-size: 16px;
2027
 
-
 
2028
    #rdrrPmWrap .pm-meta-sep {
2029
      line-height: 1.2;
2029
      opacity: .4;
2030
      color: var(--ink);
2030
      margin: 0 3px
2031
      white-space: nowrap
2031
    }
2032
    }
2032
 
2033
 
2033
    #rdrrPmWrap .pm-po {
2034
    #rdrrPmWrap .pm-tag {
-
 
2035
      font-size: 10px;
-
 
2036
      font-weight: 500;
2034
      color: #4a55a8
2037
      opacity: .7;
-
 
2038
      margin-left: 2px;
-
 
2039
      letter-spacing: .02em
2035
    }
2040
    }
2036
 
2041
 
2037
    /* --- row hover --- */
2042
    /* --- row hover --- */
2038
    #rdrrPmWrap .pm-grid tbody tr.pm-row + tr.pm-row td {
2043
    #rdrrPmWrap .pm-grid tbody tr.pm-row + tr.pm-row td {
2039
      border-top: 1px solid var(--line2)
2044
      border-top: 1px solid var(--line2)
Line 3167... Line 3172...
3167
      var other = s.substring(0, s.length - 3);
3172
      var other = s.substring(0, s.length - 3);
3168
      if (other !== "") lastThree = "," + lastThree;
3173
      if (other !== "") lastThree = "," + lastThree;
3169
      return other.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
3174
      return other.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
3170
    }
3175
    }
3171
 
3176
 
-
 
3177
    // Compact Lakh format for the Purchase Milestones grid: 623478 → "6.2L", 500 → "0.0L", 15737358 → "157.4L".
-
 
3178
    // Always one decimal, always suffixed "L" — matches how other DRR sections display money.
-
 
3179
    function pmLakh(n) {
-
 
3180
      n = Number(n) || 0;
-
 
3181
      return (n / 100000).toFixed(1) + "L";
-
 
3182
    }
-
 
3183
 
3172
    // Compact currency: >= 1Cr => "1.19Cr", >= 1L => "18.68L", >= 1K => "28.4K", else raw.
3184
    // Compact currency: >= 1Cr => "1.19Cr", >= 1L => "18.68L", >= 1K => "28.4K", else raw.
3173
    // `tight=true` drops the space before the unit for narrow cells.
3185
    // `tight=true` drops the space before the unit for narrow cells.
3174
    function pmCompactCurrency(n, tight) {
3186
    function pmCompactCurrency(n, tight) {
3175
      n = Number(n) || 0;
3187
      n = Number(n) || 0;
3176
      var sp = tight ? "" : " ";
3188
      var sp = tight ? "" : " ";
Line 3303... Line 3315...
3303
        model.brands.forEach(function (b) {
3315
        model.brands.forEach(function (b) {
3304
          var c = row.cells[b.name] || {po: 0, count: 0, billed: 0};
3316
          var c = row.cells[b.name] || {po: 0, count: 0, billed: 0};
3305
          var max = model.brandMax[b.name] || 0;
3317
          var max = model.brandMax[b.name] || 0;
3306
          var intensity = (!row.isTotal && max > 0) ? Math.min(1, c.billed / max) : 0;
3318
          var intensity = (!row.isTotal && max > 0) ? Math.min(1, c.billed / max) : 0;
3307
          var isZero = c.billed === 0 && c.po === 0 && c.count === 0;
3319
          var isZero = c.billed === 0 && c.po === 0 && c.count === 0;
-
 
3320
          // Softer heatmap: capped alpha keeps dark text readable at max intensity.
3308
          var bgAlpha = intensity > 0 ? (0.10 + intensity * 0.55).toFixed(2) : 0;
3321
          var bgAlpha = intensity > 0 ? (0.05 + intensity * 0.22).toFixed(2) : 0;
3309
          var style = (!row.isTotal && intensity > 0)
3322
          var style = (!row.isTotal && intensity > 0)
3310
                  ? ' style="background: rgba(59,91,219,' + bgAlpha + ')"' : '';
3323
                  ? ' style="background: rgba(59,130,246,' + bgAlpha + ')"' : '';
3311
          if (isZero) {
3324
          if (isZero) {
3312
            html.push('<td class="pm-cell pm-cell-zero">&mdash;</td>');
3325
            html.push('<td class="pm-cell pm-cell-zero">&mdash;</td>');
3313
          } else {
3326
          } else {
-
 
3327
            // Values formatted in Lakh (X.XL) — matches how the drill-down and other DRR sections display money.
3314
            var billedTxt = numberToIndianCurrency(Math.round(c.billed));
3328
            var billedTxt = pmLakh(c.billed);
3315
            var poTxt = c.po > 0 ? numberToIndianCurrency(Math.round(c.po)) : '';
3329
            var poTxt = pmLakh(c.po);
3316
            var partnerTxt = c.count > 0 ? (c.count + 'p') : '';
3330
            var partnerLine = c.count > 0
-
 
3331
                    ? ('<div class="pm-partners">' + c.count + '<span class="pm-tag"> partner' + (c.count === 1 ? '' : 's') + '</span></div>')
3317
            var metaBits = [];
3332
                    : '';
-
 
3333
            var poLine = (c.po > 0 || c.billed > 0)
3318
            if (partnerTxt) metaBits.push('<span class="pm-partners">' + partnerTxt + '</span>');
3334
                    ? ('<div class="pm-po">' + poTxt + '<span class="pm-tag"> PO</span></div>')
-
 
3335
                    : '';
3319
            if (poTxt) metaBits.push('<span class="pm-po">' + poTxt + '</span>');
3336
            var billedLine = '<div class="pm-billed">' + billedTxt + '</div>';
-
 
3337
            // Order: partner (top) → PO (middle) → billed (bottom, primary)
3320
            html.push('<td class="pm-cell' + (row.isTotal ? ' pm-cell-total' : '') + '"' + style + '>' +
3338
            html.push('<td class="pm-cell' + (row.isTotal ? ' pm-cell-total' : '') + '"' + style + '>' +
3321
                    '<div class="pm-billed">' + billedTxt + '</div>' +
3339
                    partnerLine + poLine + billedLine +
3322
                    (metaBits.length ? '<div class="pm-meta">' + metaBits.join('<span class="pm-meta-sep">·</span>') + '</div>' : '') +
-
 
3323
                    '</td>');
3340
                    '</td>');
3324
          }
3341
          }
3325
        });
3342
        });
3326
        html.push('</tr>');
3343
        html.push('</tr>');
3327
      });
3344
      });