Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8352-fixVnLog
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2025-01-28 12:28:37 +01:00
commit 067ecbf2dc
151 changed files with 3278 additions and 2625 deletions

4
.gitignore vendored
View File

@ -29,5 +29,5 @@ yarn-error.log*
*.sln *.sln
# Cypress directories and files # Cypress directories and files
/tests/cypress/videos /test/cypress/videos
/tests/cypress/screenshots /test/cypress/screenshots

View File

@ -1,3 +1,157 @@
# Version 25.04 - 2025-01-28
### Added 🆕
- chore: add task comment by:jorgep
- chore: refs #8198 rollback by:jorgep
- chore: refs #8322 unnecessary prop by:alexm
- feat: refs #7055 added new test case by:provira
- feat: refs #7055 created FilterItemForm test by:provira
- feat: refs #7077 created test for VnInputTime by:provira
- feat: refs #7078 created test for VnJsonValue by:provira
- feat: refs #7087 added more test cases by:provira
- feat: refs #7087 added new test by:provira
- feat: refs #7087 created CardSummary test by:provira
- feat: refs #7088 created test for FetchedTags by:provira
- feat: refs #7202 added new field by:Jon
- feat: refs #7882 Added coords to create a address by:guillermo
- feat: refs #7957 add tooltip and i18n support for search link in VnSearchbar component by:jorgep
- feat: refs #7957 enhance search functionality and improve data filtering logic by:jorgep
- feat: refs #7957 open in new tab by:jorgep
- feat: refs #7957 simplify fn to by:jorgep
- feat: refs #7957 update VnSearchbar component with improved search URL handling and styling enhancements by:jorgep
- feat: refs #8117 filters and values added as needed by:jtubau
- feat: refs #8197 useHasContent and use in VnSection and RightMenu by:alexm
- feat: refs #8219 added invoice out e2e tests by:Jon
- feat: refs #8219 global invoicing e2e by:Jon
- feat: refs #8220 added barcodes e2e test by:Jon
- feat: refs #8220 created items e2e by:Jon
- feat: refs #8220 modified create item form and added respective e2e by:Jon
- feat: refs #8225 added account and invoiceOut modules by:Jon
- feat: refs #8225 added entry module and fixed translations by:Jon
- feat: refs #8225 added invoiceIn and travel module by:Jon
- feat: refs #8225 added moreOptions and use it in customer and ticket summary by:Jon
- feat: refs #8225 added route and shelving module by:Jon
- feat: refs #8225 added worker and zone modules by:Jon
- feat: refs #8225 use it in claim, item and order modules by:Jon
- feat: refs #8258 added button to pass to uppercase by:provira
- feat: refs #8258 added uppercase option to VnInput by:provira
- feat: refs #8258 added uppercase validation on supplier create by:provira
- feat: refs #8298 add price optimum input and update translations for bonus and price optimum by:jgallego
- feat: refs #8316 add entryFilter prop to VnTable component in EntryList by:jtubau
- feat: refs #8322 added department changes by:provira
- feat: refs #8372 workerPBX by:robert
- feat: refs #8381 add initial and final temperature fields to entry forms and summaries by:jgallego
- feat: refs #8381 add initial and final temperature labels in English and Spanish locales by:jgallego
- feat: refs #8381 add toCelsius filter and update temperature fields in entry forms and summaries by:jgallego
- feat: skip tests by:jorgep
- style: refs #7957 update VnSearchbar padding for improved layout by:jorgep
### Changed 📦
- perf: refs #8219 #8219 minor change by:Javier Segarra
- perf: refs #8220 on-fetch and added missing translations by:Jon
- perf: refs #8220 on-fetch by:Jon
- perf: refs #8220 translations by:Jon
- perf: refs #8220 use searchbar selector in e2e tests by:Jon
- perf: remove warning default value by:Javier Segarra
- refactor: redirect using params by:Jon
- refactor: refs #7077 removed some comments by:provira
- refactor: refs #7087 removed unused imports by:provira
- refactor: refs #7100 added const mockData by:jtubau
- refactor: refs #7100 delete unnecesary set prop by:jtubau
- refactor: refs #7100 refactorized with methods by:jtubau
- refactor: refs #7957 remove blank by:jorgep
- refactor: refs #8198 simplify data fetching and filtering logic by:jorgep
- refactor: refs #8198 simplify state management and data fetching in ItemDiary component by:jorgep
- refactor: refs #8219 modified e2e tests and fixed some translations by:Jon
- refactor: refs #8219 modified list test, created cypress download folder and added to gitignore by:Jon
- refactor: refs #8219 requested changes by:Jon
- refactor: refs #8219 use checkNotification command by:Jon
- refactor: refs #8220 added data-cy for e2e tests by:Jon
- refactor: refs #8220 requested changes by:Jon
- refactor: refs #8220 skip failling test and modifed tag test by:Jon
- refactor: refs #8225 requested changes by:Jon
- refactor: refs #8247 use new acl for sysadmin by:Jon
- refactor: refs #8316 added claimFilter by:jtubau
- refactor: refs #8316 added entryFilter by:jtubau
- refactor: refs #8316 add new localization keys and update existing ones for entry components by:jtubau
- refactor: refs #8316 moved localizations to local locale by:jtubau
- refactor: refs #8316 move order localization by:jtubau
- refactor: refs #8316 remove unused OrderSearchbar component by:jtubau
- refactor: refs #8316 update EntryCard to use user-filter prop and remove exprBuilder from EntryList by:jtubau
- refactor: refs #8316 used VnSection and VnCardBeta by:jtubau
- refactor: refs #8322 changed translations by:provira
- refactor: refs #8322 changed Worker component to use VnSection/VnCardBeta by:provira
- refactor: refs #8322 set department inside worker by:alexm
- refactor: skip intermitent failing test by:Jon
### Fixed 🛠️
- feat: refs #8225 added entry module and fixed translations by:Jon
- fix: added missing translations in InvoiceIn by:provira
- fix: changed invoiceIn for InvoiceIn by:provira
- fix: changed translations to only use "invoicein" by:provira
- fix: department descriptor link by:Jon
- fix: e2e tests by:Jon
- fix: entry summary view and build warnings by:Jon
- fix: fixed InvoiceIn filter translations by:provira
- fix: modified setData in customerDescriptor to show the icons by:Jon
- fix: redirect to TicketSale from OrderLines (origin/Fix-RedirectToTicketSale) by:Jon
- fix: redirect when confirming lines by:Jon
- fix: refs #7055 #7055 #7055 fixed some tests by:provira
- fix: refs #7077 removed unused imports by:provira
- fix: refs #7078 added missing case with array by:provira
- fix: refs #7087 fixed some tests by:provira
- fix: refs #7088 changed "vm.vm" to "vm" by:provira
- fix: refs #7088 changed wrapper to vm by:provira
- fix: refs #7699 add icons and hint by:carlossa
- fix: refs #7699 add pwd vnInput by:carlossa
- fix: refs #7699 fix component by:carlossa
- fix: refs #7699 fix password visibility by:carlossa
- fix: refs #7699 fix tfront clean code by:carlossa
- fix: refs #7699 fix vnChangePassword, clean VnInput by:carlossa
- fix: refs #7699 fix vnInputPassword by:carlossa
- fix: refs #7957 add missing closing brace by:jorgep
- fix: refs #7957 css by:jorgep
- fix: refs #7957 rollback by:jorgep
- fix: refs #7957 update data-cy by:jorgep
- fix: refs #7957 update visibility handling for clear icon in VnInput component by:jorgep
- fix: refs #7957 vn-searchbar test by:jorgep
- fix: refs #8117 update salesPersonFk filter options and URL for improved data retrieval by:jtubau
- fix: refs #8197 not use yet by:alexm
- fix: refs #8198 update query param by:jorgep
- fix: refs #8219 fixed e2e tests by:Jon
- fix: refs #8219 fixed summary and global tests by:Jon
- fix: refs #8219 forgotten dataCy by:Jon
- fix: refs #8219 global e2e by:Jon
- fix: refs #8219 requested changes by:Jon
- fix: refs #8220 itemTag test by:Javier Segarra
- fix: refs #8225 invoice in translations by:Jon
- fix: refs #8243 fixed SkeletonSummary by:provira
- fix: refs #8247 conflicts by:Jon
- fix: refs #8247 fixed acls and added lost options by:Jon
- fix: refs #8316 ref="claimFilterRef" by:alexm
- fix: refs #8316 userFilter by:alexm
- fix: refs #8316 use rightMenu by:alexm
- fix: refs #8316 use section-searchbar by:alexm
- fix: refs #8317 disable action buttons when no rows are selected in ItemFixedPrice by:jtubau
- fix: refs #8322 unnecessary section by:alexm
- fix: refs #8338 fixed VnTable translations by:provira
- fix: refs #8338 removed chipLocale property/added more translations by:provira
- fix: refs #8448 e2e by:Jon
- fix: refs #8448 not use croppie by:alexm
- fix: remove departmentCode by:Javier Segarra
- fix: removed unused searchbar by:PAU ROVIRA ROSALENY
- fix: skip failling e2e by:Jon
- fix: sort by name in description by:Jon
- fix: translations by:Jon
- fix: use entryFilter by:alexm
- fix(VnCardBeta): add userFilter by:alexm
- refactor: refs #8219 modified e2e tests and fixed some translations by:Jon
- revert: revert header by:alexm
- test: fix expedition e2e by:alexm
# Version 25.00 - 2025-01-14 # Version 25.00 - 2025-01-14
### Added 🆕 ### Added 🆕

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import axios from 'axios'; import axios from 'axios';
import { computed, ref, watch } from 'vue'; import { computed, ref, useAttrs, watch } from 'vue';
import { useRouter, onBeforeRouteLeave } from 'vue-router'; import { useRouter, onBeforeRouteLeave } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
@ -17,6 +17,7 @@ const quasar = useQuasar();
const stateStore = useStateStore(); const stateStore = useStateStore();
const { t } = useI18n(); const { t } = useI18n();
const { validate } = useValidator(); const { validate } = useValidator();
const $attrs = useAttrs();
const $props = defineProps({ const $props = defineProps({
model: { model: {
@ -113,9 +114,11 @@ onBeforeRouteLeave((to, from, next) => {
}); });
async function fetch(data) { async function fetch(data) {
resetData(data); const keyData = $attrs['key-data'];
emit('onFetch', data); const rows = keyData ? data[keyData] : data;
return data; resetData(rows);
emit('onFetch', rows);
return rows;
} }
function resetData(data) { function resetData(data) {
@ -146,7 +149,7 @@ function filter(value, update, filterOptions) {
(ref) => { (ref) => {
ref.setOptionIndex(-1); ref.setOptionIndex(-1);
ref.moveOptionSelection(1, true); ref.moveOptionSelection(1, true);
} },
); );
} }
@ -212,7 +215,7 @@ async function remove(data) {
if (preRemove.length) { if (preRemove.length) {
newData = newData.filter( newData = newData.filter(
(form) => !preRemove.some((index) => index == form.$index) (form) => !preRemove.some((index) => index == form.$index),
); );
const changes = getChanges(); const changes = getChanges();
if (!changes.creates?.length && !changes.updates?.length) if (!changes.creates?.length && !changes.updates?.length)

View File

@ -349,4 +349,11 @@ es:
floramondo: Floramondo floramondo: Floramondo
salesPersonFk: Comprador salesPersonFk: Comprador
categoryFk: Categoría categoryFk: Categoría
Plant: Planta natural
Flower: Flor fresca
Handmade: Hecho a mano
Artificial: Artificial
Green: Verdes frescos
Accessories: Complementos florales
Fruit: Fruta
</i18n> </i18n>

View File

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

View File

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

View File

@ -12,6 +12,7 @@ const props = defineProps({
baseUrl: { type: String, default: undefined }, baseUrl: { type: String, default: undefined },
customUrl: { type: String, default: undefined }, customUrl: { type: String, default: undefined },
filter: { type: Object, default: () => {} }, filter: { type: Object, default: () => {} },
userFilter: { type: Object, default: () => {} },
descriptor: { type: Object, required: true }, descriptor: { type: Object, required: true },
filterPanel: { type: Object, default: undefined }, filterPanel: { type: Object, default: undefined },
searchDataKey: { type: String, default: undefined }, searchDataKey: { type: String, default: undefined },
@ -32,6 +33,7 @@ const url = computed(() => {
const arrayData = useArrayData(props.dataKey, { const arrayData = useArrayData(props.dataKey, {
url: url.value, url: url.value,
filter: props.filter, filter: props.filter,
userFilter: props.userFilter,
}); });
onBeforeMount(async () => { onBeforeMount(async () => {

View File

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

View File

@ -75,6 +75,7 @@ const focus = () => {
defineExpose({ defineExpose({
focus, focus,
vnInputRef,
}); });
const mixinRules = [ const mixinRules = [
@ -174,7 +175,11 @@ const handleUppercase = () => {
v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase" v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase"
@click="handleUppercase" @click="handleUppercase"
class="uppercase-icon" class="uppercase-icon"
/> >
<QTooltip>
{{ t('Convert to uppercase') }}
</QTooltip>
</QIcon>
<slot name="append" v-if="$slots.append && !$attrs.disabled" /> <slot name="append" v-if="$slots.append && !$attrs.disabled" />
<QIcon v-if="info" name="info"> <QIcon v-if="info" name="info">
@ -187,13 +192,26 @@ const handleUppercase = () => {
</div> </div>
</template> </template>
<style>
.uppercase-icon {
transition: color 0.3s, transform 0.2s;
cursor: pointer;
}
.uppercase-icon:hover {
color: #ed9937;
transform: scale(1.2);
}
</style>
<i18n> <i18n>
en: en:
inputMin: Must be more than {value} inputMin: Must be more than {value}
maxLength: The value exceeds {value} characters maxLength: The value exceeds {value} characters
inputMax: Must be less than {value} inputMax: Must be less than {value}
es: es:
inputMin: Debe ser mayor a {value} inputMin: Debe ser mayor a {value}
maxLength: El valor excede los {value} carácteres maxLength: El valor excede los {value} carácteres
inputMax: Debe ser menor a {value} inputMax: Debe ser menor a {value}
Convert to uppercase: Convertir a mayúsculas
</i18n> </i18n>

View File

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

View File

@ -75,6 +75,10 @@ onMounted(() => {
onUnmounted(unsubscribe); onUnmounted(unsubscribe);
}); });
onUnmounted(() => {
if (arrayData) arrayData.destroy();
});
function checkIsMain() { function checkIsMain() {
isMainSection.value = sectionValue.value == route.name; isMainSection.value = sectionValue.value == route.name;
if (!isMainSection.value && arrayData) { if (!isMainSection.value && arrayData) {
@ -94,8 +98,8 @@ function checkIsMain() {
/> />
<div :id="searchbarId"></div> <div :id="searchbarId"></div>
</slot> </slot>
<RightAdvancedMenu :is-main-section="isMainSection"> <RightAdvancedMenu :is-main-section="isMainSection && rightFilter">
<template #advanced-menu v-if="$slots[advancedMenuSlot] || rightFilter"> <template #advanced-menu v-if="$slots[advancedMenuSlot]">
<slot :name="advancedMenuSlot"> <slot :name="advancedMenuSlot">
<VnTableFilter <VnTableFilter
v-if="rightFilter && columns" v-if="rightFilter && columns"

View File

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

View File

@ -10,6 +10,10 @@ defineProps({
type: Object, type: Object,
required: true, required: true,
}, },
width: {
type: String,
default: 'md-width',
},
}); });
defineEmits([...useDialogPluginComponent.emits]); defineEmits([...useDialogPluginComponent.emits]);
@ -17,7 +21,19 @@ defineEmits([...useDialogPluginComponent.emits]);
const { dialogRef, onDialogHide } = useDialogPluginComponent(); const { dialogRef, onDialogHide } = useDialogPluginComponent();
</script> </script>
<template> <template>
<QDialog ref="dialogRef" @hide="onDialogHide" full-width> <QDialog ref="dialogRef" @hide="onDialogHide">
<component :is="summary" :id="id" /> <component :is="summary" :id="id" :class="width" />
</QDialog> </QDialog>
</template> </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

@ -0,0 +1,146 @@
import { createWrapper, axios } from 'app/test/vitest/helper';
import { vi, afterEach, beforeEach, beforeAll, describe, expect, it } from 'vitest';
import VnDms from 'src/components/common/VnDms.vue';
class MockFormData {
constructor() {
this.entries = {};
}
append(key, value) {
if (!key) {
throw new Error('Key is required for FormData.append');
}
this.entries[key] = value;
}
get(key) {
return this.entries[key] || null;
}
getAll() {
return this.entries;
}
}
global.FormData = MockFormData;
describe('VnDms', () => {
let wrapper;
let vm;
let postMock;
const postResponseMock = { data: { success: true } };
const data = {
hasFile: true,
hasFileAttached: true,
reference: 'DMS-test',
warehouseFk: 1,
companyFk: 2,
dmsTypeFk: 3,
description: 'This is a test description',
files: { name: 'example.txt', content: new Blob(['file content'], { type: 'text/plain' })},
};
const expectedBody = {
hasFile: true,
hasFileAttached: true,
reference: 'DMS-test',
warehouseId: 1,
companyId: 2,
dmsTypeId: 3,
description: 'This is a test description',
};
beforeAll(() => {
wrapper = createWrapper(VnDms, {
propsData: {
url: '/test',
formInitialData: { id: 1, reference: 'test' },
model: 'Worker',
}
});
wrapper = wrapper.wrapper;
vm = wrapper.vm;
vi.spyOn(vm, '$emit');
});
beforeEach(() => {
postMock = vi.spyOn(axios, 'post').mockResolvedValue(postResponseMock);
vm.dms = data;
});
afterEach(() => {
vi.clearAllMocks();
});
describe('mapperDms', () => {
it('should map DMS data correctly and add file to FormData', () => {
const [formData, params] = vm.mapperDms(data);
expect(formData.get('example.txt')).toBe(data.files);
expect(expectedBody).toEqual(params.params);
});
it('should map DMS data correctly without file', () => {
delete data.files;
const [formData, params] = vm.mapperDms(data);
expect(formData.getAll()).toEqual({});
expect(expectedBody).toEqual(params.params);
});
});
describe('getUrl', () => {
it('should returns prop url when is set', async () => {
expect(vm.getUrl()).toBe('/test');
});
it('should returns url dms/"props.formInitialData.id"/updateFile when prop url is null', async () => {
await wrapper.setProps({ url: null });
expect(vm.getUrl()).toBe('dms/1/updateFile');
});
it('should returns url "props.model"/"route.params.id"/uploadFile when formInitialData is null', async () => {
await wrapper.setProps({ formInitialData: null });
vm.route.params.id = '123';
expect(vm.getUrl()).toBe('Worker/123/uploadFile');
});
});
describe('save', () => {
it('should save data correctly', async () => {
await vm.save();
expect(postMock).toHaveBeenCalledWith(vm.getUrl(), expect.any(FormData), { params: expectedBody });
expect(wrapper.emitted('onDataSaved')).toBeTruthy();
});
});
describe('defaultData', () => {
it('should set dms with formInitialData', async () => {
const testData = {
hasFile: false,
hasFileAttached: false,
reference: 'defaultData-test',
warehouseFk: 2,
companyFk: 3,
dmsTypeFk: 2,
description: 'This is a test description'
}
await wrapper.setProps({ formInitialData: testData });
vm.defaultData();
expect(vm.dms).toEqual(testData);
});
it('should add reference with "route.params.id" to dms if formInitialData is null', async () => {
await wrapper.setProps({ formInitialData: null });
vm.route.params.id= '111';
vm.defaultData();
expect(vm.dms.reference).toBe('111');
});
});
});

View File

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

View File

@ -41,7 +41,7 @@ const card = toRef(props, 'item');
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<span class="link"> <span class="link" @click.stop>
{{ card.name }} {{ card.name }}
<ItemDescriptorProxy :id="card.id" /> <ItemDescriptorProxy :id="card.id" />
</span> </span>

View File

@ -190,7 +190,10 @@ const getLocale = (label) => {
const globalLocale = `globals.params.${param}`; const globalLocale = `globals.params.${param}`;
if (te(globalLocale)) return t(globalLocale); if (te(globalLocale)) return t(globalLocale);
else if (te(t(`params.${param}`))); else if (te(t(`params.${param}`)));
else return t(`${route.meta.moduleName.toLowerCase()}.params.${param}`); else {
const camelCaseModuleName = route.meta.moduleName.charAt(0).toLowerCase() + route.meta.moduleName.slice(1);
return t(`${camelCaseModuleName}.params.${param}`);
}
}; };
</script> </script>

View File

@ -78,6 +78,10 @@ const props = defineProps({
type: String, type: String,
default: '', default: '',
}, },
keyData: {
type: String,
default: undefined,
},
}); });
const emit = defineEmits(['onFetch', 'onPaginate', 'onChange']); const emit = defineEmits(['onFetch', 'onPaginate', 'onChange']);
@ -166,7 +170,7 @@ function emitStoreData() {
async function paginate() { async function paginate() {
const { page, rowsPerPage, sortBy, descending } = pagination.value; const { page, rowsPerPage, sortBy, descending } = pagination.value;
if (!props.url) return; if (!arrayData.store.url) return;
isLoading.value = true; isLoading.value = true;
await arrayData.loadMore(); await arrayData.loadMore();
@ -255,7 +259,7 @@ defineExpose({
:disable="disableInfiniteScroll || !store.hasMoreData" :disable="disableInfiniteScroll || !store.hasMoreData"
v-bind="$attrs" v-bind="$attrs"
> >
<slot name="body" :rows="store.data"></slot> <slot name="body" :rows="keyData ? store.data[keyData] : store.data"></slot>
<div v-if="isLoading" class="spinner info-row q-pa-md text-center"> <div v-if="isLoading" class="spinner info-row q-pa-md text-center">
<QSpinner color="primary" size="md" /> <QSpinner color="primary" size="md" />
</div> </div>

View File

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

View File

@ -170,10 +170,9 @@ export function useArrayData(key, userOptions) {
async function addOrder(field, direction = 'ASC') { async function addOrder(field, direction = 'ASC') {
const newOrder = field + ' ' + direction; const newOrder = field + ' ' + direction;
let order = store.order || []; const order = toArray(store.order);
if (typeof order == 'string') order = [order];
let index = order.findIndex((o) => o.split(' ')[0] === field); let index = getOrderIndex(order, field);
if (index > -1) { if (index > -1) {
order[index] = newOrder; order[index] = newOrder;
} else { } else {
@ -190,16 +189,24 @@ export function useArrayData(key, userOptions) {
} }
async function deleteOrder(field) { async function deleteOrder(field) {
let order = store.order ?? []; const order = toArray(store.order);
if (typeof order == 'string') order = [order]; const index = getOrderIndex(order, field);
const index = order.findIndex((o) => o.split(' ')[0] === field);
if (index > -1) order.splice(index, 1); if (index > -1) order.splice(index, 1);
store.order = order; store.order = order;
fetch({}); fetch({});
} }
function getOrderIndex(order, field) {
return order.findIndex((o) => o.split(' ')[0] === field);
}
function toArray(str = []) {
if (!str) return [];
if (Array.isArray(str)) return str;
if (typeof str === 'string') return str.split(',').map((item) => item.trim());
}
function sanitizerParams(params, exprBuilder) { function sanitizerParams(params, exprBuilder) {
for (const param in params) { for (const param in params) {
if (params[param] === '' || params[param] === null) { if (params[param] === '' || params[param] === null) {
@ -290,8 +297,7 @@ export function useArrayData(key, userOptions) {
Object.assign(params, store.userParams); Object.assign(params, store.userParams);
if (params.filter) params.filter.skip = store.skip; if (params.filter) params.filter.skip = store.skip;
if (store?.order && typeof store?.order == 'string') store.order = [store.order]; if (store.order) params.filter.order = toArray(store.order);
if (store.order?.length) params.filter.order = [...store.order];
else delete params.filter.order; else delete params.filter.order;
return { filter, params, limit: filter.limit }; return { filter, params, limit: filter.limit };

View File

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

View File

@ -312,11 +312,11 @@ input::-webkit-inner-spin-button {
} }
.q-item > .q-item__section:has(.q-checkbox) { .q-item > .q-item__section:has(.q-checkbox) {
max-width: min-content; max-width: fit-content;
} }
.row > .column:has(.q-checkbox) { .row > .column:has(.q-checkbox) {
max-width: min-content; max-width: fit-content;
} }
.q-field__inner { .q-field__inner {
.q-field__control { .q-field__control {

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

View File

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

View File

@ -2,9 +2,10 @@ globals:
lang: lang:
es: Spanish es: Spanish
en: English en: English
quantity: Quantity
language: Language language: Language
quantity: Quantity
entity: Entity entity: Entity
preview: Preview
user: User user: User
details: Details details: Details
collapseMenu: Collapse lateral menu collapseMenu: Collapse lateral menu
@ -36,7 +37,6 @@ globals:
confirm: Confirm confirm: Confirm
assign: Assign assign: Assign
back: Back back: Back
downloadPdf: Download PDF
yes: 'Yes' yes: 'Yes'
no: 'No' no: 'No'
noChanges: No changes to save noChanges: No changes to save
@ -60,6 +60,7 @@ globals:
downloadCSVSuccess: CSV downloaded successfully downloadCSVSuccess: CSV downloaded successfully
reference: Reference reference: Reference
agency: Agency agency: Agency
entry: Entry
warehouseOut: Warehouse Out warehouseOut: Warehouse Out
warehouseIn: Warehouse In warehouseIn: Warehouse In
landed: Landed landed: Landed
@ -68,11 +69,11 @@ globals:
amount: Amount amount: Amount
packages: Packages packages: Packages
download: Download download: Download
downloadPdf: Download PDF
selectRows: 'Select all { numberRows } row(s)' selectRows: 'Select all { numberRows } row(s)'
allRows: 'All { numberRows } row(s)' allRows: 'All { numberRows } row(s)'
markAll: Mark all markAll: Mark all
requiredField: Required field requiredField: Required field
valueCantBeEmpty: Value cannot be empty
class: clase class: clase
type: Type type: Type
reason: reason reason: reason
@ -82,6 +83,9 @@ globals:
warehouse: Warehouse warehouse: Warehouse
company: Company company: Company
fieldRequired: Field required fieldRequired: Field required
valueCantBeEmpty: Value cannot be empty
Value can't be blank: Value cannot be blank
Value can't be null: Value cannot be null
allowedFilesText: 'Allowed file types: { allowedContentTypes }' allowedFilesText: 'Allowed file types: { allowedContentTypes }'
smsSent: SMS sent smsSent: SMS sent
confirmDeletion: Confirm deletion confirmDeletion: Confirm deletion
@ -131,6 +135,26 @@ globals:
medium: Medium medium: Medium
big: Big big: Big
email: Email email: Email
supplier: Supplier
ticketList: Ticket List
created: Created
worker: Worker
now: Now
name: Name
new: New
comment: Comment
observations: Observations
goToModuleIndex: Go to module index
createInvoiceIn: Create invoice in
myAccount: My account
noOne: No one
maxTemperature: Max
minTemperature: Min
changePass: Change password
deleteConfirmTitle: Delete selected elements
changeState: Change state
raid: 'Raid {daysInForward} days'
isVies: Vies
pageTitles: pageTitles:
logIn: Login logIn: Login
addressEdit: Update address addressEdit: Update address
@ -152,13 +176,14 @@ globals:
subRoles: Subroles subRoles: Subroles
inheritedRoles: Inherited Roles inheritedRoles: Inherited Roles
customers: Customers customers: Customers
customerCreate: New customer
createCustomer: Create customer
createOrder: New order
list: List list: List
webPayments: Web Payments webPayments: Web Payments
extendedList: Extended list extendedList: Extended list
notifications: Notifications notifications: Notifications
defaulter: Defaulter defaulter: Defaulter
customerCreate: New customer
createOrder: New order
fiscalData: Fiscal data fiscalData: Fiscal data
billingData: Billing data billingData: Billing data
consignees: Consignees consignees: Consignees
@ -194,27 +219,28 @@ globals:
claims: Claims claims: Claims
claimCreate: New claim claimCreate: New claim
lines: Lines lines: Lines
photos: Photos
development: Development development: Development
photos: Photos
action: Action action: Action
invoiceOuts: Invoice out invoiceOuts: Invoice out
negativeBases: Negative Bases negativeBases: Negative Bases
globalInvoicing: Global invoicing globalInvoicing: Global invoicing
invoiceOutCreate: Create invoice out invoiceOutCreate: Create invoice out
order: Orders
orderList: List
orderCreate: New order
catalog: Catalog
volume: Volume
shelving: Shelving shelving: Shelving
shelvingList: Shelving List shelvingList: Shelving List
shelvingCreate: New shelving shelvingCreate: New shelving
invoiceIns: Invoices In invoiceIns: Invoices In
invoiceInCreate: Create invoice in invoiceInCreate: Create invoice in
vat: VAT vat: VAT
labeler: Labeler
dueDay: Due day dueDay: Due day
intrastat: Intrastat intrastat: Intrastat
corrective: Corrective corrective: Corrective
order: Orders
orderList: List
orderCreate: New order
catalog: Catalog
volume: Volume
workers: Workers workers: Workers
workerCreate: New worker workerCreate: New worker
department: Department department: Department
@ -227,10 +253,10 @@ globals:
wagonsList: Wagons List wagonsList: Wagons List
wagonCreate: Create wagon wagonCreate: Create wagon
wagonEdit: Edit wagon wagonEdit: Edit wagon
wagonCounter: Trolley counter
typesList: Types List typesList: Types List
typeCreate: Create type typeCreate: Create type
typeEdit: Edit type typeEdit: Edit type
wagonCounter: Trolley counter
roadmap: Roadmap roadmap: Roadmap
stops: Stops stops: Stops
routes: Routes routes: Routes
@ -239,21 +265,16 @@ globals:
routeCreate: New route routeCreate: New route
RouteRoadmap: Roadmaps RouteRoadmap: Roadmaps
RouteRoadmapCreate: Create roadmap RouteRoadmapCreate: Create roadmap
RouteExtendedList: Router
autonomous: Autonomous autonomous: Autonomous
suppliers: Suppliers suppliers: Suppliers
supplier: Supplier supplier: Supplier
expedition: Expedition
services: Service
components: Components
pictures: Pictures
packages: Packages
tracking: Tracking
labeler: Labeler
supplierCreate: New supplier supplierCreate: New supplier
accounts: Accounts accounts: Accounts
addresses: Addresses addresses: Addresses
agencyTerm: Agency agreement agencyTerm: Agency agreement
travel: Travels travel: Travels
create: Create
extraCommunity: Extra community extraCommunity: Extra community
travelCreate: New travel travelCreate: New travel
history: Log history: Log
@ -261,14 +282,13 @@ globals:
items: Items items: Items
diary: Diary diary: Diary
tags: Tags tags: Tags
create: Create
buyRequest: Buy requests
fixedPrice: Fixed prices fixedPrice: Fixed prices
buyRequest: Buy requests
wasteBreakdown: Waste breakdown wasteBreakdown: Waste breakdown
itemCreate: New item itemCreate: New item
barcode: Barcodes
tax: Tax tax: Tax
botanical: Botanical botanical: Botanical
barcode: Barcodes
itemTypeCreate: New item type itemTypeCreate: New item type
family: Item Type family: Item Type
lastEntries: Last entries lastEntries: Last entries
@ -284,13 +304,20 @@ globals:
formation: Formation formation: Formation
locations: Locations locations: Locations
warehouses: Warehouses warehouses: Warehouses
saleTracking: Sale tracking
roles: Roles roles: Roles
connections: Connections connections: Connections
acls: ACLs acls: ACLs
mailForwarding: Mail forwarding mailForwarding: Mail forwarding
mailAlias: Mail alias mailAlias: Mail alias
privileges: Privileges privileges: Privileges
observation: Notes
expedition: Expedition
saleTracking: Sale tracking
services: Service
tracking: Tracking
components: Components
pictures: Pictures
packages: Packages
ldap: LDAP ldap: LDAP
samba: Samba samba: Samba
twoFactor: Two factor twoFactor: Two factor
@ -301,27 +328,12 @@ globals:
serial: Serial serial: Serial
medical: Mutual medical: Mutual
pit: IRPF pit: IRPF
RouteExtendedList: Router
wasteRecalc: Waste recaclulate wasteRecalc: Waste recaclulate
operator: Operator operator: Operator
parking: Parking parking: Parking
supplier: Supplier
created: Created
worker: Worker
now: Now
name: Name
new: New
comment: Comment
observations: Observations
goToModuleIndex: Go to module index
unsavedPopup: unsavedPopup:
title: Unsaved changes will be lost title: Unsaved changes will be lost
subtitle: Are you sure exit without saving? subtitle: Are you sure exit without saving?
createInvoiceIn: Create invoice in
myAccount: My account
noOne: No one
maxTemperature: Max
minTemperature: Min
params: params:
clientFk: Client id clientFk: Client id
salesPersonFk: Sales person salesPersonFk: Sales person
@ -339,19 +351,13 @@ globals:
supplierFk: Supplier supplierFk: Supplier
supplierRef: Supplier ref supplierRef: Supplier ref
serial: Serial serial: Serial
amount: Importe amount: Amount
awbCode: AWB awbCode: AWB
correctedFk: Rectified correctedFk: Rectified
correctingFk: Rectificative correctingFk: Rectificative
daysOnward: Days onward daysOnward: Days onward
countryFk: Country countryFk: Country
companyFk: Company companyFk: Company
changePass: Change password
setPass: Set password
deleteConfirmTitle: Delete selected elements
changeState: Change state
raid: 'Raid {daysInForward} days'
isVies: Vies
errors: errors:
statusUnauthorized: Access denied statusUnauthorized: Access denied
statusInternalServerError: An internal server error has ocurred statusInternalServerError: An internal server error has ocurred
@ -447,6 +453,7 @@ ticket:
service: Service service: Service
attender: Attender attender: Attender
ok: Ok ok: Ok
consigneeStreet: Street
create: create:
address: Address address: Address
invoiceOut: invoiceOut:
@ -491,21 +498,6 @@ invoiceOut:
comercial: Comercial comercial: Comercial
errors: errors:
downloadCsvFailed: CSV download failed downloadCsvFailed: CSV download failed
shelving:
list:
parking: Parking
priority: Priority
newShelving: New Shelving
summary:
recyclable: Recyclable
parking:
pickingOrder: Picking order
sector: Sector
row: Row
column: Column
searchBar:
info: You can search by parking code
label: Search parking...
department: department:
chat: Chat chat: Chat
bossDepartment: Boss Department bossDepartment: Boss Department
@ -697,6 +689,9 @@ supplier:
consumption: consumption:
entry: Entry entry: Entry
travel: travel:
search: Search travel
searchInfo: You can search by travel id or name
id: Id
travelList: travelList:
tableVisibleColumns: tableVisibleColumns:
ref: Reference ref: Reference
@ -727,62 +722,7 @@ travel:
destination: Destination destination: Destination
thermograph: Thermograph thermograph: Thermograph
travelFileDescription: 'Travel id { travelId }' travelFileDescription: 'Travel id { travelId }'
item: carrier: Carrier
descriptor:
buyer: Buyer
color: Color
category: Category
available: Available
warehouseText: 'Calculated on the warehouse of { warehouseName }'
itemDiary: Item diary
list:
id: Identifier
stems: Stems
category: Category
typeName: Type
isActive: Active
userName: Buyer
weightByPiece: Weight/Piece
stemMultiplier: Multiplier
fixedPrice:
itemFk: Item ID
groupingPrice: Grouping price
packingPrice: Packing price
hasMinPrice: Has min price
minPrice: Min price
started: Started
ended: Ended
create:
priority: Priority
buyRequest:
requester: Requester
requested: Requested
attender: Atender
achieved: Achieved
concept: Concept
summary:
otherData: Other data
tax: Tax
botanical: Botanical
barcode: Barcode
completeName: Complete name
family: Familiy
stems: Stems
multiplier: Multiplier
buyer: Buyer
doPhoto: Do photo
intrastatCode: Intrastat code
ref: Reference
relevance: Relevance
weight: Weight (gram)/stem
units: Units/box
expense: Expense
generic: Generic
recycledPlastic: Recycled plastic
nonRecycledPlastic: Non recycled plastic
minSalesQuantity: Min sales quantity
genus: Genus
specie: Specie
components: components:
topbar: {} topbar: {}
itemsFilterPanel: itemsFilterPanel:

View File

@ -5,6 +5,7 @@ globals:
language: Idioma language: Idioma
quantity: Cantidad quantity: Cantidad
entity: Entidad entity: Entidad
preview: Vista previa
user: Usuario user: Usuario
details: Detalles details: Detalles
collapseMenu: Contraer menú lateral collapseMenu: Contraer menú lateral
@ -54,11 +55,12 @@ globals:
today: Hoy today: Hoy
yesterday: Ayer yesterday: Ayer
dateFormat: es-ES dateFormat: es-ES
noSelectedRows: No tienes ninguna línea seleccionada
microsip: Abrir en MicroSIP microsip: Abrir en MicroSIP
noSelectedRows: No tienes ninguna línea seleccionada
downloadCSVSuccess: Descarga de CSV exitosa downloadCSVSuccess: Descarga de CSV exitosa
reference: Referencia reference: Referencia
agency: Agencia agency: Agencia
entry: Entrada
warehouseOut: Alm. salida warehouseOut: Alm. salida
warehouseIn: Alm. entrada warehouseIn: Alm. entrada
landed: F. entrega landed: F. entrega
@ -133,6 +135,26 @@ globals:
medium: Mediano/a medium: Mediano/a
big: Grande big: Grande
email: Correo email: Correo
supplier: Proveedor
ticketList: Listado de tickets
created: Fecha creación
worker: Trabajador
now: Ahora
name: Nombre
new: Nuevo
comment: Comentario
observations: Observaciones
goToModuleIndex: Ir al índice del módulo
createInvoiceIn: Crear factura recibida
myAccount: Mi cuenta
noOne: Nadie
maxTemperature: Máx
minTemperature: Mín
changePass: Cambiar contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados
changeState: Cambiar estado
raid: 'Redada {daysInForward} días'
isVies: Vies
pageTitles: pageTitles:
logIn: Inicio de sesión logIn: Inicio de sesión
addressEdit: Modificar consignatario addressEdit: Modificar consignatario
@ -155,17 +177,17 @@ globals:
inheritedRoles: Roles heredados inheritedRoles: Roles heredados
customers: Clientes customers: Clientes
customerCreate: Nuevo cliente customerCreate: Nuevo cliente
createCustomer: Crear cliente
createOrder: Nuevo pedido createOrder: Nuevo pedido
list: Listado list: Listado
webPayments: Pagos Web webPayments: Pagos Web
extendedList: Listado extendido extendedList: Listado extendido
notifications: Notificaciones notifications: Notificaciones
defaulter: Morosos defaulter: Morosos
createCustomer: Crear cliente
fiscalData: Datos fiscales fiscalData: Datos fiscales
billingData: Forma de pago billingData: Forma de pago
consignees: Consignatarios consignees: Consignatarios
'address-create': Nuevo consignatario address-create: Nuevo consignatario
notes: Notas notes: Notas
credits: Créditos credits: Créditos
greuges: Greuges greuges: Greuges
@ -231,10 +253,10 @@ globals:
wagonsList: Listado vagones wagonsList: Listado vagones
wagonCreate: Crear tipo wagonCreate: Crear tipo
wagonEdit: Editar tipo wagonEdit: Editar tipo
wagonCounter: Contador de carros
typesList: Listado tipos typesList: Listado tipos
typeCreate: Crear tipo typeCreate: Crear tipo
typeEdit: Editar tipo typeEdit: Editar tipo
wagonCounter: Contador de carros
roadmap: Troncales roadmap: Troncales
stops: Paradas stops: Paradas
routes: Rutas routes: Rutas
@ -243,8 +265,8 @@ globals:
routeCreate: Nueva ruta routeCreate: Nueva ruta
RouteRoadmap: Troncales RouteRoadmap: Troncales
RouteRoadmapCreate: Crear troncal RouteRoadmapCreate: Crear troncal
autonomous: Autónomos
RouteExtendedList: Enrutador RouteExtendedList: Enrutador
autonomous: Autónomos
suppliers: Proveedores suppliers: Proveedores
supplier: Proveedor supplier: Proveedor
supplierCreate: Nuevo proveedor supplierCreate: Nuevo proveedor
@ -309,23 +331,9 @@ globals:
wasteRecalc: Recalcular mermas wasteRecalc: Recalcular mermas
operator: Operario operator: Operario
parking: Parking parking: Parking
supplier: Proveedor
created: Fecha creación
worker: Trabajador
now: Ahora
name: Nombre
new: Nuevo
comment: Comentario
observations: Observaciones
goToModuleIndex: Ir al índice del módulo
unsavedPopup: unsavedPopup:
title: Los cambios que no haya guardado se perderán title: Los cambios que no haya guardado se perderán
subtitle: ¿Seguro que quiere salir sin guardar? subtitle: ¿Seguro que quiere salir sin guardar?
createInvoiceIn: Crear factura recibida
myAccount: Mi cuenta
noOne: Nadie
maxTemperature: Máx
minTemperature: Mín
params: params:
clientFk: Id cliente clientFk: Id cliente
salesPersonFk: Comercial salesPersonFk: Comercial
@ -348,12 +356,6 @@ globals:
packing: ITP packing: ITP
countryFk: País countryFk: País
companyFk: Empresa companyFk: Empresa
changePass: Cambiar contraseña
setPass: Establecer contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados
changeState: Cambiar estado
raid: 'Redada {daysInForward} días'
isVies: Vies
errors: errors:
statusUnauthorized: Acceso denegado statusUnauthorized: Acceso denegado
statusInternalServerError: Ha ocurrido un error interno del servidor statusInternalServerError: Ha ocurrido un error interno del servidor
@ -446,13 +448,18 @@ ticket:
purchaseRequest: Petición de compra purchaseRequest: Petición de compra
service: Servicio service: Servicio
attender: Consignatario attender: Consignatario
consigneeStreet: Dirección
create: create:
address: Dirección address: Dirección
invoiceOut: order:
card: field:
issued: Fecha emisión salesPersonFk: Comercial
customerCard: Ficha del cliente form:
ticketList: Listado de tickets clientFk: Cliente
addressFk: Dirección
agencyModeFk: Agencia
list:
newOrder: Nuevo Pedido
summary: summary:
issued: Fecha issued: Fecha
dued: Fecha límite dued: Fecha límite
@ -463,47 +470,6 @@ invoiceOut:
fee: Cuota fee: Cuota
tickets: Tickets tickets: Tickets
totalWithVat: Importe totalWithVat: Importe
globalInvoices:
errors:
chooseValidClient: Selecciona un cliente válido
chooseValidCompany: Selecciona una empresa válida
chooseValidPrinter: Selecciona una impresora válida
chooseValidSerialType: Selecciona una tipo de serie válida
fillDates: La fecha de la factura y la fecha máxima deben estar completas
invoiceDateLessThanMaxDate: La fecha de la factura no puede ser menor que la fecha máxima
invoiceWithFutureDate: Existe una factura con una fecha futura
noTicketsToInvoice: No existen tickets para facturar
criticalInvoiceError: Error crítico en la facturación proceso detenido
invalidSerialTypeForAll: El tipo de serie debe ser global cuando se facturan todos los clientes
table:
addressId: Id dirección
streetAddress: Dirección fiscal
statusCard:
percentageText: '{getPercentage}% {getAddressNumber} de {getNAddresses}'
pdfsNumberText: '{nPdfs} de {totalPdfs} PDFs'
negativeBases:
clientId: Id cliente
base: Base
active: Activo
hasToInvoice: Facturar
verifiedData: Datos comprobados
comercial: Comercial
errors:
downloadCsvFailed: Error al descargar CSV
shelving:
list:
parking: Parking
priority: Prioridad
newShelving: Nuevo Carro
summary:
recyclable: Reciclable
parking:
pickingOrder: Orden de recogida
row: Fila
column: Columna
searchBar:
info: Puedes buscar por código de parking
label: Buscar parking...
department: department:
chat: Chat chat: Chat
bossDepartment: Jefe de departamento bossDepartment: Jefe de departamento
@ -693,6 +659,9 @@ supplier:
consumption: consumption:
entry: Entrada entry: Entrada
travel: travel:
search: Buscar envío
searchInfo: Buscar envío por id o nombre
id: Id
travelList: travelList:
tableVisibleColumns: tableVisibleColumns:
ref: Referencia ref: Referencia
@ -723,62 +692,7 @@ travel:
destination: Destino destination: Destino
thermograph: Termógrafo thermograph: Termógrafo
travelFileDescription: 'Id envío { travelId }' travelFileDescription: 'Id envío { travelId }'
item: carrier: Transportista
descriptor:
buyer: Comprador
color: Color
category: Categoría
available: Disponible
warehouseText: 'Calculado sobre el almacén de { warehouseName }'
itemDiary: Registro de compra-venta
list:
id: Identificador
stems: Tallos
category: Reino
typeName: Tipo
isActive: Activo
weightByPiece: Peso (gramos)/tallo
userName: Comprador
stemMultiplier: Multiplicador
fixedPrice:
itemFk: ID Artículo
groupingPrice: Precio grouping
packingPrice: Precio packing
hasMinPrice: Tiene precio mínimo
minPrice: Precio min
started: Inicio
ended: Fin
create:
priority: Prioridad
summary:
otherData: Otros datos
tax: IVA
botanical: Botánico
barcode: Código de barras
completeName: Nombre completo
family: Familia
stems: Tallos
multiplier: Multiplicador
buyer: Comprador
doPhoto: Hacer foto
intrastatCode: Código intrastat
ref: Referencia
relevance: Relevancia
weight: Peso (gramos)/tallo
units: Unidades/caja
expense: Gasto
generic: Genérico
recycledPlastic: Plástico reciclado
nonRecycledPlastic: Plástico no reciclado
minSalesQuantity: Cantidad mínima de venta
genus: Genus
specie: Specie
buyRequest:
requester: Solicitante
requested: Solicitado
attender: Comprador
achieved: Conseguido
concept: Concepto
components: components:
topbar: {} topbar: {}
itemsFilterPanel: itemsFilterPanel:

View File

@ -152,7 +152,8 @@ const updateDateParams = (value, params) => {
v-if="campaignList" v-if="campaignList"
data-key="CustomerConsumption" data-key="CustomerConsumption"
url="Clients/consumption" url="Clients/consumption"
:order="['itemTypeFk', 'itemName', 'itemSize', 'description']" :order="['itemTypeFk', 'itemName', 'itemSize', 'description']"
:filter="{ where: { clientFk: route.params.id } }"
:columns="columns" :columns="columns"
search-url="consumption" search-url="consumption"
:user-params="userParams" :user-params="userParams"

View File

@ -53,6 +53,7 @@ const debtWarning = computed(() => {
@on-fetch="setData" @on-fetch="setData"
:summary="$props.summary" :summary="$props.summary"
data-key="customer" data-key="customer"
width="lg-width"
> >
<template #menu="{ entity }"> <template #menu="{ entity }">
<CustomerDescriptorMenu :customer="entity" /> <CustomerDescriptorMenu :customer="entity" />
@ -187,14 +188,18 @@ const debtWarning = computed(() => {
</QBtn> </QBtn>
<QBtn <QBtn
:to="{ :to="{
name: 'AccountSummary', name: 'OrderList',
params: { id: entity.id }, query: {
createForm: JSON.stringify({
clientFk: entity.id,
}),
},
}" }"
size="md" size="md"
icon="face" icon="vn:basketadd"
color="primary" color="primary"
> >
<QTooltip>{{ t('Go to user') }}</QTooltip> <QTooltip>{{ t('globals.pageTitles.createOrder') }}</QTooltip>
</QBtn> </QBtn>
<QBtn <QBtn
v-if="entity.supplier" v-if="entity.supplier"
@ -218,14 +223,9 @@ en:
unpaidDated: 'Date {dated}' unpaidDated: 'Date {dated}'
unpaidAmount: 'Amount {amount}' unpaidAmount: 'Amount {amount}'
es: es:
Go to module index: Ir al índice del módulo
Customer ticket list: Listado de tickets del cliente Customer ticket list: Listado de tickets del cliente
Customer invoice out list: Listado de facturas del cliente Customer invoice out list: Listado de facturas del cliente
New order: Nuevo pedido
New ticket: Nuevo ticket
Go to user: Ir al usuario
Go to supplier: Ir al proveedor Go to supplier: Ir al proveedor
Customer unpaid: Cliente impago
Unpaid: Impagado Unpaid: Impagado
unpaidDated: 'Fecha {dated}' unpaidDated: 'Fecha {dated}'
unpaidAmount: 'Importe {amount}' unpaidAmount: 'Importe {amount}'

View File

@ -51,7 +51,6 @@ const openCreateForm = (type) => {
}; };
const clientFk = { const clientFk = {
ticket: 'clientId', ticket: 'clientId',
order: 'clientFk',
}; };
const key = clientFk[type]; const key = clientFk[type];
if (!key) return; if (!key) return;
@ -70,11 +69,6 @@ const openCreateForm = (type) => {
{{ t('globals.pageTitles.createTicket') }} {{ t('globals.pageTitles.createTicket') }}
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable @click="openCreateForm('order')">
<QItemSection>
{{ t('globals.pageTitles.createOrder') }}
</QItemSection>
</QItem>
<QItem v-ripple clickable> <QItem v-ripple clickable>
<QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection> <QItemSection @click="showSmsDialog()">{{ t('Send SMS') }}</QItemSection>
</QItem> </QItem>

View File

@ -50,7 +50,8 @@ const filterClientFindOne = {
> >
<template #form="{ data }"> <template #form="{ data }">
<VnRow> <VnRow>
<QCheckbox :label="t('Unpaid client')" v-model="data.unpaid" /> <QCheckbox :label="t('Unpaid client')" v-model="data.unpaid"
data-cy="UnpaidCheckBox" />
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md" v-show="data.unpaid"> <VnRow class="row q-gutter-md q-mb-md" v-show="data.unpaid">

View File

@ -1,3 +1,4 @@
<script setup> <script setup>
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
@ -169,9 +170,16 @@ en:
fi: FI fi: FI
salesPersonFk: Salesperson salesPersonFk: Salesperson
provinceFk: Province provinceFk: Province
isActive: Is active
city: City city: City
phone: Phone phone: Phone
email: Email email: Email
isToBeMailed: Mailed
isEqualizated: Equailized
businessTypeFk: Business type
sageTaxTypeFk: Sage Tax Type
sageTransactionTypeFk: Sage Tax Type
payMethodFk: Billing data
zoneFk: Zone zoneFk: Zone
socialName : Social name socialName : Social name
name: Name name: Name
@ -180,6 +188,13 @@ es:
params: params:
search: Contiene search: Contiene
fi: NIF fi: NIF
isActive: Activo
isToBeMailed: A enviar
isEqualizated: Recargo de equivalencia
businessTypeFk: Tipo de negocio
sageTaxTypeFk: Tipo de impuesto Sage
sageTransactionTypeFk: Tipo de impuesto Sage
payMethodFk: Forma de pago
salesPersonFk: Comercial salesPersonFk: Comercial
provinceFk: Provincia provinceFk: Provincia
city: Ciudad city: Ciudad

View File

@ -38,8 +38,8 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('globals.name'),
name: 'name', name: 'name',
label: t('globals.name'),
isTitle: true, isTitle: true,
create: true, create: true,
columnClass: 'expand', columnClass: 'expand',
@ -51,25 +51,30 @@ const columns = computed(() => [
isTitle: true, isTitle: true,
create: true, create: true,
columnClass: 'expand', columnClass: 'expand',
attrs: {
uppercase: true,
},
columnFilter: { columnFilter: {
component: 'select',
attrs: { attrs: {
url: 'Clients',
fields: ['socialName'],
optionLabel: 'socialName',
optionValue: 'socialName',
uppercase: false, uppercase: false,
}, },
}, },
attrs: {
uppercase: true,
},
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.fi'),
name: 'fi', name: 'fi',
label: t('customer.extendedList.tableVisibleColumns.fi'),
create: true, create: true,
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'),
name: 'salesPersonFk', name: 'salesPersonFk',
label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'),
component: 'select', component: 'select',
attrs: { attrs: {
url: 'Workers/activeWithInheritedRole', url: 'Workers/activeWithInheritedRole',
@ -85,8 +90,8 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.summary.credit'),
name: 'credit', name: 'credit',
label: t('customer.summary.credit'),
columnFilter: { columnFilter: {
component: 'number', component: 'number',
inWhere: true, inWhere: true,
@ -94,8 +99,8 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.creditInsurance'),
name: 'creditInsurance', name: 'creditInsurance',
label: t('customer.extendedList.tableVisibleColumns.creditInsurance'),
columnFilter: { columnFilter: {
component: 'number', component: 'number',
inWhere: true, inWhere: true,
@ -103,8 +108,8 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.phone'),
name: 'phone', name: 'phone',
label: t('customer.extendedList.tableVisibleColumns.phone'),
cardVisible: true, cardVisible: true,
columnFilter: { columnFilter: {
component: 'number', component: 'number',
@ -123,8 +128,8 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.summary.mobile'),
name: 'mobile', name: 'mobile',
label: t('customer.summary.mobile'),
cardVisible: true, cardVisible: true,
columnFilter: { columnFilter: {
component: 'number', component: 'number',
@ -133,8 +138,8 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.street'),
name: 'street', name: 'street',
label: t('customer.extendedList.tableVisibleColumns.street'),
create: true, create: true,
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
@ -143,8 +148,8 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.countryFk'),
name: 'countryFk', name: 'countryFk',
label: t('customer.extendedList.tableVisibleColumns.countryFk'),
columnFilter: { columnFilter: {
component: 'select', component: 'select',
inWhere: true, inWhere: true,
@ -157,8 +162,8 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.provinceFk'),
name: 'provinceFk', name: 'provinceFk',
label: t('customer.extendedList.tableVisibleColumns.provinceFk'),
component: 'select', component: 'select',
attrs: { attrs: {
url: 'Provinces', url: 'Provinces',
@ -170,24 +175,24 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.summary.city'),
name: 'city', name: 'city',
label: t('customer.summary.city'),
}, },
{ {
align: 'left', align: 'left',
label: t('customer.summary.postcode'),
name: 'postcode', name: 'postcode',
label: t('customer.summary.postcode'),
}, },
{ {
align: 'left', align: 'left',
label: t('globals.params.email'),
name: 'email', name: 'email',
label: t('globals.params.email'),
cardVisible: true, cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.created'),
name: 'created', name: 'created',
label: t('customer.extendedList.tableVisibleColumns.created'),
format: ({ created }) => toDate(created), format: ({ created }) => toDate(created),
columnFilter: { columnFilter: {
component: 'date', component: 'date',
@ -197,10 +202,13 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.businessTypeFk'),
name: 'businessTypeFk', name: 'businessTypeFk',
label: t('customer.extendedList.tableVisibleColumns.businessTypeFk'),
create: true, create: true,
component: 'select', component: 'select',
columnFilter: {
inWhere: true,
},
attrs: { attrs: {
url: 'BusinessTypes', url: 'BusinessTypes',
fields: ['code', 'description'], fields: ['code', 'description'],
@ -215,8 +223,8 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.summary.payMethodFk'),
name: 'payMethodFk', name: 'payMethodFk',
label: t('customer.summary.payMethodFk'),
columnFilter: { columnFilter: {
component: 'select', component: 'select',
attrs: { attrs: {
@ -236,8 +244,6 @@ const columns = computed(() => [
optionLabel: 'vat', optionLabel: 'vat',
url: 'SageTaxTypes', url: 'SageTaxTypes',
}, },
alias: 'sti',
inWhere: true,
}, },
format: (row, dashIfEmpty) => dashIfEmpty(row.sageTaxType), format: (row, dashIfEmpty) => dashIfEmpty(row.sageTaxType),
}, },
@ -251,15 +257,13 @@ const columns = computed(() => [
optionLabel: 'transaction', optionLabel: 'transaction',
url: 'SageTransactionTypes', url: 'SageTransactionTypes',
}, },
alias: 'stt',
inWhere: true,
}, },
format: (row, dashIfEmpty) => dashIfEmpty(row.sageTransactionType), format: (row, dashIfEmpty) => dashIfEmpty(row.sageTransactionType),
}, },
{ {
align: 'left', align: 'left',
label: t('customer.summary.isActive'),
name: 'isActive', name: 'isActive',
label: t('customer.summary.isActive'),
chip: { chip: {
color: null, color: null,
condition: (value) => !value, condition: (value) => !value,
@ -271,24 +275,24 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('globals.isVies'),
name: 'isVies', name: 'isVies',
label: t('globals.isVies'),
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.isTaxDataChecked'),
name: 'isTaxDataChecked', name: 'isTaxDataChecked',
label: t('customer.extendedList.tableVisibleColumns.isTaxDataChecked'),
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
}, },
{ {
align: 'left', align: 'left',
label: t('customer.summary.isEqualizated'),
name: 'isEqualizated', name: 'isEqualizated',
label: t('customer.summary.isEqualizated'),
create: true, create: true,
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
@ -296,8 +300,8 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.isFreezed'),
name: 'isFreezed', name: 'isFreezed',
label: t('customer.extendedList.tableVisibleColumns.isFreezed'),
chip: { chip: {
color: null, color: null,
condition: (value) => value, condition: (value) => value,
@ -309,48 +313,48 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.hasToInvoice'),
name: 'hasToInvoice', name: 'hasToInvoice',
label: t('customer.extendedList.tableVisibleColumns.hasToInvoice'),
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.hasToInvoiceByAddress'),
name: 'hasToInvoiceByAddress', name: 'hasToInvoiceByAddress',
label: t('customer.extendedList.tableVisibleColumns.hasToInvoiceByAddress'),
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.isToBeMailed'),
name: 'isToBeMailed', name: 'isToBeMailed',
label: t('customer.extendedList.tableVisibleColumns.isToBeMailed'),
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
}, },
{ {
align: 'left', align: 'left',
label: t('customer.summary.hasLcr'),
name: 'hasLcr', name: 'hasLcr',
label: t('customer.summary.hasLcr'),
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
}, },
{ {
align: 'left', align: 'left',
label: t('customer.summary.hasCoreVnl'),
name: 'hasCoreVnl', name: 'hasCoreVnl',
label: t('customer.summary.hasCoreVnl'),
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
}, },
{ {
align: 'left', align: 'left',
label: t('customer.extendedList.tableVisibleColumns.hasSepaVnl'),
name: 'hasSepaVnl', name: 'hasSepaVnl',
label: t('customer.extendedList.tableVisibleColumns.hasSepaVnl'),
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
@ -408,7 +412,7 @@ function handleLocation(data, location) {
order: ['id DESC'], order: ['id DESC'],
}" }"
> >
<template #rightMenu> <template #advanced-menu>
<CustomerFilter data-key="CustomerList" /> <CustomerFilter data-key="CustomerList" />
</template> </template>
<template #body> <template #body>

View File

@ -11,14 +11,14 @@ import VnInput from 'src/components/common/VnInput.vue';
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue'; import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue'; import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
import VnTable from 'src/components/VnTable/VnTable.vue'; import VnTable from 'src/components/VnTable/VnTable.vue';
import { useArrayData } from 'src/composables/useArrayData';
const { t } = useI18n(); const { t } = useI18n();
const quasar = useQuasar(); const quasar = useQuasar();
const dataRef = ref(null); const dataRef = ref(null);
const balanceDueTotal = ref(0);
const selected = ref([]); const selected = ref([]);
const arrayData = useArrayData('CustomerDefaulter');
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
@ -165,26 +165,37 @@ const viewAddObservation = (rowsSelected) => {
}); });
}; };
const onFetch = async (data) => {
balanceDueTotal.value = data.reduce((acc, { amount = 0 }) => acc + amount, 0);
};
function exprBuilder(param, value) { function exprBuilder(param, value) {
switch (param) { switch (param) {
case 'clientFk':
return { [`d.${param}`]: value };
case 'creditInsurance':
case 'amount':
case 'workerFk':
case 'departmentFk':
case 'countryFk':
case 'payMethod':
case 'salesPersonFk': case 'salesPersonFk':
case 'creditInsurance':
case 'countryFk':
return { [`c.${param}`]: value };
case 'payMethod':
return { [`c.payMethodFk`]: value };
case 'workerFk':
return { [`co.${param}`]: value };
case 'departmentFk':
return { [`wd.${param}`]: value };
case 'amount':
case 'clientFk':
return { [`d.${param}`]: value }; return { [`d.${param}`]: value };
case 'created': case 'created':
return { 'd.created': { between: dateRange(value) } }; return { 'd.created': { between: dateRange(value) } };
case 'defaulterSinced': case 'defaulterSinced':
return { 'd.defaulterSinced': { between: dateRange(value) } }; return { 'd.defaulterSinced': { between: dateRange(value) } };
case 'isWorker': {
if (value == undefined) return;
const search = value ? 'worker' : { neq: 'worker' };
return { 'c.businessTypeFk': search };
}
case 'hasRecovery': {
if (value == undefined) return;
const search = value ? null : { neq: null };
return { 'r.finished': search };
}
case 'observation':
return { 'co.text': { like: `%${value}%` } };
} }
} }
</script> </script>
@ -192,7 +203,7 @@ function exprBuilder(param, value) {
<template> <template>
<VnSubToolbar> <VnSubToolbar>
<template #st-data> <template #st-data>
<CustomerBalanceDueTotal :amount="balanceDueTotal" /> <CustomerBalanceDueTotal :amount="arrayData.store.data?.amount" />
</template> </template>
<template #st-actions> <template #st-actions>
<QBtn <QBtn
@ -211,8 +222,6 @@ function exprBuilder(param, value) {
url="Defaulters/filter" url="Defaulters/filter"
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
:columns="columns" :columns="columns"
@on-fetch="onFetch"
:use-model="true"
:table="{ :table="{
'row-key': 'clientFk', 'row-key': 'clientFk',
selection: 'multiple', selection: 'multiple',
@ -221,6 +230,7 @@ function exprBuilder(param, value) {
:disable-option="{ card: true }" :disable-option="{ card: true }"
auto-load auto-load
:order="['amount DESC']" :order="['amount DESC']"
key-data="defaulters"
> >
<template #column-clientFk="{ row }"> <template #column-clientFk="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>

View File

@ -2,7 +2,7 @@
import { onBeforeMount, ref } from 'vue'; import { onBeforeMount, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useQuasar } from 'quasar';
import axios from 'axios'; import axios from 'axios';
import VnLocation from 'src/components/common/VnLocation.vue'; import VnLocation from 'src/components/common/VnLocation.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
@ -13,11 +13,12 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue'; import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue'; import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import VnConfirm from 'components/ui/VnConfirm.vue';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const quasar = useQuasar();
const urlUpdate = ref(''); const urlUpdate = ref('');
const agencyModes = ref([]); const agencyModes = ref([]);
const incoterms = ref([]); const incoterms = ref([]);
@ -83,8 +84,26 @@ const deleteNote = (id, index) => {
notes.value.splice(index, 1); notes.value.splice(index, 1);
}; };
const onDataSaved = async () => { const updateAddress = async (data) => {
let payload = { await axios.patch(urlUpdate.value, data);
};
const updateAddressTicket = async () => {
urlUpdate.value += '?updateObservations=true';
};
const updateObservations = async (payload) => {
await axios.post('AddressObservations/crud', payload);
notes.value = [];
deletes.value = [];
toCustomerAddress();
};
async function updateAll({ data, payload }) {
await updateObservations(payload);
await updateAddress(data);
}
function getPayload() {
return {
creates: notes.value.filter((note) => note.$isNew), creates: notes.value.filter((note) => note.$isNew),
deletes: deletes.value, deletes: deletes.value,
updates: notes.value updates: notes.value
@ -101,14 +120,40 @@ const onDataSaved = async () => {
where: { id: note.id }, where: { id: note.id },
})), })),
}; };
}
await axios.post('AddressObservations/crud', payload); async function handleDialog(data) {
notes.value = []; const payload = getPayload();
deletes.value = []; const body = { data, payload };
toCustomerAddress(); if (payload.updates.length) {
}; quasar
.dialog({
component: VnConfirm,
componentProps: {
title: t(
'confirmTicket'
),
message: t('confirmDeletionMessage'),
},
})
.onOk(async () => {
await updateAddressTicket();
await updateAll(body);
toCustomerAddress();
})
.onCancel(async () => {
await updateAll(body);
toCustomerAddress();
});
} else {
updateAll(body);
toCustomerAddress();
}
}
const toCustomerAddress = () => { const toCustomerAddress = () => {
notes.value = [];
deletes.value = [];
router.push({ router.push({
name: 'CustomerAddress', name: 'CustomerAddress',
params: { params: {
@ -143,7 +188,7 @@ function handleLocation(data, location) {
:observe-form-changes="false" :observe-form-changes="false"
:url-update="urlUpdate" :url-update="urlUpdate"
:url="`Addresses/${route.params.addressId}`" :url="`Addresses/${route.params.addressId}`"
@on-data-saved="onDataSaved()" :save-fn="handleDialog"
auto-load auto-load
> >
<template #moreActions> <template #moreActions>
@ -336,4 +381,9 @@ es:
Remove note: Eliminar nota Remove note: Eliminar nota
Longitude: Longitud Longitude: Longitud
Latitude: Latitud Latitude: Latitud
confirmTicket: ¿Desea modificar también los estados de todos los tickets que están a punto de ser servidos?
confirmDeletionMessage: Si le das a aceptar, se modificaran todas las notas de los ticket a futuro
en:
confirmTicket: Do you also want to modify the states of all the tickets that are about to be served?
confirmDeletionMessage: If you click accept, all the notes of the future tickets will be modified
</i18n> </i18n>

View File

@ -214,7 +214,7 @@ const toCustomerSamples = () => {
<template #custom-buttons> <template #custom-buttons>
<QBtn <QBtn
:disabled="isLoading || !sampleType?.hasPreview" :disabled="isLoading || !sampleType?.hasPreview"
:label="t('Preview')" :label="t('globals.preview')"
:loading="isLoading" :loading="isLoading"
@click.stop="getPreview()" @click.stop="getPreview()"
color="primary" color="primary"
@ -353,7 +353,6 @@ es:
Its only used when sample is sent: Se utiliza únicamente cuando se envía la plantilla Its only used when sample is sent: Se utiliza únicamente cuando se envía la plantilla
To who should the recipient replay?: ¿A quien debería responder el destinatario? To who should the recipient replay?: ¿A quien debería responder el destinatario?
Edit address: Editar dirección Edit address: Editar dirección
Preview: Vista previa
Email cannot be blank: Debes introducir un email Email cannot be blank: Debes introducir un email
Choose a sample: Selecciona una plantilla Choose a sample: Selecciona una plantilla
Choose a company: Selecciona una empresa Choose a company: Selecciona una empresa

View File

@ -114,7 +114,7 @@ const columns = computed(() => [
action: ({ id }) => action: ({ id }) =>
window.open( window.open(
router.resolve({ params: { id }, name: 'TicketSale' }).href, router.resolve({ params: { id }, name: 'TicketSale' }).href,
'_blank' '_blank',
), ),
isPrimary: true, isPrimary: true,
}, },
@ -122,7 +122,7 @@ const columns = computed(() => [
title: t('components.smartCard.viewSummary'), title: t('components.smartCard.viewSummary'),
icon: 'preview', icon: 'preview',
isPrimary: true, isPrimary: true,
action: (row) => viewSummary(row.id, TicketSummary), action: (row) => viewSummary(row.id, TicketSummary, 'lg-width'),
}, },
], ],
}, },

View File

@ -0,0 +1,33 @@
import { describe, it, expect, vi, afterEach } from 'vitest';
import axios from 'axios';
import { getAddresses } from 'src/pages/Customer/composables/getAddresses';
vi.mock('axios');
describe('getAddresses', () => {
afterEach(() => {
vi.clearAllMocks();
});
it('should fetch addresses with correct parameters for a valid clientId', async () => {
const clientId = '12345';
await getAddresses(clientId);
expect(axios.get).toHaveBeenCalledWith(`Clients/${clientId}/addresses`, {
params: {
filter: JSON.stringify({
fields: ['nickname', 'street', 'city', 'id'],
where: { isActive: true },
order: 'nickname ASC',
}),
},
});
});
it('should return undefined when clientId is not provided', async () => {
await getAddresses(undefined);
expect(axios.get).not.toHaveBeenCalled();
});
});

View File

@ -0,0 +1,41 @@
import { describe, it, expect, vi, afterEach } from 'vitest';
import axios from 'axios';
import { getClient } from 'src/pages/Customer/composables/getClient';
vi.mock('axios');
describe('getClient', () => {
afterEach(() => {
vi.clearAllMocks();
});
const generateParams = (clientId) => ({
params: {
filter: JSON.stringify({
include: {
relation: 'defaultAddress',
scope: {
fields: ['id', 'agencyModeFk'],
},
},
where: { id: clientId },
}),
},
});
it('should fetch client data with correct parameters for a valid clientId', async () => {
const clientId = '12345';
await getClient(clientId);
expect(axios.get).toHaveBeenCalledWith('Clients', generateParams(clientId));
});
it('should return undefined when clientId is not provided', async () => {
const clientId = undefined;
await getClient(clientId);
expect(axios.get).toHaveBeenCalledWith('Clients', generateParams(clientId));
});
});

View File

@ -0,0 +1,14 @@
import axios from 'axios';
export async function getAddresses(clientId) {
if (!clientId) return;
const filter = {
fields: ['nickname', 'street', 'city', 'id'],
where: { isActive: true },
order: 'nickname ASC',
};
const params = { filter: JSON.stringify(filter) };
return await axios.get(`Clients/${clientId}/addresses`, {
params,
});
};

View File

@ -0,0 +1,15 @@
import axios from 'axios';
export async function getClient(clientId) {
const filter = {
include: {
relation: 'defaultAddress',
scope: {
fields: ['id', 'agencyModeFk'],
},
},
where: { id: clientId },
};
const params = { filter: JSON.stringify(filter) };
return await axios.get('Clients', { params });
};

View File

@ -2,13 +2,10 @@
import { ref, computed, onMounted } from 'vue'; import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import CardDescriptor from 'components/ui/CardDescriptor.vue'; import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import filter from './EntryFilter.js';
import EntryDescriptorMenu from './EntryDescriptorMenu.vue'; import EntryDescriptorMenu from './EntryDescriptorMenu.vue';
const $props = defineProps({ const $props = defineProps({
@ -23,7 +20,42 @@ const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const entryDescriptorRef = ref(null); const entryDescriptorRef = ref(null);
const url = ref(); 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(() => { const entityId = computed(() => {
return $props.id || route.params.id; return $props.id || route.params.id;
}); });
@ -58,9 +90,10 @@ const getEntryRedirectionFilter = (entry) => {
ref="entryDescriptorRef" ref="entryDescriptorRef"
module="Entry" module="Entry"
:url="`Entries/${entityId}`" :url="`Entries/${entityId}`"
:filter="filter" :userFilter="entryFilter"
title="supplier.nickname" title="supplier.nickname"
data-key="Entry" data-key="Entry"
width="lg-width"
> >
<template #menu="{ entity }"> <template #menu="{ entity }">
<EntryDescriptorMenu :id="entity.id" /> <EntryDescriptorMenu :id="entity.id" />
@ -147,7 +180,7 @@ es:
Supplier card: Ficha del proveedor Supplier card: Ficha del proveedor
All travels with current agency: Todos los envíos con la agencia actual All travels with current agency: Todos los envíos con la agencia actual
All entries with current supplier: Todas las entradas con el proveedor actual All entries with current supplier: Todas las entradas con el proveedor actual
Go to module index: Ir al índice del modulo Show entry report: Ver informe del pedido
Inventory entry: Es inventario Inventory entry: Es inventario
Virtual entry: Es una redada Virtual entry: Es una redada
</i18n> </i18n>

View File

@ -1,5 +1,11 @@
<script setup> <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 { usePrintService } from 'composables/usePrintService';
import useNotify from 'src/composables/useNotify.js';
import VnConfirm from 'src/components/ui/VnConfirm.vue';
const { openReport } = usePrintService(); const { openReport } = usePrintService();
@ -9,14 +15,47 @@ const $props = defineProps({
required: true, required: true,
}, },
}); });
const { t } = useI18n();
const { notify } = useNotify();
const quasar = useQuasar();
const route = useRoute();
function showEntryReport() { function showEntryReport() {
openReport(`Entries/${$props.id}/entry-order-pdf`); 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> </script>
<template> <template>
<QItem v-ripple clickable @click="showEntryReport"> <QItem v-ripple clickable @click="showEntryReport">
<QItemSection>{{ $t('entryList.list.showEntryReport') }}</QItemSection> <QItemSection>{{ $t('entry.descriptorMenu.showEntryReport') }}</QItemSection>
</QItem>
<QItem v-ripple clickable @click="openDialog">
<QItemSection>{{ t('transferEntry') }}</QItemSection>
</QItem> </QItem>
</template> </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

@ -205,7 +205,7 @@ const columns = computed(() => [
userFilter: entryFilter, userFilter: entryFilter,
}" }"
> >
<template #rightMenu> <template #advanced-menu>
<EntryFilter data-key="EntryList" /> <EntryFilter data-key="EntryList" />
</template> </template>
<template #body> <template #body>
@ -231,7 +231,7 @@ const columns = computed(() => [
> >
<QTooltip>{{ <QTooltip>{{
t( t(
'entry.list.tableVisibleColumns.isExcludedFromAvailable' 'entry.list.tableVisibleColumns.isExcludedFromAvailable',
) )
}}</QTooltip> }}</QTooltip>
</QIcon> </QIcon>

View File

@ -76,6 +76,8 @@ entry:
warehouseInFk: Warehouse in warehouseInFk: Warehouse in
search: Search entries search: Search entries
searchInfo: You can search by entry reference searchInfo: You can search by entry reference
descriptorMenu:
showEntryReport: Show entry report
entryFilter: entryFilter:
params: params:
invoiceNumber: Invoice number invoiceNumber: Invoice number

View File

@ -75,6 +75,8 @@ entry:
warehouseInFk: Alm. entrada warehouseInFk: Alm. entrada
daysOnward: Días adelante daysOnward: Días adelante
daysAgo: Días atras daysAgo: Días atras
descriptorMenu:
showEntryReport: Ver informe del pedido
search: Buscar entradas search: Buscar entradas
searchInfo: Puedes buscar por referencia de entrada searchInfo: Puedes buscar por referencia de entrada
entryFilter: entryFilter:

View File

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

View File

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

View File

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

View File

@ -40,15 +40,15 @@ const cplusRectificationTypes = ref([]);
const siiTypeInvoiceIns = ref([]); const siiTypeInvoiceIns = ref([]);
const actions = { const actions = {
unbook: { unbook: {
title: t('assertAction', { action: t('invoicein.descriptorMenu.unbook') }), title: t('assertAction', { action: t('invoiceIn.descriptorMenu.unbook') }),
action: toUnbook, action: toUnbook,
}, },
delete: { delete: {
title: t('assertAction', { action: t('invoicein.descriptorMenu.delete') }), title: t('assertAction', { action: t('invoiceIn.descriptorMenu.delete') }),
action: deleteInvoice, action: deleteInvoice,
}, },
clone: { clone: {
title: t('assertAction', { action: t('invoicein.descriptorMenu.clone') }), title: t('assertAction', { action: t('invoiceIn.descriptorMenu.clone') }),
action: cloneInvoice, action: cloneInvoice,
}, },
showPdf: { cb: showPdfInvoice }, showPdf: { cb: showPdfInvoice },
@ -96,7 +96,7 @@ async function deleteInvoice() {
await axios.delete(`InvoiceIns/${entityId.value}`); await axios.delete(`InvoiceIns/${entityId.value}`);
quasar.notify({ quasar.notify({
type: 'positive', type: 'positive',
message: t('invoicein.descriptorMenu.invoiceDeleted'), message: t('invoiceIn.descriptorMenu.invoiceDeleted'),
}); });
push({ path: '/invoice-in' }); push({ path: '/invoice-in' });
} }
@ -105,7 +105,7 @@ async function cloneInvoice() {
const { data } = await axios.post(`InvoiceIns/${entityId.value}/clone`); const { data } = await axios.post(`InvoiceIns/${entityId.value}/clone`);
quasar.notify({ quasar.notify({
type: 'positive', type: 'positive',
message: t('invoicein.descriptorMenu.invoiceCloned'), message: t('invoiceIn.descriptorMenu.invoiceCloned'),
}); });
push({ path: `/invoice-in/${data.id}/summary` }); push({ path: `/invoice-in/${data.id}/summary` });
} }
@ -149,7 +149,7 @@ function sendPdfInvoice({ address }) {
const createInvoiceInCorrection = async () => { const createInvoiceInCorrection = async () => {
const { data: correctingId } = await axios.post( const { data: correctingId } = await axios.post(
'InvoiceIns/corrective', 'InvoiceIns/corrective',
Object.assign(correctionFormData, { id: entityId.value }) Object.assign(correctionFormData, { id: entityId.value }),
); );
push({ path: `/invoice-in/${correctingId}/summary` }); push({ path: `/invoice-in/${correctingId}/summary` });
}; };
@ -186,7 +186,7 @@ const createInvoiceInCorrection = async () => {
clickable clickable
@click="book(entityId)" @click="book(entityId)"
> >
<QItemSection>{{ t('invoicein.descriptorMenu.toBook') }}</QItemSection> <QItemSection>{{ t('invoiceIn.descriptorMenu.toBook') }}</QItemSection>
</QItem> </QItem>
</template> </template>
</InvoiceInToBook> </InvoiceInToBook>
@ -197,7 +197,7 @@ const createInvoiceInCorrection = async () => {
@click="triggerMenu('unbook')" @click="triggerMenu('unbook')"
> >
<QItemSection> <QItemSection>
{{ t('invoicein.descriptorMenu.toUnbook') }} {{ t('invoiceIn.descriptorMenu.toUnbook') }}
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem <QItem
@ -206,19 +206,19 @@ const createInvoiceInCorrection = async () => {
clickable clickable
@click="triggerMenu('delete')" @click="triggerMenu('delete')"
> >
<QItemSection>{{ t('invoicein.descriptorMenu.deleteInvoice') }}</QItemSection> <QItemSection>{{ t('invoiceIn.descriptorMenu.deleteInvoice') }}</QItemSection>
</QItem> </QItem>
<QItem v-if="canEditProp('clone')" v-ripple clickable @click="triggerMenu('clone')"> <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>
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('showPdf')"> <QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('showPdf')">
<QItemSection>{{ <QItemSection>{{
t('invoicein.descriptorMenu.showAgriculturalPdf') t('invoiceIn.descriptorMenu.showAgriculturalPdf')
}}</QItemSection> }}</QItemSection>
</QItem> </QItem>
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('sendPdf')"> <QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('sendPdf')">
<QItemSection <QItemSection
>{{ t('invoicein.descriptorMenu.sendAgriculturalPdf') }}...</QItemSection >{{ t('invoiceIn.descriptorMenu.sendAgriculturalPdf') }}...</QItemSection
> >
</QItem> </QItem>
<QItem <QItem
@ -228,7 +228,7 @@ const createInvoiceInCorrection = async () => {
@click="triggerMenu('correct')" @click="triggerMenu('correct')"
> >
<QItemSection <QItemSection
>{{ t('invoicein.descriptorMenu.createCorrective') }}...</QItemSection >{{ t('invoiceIn.descriptorMenu.createCorrective') }}...</QItemSection
> >
</QItem> </QItem>
<QItem v-if="invoice.dmsFk" v-ripple clickable @click="downloadFile(invoice.dmsFk)"> <QItem v-if="invoice.dmsFk" v-ripple clickable @click="downloadFile(invoice.dmsFk)">
@ -272,7 +272,6 @@ const createInvoiceInCorrection = async () => {
> >
<template #option="{ itemProps, opt }"> <template #option="{ itemProps, opt }">
<QItem v-bind="itemProps"> <QItem v-bind="itemProps">
{{ console.log('opt: ', opt) }}
<QItemSection> <QItemSection>
<QItemLabel <QItemLabel
>{{ opt.id }} - >{{ opt.id }} -
@ -311,11 +310,11 @@ const createInvoiceInCorrection = async () => {
<i18n> <i18n>
en: en:
isNotLinked: The entry {bookEntry} has been deleted with {accountingEntries} entries isNotLinked: The entry {bookEntry} has been deleted with {accountingEntries} entries
isLinked: The entry has been linked to Sage. Please contact administration for further information isLinked: The entry has been linked to Sage. Please contact administration for further information
assertAction: Are you sure you want to {action} this invoice? assertAction: Are you sure you want to {action} this invoice?
es: es:
isNotLinked: Se ha eliminado el asiento {bookEntry} con {accountingEntries} apuntes isNotLinked: Se ha eliminado el asiento {bookEntry} con {accountingEntries} apuntes
isLinked: El asiento fue enlazado a Sage, por favor contacta con administración isLinked: El asiento fue enlazado a Sage, por favor contacta con administración
assertAction: Estas seguro de querer {action} esta factura? assertAction: Estas seguro de querer {action} esta factura?
</i18n> </i18n>

View File

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

View File

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

View File

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

View File

@ -8,17 +8,17 @@ import InvoiceInFilter from './InvoiceInFilter.vue';
import InvoiceInSummary from './Card/InvoiceInSummary.vue'; import InvoiceInSummary from './Card/InvoiceInSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue'; 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 VnTable from 'src/components/VnTable/VnTable.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
import VnSection from 'src/components/common/VnSection.vue';
const user = useState().getUser(); const user = useState().getUser();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const { t } = useI18n(); const { t } = useI18n();
const dataKey = 'InvoiceInList';
const tableRef = ref(); const tableRef = ref();
const companies = ref([]); const companies = ref([]);
@ -26,7 +26,7 @@ const cols = computed(() => [
{ {
align: 'left', align: 'left',
name: 'isBooked', name: 'isBooked',
label: t('invoicein.isBooked'), label: t('invoiceIn.isBooked'),
columnFilter: false, columnFilter: false,
}, },
{ {
@ -41,7 +41,7 @@ const cols = computed(() => [
{ {
align: 'left', align: 'left',
name: 'supplierFk', name: 'supplierFk',
label: t('invoicein.list.supplier'), label: t('invoiceIn.list.supplier'),
columnFilter: { columnFilter: {
component: 'select', component: 'select',
attrs: { attrs: {
@ -55,16 +55,16 @@ const cols = computed(() => [
{ {
align: 'left', align: 'left',
name: 'supplierRef', name: 'supplierRef',
label: t('invoicein.list.supplierRef'), label: t('invoiceIn.list.supplierRef'),
}, },
{ {
align: 'left', align: 'left',
name: 'serial', name: 'serial',
label: t('invoicein.serial'), label: t('invoiceIn.serial'),
}, },
{ {
align: 'left', align: 'left',
label: t('invoicein.list.issued'), label: t('invoiceIn.list.issued'),
name: 'issued', name: 'issued',
component: null, component: null,
columnFilter: { columnFilter: {
@ -74,7 +74,7 @@ const cols = computed(() => [
}, },
{ {
align: 'left', align: 'left',
label: t('invoicein.list.dueDated'), label: t('invoiceIn.list.dueDated'),
name: 'dueDated', name: 'dueDated',
component: null, component: null,
columnFilter: { columnFilter: {
@ -86,12 +86,12 @@ const cols = computed(() => [
{ {
align: 'left', align: 'left',
name: 'awbCode', name: 'awbCode',
label: t('invoicein.list.awb'), label: t('invoiceIn.list.awb'),
}, },
{ {
align: 'left', align: 'left',
name: 'amount', name: 'amount',
label: t('invoicein.list.amount'), label: t('invoiceIn.list.amount'),
format: ({ amount }) => toCurrency(amount), format: ({ amount }) => toCurrency(amount),
cardVisible: true, cardVisible: true,
}, },
@ -130,71 +130,84 @@ const cols = computed(() => [
}, },
]); ]);
</script> </script>
<template> <template>
<FetchData url="Companies" @on-fetch="(data) => (companies = data)" auto-load /> <FetchData url="Companies" @on-fetch="(data) => (companies = data)" auto-load />
<InvoiceInSearchbar /> <VnSection
<RightMenu> :data-key
<template #right-panel>
<InvoiceInFilter data-key="InvoiceInList" />
</template>
</RightMenu>
<VnTable
ref="tableRef"
data-key="InvoiceInList"
url="InvoiceIns/filter"
:order="['issued DESC', 'id DESC']"
:create="{
urlCreate: 'InvoiceIns',
title: t('globals.createInvoiceIn'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: { companyFk: user.companyFk, issued: Date.vnNew() },
}"
redirect="invoice-in"
:columns="cols" :columns="cols"
:right-search="false" prefix="invoiceIn"
:disable-option="{ card: true }" :array-data-props="{
:auto-load="!!$route.query.table" url: 'InvoiceIns/filter',
order: ['issued DESC', 'id DESC'],
}"
> >
<template #column-supplierFk="{ row }"> <template #advanced-menu>
<span class="link" @click.stop> <InvoiceInFilter :data-key />
{{ row.supplierName }}
<SupplierDescriptorProxy :id="row.supplierFk" />
</span>
</template> </template>
<template #more-create-dialog="{ data }"> <template #body>
<VnSelect <VnTable
v-model="data.supplierFk" ref="tableRef"
url="Suppliers" :data-key
:fields="['id', 'nickname', 'name']" :create="{
:label="t('globals.supplier')" urlCreate: 'InvoiceIns',
option-value="id" title: t('globals.createInvoiceIn'),
option-label="nickname" onDataSaved: ({ id }) => tableRef.redirect(id),
:filter-options="['id', 'name', 'nickname']" formInitialData: { companyFk: user.companyFk, issued: Date.vnNew() },
:required="true" }"
redirect="invoice-in"
:columns="cols"
:right-search="false"
:disable-option="{ card: true }"
:auto-load="!!$route.query.table"
> >
<template #option="scope"> <template #column-supplierFk="{ row }">
<QItem v-bind="scope.itemProps"> <span class="link" @click.stop>
<QItemSection> {{ row.supplierName }}
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel> <SupplierDescriptorProxy :id="row.supplierFk" />
<QItemLabel caption> #{{ scope.opt?.id }}, {{ scope.opt?.name }} </QItemLabel> </span>
</QItemSection>
</QItem>
</template> </template>
</VnSelect> <template #more-create-dialog="{ data }">
<VnInput <VnSelect
:label="t('invoicein.list.supplierRef')" v-model="data.supplierFk"
v-model="data.supplierRef" url="Suppliers"
/> :fields="['id', 'name', 'nickname']"
<VnSelect :label="t('globals.supplier')"
url="Companies" option-value="id"
:label="t('globals.company')" option-label="nickname"
:fields="['id', 'code']" :filter-options="['id', 'name', 'nickname']"
v-model="data.companyFk" :required="true"
option-value="id" >
option-label="code" <template #option="scope">
:required="true" <QItem v-bind="scope.itemProps">
/> <QItemSection>
<VnInputDate :label="t('invoicein.summary.issued')" v-model="data.issued" /> <QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
<QItemLabel caption>
#{{ scope.opt?.id }}, {{ scope.opt?.name }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnInput
:label="t('invoiceIn.list.supplierRef')"
v-model="data.supplierRef"
/>
<VnSelect
url="Companies"
:label="t('globals.company')"
:fields="['id', 'code']"
v-model="data.companyFk"
option-value="id"
option-label="code"
:required="true"
/>
<VnInputDate
:label="t('invoiceIn.summary.issued')"
v-model="data.issued"
/>
</template>
</VnTable>
</template> </template>
</VnTable> </VnSection>
</template> </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 serial: Serial
isBooked: Is booked isBooked: Is booked
list: 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 serial: Serie
isBooked: Contabilizada isBooked: Contabilizada
list: list:
@ -63,6 +65,7 @@ invoicein:
params: params:
search: Id o nombre proveedor search: Id o nombre proveedor
correctedFk: Rectificada correctedFk: Rectificada
isBooked: Contabilizada
account: Cuenta contable account: Cuenta contable
correctingFk: Rectificativa correctingFk: Rectificativa

View File

@ -1,19 +1,11 @@
<script setup> <script setup>
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue'; import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
import VnCard from 'components/common/VnCard.vue'; import VnCardBeta from 'components/common/VnCardBeta.vue';
import InvoiceOutFilter from '../InvoiceOutFilter.vue';
</script> </script>
<template> <template>
<VnCard <VnCardBeta
data-key="InvoiceOut" data-key="InvoiceOut"
base-url="InvoiceOuts" base-url="InvoiceOuts"
:descriptor="InvoiceOutDescriptor" :descriptor="InvoiceOutDescriptor"
:filter-panel="InvoiceOutFilter"
search-data-key="InvoiceOutList"
:searchbar-props="{
url: 'InvoiceOuts/filter',
label: 'Search invoice',
info: 'You can search by invoice reference',
}"
/> />
</template> </template>

View File

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

View File

@ -3,7 +3,6 @@ import { ref, computed, watchEffect } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { usePrintService } from 'src/composables/usePrintService'; import { usePrintService } from 'src/composables/usePrintService';
@ -12,12 +11,12 @@ import InvoiceOutSummary from './Card/InvoiceOutSummary.vue';
import { toCurrency, toDate } from 'src/filters/index'; import { toCurrency, toDate } from 'src/filters/index';
import { QBtn } from 'quasar'; import { QBtn } from 'quasar';
import axios from 'axios'; import axios from 'axios';
import RightMenu from 'src/components/common/RightMenu.vue';
import InvoiceOutFilter from './InvoiceOutFilter.vue'; import InvoiceOutFilter from './InvoiceOutFilter.vue';
import VnRow from 'src/components/ui/VnRow.vue'; import VnRow from 'src/components/ui/VnRow.vue';
import VnRadio from 'src/components/common/VnRadio.vue'; import VnRadio from 'src/components/common/VnRadio.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
import VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
@ -30,9 +29,11 @@ const MODEL = 'InvoiceOuts';
const { openReport } = usePrintService(); const { openReport } = usePrintService();
const addressOptions = ref([]); const addressOptions = ref([]);
const selectedOption = ref('ticket'); const selectedOption = ref('ticket');
const dataKey = 'InvoiceOutList';
async function fetchClientAddress(id) { async function fetchClientAddress(id) {
const { data } = await axios.get( const { data } = await axios.get(
`Clients/${id}/addresses?filter[order]=isActive DESC` `Clients/${id}/addresses?filter[order]=isActive DESC`,
); );
addressOptions.value = data; addressOptions.value = data;
} }
@ -180,223 +181,239 @@ watchEffect(selectedRows);
</script> </script>
<template> <template>
<VnSearchbar <VnSection
:info="t('youCanSearchByInvoiceReference')" :data-key="dataKey"
:label="t('Search invoice')"
data-key="invoiceOutList"
/>
<RightMenu>
<template #right-panel>
<InvoiceOutFilter data-key="invoiceOutList" />
</template>
</RightMenu>
<VnSubToolbar>
<template #st-actions>
<QBtn
color="primary"
icon-right="cloud_download"
@click="downloadPdf()"
:disable="!hasSelectedCards"
data-cy="InvoiceOutDownloadPdfBtn"
>
<QTooltip>{{ t('downloadPdf') }}</QTooltip>
</QBtn>
</template>
</VnSubToolbar>
<VnTable
ref="tableRef"
data-key="invoiceOutList"
:url="`${MODEL}/filter`"
:create="{
urlCreate: 'InvoiceOuts/createManualInvoice',
title: t('createManualInvoice'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: { active: true },
}"
:right-search="false"
v-model:selected="selectedRows"
order="id DESC"
:columns="columns" :columns="columns"
redirect="invoice-out" prefix="invoiceOut"
:table="{ :array-data-props="{
'row-key': 'id', url: 'InvoiceOuts/filter',
selection: 'multiple', order: ['id DESC'],
}" }"
> >
<template #column-clientFk="{ row }"> <template #advanced-menu>
<span class="link" @click.stop> <InvoiceOutFilter data-key="InvoiceOutList" />
{{ row.clientSocialName }}
<CustomerDescriptorProxy :id="row.clientFk" />
</span>
</template> </template>
<template #more-create-dialog="{ data }"> <template #body>
<div class="row q-col-gutter-xs"> <VnSubToolbar>
<div class="col-12"> <template #st-actions>
<div class="q-col-gutter-xs"> <QBtn
<VnRow fixed> color="primary"
<VnRadio icon-right="cloud_download"
v-model="selectedOption" @click="downloadPdf()"
val="ticket" :disable="!hasSelectedCards"
:label="t('globals.ticket')" data-cy="InvoiceOutDownloadPdfBtn"
class="q-my-none q-mr-md" >
/> <QTooltip>{{ t('globals.downloadPdf') }}</QTooltip>
</QBtn>
</template>
</VnSubToolbar>
<VnTable
ref="tableRef"
:data-key="dataKey"
:create="{
urlCreate: 'InvoiceOuts/createManualInvoice',
title: t('createManualInvoice'),
onDataSaved: ({ id }) => tableRef.redirect(id),
formInitialData: { active: true },
}"
:right-search="false"
v-model:selected="selectedRows"
:columns="columns"
redirect="invoice-out"
:table="{
'row-key': 'id',
selection: 'multiple',
}"
>
<template #column-clientFk="{ row }">
<span class="link" @click.stop>
{{ row.clientSocialName }}
<CustomerDescriptorProxy :id="row.clientFk" />
</span>
</template>
<template #more-create-dialog="{ data }">
<div class="row q-col-gutter-xs">
<div class="col-12">
<div class="q-col-gutter-xs">
<VnRow fixed>
<VnRadio
v-model="selectedOption"
val="ticket"
:label="t('globals.ticket')"
class="q-my-none q-mr-md"
/>
<VnInput <VnInput
v-show="selectedOption === 'ticket'" v-show="selectedOption === 'ticket'"
v-model="data.ticketFk" v-model="data.ticketFk"
:label="t('globals.ticket')" :label="t('globals.ticket')"
style="flex: 1" style="flex: 1"
data-cy="InvoiceOutCreateTicketinput" data-cy="InvoiceOutCreateTicketinput"
/> />
<div <div
class="row q-col-gutter-xs q-ml-none" class="row q-col-gutter-xs q-ml-none"
v-show="selectedOption !== 'ticket'" v-show="selectedOption !== 'ticket'"
> >
<div class="col"> <div class="col">
<VnSelect <VnSelect
v-model="data.clientFk" v-model="data.clientFk"
:label="t('globals.client')"
url="Clients"
:options="customerOptions"
option-label="name"
option-value="id"
@update:model-value="fetchClientAddress"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
#{{ scope.opt?.id }} -
{{ scope.opt?.name }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</div>
<div class="col">
<VnSelect
v-model="data.addressFk"
:label="t('ticket.summary.consignee')"
:options="addressOptions"
option-label="nickname"
option-value="id"
v-if="
data.clientFk &&
selectedOption === 'consignatario'
"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel
:class="{
'color-vn-label':
!scope.opt
?.isActive,
}"
>
{{
`${
!scope.opt
?.isActive
? t(
'inactive',
)
: ''
} `
}}
<span>{{
scope.opt?.nickname
}}</span>
<span
v-if="
scope.opt
?.province ||
scope.opt?.city ||
scope.opt?.street
"
>
,
{{
scope.opt?.street
}},
{{ scope.opt?.city }},
{{
scope.opt
?.province
?.name
}}
-
{{
scope.opt
?.agencyMode
?.name
}}
</span>
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</div>
</div>
</VnRow>
<VnRow fixed>
<VnRadio
v-model="selectedOption"
val="cliente"
:label="t('globals.client')" :label="t('globals.client')"
url="Clients" class="q-my-none q-mr-md"
:options="customerOptions" />
option-label="name" </VnRow>
option-value="id" <VnRow fixed>
@update:model-value="fetchClientAddress" <VnRadio
> v-model="selectedOption"
<template #option="scope"> val="consignatario"
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
#{{ scope.opt?.id }} -
{{ scope.opt?.name }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</div>
<div class="col">
<VnSelect
v-model="data.addressFk"
:label="t('ticket.summary.consignee')" :label="t('ticket.summary.consignee')"
:options="addressOptions" class="q-my-none q-mr-md"
option-label="nickname" />
option-value="id" </VnRow>
v-if="
data.clientFk &&
selectedOption === 'consignatario'
"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel
:class="{
'color-vn-label':
!scope.opt?.isActive,
}"
>
{{
`${
!scope.opt?.isActive
? t('inactive')
: ''
} `
}}
<span>{{
scope.opt?.nickname
}}</span>
<span
v-if="
scope.opt?.province ||
scope.opt?.city ||
scope.opt?.street
"
>
, {{ scope.opt?.street }},
{{ scope.opt?.city }},
{{
scope.opt?.province?.name
}}
-
{{
scope.opt?.agencyMode
?.name
}}
</span>
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</div>
</div> </div>
</VnRow> </div>
<VnRow fixed> <div class="full-width">
<VnRadio <VnRow class="row q-col-gutter-xs">
v-model="selectedOption" <VnSelect
val="cliente" url="InvoiceOutSerials"
:label="t('globals.client')" v-model="data.serial"
class="q-my-none q-mr-md" :label="t('invoicein.serial')"
/> :options="invoiceOutSerialsOptions"
</VnRow> option-label="description"
<VnRow fixed> option-value="code"
<VnRadio option-filter
v-model="selectedOption" :expr-builder="exprBuilder"
val="consignatario" data-cy="InvoiceOutCreateSerialSelect"
:label="t('ticket.summary.consignee')" >
class="q-my-none q-mr-md" <template #option="scope">
/> <QItem v-bind="scope.itemProps">
</VnRow> <QItemSection>
<QItemLabel>
{{ scope.opt?.code }} -
{{ scope.opt?.description }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnInputDate
:label="t('invoiceOut.summary.dued')"
v-model="data.maxShipped"
/>
</VnRow>
<VnRow class="row q-col-gutter-xs">
<VnSelect
url="TaxAreas"
v-model="data.taxArea"
:label="
t('invoiceOutList.tableVisibleColumns.taxArea')
"
:options="taxAreasOptions"
option-label="code"
option-value="code"
/>
<VnInput
v-model="data.reference"
:label="t('globals.reference')"
/>
</VnRow>
</div>
</div> </div>
</div> </template>
<div class="full-width"> </VnTable>
<VnRow class="row q-col-gutter-xs">
<VnSelect
url="InvoiceOutSerials"
v-model="data.serial"
:label="t('invoicein.serial')"
:options="invoiceOutSerialsOptions"
option-label="description"
option-value="code"
option-filter
:expr-builder="exprBuilder"
data-cy="InvoiceOutCreateSerialSelect"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt?.code }} -
{{ scope.opt?.description }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnInputDate
:label="t('invoiceOut.summary.dued')"
v-model="data.maxShipped"
/>
</VnRow>
<VnRow class="row q-col-gutter-xs">
<VnSelect
url="TaxAreas"
v-model="data.taxArea"
:label="t('invoiceOutList.tableVisibleColumns.taxArea')"
:options="taxAreasOptions"
option-label="code"
option-value="code"
/>
<VnInput
v-model="data.reference"
:label="t('globals.reference')"
/>
</VnRow>
</div>
</div>
</template> </template>
</VnTable> </VnSection>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -39,7 +39,7 @@ const columns = computed(() => [
{ {
align: 'left', align: 'left',
name: 'country', name: 'country',
label: t('negativeBases.country'), label: t('invoiceOut.negativeBases.country'),
component: 'select', component: 'select',
attrs: { attrs: {
url: 'Countries', url: 'Countries',
@ -53,7 +53,7 @@ const columns = computed(() => [
{ {
align: 'left', align: 'left',
name: 'clientId', name: 'clientId',
label: t('negativeBases.clientId'), label: t('invoiceOut.negativeBases.clientId'),
cardVisible: true, cardVisible: true,
}, },
{ {
@ -85,28 +85,28 @@ const columns = computed(() => [
{ {
align: 'left', align: 'left',
name: 'taxableBase', name: 'taxableBase',
label: t('negativeBases.base'), label: t('invoiceOut.negativeBases.base'),
}, },
{ {
align: 'left', align: 'left',
name: 'ticketFk', name: 'ticketFk',
label: t('negativeBases.ticketId'), label: t('invoiceOut.negativeBases.ticketId'),
cardVisible: true, cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
name: 'isActive', name: 'isActive',
label: t('negativeBases.active'), label: t('invoiceOut.negativeBases.active'),
}, },
{ {
align: 'left', align: 'left',
name: 'hasToInvoice', name: 'hasToInvoice',
label: t('negativeBases.hasToInvoice'), label: t('invoiceOut.negativeBases.hasToInvoice'),
}, },
{ {
align: 'left', align: 'left',
name: 'hasVerifiedData', name: 'hasVerifiedData',
label: t('negativeBases.verifiedData'), label: t('invoiceOut.negativeBases.verifiedData'),
}, },
{ {
align: 'left', align: 'left',

View File

@ -105,28 +105,3 @@ const props = defineProps({
</template> </template>
</VnFilterPanel> </VnFilterPanel>
</template> </template>
<i18n>
en:
params:
from: From
to: To
company: Company
country: Country
clientId: Client Id
clientSocialName: Client
amount: Amount
comercialName: Comercial
es:
params:
from: Desde
to: Hasta
company: Empresa
country: País
clientId: Id cliente
clientSocialName: Cliente
amount: Importe
comercialName: Comercial
Date is required: La fecha es requerida
</i18n>

View File

@ -1,3 +1,60 @@
invoiceOut:
search: Search invoice
searchInfo: You can search by invoice reference
params:
company: Company
country: Country
clientId: Client ID
clientSocialName: Client
taxableBase: Base
ticketFk: Ticket
isActive: Active
hasToInvoice: Has to invoice
hasVerifiedData: Verified data
workerName: Worker
card:
issued: Issued
customerCard: Customer card
ticketList: Ticket List
summary:
issued: Issued
dued: Due
booked: Booked
taxBreakdown: Tax breakdown
taxableBase: Taxable base
rate: Rate
fee: Fee
tickets: Tickets
totalWithVat: Amount
globalInvoices:
errors:
chooseValidClient: Choose a valid client
chooseValidCompany: Choose a valid company
chooseValidPrinter: Choose a valid printer
chooseValidSerialType: Choose a serial type
fillDates: Invoice date and the max date should be filled
invoiceDateLessThanMaxDate: Invoice date can not be less than max date
invoiceWithFutureDate: Exists an invoice with a future date
noTicketsToInvoice: There are not tickets to invoice
criticalInvoiceError: 'Critical invoicing error, process stopped'
invalidSerialTypeForAll: The serial type must be global when invoicing all clients
table:
addressId: Address id
streetAddress: Street
statusCard:
percentageText: '{getPercentage}% {getAddressNumber} of {getNAddresses}'
pdfsNumberText: '{nPdfs} of {totalPdfs} PDFs'
negativeBases:
country: Country
clientId: Client Id
base: Base
ticketId: Ticket
active: Active
hasToInvoice: Has to Invoice
verifiedData: Verified Data
comercial: Commercial
errors:
downloadCsvFailed: CSV download failed
invoiceOutModule: invoiceOutModule:
customer: Client customer: Client
amount: Amount amount: Amount
@ -13,27 +70,4 @@ invoiceOutList:
invoiceOutSerial: Serial invoiceOutSerial: Serial
ticket: Ticket ticket: Ticket
taxArea: Tax area taxArea: Tax area
customsAgent: Custom Agent customsAgent: Custom Agent
DownloadPdf: Download PDF
InvoiceOutSummary: Summary
negativeBases:
country: Country
clientId: Client ID
base: Base
ticketId: Ticket
active: Active
hasToInvoice: Has to invoice
verifiedData: Verified data
commercial: Commercial
invoiceout:
params:
company: Company
country: Country
clientId: Client ID
clientSocialName: Client
taxableBase: Base
ticketFk: Ticket
isActive: Active
hasToInvoice: Has to invoice
hasVerifiedData: Verified data
workerName: Worker

View File

@ -1,5 +1,60 @@
Search invoice: Buscar factura emitida invoiceOut:
You can search by invoice reference: Puedes buscar por referencia de la factura search: Buscar factura emitida
searchInfo: Puedes buscar por referencia de la factura
params:
company: Empresa
country: País
clientId: ID del cliente
clientSocialName: Cliente
taxableBase: Base
ticketFk: Ticket
isActive: Activo
hasToInvoice: Debe facturar
hasVerifiedData: Datos verificados
workerName: Comercial
card:
issued: Fecha emisión
customerCard: Ficha del cliente
ticketList: Listado de tickets
summary:
issued: Fecha
dued: Fecha límite
booked: Contabilizada
taxBreakdown: Desglose impositivo
taxableBase: Base imp.
rate: Tarifa
fee: Cuota
tickets: Tickets
totalWithVat: Importe
globalInvoices:
errors:
chooseValidClient: Selecciona un cliente válido
chooseValidCompany: Selecciona una empresa válida
chooseValidPrinter: Selecciona una impresora válida
chooseValidSerialType: Selecciona una tipo de serie válida
fillDates: La fecha de la factura y la fecha máxima deben estar completas
invoiceDateLessThanMaxDate: La fecha de la factura no puede ser menor que la fecha máxima
invoiceWithFutureDate: Existe una factura con una fecha futura
noTicketsToInvoice: No existen tickets para facturar
criticalInvoiceError: Error crítico en la facturación proceso detenido
invalidSerialTypeForAll: El tipo de serie debe ser global cuando se facturan todos los clientes
table:
addressId: Id dirección
streetAddress: Dirección fiscal
statusCard:
percentageText: '{getPercentage}% {getAddressNumber} de {getNAddresses}'
pdfsNumberText: '{nPdfs} de {totalPdfs} PDFs'
negativeBases:
country: País
clientId: Id cliente
base: Base
ticketId: Ticket
active: Activo
hasToInvoice: Facturar
verifiedData: Datos comprobados
comercial: Comercial
errors:
downloadCsvFailed: Error al descargar CSV
invoiceOutModule: invoiceOutModule:
customer: Cliente customer: Cliente
amount: Importe amount: Importe
@ -15,28 +70,4 @@ invoiceOutList:
invoiceOutSerial: Serial invoiceOutSerial: Serial
ticket: Ticket ticket: Ticket
taxArea: Area taxArea: Area
customsAgent: Agente de aduanas customsAgent: Agente de aduanas
DownloadPdf: Descargar PDF
InvoiceOutSummary: Resumen
negativeBases:
country: País
clientId: ID del cliente
client: Cliente
base: Base
ticketId: Ticket
active: Activo
hasToInvoice: Debe facturar
verifiedData: Datos verificados
commercial: Comercial
invoiceout:
params:
company: Empresa
country: País
clientId: ID del cliente
clientSocialName: Cliente
taxableBase: Base
ticketFk: Ticket
isActive: Activo
hasToInvoice: Debe facturar
hasVerifiedData: Datos verificados
workerName: Comercial

View File

@ -1,19 +1,11 @@
<script setup> <script setup>
import VnCard from 'components/common/VnCard.vue'; import VnCardBeta from 'components/common/VnCardBeta.vue';
import ItemDescriptor from './ItemDescriptor.vue'; import ItemDescriptor from './ItemDescriptor.vue';
import ItemListFilter from '../ItemListFilter.vue';
</script> </script>
<template> <template>
<VnCard <VnCardBeta
data-key="Item" data-key="Item"
base-url="Items" base-url="Items"
:descriptor="ItemDescriptor" :descriptor="ItemDescriptor"
:filter-panel="ItemListFilter"
search-data-key="ItemList"
:searchbar-props="{
url: 'Items/filter',
label: 'searchbar.label',
info: 'searchbar.info',
}"
/> />
</template> </template>

View File

@ -13,10 +13,9 @@ import axios from 'axios';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const itemTagsRef = ref(null); const itemTagsRef = ref();
const tagOptions = ref([]); const tagOptions = ref([]);
const valueOptionsMap = ref(new Map()); const valueOptionsMap = ref(new Map());
const getSelectedTagValues = async (tag) => { const getSelectedTagValues = async (tag) => {
if (!tag.tagFk && tag.tag.isFree) return; if (!tag.tagFk && tag.tag.isFree) return;
const filter = { const filter = {
@ -59,10 +58,6 @@ const insertTag = (rows) => {
itemTagsRef.value.formData[itemTagsRef.value.formData.length - 1].priority = itemTagsRef.value.formData[itemTagsRef.value.formData.length - 1].priority =
getHighestPriority(rows); getHighestPriority(rows);
}; };
const submitTags = async (data) => {
itemTagsRef.value.onSubmit(data);
};
</script> </script>
<template> <template>
@ -149,7 +144,7 @@ const submitTags = async (data) => {
v-model="row.value" v-model="row.value"
:label="t('itemTags.value')" :label="t('itemTags.value')"
:is-clearable="false" :is-clearable="false"
@keyup.enter.stop="submitTags(row)" @keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
/> />
<VnInput <VnInput
:label="t('itemBasicData.relevancy')" :label="t('itemBasicData.relevancy')"
@ -157,7 +152,7 @@ const submitTags = async (data) => {
v-model="row.priority" v-model="row.priority"
:required="true" :required="true"
:rules="validate('itemTag.priority')" :rules="validate('itemTag.priority')"
@keyup.enter.stop="submitTags(row)" @keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
/> />
<div class="row justify-center" style="flex: 0"> <div class="row justify-center" style="flex: 0">
<QIcon <QIcon
@ -197,4 +192,5 @@ const submitTags = async (data) => {
<i18n> <i18n>
es: es:
Tags can not be repeated: Las etiquetas no pueden repetirse Tags can not be repeated: Las etiquetas no pueden repetirse
The value must be a number or a range of numbers: El valor debe ser un número o un rango de números
</i18n> </i18n>

View File

@ -422,6 +422,7 @@ function handleOnDataSave({ CrudModelRef }) {
onDataSaved: handleOnDataSave, onDataSaved: handleOnDataSave,
}" }"
:disable-option="{ card: true }" :disable-option="{ card: true }"
:has-sub-toolbar="false"
> >
<template #header-selection="scope"> <template #header-selection="scope">
<QCheckbox v-model="scope.selected" /> <QCheckbox v-model="scope.selected" />

View File

@ -6,18 +6,17 @@ import VnImg from 'src/components/ui/VnImg.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
import FetchedTags from 'src/components/ui/FetchedTags.vue'; import FetchedTags from 'src/components/ui/FetchedTags.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import ItemSummary from '../Item/Card/ItemSummary.vue'; import ItemSummary from '../Item/Card/ItemSummary.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import ItemDescriptorProxy from './Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from './Card/ItemDescriptorProxy.vue';
import ItemTypeDescriptorProxy from './ItemType/Card/ItemTypeDescriptorProxy.vue'; import ItemTypeDescriptorProxy from './ItemType/Card/ItemTypeDescriptorProxy.vue';
import { cloneItem } from 'src/pages/Item/composables/cloneItem'; import { cloneItem } from 'src/pages/Item/composables/cloneItem';
import RightMenu from 'src/components/common/RightMenu.vue';
import ItemListFilter from './ItemListFilter.vue'; import ItemListFilter from './ItemListFilter.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import axios from 'axios'; import axios from 'axios';
import VnSection from 'src/components/common/VnSection.vue';
const entityId = computed(() => route.params.id); const entityId = computed(() => route.params.id);
const { openCloneDialog } = cloneItem(); const { openCloneDialog } = cloneItem();
@ -25,9 +24,11 @@ const { viewSummary } = useSummaryDialog();
const { t } = useI18n(); const { t } = useI18n();
const tableRef = ref(); const tableRef = ref();
const route = useRoute(); const route = useRoute();
const dataKey = 'ItemList';
const validPriorities = ref([]); const validPriorities = ref([]);
const defaultTag = ref(); const defaultTag = ref();
const defaultPriority = ref(); const defaultPriority = ref();
const itemFilter = { const itemFilter = {
include: [ include: [
{ {
@ -324,166 +325,174 @@ onBeforeMount(async () => {
}); });
}); });
</script> </script>
<template> <template>
<VnSearchbar <VnSection
data-key="ItemList" :data-key="dataKey"
:label="t('item.searchbar.label')" :columns="columns"
:info="t('item.searchbar.info')" prefix="item"
/> :array-data-props="{
<RightMenu> url: 'Items/filter',
<template #right-panel> order: ['isActive DESC', 'name', 'id'],
userFilter: itemFilter,
}"
>
<template #advanced-menu>
<ItemListFilter data-key="ItemList" /> <ItemListFilter data-key="ItemList" />
</template> </template>
</RightMenu> <template #body>
<VnTable <VnTable
v-if="defaultTag" v-if="defaultTag"
ref="tableRef" ref="tableRef"
data-key="ItemList" :data-key="dataKey"
url="Items/filter" :columns="columns"
:create="{ :right-search="false"
urlCreate: 'Items/new', redirect="Item"
title: t('item.list.newItem'), :create="{
onDataSaved: ({ id }) => tableRef.redirect(`${id}/basic-data`), urlCreate: 'Items/new',
formInitialData: { title: t('item.list.newItem'),
editorFk: entityId, onDataSaved: ({ id }) => tableRef.redirect(`${id}/basic-data`),
tag: defaultTag, formInitialData: {
priority: defaultPriority, editorFk: entityId,
}, tag: defaultTag,
}" priority: defaultPriority,
:order="['isActive DESC', 'name', 'id']" },
:columns="columns" }"
redirect="Item" :is-editable="false"
:is-editable="false"
:right-search="false"
:filter="itemFilter"
>
<template #column-image="{ row }">
<VnImg
:id="row?.id"
zoom-resolution="1600x900"
:zoom="true"
class="rounded"
/>
</template>
<template #column-id="{ row }">
<span class="link" @click.stop>
{{ row.id }}
<ItemDescriptorProxy :id="row.id" />
</span>
</template>
<template #column-typeName="{ row }">
<span class="link" @click.stop>
{{ row.typeName }}
{{ row.typeFk }}
<ItemTypeDescriptorProxy :id="row.typeFk" />
</span>
</template>
<template #column-userName="{ row }">
<span class="link" @click.stop>
{{ row.userName }}
<WorkerDescriptorProxy :id="row.buyerFk" />
</span>
</template>
<template #column-description="{ row }">
<div class="row column full-width justify-between items-start">
{{ row?.name }}
<div v-if="row?.subName" class="subName">
{{ row?.subName.toUpperCase() }}
</div>
</div>
<FetchedTags :item="row" />
</template>
<template #more-create-dialog="{ data }">
<VnInput
v-model="data.provisionalName"
:label="t('globals.description')"
:is-required="true"
/>
<VnSelect
url="Tags"
v-model="data.tag"
:label="t('globals.tag')"
:fields="['id', 'name']"
option-label="name"
option-value="id"
:is-required="true"
:sort-by="['name ASC']"
> >
<template #option="scope"> <template #column-image="{ row }">
<QItem v-bind="scope.itemProps"> <VnImg
<QItemSection> :id="row?.id"
<QItemLabel>{{ scope.opt?.name }}</QItemLabel> zoom-resolution="1600x900"
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel> :zoom="true"
</QItemSection> class="rounded"
</QItem> />
</template> </template>
</VnSelect> <template #column-id="{ row }">
<VnSelect <span class="link" @click.stop>
:options="validPriorities" {{ row.id }}
v-model="data.priority" <ItemDescriptorProxy :id="row.id" />
:label="t('item.create.priority')" </span>
:is-required="true"
/>
<VnSelect
url="ItemTypes"
v-model="data.typeFk"
:label="t('item.list.typeName')"
:fields="['id', 'code', 'name']"
option-label="name"
option-value="id"
:is-required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>
{{ scope.opt?.code }} #{{ scope.opt?.id }}
</QItemLabel>
</QItemSection>
</QItem>
</template> </template>
</VnSelect> <template #column-typeName="{ row }">
<VnSelect <span class="link" @click.stop>
url="Intrastats" {{ row.typeName }}
v-model="data.intrastatFk" {{ row.typeFk }}
:label="t('globals.intrastat')" <ItemTypeDescriptorProxy :id="row.typeFk" />
:fields="['id', 'description']" </span>
option-label="description"
option-value="id"
:is-required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.description }}</QItemLabel>
<QItemLabel caption> #{{ scope.opt?.id }} </QItemLabel>
</QItemSection>
</QItem>
</template> </template>
</VnSelect> <template #column-userName="{ row }">
<VnSelect <span class="link" @click.stop>
url="Origins" {{ row.userName }}
v-model="data.originFk" <WorkerDescriptorProxy :id="row.buyerFk" />
:label="t('globals.origin')" </span>
:fields="['id', 'code', 'name']"
option-label="code"
option-value="id"
:is-required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>
{{ scope.opt?.code }} #{{ scope.opt?.id }}
</QItemLabel>
</QItemSection>
</QItem>
</template> </template>
</VnSelect> <template #column-description="{ row }">
<div class="row column full-width justify-between items-start">
{{ row?.name }}
<div v-if="row?.subName" class="subName">
{{ row?.subName.toUpperCase() }}
</div>
</div>
<FetchedTags :item="row" :columns="3" />
</template>
<template #more-create-dialog="{ data }">
<VnInput
v-model="data.provisionalName"
:label="t('globals.description')"
:is-required="true"
/>
<VnSelect
url="Tags"
v-model="data.tag"
:label="t('globals.tag')"
:fields="['id', 'name']"
option-label="name"
option-value="id"
:is-required="true"
:sort-by="['name ASC']"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>
#{{ scope.opt?.id }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelect
:options="validPriorities"
v-model="data.priority"
:label="t('item.create.priority')"
:is-required="true"
/>
<VnSelect
url="ItemTypes"
v-model="data.typeFk"
:label="t('item.list.typeName')"
:fields="['id', 'code', 'name']"
option-label="name"
option-value="id"
:is-required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>
{{ scope.opt?.code }} #{{ scope.opt?.id }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelect
url="Intrastats"
v-model="data.intrastatFk"
:label="t('globals.intrastat')"
:fields="['id', 'description']"
option-label="description"
option-value="id"
:is-required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.description }}</QItemLabel>
<QItemLabel caption>
#{{ scope.opt?.id }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
<VnSelect
url="Origins"
v-model="data.originFk"
:label="t('globals.origin')"
:fields="['id', 'code', 'name']"
option-label="code"
option-value="id"
:is-required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>
{{ scope.opt?.code }} #{{ scope.opt?.id }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</template>
</VnTable>
</template> </template>
</VnTable> </VnSection>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.subName { .subName {
@ -497,5 +506,4 @@ es:
New item: Nuevo artículo New item: Nuevo artículo
Create Item: Crear artículo Create Item: Crear artículo
You can search by id: Puedes buscar por id You can search by id: Puedes buscar por id
Preview: Vista previa
</i18n> </i18n>

View File

@ -1,7 +1,6 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref, onMounted } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { onMounted } from 'vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
@ -233,7 +232,7 @@ onMounted(async () => {
<QItemSection> <QItemSection>
<VnSelect <VnSelect
:label="t('params.buyerFk')" :label="t('params.buyerFk')"
v-model="params.buyerFk" v-model="params.workerFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"
:options="buyersOptions" :options="buyersOptions"
option-value="id" option-value="id"
@ -266,10 +265,10 @@ onMounted(async () => {
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
<QItemLabel> <QItemLabel>
{{ scope.opt?.name}} {{ scope.opt?.name }}
</QItemLabel> </QItemLabel>
<QItemLabel caption> <QItemLabel caption>
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }} {{ `#${scope.opt?.id} , ${scope.opt?.nickname}` }}
</QItemLabel> </QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>
@ -369,7 +368,7 @@ onMounted(async () => {
:model-value="fieldFilter.selectedField" :model-value="fieldFilter.selectedField"
:options="moreFields" :options="moreFields"
option-label="label" option-label="label"
option-value="label" option-value="label"
dense dense
outlined outlined
rounded rounded

View File

@ -272,11 +272,12 @@ const onDenyAccept = (_, responseData) => {
<template #column-achieved="{ row }"> <template #column-achieved="{ row }">
<span> <span>
<VnInput <VnInput
ref="achievedRef"
type="number" type="number"
v-model.number="row.saleQuantity" v-model.number="row.saleQuantity"
:disable="!row.itemFk || row.isOk != null" :disable="!row.itemFk || row.isOk != null"
@blur="changeQuantity(row)" @blur="changeQuantity(row)"
@keyup.enter="changeQuantity(row)" @keyup.enter="$refs.achievedRef.vnInputRef.blur()"
dense dense
/> />
</span> </span>

View File

@ -48,14 +48,14 @@ const itemPackingTypesOptions = ref([]);
> >
<template #form="{ data }"> <template #form="{ data }">
<VnRow> <VnRow>
<VnInput v-model="data.code" :label="t('shared.code')" /> <VnInput v-model="data.code" :label="t('itemType.shared.code')" />
<VnInput v-model="data.name" :label="t('shared.name')" /> <VnInput v-model="data.name" :label="t('itemType.shared.name')" />
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnSelect <VnSelect
url="Workers/search" url="Workers/search"
v-model="data.workerFk" v-model="data.workerFk"
:label="t('shared.worker')" :label="t('itemType.shared.worker')"
sort-by="nickname ASC" sort-by="nickname ASC"
:fields="['id', 'nickname']" :fields="['id', 'nickname']"
option-label="nickname" option-label="nickname"
@ -83,7 +83,7 @@ const itemPackingTypesOptions = ref([]);
> >
<VnSelect <VnSelect
v-model="data.categoryFk" v-model="data.categoryFk"
:label="t('shared.category')" :label="t('itemType.shared.category')"
:options="categoriesOptions" :options="categoriesOptions"
option-value="id" option-value="id"
option-label="name" option-label="name"
@ -93,27 +93,30 @@ const itemPackingTypesOptions = ref([]);
<VnRow> <VnRow>
<VnSelect <VnSelect
v-model="data.temperatureFk" v-model="data.temperatureFk"
:label="t('shared.temperature')" :label="t('itemType.shared.temperature')"
:options="temperaturesOptions" :options="temperaturesOptions"
option-value="code" option-value="code"
option-label="name" option-label="name"
hide-selected hide-selected
/> />
<VnInput v-model="data.life" :label="t('shared.life')" /> <VnInput v-model="data.life" :label="t('itemType.summary.life')" />
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnSelect <VnSelect
v-model="data.itemPackingTypeFk" v-model="data.itemPackingTypeFk"
:label="t('shared.itemPackingType')" :label="t('itemType.shared.itemPackingType')"
:options="itemPackingTypesOptions" :options="itemPackingTypesOptions"
option-value="code" option-value="code"
option-label="description" option-label="description"
hide-selected hide-selected
/> />
<VnInput v-model="data.maxRefs" :label="t('shared.maxRefs')" /> <VnInput v-model="data.maxRefs" :label="t('itemType.shared.maxRefs')" />
</VnRow> </VnRow>
<VnRow> <VnRow>
<QCheckbox v-model="data.isFragile" :label="t('shared.fragile')" /> <QCheckbox
v-model="data.isFragile"
:label="t('itemType.shared.fragile')"
/>
</VnRow> </VnRow>
</template> </template>
</FormModel> </FormModel>

View File

@ -1,20 +1,12 @@
<script setup> <script setup>
import VnCard from 'components/common/VnCard.vue'; import VnCardBeta from 'components/common/VnCardBeta.vue';
import ItemTypeDescriptor from 'src/pages/Item/ItemType/Card/ItemTypeDescriptor.vue'; import ItemTypeDescriptor from 'src/pages/Item/ItemType/Card/ItemTypeDescriptor.vue';
import ItemTypeFilter from 'src/pages/Item/ItemType/ItemTypeFilter.vue';
import ItemTypeSearchbar from '../ItemTypeSearchbar.vue';
</script> </script>
<template> <template>
<VnCard <VnCardBeta
data-key="ItemTypeSummary" data-key="ItemTypeSummary"
base-url="ItemTypes" base-url="ItemTypes"
:descriptor="ItemTypeDescriptor" :descriptor="ItemTypeDescriptor"
:filter-panel="ItemTypeFilter" />
search-data-key="ItemTypeList"
search-url="ItemTypes"
>
<template #searchbar>
<ItemTypeSearchbar />
</template>
</VnCard>
</template> </template>

View File

@ -50,20 +50,16 @@ const setData = (entity) => (data.value = useCardDescription(entity.code, entity
@on-fetch="setData" @on-fetch="setData"
> >
<template #body="{ entity }"> <template #body="{ entity }">
<VnLv :label="t('shared.code')" :value="entity.code" /> <VnLv :label="t('itemType.shared.code')" :value="entity.code" />
<VnLv :label="t('shared.name')" :value="entity.name" /> <VnLv :label="t('itemType.shared.name')" :value="entity.name" />
<VnLv :label="t('shared.worker')"> <VnLv :label="t('itemType.shared.worker')">
<template #value> <template #value>
<span class="link">{{ entity.worker?.firstName }}</span> <span class="link">{{ entity.worker?.firstName }}</span>
<WorkerDescriptorProxy :id="entity.worker?.id" /> <WorkerDescriptorProxy :id="entity.worker?.id" />
</template> </template>
</VnLv> </VnLv>
<VnLv :label="t('shared.category')" :value="entity.category?.name" /> <VnLv :label="t('itemType.shared.category')" :value="entity.category?.name" />
</template> </template>
</CardDescriptor> </CardDescriptor>
</template> </template>
<i18n>
es:
Go to module index: Ir al índice del módulo
</i18n>

View File

@ -1,90 +0,0 @@
<script setup>
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
const { t } = useI18n();
const props = defineProps({
dataKey: {
type: String,
required: true,
},
});
const emit = defineEmits(['search']);
const exprBuilder = (param, value) => {
switch (param) {
case 'name':
return {
name: { like: `%${value}%` },
};
case 'code':
return {
code: { like: `%${value}%` },
};
case 'search':
if (value) {
if (!isNaN(value)) {
return { id: value };
} else {
return {
or: [
{
name: {
like: `%${value}%`,
},
},
{
code: {
like: `%${value}%`,
},
},
],
};
}
}
}
};
</script>
<template>
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
@search="emit('search')"
search-url="table"
:expr-builder="exprBuilder"
>
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params }">
<QItem>
<QItemSection>
<VnInput :label="t('Name')" v-model="params.name" is-outlined />
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput v-model="params.code" :label="t('Code')" is-outlined />
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
name: Name
code: Code
es:
params:
name: Nombre
code: Código
Name: Nombre
Code: Código
</i18n>

View File

@ -1,19 +0,0 @@
<script setup>
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
</script>
<template>
<VnSearchbar
data-key="ItemTypeList"
url="ItemTypes"
:label="t('Search item type')"
:info="t('Search itemType by id, name or code')"
/>
</template>
<i18n>
es:
Search item type: Buscar familia
Search itemType by id, name or code: Buscar familia por id, nombre o código
</i18n>

View File

@ -15,3 +15,5 @@ itemType:
promo: Promo promo: Promo
itemPackingType: Item packing type itemPackingType: Item packing type
isUnconventionalSize: Is unconventional size isUnconventionalSize: Is unconventional size
search: Search item type
searchInfo: Search item type by id, name or code

View File

@ -15,3 +15,5 @@ itemType:
promo: Promoción promo: Promoción
itemPackingType: Tipo de embalaje itemPackingType: Tipo de embalaje
isUnconventionalSize: Es de tamaño poco convencional isUnconventionalSize: Es de tamaño poco convencional
search: Buscar familia
searchInfo: Buscar familia por id, nombre o código

View File

@ -1,17 +1,50 @@
<script setup> <script setup>
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import ItemTypeSearchbar from 'src/pages/Item/ItemType/ItemTypeSearchbar.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import ItemTypeFilter from './ItemType/ItemTypeFilter.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
import VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n(); const { t } = useI18n();
const tableRef = ref(); const tableRef = ref();
const itemCategoriesOptions = ref([]); const itemCategoriesOptions = ref([]);
const temperatureOptions = ref([]); const temperatureOptions = ref([]);
const dataKey = 'ItemTypeList';
const exprBuilder = (param, value) => {
switch (param) {
case 'name':
return {
name: { like: `%${value}%` },
};
case 'code':
return {
code: { like: `%${value}%` },
};
case 'search':
if (value) {
if (!isNaN(value)) {
return { id: value };
} else {
return {
or: [
{
name: {
like: `%${value}%`,
},
},
{
code: {
like: `%${value}%`,
},
},
],
};
}
}
}
};
const columns = computed(() => [ const columns = computed(() => [
{ {
@ -103,49 +136,53 @@ const columns = computed(() => [
@on-fetch="(data) => (temperatureOptions = data)" @on-fetch="(data) => (temperatureOptions = data)"
auto-load auto-load
/> />
<RightMenu> <VnSection
<template #right-panel> :data-key="dataKey"
<ItemTypeFilter data-key="ItemTypeList" /> :columns="columns"
</template> prefix="itemType"
</RightMenu> :array-data-props="{
<ItemTypeSearchbar /> url: 'ItemTypes',
<VnTable order: 'name ASC',
ref="tableRef" exprBuilder,
data-key="ItemTypeList" userFilter: {
url="ItemTypes" include: {
:create="{ relation: 'worker',
urlCreate: 'ItemTypes', scope: {
title: t('Create ItemTypes'), fields: ['id'],
onDataSaved: () => tableRef.reload(), include: {
formInitialData: {}, relation: 'user',
}" scope: {
:user-filter="{ fields: ['id', 'name'],
include: { },
relation: 'worker',
scope: {
fields: ['id'],
include: {
relation: 'user',
scope: {
fields: ['id', 'name'],
}, },
}, },
}, },
}, },
}" }"
order="name ASC"
:columns="columns"
auto-load
:right-search="false"
redirect="item/item-type"
> >
<template #column-workerFk="{ row }"> <template #body>
<span class="link" @click.stop> <VnTable
{{ row.worker?.user?.name }} ref="tableRef"
<WorkerDescriptorProxy :id="row.workerFk" /> :data-key="dataKey"
</span> :create="{
urlCreate: 'ItemTypes',
title: t('Create ItemTypes'),
onDataSaved: () => tableRef.reload(),
formInitialData: {},
}"
:columns="columns"
auto-load
redirect="item/item-type"
>
<template #column-workerFk="{ row }">
<span class="link" @click.stop>
{{ row.worker?.user?.name }}
<WorkerDescriptorProxy :id="row.workerFk" />
</span>
</template>
</VnTable>
</template> </template>
</VnTable> </VnSection>
</template> </template>
<i18n> <i18n>

View File

@ -76,13 +76,6 @@ itemTags:
searchbar: searchbar:
label: Search item label: Search item
info: Search by item id info: Search by item id
itemType:
shared:
code: Code
name: Name
worker: Worker
category: Category
temperature: Temperature
item: item:
params: params:
daysOnward: Days onward daysOnward: Days onward
@ -180,44 +173,46 @@ item:
intrastat: Intrastat intrastat: Intrastat
origin: Origin origin: Origin
buyRequest: buyRequest:
ticketId: 'Ticket ID' ticketId: Ticket ID
shipped: 'Shipped' shipped: Shipped
requester: 'Requester' requester: Requester
requested: 'Requested' requested: Requested
price: 'Price' price: Price
attender: 'Attender' attender: Attender
item: 'Item' item: Item
achieved: 'Achieved' achieved: Achieved
concept: 'Concept' concept: Concept
state: 'State' state: State
summary: summary:
basicData: 'Basic data' basicData: Basic data
otherData: 'Other data' otherData: Other data
description: 'Description' description: Description
tax: 'Tax' tax: Tax
tags: 'Tags' tags: Tags
botanical: 'Botanical' botanical: Botanical
barcode: 'Barcode' barcode: Barcode
name: 'Nombre' name: Name
completeName: 'Nombre completo' completeName: Complete name
family: 'Familia' family: Family
size: 'Medida' size: Size
origin: 'Origen' origin: Origin
stems: 'Tallos' stems: Stems
multiplier: 'Multiplicador' multiplier: Multiplier
buyer: 'Comprador' buyer: Buyer
doPhoto: 'Do photo' doPhoto: Do photo
intrastatCode: 'Código intrastat' intrastatCode: Intrastat code
intrastat: 'Intrastat' intrastat: 'Intrastat'
ref: 'Referencia' ref: Reference
relevance: 'Relevancia' relevance: Relevance
weight: 'Peso (gramos)/tallo' weight: Weight (gram)/stem
units: 'Unidades/caja' units: Units/box
expense: 'Gasto' expense: Expense
generic: 'Genérico' generic: Generic
recycledPlastic: 'Plástico reciclado' recycledPlastic: Recycled plastic
nonRecycledPlastic: 'Plástico no reciclado' nonRecycledPlastic: Non recycled plastic
minSalesQuantity: 'Cantidad mínima de venta' minSalesQuantity: Min sales quantity
genus: 'Genus' genus: Genus
specie: 'Specie' specie: Specie
regularizeStock: Regularize stock search: 'Search item'
searchInfo: 'You can search by id'
regularizeStock: Regularize stock

View File

@ -73,9 +73,6 @@ itemTags:
addTag: Añadir etiqueta addTag: Añadir etiqueta
tag: Etiqueta tag: Etiqueta
value: Valor value: Valor
searchbar:
label: Buscar artículo
info: Buscar por id de artículo
itemType: itemType:
shared: shared:
code: Código code: Código
@ -83,6 +80,9 @@ itemType:
worker: Trabajador worker: Trabajador
category: Reino category: Reino
temperature: Temperatura temperature: Temperatura
searchbar:
label: Buscar artículo
info: Buscar por id de artículo
params: params:
state: asfsdf state: asfsdf
item: item:
@ -108,9 +108,6 @@ item:
concept: Concepto concept: Concepto
denyOptions: Denegado denyOptions: Denegado
scopeDays: Días en adelante scopeDays: Días en adelante
searchbar:
label: Buscar artículo
info: Puedes buscar por id
descriptor: descriptor:
item: Artículo item: Artículo
buyer: Comprador buyer: Comprador
@ -182,35 +179,35 @@ item:
intrastat: Intrastat intrastat: Intrastat
origin: Origen origin: Origen
summary: summary:
basicData: 'Datos básicos' basicData: Datos básicos
otherData: 'Otros datos' otherData: Otros datos
description: 'Descripción' description: Descripción
tax: 'IVA' tax: IVA
tags: 'Etiquetas' tags: Etiquetas
botanical: 'Botánico' botanical: Botánico
barcode: 'Código de barras' barcode: Código de barras
name: 'Nombre' name: Nombre
completeName: 'Nombre completo' completeName: Nombre completo
family: 'Familia' family: Familia
size: 'Medida' size: Medida
origin: 'Origen' origin: Origen
stems: 'Tallos' stems: Tallos
multiplier: 'Multiplicador' multiplier: Multiplicador
buyer: 'Comprador' buyer: Comprador
doPhoto: 'Hacer foto' doPhoto: Hacer foto
intrastatCode: 'Código intrastat' intrastatCode: Código intrastat
intrastat: 'Intrastat' intrastat: Intrastat
ref: 'Referencia' ref: Referencia
relevance: 'Relevancia' relevance: Relevancia
weight: 'Peso (gramos)/tallo' weight: Peso (gramos)/tallo
units: 'Unidades/caja' units: Unidades/caja
expense: 'Gasto' expense: Gasto
generic: 'Genérico' generic: Genérico
recycledPlastic: 'Plástico reciclado' recycledPlastic: Plástico reciclado
nonRecycledPlastic: 'Plástico no reciclado' nonRecycledPlastic: Plástico no reciclado
minSalesQuantity: 'Cantidad mínima de venta' minSalesQuantity: Cantidad mínima de venta
genus: 'Genus' genus: Genus
specie: 'Specie' specie: Specie
regularizeStock: Regularizar stock regularizeStock: Regularizar stock
buyRequest: buyRequest:
ticketId: 'ID Ticket' ticketId: 'ID Ticket'
@ -223,3 +220,5 @@ item:
achieved: 'Conseguido' achieved: 'Conseguido'
concept: 'Concepto' concept: 'Concepto'
state: 'Estado' state: 'Estado'
search: 'Buscar artículo'
searchInfo: 'Puedes buscar por id'

View File

@ -290,7 +290,7 @@ const columns = computed(() => [
}, },
}, },
{ {
title: t('salesTicketsTable.preview'), title: t('globals.preview'),
icon: 'preview', icon: 'preview',
color: 'primary', color: 'primary',
action: (row) => viewSummary(row.id, TicketSummary), action: (row) => viewSummary(row.id, TicketSummary),

View File

@ -33,7 +33,6 @@ salesTicketsTable:
isFragile: Is fragile isFragile: Is fragile
zone: Zone zone: Zone
goToLines: Go to lines goToLines: Go to lines
preview: Preview
total: Total total: Total
preparation: H.Prep preparation: H.Prep
payMethod: Pay method payMethod: Pay method

View File

@ -115,6 +115,7 @@ const removeTagGroupParam = (params, search, valIndex) => {
} else { } else {
params.tagGroups.splice(valIndex, 1); params.tagGroups.splice(valIndex, 1);
} }
search();
}; };
const setCategoryList = (data) => { const setCategoryList = (data) => {

View File

@ -136,7 +136,7 @@ const columns = computed(() => [
name: 'tableActions', name: 'tableActions',
actions: [ actions: [
{ {
title: t('InvoiceOutSummary'), title: t('globals.pageTitles.summary'),
icon: 'preview', icon: 'preview',
action: (row) => viewSummary(row.id, OrderSummary), action: (row) => viewSummary(row.id, OrderSummary),
isPrimary: true, isPrimary: true,

View File

@ -1,19 +1,12 @@
<script setup> <script setup>
import VnCard from 'components/common/VnCard.vue'; import VnCardBeta from 'components/common/VnCardBeta.vue';
import ParkingDescriptor from 'pages/Parking/Card/ParkingDescriptor.vue'; import ParkingDescriptor from 'pages/Parking/Card/ParkingDescriptor.vue';
import ParkingFilter from 'pages/Parking/ParkingFilter.vue';
</script> </script>
<template> <template>
<VnCard <VnCardBeta
data-key="Parking" data-key="Parking"
base-url="Parkings" base-url="Parkings"
:descriptor="ParkingDescriptor" :descriptor="ParkingDescriptor"
:filter-panel="ParkingFilter"
search-data-key="ParkingList"
:searchbar-props="{
url: 'Parkings',
label: 'parking.searchBar.label',
info: 'parking.searchBar.info',
}"
/> />
</template> </template>

View File

@ -5,17 +5,17 @@ import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import VnPaginate from 'components/ui/VnPaginate.vue'; import VnPaginate from 'components/ui/VnPaginate.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import CardList from 'components/ui/CardList.vue'; import CardList from 'components/ui/CardList.vue';
import VnLv from 'components/ui/VnLv.vue'; import VnLv from 'components/ui/VnLv.vue';
import ParkingFilter from './ParkingFilter.vue'; import ParkingFilter from './ParkingFilter.vue';
import ParkingSummary from './Card/ParkingSummary.vue'; import ParkingSummary from './Card/ParkingSummary.vue';
import RightMenu from 'src/components/common/RightMenu.vue'; import VnSection from 'src/components/common/VnSection.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const { push } = useRouter(); const { push } = useRouter();
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const dataKey = 'ParkingList';
onMounted(() => (stateStore.rightDrawer = true)); onMounted(() => (stateStore.rightDrawer = true));
onUnmounted(() => (stateStore.rightDrawer = false)); onUnmounted(() => (stateStore.rightDrawer = false));
@ -37,58 +37,55 @@ function exprBuilder(param, value) {
</script> </script>
<template> <template>
<template> <VnSection
<VnSearchbar :data-key="dataKey"
data-key="ParkingList" prefix="parking"
:label="t('Search parking')" :array-data-props="{
:info="t('You can search by parking code')" url: 'Parkings',
/> order: ['code'],
</template> userFilter: filter,
<RightMenu> exprBuilder,
<template #right-panel> }"
>
<template #advanced-menu>
<ParkingFilter data-key="ParkingList" /> <ParkingFilter data-key="ParkingList" />
</template> </template>
</RightMenu> <template #body>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="vn-card-list"> <div class="vn-card-list">
<VnPaginate <VnPaginate :data-key="dataKey">
data-key="ParkingList" <template #body="{ rows }">
url="Parkings" <CardList
:user-filter="filter" v-for="row of rows"
:expr-builder="exprBuilder" :key="row.id"
:limit="20" :id="row.id"
order="code" :title="row.code"
> @click="
<template #body="{ rows }"> push({ path: `/shelving/parking/${row.id}/summary` })
<CardList "
v-for="row of rows" >
:key="row.id" <template #list-items>
:id="row.id" <VnLv
:title="row.code" label="Sector"
@click="push({ path: `/parking/${row.id}` })" :value="row.sector?.description"
> />
<template #list-items> <VnLv
<VnLv label="Sector" :value="row.sector?.description" /> :label="t('parking.pickingOrder')"
<VnLv :value="row.pickingOrder"
:label="t('parking.pickingOrder')" />
:value="row.pickingOrder" </template>
/> <template #actions>
<QBtn
:label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, ParkingSummary)"
color="primary"
/>
</template>
</CardList>
</template> </template>
<template #actions> </VnPaginate>
<QBtn </div>
:label="t('components.smartCard.openSummary')" </QPage>
@click.stop="viewSummary(row.id, ParkingSummary)" </template>
color="primary" </VnSection>
/>
</template>
</CardList>
</template>
</VnPaginate>
</div>
</QPage>
</template> </template>
<i18n>
es:
Search parking: Buscar parking
You can search by parking code: Puede buscar por el código del parking
</i18n>

View File

@ -0,0 +1,7 @@
parking:
pickingOrder: Picking order
sector: Sector
row: Row
column: Column
search: Search parking
searchInfo: You can search by parking code

View File

@ -0,0 +1,7 @@
parking:
pickingOrder: Orden de recogida
row: Fila
sector: Sector
column: Columna
search: Buscar parking
searchInfo: Puedes buscar por código de parking

View File

@ -2,11 +2,12 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n(); const { t } = useI18n();
const router = useRouter(); const router = useRouter();
const dataKey = 'AgencyList';
function navigate(id) { function navigate(id) {
router.push({ path: `/agency/${id}` }); router.push({ path: `/agency/${id}` });
} }
@ -67,26 +68,28 @@ const columns = computed(() => [
]); ]);
</script> </script>
<template> <template>
<VnSearchbar <VnSection
:info="t('You can search by name')" :data-key
:label="t('Search agency')" :columns="columns"
data-key="AgencyList" prefix="agency"
:expr-builder="exprBuilder" :right-filter="false"
/> :array-data-props="{
<div class="list-container"> url: 'Agencies',
<div class="list"> order: 'name',
exprBuilder,
}"
>
<template #body>
<VnTable <VnTable
data-key="AgencyList" :data-key
url="Agencies"
order="name"
:columns="columns" :columns="columns"
:right-search="false" :right-search="false"
:use-model="true" :use-model="true"
redirect="agency" redirect="route/agency"
default-mode="card" default-mode="card"
/> />
</div> </template>
</div> </VnSection>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.list { .list {
@ -104,8 +107,6 @@ const columns = computed(() => [
es: es:
isOwn: Tiene propietario isOwn: Tiene propietario
isAnyVolumeAllowed: Permite cualquier volumen isAnyVolumeAllowed: Permite cualquier volumen
Search agency: Buscar agencia
You can search by name: Puedes buscar por nombre
en: en:
isOwn: Has owner isOwn: Has owner
isAnyVolumeAllowed: Allows any volume isAnyVolumeAllowed: Allows any volume

View File

@ -1,17 +1,7 @@
<script setup> <script setup>
import AgencyDescriptor from 'pages/Route/Agency/Card/AgencyDescriptor.vue'; import AgencyDescriptor from 'pages/Route/Agency/Card/AgencyDescriptor.vue';
import VnCard from 'components/common/VnCard.vue'; import VnCardBeta from 'src/components/common/VnCardBeta.vue';
</script> </script>
<template> <template>
<VnCard <VnCardBeta data-key="Agency" base-url="Agencies" :descriptor="AgencyDescriptor" />
data-key="Agency"
base-url="Agencies"
:descriptor="AgencyDescriptor"
search-data-key="AgencyList"
:searchbar-props="{
url: 'Agencies',
label: 'agency.searchBar.label',
info: 'agency.searchBar.info',
}"
/>
</template> </template>

View File

@ -0,0 +1,55 @@
import { describe, it, expect, vi, afterEach } from 'vitest';
import axios from 'axios';
import { getAgencies } from 'src/pages/Route/Agency/composables/getAgencies';
vi.mock('axios');
describe('getAgencies', () => {
afterEach(() => {
vi.clearAllMocks();
});
const generateParams = (formData) => ({
params: {
warehouseFk: formData.warehouseId,
addressFk: formData.addressId,
landed: formData.landed,
},
});
it('should fetch agencies data with correct parameters for valid formData', async () => {
const formData = {
warehouseId: '123',
addressId: '456',
landed: 'true',
};
await getAgencies(formData);
expect(axios.get).toHaveBeenCalledWith('Agencies/getAgenciesWithWarehouse', generateParams(formData));
});
it('should not call API when formData is missing required landed field', async () => {
const formData = { warehouseId: '123', addressId: '456' };
await getAgencies(formData);
expect(axios.get).not.toHaveBeenCalled();
});
it('should not call API when formData is missing required addressId field', async () => {
const formData = { warehouseId: '123', landed: 'true' };
await getAgencies(formData);
expect(axios.get).not.toHaveBeenCalled();
});
it('should not call API when formData is missing required warehouseId field', async () => {
const formData = { addressId: '456', landed: 'true' };
await getAgencies(formData);
expect(axios.get).not.toHaveBeenCalled();
});
});

View File

@ -0,0 +1,12 @@
import axios from 'axios';
export async function getAgencies(formData) {
if (!formData.warehouseId || !formData.addressId || !formData.landed) return;
let params = {
warehouseFk: formData.warehouseId,
addressFk: formData.addressId,
landed: formData.landed,
};
return await axios.get('Agencies/getAgenciesWithWarehouse', { params });
}

View File

@ -1,4 +1,6 @@
agency: agency:
search: Search agency
searchInfo: You can search by name
isOwn: Own isOwn: Own
isAnyVolumeAllowed: Any volume allowed isAnyVolumeAllowed: Any volume allowed
notification: notification:

View File

@ -1,4 +1,6 @@
agency: agency:
search: Buscar agencia
searchInfo: Puedes buscar por nombre
isOwn: Propio isOwn: Propio
isAnyVolumeAllowed: Cualquier volumen isAnyVolumeAllowed: Cualquier volumen
removeItem: Agencia eliminada correctamente removeItem: Agencia eliminada correctamente

View File

@ -1,19 +1,8 @@
<script setup> <script setup>
import VnCard from 'components/common/VnCard.vue';
import RouteDescriptor from 'pages/Route/Card/RouteDescriptor.vue'; import RouteDescriptor from 'pages/Route/Card/RouteDescriptor.vue';
import RouteFilter from './RouteFilter.vue'; import VnCardBeta from 'src/components/common/VnCardBeta.vue';
import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue';
</script> </script>
<template> <template>
<VnCard <VnCardBeta data-key="Route" base-url="Routes" :descriptor="RouteDescriptor" />
data-key="Route"
base-url="Routes"
:descriptor="RouteDescriptor"
:filter-panel="RouteFilter"
search-data-key="RouteList"
>
<template #searchbar>
<RouteSearchbar />
</template>
</VnCard>
</template> </template>

View File

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

Some files were not shown because too many files have changed in this diff Show More