Merge branch 'dev' into 8387-itemTagCrudModelFront
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Robert Ferrús 2025-01-27 10:26:39 +00:00
commit a5ea7ab104
41 changed files with 454 additions and 331 deletions

View File

@ -61,7 +61,6 @@ onMounted(() => stateStore.setMounted());
/>
<QSpace />
<div id="searchbar" class="searchbar"></div>
<div id="searchbar-after"></div>
<QSpace />
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
<div id="actions-prepend"></div>

View File

@ -20,7 +20,7 @@ watch(
(val) => {
if (stateStore) stateStore.rightAdvancedDrawer = val;
},
{ immediate: true }
{ immediate: true },
);
</script>
<template>
@ -30,8 +30,8 @@ watch(
flat
@click="stateStore.toggleRightAdvancedDrawer()"
round
dense
icon="tune"
color="white"
>
<QTooltip bottom anchor="bottom right">
{{ t('globals.advancedMenu') }}

View File

@ -202,7 +202,7 @@ const columns = computed(() => [
prop.row.id,
$props.downloadModel,
undefined,
prop.row.download
prop.row.download,
),
},
{
@ -374,7 +374,7 @@ defineExpose({
v-if="
shouldRenderButton(
button.name,
props.row.isDocuware
props.row.isDocuware,
)
"
:is="button.component"

View File

@ -804,7 +804,7 @@ watch(
<QItem class="q-mt-sm">
<QInput
class="full-width"
:label="t('to')"
:label="t('globals.to')"
@click="dateToDialog = true"
@focus="(evt) => evt.target.blur()"
@clear="selectFilter('date', 'from')"
@ -1059,9 +1059,9 @@ en:
Deletes: Deletes
Accesses: Accesses
Users:
User: Usuario
All: Todo
System: Sistema
User: User
All: All
System: System
properties:
id: ID
claimFk: Claim ID

View File

@ -75,6 +75,10 @@ onMounted(() => {
onUnmounted(unsubscribe);
});
onUnmounted(() => {
if (arrayData) arrayData.destroy();
});
function checkIsMain() {
isMainSection.value = sectionValue.value == route.name;
if (!isMainSection.value && arrayData) {

View File

@ -9,9 +9,9 @@ const $props = defineProps({
type: Boolean,
default: false,
},
hasInfo: {
type: Boolean,
default: false,
info: {
type: String,
default: undefined,
},
modelValue: {
type: [String, Number, Object],
@ -57,9 +57,9 @@ const url = computed(() => {
<template #prepend v-if="$props.hasAvatar">
<VnAvatar :worker-id="value" color="primary" v-bind="$attrs" />
</template>
<template #append v-if="$props.hasInfo">
<template #append v-if="$props.info">
<QIcon name="info" class="cursor-pointer">
<QTooltip>{{ $t($props.hasInfo) }}</QTooltip>
<QTooltip>{{ $t($props.info) }}</QTooltip>
</QIcon>
</template>
<template #option="scope">

View File

@ -10,6 +10,10 @@ defineProps({
type: Object,
required: true,
},
width: {
type: String,
default: 'md-width',
},
});
defineEmits([...useDialogPluginComponent.emits]);
@ -17,7 +21,19 @@ defineEmits([...useDialogPluginComponent.emits]);
const { dialogRef, onDialogHide } = useDialogPluginComponent();
</script>
<template>
<QDialog ref="dialogRef" @hide="onDialogHide" full-width>
<component :is="summary" :id="id" />
<QDialog ref="dialogRef" @hide="onDialogHide">
<component :is="summary" :id="id" :class="width" />
</QDialog>
</template>
<style lang="scss" scoped>
.md-width {
max-width: $width-md;
}
.lg-width {
max-width: $width-lg;
}
.xlg-width {
max-width: $width-xl;
}
</style>

View File

@ -37,6 +37,10 @@ const $props = defineProps({
type: Object,
default: null,
},
width: {
type: String,
default: 'md-width',
},
});
const state = useState();
@ -128,9 +132,8 @@ const toModule = computed(() =>
</QTooltip>
</QBtn></slot
>
<QBtn
@click.stop="viewSummary(entity.id, $props.summary)"
@click.stop="viewSummary(entity.id, $props.summary, $props.width)"
round
flat
dense

View File

@ -102,7 +102,7 @@ watch(
(val) => {
arrayData = useArrayData(val, { ...props });
store = arrayData.store;
}
},
);
onMounted(() => {
@ -176,6 +176,7 @@ async function search() {
>
<QTooltip>{{ t(props.info) }}</QTooltip>
</QIcon>
<div id="searchbar-after"></div>
</template>
</VnInput>
</QForm>

View File

@ -4,10 +4,10 @@ import { useQuasar } from 'quasar';
export function useSummaryDialog() {
const quasar = useQuasar();
function viewSummary(id, summary) {
function viewSummary(id, summary, width) {
quasar.dialog({
component: VnSummaryDialog,
componentProps: { id, summary },
componentProps: { id, summary, width },
});
}

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
@font-face {
font-family: 'icon';
src: url('fonts/icon.eot?y0x93o');
src: url('fonts/icon.eot?y0x93o#iefix') format('embedded-opentype'),
url('fonts/icon.ttf?y0x93o') format('truetype'),
url('fonts/icon.woff?y0x93o') format('woff'),
url('fonts/icon.svg?y0x93o#icon') format('svg');
src: url('fonts/icon.eot?7j3xju');
src: url('fonts/icon.eot?7j3xju#iefix') format('embedded-opentype'),
url('fonts/icon.ttf?7j3xju') format('truetype'),
url('fonts/icon.woff?7j3xju') format('woff'),
url('fonts/icon.svg?7j3xju#icon') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
@ -25,8 +25,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-entry_lastbuys:before {
content: "\e91a";
.icon-hasItemLost:before {
content: "\e957";
}
.icon-hasItemDelay:before {
content: "\e96d";
}
.icon-add_entries:before {
content: "\e953";
}
.icon-100:before {
content: "\e901";
@ -52,6 +58,9 @@
.icon-addperson:before {
content: "\e908";
}
.icon-agencia_tributaria:before {
content: "\e948";
}
.icon-agency:before {
content: "\e92a";
}
@ -189,6 +198,9 @@
.icon-entry:before {
content: "\e937";
}
.icon-entry_lastbuys:before {
content: "\e91a";
}
.icon-exit:before {
content: "\e938";
}

View File

@ -33,6 +33,11 @@ $dark-shadow-color: black;
$layout-shadow-dark: 0 0 10px 2px #00000033, 0 0px 10px #0000003d;
$spacing-md: 16px;
$color-font-secondary: #777;
$width-xs: 400px;
$width-sm: 544px;
$width-md: 800px;
$width-lg: 1280px;
$width-xl: 1600px;
.bg-success {
background-color: $positive;
}

View File

@ -53,6 +53,7 @@ const debtWarning = computed(() => {
@on-fetch="setData"
:summary="$props.summary"
data-key="customer"
width="lg-width"
>
<template #menu="{ entity }">
<CustomerDescriptorMenu :customer="entity" />

View File

@ -2,13 +2,10 @@
import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import { toDate } from 'src/filters';
import { getUrl } from 'src/composables/getUrl';
import filter from './EntryFilter.js';
import EntryDescriptorMenu from './EntryDescriptorMenu.vue';
const $props = defineProps({
@ -23,7 +20,42 @@ const route = useRoute();
const { t } = useI18n();
const entryDescriptorRef = ref(null);
const url = ref();
const entryFilter = {
include: [
{
relation: 'travel',
scope: {
fields: ['id', 'landed', 'shipped', 'agencyModeFk', 'warehouseOutFk'],
include: [
{
relation: 'agency',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseOut',
scope: {
fields: ['name'],
},
},
{
relation: 'warehouseIn',
scope: {
fields: ['name'],
},
},
],
},
},
{
relation: 'supplier',
scope: {
fields: ['id', 'nickname'],
},
},
],
};
const entityId = computed(() => {
return $props.id || route.params.id;
});
@ -58,9 +90,10 @@ const getEntryRedirectionFilter = (entry) => {
ref="entryDescriptorRef"
module="Entry"
:url="`Entries/${entityId}`"
:filter="filter"
:userFilter="entryFilter"
title="supplier.nickname"
data-key="Entry"
width="lg-width"
>
<template #menu="{ entity }">
<EntryDescriptorMenu :id="entity.id" />

View File

@ -1,5 +1,11 @@
<script setup>
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useQuasar } from 'quasar';
import axios from 'axios';
import { usePrintService } from 'composables/usePrintService';
import useNotify from 'src/composables/useNotify.js';
import VnConfirm from 'src/components/ui/VnConfirm.vue';
const { openReport } = usePrintService();
@ -9,14 +15,47 @@ const $props = defineProps({
required: true,
},
});
const { t } = useI18n();
const { notify } = useNotify();
const quasar = useQuasar();
const route = useRoute();
function showEntryReport() {
openReport(`Entries/${$props.id}/entry-order-pdf`);
}
const openDialog = () => {
quasar.dialog({
component: VnConfirm,
componentProps: {
title: t('transferEntryDialog'),
promise: transferEntry,
},
});
};
const transferEntry = async () => {
const { data } = await axios.post(`Entries/${route.params.id}/transfer`);
notify('globals.dataSaved', 'positive');
const url = `#/entry/${data.newEntryFk.newEntryFk}/summary`;
window.open(url, '_blank');
};
</script>
<template>
<QItem v-ripple clickable @click="showEntryReport">
<QItemSection>{{ $t('entryList.list.showEntryReport') }}</QItemSection>
</QItem>
<QItem v-ripple clickable @click="openDialog">
<QItemSection>{{ t('transferEntry') }}</QItemSection>
</QItem>
</template>
<i18n>
en:
transferEntryDialog: The entries will be transferred to the next day
transferEntry: Transfer Entry
es:
transferEntryDialog: Se van a transferir las compras al dia siguiente
transferEntry: Transferir Entrada
</i18n>

View File

@ -268,7 +268,7 @@ function deleteFile(dmsFk) {
</VnRow>
<VnRow>
<VnSelect
:label="t('invoicein.summary.sage')"
:label="t('invoiceIn.summary.sage')"
v-model="data.withholdingSageFk"
:options="sageWithholdings"
option-value="id"

View File

@ -1,10 +1,6 @@
<script setup>
import VnCard from 'components/common/VnCard.vue';
import VnCardBeta from 'components/common/VnCardBeta.vue';
import InvoiceInDescriptor from './InvoiceInDescriptor.vue';
import InvoiceInFilter from '../InvoiceInFilter.vue';
import InvoiceInSearchbar from '../InvoiceInSearchbar.vue';
import { onBeforeRouteUpdate } from 'vue-router';
import { setRectificative } from '../composables/setRectificative';
const filter = {
include: [
@ -39,20 +35,13 @@ const filter = {
},
],
};
onBeforeRouteUpdate(async (to) => await setRectificative(to));
</script>
<template>
<VnCard
<VnCardBeta
data-key="InvoiceIn"
base-url="InvoiceIns"
:filter="filter"
:descriptor="InvoiceInDescriptor"
:filter-panel="InvoiceInFilter"
search-data-key="InvoiceInList"
>
<template #searchbar>
<InvoiceInSearchbar />
</template>
</VnCard>
:user-filter="filter"
/>
</template>

View File

@ -105,7 +105,7 @@ async function setInvoiceCorrection(id) {
if (correctingData[0]) invoiceInCorrection.corrected = correctingData[0].correctedFk;
invoiceInCorrection.correcting = correctedData.map(
(corrected) => corrected.correctingFk
(corrected) => corrected.correctingFk,
);
}
</script>
@ -117,18 +117,19 @@ async function setInvoiceCorrection(id) {
:url="`InvoiceIns/${entityId}`"
:filter="filter"
title="supplierRef"
width="xlg-width"
>
<template #menu="{ entity }">
<InvoiceInDescriptorMenu :invoice="entity" />
</template>
<template #body="{ entity }">
<VnLv :label="t('invoicein.list.issued')" :value="toDate(entity.issued)" />
<VnLv :label="t('invoiceIn.list.issued')" :value="toDate(entity.issued)" />
<VnLv
:label="t('invoicein.summary.bookedDate')"
:label="t('invoiceIn.summary.bookedDate')"
:value="toDate(entity.booked)"
/>
<VnLv :label="t('invoicein.list.amount')" :value="toCurrency(totalAmount)" />
<VnLv :label="t('invoicein.list.supplier')">
<VnLv :label="t('invoiceIn.list.amount')" :value="toCurrency(totalAmount)" />
<VnLv :label="t('invoiceIn.list.supplier')">
<template #value>
<span class="link">
{{ entity?.supplier?.nickname }}
@ -145,7 +146,7 @@ async function setInvoiceCorrection(id) {
color="primary"
:to="routes.getSupplier(entity.supplierFk)"
>
<QTooltip>{{ t('invoicein.list.supplier') }}</QTooltip>
<QTooltip>{{ t('globals.supplier') }}</QTooltip>
</QBtn>
<QBtn
size="md"
@ -153,7 +154,7 @@ async function setInvoiceCorrection(id) {
color="primary"
:to="routes.getEntry(entity.entryFk)"
>
<QTooltip>{{ t('Entry') }}</QTooltip>
<QTooltip>{{ t('globals.entry') }}</QTooltip>
</QBtn>
<QBtn
size="md"
@ -161,7 +162,7 @@ async function setInvoiceCorrection(id) {
color="primary"
:to="routes.getTickets(entity.supplierFk)"
>
<QTooltip>{{ t('InvoiceOut.card.ticketList') }}</QTooltip>
<QTooltip>{{ t('globals.ticketList') }}</QTooltip>
</QBtn>
<QBtn
v-if="

View File

@ -40,15 +40,15 @@ const cplusRectificationTypes = ref([]);
const siiTypeInvoiceIns = ref([]);
const actions = {
unbook: {
title: t('assertAction', { action: t('invoicein.descriptorMenu.unbook') }),
title: t('assertAction', { action: t('invoiceIn.descriptorMenu.unbook') }),
action: toUnbook,
},
delete: {
title: t('assertAction', { action: t('invoicein.descriptorMenu.delete') }),
title: t('assertAction', { action: t('invoiceIn.descriptorMenu.delete') }),
action: deleteInvoice,
},
clone: {
title: t('assertAction', { action: t('invoicein.descriptorMenu.clone') }),
title: t('assertAction', { action: t('invoiceIn.descriptorMenu.clone') }),
action: cloneInvoice,
},
showPdf: { cb: showPdfInvoice },
@ -96,7 +96,7 @@ async function deleteInvoice() {
await axios.delete(`InvoiceIns/${entityId.value}`);
quasar.notify({
type: 'positive',
message: t('invoicein.descriptorMenu.invoiceDeleted'),
message: t('invoiceIn.descriptorMenu.invoiceDeleted'),
});
push({ path: '/invoice-in' });
}
@ -105,7 +105,7 @@ async function cloneInvoice() {
const { data } = await axios.post(`InvoiceIns/${entityId.value}/clone`);
quasar.notify({
type: 'positive',
message: t('invoicein.descriptorMenu.invoiceCloned'),
message: t('invoiceIn.descriptorMenu.invoiceCloned'),
});
push({ path: `/invoice-in/${data.id}/summary` });
}
@ -186,7 +186,7 @@ const createInvoiceInCorrection = async () => {
clickable
@click="book(entityId)"
>
<QItemSection>{{ t('invoicein.descriptorMenu.toBook') }}</QItemSection>
<QItemSection>{{ t('invoiceIn.descriptorMenu.toBook') }}</QItemSection>
</QItem>
</template>
</InvoiceInToBook>
@ -197,7 +197,7 @@ const createInvoiceInCorrection = async () => {
@click="triggerMenu('unbook')"
>
<QItemSection>
{{ t('invoicein.descriptorMenu.toUnbook') }}
{{ t('invoiceIn.descriptorMenu.toUnbook') }}
</QItemSection>
</QItem>
<QItem
@ -206,19 +206,19 @@ const createInvoiceInCorrection = async () => {
clickable
@click="triggerMenu('delete')"
>
<QItemSection>{{ t('invoicein.descriptorMenu.deleteInvoice') }}</QItemSection>
<QItemSection>{{ t('invoiceIn.descriptorMenu.deleteInvoice') }}</QItemSection>
</QItem>
<QItem v-if="canEditProp('clone')" v-ripple clickable @click="triggerMenu('clone')">
<QItemSection>{{ t('invoicein.descriptorMenu.cloneInvoice') }}</QItemSection>
<QItemSection>{{ t('invoiceIn.descriptorMenu.cloneInvoice') }}</QItemSection>
</QItem>
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('showPdf')">
<QItemSection>{{
t('invoicein.descriptorMenu.showAgriculturalPdf')
t('invoiceIn.descriptorMenu.showAgriculturalPdf')
}}</QItemSection>
</QItem>
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('sendPdf')">
<QItemSection
>{{ t('invoicein.descriptorMenu.sendAgriculturalPdf') }}...</QItemSection
>{{ t('invoiceIn.descriptorMenu.sendAgriculturalPdf') }}...</QItemSection
>
</QItem>
<QItem
@ -228,7 +228,7 @@ const createInvoiceInCorrection = async () => {
@click="triggerMenu('correct')"
>
<QItemSection
>{{ t('invoicein.descriptorMenu.createCorrective') }}...</QItemSection
>{{ t('invoiceIn.descriptorMenu.createCorrective') }}...</QItemSection
>
</QItem>
<QItem v-if="invoice.dmsFk" v-ripple clickable @click="downloadFile(invoice.dmsFk)">

View File

@ -27,14 +27,14 @@ const intrastatTotals = ref({ amount: 0, net: 0, stems: 0 });
const vatColumns = ref([
{
name: 'expense',
label: 'invoicein.summary.expense',
label: 'invoiceIn.summary.expense',
field: (row) => row.expenseFk,
sortable: true,
align: 'left',
},
{
name: 'landed',
label: 'invoicein.summary.taxableBase',
label: 'invoiceIn.summary.taxableBase',
field: (row) => row.taxableBase,
format: (value) => toCurrency(value),
sortable: true,
@ -42,7 +42,7 @@ const vatColumns = ref([
},
{
name: 'vat',
label: 'invoicein.summary.sageVat',
label: 'invoiceIn.summary.sageVat',
field: (row) => {
if (row.taxTypeSage) return `#${row.taxTypeSage.id} : ${row.taxTypeSage.vat}`;
},
@ -52,7 +52,7 @@ const vatColumns = ref([
},
{
name: 'transaction',
label: 'invoicein.summary.sageTransaction',
label: 'invoiceIn.summary.sageTransaction',
field: (row) => {
if (row.transactionTypeSage)
return `#${row.transactionTypeSage.id} : ${row.transactionTypeSage?.transaction}`;
@ -63,7 +63,7 @@ const vatColumns = ref([
},
{
name: 'rate',
label: 'invoicein.summary.rate',
label: 'invoiceIn.summary.rate',
field: (row) => taxRate(row.taxableBase, row.taxTypeSage?.rate),
format: (value) => toCurrency(value),
sortable: true,
@ -71,7 +71,7 @@ const vatColumns = ref([
},
{
name: 'currency',
label: 'invoicein.summary.currency',
label: 'invoiceIn.summary.currency',
field: (row) => row.foreignValue,
format: (val) => val && toCurrency(val, currency.value),
sortable: true,
@ -82,21 +82,21 @@ const vatColumns = ref([
const dueDayColumns = ref([
{
name: 'date',
label: 'invoicein.summary.dueDay',
label: 'invoiceIn.summary.dueDay',
field: (row) => toDate(row.dueDated),
sortable: true,
align: 'left',
},
{
name: 'bank',
label: 'invoicein.summary.bank',
label: 'invoiceIn.summary.bank',
field: (row) => row.bank.bank,
sortable: true,
align: 'left',
},
{
name: 'amount',
label: 'invoicein.list.amount',
label: 'invoiceIn.list.amount',
field: (row) => row.amount,
format: (value) => toCurrency(value),
sortable: true,
@ -104,7 +104,7 @@ const dueDayColumns = ref([
},
{
name: 'landed',
label: 'invoicein.summary.foreignValue',
label: 'invoiceIn.summary.foreignValue',
field: (row) => row.foreignValue,
format: (val) => val && toCurrency(val, currency.value),
sortable: true,
@ -115,7 +115,7 @@ const dueDayColumns = ref([
const intrastatColumns = ref([
{
name: 'code',
label: 'invoicein.summary.code',
label: 'invoiceIn.summary.code',
field: (row) => {
return `${row.intrastat.id}: ${row.intrastat?.description}`;
},
@ -124,21 +124,21 @@ const intrastatColumns = ref([
},
{
name: 'amount',
label: 'invoicein.list.amount',
label: 'invoiceIn.list.amount',
field: (row) => toCurrency(row.amount),
sortable: true,
align: 'left',
},
{
name: 'net',
label: 'invoicein.summary.net',
label: 'invoiceIn.summary.net',
field: (row) => row.net,
sortable: true,
align: 'left',
},
{
name: 'stems',
label: 'invoicein.summary.stems',
label: 'invoiceIn.summary.stems',
field: (row) => row.stems,
format: (value) => value,
sortable: true,
@ -146,7 +146,7 @@ const intrastatColumns = ref([
},
{
name: 'landed',
label: 'invoicein.summary.country',
label: 'invoiceIn.summary.country',
field: (row) => row.country?.code,
format: (value) => value,
sortable: true,
@ -214,7 +214,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
/>
</QCardSection>
<VnLv
:label="t('invoicein.list.supplier')"
:label="t('invoiceIn.list.supplier')"
:value="entity.supplier?.name"
>
<template #value>
@ -225,14 +225,14 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</template>
</VnLv>
<VnLv
:label="t('invoicein.list.supplierRef')"
:label="t('invoiceIn.list.supplierRef')"
:value="entity.supplierRef"
/>
<VnLv
:label="t('invoicein.summary.currency')"
:label="t('invoiceIn.summary.currency')"
:value="entity.currency?.code"
/>
<VnLv :label="t('invoicein.serial')" :value="`${entity.serial}`" />
<VnLv :label="t('invoiceIn.serial')" :value="`${entity.serial}`" />
<VnLv
:label="t('globals.country')"
:value="entity.supplier?.country?.code"
@ -247,19 +247,19 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</QCardSection>
<VnLv
:ellipsis-value="false"
:label="t('invoicein.summary.issued')"
:label="t('invoiceIn.summary.issued')"
:value="toDate(entity.issued)"
/>
<VnLv
:label="t('invoicein.summary.operated')"
:label="t('invoiceIn.summary.operated')"
:value="toDate(entity.operated)"
/>
<VnLv
:label="t('invoicein.summary.bookEntried')"
:label="t('invoiceIn.summary.bookEntried')"
:value="toDate(entity.bookEntried)"
/>
<VnLv
:label="t('invoicein.summary.bookedDate')"
:label="t('invoiceIn.summary.bookedDate')"
:value="toDate(entity.booked)"
/>
<VnLv :label="t('globals.isVies')" :value="entity.supplier?.isVies" />
@ -272,18 +272,18 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
/>
</QCardSection>
<VnLv
:label="t('invoicein.summary.sage')"
:label="t('invoiceIn.summary.sage')"
:value="entity.sageWithholding?.withholding"
/>
<VnLv
:label="t('invoicein.summary.vat')"
:label="t('invoiceIn.summary.vat')"
:value="entity.expenseDeductible?.name"
/>
<VnLv
:label="t('invoicein.card.company')"
:label="t('invoiceIn.card.company')"
:value="entity.company?.code"
/>
<VnLv :label="t('invoicein.isBooked')" :value="invoiceIn?.isBooked" />
<VnLv :label="t('invoiceIn.isBooked')" :value="invoiceIn?.isBooked" />
</QCard>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
@ -294,11 +294,11 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</QCardSection>
<QCardSection class="q-pa-none">
<VnLv
:label="t('invoicein.summary.taxableBase')"
:label="t('invoiceIn.summary.taxableBase')"
:value="toCurrency(entity.totals.totalTaxableBase)"
/>
<VnLv label="Total" :value="toCurrency(entity.totals.totalVat)" />
<VnLv :label="t('invoicein.summary.dueTotal')">
<VnLv :label="t('invoiceIn.summary.dueTotal')">
<template #value>
<QChip
dense
@ -306,8 +306,8 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
:color="amountsNotMatch ? 'negative' : 'transparent'"
:title="
amountsNotMatch
? t('invoicein.summary.noMatch')
: t('invoicein.summary.dueTotal')
? t('invoiceIn.summary.noMatch')
: t('invoiceIn.summary.dueTotal')
"
>
{{ toCurrency(entity.totals.totalDueDay) }}
@ -318,7 +318,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</QCard>
<!--Vat-->
<QCard v-if="entity.invoiceInTax.length" class="vat">
<VnTitle :url="getLink('vat')" :text="t('invoicein.card.vat')" />
<VnTitle :url="getLink('vat')" :text="t('invoiceIn.card.vat')" />
<QTable
:columns="vatColumns"
:rows="entity.invoiceInTax"
@ -366,7 +366,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</QCard>
<!--Due Day-->
<QCard v-if="entity.invoiceInDueDay.length" class="due-day">
<VnTitle :url="getLink('due-day')" :text="t('invoicein.card.dueDay')" />
<VnTitle :url="getLink('due-day')" :text="t('invoiceIn.card.dueDay')" />
<QTable :columns="dueDayColumns" :rows="entity.invoiceInDueDay" flat>
<template #header="dueDayProps">
<QTr :props="dueDayProps" class="bg">
@ -404,7 +404,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
<QCard v-if="entity.invoiceInIntrastat.length">
<VnTitle
:url="getLink('intrastat')"
:text="t('invoicein.card.intrastat')"
:text="t('invoiceIn.card.intrastat')"
/>
<QTable
:columns="intrastatColumns"

View File

@ -83,7 +83,7 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
</template>
</VnSelect>
<VnInput
:label="t('invoicein.list.supplierRef')"
:label="t('invoiceIn.list.supplierRef')"
v-model="data.supplierRef"
/>
</VnRow>
@ -97,10 +97,10 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
map-options
hide-selected
:required="true"
:rules="validate('invoicein.companyFk')"
:rules="validate('invoiceIn.companyFk')"
/>
<VnInputDate
:label="t('invoicein.summary.issued')"
:label="t('invoiceIn.summary.issued')"
v-model="data.issued"
/>
</VnRow>

View File

@ -164,7 +164,7 @@ function handleDaysAgo(params, daysAgo) {
<QItem>
<QItemSection>
<QCheckbox
:label="$t('invoicein.isBooked')"
:label="$t('invoiceIn.isBooked')"
v-model="params.isBooked"
@update:model-value="searchFn()"
toggle-indeterminate

View File

@ -8,17 +8,17 @@ import InvoiceInFilter from './InvoiceInFilter.vue';
import InvoiceInSummary from './Card/InvoiceInSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import InvoiceInSearchbar from 'src/pages/InvoiceIn/InvoiceInSearchbar.vue';
import VnTable from 'src/components/VnTable/VnTable.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import FetchData from 'src/components/FetchData.vue';
import VnSection from 'src/components/common/VnSection.vue';
const user = useState().getUser();
const { viewSummary } = useSummaryDialog();
const { t } = useI18n();
const dataKey = 'InvoiceInList';
const tableRef = ref();
const companies = ref([]);
@ -26,7 +26,7 @@ const cols = computed(() => [
{
align: 'left',
name: 'isBooked',
label: t('invoicein.isBooked'),
label: t('invoiceIn.isBooked'),
columnFilter: false,
},
{
@ -41,7 +41,7 @@ const cols = computed(() => [
{
align: 'left',
name: 'supplierFk',
label: t('invoicein.list.supplier'),
label: t('invoiceIn.list.supplier'),
columnFilter: {
component: 'select',
attrs: {
@ -55,16 +55,16 @@ const cols = computed(() => [
{
align: 'left',
name: 'supplierRef',
label: t('invoicein.list.supplierRef'),
label: t('invoiceIn.list.supplierRef'),
},
{
align: 'left',
name: 'serial',
label: t('invoicein.serial'),
label: t('invoiceIn.serial'),
},
{
align: 'left',
label: t('invoicein.list.issued'),
label: t('invoiceIn.list.issued'),
name: 'issued',
component: null,
columnFilter: {
@ -74,7 +74,7 @@ const cols = computed(() => [
},
{
align: 'left',
label: t('invoicein.list.dueDated'),
label: t('invoiceIn.list.dueDated'),
name: 'dueDated',
component: null,
columnFilter: {
@ -86,12 +86,12 @@ const cols = computed(() => [
{
align: 'left',
name: 'awbCode',
label: t('invoicein.list.awb'),
label: t('invoiceIn.list.awb'),
},
{
align: 'left',
name: 'amount',
label: t('invoicein.list.amount'),
label: t('invoiceIn.list.amount'),
format: ({ amount }) => toCurrency(amount),
cardVisible: true,
},
@ -130,19 +130,25 @@ const cols = computed(() => [
},
]);
</script>
<template>
<FetchData url="Companies" @on-fetch="(data) => (companies = data)" auto-load />
<InvoiceInSearchbar />
<RightMenu>
<template #right-panel>
<InvoiceInFilter data-key="InvoiceInList" />
<VnSection
:data-key
:columns="cols"
prefix="invoiceIn"
:array-data-props="{
url: 'InvoiceIns/filter',
order: ['issued DESC', 'id DESC'],
}"
>
<template #advanced-menu>
<InvoiceInFilter :data-key />
</template>
</RightMenu>
<template #body>
<VnTable
ref="tableRef"
data-key="InvoiceInList"
url="InvoiceIns/filter"
:order="['issued DESC', 'id DESC']"
:data-key
:create="{
urlCreate: 'InvoiceIns',
title: t('globals.createInvoiceIn'),
@ -165,7 +171,7 @@ const cols = computed(() => [
<VnSelect
v-model="data.supplierFk"
url="Suppliers"
:fields="['id', 'nickname', 'name']"
:fields="['id', 'name', 'nickname']"
:label="t('globals.supplier')"
option-value="id"
option-label="nickname"
@ -176,13 +182,15 @@ const cols = computed(() => [
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
<QItemLabel caption> #{{ scope.opt?.id }}, {{ scope.opt?.name }} </QItemLabel>
<QItemLabel caption>
#{{ scope.opt?.id }}, {{ scope.opt?.name }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnInput
:label="t('invoicein.list.supplierRef')"
:label="t('invoiceIn.list.supplierRef')"
v-model="data.supplierRef"
/>
<VnSelect
@ -194,7 +202,12 @@ const cols = computed(() => [
option-label="code"
:required="true"
/>
<VnInputDate :label="t('invoicein.summary.issued')" v-model="data.issued" />
<VnInputDate
:label="t('invoiceIn.summary.issued')"
v-model="data.issued"
/>
</template>
</VnTable>
</template>
</VnSection>
</template>

View File

@ -1,18 +0,0 @@
<script setup>
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
</script>
<template>
<VnSearchbar
data-key="InvoiceInList"
:label="t('Search invoice')"
:info="t('Search invoices in by id or supplier fiscal name')"
url="InvoiceIns/filter"
/>
</template>
<i18n>
es:
Search invoice: Buscar factura recibida
Search invoices in by id or supplier fiscal name: Buscar facturas recibidas por id o por nombre fiscal del proveedor
</i18n>

View File

@ -1,4 +1,6 @@
invoicein:
invoiceIn:
search: Search invoice
searchInfo: Search incoming invoices by ID or supplier fiscal name
serial: Serial
isBooked: Is booked
list:

View File

@ -1,4 +1,6 @@
invoicein:
invoiceIn:
search: Buscar factura recibida
searchInfo: Buscar facturas recibidas por ID o nombre fiscal del proveedor
serial: Serie
isBooked: Contabilizada
list:
@ -63,6 +65,7 @@ invoicein:
params:
search: Id o nombre proveedor
correctedFk: Rectificada
isBooked: Contabilizada
account: Cuenta contable
correctingFk: Rectificativa

View File

@ -62,6 +62,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
:subtitle="data.subtitle"
@on-fetch="setData"
data-key="invoiceOutData"
width="lg-width"
>
<template #menu="{ entity, menuRef }">
<InvoiceOutDescriptorMenu :invoice-out-data="entity" :menu-ref="menuRef" />

View File

@ -76,6 +76,7 @@ const setData = (entity) => (data.value = useCardDescription(entity.code, entity
:subtitle="data.subtitle"
data-key="routeData"
@on-fetch="setData"
width="lg-width"
>
<template #body="{ entity }">
<VnLv :label="t('Date')" :value="toDate(entity?.dated)" />

View File

@ -36,7 +36,7 @@ const companySizes = [
/>
<VnSelectWorker
v-model="data.workerFk"
has-info="Responsible for approving invoices"
info="Responsible for approving invoices"
:rules="validate('supplier.workerFk')"
/>
<VnSelect

View File

@ -94,7 +94,7 @@ function handleLocation(data, location) {
<VnInput
v-model="data.name"
:label="t('supplier.fiscalData.name')"
uppercase="true"
:uppercase="true"
clearable
/>
<VnInput

View File

@ -16,6 +16,10 @@ const $props = defineProps({
required: false,
default: null,
},
summary: {
type: Object,
default: null,
},
});
const route = useRoute();
@ -102,6 +106,10 @@ const data = ref(useCardDescription());
function ticketFilter(ticket) {
return JSON.stringify({ clientFk: ticket.clientFk });
}
const setData = (entity) => {
data.value = useCardDescription(entity.ref, entity.id);
};
</script>
<template>
@ -111,7 +119,10 @@ function ticketFilter(ticket) {
:filter="filter"
:title="data.title"
:subtitle="data.subtitle"
@on-fetch="setData"
:summary="$props.summary"
data-key="ticketData"
width="lg-width"
>
<template #menu="{ entity }">
<TicketDescriptorMenu :ticket="entity" />
@ -157,7 +168,7 @@ function ticketFilter(ticket) {
<VnLv :label="t('globals.alias')" :value="entity.nickname" />
</template>
<template #icons="{ entity }">
<QCardActions class="q-gutter-x-xs">
<QCardActions class="q-gutter-x-md">
<QIcon
v-if="entity.client.isActive == false"
name="vn:disabled"
@ -201,7 +212,7 @@ function ticketFilter(ticket) {
</QCardActions>
</template>
<template #actions="{ entity }">
<QCardActions>
<QCardActions class="flex justify-center" style="padding-inline: 0">
<QBtn
size="md"
icon="vn:client"

View File

@ -6,7 +6,6 @@ import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { dashIfEmpty, toDate, toCurrency } from 'src/filters';
import CardSummary from 'components/ui/CardSummary.vue';
import FetchData from 'components/FetchData.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
import InvoiceOutDescriptorProxy from 'pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
import VnLv from 'src/components/ui/VnLv.vue';
@ -29,15 +28,14 @@ const { t } = useI18n();
const $props = defineProps({
id: {
type: Number,
required: false,
default: null,
},
});
const entityId = computed(() => $props.id || route.params.id);
const summaryRef = ref();
const ticket = computed(() => summaryRef.value?.entity);
const summary = ref();
const ticket = computed(() => summary.value?.entity);
const editableStates = ref([]);
const ticketUrl = ref();
const grafanaUrl = 'https://grafana.verdnatura.es';
@ -76,26 +74,27 @@ async function changeState(value) {
};
await axios.post(`Tickets/state`, formData);
notify('globals.dataSaved', 'positive');
summaryRef.value?.fetch();
summary.value?.fetch();
descriptorData.fetch({});
}
function toTicketUrl(section) {
return '#/ticket/' + entityId.value + '/' + section;
}
onMounted(async () => {
const filter = { fields: ['code', 'name', 'id', 'alertLevel'] };
const params = { filter: JSON.stringify(filter) };
editableStates.value = (await axios.get('States/editableStates', { params }))?.data;
});
</script>
<template>
<FetchData
url="States/editableStates"
:filter="{ fields: ['code', 'name', 'id', 'alertLevel'], order: 'name ASC' }"
auto-load
@on-fetch="(data) => (editableStates = data)"
/>
<CardSummary
ref="summaryRef"
ref="summary"
:url="`Tickets/${entityId}/summary`"
data-key="TicketSummary"
v-bind="$attrs.width"
>
<template #header-left>
<VnToSummary
@ -207,7 +206,7 @@ function toTicketUrl(section) {
</VnLv>
<VnLv :label="t('globals.weight')" :value="dashIfEmpty(entity.weight)" />
</QCard>
<QCard class="vn-one" style="flex: 2 1">
<QCard class="vn-one">
<VnTitle
:url="toTicketUrl('basic-data')"
:text="t('globals.summary.basicData')"
@ -454,7 +453,7 @@ function toTicketUrl(section) {
toCurrency(
props.row.quantity *
props.row.price *
((100 - props.row.discount) / 100)
((100 - props.row.discount) / 100),
)
}}
</QTd>

View File

@ -1,18 +1,12 @@
import { RouterView } from 'vue-router';
import { setRectificative } from 'src/pages/InvoiceIn/composables/setRectificative';
export default {
path: '/invoice-in',
name: 'InvoiceIn',
const invoiceInCard = {
name: 'InvoiceInCard',
path: ':id',
component: () => import('src/pages/InvoiceIn/Card/InvoiceInCard.vue'),
redirect: { name: 'InvoiceInSummary' },
meta: {
title: 'invoiceIns',
icon: 'vn:invoice-in',
moduleName: 'InvoiceIn',
},
component: RouterView,
redirect: { name: 'InvoiceInMain' },
menus: {
main: ['InvoiceInList', 'InvoiceInSerial'],
card: [
menu: [
'InvoiceInBasicData',
'InvoiceInVat',
'InvoiceInDueDay',
@ -23,60 +17,13 @@ export default {
},
children: [
{
path: '',
name: 'InvoiceInMain',
component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'InvoiceInList' },
children: [
{
path: 'list',
name: 'InvoiceInList',
meta: {
title: 'list',
icon: 'view_list',
},
component: () => import('src/pages/InvoiceIn/InvoiceInList.vue'),
},
{
path: 'serial',
name: 'InvoiceInSerial',
meta: {
title: 'serial',
icon: 'view_list',
},
component: () =>
import('src/pages/InvoiceIn/Serial/InvoiceInSerial.vue'),
},
{
path: 'create',
name: 'InvoiceInCreare',
meta: {
title: 'invoiceInCreate',
icon: 'create',
},
component: () => import('src/pages/InvoiceIn/InvoiceInCreate.vue'),
},
],
},
{
name: 'InvoiceInCard',
path: ':id',
component: () => import('src/pages/InvoiceIn/Card/InvoiceInCard.vue'),
redirect: { name: 'InvoiceInSummary' },
beforeEnter: async (to, from, next) => {
await setRectificative(to);
next();
},
children: [
{
name: 'InvoiceInSummary',
path: 'summary',
name: 'InvoiceInSummary',
meta: {
title: 'summary',
icon: 'view_list',
},
component: () =>
import('src/pages/InvoiceIn/Card/InvoiceInSummary.vue'),
component: () => import('src/pages/InvoiceIn/Card/InvoiceInSummary.vue'),
},
{
name: 'InvoiceInBasicData',
@ -117,15 +64,6 @@ export default {
component: () =>
import('src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue'),
},
{
name: 'InvoiceInLog',
path: 'log',
meta: {
title: 'log',
icon: 'history',
},
component: () => import('src/pages/InvoiceIn/Card/InvoiceInLog.vue'),
},
{
name: 'InvoiceInCorrective',
path: 'corrective',
@ -136,6 +74,71 @@ export default {
component: () =>
import('src/pages/InvoiceIn/Card/InvoiceInCorrective.vue'),
},
{
name: 'InvoiceInLog',
path: 'log',
meta: {
title: 'log',
icon: 'history',
},
component: () => import('src/pages/InvoiceIn/Card/InvoiceInLog.vue'),
},
],
};
export default {
name: 'InvoiceIn',
path: '/invoice-in',
meta: {
title: 'invoiceIns',
icon: 'vn:invoice-in',
moduleName: 'InvoiceIn',
menu: ['InvoiceInList', 'InvoiceInSerial'],
},
component: RouterView,
redirect: { name: 'InvoiceInMain' },
children: [
{
name: 'InvoiceInMain',
path: '',
component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'InvoiceInIndexMain' },
children: [
{
path: '',
name: 'InvoiceInIndexMain',
redirect: { name: 'InvoiceInList' },
component: () => import('src/pages/InvoiceIn/InvoiceInList.vue'),
children: [
{
name: 'InvoiceInList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
},
invoiceInCard,
],
},
{
path: 'create',
name: 'InvoiceInCreare',
meta: {
title: 'invoiceInCreate',
icon: 'create',
},
component: () => import('src/pages/InvoiceIn/InvoiceInCreate.vue'),
},
{
path: 'serial',
name: 'InvoiceInSerial',
meta: {
title: 'serial',
icon: 'view_list',
},
component: () => import('src/pages/InvoiceIn/Serial/InvoiceInSerial.vue'),
},
],
},
],

View File

@ -30,14 +30,15 @@ describe('TicketList', () => {
cy.get(firstRow).find('.q-btn:first').click();
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
});
// https://redmine.verdnatura.es/issues/8424
it.skip('should open ticket summary', () => {
it('should open ticket summary', () => {
searchResults();
cy.get(firstRow).find('.q-btn:last').click();
cy.dataCy('ticketSummary').should('exist');
cy.get('.summaryHeader').should('exist');
cy.get('.summaryBody').should('exist');
});
it.skip('Client list create new client', () => {
it('Client list create new client', () => {
cy.dataCy('vnTableCreateBtn').should('exist');
cy.dataCy('vnTableCreateBtn').click();
const data = {
@ -45,9 +46,9 @@ describe('TicketList', () => {
Warehouse: { val: 'Warehouse One', type: 'select' },
Address: { val: 'employee', type: 'select' },
Landed: { val: '01-01-2024', type: 'date' },
Agency: { val: 'Other agency', type: 'select' },
};
cy.fillInForm(data);
cy.dataCy('Agency_select').click();
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
cy.url().should('match', /\/ticket\/\d+\/summary/);

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" />
describe('TicketRequest', () => {
describe('TicketNotes', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
@ -13,7 +13,7 @@ describe('TicketRequest', () => {
cy.selectOption('[data-cy="ticketNotesObservationType"]:last', 'Weight');
cy.dataCy('ticketNotesDescription').should('exist');
cy.get('[data-cy="ticketNotesDescription"]:last').type(
'This is a note description'
'This is a note description',
);
cy.dataCy('crudModelDefaultSaveBtn').click();
cy.checkNotification('Data saved');

View File

@ -6,7 +6,7 @@ describe('TicketRequest', () => {
cy.visit('/#/ticket/31/request');
});
it.skip('Creates a new request', () => {
it('Creates a new request', () => {
cy.dataCy('vnTableCreateBtn').should('exist');
cy.dataCy('vnTableCreateBtn').click();
const data = {