@@ -44,7 +45,7 @@ const val = computed(() => $props.value);
-
+
{{ dash ? dashIfEmpty(value) : value }}
diff --git a/src/components/ui/VnMoreOptions.vue b/src/components/ui/VnMoreOptions.vue
index 8a1c7a0f2..984e2b64f 100644
--- a/src/components/ui/VnMoreOptions.vue
+++ b/src/components/ui/VnMoreOptions.vue
@@ -12,7 +12,7 @@
{{ $t('components.cardDescriptor.moreOptions') }}
-
+
diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue
index 6ce28254d..b7e6ccbec 100644
--- a/src/components/ui/VnNotes.vue
+++ b/src/components/ui/VnNotes.vue
@@ -40,6 +40,11 @@ const quasar = useQuasar();
const newNote = reactive({ text: null, observationTypeFk: null });
const observationTypes = ref([]);
const vnPaginateRef = ref();
+
+const defaultObservationType = computed(() =>
+ observationTypes.value.find(ot => ot.code === 'salesPerson')?.id
+);
+
let originalText;
function handleClick(e) {
@@ -111,14 +116,22 @@ function fetchData([data]) {
originalText = data?.notes;
emit('onFetch', data);
}
+
+const handleObservationTypes = (data) => {
+ observationTypes.value = data;
+ if(defaultObservationType.value) {
+ newNote.observationTypeFk = defaultObservationType.value;
+ }
+};
+
(observationTypes = data)"
+ @on-fetch="handleObservationTypes"
/>
diff --git a/src/components/ui/VnToSummary.vue b/src/components/ui/VnToSummary.vue
index 305d65e02..853d26230 100644
--- a/src/components/ui/VnToSummary.vue
+++ b/src/components/ui/VnToSummary.vue
@@ -26,6 +26,7 @@ const id = props.entityId;
:to="{ name: routeName, params: { id: id } }"
class="header link"
:href="url"
+ data-cy="goToSummaryBtn"
>
diff --git a/src/composables/__tests__/downloadFile.spec.js b/src/composables/__tests__/downloadFile.spec.js
index f53b56b3e..f83a973b0 100644
--- a/src/composables/__tests__/downloadFile.spec.js
+++ b/src/composables/__tests__/downloadFile.spec.js
@@ -6,10 +6,12 @@ const session = useSession();
const token = session.getToken();
describe('downloadFile', () => {
- const baseUrl = 'http://localhost:9000';
let defaulCreateObjectURL;
beforeAll(() => {
+ vi.mock('src/composables/getUrl', () => ({
+ getUrl: vi.fn().mockResolvedValue(''),
+ }));
defaulCreateObjectURL = window.URL.createObjectURL;
window.URL.createObjectURL = vi.fn(() => 'blob:http://localhost:9000/blob-id');
});
@@ -22,15 +24,14 @@ describe('downloadFile', () => {
headers: { 'content-disposition': 'attachment; filename="test-file.txt"' },
};
vi.spyOn(axios, 'get').mockImplementation((url) => {
- if (url == 'Urls/getUrl') return Promise.resolve({ data: baseUrl });
- else if (url.includes('downloadFile')) return Promise.resolve(res);
+ if (url.includes('downloadFile')) return Promise.resolve(res);
});
await downloadFile(1);
expect(axios.get).toHaveBeenCalledWith(
- `${baseUrl}/api/dms/1/downloadFile?access_token=${token}`,
- { responseType: 'blob' }
+ `/api/dms/1/downloadFile?access_token=${token}`,
+ { responseType: 'blob' },
);
});
});
diff --git a/src/composables/downloadFile.js b/src/composables/downloadFile.js
index 4588265a2..0c4e8edb6 100644
--- a/src/composables/downloadFile.js
+++ b/src/composables/downloadFile.js
@@ -7,18 +7,33 @@ const { getTokenMultimedia } = useSession();
const token = getTokenMultimedia();
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
- const appUrl = (await getUrl('', 'lilium')).replace('/#/', '');
+ const appUrl = await getAppUrl();
const response = await axios.get(
url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`,
- { responseType: 'blob' }
+ { responseType: 'blob' },
);
+ download(response);
+}
+
+export async function downloadDocuware(url, params) {
+ const appUrl = await getAppUrl();
+ const response = await axios.get(`${appUrl}/api/` + url, {
+ responseType: 'blob',
+ params,
+ });
+
+ download(response);
+}
+
+function download(response) {
const contentDisposition = response.headers['content-disposition'];
const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(contentDisposition);
- const filename =
- matches != null && matches[1]
- ? matches[1].replace(/['"]/g, '')
- : 'downloaded-file';
+ const filename = matches?.[1] ? matches[1].replace(/['"]/g, '') : 'downloaded-file';
exportFile(filename, response.data);
}
+
+async function getAppUrl() {
+ return (await getUrl('', 'lilium')).replace('/#/', '');
+}
diff --git a/src/css/app.scss b/src/css/app.scss
index 5befd150b..b299973d1 100644
--- a/src/css/app.scss
+++ b/src/css/app.scss
@@ -325,7 +325,6 @@ input::-webkit-inner-spin-button {
min-height: auto !important;
display: flex;
align-items: flex-end;
- padding-bottom: 2px;
.q-field__native.row {
min-height: auto !important;
}
diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml
index 7738b60b2..9d9cd2887 100644
--- a/src/i18n/locale/en.yml
+++ b/src/i18n/locale/en.yml
@@ -100,7 +100,6 @@ globals:
file: File
selectFile: Select a file
copyClipboard: Copy on clipboard
- salesPerson: SalesPerson
send: Send
code: Code
since: Since
@@ -160,6 +159,7 @@ globals:
changeState: Change state
raid: 'Raid {daysInForward} days'
isVies: Vies
+ department: Department
noData: No data available
vehicle: Vehicle
pageTitles:
@@ -349,7 +349,6 @@ globals:
params:
description: Description
clientFk: Client id
- salesPersonFk: Sales person
warehouseFk: Warehouse
provinceFk: Province
stateFk: State
@@ -607,7 +606,6 @@ worker:
balance: Balance
medical: Medical
list:
- department: Department
schedule: Schedule
newWorker: New worker
summary:
@@ -650,6 +648,7 @@ worker:
model: Model
serialNumber: Serial number
removePDA: Deallocate PDA
+ sendToTablet: Send to tablet
create:
lastName: Last name
birth: Birth
@@ -820,6 +819,7 @@ travel:
search: Search travel
searchInfo: You can search by travel id or name
id: Id
+ awbFk: AWB
travelList:
tableVisibleColumns:
ref: Reference
@@ -866,7 +866,6 @@ components:
mine: For me
hasMinPrice: Minimum price
# LatestBuysFilter
- salesPersonFk: Buyer
supplierFk: Supplier
from: From
to: To
@@ -887,7 +886,7 @@ components:
openCard: View
openSummary: Summary
viewSummary: Summary
- cardDescriptor:
+ vnDescriptor:
mainList: Main list
summary: Summary
moreOptions: More options
@@ -897,6 +896,8 @@ components:
VnLv:
copyText: '{copyValue} has been copied to the clipboard'
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789'
+ VnNotes:
+ clientWithoutPhone: 'The following clients do not have a phone number and the message will not be sent to them: {clientWithoutPhone}'
weekdays:
sun: Sunday
mon: Monday
diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml
index f89571a39..00b577cf1 100644
--- a/src/i18n/locale/es.yml
+++ b/src/i18n/locale/es.yml
@@ -104,7 +104,6 @@ globals:
file: Fichero
selectFile: Seleccione un fichero
copyClipboard: Copiar en portapapeles
- salesPerson: Comercial
send: Enviar
code: Código
since: Desde
@@ -165,6 +164,7 @@ globals:
raid: 'Redada {daysInForward} días'
isVies: Vies
noData: Datos no disponibles
+ department: Departamento
vehicle: Vehículo
pageTitles:
logIn: Inicio de sesión
@@ -352,7 +352,6 @@ globals:
params:
description: Descripción
clientFk: Id cliente
- salesPersonFk: Comercial
warehouseFk: Almacén
provinceFk: Provincia
stateFk: Estado
@@ -534,7 +533,6 @@ ticket:
state: Estado
shipped: Enviado
landed: Entregado
- salesPerson: Comercial
total: Total
card:
customerId: ID cliente
@@ -626,8 +624,6 @@ invoiceOut:
errors:
downloadCsvFailed: Error al descargar CSV
order:
- field:
- salesPersonFk: Comercial
form:
clientFk: Cliente
addressFk: Dirección
@@ -695,7 +691,6 @@ worker:
formation: Formación
medical: Mutua
list:
- department: Departamento
schedule: Horario
newWorker: Nuevo trabajador
summary:
@@ -738,6 +733,7 @@ worker:
model: Modelo
serialNumber: Número de serie
removePDA: Desasignar PDA
+ sendToTablet: Enviar a la tablet
create:
lastName: Apellido
birth: Fecha de nacimiento
@@ -906,6 +902,7 @@ travel:
search: Buscar envío
searchInfo: Buscar envío por id o nombre
id: Id
+ awbFk: Guía aérea
travelList:
tableVisibleColumns:
ref: Referencia
@@ -953,7 +950,6 @@ components:
hasMinPrice: Precio mínimo
wareHouseFk: Almacén
# LatestBuysFilter
- salesPersonFk: Comprador
supplierFk: Proveedor
visible: Visible
active: Activo
@@ -974,7 +970,7 @@ components:
openCard: Ficha
openSummary: Detalles
viewSummary: Vista previa
- cardDescriptor:
+ vnDescriptor:
mainList: Listado principal
summary: Resumen
moreOptions: Más opciones
@@ -984,6 +980,8 @@ components:
VnLv:
copyText: '{copyValue} se ha copiado al portapepeles'
iban_tooltip: 'IBAN: ES21 1234 5678 90 0123456789'
+ VnNotes:
+ clientWithoutPhone: 'Estos clientes no tienen asociado número de télefono y el sms no les será enviado: {clientWithoutPhone}'
weekdays:
sun: Domingo
mon: Lunes
diff --git a/src/pages/Account/AccountFilter.vue b/src/pages/Account/AccountFilter.vue
index 50c3ee1ac..732e92f77 100644
--- a/src/pages/Account/AccountFilter.vue
+++ b/src/pages/Account/AccountFilter.vue
@@ -47,7 +47,7 @@ const rolesOptions = ref([]);
:label="t('globals.name')"
v-model="params.name"
lazy-rules
- is-outlined
+ filled
/>
@@ -57,7 +57,7 @@ const rolesOptions = ref([]);
:label="t('account.card.alias')"
v-model="params.nickname"
lazy-rules
- is-outlined
+ filled
/>
@@ -75,8 +75,7 @@ const rolesOptions = ref([]);
use-input
hide-selected
dense
- outlined
- rounded
+ filled
:input-debounce="0"
/>
diff --git a/src/pages/Account/Acls/AclFilter.vue b/src/pages/Account/Acls/AclFilter.vue
index 8035f92b8..222fe5b77 100644
--- a/src/pages/Account/Acls/AclFilter.vue
+++ b/src/pages/Account/Acls/AclFilter.vue
@@ -56,8 +56,7 @@ onBeforeMount(() => {
option-label="name"
use-input
dense
- outlined
- rounded
+ filled
/>
@@ -72,8 +71,7 @@ onBeforeMount(() => {
option-label="name"
use-input
dense
- outlined
- rounded
+ filled
/>
@@ -83,7 +81,7 @@ onBeforeMount(() => {
:label="t('acls.aclFilter.property')"
v-model="params.property"
lazy-rules
- is-outlined
+ filled
/>
@@ -98,8 +96,7 @@ onBeforeMount(() => {
option-label="name"
use-input
dense
- outlined
- rounded
+ filled
/>
@@ -114,8 +111,7 @@ onBeforeMount(() => {
option-label="name"
use-input
dense
- outlined
- rounded
+ filled
/>
diff --git a/src/pages/Account/Alias/Card/AliasDescriptor.vue b/src/pages/Account/Alias/Card/AliasDescriptor.vue
index 671ef7fbc..957047cc3 100644
--- a/src/pages/Account/Alias/Card/AliasDescriptor.vue
+++ b/src/pages/Account/Alias/Card/AliasDescriptor.vue
@@ -4,7 +4,7 @@ import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
-import CardDescriptor from 'components/ui/CardDescriptor.vue';
+import EntityDescriptor from 'components/ui/EntityDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import axios from 'axios';
@@ -48,11 +48,12 @@ const removeAlias = () => {
-
@@ -62,7 +63,7 @@ const removeAlias = () => {
-
+
diff --git a/src/pages/Account/Card/AccountDescriptor.vue b/src/pages/Account/Card/AccountDescriptor.vue
index 49328fe87..eb0a9013c 100644
--- a/src/pages/Account/Card/AccountDescriptor.vue
+++ b/src/pages/Account/Card/AccountDescriptor.vue
@@ -1,7 +1,7 @@
- {
-
+
-
-
-es:
- Comercial name: Nombre comercial
- Salesperson: Comercial
- Business type: Tipo de negocio
- Tax number: NIF / CIF
- Business name: Razón social
- Street: Dirección fiscal
- Postcode: Código postal
- City: Población
- Province: Provincia
- Country: País
- Web user: Usuario web
- Email: Email
- Is equalizated: Recargo de equivalencia
-
diff --git a/src/pages/Customer/CustomerFilter.vue b/src/pages/Customer/CustomerFilter.vue
index 1c5a08304..55a7f565e 100644
--- a/src/pages/Customer/CustomerFilter.vue
+++ b/src/pages/Customer/CustomerFilter.vue
@@ -3,7 +3,6 @@ import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
-import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
defineProps({
@@ -42,7 +41,7 @@ const exprBuilder = (param, value) => {
-
+
@@ -51,7 +50,7 @@ const exprBuilder = (param, value) => {
-
+
@@ -59,28 +58,20 @@ const exprBuilder = (param, value) => {
-
@@ -97,8 +88,7 @@ const exprBuilder = (param, value) => {
map-options
hide-selected
dense
- outlined
- rounded
+ filled
auto-load
:input-debounce="0"
/>
@@ -106,12 +96,12 @@ const exprBuilder = (param, value) => {
-
+
-
+
@@ -120,7 +110,7 @@ const exprBuilder = (param, value) => {
-
+
@@ -140,19 +130,14 @@ const exprBuilder = (param, value) => {
map-options
hide-selected
dense
- outlined
- rounded
+ filled
auto-load
sortBy="name ASC"
/>
-
+
@@ -164,7 +149,6 @@ en:
params:
search: Contains
fi: FI
- salesPersonFk: Salesperson
provinceFk: Province
isActive: Is active
city: City
@@ -191,7 +175,6 @@ es:
sageTaxTypeFk: Tipo de impuesto Sage
sageTransactionTypeFk: Tipo de impuesto Sage
payMethodFk: Forma de pago
- salesPersonFk: Comercial
provinceFk: Provincia
city: Ciudad
phone: Teléfono
@@ -201,7 +184,6 @@ es:
name: Nombre
postcode: CP
FI: NIF
- Salesperson: Comercial
Province: Provincia
City: Ciudad
Phone: Teléfono
diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue
index 0bfca7910..b721a6ad9 100644
--- a/src/pages/Customer/CustomerList.vue
+++ b/src/pages/Customer/CustomerList.vue
@@ -10,7 +10,6 @@ import CustomerFilter from './CustomerFilter.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import VnLocation from 'src/components/common/VnLocation.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
-import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
import VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n();
@@ -73,30 +72,17 @@ const columns = computed(() => [
},
{
align: 'left',
- name: 'salesPersonFk',
- label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'),
+ name: 'departmentFk',
+ label: t('customer.summary.team'),
component: 'select',
attrs: {
- url: 'Workers/activeWithInheritedRole',
- fields: ['id', 'name', 'firstName'],
- where: { role: 'salesPerson' },
- optionFilter: 'firstName',
+ url: 'Departments',
},
- columnFilter: {
- component: 'select',
- attrs: {
- url: 'Workers/activeWithInheritedRole',
- fields: ['id', 'name', 'firstName'],
- where: { role: 'salesPerson' },
- optionLabel: 'firstName',
- optionValue: 'id',
- },
- },
- create: false,
+ create: true,
columnField: {
component: null,
},
- format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson),
+ format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
},
{
align: 'left',
@@ -155,6 +141,9 @@ const columns = computed(() => [
inWhere: true,
},
columnClass: 'expand',
+ attrs: {
+ uppercase: true,
+ },
},
{
align: 'left',
@@ -446,36 +435,6 @@ function handleLocation(data, location) {
redirect="customer"
>
-
-
-
-
-
-
-
- {{ scope.opt?.name }}
- {{ scope.opt?.nickname }},
- {{ scope.opt?.code }}
-
-
-
-
[
},
},
},
- {
- align: 'left',
- name: 'isWorker',
- label: t('Is worker'),
- },
- {
- align: 'left',
- name: 'salesPersonFk',
- label: t('Salesperson'),
- columnFilter: {
- component: 'select',
- attrs: {
- url: 'Workers/activeWithInheritedRole',
- fields: ['id', 'name'],
- where: { role: 'salesPerson' },
- useLike: false,
- optionValue: 'id',
- optionLabel: 'name',
- optionFilter: 'firstName',
- },
- },
- },
{
align: 'left',
name: 'departmentFk',
@@ -153,6 +131,11 @@ const columns = computed(() => [
label: t('Has recovery'),
name: 'hasRecovery',
},
+ {
+ align: 'left',
+ name: 'isWorker',
+ label: t('customer.params.isWorker'),
+ },
]);
const viewAddObservation = (rowsSelected) => {
@@ -167,7 +150,6 @@ const viewAddObservation = (rowsSelected) => {
function exprBuilder(param, value) {
switch (param) {
- case 'salesPersonFk':
case 'creditInsurance':
case 'countryFk':
return { [`c.${param}`]: value };
@@ -176,7 +158,7 @@ function exprBuilder(param, value) {
case 'workerFk':
return { [`co.${param}`]: value };
case 'departmentFk':
- return { [`wd.${param}`]: value };
+ return { [`c.${param}`]: value };
case 'amount':
case 'clientFk':
return { [`d.${param}`]: value };
@@ -241,12 +223,6 @@ function exprBuilder(param, value) {
-
-
- {{ row.salesPersonName }}
-
-
-
{{ row.departmentName }}
@@ -265,8 +241,6 @@ function exprBuilder(param, value) {
es:
Add observation: Añadir observación
Client: Cliente
- Is worker: Es trabajador
- Salesperson: Comercial
Department: Departamento
Country: País
P. Method: F. Pago
@@ -281,5 +255,5 @@ es:
Credit I.: Crédito A.
Credit insurance: Crédito asegurado
From: Desde
- Has recovery: Tiene recobro
+ Has recovery: Recobro
diff --git a/src/pages/Customer/Defaulter/CustomerDefaulterFilter.vue b/src/pages/Customer/Defaulter/CustomerDefaulterFilter.vue
index ce86c6435..64e3baeb5 100644
--- a/src/pages/Customer/Defaulter/CustomerDefaulterFilter.vue
+++ b/src/pages/Customer/Defaulter/CustomerDefaulterFilter.vue
@@ -15,19 +15,12 @@ const props = defineProps({
},
});
-const salespersons = ref();
const countries = ref();
const authors = ref();
const departments = ref();
- (salespersons = data)"
- auto-load
- url="Workers/activeWithInheritedRole"
- />
(countries = data)" auto-load url="Countries" />
(authors = data)"
@@ -52,8 +45,7 @@ const departments = ref();
dense
option-label="name"
option-value="id"
- outlined
- rounded
+ filled
emit-value
hide-selected
map-options
@@ -62,29 +54,6 @@ const departments = ref();
@update:model-value="searchFn()"
/>
-
-
-
-
-
-
-
-
@@ -149,7 +116,7 @@ const departments = ref();
@@ -167,8 +134,7 @@ const departments = ref();
map-options
option-label="name"
option-value="id"
- outlined
- rounded
+ filled
use-input
v-model="params.workerFk"
@update:model-value="searchFn()"
@@ -184,7 +150,7 @@ const departments = ref();
@@ -195,7 +161,7 @@ const departments = ref();
@@ -205,7 +171,7 @@ const departments = ref();
@@ -219,7 +185,6 @@ const departments = ref();
en:
params:
clientFk: Client
- salesPersonFk: Salesperson
countryFk: Country
paymentMethod: P. Method
balance: Balance D.
@@ -230,7 +195,6 @@ en:
es:
params:
clientFk: Cliente
- salesPersonFk: Comercial
countryFk: País
paymentMethod: F. Pago
balance: Saldo V.
@@ -239,7 +203,6 @@ es:
credit: Crédito A.
defaulterSinced: Desde
Client: Cliente
- Salesperson: Comercial
Departments: Departamentos
Country: País
P. Method: F. Pago
diff --git a/src/pages/Customer/Notifications/CustomerNotifications.vue b/src/pages/Customer/Notifications/CustomerNotifications.vue
index ce18739b4..b30ed6f76 100644
--- a/src/pages/Customer/Notifications/CustomerNotifications.vue
+++ b/src/pages/Customer/Notifications/CustomerNotifications.vue
@@ -69,17 +69,16 @@ const columns = computed(() => [
},
{
align: 'left',
- label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'),
- name: 'salesPersonFk',
+ name: 'departmentFk',
+ label: t('customer.summary.team'),
component: 'select',
attrs: {
- url: 'Workers/activeWithInheritedRole',
- fields: ['id', 'name'],
- where: { role: 'salesPerson' },
- optionFilter: 'firstName',
- useLike: false,
+ url: 'Departments',
},
- visible: false,
+ columnField: {
+ component: null,
+ },
+ format: (row, dashIfEmpty) => dashIfEmpty(row.departmentName),
},
]);
@@ -96,7 +95,7 @@ const columns = computed(() => [
-
+
@@ -34,11 +34,7 @@ const props = defineProps({
-
+
@@ -47,19 +43,15 @@ const props = defineProps({
-
+
-
+
-
+
diff --git a/src/pages/Customer/locale/en.yml b/src/pages/Customer/locale/en.yml
index b6d495335..6724a5a7b 100644
--- a/src/pages/Customer/locale/en.yml
+++ b/src/pages/Customer/locale/en.yml
@@ -20,7 +20,7 @@ customer:
name: Name
contact: Contact
mobile: Mobile
- salesPerson: Sales person
+ team: Team
contactChannel: Contact channel
socialName: Social name
fiscalId: Fiscal ID
@@ -78,7 +78,6 @@ customer:
id: Identifier
socialName: Social name
fi: Tax number
- salesPersonFk: Salesperson
creditInsurance: Credit insurance
phone: Phone
street: Street
diff --git a/src/pages/Customer/locale/es.yml b/src/pages/Customer/locale/es.yml
index f50d049da..4a266e07a 100644
--- a/src/pages/Customer/locale/es.yml
+++ b/src/pages/Customer/locale/es.yml
@@ -20,7 +20,7 @@ customer:
name: Nombre
contact: Contacto
mobile: Móvil
- salesPerson: Comercial
+ team: Equipo
contactChannel: Canal de contacto
socialName: Razón social
fiscalId: NIF/CIF
@@ -78,7 +78,6 @@ customer:
id: Identificador
socialName: Razón social
fi: NIF / CIF
- salesPersonFk: Comercial
creditInsurance: Crédito asegurado
phone: Teléfono
street: Dirección fiscal
diff --git a/src/pages/Entry/Card/EntryBasicData.vue b/src/pages/Entry/Card/EntryBasicData.vue
index 6462ed24a..f6d15a977 100644
--- a/src/pages/Entry/Card/EntryBasicData.vue
+++ b/src/pages/Entry/Card/EntryBasicData.vue
@@ -13,6 +13,9 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import VnSelectTravelExtended from 'src/components/common/VnSelectTravelExtended.vue';
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
+import VnCheckbox from 'src/components/common/VnCheckbox.vue';
+import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
+import VnDmsInput from 'src/components/common/VnDmsInput.vue';
const route = useRoute();
const { t } = useI18n();
@@ -23,6 +26,7 @@ const user = state.getUser().fn();
const companiesOptions = ref([]);
const currenciesOptions = ref([]);
+const entryRef = ref({});
onMounted(() => {
checkEntryLock(route.params.id, user.id);
@@ -47,13 +51,14 @@ onMounted(() => {
auto-load
/>
-
+
{
:required="true"
/>
-
-
-
+
+
-
+
{
:options="companiesOptions"
option-value="id"
option-label="code"
+ sort-by="code"
map-options
hide-selected
:required="true"
/>
-
+
{
:options="currenciesOptions"
option-value="id"
option-label="code"
+ sort-by="code"
/>
-
+
{
name="finalTemperature"
:label="t('entry.basicData.finalTemperature')"
:step="0.5"
- :decimal-places="2"
:positive="false"
/>
-
-
+
+
+
+
+
+ {
fill-input
/>
-
-
-
-
+
-
+
+ {
@@ -294,7 +267,7 @@ const columns = [
align: 'center',
label: t('Amount'),
name: 'amount',
- width: '45px',
+ width: '75px',
component: 'number',
attrs: {
positive: false,
@@ -310,7 +283,9 @@ const columns = [
toolTip: t('Package'),
name: 'price2',
component: 'number',
- createDisable: true,
+ createAttrs: {
+ disable: true,
+ },
width: '35px',
create: true,
format: (row) => parseFloat(row['price2']).toFixed(2),
@@ -320,7 +295,9 @@ const columns = [
label: t('Box'),
name: 'price3',
component: 'number',
- createDisable: true,
+ createAttrs: {
+ disable: true,
+ },
cellEvent: {
'update:modelValue': async (value, oldValue, row) => {
row['price2'] = row['price2'] * (value / oldValue);
@@ -340,13 +317,6 @@ const columns = [
toggleIndeterminate: false,
},
component: 'checkbox',
- cellEvent: {
- 'update:modelValue': async (value, oldValue, row) => {
- await axios.patch(`Items/${row['itemFk']}`, {
- hasMinPrice: value,
- });
- },
- },
width: '25px',
},
{
@@ -356,13 +326,6 @@ const columns = [
toolTip: t('Minimum price'),
name: 'minPrice',
component: 'number',
- cellEvent: {
- 'update:modelValue': async (value, oldValue, row) => {
- await axios.patch(`Items/${row['itemFk']}`, {
- minPrice: value,
- });
- },
- },
width: '35px',
style: (row) => {
if (!row?.hasMinPrice) return { color: 'var(--vn-label-color)' };
@@ -425,6 +388,23 @@ const columns = [
},
},
];
+const buyerFk = ref(null);
+const itemTypeFk = ref(null);
+const inkFk = ref(null);
+const tag1 = ref(null);
+const tag2 = ref(null);
+const tag1Filter = ref(null);
+const tag2Filter = ref(null);
+const filter = computed(() => {
+ const where = {};
+ where.workerFk = buyerFk.value;
+ where.itemTypeFk = itemTypeFk.value;
+ where.inkFk = inkFk.value;
+ where.tag1 = tag1.value;
+ where.tag2 = tag2.value;
+
+ return { where };
+});
function getQuantityStyle(row) {
if (row?.quantity !== row?.stickers * row?.packing)
@@ -521,6 +501,23 @@ async function setBuyUltimate(itemFk, data) {
});
}
+async function transferBuys(rows, newEntry) {
+ if (!newEntry) return;
+
+ const promises = rows.map((row) => {
+ return axios.patch('Buys', { id: row.id, entryFk: newEntry });
+ });
+
+ await Promise.all(promises);
+
+ await axios.post(`Entries/${newEntry}/recalcEntryPrices`);
+ await axios.post(`Entries/${entityId.value}/recalcEntryPrices`);
+
+ entryBuysRef.value.reload();
+ newEntryRef.value = null;
+ dialogRef.value = false;
+}
+
onMounted(() => {
stateStore.rightDrawer = false;
if ($props.editableMode) checkEntryLock(entityId.value, user.id);
@@ -595,6 +592,47 @@ onMounted(() => {
+
+
+
+
+ {{ t('Transfer buys') }}
+
+
+
+
+
+
+
+
+
+
+
+
{
:url="`Entries/${entityId}/getBuyList`"
search-url="EntryBuys"
save-url="Buys/crud"
+ :filter="editableMode ? filter : {}"
:disable-option="{ card: true }"
v-model:selected="selectedRows"
@on-fetch="() => footerFetchDataRef.fetch()"
@@ -643,7 +682,7 @@ onMounted(() => {
},
columnGridStyle: {
'max-width': '50%',
- 'margin-right': '30px',
+ 'margin-right': '5%',
flex: 1,
},
previousStyle: {
@@ -655,7 +694,7 @@ onMounted(() => {
:is-editable="editableMode"
:without-header="!editableMode"
:with-filters="editableMode"
- :right-search="editableMode"
+ :right-search="false"
:row-click="false"
:columns="columns"
:beforeSaveFn="beforeSave"
@@ -666,6 +705,47 @@ onMounted(() => {
data-cy="entry-buys"
overlay
>
+
+
+
+
+
+
+
+
+
@@ -696,7 +776,7 @@ onMounted(() => {