diff --git a/README.md b/README.md index d280e29ceb5..8eff9913739 100644 --- a/README.md +++ b/README.md @@ -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 +``` diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 6eda038919c..32a8db16ff1 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -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) diff --git a/src/components/ui/CardSummary.vue b/src/components/ui/CardSummary.vue index 05bfed9985a..2ec6bea78db 100644 --- a/src/components/ui/CardSummary.vue +++ b/src/components/ui/CardSummary.vue @@ -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 { diff --git a/src/components/ui/VnLv.vue b/src/components/ui/VnLv.vue index 50da8a14367..ee3791291c5 100644 --- a/src/components/ui/VnLv.vue +++ b/src/components/ui/VnLv.vue @@ -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> diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index cd18cf2c958..c7461f890d6 100644 --- a/src/pages/Customer/Card/CustomerDescriptor.vue +++ b/src/pages/Customer/Card/CustomerDescriptor.vue @@ -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" diff --git a/src/pages/Customer/Card/CustomerDescriptorMenu.vue b/src/pages/Customer/Card/CustomerDescriptorMenu.vue index aea45721c7a..fb78eab69cc 100644 --- a/src/pages/Customer/Card/CustomerDescriptorMenu.vue +++ b/src/pages/Customer/Card/CustomerDescriptorMenu.vue @@ -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> diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue index dc963a91b7f..c3b6786782f 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue @@ -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 diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue index 5af6a94f742..dad1da8d6ec 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue @@ -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,116 +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.noMatch', { - totalTaxableBase: - entity.totals.totalTaxableBase, - }) - : 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"> @@ -338,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 }} diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue index e37cf5b7e57..61c3040aeae 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue @@ -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> diff --git a/src/pages/InvoiceIn/InvoiceInList.vue b/src/pages/InvoiceIn/InvoiceInList.vue index 8dbee6501bb..10ddcbf0573 100644 --- a/src/pages/InvoiceIn/InvoiceInList.vue +++ b/src/pages/InvoiceIn/InvoiceInList.vue @@ -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'), diff --git a/src/pages/InvoiceIn/locale/en.yml b/src/pages/InvoiceIn/locale/en.yml index 2f9435b0083..d341c0aa7a8 100644 --- a/src/pages/InvoiceIn/locale/en.yml +++ b/src/pages/InvoiceIn/locale/en.yml @@ -4,6 +4,7 @@ invoiceIn: serial: Serial isBooked: Is booked supplierRef: Invoice nº + isDeductible: Deductible list: ref: Reference supplier: Supplier diff --git a/src/pages/InvoiceIn/locale/es.yml b/src/pages/InvoiceIn/locale/es.yml index 9144d6ab13c..c53d227fe24 100644 --- a/src/pages/InvoiceIn/locale/es.yml +++ b/src/pages/InvoiceIn/locale/es.yml @@ -4,6 +4,7 @@ invoiceIn: serial: Serie isBooked: Contabilizada supplierRef: Nº factura + isDeductible: Deducible list: ref: Referencia supplier: Proveedor diff --git a/src/pages/Order/Card/OrderSummary.vue b/src/pages/Order/Card/OrderSummary.vue index a4bdb288102..10a458bfb32 100644 --- a/src/pages/Order/Card/OrderSummary.vue +++ b/src/pages/Order/Card/OrderSummary.vue @@ -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 { diff --git a/src/pages/Order/OrderList.vue b/src/pages/Order/OrderList.vue index d75390d96e4..f59ce6585a6 100644 --- a/src/pages/Order/OrderList.vue +++ b/src/pages/Order/OrderList.vue @@ -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, }, ], diff --git a/src/pages/Route/Card/RouteSummary.vue b/src/pages/Route/Card/RouteSummary.vue index f6862809527..86bdbb5c5be 100644 --- a/src/pages/Route/Card/RouteSummary.vue +++ b/src/pages/Route/Card/RouteSummary.vue @@ -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, - )} m³`" - /> - <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, + )} m³`" + /> + <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 diff --git a/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue b/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue index 3c2fe95e568..76191b099ad 100644 --- a/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue +++ b/src/pages/Ticket/Card/BasicData/TicketBasicDataView.vue @@ -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, ); diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue index a19ab3779e5..3412b01068c 100644 --- a/src/pages/Ticket/Card/TicketSummary.vue +++ b/src/pages/Ticket/Card/TicketSummary.vue @@ -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 diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index 307f34dc292..039d3ca9e0c 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -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'); }, }, ], diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index 9f955261181..af6db630406 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -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')" /> diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue index b227afcb213..32ddc639a18 100644 --- a/src/pages/Travel/TravelList.vue +++ b/src/pages/Travel/TravelList.vue @@ -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, }, ], diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue index ad78a3fb9e7..40787613c00 100644 --- a/src/pages/Worker/Card/WorkerSummary.vue +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -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')" /> diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue index b767900752e..cb722a139cc 100644 --- a/src/pages/Worker/WorkerList.vue +++ b/src/pages/Worker/WorkerList.vue @@ -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, }, ], diff --git a/src/pages/Zone/Card/ZoneSummary.vue b/src/pages/Zone/Card/ZoneSummary.vue index 2c56fa3e292..61475b1f6c5 100644 --- a/src/pages/Zone/Card/ZoneSummary.vue +++ b/src/pages/Zone/Card/ZoneSummary.vue @@ -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> diff --git a/src/stores/useDescriptorStore.js b/src/stores/useDescriptorStore.js index 89189f32ee1..a5b83a42e25 100644 --- a/src/stores/useDescriptorStore.js +++ b/src/stores/useDescriptorStore.js @@ -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; diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js index d0d87d9f060..7254e890968 100644 --- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js @@ -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', () => { diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js index e9412244f11..ff7d639e600 100644 --- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js @@ -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']); diff --git a/test/cypress/integration/ticket/ticketDescriptor.spec.js b/test/cypress/integration/ticket/ticketDescriptor.spec.js index 0ba2723a250..b5c95c4632c 100644 --- a/test/cypress/integration/ticket/ticketDescriptor.spec.js +++ b/test/cypress/integration/ticket/ticketDescriptor.spec.js @@ -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); diff --git a/test/cypress/integration/vnComponent/UserPanel.spec.js b/test/cypress/integration/vnComponent/UserPanel.spec.js index 25724e87392..8722fe37e46 100644 --- a/test/cypress/integration/vnComponent/UserPanel.spec.js +++ b/test/cypress/integration/vnComponent/UserPanel.spec.js @@ -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(); diff --git a/test/cypress/integration/vnComponent/VnLog.spec.js b/test/cypress/integration/vnComponent/VnLog.spec.js index ae0013150ce..8ca32b681d9 100644 --- a/test/cypress/integration/vnComponent/VnLog.spec.js +++ b/test/cypress/integration/vnComponent/VnLog.spec.js @@ -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', () => { diff --git a/test/cypress/integration/worker/workerSummary.spec.js b/test/cypress/integration/worker/workerSummary.spec.js index c50b2c9431e..6071c4cdf11 100644 --- a/test/cypress/integration/worker/workerSummary.spec.js +++ b/test/cypress/integration/worker/workerSummary.spec.js @@ -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'); });