Rename vendor price to project price, expand pricing CSV export
- Rename "Цена вендора" to "Цена проектная" in pricing tab table header and comments - Expand pricing CSV export to include: Lot, P/N вендора, Описание, Кол-во, Цена проектная Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -211,7 +211,7 @@
|
||||
<th class="px-3 py-2 text-left border-b">Описание</th>
|
||||
<th class="px-3 py-2 text-right border-b">Кол-во</th>
|
||||
<th class="px-3 py-2 text-right border-b">Estimate</th>
|
||||
<th class="px-3 py-2 text-right border-b">Цена вендора</th>
|
||||
<th class="px-3 py-2 text-right border-b">Цена проектная</th>
|
||||
<th class="px-3 py-2 text-right border-b">Склад</th>
|
||||
<th class="px-3 py-2 text-right border-b">Конк.</th>
|
||||
</tr>
|
||||
@@ -3789,7 +3789,7 @@ function applyPricingCustomPrice(customPrice) {
|
||||
const totalVendorEl = document.getElementById('pricing-total-vendor');
|
||||
|
||||
if (customPrice > 0 && estimateTotal > 0) {
|
||||
// Proportionally redistribute custom price → Цена вендора cells
|
||||
// Proportionally redistribute custom price → Цена проектная cells
|
||||
let assigned = 0;
|
||||
rows.forEach((tr, i) => {
|
||||
const est = parseFloat(tr.dataset.est) || 0;
|
||||
@@ -3850,18 +3850,22 @@ function exportPricingCSV() {
|
||||
return /[,"\n]/.test(s) ? `"${s}"` : s;
|
||||
};
|
||||
|
||||
const headers = ['Цена вендора'];
|
||||
const headers = ['Lot', 'P/N вендора', 'Описание', 'Кол-во', 'Цена проектная'];
|
||||
const lines = [headers.map(csvEscape).join(',')];
|
||||
|
||||
rows.forEach(tr => {
|
||||
const cells = tr.querySelectorAll('td');
|
||||
const lot = cells[0] ? cells[0].textContent.trim() : '';
|
||||
const vendorPN = cells[1] ? cells[1].textContent.trim() : '';
|
||||
const description = cells[2] ? cells[2].textContent.trim() : '';
|
||||
const qty = cells[3] ? cells[3].textContent.trim() : '';
|
||||
const vendorPrice = cells[5] ? cells[5].textContent.trim() : '';
|
||||
lines.push([vendorPrice].map(csvEscape).join(','));
|
||||
lines.push([lot, vendorPN, description, qty, vendorPrice].map(csvEscape).join(','));
|
||||
});
|
||||
|
||||
// Totals row
|
||||
const vendorTotal = document.getElementById('pricing-total-vendor').textContent.trim();
|
||||
lines.push(['Итого: ' + vendorTotal].map(csvEscape).join(','));
|
||||
lines.push(['', '', '', 'Итого:', vendorTotal].map(csvEscape).join(','));
|
||||
|
||||
const blob = new Blob(['\uFEFF' + lines.join('\r\n')], {type: 'text/csv;charset=utf-8;'});
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
||||
Reference in New Issue
Block a user