#7936 improve InvoiceIn #1004
|
@ -1,10 +1,10 @@
|
||||||
import { toCurrency } from 'src/filters';
|
import { toCurrency } from 'src/filters';
|
||||||
|
|
||||||
export function getTotal(rows, key, opts = {}) {
|
export function getTotal(rows, key, opts = {}) {
|
||||||
const { currency, cb } = opts;
|
const { currency, cb, decimalPlaces } = opts;
|
||||||
const total = rows.reduce((acc, row) => acc + +(cb ? cb(row) : row[key] || 0), 0);
|
const total = rows.reduce((acc, row) => acc + +(cb ? cb(row) : row[key] || 0), 0);
|
||||||
|
|
||||||
return currency
|
return currency
|
||||||
? toCurrency(total, currency == 'default' ? undefined : currency)
|
? toCurrency(total, currency == 'default' ? undefined : currency)
|
||||||
: total;
|
: parseFloat(total).toFixed(decimalPlaces ?? 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,7 +261,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
country: Country
|
country: Country
|
||||||
es:
|
es:
|
||||||
Code: Código
|
Code: Código
|
||||||
amount: Cantidad
|
amount: Valor mercancía
|
||||||
net: Neto
|
net: Neto
|
||||||
stems: Tallos
|
stems: Tallos
|
||||||
country: País
|
country: País
|
||||||
|
|
|
@ -188,11 +188,6 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
<template #body-cell-taxablebase="{ row }">
|
<template #body-cell-taxablebase="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<VnInputNumber
|
<VnInputNumber
|
||||||
:class="{
|
|
||||||
'no-pointer-events': isNotEuro(currency),
|
|
||||||
}"
|
|
||||||
:disable="isNotEuro(currency)"
|
|
||||||
label=""
|
|
||||||
clear-icon="close"
|
clear-icon="close"
|
||||||
v-model="row.taxableBase"
|
v-model="row.taxableBase"
|
||||||
clearable
|
clearable
|
||||||
|
|
Loading…
Reference in New Issue