diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 17fc8fc4a..9bb05d439 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -196,7 +196,6 @@ function getChanges() { const creates = []; const pk = $props.primaryKey; - for (const [i, row] of formData.value.entries()) { if (!row[pk]) { creates.push(row); diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue index 2eac97c65..1721adfec 100644 --- a/src/components/LeftMenu.vue +++ b/src/components/LeftMenu.vue @@ -206,6 +206,17 @@ async function togglePinned(item, event) { diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 4265d02e9..6368a3e52 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -7,7 +7,7 @@ import { date } from 'quasar'; import { useStateStore } from 'stores/useStateStore'; import { toRelativeDate } from 'src/filters'; import { useColor } from 'src/composables/useColor'; -import { useFirstUpper } from 'src/composables/useFirstUpper'; +import { useCapitalize } from 'src/composables/useCapitalize'; import { useValidator } from 'src/composables/useValidator'; import VnAvatar from '../ui/VnAvatar.vue'; import VnJsonValue from '../common/VnJsonValue.vue'; @@ -140,7 +140,7 @@ function parseProps(propNames, locale, vals, olds) { if (prop.endsWith('$')) continue; props.push({ name: prop, - nameI18n: useFirstUpper(locale.columns?.[prop]) || prop, + nameI18n: useCapitalize(locale.columns?.[prop]) || prop, val: getVal(vals, prop), old: olds && getVal(olds, prop), }); @@ -202,7 +202,7 @@ function getLogTree(data) { userLog.logs.push( (modelLog = { model: log.changedModel, - modelI18n: useFirstUpper(locale.name) || log.changedModel, + modelI18n: useCapitalize(locale.name) || log.changedModel, id: log.changedModelId, showValue: log.changedModelValue, logs: [], @@ -395,7 +395,7 @@ setLogTree(); (data) => (actions = data.map((item) => { return { - locale: useFirstUpper(validations[item.changedModel].locale.name), + locale: useCapitalize(validations[item.changedModel].locale.name), value: item.changedModel, }; })) @@ -409,7 +409,7 @@ setLogTree(); >
- {{ useFirstUpper(validations[props.model].locale.name) }} + {{ useCapitalize(validations[props.model].locale.name) }} #{{ originLog.originFk }}
diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index 95844ac22..5c26443f2 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -83,7 +83,7 @@ onMounted(() => { if ($props.url && $props.modelValue) fetchFilter($props.modelValue); }); -async function filter(val, options) { +function filter(val, options) { const search = val.toString().toLowerCase(); if (!search) return options; @@ -123,7 +123,7 @@ async function filterHandler(val, update) { myOptions.value = await fetchFilter(val); return; } - myOptions.value = await filter(val, myOptionsOriginal.value); + myOptions.value = filter(val, myOptionsOriginal.value); }, (ref) => { if (val !== '' && ref.options.length > 0) { diff --git a/src/pages/Worker/Card/WorkerSummaryDialog.vue b/src/components/common/VnSummaryDialog.vue similarity index 61% rename from src/pages/Worker/Card/WorkerSummaryDialog.vue rename to src/components/common/VnSummaryDialog.vue index 59ea702e0..08fc8870d 100644 --- a/src/pages/Worker/Card/WorkerSummaryDialog.vue +++ b/src/components/common/VnSummaryDialog.vue @@ -1,21 +1,23 @@ - diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 8f6ffa35d..0e7218892 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -1,9 +1,9 @@ + + +es: + Total: Total + Date: Fecha + Created by: Creado por + Comment: Comentario + Type: Tipo + Amount: Importe + New greuge: Nuevo greuge + diff --git a/src/pages/Customer/Card/CustomerLog.vue b/src/pages/Customer/Card/CustomerLog.vue index fe59bf2dc..36d79959d 100644 --- a/src/pages/Customer/Card/CustomerLog.vue +++ b/src/pages/Customer/Card/CustomerLog.vue @@ -1,3 +1,262 @@ + + + + +es: + Search: Buscar + Search by id or concept: xxx + Entity: Entidad + All: Todo + User: Usuario + System: Sistema + Changes: Cambios + Search by changes: xxx + Creates: Crea + Edits: Modifica + Deletes: Elimina + Accesses: Accede + Date: Fecha + To: Hasta + Quit filter: Quitar filtro + diff --git a/src/pages/Customer/Card/CustomerNotes.vue b/src/pages/Customer/Card/CustomerNotes.vue index 09f5c0ce6..781c57e50 100644 --- a/src/pages/Customer/Card/CustomerNotes.vue +++ b/src/pages/Customer/Card/CustomerNotes.vue @@ -62,7 +62,7 @@ const toCustomerNoteCreate = () => { +import { ref, computed, onBeforeMount } from 'vue'; +import { useI18n } from 'vue-i18n'; +import { useRoute, useRouter } from 'vue-router'; + +import { date, QBtn } from 'quasar'; + +import { useArrayData } from 'composables/useArrayData'; +import { useStateStore } from 'stores/useStateStore'; +import { toCurrency } from 'src/filters'; + +import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; + +const { t } = useI18n(); +const route = useRoute(); +const router = useRouter(); +const stateStore = useStateStore(); + +const arrayData = ref(null); +const workerId = ref(0); +const rows = computed(() => arrayData.value.store.data); + +onBeforeMount(async () => { + const filter = { + where: { clientFk: `${route.params.id}` }, + order: ['started DESC'], + limit: 20, + }; + + arrayData.value = useArrayData('CustomerRecoveriesCard', { + url: 'Recoveries', + filter, + }); + await arrayData.value.fetch({ append: false }); + stateStore.rightDrawer = true; +}); + +const tableColumnComponents = { + since: { + component: 'span', + props: () => {}, + event: () => {}, + }, + to: { + component: 'span', + props: () => {}, + event: () => {}, + }, + amount: { + component: 'span', + props: () => {}, + event: () => {}, + }, + period: { + component: 'span', + props: () => {}, + event: () => {}, + }, +}; + +const columns = computed(() => [ + { + align: 'left', + field: 'started', + label: t('Since'), + name: 'since', + format: (value) => date.formatDate(value, 'DD/MM/YYYY'), + }, + { + align: 'left', + field: 'finished', + label: t('To'), + name: 'to', + format: (value) => date.formatDate(value, 'DD/MM/YYYY'), + }, + { + align: 'left', + field: 'amount', + label: t('Amount'), + name: 'amount', + format: (value) => toCurrency(value), + }, + { + align: 'left', + field: 'period', + label: t('Period'), + name: 'period', + }, +]); + +const toCustomerRecoverieCreate = () => { + router.push({ name: 'CustomerRecoverieCreate' }); +}; + + + + + + +es: + Since: Desde + To: Hasta + Amount: Importe + Period: Periodo + New recoverie: Nuevo recobro + diff --git a/src/pages/Customer/Card/CustomerSummaryDialog.vue b/src/pages/Customer/Card/CustomerSummaryDialog.vue deleted file mode 100644 index d9571ac54..000000000 --- a/src/pages/Customer/Card/CustomerSummaryDialog.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - - - diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue index 95ec77c3d..d3be7bec8 100644 --- a/src/pages/Customer/Card/CustomerWebAccess.vue +++ b/src/pages/Customer/Card/CustomerWebAccess.vue @@ -1,3 +1,69 @@ + + + + +es: + Enable web access: Habilitar acceso web + User: Usuario + Recovery email: Correo de recuperacion + This email is used for user to regain access their account: Este correo electrónico se usa para que el usuario recupere el acceso a su cuenta + diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index a78720d03..56c3749d4 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -1,34 +1,25 @@