Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6564-enhanceTicketAdvance

This commit is contained in:
Jorge Penadés 2025-03-25 17:38:11 +01:00
commit 7b1e126966
51 changed files with 1299 additions and 742 deletions

View File

@ -1,3 +1,214 @@
# Version 25.12 - 2025-03-25
### Added 🆕
- chore: add junit-merge dependency to package.json by:alexm
- chore: downgrade version from 25.14.0 to 25.12.0 in package.json by:alexm
- chore: reduce page load timeout in Cypress configuration by:alexm
- chore: refs #6695 update Cypress to version 14.1.0 and simplify test execution in Jenkinsfile by:alexm
- chore: refs #8602 add comments for clarity in Cypress commands file by:pablone
- chore: refs #8602 enhance Cypress support files with detailed comments and organization by:pablone
- ci: refs #6695 feat jenkins parallel e2e by:alexm
- feat: integrate vue-router to enhance routing capabilities in ZoneCard component by:alexm
- feat: refs #6695 implement parallel Cypress testing and enhance timeout configurations by:alexm
- feat: refs #6695 update Cypress parallel test execution to use 3 instances by:alexm
- feat: refs #6802 add dash placeholder for empty department names in InvoiceOut list by:jgallego
- feat: refs #6802 add DepartmentDescriptorProxy to InvoiceOutList and update translations by:jgallego
- feat: refs #6802 add DepartmentDescriptorProxy to various components and update department handling by:jgallego
- feat: refs #7587 add 'ticketClaimed' translation and implement claims retrieval in TicketDescriptor by:jtubau
- feat: refs #7949 show new field in ticket sales by:Jon
- feat: refs #8045 added new logic to show the correct icon and the correct path to redirect by:Jon
- feat: refs #8045 modified icon and route to redirect from CardDescriptor by:Jon
- feat: refs #8074 modified spinner size by:Jon
- feat: refs #8600 added calendar e2e and modified basic data by:Jon
- feat: refs #8600 added deliveryDays and modified warehouse E2Es by:Jon
- feat: refs #8600 added new tests for zoneSummary & zoneLocations by:provira
- feat: refs #8602 add custom Cypress commands for improved element interaction and request handling by:pablone
- feat: refs #8602 add new Cypress command for clicking buttons with icons by:pablone
- feat: refs #8602 add remove functionality for tag filters in EntryBuys component by:pablone
- feat: refs #8602 add sorting options for select fields and update locale files with supplier name by:pablone
- feat: refs #8602 refactor EntryBuys component and enhance observation tests by:pablone
- feat: refs #8602 remove unused state property from useArrayDataStore by:pablone
- feat: refs #8602 remove unused URL property from VnTable in ClaimList component by:pablone
- feat: refs #8602 skip warehouse creation and removal test in ZoneWarehouse spec by:pablone
- feat: refs #8602 streamline beforeSaveFn execution in CrudModel component by:pablone
- feat: refs #8602 streamline beforeSaveFn execution in VnTable component by:pablone
- feat: refs #8602 streamline filter logic in EntryBuys component by:pablone
- feat: refs #8602 update entry components and tests, add data-cy attributes for Cypress integration by:pablone
- feat: refs #8602 update localization for purchased spaces and enhance Entry components with new labels by:pablone
- feat: refs #8606 adapt module to VnCatdBeta by:Jon
- feat: refs #8612 added summary button & changed e2e tests by:provira
- feat: refs #8612 changed shelving to VnTable & created e2e tests by:provira
- feat: refs #8616 add summary prop to CardDescriptor in RoadmapDescriptor and WorkerDescriptor by:jtubau
- feat: refs #8616 add VnCheckbox component to VnFilter and update prop types in VnFilterPanel and VnSearchbar by:jtubau
- feat: refs #8630 add Agency and Vehicle descriptor components with summary props by:jtubau
- feat: refs #8638 add AWB field to travel and entry forms, update translations and styles by:pablone
- feat: refs #8638 add data attributes for transfer buys functionality in EntryBuys.vue and corresponding tests by:pablone
- feat: refs #8648 enhance roadmapList tests with improved selectors and additional scenarios by:jtubau
- feat: refs #8664 add CmrFilter component and integrate it into CmrList for enhanced filtering options by:jtubau
- feat: refs #8721 add ticket navigation and update route columns by:jtubau
- feat: run.sh build neccessary images by:alexm
- feat: update Jenkinsfile to pull Docker images for back and db services by:alexm
- feat: update labels and add department selection in InvoiceOut filter and list by:jgallego
- refactor: refs #8626 update button styles and improve route redirection logic by:jtubau
- style: refs #8041 new variable by:benjaminedc
### Changed 📦
- feat: refs #8602 refactor EntryBuys component and enhance observation tests by:pablone
- refactor(cypress): refs #6695 simplify parallel test execution script by:alexm
- refactor: deleted useless (origin/Warmfix-DepartmentIcon) by:Jon
- refactor: refs #6695 enable ClaimNotes test suite by:alexm
- refactor: refs #6695 fix invoiceOutSummary by:alexm
- refactor: refs #6695 improve notification check and extend waitForElement timeout by:alexm
- refactor: refs #6695 remove mocha dependency and optimize Cypress command execution by:alexm
- refactor: refs #6695 skips by:alexm
- refactor: refs #6695 skip zoneWarehouse by:alexm
- refactor: refs #6695 streamline Cypress test execution and remove deprecated configurations by:alexm
- refactor: refs #6802 replace salesPerson references with department in claims and tickets by:jgallego
- refactor: refs #6802 replace 'salesPerson' terminology with 'team' across multiple locales and components by:jgallego
- refactor: refs #6802 update import paths for DepartmentDescriptorProxy to use Worker directory by:jgallego
- refactor: refs #6802 update InvoiceOutNegativeBases to use Department instead of Worker by:jgallego
- refactor: refs #6802 update TicketFilter and TicketSale components to use departmentFk and adjust API endpoints by:jgallego
- refactor: refs #8041 unify class link and unify titles to VnTitles by:benjaminedc
- refactor: refs #8045 modified icon and module const by:Jon
- refactor: refs #8197 rename VnCardBeta to VnCard by:alexm
- refactor: refs #8197 simplify menu retrieval logic in LeftMenu component by:alexm
- refactor: refs #8322 changed Wagon component to use VnSection/VnCardBeta by:provira
- refactor: refs #8322 remove keyBinding from Wagon router module by:alexm
- refactor: refs #8322 update WagonCard component and routing structure by:alexm
- refactor: refs #8370 modified function to get the correct date by:Jon
- refactor: refs #8472 remove added div and add class to VnInput by:jtubau
- refactor: refs #8472 unified styling for the more-create-dialog slot to ensure consistency across all scenarios by:jtubau
- refactor: refs #8472 update class names from q-span-2 to col-span-2 for consistency in layout by:jtubau
- refactor: refs #8600 changed test case description by:provira
- refactor: refs #8600 modified make invoice and send dialog e2es by:Jon
- refactor: refs #8600 modified upcomingDeliveries e2e and created deliveryDays by:Jon
- refactor: refs #8600 modified zoneSummary e2e by:Jon
- refactor: refs #8602 remove redundant date input test from entryList.spec.js by:pablone
- refactor: refs #8606 clear some warnings by:Jon
- refactor: refs #8606 deleted code and fixed translation by:Jon
- refactor: refs #8606 merged previous and e2e changes and corrected minor errors by:Jon
- refactor: refs #8606 requested changes by:Jon
- refactor: refs #8616 integrate summary dialog and update navigation in Agency and Vehicle components by:jtubau
- refactor: refs #8616 integrate VnSelectWorker component in RouteList and optimize format functions by:jtubau
- refactor: refs #8616 simplify template bindings and improve link generation in VehicleSummary by:jtubau
- refactor: refs #8616 update routing components for AgencyList and RouteRoadmap in route.js by:jtubau
- refactor: refs #8619 simplify empty data check in RouteDescriptor component by:jtubau
- refactor: refs #8626 add cardVisible property to RouteList columns by:jtubau
- refactor: refs #8626 add formatting for agency and vehicle columns in RouteList by:jtubau
- refactor: refs #8626 enhance Worker and Agency components with data attributes and improved routing by:jtubau
- refactor: refs #8626 improve test messages and selectors in route tests by:jtubau
- refactor: refs #8626 update button styles and improve route redirection logic by:jtubau
- refactor: refs #8626 update RouteList columns and enable AgencyWorkCenter tests by:jtubau
- refactor: refs #8630 add vehicle translations and enhance route list columns by:jtubau
- refactor: refs #8648 update roadmap deletion test to use current element text by:jtubau
- refactor: refs #8664 enhance CmrList component with query initialization and user parameters by:jtubau
- refactor: refs #8664 localization files by:jtubau
- refactor: refs #8664 remove CmrFilter and replace with VnSearchbar in CmrList by:jtubau
- refactor: remove unnecessary login and reload calls in ClaimDevelopment tests by:alexm
- refactor: simplify client selection in order creation test by:alexm
- refactor: update client ID input selector and remove viewport setting by:alexm
- test: refs #8197 comment out ticket list tests for refactoring by:alexm
- test: refs #8626 refactor notification check in routeList.spec.js by:jtubau
- test: refs #8626 refactor routeList.spec.js to use a constant for summary URL by:jtubau
- test: refs #8626 refactor routeList.spec.js to use selectors and improve readability by:jtubau
### Fixed 🛠️
- fix: add --init flag to Docker container for Cypress tests by:alexm
- fix: agency list filters by:jtubau
- fix: align Article label to the left in EntryBuys component by:alexm
- fix: card descriptor imports by:Jon
- fix: card descriptor merge by:Jon
- fix(ClaimAction): update shelving options to use URL instead of static data by:jgallego
- fix(ClaimSummary): clean url by:alexm
- fix(cypress.config.js): refs #6695 update reporter to junit and remove unused dependencies by:alexm
- fix(cypressParallel.sh): refs #6695 improve script readability by:alexm
- fix(cypressParallel.sh): refs #6695 improve test execution output for clarity by:alexm
- fix(cypressParallel.sh): refs #6695 simplify test execution output format by:alexm
- fix(cypress scripts): refs #6695 improve cleanup process and adjust output redirection by:alexm
- fix: fixed department descriptor icon by:Jon
- fix: fixed submodule descriptors icons by:Jon
- fix(invoiceOutSummary.spec.js): refs #6695 remove unnecessary visibility check for descriptor by:alexm
- fix(Jenkinsfile): reduce parallel Cypress test execution from 3 to 2 by:alexm
- fix(Jenkinsfile): refs #6695 add credentials for Docker login in E2E stage by:alexm
- fix(Jenkinsfile): refs #6695 change parallel test execution from 4 to 2 by:alexm
- fix(Jenkinsfile): refs #6695 increase parallel test execution from 2 to 4 by:alexm
- fix(Jenkinsfile): refs #6695 update parallel test execution to 4 by:alexm
- fix(LeftMenu): refs #8197 handle missing children in findRoute and update menu structure by:alexm
- fix: refs #6695 update Cypress configuration and test result paths by:alexm
- fix: refs #6695 update Jenkinsfile to build Docker image correctly and modify logout test visit method by:alexm
- fix: refs #6695 update Jenkinsfile to remove specific e2e XML files and adjust Cypress parallel execution by:alexm
- fix: refs #6695 update Jenkinsfile to source cypressParallel.sh correctly by:alexm
- fix: refs #6695 update visit method in TicketLackDetail.spec.js to prevent page reload by:alexm
- fix: refs #6802 update import path for DepartmentDescriptorProxy in OrderList.vue by:jgallego
- fix: refs #6802 update OrderFilter to use department relation instead of salesPerson by:jgallego
- fix: refs #8041 update redirection from preview to summary in ShelvingList tests by:benjaminedc
- fix: refs #8041 update selector for summary header in ParkingList tests by:benjaminedc
- fix: refs #8041 update summaryHeader selector in ParkingList test by:benjaminedc
- fix: refs #8322 update order property for WagonList component by:alexm
- fix: refs #8370 change param rely on month by:Jon
- fix: refs #8417 added data-cy to all files and fixed test by:provira
- fix: refs #8417 added data-cy to delete button by:provira
- fix: refs #8417 fixed claimPhoto e2e by:provira
- fix: refs #8417 fixed claimPhoto e2e test by:provira
- fix: refs #8417 fixed e2e test by:provira
- fix: refs #8417 fixed e2e test case by:provira
- fix: refs #8417 fixed failing test case by:provira
- fix: refs #8417 fixed invoiceOutSummary e2e test by:provira
- fix: refs #8417 removed .only by:provira
- fix: refs #8583 basicData, business, summary by:carlossa
- fix: refs #8583 basicData e2e by:carlossa
- fix: refs #8583 basicData timeControl by:carlossa
- fix: refs #8583 cypressconf by:carlossa
- fix: refs #8583 dataCy operator by:carlossa
- fix: refs #8583 fix AddCard by:carlossa
- fix: refs #8583 mutual create by:carlossa
- fix: refs #8583 operator by:carlossa
- fix: refs #8583 remove workerTimeControl by:carlossa
- fix: refs #8583 tMutual, tNotes, TOperator by:carlossa
- fix: refs #8583 wBusiness by:carlossa
- fix: refs #8583 wBusiness e2e by:carlossa
- fix: refs #8583 workerBasicData & workerTimeControl by:carlossa
- fix: refs #8583 workerBusiness by:carlossa
- fix: refs #8583 workerBusiness e2e by:carlossa
- fix: refs #8583 workerBusiness test by:carlossa
- fix: refs #8583 workerE2E by:carlossa
- fix: refs #8583 worker mutual e2e by:carlossa
- fix: refs #8583 workerSummary test by:carlossa
- fix: refs #8583 workerTimeControl by:carlossa
- fix: refs #8583 workerTimeControl e2e by:carlossa
- fix: refs #8600 e2e by:Jon
- fix: refs #8600 fixed calendar e2e by:Jon
- fix: refs #8600 fixed e2e and skip client ones by:Jon
- fix: refs #8600 fixed e2e by:Jon
- fix: refs #8600 fixed invoiceOut summary e2e by:Jon
- fix: refs #8600 fixed zoneList & added test case to zoneSummary by:provira
- fix: refs #8600 zone basic data e2e and skip intermitent invoice out summary it by:Jon
- fix: refs #8602 delete unused entryDms and stockBought test files (origin/8581-e2eInvoiceIn) by:pablone
- fix: refs #8606 deleted code by:Jon
- fix: refs #8612 changed QCheckbox for VnCheckbox by:provira
- fix: refs #8612 fixed shelving e2e tests by:provira
- fix: refs #8616 add conditional for SupplierDescriptorProxy and bind attributes in CardDescriptor by:jtubau
- fix: refs #8616 remove redundant v-on binding from QCheckbox in VnCheckbox.vue by:jtubau
- fix: refs #8616 update binding syntax for is-editable prop in AgencyList.vue by:jtubau
- fix: refs #8616 update FormModel prop from 'update-url' to 'url-update' in Agency and RoadMap BasicData by:jtubau
- fix: refs #8619 handle empty ticket records in RouteDescriptor component by:jtubau
- fix: refs #8619 update route descriptor to handle empty ticket records and adjust test cases by:jtubau
- fix: refs #8626 remove duplicate ref attribute from RouteList.vue by:jtubau
- fix: refs #8630 remove duplicated locations by:jtubau
- fix: refs #8638 restore invoiceInBasicData by:pablone
- fix: refs #8638 update comment formatting in VnTable.vue by:pablone
- fix: refs #8638 update null check for maxlength validation in VnInput.vue by:pablone
- fix: simplify menu structure in monitor router module (origin/fix_monitor_leftMenu) by:Javier Segarra
- refactor: refs #6695 fix invoiceOutSummary by:alexm
- refactor: refs #8606 deleted code and fixed translation by:Jon
- test: fix intermitent e2e by:alexm
- test: fix orderList e2e, unestables by:alexm
- test(OrderList): fix inconsistency by:alexm
- test(TicketList): fix inconsistency by:alexm
# Version 25.10 - 2025-03-11
### Added 🆕

View File

@ -49,3 +49,9 @@ pnpm run test:e2e:summary
```bash
quasar build
```
### Serve the app for production
```bash
quasar build quasar serve dist/spa --host 0.0.0.0 --proxy=./proxy-serve.js
```

View File

@ -897,7 +897,7 @@ const rowCtrlClickFunction = computed(() => {
{{ row[splittedColumns.title.name] }}
</span>
</QCardSection>
<!-- Fields -->
<!-- Fields -->
<QCardSection
class="q-pl-sm q-py-xs"
:class="$props.cardClass"
@ -1156,7 +1156,7 @@ es:
.grid-create {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
max-width: 100%;
grid-gap: 20px;
margin: 0 auto;

View File

@ -0,0 +1,166 @@
<script setup>
import VnConfirm from '../ui/VnConfirm.vue';
import VnInput from './VnInput.vue';
import VnDms from './VnDms.vue';
import axios from 'axios';
import { useQuasar } from 'quasar';
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { downloadFile } from 'src/composables/downloadFile';
const { t } = useI18n();
const quasar = useQuasar();
const documentDialogRef = ref({});
const editDownloadDisabled = ref(false);
const $props = defineProps({
defaultDmsCode: {
type: String,
default: 'InvoiceIn',
},
disable: {
type: Boolean,
default: true,
},
data: {
type: Object,
default: null,
},
formRef: {
type: Object,
default: null,
},
});
function deleteFile(dmsFk) {
quasar
.dialog({
component: VnConfirm,
componentProps: {
title: t('globals.confirmDeletion'),
message: t('globals.confirmDeletionMessage'),
},
})
.onOk(async () => {
await axios.post(`dms/${dmsFk}/removeFile`);
$props.formRef.formData.dmsFk = null;
$props.formRef.formData.dms = undefined;
$props.formRef.hasChanges = true;
$props.formRef.save();
});
}
</script>
<template>
<div class="row no-wrap">
<VnInput
:label="t('Document')"
v-model="data.dmsFk"
clearable
clear-icon="close"
class="full-width"
:disable="disable"
/>
<div
v-if="data.dmsFk"
class="row no-wrap q-pa-xs q-gutter-x-xs"
data-cy="dms-buttons"
>
<QBtn
:disable="editDownloadDisabled"
@click="downloadFile(data.dmsFk)"
icon="cloud_download"
color="primary"
flat
:class="{
'no-pointer-events': editDownloadDisabled,
}"
padding="xs"
round
>
<QTooltip>{{ t('Download file') }}</QTooltip>
</QBtn>
<QBtn
:disable="editDownloadDisabled"
@click="
() => {
documentDialogRef.show = true;
documentDialogRef.dms = data.dms;
}
"
icon="edit"
color="primary"
flat
:class="{
'no-pointer-events': editDownloadDisabled,
}"
padding="xs"
round
>
<QTooltip>{{ t('Edit document') }}</QTooltip>
</QBtn>
<QBtn
:disable="editDownloadDisabled"
@click="deleteFile(data.dmsFk)"
icon="delete"
color="primary"
flat
round
:class="{
'no-pointer-events': editDownloadDisabled,
}"
padding="xs"
>
<QTooltip>{{ t('Delete file') }}</QTooltip>
</QBtn>
</div>
<QBtn
v-else
icon="add_circle"
color="primary"
flat
round
v-shortcut="'+'"
padding="xs"
@click="
() => {
documentDialogRef.show = true;
delete documentDialogRef.dms;
}
"
data-cy="dms-create"
>
<QTooltip>{{ t('Create document') }}</QTooltip>
</QBtn>
</div>
<QDialog v-model="documentDialogRef.show">
<VnDms
model="dms"
:default-dms-code="defaultDmsCode"
:form-initial-data="documentDialogRef.dms"
:url="
documentDialogRef.dms
? `Dms/${documentDialogRef.dms.id}/updateFile`
: 'Dms/uploadFile'
"
:description="documentDialogRef.supplierName"
@on-data-saved="
(_, { data }) => {
let dmsData = data;
if (Array.isArray(data)) dmsData = data[0];
formRef.formData.dmsFk = dmsData.id;
formRef.formData.dms = dmsData;
formRef.hasChanges = true;
formRef.save();
}
"
/>
</QDialog>
</template>
<i18n>
es:
Document: Documento
Download file: Descargar archivo
Edit document: Editar documento
Delete file: Eliminar archivo
Create document: Crear documento
</i18n>

View File

@ -84,7 +84,7 @@ const mixinRules = [
...($attrs.rules ?? []),
(val) => {
const maxlength = $props.maxlength;
if (maxlength && +val.length > maxlength)
if (maxlength && +val?.length > maxlength)
return t(`maxLength`, { value: maxlength });
const { min, max } = vnInputRef.value.$attrs;
if (!min) return null;

View File

@ -152,6 +152,10 @@ const value = computed({
},
});
const computedSortBy = computed(() => {
return $props.sortBy || $props.optionLabel + ' ASC';
});
watch(options, (newValue) => {
setOptions(newValue);
});
@ -186,7 +190,7 @@ function findKeyInOptions() {
}
function setOptions(data) {
data = dataByOrder(data, $props.sortBy);
data = dataByOrder(data, computedSortBy.value);
myOptions.value = JSON.parse(JSON.stringify(data));
myOptionsOriginal.value = JSON.parse(JSON.stringify(data));
emit('update:options', data);
@ -216,7 +220,8 @@ function filter(val, options) {
async function fetchFilter(val) {
if (!$props.url) return;
const { fields, include, sortBy, limit } = $props;
const { fields, include, limit } = $props;
const sortBy = computedSortBy.value;
const key =
optionFilterValue.value ??
(new RegExp(/\d/g).test(val)

View File

@ -201,6 +201,29 @@ async function fetch() {
}
}
}
.vn-card-group {
display: flex;
flex-direction: column;
}
.vn-card-content {
display: flex;
flex-direction: column;
text-overflow: ellipsis;
> div {
max-height: 70px;
}
}
@media (min-width: 1010px) {
.vn-card-group {
flex-direction: row;
}
.vn-card-content {
flex: 1;
}
}
</style>
<style lang="scss" scoped>
.summaryHeader .vn-label-value {

View File

@ -35,6 +35,7 @@ const val = computed(() => $props.value);
:label="label"
disable
dense
size="sm"
/>
<template v-else>
<div v-if="label || $slots.label" class="label">
@ -44,7 +45,7 @@ const val = computed(() => $props.value);
</div>
<div class="value">
<slot name="value">
<span :title="value">
<span :title="value" style="text-overflow: ellipsis">
{{ dash ? dashIfEmpty(value) : value }}
</span>
</slot>

View File

@ -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;
}
};
</script>
<template>
<FetchData
v-if="selectType"
url="ObservationTypes"
:filter="{ fields: ['id', 'description'] }"
:filter="{ fields: ['id', 'description', 'code'] }"
auto-load
@on-fetch="(data) => (observationTypes = data)"
@on-fetch="handleObservationTypes"
/>
<FetchData
v-if="justInput"
@ -154,6 +167,7 @@ function fetchData([data]) {
filled
size="lg"
autogrow
autofocus
@keyup.enter.stop="handleClick"
:required="isRequired"
clearable
@ -189,7 +203,6 @@ function fetchData([data]) {
:search-url="false"
@on-fetch="
newNote.text = '';
newNote.observationTypeFk = null;
"
>
<template #body="{ rows }">

View File

@ -5,18 +5,19 @@ import { exportFile } from 'quasar';
const { getTokenMultimedia } = useSession();
const token = getTokenMultimedia();
const appUrl = (await getUrl('', 'lilium')).replace('/#/', '');
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
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,
@ -32,3 +33,7 @@ function download(response) {
exportFile(filename, response.data);
}
async function getAppUrl() {
return (await getUrl('', 'lilium')).replace('/#/', '');
}

View File

@ -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;
}

View File

@ -817,6 +817,7 @@ travel:
search: Search travel
searchInfo: You can search by travel id or name
id: Id
awbFk: AWB
travelList:
tableVisibleColumns:
ref: Reference

View File

@ -900,6 +900,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

View File

@ -18,7 +18,7 @@ const entityId = computed(() => $props.id || route.params.id);
data-key="Account"
ref="AccountSummary"
url="VnUsers/preview"
:filter="filter"
:filter="{ ...filter, where: { id: entityId } }"
>
<template #header="{ entity }">{{ entity.id }} - {{ entity.nickname }}</template>
<template #menu>

View File

@ -2,6 +2,7 @@
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { getDifferences, getUpdatedValues } from 'src/filters';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
import FetchData from 'components/FetchData.vue';
@ -9,12 +10,18 @@ import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnAvatar from 'src/components/ui/VnAvatar.vue';
const route = useRoute();
const { t } = useI18n();
const workersOptions = ref([]);
function onBeforeSave(formData, originalData) {
return getUpdatedValues(
Object.keys(getDifferences(formData, originalData)),
formData,
);
}
</script>
<template>
<FetchData
@ -27,6 +34,7 @@ const workersOptions = ref([]);
<FormModel
model="Claim"
:url-update="`Claims/updateClaim/${route.params.id}`"
:mapper="onBeforeSave"
auto-load
>
<template #form="{ data, validate }">

View File

@ -105,15 +105,6 @@ const debtWarning = computed(() => {
>
<QTooltip>{{ t('customer.card.isDisabled') }}</QTooltip>
</QIcon>
<QIcon
v-if="entity?.substitutionAllowed"
name="help"
size="xs"
color="primary"
>
<QTooltip>{{ t('Allowed substitution') }}</QTooltip>
</QIcon>
<QIcon
v-if="!entity.account?.active"
color="primary"

View File

@ -61,16 +61,6 @@ const openCreateForm = (type) => {
.join('&');
useOpenURL(`/#/${type}/list?${params}`);
};
const updateSubstitutionAllowed = async () => {
try {
await axios.patch(`Clients/${route.params.id}`, {
substitutionAllowed: !$props.customer.substitutionAllowed,
});
notify('globals.notificationSent', 'positive');
} catch (error) {
notify(error.message, 'positive');
}
};
</script>
<template>
@ -79,13 +69,6 @@ const updateSubstitutionAllowed = async () => {
{{ t('globals.pageTitles.createTicket') }}
</QItemSection>
</QItem>
<QItem v-ripple clickable>
<QItemSection @click="updateSubstitutionAllowed()">{{
$props.customer.substitutionAllowed
? t('Disable substitution')
: t('Allow substitution')
}}</QItemSection>
</QItem>
<QItem v-ripple clickable>
<QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection>
</QItem>

View File

@ -14,6 +14,8 @@ 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();
@ -24,6 +26,7 @@ const user = state.getUser().fn();
const companiesOptions = ref([]);
const currenciesOptions = ref([]);
const entryRef = ref({});
onMounted(() => {
checkEntryLock(route.params.id, user.id);
@ -48,10 +51,11 @@ onMounted(() => {
auto-load
/>
<FormModel
:url-update="`Entries/${route.params.id}`"
ref="entryRef"
model="Entry"
auto-load
:url-update="`Entries/${route.params.id}`"
:clear-store-on-unmount="false"
auto-load
>
<template #form="{ data }">
<VnRow class="q-py-sm">
@ -67,11 +71,18 @@ onMounted(() => {
/>
</VnRow>
<VnRow class="q-py-sm">
<VnInput v-model="data.reference" :label="t('globals.reference')" />
<VnInputNumber
v-model="data.invoiceAmount"
:label="t('entry.summary.invoiceAmount')"
:positive="false"
<VnInput
v-model="data.reference"
:label="t('entry.list.tableVisibleColumns.reference')"
/>
<VnSelect
v-model="data.typeFk"
url="entryTypes"
:fields="['code', 'description']"
option-value="code"
optionLabel="description"
sortBy="description"
:label="t('entry.list.tableVisibleColumns.entryTypeDescription')"
/>
</VnRow>
<VnRow class="q-py-sm">
@ -113,7 +124,6 @@ onMounted(() => {
name="initialTemperature"
:label="t('entry.basicData.initialTemperature')"
:step="0.5"
:decimal-places="2"
:positive="false"
/>
<VnInputNumber
@ -121,20 +131,21 @@ onMounted(() => {
name="finalTemperature"
:label="t('entry.basicData.finalTemperature')"
:step="0.5"
:decimal-places="2"
:positive="false"
/>
<VnSelect
v-model="data.typeFk"
url="entryTypes"
:fields="['code', 'description']"
option-value="code"
optionLabel="description"
sortBy="description"
/>
</VnRow>
<VnRow class="q-py-sm">
<QInput
<VnInputNumber
v-model="data.invoiceAmount"
:label="t('entry.list.tableVisibleColumns.invoiceAmount')"
:positive="false"
@update:model-value="data.buyerFk = user.id"
/>
<VnSelectWorker v-model="data.buyerFk" hide-selected />
<VnDmsInput :data="data" :formRef="entryRef" :disable="false" />
</VnRow>
<VnRow class="q-py-sm">
<VnInputNumber
:label="t('entry.basicData.observation')"
type="textarea"
v-model="data.observation"

View File

@ -18,6 +18,7 @@ import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
import { checkEntryLock } from 'src/composables/checkEntryLock';
import VnRow from 'src/components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
const $props = defineProps({
id: {
@ -44,6 +45,8 @@ const entityId = ref($props.id ?? route.params.id);
const entryBuysRef = ref();
const footerFetchDataRef = ref();
const footer = ref({});
const dialogRef = ref(false);
const newEntryRef = ref(null);
const columns = [
{
align: 'center',
@ -250,6 +253,7 @@ const columns = [
component: 'number',
attrs: {
positive: false,
decimalPlaces: 3,
},
cellEvent: {
'update:modelValue': async (value, oldValue, row) => {
@ -497,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);
@ -571,6 +592,47 @@ onMounted(() => {
</QItem>
</QList>
</QBtnDropdown>
<QBtn
icon="move_group"
color="primary"
:title="t('Transfer buys')"
data-cy="transferBuys"
flat
@click="dialogRef = true"
:disable="!selectedRows.length"
/>
<QDialog v-model="dialogRef">
<QCard>
<QCardSection>
<span>{{ t('Transfer buys') }}</span>
</QCardSection>
<QCardSection>
<VnInputNumber
v-model="newEntryRef"
:label="t('Entry')"
type="number"
data-cy="entryDestinyInput"
/>
</QCardSection>
<QCardSection>
<QCardActions>
<QBtn
label="Cancel"
flat
color="primary"
@click="dialogRef = false"
/>
<QBtn
label="Transfer"
data-cy="transferBuysBtn"
flat
color="primary"
@click="transferBuys(selectedRows, newEntryRef)"
/>
</QCardActions>
</QCardSection>
</QCard>
</QDialog>
</QBtnGroup>
</Teleport>
<FetchData
@ -620,7 +682,7 @@ onMounted(() => {
},
columnGridStyle: {
'max-width': '50%',
'margin-right': '30px',
'margin-right': '5%',
flex: 1,
},
previousStyle: {
@ -652,6 +714,7 @@ onMounted(() => {
:fields="['id', 'nickname']"
option-label="nickname"
sort-by="nickname ASC"
:use-like="false"
/>
<VnSelect
:label="t('Family')"
@ -816,6 +879,8 @@ es:
Create buy: Crear compra
Invert quantity value: Invertir valor de cantidad
Check buy amount: Marcar como correcta la cantidad de compra
Transfer buys: Transferir compras
Entry: Entrada
</i18n>
<style lang="scss" scoped>
.centered-container {

View File

@ -92,7 +92,7 @@ const getEntryRedirectionFilter = (entry) => {
};
function showEntryReport() {
openReport(`Entries/${entityId.value}/entry-order-pdf`);
openReport(`Entries/${entityId.value}/entry-order-pdf`, {}, true);
}
function showNotification(type, message) {
@ -147,7 +147,7 @@ async function deleteEntry() {
<template>
<EntityDescriptor
:url="`Entries/${entityId}`"
:filter="entryFilter"
:user-filter="entryFilter"
title="supplier.nickname"
data-key="Entry"
width="lg-width"

View File

@ -84,7 +84,10 @@ onMounted(async () => {
:label="t('globals.company')"
:value="entry?.company?.code"
/>
<VnLv :label="t('globals.reference')" :value="entry?.reference" />
<VnLv
:label="t('entry.list.tableVisibleColumns.reference')"
:value="entry?.reference"
/>
<VnLv
:label="t('entry.summary.invoiceNumber')"
:value="entry?.invoiceNumber"
@ -159,6 +162,7 @@ onMounted(async () => {
/>
</div>
<div class="card-content">
<VnLv :label="t('travel.awbFk')" :value="entry.travel.awbFk" />
<VnCheckbox
:label="t('entry.summary.travelDelivered')"
v-model="entry.travel.isDelivered"

View File

@ -162,8 +162,8 @@ async function beforeSave(data, getChanges) {
}
await Promise.all(patchPromises);
const filteredChanges = changes.filter((change) => change?.isReal !== false);
data.creates = filteredChanges;
data.creates = [];
return data;
}
</script>
<template>
@ -203,7 +203,7 @@ async function beforeSave(data, getChanges) {
</VnRow>
</template>
</VnSubToolbar>
<QDialog v-model="travelDialogRef" :maximized="true" :class="['vn-row', 'wrap']">
<QDialog v-model="travelDialogRef" :class="['vn-row', 'wrap']">
<FormModelPopup
:url-update="`Travels/${travel?.id}`"
model="travel"
@ -252,12 +252,15 @@ async function beforeSave(data, getChanges) {
</span>
</template>
<template #column-footer-reserve>
<span>
<span class="q-pr-xs">
{{ round(footer.reserve) }}
</span>
</template>
<template #column-footer-bought>
<span :style="boughtStyle(footer?.bought, footer?.reserve)">
<span
:style="boughtStyle(footer?.bought, footer?.reserve)"
class="q-pr-xs"
>
{{ round(footer.bought) }}
</span>
</template>
@ -275,7 +278,7 @@ async function beforeSave(data, getChanges) {
}
.column {
min-width: 35%;
margin-top: 5%;
margin-top: 1%;
}
.text-negative {
color: $negative !important;

View File

@ -25,7 +25,7 @@ entry:
entryTypeDescription: Tipo entrada
invoiceAmount: Importe
dated: Fecha
inventoryEntry: Es inventario
inventoryEntry: Es inventario
summary:
commission: Comisión
currency: Moneda
@ -33,7 +33,8 @@ entry:
invoiceAmount: Importe
ordered: Pedida
booked: Contabilizada
excludedFromAvailable: Excluido
excludedFromAvailable: Excluir del disponible
isConfirmed: Lista para etiquetar
travelReference: Referencia
travelAgency: Agencia
travelShipped: F. envio
@ -56,7 +57,7 @@ entry:
observation: Observación
commission: Comisión
booked: Contabilizada
excludedFromAvailable: Excluido
excludedFromAvailable: Excluir del disponible
initialTemperature: Ini °C
finalTemperature: Fin °C
buys:
@ -119,9 +120,9 @@ entry:
supplierName: Proveedor
entryFilter:
params:
isExcludedFromAvailable: Excluido
isExcludedFromAvailable: Excluir del disponible
isOrdered: Pedida
isConfirmed: Confirmado
isConfirmed: Lista para etiquetar
isReceived: Recibida
isRaid: Raid
landed: Fecha

View File

@ -158,20 +158,12 @@ function deleteFile(dmsFk) {
</VnRow>
<VnRow>
<VnSelect
:label="t('Undeductible VAT')"
v-model="data.deductibleExpenseFk"
:options="expenses"
:label="t('invoiceIn.summary.sage')"
v-model="data.withholdingSageFk"
:options="sageWithholdings"
option-value="id"
option-label="id"
:filter-options="['id', 'name']"
data-cy="invoiceInBasicDataDeductibleExpenseFk"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
{{ `${scope.opt.id}: ${scope.opt.name}` }}
</QItem>
</template>
</VnSelect>
option-label="withholding"
/>
<div class="row no-wrap">
<VnInput
@ -271,16 +263,6 @@ function deleteFile(dmsFk) {
data-cy="invoiceInBasicDataCompanyFk"
/>
</VnRow>
<VnRow>
<VnSelect
:label="t('invoiceIn.summary.sage')"
v-model="data.withholdingSageFk"
:options="sageWithholdings"
option-value="id"
option-label="withholding"
data-cy="invoiceInBasicDataWithholdingSageFk"
/>
</VnRow>
</template>
</FormModel>
<QDialog v-model="documentDialogRef.show">
@ -332,7 +314,6 @@ function deleteFile(dmsFk) {
supplierFk: Proveedor
Expedition date: Fecha expedición
Operation date: Fecha operación
Undeductible VAT: Iva no deducible
Document: Documento
Download file: Descargar archivo
Entry date: Fecha asiento

View File

@ -40,6 +40,13 @@ const vatColumns = ref([
sortable: true,
align: 'left',
},
{
name: 'isDeductible',
label: 'invoiceIn.isDeductible',
field: (row) => row.isDeductible,
sortable: true,
align: 'center',
},
{
name: 'vat',
label: 'invoiceIn.summary.sageVat',
@ -207,113 +214,106 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
<InvoiceInDescriptorMenu :invoice="entity" />
</template>
<template #body="{ entity }">
<!--Basic Data-->
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv
:label="t('invoiceIn.list.supplier')"
:value="entity.supplier?.name"
>
<template #value>
<span class="link" data-cy="invoiceInSummary_supplier">
{{ entity.supplier?.name }}
<SupplierDescriptorProxy :id="entity.supplierFk" />
</span>
</template>
</VnLv>
<VnLv :label="t('invoiceIn.supplierRef')" :value="entity.supplierRef" />
<VnLv
:label="t('invoiceIn.summary.currency')"
:value="entity.currency?.code"
<QCard class="max-width">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
<VnLv :label="t('invoiceIn.serial')" :value="`${entity.serial}`" />
<VnLv
:label="t('globals.country')"
:value="entity.supplier?.country?.code"
/>
</QCard>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv
:ellipsis-value="false"
:label="t('invoiceIn.summary.issued')"
:value="toDate(entity.issued)"
/>
<VnLv
:label="t('invoiceIn.summary.operated')"
:value="toDate(entity.operated)"
/>
<VnLv
:label="t('invoiceIn.summary.bookEntried')"
:value="toDate(entity.bookEntried)"
/>
<VnLv
:label="t('invoiceIn.summary.bookedDate')"
:value="toDate(entity.booked)"
/>
<VnLv :label="t('globals.isVies')" :value="entity.supplier?.isVies" />
</QCard>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv
:label="t('invoiceIn.summary.sage')"
:value="entity.sageWithholding?.withholding"
/>
<VnLv
:label="t('invoiceIn.summary.vat')"
:value="entity.expenseDeductible?.name"
/>
<VnLv
:label="t('invoiceIn.card.company')"
:value="entity.company?.code"
/>
<VnLv :label="t('invoiceIn.isBooked')" :value="invoiceIn?.isBooked" />
</QCard>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<QCardSection class="q-pa-none">
<VnLv
:label="t('invoiceIn.summary.taxableBase')"
:value="toCurrency(entity.totals.totalTaxableBase)"
/>
<VnLv label="Total" :value="toCurrency(entity.totals.totalVat)" />
<VnLv :label="t('invoiceIn.summary.dueTotal')">
<template #value>
<QChip
dense
class="q-pa-xs"
:color="amountsNotMatch ? 'negative' : 'transparent'"
:title="
amountsNotMatch
? t('invoiceIn.summary.noMatch')
: t('invoiceIn.summary.dueTotal')
"
>
{{ toCurrency(entity.totals.totalDueDay) }}
</QChip>
</template>
</VnLv>
</QCardSection>
<div class="vn-card-group">
<div class="vn-card-content">
<VnLv
:label="t('invoiceIn.list.supplier')"
:value="entity.supplier?.name"
>
<template #value>
<span class="link" data-cy="invoiceInSummary_supplier">
{{ entity.supplier?.name }}
<SupplierDescriptorProxy :id="entity.supplierFk" />
</span>
</template>
</VnLv>
<VnLv
:label="t('invoiceIn.supplierRef')"
:value="entity.supplierRef"
/>
<VnLv
:label="t('invoiceIn.summary.currency')"
:value="entity.currency?.code"
/>
<VnLv
:label="t('invoiceIn.serial')"
:value="`${entity.serial}`"
/>
<VnLv
:label="t('globals.country')"
:value="entity.supplier?.country?.code"
/>
</div>
<div class="vn-card-content">
<VnLv
:ellipsis-value="false"
:label="t('invoiceIn.summary.issued')"
:value="toDate(entity.issued)"
/>
<VnLv
:label="t('invoiceIn.summary.operated')"
:value="toDate(entity.operated)"
/>
<VnLv
:label="t('invoiceIn.summary.bookEntried')"
:value="toDate(entity.bookEntried)"
/>
<VnLv
:label="t('invoiceIn.summary.bookedDate')"
:value="toDate(entity.booked)"
/>
<VnLv
:label="t('globals.isVies')"
:value="entity.supplier?.isVies"
/>
</div>
<div class="vn-card-content">
<VnLv
:label="t('invoiceIn.summary.sage')"
:value="entity.sageWithholding?.withholding"
/>
<VnLv
:label="t('invoiceIn.summary.vat')"
:value="entity.expenseDeductible?.name"
/>
<VnLv
:label="t('invoiceIn.card.company')"
:value="entity.company?.code"
/>
<VnLv
:label="t('invoiceIn.isBooked')"
:value="invoiceIn?.isBooked"
/>
</div>
<div class="vn-card-content">
<VnLv
:label="t('invoiceIn.summary.taxableBase')"
:value="toCurrency(entity.totals.totalTaxableBase)"
/>
<VnLv label="Total" :value="toCurrency(entity.totals.totalVat)" />
<VnLv :label="t('invoiceIn.summary.dueTotal')">
<template #value>
<QChip
dense
class="q-pa-xs"
:color="amountsNotMatch ? 'negative' : 'transparent'"
:title="
amountsNotMatch
? t('invoiceIn.summary.noMatch')
: t('invoiceIn.summary.dueTotal')
"
>
{{ toCurrency(entity.totals.totalDueDay) }}
</QChip>
</template>
</VnLv>
</div>
</div>
</QCard>
<!--Vat-->
<QCard v-if="entity.invoiceInTax.length" class="vat">
@ -335,6 +335,15 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</QTh>
</QTr>
</template>
<template #body-cell-isDeductible="{ row }">
<QTd align="center">
<QCheckbox
v-model="row.isDeductible"
disable
data-cy="isDeductible_checkbox"
/>
</QTd>
</template>
<template #body-cell-vat="{ value: vatCell }">
<QTd :title="vatCell" shrink>
{{ vatCell }}

View File

@ -53,6 +53,13 @@ const columns = computed(() => [
sortable: true,
align: 'left',
},
{
name: 'isDeductible',
label: t('invoiceIn.isDeductible'),
field: (row) => row.isDeductible,
model: 'isDeductible',
align: 'center',
},
{
name: 'sageiva',
label: t('Sage iva'),
@ -119,6 +126,7 @@ const filter = {
'foreignValue',
'taxTypeSageFk',
'transactionTypeSageFk',
'isDeductible',
],
where: {
invoiceInFk: route.params.id,
@ -230,6 +238,14 @@ function setCursor(ref) {
</VnSelectDialog>
</QTd>
</template>
<template #body-cell-isDeductible="{ row }">
<QTd align="center">
<QCheckbox
v-model="row.isDeductible"
data-cy="isDeductible_checkbox"
/>
</QTd>
</template>
<template #body-cell-taxablebase="{ row }">
<QTd shrink>
<VnInputNumber
@ -324,6 +340,7 @@ function setCursor(ref) {
</QTd>
<QTd />
<QTd />
<QTd />
<QTd>
{{ toCurrency(taxRateTotal) }}
</QTd>

View File

@ -119,7 +119,7 @@ const cols = computed(() => [
icon: 'preview',
type: 'submit',
isPrimary: true,
action: (row) => viewSummary(row.id, InvoiceInSummary),
action: (row) => viewSummary(row.id, InvoiceInSummary, 'lg-width'),
},
{
title: t('globals.download'),

View File

@ -4,6 +4,7 @@ invoiceIn:
serial: Serial
isBooked: Is booked
supplierRef: Invoice nº
isDeductible: Deductible
list:
ref: Reference
supplier: Supplier

View File

@ -4,6 +4,7 @@ invoiceIn:
serial: Serie
isBooked: Contabilizada
supplierRef: Nº factura
isDeductible: Deducible
list:
ref: Referencia
supplier: Proveedor

View File

@ -71,180 +71,174 @@ async function handleConfirm() {
</script>
<template>
<div class="q-pa-md">
<CardSummary
ref="summary"
:url="`Orders/${entityId}/summary`"
data-key="OrderSummary"
>
<template #header="{ entity }">
{{ t('order.summary.basket') }} #{{ entity?.id }} -
{{ entity?.client?.name }} ({{ entity?.clientFk }})
</template>
<template #header-right>
<QBtn
flat
text-color="white"
:disabled="isConfirmed"
:label="t('order.summary.confirm')"
@click="handleConfirm()"
>
<QTooltip>{{ t('order.summary.confirmLines') }}</QTooltip>
</QBtn>
</template>
<template #menu="{ entity }">
<OrderDescriptorMenu :order="entity" />
</template>
<template #body="{ entity }">
<QCard class="vn-one">
<VnTitle
:url="`#/order/${entity.id}/basic-data`"
:text="t('globals.pageTitles.basicData')"
/>
<VnLv label="ID" :value="entity.id" />
<VnLv :label="t('globals.alias')" dash>
<template #value>
<span class="link">
{{ dashIfEmpty(entity?.address?.nickname) }}
<CustomerDescriptorProxy :id="entity?.clientFk" />
</span>
</template>
</VnLv>
<VnLv
:label="t('globals.company')"
:value="entity?.address?.companyFk"
/>
<VnLv
:label="t('globals.confirmed')"
:value="Boolean(entity?.isConfirmed)"
/>
</QCard>
<QCard class="vn-one">
<VnTitle
:url="`#/order/${entity.id}/basic-data`"
:text="t('globals.pageTitles.basicData')"
/>
<VnLv
:label="t('order.summary.created')"
:value="toDateHourMinSec(entity?.created)"
/>
<VnLv
:label="t('globals.confirmed')"
:value="toDateHourMinSec(entity?.confirmed)"
/>
<VnLv
:label="t('globals.landed')"
:value="toDateHourMinSec(entity?.landed)"
/>
<VnLv :label="t('globals.phone')">
<template #value>
{{ dashIfEmpty(entity?.address?.phone) }}
<a
v-if="entity?.address?.phone"
:href="`tel:${entity?.address?.phone}`"
class="text-primary"
>
<QIcon name="phone" />
</a>
</template>
</VnLv>
<VnLv
:label="t('order.summary.createdFrom')"
:value="entity?.sourceApp"
/>
<VnLv
:label="t('order.summary.address')"
:value="`${entity?.address?.street} - ${entity?.address?.city} (${entity?.address?.province?.name})`"
class="order-summary-address"
/>
</QCard>
<QCard class="vn-one">
<VnTitle :text="t('globals.pageTitles.notes')" />
<p v-if="entity?.note" class="no-margin">
{{ entity?.note }}
</p>
</QCard>
<QCard class="vn-one">
<VnTitle :text="t('order.summary.total')" />
<VnLv>
<template #label>
<span class="text-h6">{{ t('globals.subtotal') }}</span>
</template>
<template #value>
<span class="text-h6">{{
toCurrency(entity?.subTotal)
}}</span>
</template>
</VnLv>
<VnLv>
<template #label>
<span class="text-h6">{{ t('globals.vat') }}</span>
</template>
<template #value>
<span class="text-h6">{{ toCurrency(entity?.VAT) }}</span>
</template>
</VnLv>
<VnLv>
<template #label>
<span class="text-h6">{{ t('order.summary.total') }}</span>
</template>
<template #value>
<span class="text-h6">{{ toCurrency(entity?.total) }}</span>
</template>
</VnLv>
</QCard>
<QCard>
<VnTitle :text="t('globals.details')" />
<QTable :columns="detailsColumns" :rows="entity?.rows" flat>
<template #header="props">
<QTr :props="props">
<QTh auto-width>{{ t('globals.item') }}</QTh>
<QTh>{{ t('globals.description') }}</QTh>
<QTh auto-width>{{ t('globals.quantity') }}</QTh>
<QTh auto-width>{{ t('globals.price') }}</QTh>
<QTh auto-width>{{ t('order.summary.amount') }}</QTh>
</QTr>
</template>
<template #body="props">
<QTr :props="props">
<QTd key="item" :props="props" class="item">
<span class="link">
{{ props.row.item?.id }}
<ItemDescriptorProxy :id="props.row.item?.id" />
</span>
</QTd>
<QTd key="description" :props="props">
<div class="description">
<div class="name">
{{ props.row.item.name }}
<span
v-if="props.row.item.subName"
class="subName"
>
{{ props.row.item.subName }}
</span>
</div>
<CardSummary
ref="summary"
:url="`Orders/${entityId}/summary`"
data-key="OrderSummary"
>
<template #header="{ entity }">
{{ t('order.summary.basket') }} #{{ entity?.id }} -
{{ entity?.client?.name }} ({{ entity?.clientFk }})
</template>
<template #header-right>
<QBtn
flat
text-color="white"
:disabled="isConfirmed"
:label="t('order.summary.confirm')"
@click="handleConfirm()"
>
<QTooltip>{{ t('order.summary.confirmLines') }}</QTooltip>
</QBtn>
</template>
<template #menu="{ entity }">
<OrderDescriptorMenu :order="entity" />
</template>
<template #body="{ entity }">
<QCard class="vn-two">
<VnTitle
:url="`#/order/${entity.id}/basic-data`"
:text="t('globals.pageTitles.basicData')"
/>
<div class="vn-card-group">
<div class="vn-card-content">
<VnLv label="ID" :value="entity.id" />
<VnLv :label="t('globals.alias')" dash>
<template #value>
<span class="link">
{{ dashIfEmpty(entity?.address?.nickname) }}
<CustomerDescriptorProxy :id="entity?.clientFk" />
</span>
</template>
</VnLv>
<VnLv
:label="t('globals.company')"
:value="entity?.address?.companyFk"
/>
<VnLv
:label="t('globals.confirmed')"
:value="Boolean(entity?.isConfirmed)"
/>
</div>
<div class="vn-card-content">
<VnLv
:label="t('order.summary.created')"
:value="toDateHourMinSec(entity?.created)"
/>
<VnLv
:label="t('globals.confirmed')"
:value="toDateHourMinSec(entity?.confirmed)"
/>
<VnLv
:label="t('globals.landed')"
:value="toDateHourMinSec(entity?.landed)"
/>
<VnLv :label="t('globals.phone')">
<template #value>
{{ dashIfEmpty(entity?.address?.phone) }}
<a
v-if="entity?.address?.phone"
:href="`tel:${entity?.address?.phone}`"
class="text-primary"
>
<QIcon name="phone" />
</a>
</template>
</VnLv>
<VnLv
:label="t('order.summary.createdFrom')"
:value="entity?.sourceApp"
/>
<VnLv
:label="t('order.summary.address')"
:value="`${entity?.address?.street} - ${entity?.address?.city} (${entity?.address?.province?.name})`"
class="order-summary-address"
/>
</div>
</div>
</QCard>
<QCard class="vn-one">
<VnTitle :text="t('globals.pageTitles.notes')" />
<p v-if="entity?.note" class="no-margin">
{{ entity?.note }}
</p>
</QCard>
<QCard class="vn-one">
<VnTitle :text="t('order.summary.total')" />
<VnLv>
<template #label>
<span class="text-h6">{{ t('globals.subtotal') }}</span>
</template>
<template #value>
<span class="text-h6">{{ toCurrency(entity?.subTotal) }}</span>
</template>
</VnLv>
<VnLv>
<template #label>
<span class="text-h6">{{ t('globals.vat') }}</span>
</template>
<template #value>
<span class="text-h6">{{ toCurrency(entity?.VAT) }}</span>
</template>
</VnLv>
<VnLv>
<template #label>
<span class="text-h6">{{ t('order.summary.total') }}</span>
</template>
<template #value>
<span class="text-h6">{{ toCurrency(entity?.total) }}</span>
</template>
</VnLv>
</QCard>
<QCard>
<VnTitle :text="t('globals.details')" />
<QTable :columns="detailsColumns" :rows="entity?.rows" flat>
<template #header="props">
<QTr :props="props">
<QTh auto-width>{{ t('globals.item') }}</QTh>
<QTh>{{ t('globals.description') }}</QTh>
<QTh auto-width>{{ t('globals.quantity') }}</QTh>
<QTh auto-width>{{ t('globals.price') }}</QTh>
<QTh auto-width>{{ t('order.summary.amount') }}</QTh>
</QTr>
</template>
<template #body="props">
<QTr :props="props">
<QTd key="item" :props="props" class="item">
<span class="link">
{{ props.row.item?.id }}
<ItemDescriptorProxy :id="props.row.item?.id" />
</span>
</QTd>
<QTd key="description" :props="props">
<div class="description">
<div class="name">
{{ props.row.item.name }}
<span
v-if="props.row.item.subName"
class="subName"
>
{{ props.row.item.subName }}
</span>
</div>
<FetchedTags :item="props.row.item" :columns="3" />
</QTd>
<QTd key="quantity" :props="props">
{{ props.row.quantity }}
</QTd>
<QTd key="price" :props="props">
{{ toCurrency(props.row.price) }}
</QTd>
<QTd key="amount" :props="props">
{{
toCurrency(props.row?.quantity * props.row?.price)
}}
</QTd>
</QTr>
</template>
</QTable>
</QCard>
</template>
</CardSummary>
</div>
</div>
<FetchedTags :item="props.row.item" :columns="3" />
</QTd>
<QTd key="quantity" :props="props">
{{ props.row.quantity }}
</QTd>
<QTd key="price" :props="props">
{{ toCurrency(props.row.price) }}
</QTd>
<QTd key="amount" :props="props">
{{ toCurrency(props.row?.quantity * props.row?.price) }}
</QTd>
</QTr>
</template>
</QTable>
</QCard>
</template>
</CardSummary>
</template>
<style lang="scss">
.cardSummary .summaryBody .vn-label-value.order-summary-address {

View File

@ -65,7 +65,6 @@ const columns = computed(() => [
attrs: {
url: 'Departments',
},
create: true,
columnField: {
component: null,
},
@ -142,7 +141,7 @@ const columns = computed(() => [
{
title: t('globals.pageTitles.summary'),
icon: 'preview',
action: (row) => viewSummary(row.id, OrderSummary),
action: (row) => viewSummary(row.id, OrderSummary, 'lg-width'),
isPrimary: true,
},
],

View File

@ -138,74 +138,79 @@ const ticketColumns = ref([
:url="`#/${route.meta.moduleName.toLowerCase()}/${entityId}/basic-data`"
:text="t('globals.pageTitles.basicData')"
/>
</QCard>
<QCard class="vn-one">
<VnLv
:label="t('route.summary.date')"
:value="toDate(entity?.route.dated)"
/>
<VnLv
:label="t('route.summary.agency')"
:value="entity?.route?.agencyMode?.name"
/>
<VnLv
:label="t('route.summary.vehicle')"
:value="entity.route?.vehicle?.numberPlate"
/>
<VnLv :label="t('route.summary.driver')">
<template #value>
<span class="link">
{{ dashIfEmpty(entity?.route?.worker?.user?.name) }}
<WorkerDescriptorProxy :id="entity.route?.workerFk" />
</span>
</template>
</VnLv>
<VnLv
:label="t('route.summary.cost')"
:value="toCurrency(entity.route?.cost)"
/>
<VnLv
:label="t('route.summary.volume')"
:value="`${dashIfEmpty(entity?.route?.m3)} / ${dashIfEmpty(
entity?.route?.vehicle?.m3,
)} `"
/>
<VnLv
:label="t('route.summary.packages')"
:value="getTotalPackages(entity.tickets)"
/>
<QCheckbox
:label="
entity.route.isOk
? t('route.summary.closed')
: t('route.summary.open')
"
v-model="entity.route.isOk"
:disable="true"
/>
</QCard>
<QCard class="vn-one">
<VnLv
:label="t('route.summary.started')"
:value="toHour(entity?.route.started)"
/>
<VnLv
:label="t('route.summary.finished')"
:value="toHour(entity?.route.finished)"
/>
<VnLv
:label="t('route.summary.kmStart')"
:value="dashIfEmpty(entity?.route?.kmStart)"
/>
<VnLv
:label="t('route.summary.kmEnd')"
:value="dashIfEmpty(entity?.route?.kmEnd)"
/>
<VnLv
:label="t('globals.description')"
:value="dashIfEmpty(entity?.route?.description)"
/>
<div class="vn-card-group">
<div class="vn-card-content">
<VnLv
:label="t('route.summary.date')"
:value="toDate(entity?.route.dated)"
/>
<VnLv
:label="t('route.summary.agency')"
:value="entity?.route?.agencyMode?.name"
/>
<VnLv
:label="t('route.summary.vehicle')"
:value="entity.route?.vehicle?.numberPlate"
/>
<VnLv :label="t('route.summary.driver')">
<template #value>
<span class="link">
{{
dashIfEmpty(entity?.route?.worker?.user?.name)
}}
<WorkerDescriptorProxy
:id="entity.route?.workerFk"
/>
</span>
</template>
</VnLv>
<VnLv
:label="t('route.summary.cost')"
:value="toCurrency(entity.route?.cost)"
/>
<VnLv
:label="t('route.summary.volume')"
:value="`${dashIfEmpty(entity?.route?.m3)} / ${dashIfEmpty(
entity?.route?.vehicle?.m3,
)} `"
/>
<VnLv
:label="t('route.summary.packages')"
:value="getTotalPackages(entity.tickets)"
/>
<QCheckbox
:label="
entity.route.isOk
? t('route.summary.closed')
: t('route.summary.open')
"
v-model="entity.route.isOk"
:disable="true"
/>
</div>
<div class="vn-card-content">
<VnLv
:label="t('route.summary.started')"
:value="toHour(entity?.route.started)"
/>
<VnLv
:label="t('route.summary.finished')"
:value="toHour(entity?.route.finished)"
/>
<VnLv
:label="t('route.summary.kmStart')"
:value="dashIfEmpty(entity?.route?.kmStart)"
/>
<VnLv
:label="t('route.summary.kmEnd')"
:value="dashIfEmpty(entity?.route?.kmEnd)"
/>
<VnLv
:label="t('globals.description')"
:value="dashIfEmpty(entity?.route?.description)"
/>
</div>
</div>
</QCard>
<QCard class="vn-max">
<VnTitle

View File

@ -44,7 +44,7 @@ const getPriceDifference = async () => {
shipped: ticket.value.shipped,
};
const { data } = await axios.post(
`tickets/${formData.value.id}/priceDifference`,
`tickets/${ticket.value.id}/priceDifference`,
params,
);
ticket.value.sale = data;
@ -71,7 +71,7 @@ const submit = async () => {
};
const { data } = await axios.post(
`tickets/${formData.value.id}/componentUpdate`,
`tickets/${ticket.value.id}/componentUpdate`,
params,
);

View File

@ -137,120 +137,132 @@ onMounted(async () => {
<TicketDescriptorMenu :ticket="entity" />
</template>
<template #body="{ entity }">
<QCard class="vn-one">
<QCard class="vn-two">
<VnTitle
:url="toTicketUrl('basic-data')"
:text="t('globals.summary.basicData')"
/>
<VnLv v-if="entity.ticketState" :label="t('globals.state')">
<template #value>
<QBadge
text-color="black"
:color="entity.ticketState.state.classColor"
<div class="vn-card-group">
<div class="vn-card-content">
<VnLv v-if="entity.ticketState" :label="t('globals.state')">
<template #value>
<QBadge
text-color="black"
:color="entity.ticketState.state.classColor"
>
{{ entity.ticketState.state.name }}
</QBadge>
</template>
</VnLv>
<VnLv :label="t('customer.summary.team')">
<template #value>
<span class="link">
{{ entity?.client?.department?.name || '-' }}
<DepartmentDescriptorProxy
:id="entity?.client?.departmentFk"
/>
</span>
</template>
</VnLv>
<VnLv
:label="t('globals.agency')"
:value="entity.agencyMode?.name"
/>
<VnLv :label="t('ticket.summary.zone')">
<template #value>
<span class="link" @click.stop>
{{ entity?.zone?.name }}
<ZoneDescriptorProxy :id="entity.zoneFk" />
</span>
</template>
</VnLv>
<VnLv
:label="t('globals.warehouse')"
:value="entity.warehouse?.name"
/>
<VnLv
v-if="ticket?.ticketCollections?.length > 0"
:label="t('ticket.summary.collection')"
:value="ticket?.ticketCollections[0]?.collectionFk"
>
{{ entity.ticketState.state.name }}
</QBadge>
</template>
</VnLv>
<VnLv :label="t('customer.summary.team')">
<template #value>
<span class="link">
{{ entity?.client?.department?.name || '-' }}
<DepartmentDescriptorProxy
:id="entity?.client?.departmentFk"
/>
</span>
</template>
</VnLv>
<VnLv :label="t('globals.agency')" :value="entity.agencyMode?.name" />
<VnLv :label="t('ticket.summary.zone')">
<template #value>
<span class="link" @click.stop>
{{ entity?.zone?.name }}
<ZoneDescriptorProxy :id="entity.zoneFk" />
</span>
</template>
</VnLv>
<VnLv :label="t('globals.warehouse')" :value="entity.warehouse?.name" />
<VnLv
v-if="ticket?.ticketCollections?.length > 0"
:label="t('ticket.summary.collection')"
:value="ticket?.ticketCollections[0]?.collectionFk"
>
<template #value>
<a
:href="`${grafanaUrl}/d/d552ab74-85b4-4e7f-a279-fab7cd9c6124/control-de-expediciones?orgId=1&var-collectionFk=${entity.ticketCollections[0]?.collectionFk}`"
target="_blank"
class="grafana"
>
{{ entity.ticketCollections[0]?.collectionFk }}
</a>
</template>
</VnLv>
<VnLv :label="t('ticket.summary.route')">
<template #value>
<span class="link">
{{ entity.routeFk }}
<RouteDescriptorProxy :id="entity.routeFk" />
</span>
</template>
</VnLv>
<VnLv :label="t('ticket.summary.invoice')">
<template #value>
<span :class="{ link: entity.refFk }">
{{ dashIfEmpty(entity.refFk) }}
<InvoiceOutDescriptorProxy
:id="entity.invoiceOut.id"
v-if="entity.refFk"
/>
</span>
</template>
</VnLv>
<VnLv :label="t('globals.weight')" :value="dashIfEmpty(entity.weight)" />
</QCard>
<QCard class="vn-one">
<VnTitle
:url="toTicketUrl('basic-data')"
:text="t('globals.summary.basicData')"
/>
<VnLv
:label="t('ticket.summary.shipped')"
:value="toDate(entity.shipped)"
/>
<VnLv :label="t('globals.landed')" :value="toDate(entity.landed)" />
<VnLv :label="t('globals.packages')" :value="entity.packages" />
<VnLv :value="entity.address.phone">
<template #label>
{{ t('ticket.summary.consigneePhone') }}
<VnLinkPhone :phone-number="entity.address.phone" />
</template>
</VnLv>
<VnLv :value="entity.address.mobile">
<template #label>
{{ t('ticket.summary.consigneeMobile') }}
<VnLinkPhone :phone-number="entity.address.mobile" />
</template>
</VnLv>
<VnLv :value="entity.client.phone">
<template #label>
{{ t('ticket.summary.clientPhone') }}
<VnLinkPhone :phone-number="entity.client.phone" />
</template>
</VnLv>
<VnLv :value="entity.client.mobile">
<template #label>
{{ t('ticket.summary.clientMobile') }}
<VnLinkPhone :phone-number="entity.client.mobile" />
</template>
</VnLv>
<VnLv
:label="t('ticket.summary.consignee')"
:value="`${entity.address?.nickname} #${entity.address?.id}`"
/>
<VnLv
:label="t('ticket.summary.consigneeStreet')"
:value="formattedAddress"
/>
<template #value>
<a
:href="`${grafanaUrl}/d/d552ab74-85b4-4e7f-a279-fab7cd9c6124/control-de-expediciones?orgId=1&var-collectionFk=${entity.ticketCollections[0]?.collectionFk}`"
target="_blank"
class="grafana"
>
{{ entity.ticketCollections[0]?.collectionFk }}
</a>
</template>
</VnLv>
<VnLv :label="t('ticket.summary.route')">
<template #value>
<span class="link">
{{ entity.routeFk }}
<RouteDescriptorProxy :id="entity.routeFk" />
</span>
</template>
</VnLv>
<VnLv :label="t('ticket.summary.invoice')">
<template #value>
<span :class="{ link: entity.refFk }">
{{ dashIfEmpty(entity.refFk) }}
<InvoiceOutDescriptorProxy
:id="entity.invoiceOut.id"
v-if="entity.refFk"
/>
</span>
</template>
</VnLv>
<VnLv
:label="t('globals.weight')"
:value="dashIfEmpty(entity.weight)"
/>
</div>
<div class="vn-card-content">
<VnLv
:label="t('ticket.summary.shipped')"
:value="toDate(entity.shipped)"
/>
<VnLv
:label="t('globals.landed')"
:value="toDate(entity.landed)"
/>
<VnLv :label="t('globals.packages')" :value="entity.packages" />
<VnLv :value="entity.address.phone">
<template #label>
{{ t('ticket.summary.consigneePhone') }}
<VnLinkPhone :phone-number="entity.address.phone" />
</template>
</VnLv>
<VnLv :value="entity.address.mobile">
<template #label>
{{ t('ticket.summary.consigneeMobile') }}
<VnLinkPhone :phone-number="entity.address.mobile" />
</template>
</VnLv>
<VnLv :value="entity.client.phone">
<template #label>
{{ t('ticket.summary.clientPhone') }}
<VnLinkPhone :phone-number="entity.client.phone" />
</template>
</VnLv>
<VnLv :value="entity.client.mobile">
<template #label>
{{ t('ticket.summary.clientMobile') }}
<VnLinkPhone :phone-number="entity.client.mobile" />
</template>
</VnLv>
<VnLv
:label="t('ticket.summary.consignee')"
:value="`${entity.address?.nickname} #${entity.address?.id}`"
/>
<VnLv
:label="t('ticket.summary.consigneeStreet')"
:value="formattedAddress"
/>
</div>
</div>
</QCard>
<QCard class="vn-one" v-if="entity.notes.length">
<VnTitle

View File

@ -248,7 +248,7 @@ const columns = computed(() => [
name: 'TicketCard',
}).href;
window.open(url, '_blank');
} else viewSummary(row.id, TicketSummary);
} else viewSummary(row.id, TicketSummary, 'lg-width');
},
},
],

View File

@ -36,7 +36,7 @@ const warehousesOptionsIn = ref([]);
auto-load
:filter="{ where: { isDestiny: TRUE } }"
/>
<FormModel :url-update="`Travels/${route.params.id}`" model="Travel" auto-load>
<FormModel :url-update="`Travels/${route.params.id}`" model="Travel">
<template #form="{ data }">
<VnRow>
<VnInput v-model="data.ref" :label="t('globals.reference')" />
@ -57,8 +57,8 @@ const warehousesOptionsIn = ref([]);
<VnRow>
<VnInputDate
v-model="data.availabled"
:label="t('travel.summary.availabled')"
/>
:label="t('travel.summary.availabled')"
/>
<VnInputTime
v-model="data.availabled"
:label="t('travel.summary.availabledHour')"
@ -96,6 +96,7 @@ const warehousesOptionsIn = ref([]);
</QIcon>
</template>
</VnInput>
<VnInput v-model="data.awbFk" :label="t('travel.awbFk')" />
</VnRow>
<VnRow>
<QCheckbox v-model="data.isRaid" :label="t('travel.basicData.isRaid')" />

View File

@ -12,6 +12,7 @@ export default {
'isRaid',
'daysInForward',
'availabled',
'awbFk',
],
include: [
{

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, computed } from 'vue';
import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
@ -7,8 +7,6 @@ import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
import FetchData from 'src/components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue';
import { toDate, toCurrency, toCelsius } from 'src/filters';
import { toDateTimeFormat } from 'src/filters/date.js';
import { dashIfEmpty } from 'src/filters';
@ -252,16 +250,16 @@ async function setTravelData(travelData) {
}
const getLink = (param) => `#/travel/${entityId.value}/${param}`;
onMounted(async () => {
const { data } = await axios.get('Warehouses', {
params: { fields: ['id', 'name'] },
});
warehouses.value = data;
});
</script>
<template>
<FetchData
url="Warehouses"
:filter="{ fields: ['id', 'name'] }"
order="name"
@on-fetch="(data) => (warehouses = data)"
auto-load
/>
<CardSummary
ref="summaryRef"
:url="`Travels/${entityId}/getTravel`"
@ -275,72 +273,68 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
<TravelDescriptorMenuItems :travel="entity" />
</template>
<template #body>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv :label="t('globals.shipped')" :value="toDate(travel.shipped)" />
<VnLv
:label="t('globals.warehouseOut')"
:value="travel.warehouseOut?.name"
/>
<VnRow>
<QCheckbox
:label="t('travel.basicData.isRaid')"
v-model="travel.isRaid"
:disable="true"
/>
</VnRow>
<VnRow>
<QCheckbox
:label="t('travel.summary.delivered')"
v-model="travel.isDelivered"
:disable="true"
/>
</VnRow>
</QCard>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv :label="t('globals.landed')" :value="toDate(travel.landed)" />
<VnLv
:label="t('globals.warehouseIn')"
:value="travel.warehouseIn?.name"
/>
<VnLv
:label="t('travel.basicData.daysInForward')"
:value="travel?.daysInForward"
/>
<QCheckbox
:label="t('travel.summary.received')"
v-model="travel.isReceived"
:disable="true"
/>
</QCard>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
</QCardSection>
<VnLv :label="t('globals.agency')" :value="travel.agency?.name" />
<VnLv :label="t('globals.reference')" :value="travel.ref" />
<VnLv label="m³" :value="travel.m3" />
<VnLv :label="t('globals.totalEntries')" :value="travel.totalEntries" />
<VnLv
:label="t('travel.summary.availabled')"
:value="
dashIfEmpty(toDateTimeFormat(travel.availabled))
"
<QCard class="full-width">
<VnTitle
:url="getLink('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
<div class="vn-card-group">
<div class="vn-card-content">
<VnLv
:label="t('globals.shipped')"
:value="toDate(travel.shipped)"
/>
<VnLv
:label="t('globals.warehouseOut')"
:value="travel.warehouseOut?.name"
/>
<QCheckbox
:label="t('travel.basicData.isRaid')"
v-model="travel.isRaid"
:disable="true"
size="sm"
/>
<QCheckbox
:label="t('travel.summary.delivered')"
v-model="travel.isDelivered"
:disable="true"
size="sm"
/>
</div>
<div class="vn-card-content">
<VnLv
:label="t('globals.landed')"
:value="toDate(travel.landed)"
/>
<VnLv
:label="t('globals.warehouseIn')"
:value="travel.warehouseIn?.name"
/>
<VnLv
:label="t('travel.basicData.daysInForward')"
:value="travel?.daysInForward"
/>
<QCheckbox
:label="t('travel.summary.received')"
v-model="travel.isReceived"
:disable="true"
size="sm"
/>
</div>
<div class="vn-card-content">
<VnLv :label="t('globals.agency')" :value="travel.agency?.name" />
<VnLv :label="t('globals.reference')" :value="travel.ref" />
<VnLv label="m³" :value="travel.m3" />
<VnLv
:label="t('globals.totalEntries')"
:value="travel.totalEntries"
/>
<VnLv
:label="t('travel.summary.availabled')"
:value="dashIfEmpty(toDateTimeFormat(travel.availabled))"
/>
</div>
</div>
</QCard>
<QCard class="full-width">
<VnTitle :text="t('travel.summary.entries')" />

View File

@ -201,7 +201,7 @@ const columns = computed(() => [
{
title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, TravelSummary),
action: (row) => viewSummary(row.id, TravelSummary, 'lg-width'),
isPrimary: true,
},
],

View File

@ -48,77 +48,88 @@ onBeforeMount(async () => {
<WorkerDescriptorMenu :worker="entity" :is-excluded="workerExcluded" />
</template>
<template #body="{ entity: worker }">
<QCard class="vn-one">
<QCard class="vn-two">
<VnTitle :url="basicDataUrl" :text="t('globals.summary.basicData')" />
<VnLv :label="t('globals.name')" :value="worker.user?.nickname" />
<VnLv :label="t('globals.department')">
<template #value>
<span class="link" v-text="worker.department?.department?.name" />
<DepartmentDescriptorProxy
:id="worker.department?.department?.id"
<div class="vn-card-group">
<div class="vn-card-content">
<VnLv :label="t('globals.name')" :value="worker.user?.nickname" />
<VnLv :label="t('globals.department')">
<template #value>
<span
class="link"
v-text="worker.department?.department?.name"
/>
<DepartmentDescriptorProxy
:id="worker.department?.department?.id"
/>
</template>
</VnLv>
<VnLv :label="t('worker.summary.boss')" link>
<template #value>
<VnUserLink
v-if="worker.boss"
:name="dashIfEmpty(worker.boss?.name)"
:worker-id="worker.bossFk"
/>
</template>
</VnLv>
<VnLv :value="worker.mobileExtension">
<template #label>
{{ t('worker.summary.phoneExtension') }}
<VnLinkPhone :phone-number="worker.mobileExtension" />
</template>
</VnLv>
<VnLv :value="worker.phone">
<template #label>
{{ t('worker.summary.entPhone') }}
<VnLinkPhone :phone-number="worker.phone" />
</template>
</VnLv>
<VnLv :value="advancedSummary?.client?.phone">
<template #label>
{{ t('worker.summary.personalPhone') }}
<VnLinkPhone
:phone-number="advancedSummary?.client?.phone"
/>
</template>
</VnLv>
</div>
<div class="vn-card-content">
<VnLv
:label="t('worker.summary.fiDueDate')"
:value="toDate(advancedSummary.fiDueDate)"
/>
</template>
</VnLv>
<VnLv :label="t('worker.summary.boss')" link>
<template #value>
<VnUserLink
v-if="worker.boss"
:name="dashIfEmpty(worker.boss?.name)"
:worker-id="worker.bossFk"
<VnLv :label="t('worker.summary.sex')" :value="worker.sex" />
<VnLv
:label="t('worker.summary.seniority')"
:value="toDate(advancedSummary.seniority)"
/>
</template>
</VnLv>
<VnLv :value="worker.mobileExtension">
<template #label>
{{ t('worker.summary.phoneExtension') }}
<VnLinkPhone :phone-number="worker.mobileExtension" />
</template>
</VnLv>
<VnLv :value="worker.phone">
<template #label>
{{ t('worker.summary.entPhone') }}
<VnLinkPhone :phone-number="worker.phone" />
</template>
</VnLv>
<VnLv :value="advancedSummary?.client?.phone">
<template #label>
{{ t('worker.summary.personalPhone') }}
<VnLinkPhone :phone-number="advancedSummary?.client?.phone" />
</template>
</VnLv>
</QCard>
<QCard class="vn-one" v-if="advancedSummary">
<VnTitle :url="basicDataUrl" :text="t('globals.summary.basicData')" />
<VnLv
:label="t('worker.summary.fiDueDate')"
:value="toDate(advancedSummary.fiDueDate)"
/>
<VnLv :label="t('worker.summary.sex')" :value="worker.sex" />
<VnLv
:label="t('worker.summary.seniority')"
:value="toDate(advancedSummary.seniority)"
/>
<VnLv :label="t('worker.summary.fi')" :value="advancedSummary.fi" />
<VnLv
:label="t('worker.summary.birth')"
:value="toDate(advancedSummary.birth)"
/>
<VnLv
:label="t('worker.summary.isFreelance')"
:value="advancedSummary.isFreelance"
/>
<VnLv
:label="t('worker.summary.isSsDiscounted')"
:value="advancedSummary.isSsDiscounted"
/>
<VnLv
:label="t('worker.summary.hasMachineryAuthorized')"
:value="advancedSummary.hasMachineryAuthorized"
/>
<VnLv
:label="t('worker.summary.isDisable')"
:value="advancedSummary.isDisable"
/>
<VnLv
:label="t('worker.summary.fi')"
:value="advancedSummary.fi"
/>
<VnLv
:label="t('worker.summary.birth')"
:value="toDate(advancedSummary.birth)"
/>
<VnLv
:label="t('worker.summary.isFreelance')"
:value="advancedSummary.isFreelance"
/>
<VnLv
:label="t('worker.summary.isSsDiscounted')"
:value="advancedSummary.isSsDiscounted"
/>
<VnLv
:label="t('worker.summary.hasMachineryAuthorized')"
:value="advancedSummary.hasMachineryAuthorized"
/>
<VnLv
:label="t('worker.summary.isDisable')"
:value="advancedSummary.isDisable"
/>
</div>
</div>
</QCard>
<QCard class="vn-one">
<VnTitle :text="t('worker.summary.userData')" />

View File

@ -105,7 +105,7 @@ const columns = computed(() => [
{
title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, WorkerSummary),
action: (row) => viewSummary(row.id, WorkerSummary, 'lg-width'),
isPrimary: true,
},
],

View File

@ -75,21 +75,30 @@ onMounted(async () => {
<template #body="{ entity: zone }">
<QCard class="vn-one">
<VnTitle :url="zoneUrl + `basic-data`" :text="t('summary.basicData')" />
<VnLv :label="t('list.agency')" :value="zone.agencyMode?.name" />
<VnLv :label="t('list.price')" :value="toCurrency(zone.price)" />
<VnLv :label="t('zone.bonus')" :value="toCurrency(zone.bonus)" />
<div class="card-group">
<div class="card-content">
<VnLv :label="t('list.agency')" :value="zone.agencyMode?.name" />
<VnLv :label="t('list.price')" :value="toCurrency(zone.price)" />
<VnLv :label="t('zone.bonus')" :value="toCurrency(zone.bonus)" />
</div>
<div class="card-content">
<VnLv
:label="t('summary.closeHour')"
:value="toTimeFormat(zone.hour)"
/>
<VnLv
:label="t('zone.travelingDays')"
:value="zone.travelingDays"
/>
<QCheckbox
:label="t('zone.volumetric')"
v-model="zone.isVolumetric"
:disable="true"
/>
</div>
</div>
</QCard>
<QCard class="vn-one">
<VnTitle :url="zoneUrl + `basic-data`" :text="t('summary.basicData')" />
<VnLv :label="t('summary.closeHour')" :value="toTimeFormat(zone.hour)" />
<VnLv :label="t('zone.travelingDays')" :value="zone.travelingDays" />
<QCheckbox
:label="t('zone.volumetric')"
v-model="zone.isVolumetric"
:disable="true"
/>
</QCard>
<QCard class="full-width">
<VnTitle :url="zoneUrl + `warehouses`" :text="t('list.warehouse')" />
<QTable
:columns="columns"
@ -100,3 +109,15 @@ onMounted(async () => {
</template>
</CardSummary>
</template>
<style lang="scss" scoped>
.card-group {
display: flex;
flex-direction: column;
}
.card-content {
display: flex;
flex-direction: column;
}
</style>

View File

@ -16,9 +16,7 @@ export const useDescriptorStore = defineStore('descriptorStore', () => {
for (const file in files) {
const name = file.split('/').at(-1).slice(0, -19).toLowerCase();
const descriptor = moduleParser[name] ?? name;
currentDescriptors[descriptor + 'Fk'] = defineAsyncComponent(
() => import(/* @vite-ignore */ file),
);
currentDescriptors[descriptor + 'Fk'] = defineAsyncComponent(files[file]);
}
setDescriptors(currentDescriptors);
return currentDescriptors;

View File

@ -80,6 +80,11 @@ describe('EntryBuys', () => {
checkColor('amount', COLORS.positive);
cy.saveCard();
cy.get('tbody > tr [tabindex="0"][role="checkbox"]').click();
cy.dataCy('transferBuys').should('be.enabled').click();
cy.dataCy('entryDestinyInput').should('be.visible').type('100');
cy.dataCy('transferBuysBtn').click();
cy.deleteEntry();
});

View File

@ -4,7 +4,7 @@ describe('InvoiceInList', () => {
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
const firstId = `${firstRow} > td:nth-child(2) span`;
const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`;
const summaryHeaders = '.summaryBody .header-link';
const summaryHeaders = (opt) => `.summaryBody > .${opt} > .q-pb-lg > .header-link`;
const mockInvoiceRef = `createMockInvoice${Math.floor(Math.random() * 100)}`;
const mock = {
vnSupplierSelect: { val: 'farmer king', type: 'select' },
@ -32,8 +32,8 @@ describe('InvoiceInList', () => {
it('should open the details', () => {
cy.get(firstDetailBtn).click();
cy.get(summaryHeaders).eq(1).contains('Basic data');
cy.get(summaryHeaders).eq(4).contains('Vat');
cy.get(summaryHeaders('max-width')).contains('Basic data');
cy.get(summaryHeaders('vat')).contains('Vat');
});
it('should create a new Invoice', () => {

View File

@ -1,7 +1,7 @@
/// <reference types="cypress" />
describe('InvoiceInVat', () => {
const thirdRow = 'tbody > :nth-child(3)';
const firstLineVat = 'tbody > :nth-child(1) > :nth-child(4)';
const firstLineVat = 'tbody > :nth-child(1) ';
const vats = '[data-cy="vat-sageiva"]';
const dialogInputs = '.q-dialog label input';
const addBtn = 'tbody tr:nth-child(1) td:nth-child(2) .--add-icon';
@ -18,6 +18,17 @@ describe('InvoiceInVat', () => {
cy.get(vats).eq(0).should('have.value', '8: H.P. IVA 21% CEE');
});
it('should mark the line as deductible VAT', () => {
cy.get(`${firstLineVat} [data-cy="isDeductible_checkbox"]`).click();
cy.saveCard();
cy.get(`${firstLineVat} [data-cy="isDeductible_checkbox"]`)
.click();
cy.saveCard();
});
it('should add a new row', () => {
cy.addRow();
cy.fillRow(thirdRow, [true, 2000000001, 30, 'H.P. IVA 10']);

View File

@ -3,10 +3,10 @@ describe('Ticket descriptor', () => {
const listItem = '[role="menu"] .q-list .q-item';
const toCloneOpt = 'To clone ticket';
const setWeightOpt = 'Set weight';
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
const warehouseValue = ':nth-child(1) > [data-cy="vnLvWarehouse"]';
const summaryHeader = '.summaryHeader > div';
const weight = 25;
const weightValue = '.summaryBody.row :nth-child(1) > :nth-child(9) > .value > span';
const weightValue = '[data-cy="vnLvWeight"]';
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);

View File

@ -35,7 +35,7 @@ describe('TicketList', () => {
cy.get('.summaryBody').should('exist');
});
it.skip('filter client and create ticket', () => {
it('filter client and create ticket', () => {
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
searchResults();
cy.wait('@ticketSearchbar');
@ -44,6 +44,7 @@ describe('TicketList', () => {
cy.dataCy('Customer ID_input').type('1101{enter}');
cy.get('[data-cy="vnTableCreateBtn"] > .q-btn__content > .q-icon').click();
cy.waitSpinner();
cy.dataCy('Customer_select').should('have.value', 'Bruce Wayne');
cy.dataCy('Address_select').click();

View File

@ -39,11 +39,11 @@ describe('UserPanel', () => {
cy.get(userCompany).should('have.value', 'Warehouse One').click();
//Actualizo la opción
cy.getOption(2);
cy.getOption(3);
//Compruebo la notificación
cy.get('.q-notification').should('be.visible');
cy.get(userCompany).should('have.value', 'Warehouse Two');
cy.get(userCompany).should('have.value', 'TestingWarehouse');
//Restauro el valor
cy.get(userCompany).click();

View File

@ -20,7 +20,7 @@ describe('VnLog', () => {
it('should filter by entity', () => {
cy.selectOption('.q-drawer--right .q-item > .q-select', 'Claim');
cy.get('.q-page').click();
cy.validateContent(chips[0], 'Claim');
cy.validateContent(chips[0], 'Beginning');
});
it('should show claimDescriptor', () => {

View File

@ -1,27 +1,25 @@
describe('WorkerSummary', () => {
const departmentDescriptor = ':nth-child(1) > :nth-child(3) > .value > .link';
const roleDescriptor = ':nth-child(3) > :nth-child(4) > .value > .link';
const department = ':nth-child(1) > [data-cy="vnLvDepartment"] > .value';
const role = '[data-cy="vnLvRole"] > .value';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/worker/19/summary');
});
it('should load worker summary', () => {
it('should load worker summary and show the department', () => {
cy.waitForElement('.summaryHeader');
cy.get('.summaryHeader > div').should('have.text', '19 - salesboss salesboss');
cy.get(':nth-child(1) > :nth-child(2) > .value > span').should(
'have.text',
'salesBossNick',
);
cy.get(department).should('have.text', 'VENTAS');
});
it('should try descriptors', () => {
cy.waitForElement('.summaryHeader');
cy.get(departmentDescriptor).click();
cy.get(department).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '43');
cy.get(roleDescriptor).click();
cy.get('.summaryBody').click();
cy.get(role).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '19');
});