fix(dashboard): show billing vs shipping marker for PJ and PF ramburs
PJ: tooltip shows company on Facturat (display) vs shipping person. PF ramburs: tooltip shows billing person vs shipping person when they differ. Adds aria-label + title on indicator for keyboard/screen reader. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -464,9 +464,14 @@ function renderClientCell(order) {
|
||||
const display = (order.customer_name || order.shipping_name || '').trim();
|
||||
const billing = (order.billing_name || '').trim();
|
||||
const shipping = (order.shipping_name || '').trim();
|
||||
const isDiff = display !== shipping && shipping;
|
||||
if (isDiff) {
|
||||
return `<td class="tooltip-cont fw-bold" data-tooltip="Livrare: ${escHtml(shipping)}">${escHtml(display)} <sup class="client-diff-indicator">▲</sup></td>`;
|
||||
// PJ: invoice party (company = display) differs from shipping person
|
||||
// PF ramburs: invoice party = shipping, but billing person differs from shipping
|
||||
const isPJDiff = display && shipping && display !== shipping;
|
||||
const isPFDiff = !isPJDiff && billing && shipping && billing !== shipping;
|
||||
if (isPJDiff || isPFDiff) {
|
||||
const facturat = isPJDiff ? display : billing;
|
||||
const tip = `Facturat: ${escHtml(facturat)} · Livrare: ${escHtml(shipping)}`;
|
||||
return `<td class="tooltip-cont fw-bold" data-tooltip="${tip}">${escHtml(display)} <sup class="client-diff-indicator" aria-label="${tip}" title="${tip}">▲</sup></td>`;
|
||||
}
|
||||
return `<td class="fw-bold">${escHtml(display || billing || '\u2014')}</td>`;
|
||||
}
|
||||
|
||||
@@ -115,5 +115,5 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{{ request.scope.get('root_path', '') }}/static/js/dashboard.js?v=49"></script>
|
||||
<script src="{{ request.scope.get('root_path', '') }}/static/js/dashboard.js?v=51"></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user