fix(pecas): corrigir discrepancia no calculo de peso total da tabela e da importacao
This commit is contained in:
@@ -123,12 +123,7 @@ export function ImportarPecasModal({ open, onOpenChange, onImport, pecasExistent
|
||||
});
|
||||
convertedData[field] = 0;
|
||||
} else {
|
||||
// Para peso_unitario e peso_total, arredondar para integer
|
||||
if (field === 'peso_unitario' || field === 'peso_total') {
|
||||
convertedData[field] = Math.round(numValue);
|
||||
} else {
|
||||
convertedData[field] = numValue;
|
||||
}
|
||||
convertedData[field] = numValue;
|
||||
}
|
||||
} else {
|
||||
convertedData[field] = field.includes('componente') ? 0 : (field === 'quantidade' ? 1 : 0);
|
||||
|
||||
@@ -77,7 +77,7 @@ export function TableRow({
|
||||
</TableCell>
|
||||
|
||||
<TableCell className="w-16 px-2 text-right font-medium text-foreground text-xs">
|
||||
{(peca.quantidade * peca.peso_unitario).toFixed(2)} kg
|
||||
{(peca.peso_total || (peca.quantidade * peca.peso_unitario)).toFixed(2)} kg
|
||||
</TableCell>
|
||||
|
||||
<TableCell className="w-16 px-2 text-muted-foreground text-xs">
|
||||
|
||||
Reference in New Issue
Block a user