diff --git a/src/components/CreateBankEntityForm.vue b/src/components/CreateBankEntityForm.vue index c46ac7752..1117225c7 100644 --- a/src/components/CreateBankEntityForm.vue +++ b/src/components/CreateBankEntityForm.vue @@ -1,5 +1,5 @@ import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; -import { useI18n } from 'vue-i18n'; -const $props = defineProps({ +defineProps({ name: { type: String, default: null }, + tag: { type: String, default: null }, workerId: { type: Number, default: null }, defaultName: { type: Boolean, default: false }, }); - -const { t } = useI18n(); - - {{ $props.defaultName ? $props.name ?? t('globals.system') : $props.name }} + + {{ defaultName ? name ?? $t('globals.system') : name }} - + diff --git a/src/composables/usePrintService.js b/src/composables/usePrintService.js index edf9598b2..ff43c65a1 100644 --- a/src/composables/usePrintService.js +++ b/src/composables/usePrintService.js @@ -17,6 +17,7 @@ export function usePrintService() { } function openReport(path, params) { + if (typeof params === 'string') params = JSON.parse(params); params = Object.assign( { access_token: getTokenMultimedia(), diff --git a/src/css/app.scss b/src/css/app.scss index ecffd576c..3c51dc8af 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -275,3 +275,8 @@ input::-webkit-inner-spin-button { z-index: 1; cursor: pointer; } + +.subName { + color: var(--vn-label-color); + text-transform: uppercase; +} diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 0a3e35b9e..f736bd705 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -2,6 +2,7 @@ globals: lang: es: Spanish en: English + quantity: Quantity language: Language entity: Entity user: User @@ -98,6 +99,9 @@ globals: to: To notes: Notes refresh: Refresh + item: Item + ticket: Ticket + campaign: Campaign weight: Weight pageTitles: logIn: Login @@ -125,6 +129,7 @@ globals: notifications: Notifications defaulter: Defaulter customerCreate: New customer + createOrder: New order fiscalData: Fiscal data billingData: Billing data consignees: Consignees @@ -315,135 +320,6 @@ resetPassword: repeatPassword: Repeat password passwordNotMatch: Passwords don't match passwordChanged: Password changed -customer: - list: - phone: Phone - email: Email - customerOrders: Display customer orders - moreOptions: More options - card: - customerList: Customer list - customerId: Claim ID - salesPerson: Sales person - credit: Credit - risk: Risk - securedCredit: Secured credit - payMethod: Pay method - debt: Debt - isFrozen: Customer frozen - hasDebt: Customer has debt - isDisabled: Customer inactive - notChecked: Customer no checked - webAccountInactive: Web account inactive - noWebAccess: Web access is disabled - businessType: Business type - passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n' - businessTypeFk: Business type - summary: - basicData: Basic data - fiscalAddress: Fiscal address - fiscalData: Fiscal data - billingData: Billing data - consignee: Default consignee - businessData: Business data - financialData: Financial data - customerId: Customer ID - name: Name - contact: Contact - phone: Phone - mobile: Mobile - email: Email - salesPerson: Sales person - contactChannel: Contact channel - socialName: Social name - fiscalId: Fiscal ID - postcode: Postcode - province: Province - country: Country - street: Address - isEqualizated: Is equalizated - isActive: Is active - invoiceByAddress: Invoice by address - verifiedData: Verified data - hasToInvoice: Has to invoice - notifyByEmail: Notify by email - vies: VIES - payMethod: Pay method - bankAccount: Bank account - dueDay: Due day - hasLcr: Has LCR - hasCoreVnl: Has core VNL - hasB2BVnl: Has B2B VNL - addressName: Address name - addressCity: City - addressStreet: Street - username: Username - webAccess: Web access - totalGreuge: Total greuge - mana: Mana - priceIncreasingRate: Price increasing rate - averageInvoiced: Average invoiced - claimRate: Claming rate - risk: Risk - riskInfo: Invoices minus payments plus orders not yet invoiced - credit: Credit - creditInfo: Company's maximum risk - securedCredit: Secured credit - securedCreditInfo: Solunion's maximum risk - balance: Balance - balanceInfo: Invoices minus payments - balanceDue: Balance due - balanceDueInfo: Deviated invoices minus payments - recoverySince: Recovery since - businessType: Business Type - city: City - descriptorInfo: Invoices minus payments plus orders not yet - rating: Rating - recommendCredit: Recommended credit - basicData: - socialName: Fiscal name - businessType: Business type - contact: Contact - youCanSaveMultipleEmails: You can save multiple emails - email: Email - phone: Phone - mobile: Mobile - salesPerson: Sales person - contactChannel: Contact channel - previousClient: Previous client - extendedList: - tableVisibleColumns: - id: Identifier - name: Name - socialName: Social name - fi: Tax number - salesPersonFk: Salesperson - credit: Credit - creditInsurance: Credit insurance - phone: Phone - mobile: Mobile - street: Street - countryFk: Country - provinceFk: Province - city: City - postcode: Postcode - email: Email - created: Created - businessTypeFk: Business type - payMethodFk: Billing data - sageTaxTypeFk: Sage tax type - sageTransactionTypeFk: Sage tr. type - isActive: Active - isVies: Vies - isTaxDataChecked: Verified data - isEqualizated: Is equalizated - isFreezed: Freezed - hasToInvoice: Invoice - hasToInvoiceByAddress: Invoice by address - isToBeMailed: Mailing - hasLcr: Received LCR - hasCoreVnl: VNL core received - hasSepaVnl: VNL B2B received entry: list: newEntry: New entry diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 15058a9be..27920bcd2 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -3,6 +3,7 @@ globals: es: Español en: Inglés language: Idioma + quantity: Cantidad entity: Entidad user: Usuario details: Detalles @@ -100,6 +101,9 @@ globals: to: Hasta notes: Notas refresh: Actualizar + item: Artículo + ticket: Ticket + campaign: Campaña weight: Peso pageTitles: logIn: Inicio de sesión @@ -122,6 +126,7 @@ globals: inheritedRoles: Roles heredados customers: Clientes customerCreate: Nuevo cliente + createOrder: Nuevo pedido list: Listado webPayments: Pagos Web extendedList: Listado extendido @@ -317,134 +322,6 @@ resetPassword: repeatPassword: Repetir contraseña passwordNotMatch: Las contraseñas no coinciden passwordChanged: Contraseña cambiada -customer: - list: - phone: Teléfono - email: Email - customerOrders: Mostrar órdenes del cliente - moreOptions: Más opciones - card: - customerId: ID cliente - salesPerson: Comercial - credit: Crédito - risk: Riesgo - securedCredit: Crédito asegurado - payMethod: Método de pago - debt: Riesgo - isFrozen: Cliente congelado - hasDebt: Cliente con riesgo - isDisabled: Cliente inactivo - notChecked: Cliente no comprobado - webAccountInactive: Sin acceso web - noWebAccess: El acceso web está desactivado - businessType: Tipo de negocio - passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)' - businessTypeFk: Tipo de negocio - summary: - basicData: Datos básicos - fiscalAddress: Dirección fiscal - fiscalData: Datos fiscales - billingData: Datos de facturación - consignee: Consignatario pred. - businessData: Datos comerciales - financialData: Datos financieros - customerId: ID cliente - name: Nombre - contact: Contacto - phone: Teléfono - mobile: Móvil - email: Email - salesPerson: Comercial - contactChannel: Canal de contacto - socialName: Razón social - fiscalId: NIF/CIF - postcode: Código postal - province: Provincia - country: País - street: Calle - isEqualizated: Recargo de equivalencia - isActive: Activo - invoiceByAddress: Facturar por consignatario - verifiedData: Datos verificados - hasToInvoice: Facturar - notifyByEmail: Notificar por email - vies: VIES - payMethod: Método de pago - bankAccount: Cuenta bancaria - dueDay: Día de pago - hasLcr: Recibido LCR - hasCoreVnl: Recibido core VNL - hasB2BVnl: Recibido B2B VNL - addressName: Nombre de la dirección - addressCity: Ciudad - addressStreet: Calle - username: Usuario - webAccess: Acceso web - totalGreuge: Greuge total - mana: Maná - priceIncreasingRate: Ratio de incremento de precio - averageInvoiced: Facturación media - claimRate: Ratio de reclamaciones - risk: Riesgo - riskInfo: Facturas menos recibos mas pedidos sin facturar - credit: Crédito - creditInfo: Riesgo máximo asumido por la empresa - securedCredit: Crédito asegurado - securedCreditInfo: Riesgo máximo asumido por Solunion - balance: Balance - balanceInfo: Facturas menos recibos - balanceDue: Saldo vencido - balanceDueInfo: Facturas fuera de plazo menos recibos - recoverySince: Recobro desde - businessType: Tipo de negocio - city: Población - descriptorInfo: Facturas menos recibos mas pedidos sin facturar - rating: Clasificación - recommendCredit: Crédito recomendado - basicData: - socialName: Nombre fiscal - businessType: Tipo de negocio - contact: Contacto - youCanSaveMultipleEmails: Puede guardar varios correos electrónicos encadenándolos mediante comas sin espacios{','} ejemplo{':'} user{'@'}dominio{'.'}com, user2{'@'}dominio{'.'}com siendo el primer correo electrónico el principal - email: Email - phone: Teléfono - mobile: Móvil - salesPerson: Comercial - contactChannel: Canal de contacto - previousClient: Cliente anterior - extendedList: - tableVisibleColumns: - id: Identificador - name: Nombre - socialName: Razón social - fi: NIF / CIF - salesPersonFk: Comercial - credit: Crédito - creditInsurance: Crédito asegurado - phone: Teléfono - mobile: Móvil - street: Dirección fiscal - countryFk: País - provinceFk: Provincia - city: Población - postcode: Código postal - email: Email - created: Fecha creación - businessTypeFk: Tipo de negocio - payMethodFk: Forma de pago - sageTaxTypeFk: Tipo de impuesto Sage - sageTransactionTypeFk: Tipo tr. sage - isActive: Activo - isVies: Vies - isTaxDataChecked: Datos comprobados - isEqualizated: Recargo de equivalencias - isFreezed: Congelado - hasToInvoice: Factura - hasToInvoiceByAddress: Factura por consigna - isToBeMailed: Env. emails - hasLcr: Recibido LCR - hasCoreVnl: Recibido core VNL - hasSepaVnl: Recibido B2B VNL entry: list: newEntry: Nueva entrada diff --git a/src/pages/Account/Card/AccountPrivileges.vue b/src/pages/Account/Card/AccountPrivileges.vue index 0574e08d2..fea57105b 100644 --- a/src/pages/Account/Card/AccountPrivileges.vue +++ b/src/pages/Account/Card/AccountPrivileges.vue @@ -19,7 +19,15 @@ watch( (rolesOptions = data)" /> - + @@ -211,7 +211,7 @@ async function saveWhenHasChanges() { - toCurrency(sale.quantity * sale.price * ((100 - sale.discount) / 100)), + field: (row) => + toCurrency(row.quantity * row.sale.price * ((100 - row.sale.discount) / 100)), sortable: true, }, ]); diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index 95f5f0981..70747bb3f 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -95,12 +95,7 @@ const columns = computed(() => [ label: t('Employee'), columnField: { component: 'userLink', - attrs: ({ row }) => { - return { - workerId: row.workerFk, - name: row.userName, - }; - }, + attrs: ({ row }) => ({ workerId: row.workerFk, tag: row.userName }), }, cardVisible: true, }, @@ -259,6 +254,7 @@ const showBalancePdf = ({ id }) => { :is-editable="false" :column-search="false" @on-fetch="onFetch" + :disable-option="{ card: true }" auto-load > diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index a6150bb3f..8cc59ef3c 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -25,6 +25,7 @@ const title = ref(); /> (businessTypes = data)" auto-load /> @@ -38,7 +39,7 @@ const title = ref(); clearable v-model="data.name" /> - { - title = val?.nickname; - data.salesPersonFk = val?.id; - } - " + emit-value + auto-load > + + + + {{ scope.opt?.name }} + {{ scope.opt?.nickname }}, + {{ scope.opt?.code }} + + + - - @@ -145,7 +159,7 @@ const title = ref(); }} - + diff --git a/src/pages/Customer/Card/CustomerBillingData.vue b/src/pages/Customer/Card/CustomerBillingData.vue index 495b871df..5eeaea50b 100644 --- a/src/pages/Customer/Card/CustomerBillingData.vue +++ b/src/pages/Customer/Card/CustomerBillingData.vue @@ -31,8 +31,8 @@ const getBankEntities = (data, formData) => { - (payMethods = data)" auto-load url="PayMethods" /> - (payMethods = data)" auto-load url="PayMethods" /> + (bankEntitiesOptions = data)" :filter="filter" @@ -85,9 +85,8 @@ const getBankEntities = (data, formData) => { - {{ scope.opt.bic }} {{ scope.opt.name }} + {{ scope.opt.bic }} + {{ scope.opt.name }} diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue index 229946ea2..139917d05 100644 --- a/src/pages/Customer/Card/CustomerCard.vue +++ b/src/pages/Customer/Card/CustomerCard.vue @@ -1,17 +1,23 @@ -import CustomerConsumptionFilter from './CustomerConsumptionFilter.vue'; -import { useStateStore } from 'src/stores/useStateStore'; +import { ref, computed, onBeforeMount } from 'vue'; +import axios from 'axios'; +import { useI18n } from 'vue-i18n'; +import { toDate } from 'src/filters/index'; +import { useRoute } from 'vue-router'; + +import VnTable from 'components/VnTable/VnTable.vue'; +import FetchedTags from 'components/ui/FetchedTags.vue'; +import { useArrayData } from 'src/composables/useArrayData'; +import { usePrintService } from 'src/composables/usePrintService'; +import { useVnConfirm } from 'src/composables/useVnConfirm'; + +const { openConfirmationModal } = useVnConfirm(); +const { openReport, sendEmail } = usePrintService(); +import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue'; +import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; +import VnSelect from 'components/common/VnSelect.vue'; +import VnInputDate from 'components/common/VnInputDate.vue'; + +const arrayData = useArrayData('Client'); +const { t } = useI18n(); +const route = useRoute(); +const campaignList = ref(); +const showActionBtns = computed(() => handleQueryParams()); +function handleQueryParams() { + const query = getQueryParams(); + return query.from && query.to; +} +const columns = computed(() => [ + { + name: 'search', + align: 'left', + label: t('globals.search'), + visible: false, + }, + { + name: 'itemFk', + align: 'left', + label: t('globals.item'), + columnClass: 'shrink', + cardVisible: true, + columnFilter: { + name: 'itemId', + }, + }, + { + name: 'ticketFk', + align: 'left', + label: t('globals.ticket'), + cardVisible: true, + columnFilter: { + inWhere: true, + }, + }, + { + name: 'shipped', + align: 'left', + label: t('globals.shipped'), + format: ({ shipped }) => toDate(shipped), + columnFilter: false, + cardVisible: true, + }, + { + name: 'description', + align: 'left', + label: t('globals.description'), + columnClass: 'expand', + columnFilter: { + inWhere: true, + }, + }, + { + name: 'quantity', + label: t('globals.quantity'), + cardVisible: true, + columnFilter: { + inWhere: true, + }, + }, + { + name: 'grouped', + label: t('Group by items'), + component: 'checkbox', + visible: false, + orderBy: false, + }, +]); + +onBeforeMount(async () => { + campaignList.value = (await axios('Campaigns/latest')).data; +}); + +function getQueryParams() { + return JSON.parse(route.query.consumption ?? '{}'); +} +function getParams() { + const query = getQueryParams(); + return { + from: query.from, + to: query.to, + recipient: arrayData.store.data.email, + recipientId: arrayData.store.data.id, + }; +} +const userParams = computed(() => { + const minDate = Date.vnNew(); + minDate.setHours(0, 0, 0, 0); + minDate.setMonth(minDate.getMonth() - 2); + + const maxDate = Date.vnNew(); + maxDate.setHours(23, 59, 59, 59); + + return { + campaign: campaignList.value[0]?.id, + from: minDate, + to: maxDate, + }; +}); +const openReportPdf = () => { + openReport(`Clients/${route.params.id}/campaign-metrics-pdf`, getParams()); +}; + +const openSendEmailDialog = async () => { + openConfirmationModal( + t('The consumption report will be sent'), + t('Please, confirm'), + () => sendCampaignMetricsEmail({ address: arrayData.store.data.email }) + ); +}; +const sendCampaignMetricsEmail = ({ address }) => { + sendEmail(`Clients/${route.params.id}/campaign-metrics-email`, { + recipient: address, + ...getParams(), + }); +}; - - - + + + + {{ t('globals.downloadPdf') }} + + + {{ t('Send to email') }} + + + + + {{ row.itemFk }} + + + + + + {{ row.ticketFk }} + + + + + {{ row.concept }} + + {{ row.subName }} + + + + + + + + + + + {{ scope.opt?.code }} + {{ + new Date(scope.opt?.dated).getFullYear() + }} + + + + + + + + + es: Enter a new search: Introduce una nueva búsqueda + Group by items: Agrupar por artículos diff --git a/src/pages/Customer/Card/CustomerCreditContracts.vue b/src/pages/Customer/Card/CustomerCreditContracts.vue index 12719b2cf..0ff074793 100644 --- a/src/pages/Customer/Card/CustomerCreditContracts.vue +++ b/src/pages/Customer/Card/CustomerCreditContracts.vue @@ -53,6 +53,8 @@ const openDialog = (item) => { promise: updateData, }, }); + updateData(); + showQPageSticky.value = true; }; const openViewCredit = (credit) => { diff --git a/src/pages/Customer/Card/CustomerCreditOpinion.vue b/src/pages/Customer/Card/CustomerCreditOpinion.vue index 9c060b1a5..6a839ff3f 100644 --- a/src/pages/Customer/Card/CustomerCreditOpinion.vue +++ b/src/pages/Customer/Card/CustomerCreditOpinion.vue @@ -1,23 +1,17 @@ - (rows = data)" - auto-load - ref="clientInformasRef" + - - - - - - - - - - - + + {{ row.worker.user.nickname }} + - - - - + diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index 0e76bcfed..b18f90d20 100644 --- a/src/pages/Customer/Card/CustomerDescriptor.vue +++ b/src/pages/Customer/Card/CustomerDescriptor.vue @@ -3,7 +3,7 @@ import { ref, computed } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; -import { toCurrency, toDate } from 'src/filters'; +import { dashIfEmpty, toCurrency, toDate } from 'src/filters'; import useCardDescription from 'src/composables/useCardDescription'; @@ -11,6 +11,10 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import VnUserLink from 'src/components/ui/VnUserLink.vue'; import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue'; +import { useState } from 'src/composables/useState'; +const state = useState(); + +const customer = computed(() => state.get('customer')); const $props = defineProps({ id: { @@ -43,7 +47,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit :subtitle="data.subtitle" @on-fetch="setData" :summary="$props.summary" - data-key="customerData" + data-key="customer" > @@ -57,35 +61,46 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit :value="toCurrency(entity.creditInsurance)" /> - - + + + {{ dashIfEmpty(entity.salesPersonUser) }} - - + + {{ t('customer.card.isDisabled') }} - + {{ t('customer.card.isFrozen') }} (data.value = useCardDescription(entity?.name, entit {{ t('customer.card.webAccountInactive') }} (data.value = useCardDescription(entity?.name, entit {{ t('customer.card.hasDebt') }} (data.value = useCardDescription(entity?.name, entit {{ t('customer.card.notChecked') }} (data.value = useCardDescription(entity?.name, entit {{ t('unpaidDated', { - dated: toDate(entity.unpaid.dated), + dated: toDate(customer.unpaid.dated), }) }} {{ t('unpaidAmount', { - amount: toCurrency(entity.unpaid.amount), + amount: toCurrency(customer.unpaid.amount), }) }} @@ -139,7 +154,13 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit (data.value = useCardDescription(entity?.name, entit - {{ t('New order') }} - - { notify(error.message, 'positive'); } }; + +const ticketCreateFormDialog = ref(null); +const openTicketCreateForm = () => { + ticketCreateFormDialog.value.show(); +}; +const orderCreateFormDialog = ref(null); +const openOrderCreateForm = () => { + orderCreateFormDialog.value.show(); +}; - + - - {{ t('Simple ticket') }} - + {{ t('globals.pageTitles.createTicket') }} + + + + + + + + {{ t('globals.pageTitles.createOrder') }} + + + diff --git a/src/pages/Customer/Card/CustomerGreuges.vue b/src/pages/Customer/Card/CustomerGreuges.vue index 12173727f..1c78392e7 100644 --- a/src/pages/Customer/Card/CustomerGreuges.vue +++ b/src/pages/Customer/Card/CustomerGreuges.vue @@ -47,7 +47,6 @@ const columns = computed(() => [ }, { align: 'left', - name: 'userFk', label: t('Created by'), component: 'userLink', attrs: ({ row }) => { @@ -73,6 +72,7 @@ const columns = computed(() => [ columnCreate: { component: 'select', url: 'greugeTypes', + sortBy: 'name ASC ', limit: 0, }, }, @@ -105,9 +105,10 @@ const setRows = (data) => { :use-model="true" :column-search="false" @on-fetch="(data) => setRows(data)" + :disable-option="{ card: true }" :create="{ urlCreate: `Greuges`, - title: t('New credit'), + title: t('New greuge'), onDataSaved: () => tableRef.reload(), formInitialData: { shipped: new Date(), clientFk: route.params.id }, }" diff --git a/src/pages/Customer/Card/CustomerRecoveries.vue b/src/pages/Customer/Card/CustomerRecoveries.vue index 8d3d05702..3ea8998e9 100644 --- a/src/pages/Customer/Card/CustomerRecoveries.vue +++ b/src/pages/Customer/Card/CustomerRecoveries.vue @@ -89,6 +89,7 @@ function setFinished(id) { :columns="columns" :use-model="true" :right-search="false" + :disable-option="{ card: true }" :create="{ urlCreate: 'Recoveries', title: 'New recovery', diff --git a/src/pages/Customer/Card/CustomerSamples.vue b/src/pages/Customer/Card/CustomerSamples.vue index de998d8d3..49697aab7 100644 --- a/src/pages/Customer/Card/CustomerSamples.vue +++ b/src/pages/Customer/Card/CustomerSamples.vue @@ -3,18 +3,18 @@ import { ref, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; -import { QBtn } from 'quasar'; +import { QBtn, useQuasar } from 'quasar'; -import FetchData from 'components/FetchData.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import { toDateTimeFormat } from 'src/filters/date'; +import VnTable from 'src/components/VnTable/VnTable.vue'; +import { dashIfEmpty } from 'src/filters'; +import CustomerSamplesCreate from '../components/CustomerSamplesCreate.vue'; const { t } = useI18n(); const route = useRoute(); const router = useRouter(); -const rows = ref([]); - const filter = { include: [ { relation: 'type', scope: { fields: ['code', 'description'] } }, @@ -26,105 +26,67 @@ const filter = { limit: 20, }; -const tableColumnComponents = { - sent: { - component: 'span', - props: () => {}, - event: () => {}, - }, - description: { - component: 'span', - props: () => {}, - event: () => {}, - }, - worker: { - component: QBtn, - props: () => ({ flat: true, color: 'blue', noCaps: true }), - event: () => {}, - }, - company: { - component: 'span', - props: () => {}, - event: () => {}, - }, -}; - const columns = computed(() => [ { align: 'left', - field: 'created', + name: 'created', label: t('Sent'), - name: 'sent', - format: (value) => toDateTimeFormat(value), + format: ({ created }) => toDateTimeFormat(created), }, { align: 'left', - field: (value) => value.type.description, + format: (row) => row.type.description, label: t('Description'), name: 'description', }, { align: 'left', - field: (value) => value.user.name, label: t('Worker'), name: 'worker', }, { align: 'left', - field: (value) => value.company?.code, + format: ({ company }) => company?.code ?? dashIfEmpty(company), label: t('Company'), name: 'company', }, ]); +const quasar = useQuasar(); const toCustomerSamplesCreate = () => { - router.push({ name: 'CustomerSamplesCreate' }); + quasar + .dialog({ + component: CustomerSamplesCreate, + }) + .onOk(() => tableRef.value.reload()); }; +const tableRef = ref(); - (rows = data)" + - - - - - - - - - {{ props.value }} - - - - - - - - + :columns="columns" + :pagination="{ rowsPerPage: 12 }" + :disable-option="{ card: true }" + :rows="rows" + class="full-width q-mt-md" + row-key="id" + :create="false" + :no-data-label="t('globals.noResults')" + > + + + {{ row.user?.name }} + + {{ dashIfEmpty(row.user) }} + + diff --git a/src/pages/Customer/Card/CustomerSummary.vue b/src/pages/Customer/Card/CustomerSummary.vue index da50ba239..f049426e2 100644 --- a/src/pages/Customer/Card/CustomerSummary.vue +++ b/src/pages/Customer/Card/CustomerSummary.vue @@ -1,10 +1,11 @@ @@ -91,7 +92,13 @@ const creditWarning = computed(() => { + > + + { :url="`#/customer/${entityId}/fiscal-data`" :text="t('customer.summary.fiscalData')" /> - + { :label="t('customer.summary.isActive')" :value="entity.isActive" /> - - { :label="t('customer.summary.hasToInvoice')" :value="entity.hasToInvoice" /> - - { { /> - + { { @@ -231,7 +234,6 @@ const creditWarning = computed(() => { :value="toCurrency(entity?.mana?.mana)" /> @@ -240,15 +242,14 @@ const creditWarning = computed(() => { :value="toCurrency(entity?.averageInvoiced?.invoiced)" /> { /> - @@ -301,7 +300,7 @@ const creditWarning = computed(() => { :value="entity.recommendedCredit" /> - + diff --git a/src/pages/Customer/Card/CustomerUnpaid.vue b/src/pages/Customer/Card/CustomerUnpaid.vue index 5b9a6cde2..ad00cbf59 100644 --- a/src/pages/Customer/Card/CustomerUnpaid.vue +++ b/src/pages/Customer/Card/CustomerUnpaid.vue @@ -151,7 +151,10 @@ watch( clearable type="number" v-model="amount" - /> + autofocus + > + € diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index a38f8d1a8..f6758bf4e 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -2,6 +2,7 @@ import { ref, computed, markRaw } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; +import VnSelect from 'src/components/common/VnSelect.vue'; import VnTable from 'components/VnTable/VnTable.vue'; import VnLocation from 'src/components/common/VnLocation.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue'; @@ -69,7 +70,7 @@ const columns = computed(() => [ optionFilter: 'firstName', useLike: false, }, - create: true, + create: false, columnField: { component: null, }, @@ -195,6 +196,8 @@ const columns = computed(() => [ component: 'select', attrs: { url: 'BusinessTypes', + fields: ['code', 'description'], + sortBy: 'description ASC ', optionLabel: 'description', optionValue: 'code', }, @@ -353,12 +356,13 @@ const columns = computed(() => [ { title: t('Client ticket list'), icon: 'vn:ticket', - action: redirectToCreateView, + action: redirectToTicketsList, isPrimary: true, }, { title: t('components.smartCard.viewSummary'), icon: 'preview', + isPrimary: true, action: (row) => viewSummary(row.id, CustomerSummary), }, ], @@ -366,11 +370,12 @@ const columns = computed(() => [ ]); const { viewSummary } = useSummaryDialog(); -const redirectToCreateView = (row) => { +const redirectToTicketsList = (row) => { router.push({ name: 'TicketList', + query: { - params: JSON.stringify({ + table: JSON.stringify({ clientFk: row.id, }), }, @@ -395,10 +400,10 @@ function handleLocation(data, location) { + + + + + + + + {{ scope.opt?.name }} + {{ scope.opt?.nickname }}, + {{ scope.opt?.code }} + + + + + - (agencyModes = data)" auto-load url="AgencyModes/isActive" /> - (incoterms = data)" auto-load url="Incoterms" /> + (incoterms = data)" auto-load url="Incoterms" /> - (agencyModes = data)" auto-load url="AgencyModes/isActive" /> - (incoterms = data)" auto-load url="Incoterms" /> - (incoterms = data)" auto-load url="Incoterms" /> + (customsAgents = data)" auto-load url="CustomsAgents" /> - + -import { reactive } from 'vue'; +import { reactive, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; @@ -10,10 +10,12 @@ import VnInputDate from 'src/components/common/VnInputDate.vue'; const { t } = useI18n(); const route = useRoute(); +const routeId = computed(() => route.params.id); const router = useRouter(); const initialData = reactive({ - clientFK: Number(route.params.id), + started: Date.vnNew(), + clientFk: routeId.value, }); const toCustomerCreditContracts = () => { diff --git a/src/pages/Customer/components/CustomerCreditContractsInsurance.vue b/src/pages/Customer/components/CustomerCreditContractsInsurance.vue index ce880d4b5..70f7cf046 100644 --- a/src/pages/Customer/components/CustomerCreditContractsInsurance.vue +++ b/src/pages/Customer/components/CustomerCreditContractsInsurance.vue @@ -1,47 +1,26 @@ - (rows = data)" - auto-load + - - - - - - - - {{ props.value }} - - - - - - - - - {{ t('globals.noResults') }} - + ref="tableRef" + data-key="creditInsurances" + :filter="filter" + :columns="columns" + :right-search="false" + :is-editable="false" + :use-model="true" + :column-search="false" + :disable-option="{ card: true }" + auto-load + > diff --git a/src/pages/Customer/components/CustomerFileManagementCreate.vue b/src/pages/Customer/components/CustomerFileManagementCreate.vue index 7c15e0b71..f33a47bcc 100644 --- a/src/pages/Customer/components/CustomerFileManagementCreate.vue +++ b/src/pages/Customer/components/CustomerFileManagementCreate.vue @@ -83,35 +83,35 @@ const toCustomerFileManagement = () => { - (client = data)" auto-load :url="`Clients/${route.params.id}/getCard`" /> - (findOne = data)" auto-load url="DmsTypes/findOne" /> - (allowedContentTypes = data)" auto-load url="DmsContainers/allowedContentTypes" /> - (optionsCompanies = data)" auto-load url="Companies" /> - (optionsWarehouses = data)" auto-load url="Warehouses" /> - (optionsDmsTypes = data)" auto-load diff --git a/src/pages/Customer/components/CustomerFileManagementEdit.vue b/src/pages/Customer/components/CustomerFileManagementEdit.vue index 80eaa44f9..107f41330 100644 --- a/src/pages/Customer/components/CustomerFileManagementEdit.vue +++ b/src/pages/Customer/components/CustomerFileManagementEdit.vue @@ -69,25 +69,25 @@ const toCustomerFileManagement = () => { - - + (allowedContentTypes = data)" auto-load url="DmsContainers/allowedContentTypes" /> - (optionsCompanies = data)" auto-load url="Companies" /> - (optionsWarehouses = data)" auto-load url="Warehouses" /> - (optionsDmsTypes = data)" auto-load diff --git a/src/pages/Customer/components/CustomerSamplesCreate.vue b/src/pages/Customer/components/CustomerSamplesCreate.vue index 79f4fe449..3c9eb856b 100644 --- a/src/pages/Customer/components/CustomerSamplesCreate.vue +++ b/src/pages/Customer/components/CustomerSamplesCreate.vue @@ -1,11 +1,11 @@ - - - (optionsCompanies = data)" + @on-fetch="(data) => (companies = data)" auto-load url="Companies" /> - (optionsSamplesVisible = data)" auto-load url="Samples/visible" /> - - - - - - - - - - - - + + + + + { { { required="true" v-model="initialData.from" /> - - - - - + + + es: + New sample: Crear plantilla Sample: Plantilla Recipient: Destinatario Reply to: Responder a diff --git a/src/pages/Customer/components/CustomerSummaryTable.vue b/src/pages/Customer/components/CustomerSummaryTable.vue index dc9969b61..87e4cffa7 100644 --- a/src/pages/Customer/components/CustomerSummaryTable.vue +++ b/src/pages/Customer/components/CustomerSummaryTable.vue @@ -1,22 +1,25 @@ - (rows = data)" - auto-load + :right-search="false" + :column-search="false" url="Tickets" - /> - - - - - - - - - {{ props.value }} - - - - - {{ props.value }} - - - - - {{ props.value }} - - - - - {{ toCurrency(props.value) }} - - {{ toCurrency(props.value) }} - - - - - - - - - + :columns="columns" + search-url="tickets" + :without-header="true" + auto-load + order="shipped DESC, id" + :disable-option="{ card: true, table: true }" + limit="5" + class="full-width" + > + + + {{ row.nickname }} + + + + + + + {{ row.routeFk }} + + + + + + {{ toCurrency(row.totalWithVat) }} + + {{ toCurrency(row.totalWithVat) }} + + + + + {{ row.invoiceOut.ref }} + + + + + {{ row?.ticketState?.state.name }} + + {{ row?.ticketState?.state.name }} + + + + {{ toDateFormat(row.shipped) }} + + {{ toDateFormat(row.shipped) }} + + diff --git a/src/pages/Customer/components/CustomerSummaryTableActions.vue b/src/pages/Customer/components/CustomerSummaryTableActions.vue deleted file mode 100644 index 6e9038374..000000000 --- a/src/pages/Customer/components/CustomerSummaryTableActions.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - {{ t('Go to lines') }} - - - - - {{ t('Preview') }} - - - - - - -es: - Go to lines: Ir a lineas - Preview: Vista previa - diff --git a/src/pages/Customer/locale/en.yml b/src/pages/Customer/locale/en.yml index 6eb7cfa85..545c3f274 100644 --- a/src/pages/Customer/locale/en.yml +++ b/src/pages/Customer/locale/en.yml @@ -2,3 +2,135 @@ customerFilter: filter: name: Name socialName: Social name +customer: + list: + phone: Phone + email: Email + customerOrders: Display customer orders + moreOptions: More options + card: + customerList: Customer list + customerId: Claim ID + salesPerson: Sales person + credit: Credit + risk: Risk + securedCredit: Secured credit + payMethod: Pay method + debt: Debt + isFrozen: Customer frozen + hasDebt: Customer has debt + isDisabled: Customer inactive + notChecked: Customer no checked + webAccountInactive: Web account inactive + noWebAccess: Web access is disabled + businessType: Business type + passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n' + businessTypeFk: Business type + summary: + basicData: Basic data + fiscalAddress: Fiscal address + fiscalData: Fiscal data + billingData: Billing data + consignee: Default consignee + businessData: Business data + financialData: Financial data + customerId: Customer ID + name: Name + contact: Contact + phone: Phone + mobile: Mobile + email: Email + salesPerson: Sales person + contactChannel: Contact channel + socialName: Social name + fiscalId: Fiscal ID + postcode: Postcode + province: Province + country: Country + street: Address + isEqualizated: Is equalizated + isActive: Is active + invoiceByAddress: Invoice by address + verifiedData: Verified data + hasToInvoice: Has to invoice + notifyByEmail: Notify by email + vies: VIES + payMethod: Pay method + bankAccount: Bank account + dueDay: Due day + hasLcr: Has LCR + hasCoreVnl: Has core VNL + hasB2BVnl: Has B2B VNL + addressName: Address name + addressCity: City + addressStreet: Street + username: Username + webAccess: Web access + totalGreuge: Total greuge + mana: Mana + priceIncreasingRate: Price increasing rate + averageInvoiced: Average invoiced + claimRate: Claming rate + payMethodFk: Billing data + risk: Risk + maximumRisk: Solunion's maximum risk + riskInfo: Invoices minus payments plus orders not yet invoiced + credit: Credit + creditInfo: Company's maximum risk + securedCredit: Secured credit + securedCreditInfo: Solunion's maximum risk + balance: Balance + balanceInfo: Invoices minus payments + balanceDue: Balance due + balanceDueInfo: Deviated invoices minus payments + recoverySince: Recovery since + businessType: Business Type + city: City + descriptorInfo: Invoices minus payments plus orders not yet + rating: Rating + recommendCredit: Recommended credit + goToLines: Go to lines + basicData: + socialName: Fiscal name + businessType: Business type + contact: Contact + youCanSaveMultipleEmails: You can save multiple emails + email: Email + phone: Phone + mobile: Mobile + salesPerson: Sales person + contactChannel: Contact channel + previousClient: Previous client + extendedList: + tableVisibleColumns: + id: Identifier + name: Name + socialName: Social name + fi: Tax number + salesPersonFk: Salesperson + credit: Credit + creditInsurance: Credit insurance + phone: Phone + mobile: Mobile + street: Street + countryFk: Country + provinceFk: Province + city: City + postcode: Postcode + email: Email + created: Created + businessTypeFk: Business type + payMethodFk: Billing data + sageTaxTypeFk: Sage tax type + sageTransactionTypeFk: Sage tr. type + isActive: Active + isVies: Vies + isTaxDataChecked: Verified data + isEqualizated: Is equalizated + isFreezed: Freezed + hasToInvoice: Invoice + hasToInvoiceByAddress: Invoice by address + isToBeMailed: Mailing + hasLcr: Received LCR + hasCoreVnl: VNL core received + hasSepaVnl: VNL B2B received diff --git a/src/pages/Customer/locale/es.yml b/src/pages/Customer/locale/es.yml index 111696f21..4fcbe3fa2 100644 --- a/src/pages/Customer/locale/es.yml +++ b/src/pages/Customer/locale/es.yml @@ -4,3 +4,134 @@ customerFilter: filter: name: Nombre socialName: Razón Social +customer: + list: + phone: Teléfono + email: Email + customerOrders: Mostrar órdenes del cliente + moreOptions: Más opciones + card: + customerId: ID cliente + salesPerson: Comercial + credit: Crédito + risk: Riesgo + securedCredit: Crédito asegurado + payMethod: Método de pago + debt: Riesgo + isFrozen: Cliente congelado + hasDebt: Cliente con riesgo + isDisabled: Cliente inactivo + notChecked: Cliente no comprobado + webAccountInactive: Sin acceso web + noWebAccess: El acceso web está desactivado + businessType: Tipo de negocio + passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)' + businessTypeFk: Tipo de negocio + summary: + basicData: Datos básicos + fiscalAddress: Dirección fiscal + fiscalData: Datos fiscales + billingData: Datos de facturación + consignee: Consignatario pred. + businessData: Datos comerciales + financialData: Datos financieros + customerId: ID cliente + name: Nombre + contact: Contacto + phone: Teléfono + mobile: Móvil + email: Email + salesPerson: Comercial + contactChannel: Canal de contacto + socialName: Razón social + fiscalId: NIF/CIF + postcode: Código postal + province: Provincia + country: País + street: Calle + isEqualizated: Recargo de equivalencia + isActive: Activo + invoiceByAddress: Facturar por consignatario + verifiedData: Datos verificados + hasToInvoice: Facturar + notifyByEmail: Notificar por email + vies: VIES + payMethod: Método de pago + bankAccount: Cuenta bancaria + dueDay: Día de pago + hasLcr: Recibido LCR + hasCoreVnl: Recibido core VNL + hasB2BVnl: Recibido B2B VNL + addressName: Nombre de la dirección + addressCity: Ciudad + addressStreet: Calle + username: Usuario + webAccess: Acceso web + totalGreuge: Greuge total + mana: Maná + priceIncreasingRate: Ratio de incremento de precio + averageInvoiced: Facturación media + claimRate: Ratio de reclamaciones + maximumRisk: Riesgo máximo asumido por Solunion + payMethodFk: Forma de pago + risk: Riesgo + riskInfo: Facturas menos recibos mas pedidos sin facturar + credit: Crédito + creditInfo: Riesgo máximo asumido por la empresa + securedCredit: Crédito asegurado + securedCreditInfo: Riesgo máximo asumido por Solunion + balance: Balance + balanceInfo: Facturas menos recibos + balanceDue: Saldo vencido + balanceDueInfo: Facturas fuera de plazo menos recibos + recoverySince: Recobro desde + businessType: Tipo de negocio + city: Población + descriptorInfo: Facturas menos recibos mas pedidos sin facturar + rating: Clasificación + recommendCredit: Crédito recomendado + goToLines: Ir a líneas + basicData: + socialName: Nombre fiscal + businessType: Tipo de negocio + contact: Contacto + youCanSaveMultipleEmails: Puede guardar varios correos electrónicos encadenándolos mediante comas sin espacios{','} ejemplo{':'} user{'@'}dominio{'.'}com, user2{'@'}dominio{'.'}com siendo el primer correo electrónico el principal + email: Email + phone: Teléfono + mobile: Móvil + salesPerson: Comercial + contactChannel: Canal de contacto + previousClient: Cliente anterior + extendedList: + tableVisibleColumns: + id: Identificador + name: Nombre + socialName: Razón social + fi: NIF / CIF + salesPersonFk: Comercial + credit: Crédito + creditInsurance: Crédito asegurado + phone: Teléfono + mobile: Móvil + street: Dirección fiscal + countryFk: País + provinceFk: Provincia + city: Población + postcode: Código postal + email: Email + created: Fecha creación + businessTypeFk: Tipo de negocio + payMethodFk: Forma de pago + sageTaxTypeFk: Tipo de impuesto Sage + sageTransactionTypeFk: Tipo tr. sage + isActive: Activo + isVies: Vies + isTaxDataChecked: Datos comprobados + isEqualizated: Recargo de equivalencias + isFreezed: Congelado + hasToInvoice: Factura + hasToInvoiceByAddress: Factura por consigna + isToBeMailed: Env. emails + hasLcr: Recibido LCR + hasCoreVnl: Recibido core VNL + hasSepaVnl: Recibido B2B VNL diff --git a/src/pages/Dashboard/DashboardMain.vue b/src/pages/Dashboard/DashboardMain.vue index a339120e2..56054156a 100644 --- a/src/pages/Dashboard/DashboardMain.vue +++ b/src/pages/Dashboard/DashboardMain.vue @@ -60,7 +60,7 @@ const pinnedModules = computed(() => navigation.getPinnedModules()); {{ 'Ctrl + Alt + ' + - item.keyBinding.toUpperCase() + item?.keyBinding?.toUpperCase() }} diff --git a/src/pages/Department/Card/DepartmentBasicData.vue b/src/pages/Department/Card/DepartmentBasicData.vue index 4573f7b66..98abfd6b9 100644 --- a/src/pages/Department/Card/DepartmentBasicData.vue +++ b/src/pages/Department/Card/DepartmentBasicData.vue @@ -16,12 +16,12 @@ const workersOptions = ref([]); const clientsOptions = ref([]); - (workersOptions = data)" auto-load /> - (clientsOptions = data)" auto-load /> + (clientsOptions = data)" auto-load /> +import { useRoute, useRouter } from 'vue-router'; +import { onMounted, ref } from 'vue'; +import { useI18n } from 'vue-i18n'; +import axios from 'axios'; +import { useState } from 'composables/useState'; +import FormModelPopup from 'components/FormModelPopup.vue'; +import VnRow from 'components/ui/VnRow.vue'; +import VnSelect from 'components/common/VnSelect.vue'; +import VnInputDate from 'components/common/VnInputDate.vue'; +import { useDialogPluginComponent } from 'quasar'; +import { reactive } from 'vue'; +import FetchData from 'components/FetchData.vue'; + +const { t } = useI18n(); +const route = useRoute(); +const state = useState(); +const ORDER_MODEL = 'order'; + +const router = useRouter(); +const clientList = ref([]); +const agencyList = ref([]); +const addressList = ref([]); +defineEmits(['confirm', ...useDialogPluginComponent.emits]); + +const fetchAddressList = async (addressId) => { + try { + const { data } = await axios.get('addresses', { + params: { + filter: JSON.stringify({ + fields: ['id', 'nickname', 'street', 'city'], + where: { id: addressId }, + }), + }, + }); + addressList.value = data; + if (addressList.value?.length === 1) { + state.get(ORDER_MODEL).addressId = addressList.value[0].id; + } + } catch (err) { + console.error(`Error fetching addresses`, err); + return err.response; + } +}; + +const fetchAgencyList = async (landed, addressFk) => { + if (!landed || !addressFk) { + return; + } + try { + const { data } = await axios.get('Agencies/landsThatDay', { + params: { + addressFk, + landed: new Date(landed).toISOString(), + }, + }); + agencyList.value = data; + } catch (err) { + console.error(`Error fetching agencies`, err); + return err.response; + } +}; + +// const fetchOrderDetails = (order) => { +// fetchAddressList(order?.addressFk); +// fetchAgencyList(order?.landed, order?.addressFk); +// }; +const $props = defineProps({ + clientFk: { + type: Number, + default: null, + }, +}); +const initialFormState = reactive({ + active: true, + addressId: null, + clientFk: $props.clientFk, +}); +// const orderMapper = (order) => { +// return { +// addressId: order.addressFk, +// agencyModeId: order.agencyModeFk, +// landed: new Date(order.landed).toISOString(), +// }; +// }; +// const orderFilter = { +// include: [ +// { relation: 'agencyMode', scope: { fields: ['name'] } }, +// { +// relation: 'address', +// scope: { fields: ['nickname'] }, +// }, +// { relation: 'rows', scope: { fields: ['id'] } }, +// { +// relation: 'client', +// scope: { +// fields: [ +// 'salesPersonFk', +// 'name', +// 'isActive', +// 'isFreezed', +// 'isTaxDataChecked', +// ], +// include: { +// relation: 'salesPersonUser', +// scope: { fields: ['id', 'name'] }, +// }, +// }, +// }, +// ], +// }; + +const onClientChange = async (clientId = $props.clientFk) => { + try { + const { data } = await axios.get(`Clients/${clientId}`); + await fetchAddressList(data.defaultAddressFk); + } catch (error) { + console.error('Error al cambiar el cliente:', error); + } +}; + +async function onDataSaved(_, id) { + await router.push({ path: `/order/${id}/catalog` }); +} +onMounted(async () => { + await onClientChange(); +}); + + + + (clientOptions = data)" + :filter="{ fields: ['id', 'name', 'defaultAddressFk'], order: 'id' }" + auto-load + /> + + + + + + + + + {{ `${scope.opt.id}: ${scope.opt.name}` }} + + + + + + + + + + + {{ + `${scope.opt.nickname}: ${scope.opt.street},${scope.opt.city}` + }} + + + + + + + + fetchAgencyList(data.landed, data.addressId) + " + /> + + + + + + + + + + + es: + No default address found for the client: No hay ninguna dirección asociada a este cliente. + diff --git a/src/pages/Ticket/Card/TicketCard.vue b/src/pages/Ticket/Card/TicketCard.vue index cf15cb7fa..73b6f5543 100644 --- a/src/pages/Ticket/Card/TicketCard.vue +++ b/src/pages/Ticket/Card/TicketCard.vue @@ -1,17 +1,11 @@ routeName.value); :descriptor="TicketDescriptor" search-data-key="TicketList" :searchbar-props="{ - customRouteRedirectName, + url: 'Tickets/filter', label: t('card.search'), info: t('card.searchInfo'), }" diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index 2a4a5e3c3..7f499f7b7 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -182,8 +182,9 @@ function toTicketUrl(section) { :value="entity.warehouse?.name" /> [ sortable: true, columnFilter: null, }, + { + label: t('advanceTickets.preparation'), + name: 'preparation', + field: 'preparation', + align: 'left', + sortable: true, + columnFilter: null, + }, { label: t('advanceTickets.liters'), name: 'liters', @@ -624,6 +632,7 @@ onMounted(async () => { + diff --git a/src/pages/Ticket/TicketCreateDialog.vue b/src/pages/Ticket/TicketCreateDialog.vue new file mode 100644 index 000000000..1493adc53 --- /dev/null +++ b/src/pages/Ticket/TicketCreateDialog.vue @@ -0,0 +1,226 @@ + + + + (clientOptions = data)" + :filter="{ fields: ['id', 'name', 'defaultAddressFk'], order: 'id' }" + auto-load + /> + (warehousesOptions = data)" + order="name" + auto-load + /> + + + + + + onClientSelected(data)" + > + + + + + {{ scope.opt.name }} + + + {{ `#${scope.opt.id}` }} + + + + + + + + + + fetchAvailableAgencies(data)" + > + + + + + {{ scope.opt.nickname }} + + + {{ `${scope.opt.street}, ${scope.opt.city}` }} + + + + + + + + + + fetchAvailableAgencies(data)" + /> + + + + + fetchAvailableAgencies(data)" + /> + + + + + + + + + + diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index 1f2687500..be348b8e1 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -1,6 +1,7 @@