fix: экспорт конфига через GetByUUIDNoAuth, формат чисел с запятой как разделителем
- ExportConfigCSV и ExportConfigPricingCSV: GetByUUID → GetByUUIDNoAuth,
чтобы не падать с ErrConfigForbidden на конфигах с чужим OriginalUsername
- ConfigurationGetter: добавлен GetByUUIDNoAuth в интерфейс
- Шаблоны: toLocaleString('en-US') → 'ru-RU' во всех местах отображения цен;
процентные значения: .toFixed(1) → .toFixed(1).replace('.', ',')
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2584,7 +2584,7 @@ function formatDiffPercent(baseTotal, compareTotal, compareLabel) {
|
||||
}
|
||||
const pct = ((baseTotal - compareTotal) / compareTotal) * 100;
|
||||
const sign = pct > 0 ? '+' : '';
|
||||
return `${sign}${pct.toFixed(1)}% от ${compareLabel}`;
|
||||
return `${sign}${pct.toFixed(1).replace('.', ',')}% от ${compareLabel}`;
|
||||
}
|
||||
|
||||
function getTotalClass(current, references) {
|
||||
@@ -2709,7 +2709,7 @@ function calculateCustomPrice() {
|
||||
|
||||
// Show discount info
|
||||
discountInfoEl.classList.remove('hidden');
|
||||
discountPercentEl.textContent = discountPercent.toFixed(1) + '%';
|
||||
discountPercentEl.textContent = discountPercent.toFixed(1).replace('.', ',') + '%';
|
||||
|
||||
// Update discount color based on value
|
||||
const discountEl = discountPercentEl;
|
||||
@@ -4272,7 +4272,7 @@ function applyCustomPrice(table) {
|
||||
if (est <= 0) return '';
|
||||
const pct = ((est - custom) / est * 100);
|
||||
const sign = pct >= 0 ? '-' : '+';
|
||||
return ` (${sign}${Math.abs(pct).toFixed(1)}%)`;
|
||||
return ` (${sign}${Math.abs(pct).toFixed(1).replace('.', ',')}%)`;
|
||||
};
|
||||
const _pctClass = (custom, est) => custom <= est ? 'text-green-600' : 'text-red-600';
|
||||
|
||||
@@ -4365,7 +4365,7 @@ function setPricingCustomPriceFromVendor() {
|
||||
const totalEl = document.getElementById('pricing-total-buy-vendor');
|
||||
if (hasAny) {
|
||||
document.getElementById('pricing-custom-price-buy').value = total.toFixed(2);
|
||||
const pct = estimateTotal > 0 ? ` (-${((estimateTotal - total) / estimateTotal * 100).toFixed(1)}%)` : '';
|
||||
const pct = estimateTotal > 0 ? ` (-${((estimateTotal - total) / estimateTotal * 100).toFixed(1).replace('.', ',')}%)` : '';
|
||||
totalEl.textContent = formatCurrency(total) + pct;
|
||||
totalEl.className = totalEl.className.replace(/\btext-(?:green|red)-\d+\b/g, '').trim();
|
||||
totalEl.classList.add(total <= estimateTotal ? 'text-green-600' : 'text-red-600');
|
||||
|
||||
Reference in New Issue
Block a user