diff --git a/src/components/CreateNewExpenseForm.vue b/src/components/CreateNewExpenseForm.vue new file mode 100644 index 000000000..7088cec03 --- /dev/null +++ b/src/components/CreateNewExpenseForm.vue @@ -0,0 +1,50 @@ + + + + +es: + New expense: Nuevo gasto + It's a withholding: Es una retención + diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue index 213c08d7e..03fe11a85 100644 --- a/src/components/LeftMenu.vue +++ b/src/components/LeftMenu.vue @@ -1,6 +1,6 @@ + @@ -691,17 +723,16 @@ watch( - - - - + diff --git a/src/composables/getTotal.js b/src/composables/getTotal.js new file mode 100644 index 000000000..41c4330c4 --- /dev/null +++ b/src/composables/getTotal.js @@ -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); + + return currency + ? toCurrency(total, currency == 'default' ? undefined : currency) + : total; +} diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 9157a6cb3..b3a821948 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -263,6 +263,7 @@ globals: clientsActionsMonitor: Clients and actions serial: Serial medical: Mutual + supplier: Supplier created: Created worker: Worker now: Now @@ -755,56 +756,6 @@ parking: searchBar: info: You can search by parking code 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: field: salesPersonFk: Sales Person diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index ee42344a7..16f1e26a8 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -267,6 +267,7 @@ globals: clientsActionsMonitor: Clientes y acciones serial: Facturas por serie medical: Mutua + supplier: Proveedor created: Fecha creación worker: Trabajador now: Ahora @@ -801,54 +802,6 @@ parking: searchBar: info: Puedes buscar por código de 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: pageTitles: basicData: Basic data diff --git a/src/pages/Customer/components/CustomerSamplesCreate.vue b/src/pages/Customer/components/CustomerSamplesCreate.vue index 0470dc176..79f4fe449 100644 --- a/src/pages/Customer/components/CustomerSamplesCreate.vue +++ b/src/pages/Customer/components/CustomerSamplesCreate.vue @@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; import axios from 'axios'; +import { usePrintService } from 'composables/usePrintService'; import { useQuasar } from 'quasar'; import { useState } from 'src/composables/useState'; @@ -27,7 +28,7 @@ const router = useRouter(); const state = useState(); const user = state.getUser(); const stateStore = useStateStore(); - +const { sendEmail } = usePrintService(); const client = ref({}); const hasChanged = ref(false); const isLoading = ref(false); @@ -156,22 +157,33 @@ const onSubmit = async () => { } }; -const onDataSaved = async ({ - addressId, - companyFk, - companyId, - from, - recipient, - replyTo, -}) => { - await axios.post(`Clients/${route.params.id}/incoterms-authorization-email`, { - addressId, - companyFk, - companyId, - from, - recipient, - replyTo, - }); +const getSamples = async () => { + try { + const filter = { where: { id: initialData.typeFk } }; + let { data } = await axios.get('Samples', { + params: { filter: JSON.stringify(filter) }, + }); + return data[0]; + } catch (error) { + notify('errors.create', 'negative'); + } +}; + +getSamples(); +const onDataSaved = async () => { + try { + const params = { + recipientId: initialData.recipientId, + recipient: initialData.recipient, + replyTo: initialData.replyTo, + }; + setParams(params); + const samplesData = await getSamples(); + const path = `${samplesData.model}/${route.params.id}/${samplesData.code}-email`; + await sendEmail(path, params); + } catch (error) { + notify('errors.create', 'negative'); + } toCustomerSamples(); }; diff --git a/src/pages/Entry/Card/EntryBuys.vue b/src/pages/Entry/Card/EntryBuys.vue index e9a9ab815..ff89faada 100644 --- a/src/pages/Entry/Card/EntryBuys.vue +++ b/src/pages/Entry/Card/EntryBuys.vue @@ -26,7 +26,6 @@ const { notify } = useNotify(); const rowsSelected = ref([]); const entryBuysPaginateRef = ref(null); -const packagingsOptions = ref(null); const originalRowDataCopy = ref(null); const getInputEvents = (colField, props) => { @@ -66,7 +65,10 @@ const tableColumnComponents = computed(() => ({ 'map-options': true, 'use-input': true, 'hide-selected': true, - options: packagingsOptions.value, + url: 'Packagings', + fields: ['id'], + where: { freightItemFk: true }, + 'sort-by': 'id ASC', dense: true, }, event: getInputEvents, @@ -304,13 +306,6 @@ const lockIconType = (groupingMode, mode) => {