fix: refs #6900 fine tunning #661
|
@ -0,0 +1,10 @@
|
||||||
|
import { toCurrency } from 'src/filters';
|
||||||
|
|||||||
|
|
||||||
|
export function getTotal(rows, key, opts = {}) {
|
||||||
|
const { currency, cb } = opts;
|
||||||
|
const total = rows.reduce((acc, row) => acc + +(cb ? cb(row) : row[key] || 0), 0);
|
||||||
jsegarra marked this conversation as resolved
jsegarra
commented
Porque no sacas el valor cb fuera? y asi simplificas el reduce Porque no sacas el valor cb fuera? y asi simplificas el reduce
Por ciertpo, que significa cb? callback, no vedad?
jorgep
commented
No acabo de entender lo de sacarlo fuera, la idea es que si en lugar de solo sumar, quiero llamar a una fn tipo saca el 20% o 30% lo puedas hacer pasandole un callback(cb) No acabo de entender lo de sacarlo fuera, la idea es que si en lugar de solo sumar, quiero llamar a una fn tipo saca el 20% o 30% lo puedas hacer pasandole un callback(cb)
jsegarra
commented
Lo dejamos asi Lo dejamos asi
|
|||||||
|
|
||||||
|
return currency
|
||||||
|
? toCurrency(total, currency == 'default' ? undefined : currency)
|
||||||
|
: total;
|
||||||
|
}
|
|
@ -252,6 +252,7 @@ globals:
|
||||||
ldap: LDAP
|
ldap: LDAP
|
||||||
samba: Samba
|
samba: Samba
|
||||||
serial: Serial
|
serial: Serial
|
||||||
|
supplier: Supplier
|
||||||
created: Created
|
created: Created
|
||||||
worker: Worker
|
worker: Worker
|
||||||
now: Now
|
now: Now
|
||||||
|
@ -738,56 +739,6 @@ parking:
|
||||||
searchBar:
|
searchBar:
|
||||||
info: You can search by parking code
|
info: You can search by parking code
|
||||||
label: Search parking...
|
label: Search parking...
|
||||||
invoiceIn:
|
|
||||||
list:
|
|
||||||
ref: Reference
|
|
||||||
supplier: Supplier
|
|
||||||
supplierRef: Supplier ref.
|
|
||||||
serialNumber: Serial number
|
|
||||||
serial: Serial
|
|
||||||
file: File
|
|
||||||
issued: Issued
|
|
||||||
isBooked: Is booked
|
|
||||||
awb: AWB
|
|
||||||
amount: Amount
|
|
||||||
card:
|
|
||||||
issued: Issued
|
|
||||||
amount: Amount
|
|
||||||
client: Client
|
|
||||||
company: Company
|
|
||||||
customerCard: Customer card
|
|
||||||
ticketList: Ticket List
|
|
||||||
vat: Vat
|
|
||||||
dueDay: Due day
|
|
||||||
intrastat: Intrastat
|
|
||||||
summary:
|
|
||||||
supplier: Supplier
|
|
||||||
supplierRef: Supplier ref.
|
|
||||||
currency: Currency
|
|
||||||
docNumber: Doc number
|
|
||||||
issued: Expedition date
|
|
||||||
operated: Operation date
|
|
||||||
bookEntried: Entry date
|
|
||||||
bookedDate: Booked date
|
|
||||||
sage: Sage withholding
|
|
||||||
vat: Undeductible VAT
|
|
||||||
company: Company
|
|
||||||
booked: Booked
|
|
||||||
expense: Expense
|
|
||||||
taxableBase: Taxable base
|
|
||||||
rate: Rate
|
|
||||||
sageVat: Sage vat
|
|
||||||
sageTransaction: Sage transaction
|
|
||||||
dueDay: Date
|
|
||||||
bank: Bank
|
|
||||||
amount: Amount
|
|
||||||
foreignValue: Foreign value
|
|
||||||
dueTotal: Due day
|
|
||||||
noMatch: Do not match
|
|
||||||
code: Code
|
|
||||||
net: Net
|
|
||||||
stems: Stems
|
|
||||||
country: Country
|
|
||||||
order:
|
order:
|
||||||
field:
|
field:
|
||||||
salesPersonFk: Sales Person
|
salesPersonFk: Sales Person
|
||||||
|
|
|
@ -254,6 +254,7 @@ globals:
|
||||||
ldap: LDAP
|
ldap: LDAP
|
||||||
samba: Samba
|
samba: Samba
|
||||||
serial: Facturas por serie
|
serial: Facturas por serie
|
||||||
|
supplier: Proveedor
|
||||||
created: Fecha creación
|
created: Fecha creación
|
||||||
worker: Trabajador
|
worker: Trabajador
|
||||||
now: Ahora
|
now: Ahora
|
||||||
|
@ -782,54 +783,6 @@ parking:
|
||||||
searchBar:
|
searchBar:
|
||||||
info: Puedes buscar por código de parking
|
info: Puedes buscar por código de parking
|
||||||
label: Buscar parking...
|
label: Buscar parking...
|
||||||
invoiceIn:
|
|
||||||
list:
|
|
||||||
ref: Referencia
|
|
||||||
supplier: Proveedor
|
|
||||||
supplierRef: Ref. proveedor
|
|
||||||
serialNumber: Num. serie
|
|
||||||
shortIssued: F. emisión
|
|
||||||
serial: Serie
|
|
||||||
file: Fichero
|
|
||||||
issued: Fecha emisión
|
|
||||||
isBooked: Conciliada
|
|
||||||
awb: AWB
|
|
||||||
amount: Importe
|
|
||||||
card:
|
|
||||||
issued: Fecha emisión
|
|
||||||
amount: Importe
|
|
||||||
client: Cliente
|
|
||||||
company: Empresa
|
|
||||||
customerCard: Ficha del cliente
|
|
||||||
ticketList: Listado de tickets
|
|
||||||
vat: Iva
|
|
||||||
dueDay: Fecha de vencimiento
|
|
||||||
summary:
|
|
||||||
supplier: Proveedor
|
|
||||||
supplierRef: Ref. proveedor
|
|
||||||
currency: Divisa
|
|
||||||
docNumber: Número documento
|
|
||||||
issued: Fecha de expedición
|
|
||||||
operated: Fecha operación
|
|
||||||
bookEntried: Fecha asiento
|
|
||||||
bookedDate: Fecha contable
|
|
||||||
sage: Retención sage
|
|
||||||
vat: Iva no deducible
|
|
||||||
company: Empresa
|
|
||||||
booked: Contabilizada
|
|
||||||
expense: Gasto
|
|
||||||
taxableBase: Base imp.
|
|
||||||
rate: Tasa
|
|
||||||
sageTransaction: Sage transación
|
|
||||||
dueDay: Fecha
|
|
||||||
bank: Caja
|
|
||||||
amount: Importe
|
|
||||||
foreignValue: Divisa
|
|
||||||
dueTotal: Vencimiento
|
|
||||||
code: Código
|
|
||||||
net: Neto
|
|
||||||
stems: Tallos
|
|
||||||
country: País
|
|
||||||
department:
|
department:
|
||||||
pageTitles:
|
pageTitles:
|
||||||
basicData: Basic data
|
basicData: Basic data
|
||||||
|
|
|
@ -223,6 +223,10 @@ async function onSubmit() {
|
||||||
autofocus
|
autofocus
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
jorgep
commented
Ahora están todas las fechas juntas. Ahora están todas las fechas juntas.
|
|||||||
|
<VnInputDate :label="t('Entry date')" v-model="data.bookEntried" />
|
||||||
|
<VnInputDate :label="t('Accounted date')" v-model="data.booked" />
|
||||||
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Undeductible VAT')"
|
:label="t('Undeductible VAT')"
|
||||||
|
@ -285,10 +289,6 @@ async function onSubmit() {
|
||||||
</template>
|
</template>
|
||||||
</VnInput>
|
</VnInput>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
|
||||||
<VnInputDate :label="t('Entry date')" v-model="data.bookEntried" />
|
|
||||||
<VnInputDate :label="t('Accounted date')" v-model="data.booked" />
|
|
||||||
</VnRow>
|
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Currency')"
|
:label="t('Currency')"
|
||||||
|
|
|
@ -356,10 +356,7 @@ const createInvoiceInCorrection = async () => {
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('invoiceIn.card.issued')" :value="toDate(entity.issued)" />
|
<VnLv :label="t('invoiceIn.card.issued')" :value="toDate(entity.issued)" />
|
||||||
<VnLv :label="t('invoiceIn.summary.booked')" :value="toDate(entity.booked)" />
|
<VnLv :label="t('invoiceIn.summary.booked')" :value="toDate(entity.booked)" />
|
||||||
<VnLv
|
<VnLv :label="t('invoiceIn.card.amount')" :value="toCurrency(totalAmount)" />
|
||||||
jorgep
commented
Este valor siempre en euros. Este valor siempre en euros.
|
|||||||
:label="t('invoiceIn.card.amount')"
|
|
||||||
:value="toCurrency(totalAmount, entity.currency?.code)"
|
|
||||||
/>
|
|
||||||
<VnLv :label="t('invoiceIn.summary.supplier')">
|
<VnLv :label="t('invoiceIn.summary.supplier')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span class="link">
|
<span class="link">
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import { getTotal } from 'src/composables/getTotal';
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
@ -71,7 +72,7 @@ async function insert() {
|
||||||
await invoiceInFormRef.value.reload();
|
await invoiceInFormRef.value.reload();
|
||||||
notify(t('globals.dataSaved'), 'positive');
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
}
|
}
|
||||||
const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount, 0);
|
// const getTotal = (rows, key) => rows.reduce((acc, row) => acc + +row[key], 0);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -154,11 +155,17 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd>
|
<QTd>
|
||||||
{{
|
{{ getTotal(rows, 'amount', { currency: 'default' }) }}
|
||||||
toCurrency(getTotalAmount(rows), invoiceIn.currency.code)
|
</QTd>
|
||||||
}}
|
<QTd>
|
||||||
|
<template v-if="isNotEuro(invoiceIn.currency.code)">
|
||||||
|
{{
|
||||||
|
getTotal(rows, 'foreignValue', {
|
||||||
|
currency: invoiceIn.currency.code,
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
</QTd>
|
</QTd>
|
||||||
<QTd />
|
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
<template #item="props">
|
<template #item="props">
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { computed, ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { toCurrency } from 'src/filters';
|
import { toCurrency } from 'src/filters';
|
||||||
|
import { getTotal } from 'src/composables/getTotal';
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
@ -72,9 +73,6 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const getTotal = (data, key) =>
|
|
||||||
data.reduce((acc, cur) => acc + +String(cur[key] || 0).replace(',', '.'), 0);
|
|
||||||
|
|
||||||
const formatOpt = (row, { model, options }, prop) => {
|
const formatOpt = (row, { model, options }, prop) => {
|
||||||
const obj = row[model];
|
const obj = row[model];
|
||||||
const option = options.find(({ id }) => id == obj);
|
const option = options.find(({ id }) => id == obj);
|
||||||
|
@ -154,7 +152,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd>
|
<QTd>
|
||||||
{{ toCurrency(getTotal(rows, 'amount'), currency) }}
|
{{ getTotal(rows, 'amount', { currency: 'default' }) }}
|
||||||
</QTd>
|
</QTd>
|
||||||
<QTd>
|
<QTd>
|
||||||
{{ getTotal(rows, 'net') }}
|
{{ getTotal(rows, 'net') }}
|
||||||
|
|
|
@ -35,7 +35,7 @@ const vatColumns = ref([
|
||||||
name: 'landed',
|
name: 'landed',
|
||||||
label: 'invoiceIn.summary.taxableBase',
|
label: 'invoiceIn.summary.taxableBase',
|
||||||
field: (row) => row.taxableBase,
|
field: (row) => row.taxableBase,
|
||||||
format: (value) => toCurrency(value, currency.value),
|
format: (value) => toCurrency(value),
|
||||||
jorgep
commented
valor en euros. valor en euros.
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
@ -64,7 +64,7 @@ const vatColumns = ref([
|
||||||
name: 'rate',
|
name: 'rate',
|
||||||
label: 'invoiceIn.summary.rate',
|
label: 'invoiceIn.summary.rate',
|
||||||
field: (row) => taxRate(row.taxableBase, row.taxTypeSage?.rate),
|
field: (row) => taxRate(row.taxableBase, row.taxTypeSage?.rate),
|
||||||
format: (value) => toCurrency(value, currency.value),
|
format: (value) => toCurrency(value),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
@ -72,7 +72,7 @@ const vatColumns = ref([
|
||||||
name: 'currency',
|
name: 'currency',
|
||||||
label: 'invoiceIn.summary.currency',
|
label: 'invoiceIn.summary.currency',
|
||||||
field: (row) => row.foreignValue,
|
field: (row) => row.foreignValue,
|
||||||
format: (value) => value,
|
format: (val) => val && toCurrency(val, currency.value),
|
||||||
jorgep
commented
valor en otra divisa. valor en otra divisa.
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
@ -97,7 +97,7 @@ const dueDayColumns = ref([
|
||||||
name: 'amount',
|
name: 'amount',
|
||||||
label: 'invoiceIn.summary.amount',
|
label: 'invoiceIn.summary.amount',
|
||||||
field: (row) => row.amount,
|
field: (row) => row.amount,
|
||||||
format: (value) => toCurrency(value, currency.value),
|
format: (value) => toCurrency(value),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
@ -105,7 +105,7 @@ const dueDayColumns = ref([
|
||||||
name: 'landed',
|
name: 'landed',
|
||||||
label: 'invoiceIn.summary.foreignValue',
|
label: 'invoiceIn.summary.foreignValue',
|
||||||
field: (row) => row.foreignValue,
|
field: (row) => row.foreignValue,
|
||||||
format: (value) => value,
|
format: (val) => val && toCurrency(val, currency.value),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
@ -124,7 +124,7 @@ const intrastatColumns = ref([
|
||||||
{
|
{
|
||||||
name: 'amount',
|
name: 'amount',
|
||||||
label: 'invoiceIn.summary.amount',
|
label: 'invoiceIn.summary.amount',
|
||||||
field: (row) => toCurrency(row.amount, currency.value),
|
field: (row) => toCurrency(row.amount),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
@ -179,7 +179,6 @@ const getTotalTax = (tax) =>
|
||||||
|
|
||||||
const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<CardSummary
|
<CardSummary
|
||||||
data-key="InvoiceInSummary"
|
data-key="InvoiceInSummary"
|
||||||
|
@ -229,10 +228,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
:label="t('invoiceIn.summary.currency')"
|
:label="t('invoiceIn.summary.currency')"
|
||||||
:value="entity.currency?.code"
|
:value="entity.currency?.code"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv :label="t('invoiceIn.serial')" :value="`${entity.serial}`" />
|
||||||
:label="t('invoiceIn.summary.docNumber')"
|
|
||||||
:value="`${entity.serial}/${entity.serialNumber}`"
|
|
||||||
/>
|
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
|
@ -293,12 +289,9 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
<QCardSection class="q-pa-none">
|
<QCardSection class="q-pa-none">
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('invoiceIn.summary.taxableBase')"
|
:label="t('invoiceIn.summary.taxableBase')"
|
||||||
:value="toCurrency(entity.totals.totalTaxableBase, currency)"
|
:value="toCurrency(entity.totals.totalTaxableBase)"
|
||||||
jorgep
commented
solo euros. solo euros.
|
|||||||
/>
|
|
||||||
<VnLv
|
|
||||||
label="Total"
|
|
||||||
:value="toCurrency(entity.totals.totalVat, currency)"
|
|
||||||
/>
|
/>
|
||||||
|
<VnLv label="Total" :value="toCurrency(entity.totals.totalVat)" />
|
||||||
<VnLv :label="t('invoiceIn.summary.dueTotal')">
|
<VnLv :label="t('invoiceIn.summary.dueTotal')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<QChip
|
<QChip
|
||||||
|
@ -311,7 +304,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
: t('invoiceIn.summary.dueTotal')
|
: t('invoiceIn.summary.dueTotal')
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
{{ toCurrency(entity.totals.totalDueDay, currency) }}
|
{{ toCurrency(entity.totals.totalDueDay) }}
|
||||||
</QChip>
|
</QChip>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
|
@ -350,15 +343,17 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
<template #bottom-row>
|
<template #bottom-row>
|
||||||
<QTr class="bg">
|
<QTr class="bg">
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
|
<QTd>{{ toCurrency(entity.totals.totalTaxableBase) }}</QTd>
|
||||||
|
<QTd></QTd>
|
||||||
|
<QTd></QTd>
|
||||||
|
<QTd>{{ toCurrency(getTotalTax(entity.invoiceInTax)) }}</QTd>
|
||||||
<QTd>{{
|
<QTd>{{
|
||||||
toCurrency(entity.totals.totalTaxableBase, currency)
|
entity.totals.totalTaxableBaseForeignValue &&
|
||||||
|
toCurrency(
|
||||||
|
entity.totals.totalTaxableBaseForeignValue,
|
||||||
|
currency
|
||||||
|
)
|
||||||
}}</QTd>
|
}}</QTd>
|
||||||
<QTd></QTd>
|
|
||||||
<QTd></QTd>
|
|
||||||
<QTd>{{
|
|
||||||
toCurrency(getTotalTax(entity.invoiceInTax, currency))
|
|
||||||
}}</QTd>
|
|
||||||
<QTd></QTd>
|
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
@ -384,9 +379,17 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
<QTd>
|
<QTd>
|
||||||
{{ toCurrency(entity.totals.totalDueDay, currency) }}
|
{{ toCurrency(entity.totals.totalDueDay) }}
|
||||||
|
</QTd>
|
||||||
|
<QTd>
|
||||||
|
{{
|
||||||
|
entity.totals.totalDueDayForeignValue &&
|
||||||
|
toCurrency(
|
||||||
|
entity.totals.totalDueDayForeignValue,
|
||||||
|
currency
|
||||||
|
)
|
||||||
|
}}
|
||||||
</QTd>
|
</QTd>
|
||||||
<QTd></QTd>
|
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
|
@ -421,7 +424,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
||||||
<template #bottom-row>
|
<template #bottom-row>
|
||||||
<QTr class="bg">
|
<QTr class="bg">
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
<QTd>{{ toCurrency(intrastatTotals.amount, currency) }}</QTd>
|
<QTd>{{ toCurrency(intrastatTotals.amount) }}</QTd>
|
||||||
<QTd>{{ intrastatTotals.net }}</QTd>
|
<QTd>{{ intrastatTotals.net }}</QTd>
|
||||||
<QTd>{{ intrastatTotals.stems }}</QTd>
|
<QTd>{{ intrastatTotals.stems }}</QTd>
|
||||||
<QTd></QTd>
|
<QTd></QTd>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import { getTotal } from 'src/composables/getTotal';
|
||||||
import { toCurrency } from 'src/filters';
|
import { toCurrency } from 'src/filters';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
@ -56,7 +57,7 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'taxablebase',
|
name: 'taxablebase',
|
||||||
label: t('Taxable base'),
|
label: t('Taxable base'),
|
||||||
field: (row) => toCurrency(row.taxableBase, currency.value),
|
field: (row) => row.taxableBase,
|
||||||
model: 'taxableBase',
|
model: 'taxableBase',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
tabIndex: 2,
|
tabIndex: 2,
|
||||||
|
@ -91,7 +92,7 @@ const columns = computed(() => [
|
||||||
label: t('Rate'),
|
label: t('Rate'),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
tabIndex: 5,
|
tabIndex: 5,
|
||||||
field: (row) => toCurrency(taxRate(row, row.taxTypeSageFk), currency.value),
|
field: (row) => taxRate(row, row.taxTypeSageFk),
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -162,9 +163,11 @@ async function addExpense() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const getTotalTaxableBase = (rows) =>
|
|
||||||
rows.reduce((acc, { taxableBase }) => acc + +(taxableBase || 0), 0);
|
const formatTotal = (rows, key, cb) => {
|
||||||
const getTotalRate = (rows) => rows.reduce((acc, cur) => acc + +taxRate(cur), 0);
|
const total = rows.reduce((acc, row) => acc + +(cb ? cb(row) : row[key] || 0), 0);
|
||||||
|
return toCurrency(total, key == 'foreignValue' ? currency.value : undefined);
|
||||||
|
};
|
||||||
|
|
||||||
const formatOpt = (row, { model, options }, prop) => {
|
const formatOpt = (row, { model, options }, prop) => {
|
||||||
const obj = row[model];
|
const obj = row[model];
|
||||||
|
@ -324,12 +327,24 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd>
|
<QTd>
|
||||||
{{ toCurrency(getTotalTaxableBase(rows), currency) }}
|
{{ getTotal(rows, 'taxableBase', { currency: 'default' }) }}
|
||||||
</QTd>
|
</QTd>
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd />
|
<QTd />
|
||||||
<QTd> {{ toCurrency(getTotalRate(rows), currency) }}</QTd>
|
<QTd>
|
||||||
<QTd />
|
{{
|
||||||
|
getTotal(rows, null, { cb: taxRate, currency: 'default' })
|
||||||
|
}}</QTd
|
||||||
|
>
|
||||||
|
<QTd>
|
||||||
|
<template v-if="isNotEuro(invoiceIn.currency.code)">
|
||||||
|
{{
|
||||||
|
getTotal(rows, 'foreignValue', {
|
||||||
|
currency: invoiceIn.currency.code,
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</QTd>
|
||||||
</QTr>
|
</QTr>
|
||||||
</template>
|
</template>
|
||||||
<template #item="props">
|
<template #item="props">
|
||||||
|
|
|
@ -28,6 +28,16 @@ const activities = ref([]);
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ params, searchFn }">
|
<template #body="{ params, searchFn }">
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInputDate :label="t('From')" v-model="params.from" is-outlined />
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInputDate :label="t('To')" v-model="params.to" is-outlined />
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
@ -64,16 +74,6 @@ const activities = ref([]);
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInput
|
|
||||||
:label="t('params.serialNumber')"
|
|
||||||
v-model="params.serialNumber"
|
|
||||||
is-outlined
|
|
||||||
lazy-rules
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@ -84,15 +84,6 @@ const activities = ref([]);
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInputDate
|
|
||||||
:label="t('Issued')"
|
|
||||||
v-model="params.issued"
|
|
||||||
is-outlined
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@ -140,22 +131,6 @@ const activities = ref([]);
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QExpansionItem :label="t('More options')" expand-separator>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInputDate
|
|
||||||
:label="t('From')"
|
|
||||||
v-model="params.from"
|
|
||||||
is-outlined
|
|
||||||
/>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem>
|
|
||||||
<QItemSection>
|
|
||||||
<VnInputDate :label="t('To')" v-model="params.to" is-outlined />
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</QExpansionItem>
|
|
||||||
</template>
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</template>
|
</template>
|
||||||
|
@ -179,6 +154,7 @@ en:
|
||||||
correctedFk: Rectified
|
correctedFk: Rectified
|
||||||
issued: Issued
|
issued: Issued
|
||||||
to: To
|
to: To
|
||||||
|
from: From
|
||||||
awbCode: AWB
|
awbCode: AWB
|
||||||
correctingFk: Rectificative
|
correctingFk: Rectificative
|
||||||
supplierActivityFk: Supplier activity
|
supplierActivityFk: Supplier activity
|
||||||
|
@ -201,6 +177,8 @@ es:
|
||||||
correctedFk: Rectificada
|
correctedFk: Rectificada
|
||||||
correctingFk: Rectificativa
|
correctingFk: Rectificativa
|
||||||
supplierActivityFk: Actividad proveedor
|
supplierActivityFk: Actividad proveedor
|
||||||
|
from: Desde
|
||||||
|
to: Hasta
|
||||||
From: Desde
|
From: Desde
|
||||||
To: Hasta
|
To: Hasta
|
||||||
Amount: Importe
|
Amount: Importe
|
||||||
|
|
|
@ -47,12 +47,6 @@ const cols = computed(() => [
|
||||||
name: 'supplierRef',
|
name: 'supplierRef',
|
||||||
label: t('invoiceIn.list.supplierRef'),
|
label: t('invoiceIn.list.supplierRef'),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
name: 'serialNumber',
|
|
||||||
label: t('invoiceIn.list.serialNumber'),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'serial',
|
name: 'serial',
|
||||||
|
@ -141,7 +135,7 @@ const cols = computed(() => [
|
||||||
v-model="data.supplierFk"
|
v-model="data.supplierFk"
|
||||||
url="Suppliers"
|
url="Suppliers"
|
||||||
:fields="['id', 'nickname']"
|
:fields="['id', 'nickname']"
|
||||||
:label="t('Supplier')"
|
:label="t('globals.supplier')"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
:filter-options="['id', 'name']"
|
:filter-options="['id', 'name']"
|
||||||
|
@ -162,7 +156,7 @@ const cols = computed(() => [
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Companies"
|
url="Companies"
|
||||||
:label="t('Company')"
|
:label="t('globals.company')"
|
||||||
:fields="['id', 'code']"
|
:fields="['id', 'code']"
|
||||||
v-model="data.companyFk"
|
v-model="data.companyFk"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
invoiceIn:
|
||||||
|
serial: Serial
|
||||||
|
list:
|
||||||
|
ref: Reference
|
||||||
|
supplier: Supplier
|
||||||
|
supplierRef: Supplier ref.
|
||||||
|
serial: Serial
|
||||||
|
file: File
|
||||||
|
issued: Issued
|
||||||
|
isBooked: Is booked
|
||||||
|
awb: AWB
|
||||||
|
amount: Amount
|
||||||
|
card:
|
||||||
|
issued: Issued
|
||||||
|
amount: Amount
|
||||||
|
client: Client
|
||||||
|
company: Company
|
||||||
|
customerCard: Customer card
|
||||||
|
ticketList: Ticket List
|
||||||
|
vat: Vat
|
||||||
|
dueDay: Due day
|
||||||
|
intrastat: Intrastat
|
||||||
|
summary:
|
||||||
|
supplier: Supplier
|
||||||
|
supplierRef: Supplier ref.
|
||||||
|
currency: Currency
|
||||||
|
issued: Expedition date
|
||||||
|
operated: Operation date
|
||||||
|
bookEntried: Entry date
|
||||||
|
bookedDate: Booked date
|
||||||
|
sage: Sage withholding
|
||||||
|
vat: Undeductible VAT
|
||||||
|
company: Company
|
||||||
|
booked: Booked
|
||||||
|
expense: Expense
|
||||||
|
taxableBase: Taxable base
|
||||||
|
rate: Rate
|
||||||
|
sageVat: Sage vat
|
||||||
|
sageTransaction: Sage transaction
|
||||||
|
dueDay: Date
|
||||||
|
bank: Bank
|
||||||
|
amount: Amount
|
||||||
|
foreignValue: Foreign value
|
||||||
|
dueTotal: Due day
|
||||||
|
noMatch: Do not match
|
||||||
|
code: Code
|
||||||
|
net: Net
|
||||||
|
stems: Stems
|
||||||
|
country: Country
|
|
@ -0,0 +1,47 @@
|
||||||
|
invoiceIn:
|
||||||
|
serial: Serie
|
||||||
|
list:
|
||||||
|
ref: Referencia
|
||||||
|
supplier: Proveedor
|
||||||
|
supplierRef: Ref. proveedor
|
||||||
|
shortIssued: F. emisión
|
||||||
|
file: Fichero
|
||||||
|
issued: Fecha emisión
|
||||||
|
isBooked: Conciliada
|
||||||
|
awb: AWB
|
||||||
|
amount: Importe
|
||||||
|
card:
|
||||||
|
issued: Fecha emisión
|
||||||
|
amount: Importe
|
||||||
|
client: Cliente
|
||||||
|
company: Empresa
|
||||||
|
customerCard: Ficha del cliente
|
||||||
|
ticketList: Listado de tickets
|
||||||
|
vat: Iva
|
||||||
|
dueDay: Fecha de vencimiento
|
||||||
|
summary:
|
||||||
|
supplier: Proveedor
|
||||||
|
supplierRef: Ref. proveedor
|
||||||
|
currency: Divisa
|
||||||
|
docNumber: Número documento
|
||||||
|
issued: Fecha de expedición
|
||||||
|
operated: Fecha operación
|
||||||
|
bookEntried: Fecha asiento
|
||||||
|
bookedDate: Fecha contable
|
||||||
|
sage: Retención sage
|
||||||
|
vat: Iva no deducible
|
||||||
|
company: Empresa
|
||||||
|
booked: Contabilizada
|
||||||
|
expense: Gasto
|
||||||
|
taxableBase: Base imp.
|
||||||
|
rate: Tasa
|
||||||
|
sageTransaction: Sage transación
|
||||||
|
dueDay: Fecha
|
||||||
|
bank: Caja
|
||||||
|
amount: Importe
|
||||||
|
foreignValue: Divisa
|
||||||
|
dueTotal: Vencimiento
|
||||||
|
code: Código
|
||||||
|
net: Neto
|
||||||
|
stems: Tallos
|
||||||
|
country: País
|
Loading…
Reference in New Issue
Lo uso varias veces.