Add Tiny ERP order metadata ingestion
This commit is contained in:
@@ -507,7 +507,13 @@ const getClientDetailsAnalytics = async (clientToken, range = {}) => {
|
||||
produto_descricao,
|
||||
quantidade,
|
||||
valor_unitario,
|
||||
pedido_id
|
||||
pedido_id,
|
||||
cliente_nome_fantasia,
|
||||
id_vendedor,
|
||||
nome_vendedor,
|
||||
marketplace,
|
||||
canal_venda,
|
||||
numero_ecommerce
|
||||
FROM orders
|
||||
WHERE ${periodFilters.join(' AND ')}
|
||||
ORDER BY data_pedido_date DESC, COALESCE(NULLIF(pedido_id, ''), data_pedido || '_' || valor_pedido::text) DESC;
|
||||
@@ -559,7 +565,13 @@ const getClientDetailsAnalytics = async (clientToken, range = {}) => {
|
||||
Quantidade: toNumber(row.quantidade),
|
||||
Valor_Unitario: toNumber(row.valor_unitario),
|
||||
ID_Pedido: row.pedido_id || '',
|
||||
Fone_Cliente: row.cliente_fone || ''
|
||||
Fone_Cliente: row.cliente_fone || '',
|
||||
cliente_nome_fantasia: row.cliente_nome_fantasia || '',
|
||||
id_vendedor: row.id_vendedor || '',
|
||||
nome_vendedor: row.nome_vendedor || '',
|
||||
marketplace: row.marketplace || '',
|
||||
canal_venda: row.canal_venda || '',
|
||||
numero_ecommerce: row.numero_ecommerce || ''
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user