| ${i.empresa} |
${i.cliente ? (i.cliente.length > 25 ? i.cliente.substring(0,25)+'...' : i.cliente) : '—'} |
${i.numero_pedido} |
${i.data_faturamento || '—'} |
${i.item_codigo} |
${i.item_descricao ? (i.item_descricao.length > 40 ? i.item_descricao.substring(0,40)+'...' : i.item_descricao) : '—'} |
${i.categoria_nome || '—'} |
${i.departamento_nome ? (i.departamento_nome.length > 25 ? i.departamento_nome.substring(0,25)+'...' : i.departamento_nome) : '—'} |
${formatNumber(i.quantidade)} |
${formatCurrency(i.valor_unitario)} |
${formatCurrency(i.valor_total)} |
`).join('');
// Pagination
const totalPages = Math.ceil(filtrados.length / PER_PAGE);
const pag = document.getElementById('pagination');
if (totalPages <= 1) {
pag.innerHTML = '';
return;
}
let pagHtml = '';
pagHtml += `