diff --git a/package-lock.json b/package-lock.json index 6a60c95c6..ce9c4d7c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@quasar/extras": "^1.16.4", "axios": "^1.4.0", "chromium": "^3.0.3", + "croppie": "^2.6.5", "pinia": "^2.1.3", "quasar": "^2.12.0", "validator": "^13.9.0", @@ -3169,6 +3170,11 @@ "node": ">= 10" } }, + "node_modules/croppie": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/croppie/-/croppie-2.6.5.tgz", + "integrity": "sha512-IlChnVUGG5T3w2gRZIaQgBtlvyuYnlUWs2YZIXXR3H9KrlO1PtBT3j+ykxvy9eZIWhk+V5SpBmhCQz5UXKrEKQ==" + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/package.json b/package.json index 1d729b82f..27ba190a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.02.01", + "version": "24.8.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", @@ -19,6 +19,7 @@ "@quasar/extras": "^1.16.4", "axios": "^1.4.0", "chromium": "^3.0.3", + "croppie": "^2.6.5", "pinia": "^2.1.3", "quasar": "^2.12.0", "validator": "^13.9.0", diff --git a/src/components/CreateBankEntityForm.vue b/src/components/CreateBankEntityForm.vue index 2a1385945..106dbec3a 100644 --- a/src/components/CreateBankEntityForm.vue +++ b/src/components/CreateBankEntityForm.vue @@ -1,6 +1,7 @@ + + + + +es: + Identifier: Identificador + Model: Modelo + Warehouse: Almacén + Temperature: Temperatura + New thermograph: Nuevo termógrafo + diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 17fc8fc4a..c8fa5809c 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -176,8 +176,8 @@ async function remove(data) { .dialog({ component: VnConfirm, componentProps: { - title: t('confirmDeletion'), - message: t('confirmDeletionMessage'), + title: t('globals.confirmDeletion'), + message: t('globals.confirmDeletionMessage'), newData, ids, }, @@ -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); @@ -318,16 +317,3 @@ watch(formUrl, async () => { color="primary" /> - - - { - "en": { - "confirmDeletion": "Confirm deletion", - "confirmDeletionMessage": "Are you sure you want to delete this?" - }, - "es": { - "confirmDeletion": "Confirmar eliminación", - "confirmDeletionMessage": "Seguro que quieres eliminar?" - } - } - diff --git a/src/components/EditPictureForm.vue b/src/components/EditPictureForm.vue new file mode 100644 index 000000000..9f69896b5 --- /dev/null +++ b/src/components/EditPictureForm.vue @@ -0,0 +1,359 @@ + + + + + + + +es: + Edit photo: Editar foto + Select from computer: Seleccionar desde ordenador + Import from external URL: Importar desde URL externa + Vertical: Vertical + Normal: Normal + Panoramic: Panorámica + Orientation: Orientación + File: Fichero + This photo provider doesn't allow remote downloads: Este proveedor de fotos no permite descargas remotas + Rotate left: Girar a la izquierda + Rotate right: Girar a la derecha + Select an image: Selecciona una imagen + diff --git a/src/components/EditTableCellValueForm.vue b/src/components/EditTableCellValueForm.vue new file mode 100644 index 000000000..6d3b7b08b --- /dev/null +++ b/src/components/EditTableCellValueForm.vue @@ -0,0 +1,141 @@ + + + + + + + + en: + editBuyTitle: Edit {buysAmount} buy(s) + es: + editBuyTitle: Editar {buysAmount} compra(s) + Field to edit: Campo a editar + Value: Valor + diff --git a/src/components/FetchData.vue b/src/components/FetchData.vue index 137f751db..5b3dcbea7 100644 --- a/src/components/FetchData.vue +++ b/src/components/FetchData.vue @@ -45,7 +45,7 @@ onMounted(async () => { async function fetch(fetchFilter = {}) { try { const filter = Object.assign(fetchFilter, $props.filter); // eslint-disable-line vue/no-dupe-keys - if ($props.where) filter.where = $props.where; + if ($props.where && !fetchFilter.where) filter.where = $props.where; if ($props.sortBy) filter.order = $props.sortBy; if ($props.limit) filter.limit = $props.limit; @@ -54,15 +54,9 @@ async function fetch(fetchFilter = {}) { }); emit('onFetch', data); + return data; } catch (e) { // } } - -const render = () => { - return h('div', []); -}; - diff --git a/src/components/FilterItemForm.vue b/src/components/FilterItemForm.vue new file mode 100644 index 000000000..4c329a8e8 --- /dev/null +++ b/src/components/FilterItemForm.vue @@ -0,0 +1,242 @@ + + + + + +es: + Filter item: Filtrar artículo + Enter a new search: Introduce una nueva búsqueda + + + diff --git a/src/components/FilterTravelForm.vue b/src/components/FilterTravelForm.vue new file mode 100644 index 000000000..499d5bc4e --- /dev/null +++ b/src/components/FilterTravelForm.vue @@ -0,0 +1,240 @@ + + + + + +es: + Filter travels: Filtro envíos + Enter a new search: Introduce una nueva búsqueda + + + diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 4904795f6..c33835438 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -1,6 +1,6 @@ + + + + +es: + Warehouse: Almacén + Type the visible quantity: Introduce la cantidad visible + Regularize stock: Regularizar stock + diff --git a/src/components/common/TableVisibleColumns.vue b/src/components/common/TableVisibleColumns.vue index d9a1a2004..7aa696a07 100644 --- a/src/components/common/TableVisibleColumns.vue +++ b/src/components/common/TableVisibleColumns.vue @@ -41,7 +41,7 @@ const setUserConfigViewData = (data) => { // Importante: El name de las columnas de la tabla debe conincidir con el name de las variables que devuelve la view config formattedCols.value = $props.allColumns.map((col) => ({ name: col, - active: data[col], + active: data[col] == undefined ? true : data[col], })); emitSavedConfig(); }; diff --git a/src/components/common/VnDms.vue b/src/components/common/VnDms.vue index cdc54b786..6cdca22c5 100644 --- a/src/components/common/VnDms.vue +++ b/src/components/common/VnDms.vue @@ -1,37 +1,126 @@ diff --git a/src/components/common/VnSelectCreate.vue b/src/components/common/VnSelectDialog.vue similarity index 74% rename from src/components/common/VnSelectCreate.vue rename to src/components/common/VnSelectDialog.vue index bdc3f5cc8..355a25109 100644 --- a/src/components/common/VnSelectCreate.vue +++ b/src/components/common/VnSelectDialog.vue @@ -20,6 +20,14 @@ const $props = defineProps({ type: Array, default: () => ['developer'], }, + actionIcon: { + type: String, + default: 'add', + }, + tooltip: { + type: String, + default: '', + }, }); const role = useRole(); @@ -48,10 +56,12 @@ const toggleForm = () => { diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelectFilter.vue index 7f10f5efe..5c26443f2 100644 --- a/src/components/common/VnSelectFilter.vue +++ b/src/components/common/VnSelectFilter.vue @@ -1,5 +1,8 @@ + + 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 9571c742e..0e7218892 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -1,9 +1,9 @@ + + + + {{ t('New consignee') }} + + + + +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/CustomerCreate.vue b/src/pages/Customer/CustomerCreate.vue index 63c90c9df..5d36c6c37 100644 --- a/src/pages/Customer/CustomerCreate.vue +++ b/src/pages/Customer/CustomerCreate.vue @@ -32,9 +32,8 @@ const workersOptions = ref([]); const businessTypesOptions = ref([]); const postcodesOptions = ref([]); - -function handleLocation(data, location ) { - const { town, code, provinceFk, countryFk } = location ?? {} +function handleLocation(data, location) { + const { town, code, provinceFk, countryFk } = location ?? {}; data.postcode = code; data.city = town; data.provinceFk = provinceFk; diff --git a/src/pages/Customer/CustomerFilter.vue b/src/pages/Customer/CustomerFilter.vue index 36a9add89..593b45509 100644 --- a/src/pages/Customer/CustomerFilter.vue +++ b/src/pages/Customer/CustomerFilter.vue @@ -37,153 +37,134 @@ const zones = ref(); - - en: params: diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index 540afcc4c..56c3749d4 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -1,34 +1,25 @@ - - es: Social name: Razón social diff --git a/src/pages/Customer/Notifications/CustomerNotificationsFilter.vue b/src/pages/Customer/Notifications/CustomerNotificationsFilter.vue index 650158278..957abb7a3 100644 --- a/src/pages/Customer/Notifications/CustomerNotificationsFilter.vue +++ b/src/pages/Customer/Notifications/CustomerNotificationsFilter.vue @@ -36,91 +36,80 @@ const clients = ref(); - - en: params: diff --git a/src/pages/Customer/Payments/CustomerPayments.vue b/src/pages/Customer/Payments/CustomerPayments.vue index de774e63e..eedaaf137 100644 --- a/src/pages/Customer/Payments/CustomerPayments.vue +++ b/src/pages/Customer/Payments/CustomerPayments.vue @@ -122,7 +122,7 @@ function stateColor(row) { -
+
.customer-payments { - .card-list { - width: 100%; - max-width: 60em; - - .q-table--dense .q-table th:first-child { - padding-left: 0; - } - td { - max-width: 130px; - overflow: hidden; - text-overflow: ellipsis; - } + .q-table--dense .q-table th:first-child { + padding-left: 0; + } + td { + max-width: 130px; + overflow: hidden; + text-overflow: ellipsis; } } diff --git a/src/pages/Customer/Payments/CustomerPaymentsFilter.vue b/src/pages/Customer/Payments/CustomerPaymentsFilter.vue index a19b35a20..74ea2c203 100644 --- a/src/pages/Customer/Payments/CustomerPaymentsFilter.vue +++ b/src/pages/Customer/Payments/CustomerPaymentsFilter.vue @@ -27,71 +27,60 @@ function isValidNumber(value) {
diff --git a/src/pages/Customer/components/CustomerConsigneeCreate.vue b/src/pages/Customer/components/CustomerConsigneeCreate.vue index 92ce47bf2..ef01879c2 100644 --- a/src/pages/Customer/components/CustomerConsigneeCreate.vue +++ b/src/pages/Customer/components/CustomerConsigneeCreate.vue @@ -10,9 +10,9 @@ import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; -import VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; +import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; -import CustomsNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue'; +import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue'; const { t } = useI18n(); const route = useRoute(); @@ -113,7 +113,7 @@ const toCustomerConsignees = () => {
- { - +
@@ -223,7 +223,7 @@ const toCustomerConsignees = () => { />
- { v-model="data.customsAgentFk" > - +
diff --git a/src/pages/Customer/components/CustomerConsigneeEdit.vue b/src/pages/Customer/components/CustomerConsigneeEdit.vue index 43649c58e..98996e479 100644 --- a/src/pages/Customer/components/CustomerConsigneeEdit.vue +++ b/src/pages/Customer/components/CustomerConsigneeEdit.vue @@ -10,7 +10,7 @@ import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; -import VnSelectCreate from 'src/components/common/VnSelectCreate.vue'; +import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import CustomerCreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue'; import CustomsNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue'; @@ -168,7 +168,7 @@ const onDataSaved = () => {
- { - +
@@ -278,7 +278,7 @@ const onDataSaved = () => { />
- { - +
diff --git a/src/pages/Customer/components/CustomerGreugeCreate.vue b/src/pages/Customer/components/CustomerGreugeCreate.vue new file mode 100644 index 000000000..1ff467d97 --- /dev/null +++ b/src/pages/Customer/components/CustomerGreugeCreate.vue @@ -0,0 +1,93 @@ + + + + + + + +es: + Amount: Importe + Date: Fecha + Comment: Comentario + Type: Tipo + diff --git a/src/pages/Customer/components/CustomerNewPayment.vue b/src/pages/Customer/components/CustomerNewPayment.vue new file mode 100644 index 000000000..fc0c52b0f --- /dev/null +++ b/src/pages/Customer/components/CustomerNewPayment.vue @@ -0,0 +1,286 @@ + + + + + +es: + New payment: Añadir pago + Date: Fecha + Company: Empresa + Bank: Caja + Amount: Importe + Reference: Referencia + Cash: Efectivo + Delivered amount: Cantidad entregada + Amount to return: Cantidad a devolver + View recipt: Ver recibido + Send email: Enviar correo + Compensation: Compensación + Compensation account: Cuenta para compensar + diff --git a/src/pages/Customer/components/CustomerNoteCreate.vue b/src/pages/Customer/components/CustomerNoteCreate.vue index cea90f975..640f6f3a0 100644 --- a/src/pages/Customer/components/CustomerNoteCreate.vue +++ b/src/pages/Customer/components/CustomerNoteCreate.vue @@ -32,8 +32,8 @@ const toCustomerNotes = () => { + + +es: + Responsible for approving invoices: Responsable de aprobar las facturas + diff --git a/src/pages/Supplier/Card/SupplierBillingData.vue b/src/pages/Supplier/Card/SupplierBillingData.vue index 1237a0403..bf5ccb115 100644 --- a/src/pages/Supplier/Card/SupplierBillingData.vue +++ b/src/pages/Supplier/Card/SupplierBillingData.vue @@ -13,6 +13,13 @@ const { t } = useI18n(); const paymethodsOptions = ref([]); const payDemsOptions = ref([]); + +const formatPayDems = (data) => { + payDemsOptions.value = data.map(({ id, payDem }) => ({ + id: id, + payDem: payDem || '0', + })); +};