Merge branch 'dev' into 7058_leftMenu_vitest
This commit is contained in:
commit
29401f4d67
79
CHANGELOG.md
79
CHANGELOG.md
|
@ -1,3 +1,82 @@
|
||||||
|
# Version 25.00 - 2025-01-14
|
||||||
|
|
||||||
|
### Added 🆕
|
||||||
|
|
||||||
|
- chore: refs #7056 move test by:jorgep
|
||||||
|
- feat: refs #7050 7050 add object check by:Jtubau
|
||||||
|
- feat: refs #7050 7050 add test to isEmpty() by:Jtubau
|
||||||
|
- feat: refs #7056 add tests in FormModel by:jorgep
|
||||||
|
- feat: refs #7056 update route meta information and add FormModel tests by:jorgep
|
||||||
|
- feat: refs #7074 tests for fns setData(), parseDms() and showFormDialog() (7074-makeFrontTestToVnDmsList) by:Jtubau
|
||||||
|
- feat: refs #7079 created VnLocation front test by:provira
|
||||||
|
- feat: refs #7189 add Accept-Language header to axios requests by:jorgep
|
||||||
|
- feat: refs #7924 add custom inspection checkbox and localization support by:jgallego
|
||||||
|
- feat: refs #7924 update custom inspection label for clarity in English and Spanish locales by:jgallego
|
||||||
|
- feat: refs #8004 enhance FetchedTags component with column support and styling updates by:pablone
|
||||||
|
- feat: refs #8004 hide rightFilter by:pablone
|
||||||
|
- feat: refs #8246 added new field in list by:Jon
|
||||||
|
- feat: refs #8266 added descriptor to item name by:jtubau
|
||||||
|
- feat: refs #8293 add zone filter by:Jtubau
|
||||||
|
- feat: refs #8293 include zone data in each record by:Jtubau
|
||||||
|
- fix: refs #8004 more list style issues by:pablone
|
||||||
|
- fix: refs #8004 some style issues on all list by:pablone
|
||||||
|
- style: refs #8004 update layout and styling in FetchedTags and ItemList components by:pablone
|
||||||
|
- style: update CustomerBalance.vue to set label color by:jgallego
|
||||||
|
|
||||||
|
### Changed 📦
|
||||||
|
|
||||||
|
- perf: order by:alexm
|
||||||
|
- perf: redirect transition list to card by:alexm
|
||||||
|
- perf: refs #8201 onDataSaved fetch by:Jon
|
||||||
|
- perf: revert processData by:alexm
|
||||||
|
- perf: simplify if by:alexm
|
||||||
|
- perf: simplify if (perf_redirectTransition) by:alexm
|
||||||
|
- refactor: item fixedPrice by:Jon
|
||||||
|
- refactor: refs #7050 refactorize by:jtubau
|
||||||
|
- refactor: refs #7050 removed blank spaces by:jtubau
|
||||||
|
- refactor: refs #7052 move EditTableCellValueForm tests to a new location and enhance test coverage by:jgallego
|
||||||
|
- refactor: refs #7052 remove unnecessary console logs from EditTableCellValueForm tests by:jgallego
|
||||||
|
- refactor: refs #7074 move dms constant to global scope by:Jtubau
|
||||||
|
- refactor: refs #7079 removed useless code by:provira
|
||||||
|
- refactor: refs #7924 simplify custom inspection icon rendering in ExtraCommunity.vue by:jgallego
|
||||||
|
- refactor: refs #8004 remove console log from CardSummary component on mount by:pablone
|
||||||
|
- refactor: refs #8004 remove consoleLogs by:pablone
|
||||||
|
- refactor: refs #8004 remove unused stateStore import in InvoiceInList.vue by:pablone
|
||||||
|
- refactor: refs #8004 remove unused travelFilterRef and chip definition in TravelList.vue by:pablone
|
||||||
|
- refactor: refs #8004 replace VnSelect with VnSelectWorker in CustomerList component by:pablone
|
||||||
|
- refactor: refs #8201 added onMounted to stablish the value to show icons by:Jon
|
||||||
|
- refactor: refs #8201 deleted condition by:Jon
|
||||||
|
- refactor: refs #8201 deleted log by:Jon
|
||||||
|
- refactor: refs #8201 deleted logs by:Jon
|
||||||
|
- refactor: refs #8266 8266 change expedition item name by:Jtubau
|
||||||
|
- refactor: refs #8266 change expedition label by:Jtubau
|
||||||
|
- refactor: refs #8293 remove redundant attributes by:Jtubau
|
||||||
|
- refactor: refs #8320 changed folder names from "specs" to "**tests**" by:provira
|
||||||
|
- refactor: refs #8320 moved front tests to their respective sections by:provira
|
||||||
|
- refactor: refs #8813 removed unused class property by:provira
|
||||||
|
|
||||||
|
### Fixed 🛠️
|
||||||
|
|
||||||
|
- fix: discount class by:PAU ROVIRA ROSALENY
|
||||||
|
- fix: duplicate transalation after test to dev by:alexm
|
||||||
|
- fix: fix translations by:carlossa
|
||||||
|
- fix: redirect to sales when confirming lines by:Jon
|
||||||
|
- fix: refs #7050 delete import added by mistake by:Jtubau
|
||||||
|
- fix: refs #7133 handleSalesModelValue function to handle empty input by:jorgep
|
||||||
|
- fix: refs #7189 update user language on sessionStorage by:jorgep
|
||||||
|
- fix: refs #7935 remove unused 'companyFk' column from InvoiceInList component by:jorgep
|
||||||
|
- fix: refs #8004 more list style issues by:pablone
|
||||||
|
- fix: refs #8004 some style issues on all list by:pablone
|
||||||
|
- fix: refs #8004 update label for daysOnward in TravelFilter component and add translations by:pablone
|
||||||
|
- fix: refs #8004 vnTable card with and add permanent labels by:pablone
|
||||||
|
- fix: refs #8201 added onDataSaved emi to refetch when cahnges are made by:Jon
|
||||||
|
- fix: refs #8201 use arrayData to fix the error by:Jon
|
||||||
|
- fix: refs #8314 space between label and value by:jtubau
|
||||||
|
- fix: refs #8813 fixed ClaimLines format by:provira
|
||||||
|
- fix: update button sizes in ExtraCommunity.vue for better visibility by:jgallego
|
||||||
|
- perf: revert processData by:alexm
|
||||||
|
- refactor: item fixedPrice by:Jon
|
||||||
|
|
||||||
# Version 24.52 - 2024-01-07
|
# Version 24.52 - 2024-01-07
|
||||||
|
|
||||||
### Added 🆕
|
### Added 🆕
|
||||||
|
|
|
@ -31,7 +31,7 @@ export default {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
form.addEventListener('keyup', function (evt) {
|
form.addEventListener('keyup', function (evt) {
|
||||||
if (evt.key === 'Enter') {
|
if (evt.key === 'Enter' && !that.$attrs['prevent-submit']) {
|
||||||
const input = evt.target;
|
const input = evt.target;
|
||||||
if (input.type == 'textarea' && evt.shiftKey) {
|
if (input.type == 'textarea' && evt.shiftKey) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import FilterItemForm from 'src/components/FilterItemForm.vue';
|
||||||
|
import { vi, beforeAll, describe, expect, it } from 'vitest';
|
||||||
|
|
||||||
|
describe('FilterItemForm', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
wrapper = createWrapper(FilterItemForm, {
|
||||||
|
props: {
|
||||||
|
url: 'Items/withName',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
vm = wrapper.vm;
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
|
||||||
|
vi.spyOn(axios, 'get').mockResolvedValue({
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
id: 999996,
|
||||||
|
name: 'bolas de madera',
|
||||||
|
size: 2,
|
||||||
|
inkFk: null,
|
||||||
|
producerFk: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should filter data and populate tableRows for table display', async () => {
|
||||||
|
vm.itemFilterParams.name = 'bolas de madera';
|
||||||
|
|
||||||
|
await vm.onSubmit();
|
||||||
|
|
||||||
|
const expectedFilter = {
|
||||||
|
include: [
|
||||||
|
{ relation: 'producer', scope: { fields: ['name'] } },
|
||||||
|
{ relation: 'ink', scope: { fields: ['name'] } },
|
||||||
|
],
|
||||||
|
where: {"name":{"like":"%bolas de madera%"}},
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(axios.get).toHaveBeenCalledWith('Items/withName', {
|
||||||
|
params: { filter: JSON.stringify(expectedFilter) },
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(vm.tableRows).toEqual([
|
||||||
|
{
|
||||||
|
id: 999996,
|
||||||
|
name: 'bolas de madera',
|
||||||
|
size: 2,
|
||||||
|
inkFk: null,
|
||||||
|
producerFk: null,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle an empty itemFilterParams correctly', async () => {
|
||||||
|
vm.itemFilterParams.name = null;
|
||||||
|
vm.itemFilterParams = {};
|
||||||
|
|
||||||
|
await vm.onSubmit();
|
||||||
|
|
||||||
|
const expectedFilter = {
|
||||||
|
include: [
|
||||||
|
{ relation: 'producer', scope: { fields: ['name'] } },
|
||||||
|
{ relation: 'ink', scope: { fields: ['name'] } },
|
||||||
|
],
|
||||||
|
where: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(axios.get).toHaveBeenCalledWith('Items/withName', {
|
||||||
|
params: { filter: JSON.stringify(expectedFilter) },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should emit "itemSelected" with the correct id and close the form', () => {
|
||||||
|
vm.selectItem({ id: 12345 });
|
||||||
|
expect(wrapper.emitted('itemSelected')[0]).toEqual([12345]);
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,29 +1,17 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, useSlots } from 'vue';
|
import { onMounted, useSlots } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
import { useHasContent } from 'src/composables/useHasContent';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
const hasContent = ref(false);
|
const hasContent = useHasContent('#right-panel');
|
||||||
const rightPanel = ref(null);
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
rightPanel.value = document.querySelector('#right-panel');
|
|
||||||
if (!rightPanel.value) return;
|
|
||||||
|
|
||||||
const observer = new MutationObserver(() => {
|
|
||||||
hasContent.value = rightPanel.value.childNodes.length;
|
|
||||||
});
|
|
||||||
|
|
||||||
observer.observe(rightPanel.value, {
|
|
||||||
subtree: true,
|
|
||||||
childList: true,
|
|
||||||
attributes: true,
|
|
||||||
});
|
|
||||||
if ((!slots['right-panel'] && !hasContent.value) || quasar.platform.is.mobile)
|
if ((!slots['right-panel'] && !hasContent.value) || quasar.platform.is.mobile)
|
||||||
stateStore.rightDrawer = false;
|
stateStore.rightDrawer = false;
|
||||||
});
|
});
|
||||||
|
|
|
@ -42,10 +42,13 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
uppercase: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const vnInputRef = ref(null);
|
const vnInputRef = ref(null);
|
||||||
const showPassword = ref(false);
|
|
||||||
const value = computed({
|
const value = computed({
|
||||||
get() {
|
get() {
|
||||||
return $props.modelValue;
|
return $props.modelValue;
|
||||||
|
@ -117,6 +120,10 @@ const handleInsertMode = (e) => {
|
||||||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleUppercase = () => {
|
||||||
|
value.value = value.value?.toUpperCase() || '';
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -159,7 +166,16 @@ const handleInsertMode = (e) => {
|
||||||
emit('remove');
|
emit('remove');
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
></QIcon>
|
||||||
|
|
||||||
|
<QIcon
|
||||||
|
name="match_case"
|
||||||
|
size="xs"
|
||||||
|
v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase"
|
||||||
|
@click="handleUppercase"
|
||||||
|
class="uppercase-icon"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<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">
|
||||||
<QTooltip max-width="350px">
|
<QTooltip max-width="350px">
|
||||||
|
@ -170,3 +186,14 @@ const handleInsertMode = (e) => {
|
||||||
</QInput>
|
</QInput>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<i18n>
|
||||||
|
en:
|
||||||
|
inputMin: Must be more than {value}
|
||||||
|
maxLength: The value exceeds {value} characters
|
||||||
|
inputMax: Must be less than {value}
|
||||||
|
es:
|
||||||
|
inputMin: Debe ser mayor a {value}
|
||||||
|
maxLength: El valor excede los {value} carácteres
|
||||||
|
inputMax: Debe ser menor a {value}
|
||||||
|
</i18n>
|
|
@ -2,7 +2,7 @@
|
||||||
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
||||||
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { computed } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { useAttrs } from 'vue';
|
import { useAttrs } from 'vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -16,6 +16,14 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.location,
|
||||||
|
(newValue) => {
|
||||||
|
if (!modelValue.value) return;
|
||||||
|
modelValue.value = formatLocation(newValue) ?? null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const mixinRules = [requiredFieldRule];
|
const mixinRules = [requiredFieldRule];
|
||||||
const locationProperties = [
|
const locationProperties = [
|
||||||
'postcode',
|
'postcode',
|
||||||
|
@ -43,9 +51,7 @@ const formatLocation = (obj, properties = locationProperties) => {
|
||||||
return filteredParts.join(', ');
|
return filteredParts.join(', ');
|
||||||
};
|
};
|
||||||
|
|
||||||
const modelValue = computed(() =>
|
const modelValue = ref(props.location ? formatLocation(props.location) : null);
|
||||||
props.location ? formatLocation(props.location, locationProperties) : null
|
|
||||||
);
|
|
||||||
|
|
||||||
function showLabel(data) {
|
function showLabel(data) {
|
||||||
const dataProperties = [
|
const dataProperties = [
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
import RightMenu from './RightMenu.vue';
|
import RightMenu from './RightMenu.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
||||||
import { onBeforeMount, computed } from 'vue';
|
import { onBeforeMount, computed, ref } from 'vue';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useHasContent } from 'src/composables/useHasContent';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
section: {
|
section: {
|
||||||
|
@ -55,6 +56,8 @@ const isMainSection = computed(() => {
|
||||||
}
|
}
|
||||||
return isSame;
|
return isSame;
|
||||||
});
|
});
|
||||||
|
const searchbarId = 'section-searchbar';
|
||||||
|
const hasContent = useHasContent(`#${searchbarId}`);
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
if ($props.dataKey)
|
if ($props.dataKey)
|
||||||
|
@ -69,14 +72,14 @@ onBeforeMount(() => {
|
||||||
<template>
|
<template>
|
||||||
<slot name="searchbar">
|
<slot name="searchbar">
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
v-if="searchBar"
|
v-if="searchBar && !hasContent"
|
||||||
v-bind="arrayDataProps"
|
v-bind="arrayDataProps"
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
:label="$t(`${prefix}.search`)"
|
:label="$t(`${prefix}.search`)"
|
||||||
:info="$t(`${prefix}.searchInfo`)"
|
:info="$t(`${prefix}.searchInfo`)"
|
||||||
/>
|
/>
|
||||||
|
<div :id="searchbarId"></div>
|
||||||
</slot>
|
</slot>
|
||||||
|
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel v-if="$slots['rightMenu'] || rightFilter">
|
<template #right-panel v-if="$slots['rightMenu'] || rightFilter">
|
||||||
<slot name="rightMenu">
|
<slot name="rightMenu">
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper.js';
|
||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
|
||||||
|
function generateWrapper(date, outlined, required) {
|
||||||
|
wrapper = createWrapper(VnInputDate, {
|
||||||
|
props: {
|
||||||
|
modelValue: date,
|
||||||
|
},
|
||||||
|
attrs: {
|
||||||
|
isOutlined: outlined,
|
||||||
|
required: required
|
||||||
|
},
|
||||||
|
});
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
vm = wrapper.vm;
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('VnInputDate', () => {
|
||||||
|
|
||||||
|
describe('formattedDate', () => {
|
||||||
|
it('formats a valid date correctly', async () => {
|
||||||
|
generateWrapper('2023-12-25', false, false);
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.formattedDate).toBe('25/12/2023');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('updates the model value when a new date is set', async () => {
|
||||||
|
const input = wrapper.find('input');
|
||||||
|
await input.setValue('31/12/2023');
|
||||||
|
expect(wrapper.emitted()['update:modelValue']).toBeTruthy();
|
||||||
|
expect(wrapper.emitted()['update:modelValue'][0][0]).toBe('2023-12-31T00:00:00.000Z');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not update the model value when an invalid date is set', async () => {
|
||||||
|
const input = wrapper.find('input');
|
||||||
|
await input.setValue('invalid-date');
|
||||||
|
expect(wrapper.emitted()['update:modelValue'][0][0]).toBe('2023-12-31T00:00:00.000Z');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('styleAttrs', () => {
|
||||||
|
it('should return empty styleAttrs when isOutlined is false', async () => {
|
||||||
|
generateWrapper('2023-12-25', false, false);
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.styleAttrs).toEqual({});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set styleAttrs when isOutlined is true', async () => {
|
||||||
|
generateWrapper('2023-12-25', true, false);
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(vm.styleAttrs.outlined).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('required', () => {
|
||||||
|
it('should not applies required class when isRequired is false', async () => {
|
||||||
|
generateWrapper('2023-12-25', false, false);
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(wrapper.find('.vn-input-date').classes()).not.toContain('required');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should applies required class when isRequired is true', async () => {
|
||||||
|
generateWrapper('2023-12-25', false, true);
|
||||||
|
await vm.$nextTick();
|
||||||
|
expect(wrapper.find('.vn-input-date').classes()).toContain('required');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,63 @@
|
||||||
|
import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
|
||||||
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
|
import VnInputTime from 'components/common/VnInputTime.vue';
|
||||||
|
|
||||||
|
describe('VnInputTime', () => {
|
||||||
|
let wrapper;
|
||||||
|
let vm;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
wrapper = createWrapper(VnInputTime, {
|
||||||
|
props: {
|
||||||
|
isOutlined: true,
|
||||||
|
timeOnly: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
vm = wrapper.vm;
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the correct data if isOutlined is true', () => {
|
||||||
|
expect(vm.isOutlined).toBe(true);
|
||||||
|
expect(vm.styleAttrs).toEqual({ dense: true, outlined: true, rounded: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the formatted data', () => {
|
||||||
|
expect(vm.dateToTime('2022-01-01T03:23:43')).toBe('03:23');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('formattedTime', () => {
|
||||||
|
it('should return the formatted time for a valid ISO date', () => {
|
||||||
|
vm.model = '2025-01-02T15:45:00';
|
||||||
|
expect(vm.formattedTime).toBe('15:45');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle null model value gracefully', () => {
|
||||||
|
vm.model = null;
|
||||||
|
expect(vm.formattedTime).toBe(null);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle time-only input correctly', async () => {
|
||||||
|
await wrapper.setProps({ timeOnly: true });
|
||||||
|
vm.formattedTime = '14:30';
|
||||||
|
expect(vm.model).toBe('14:30');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should pad short time values correctly', async () => {
|
||||||
|
await wrapper.setProps({ timeOnly: true });
|
||||||
|
vm.formattedTime = '9';
|
||||||
|
expect(vm.model).toBe('09:00');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not update the model if the value is unchanged', () => {
|
||||||
|
vm.model = '14:30';
|
||||||
|
const previousModel = vm.model;
|
||||||
|
vm.formattedTime = '14:30';
|
||||||
|
expect(vm.model).toBe(previousModel);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -2,7 +2,6 @@
|
||||||
import { ref, computed, watch, onBeforeMount } from 'vue';
|
import { ref, computed, watch, onBeforeMount } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
import { isDialogOpened } from 'src/filters';
|
import { isDialogOpened } from 'src/filters';
|
||||||
import VnMoreOptions from './VnMoreOptions.vue';
|
import VnMoreOptions from './VnMoreOptions.vue';
|
||||||
|
@ -82,7 +81,7 @@ async function fetch() {
|
||||||
<span v-else></span>
|
<span v-else></span>
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="header" :entity="entity" dense>
|
<slot name="header" :entity="entity" dense>
|
||||||
<VnLv :label="`${entity.id} -`" :value="entity.name" />
|
{{ entity.id + ' - ' + entity.name }}
|
||||||
</slot>
|
</slot>
|
||||||
<span class="row no-wrap">
|
<span class="row no-wrap">
|
||||||
<slot name="header-right" :entity="entity" />
|
<slot name="header-right" :entity="entity" />
|
||||||
|
|
|
@ -18,8 +18,7 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
columns: {
|
columns: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
default: 3,
|
||||||
default: null,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,38 +1,49 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="header bg-primary q-pa-sm q-mb-md">
|
<div class="header bg-primary q-pa-sm q-mb-md">
|
||||||
<QSkeleton type="rect" square />
|
<QSkeleton type="rect" square />
|
||||||
|
<QSkeleton type="rect" square />
|
||||||
</div>
|
</div>
|
||||||
<div class="row q-pa-md q-col-gutter-md q-mb-md">
|
<div class="row q-pa-md q-col-gutter-md q-mb-md">
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<div class="col">
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
</div>
|
||||||
<QSkeleton type="text" square />
|
<div class="col">
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
</div>
|
||||||
<QSkeleton type="text" square />
|
<div class="col">
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
</div>
|
||||||
<QSkeleton type="rect" class="q-mb-md" square />
|
<div class="col">
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
<QSkeleton type="text" square />
|
<QSkeleton type="text" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<QSkeleton type="rect" class="q-mb-md" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
<QSkeleton type="text" square />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ onBeforeMount(async () => {
|
||||||
.data;
|
.data;
|
||||||
if (!channel) channel = defaultChannel;
|
if (!channel) channel = defaultChannel;
|
||||||
|
|
||||||
phone.value = await parsePhone(props.phoneNumber, props.country.toLowerCase());
|
phone.value = await parsePhone(props.phoneNumber, props.country?.toLowerCase());
|
||||||
config[
|
config[
|
||||||
type
|
type
|
||||||
].url = `${url}?customerIdentity=%2B${phone.value}&channelId=${channel}`;
|
].url = `${url}?customerIdentity=%2B${phone.value}&channelId=${channel}`;
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
import { vi, describe, expect, it, beforeAll, afterEach, beforeEach } from 'vitest';
|
||||||
|
import { createWrapper, axios } from 'app/test/vitest/helper';
|
||||||
|
import CardSummary from 'src/components/ui/CardSummary.vue';
|
||||||
|
import * as vueRouter from 'vue-router';
|
||||||
|
|
||||||
|
describe('CardSummary', () => {
|
||||||
|
let vm;
|
||||||
|
let wrapper;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
vi.spyOn(axios, 'get').mockResolvedValue({ data: [] });
|
||||||
|
});
|
||||||
|
|
||||||
|
vi.spyOn(vueRouter, 'useRoute').mockReturnValue({
|
||||||
|
query: {},
|
||||||
|
params: {},
|
||||||
|
meta: { moduleName: 'mockName' },
|
||||||
|
path: 'mockName/1/summary',
|
||||||
|
name: 'CardSummary',
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
wrapper = createWrapper(CardSummary, {
|
||||||
|
propsData: {
|
||||||
|
dataKey: 'cardSummaryKey',
|
||||||
|
url: 'cardSummaryUrl',
|
||||||
|
filter: 'cardFilter',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
vm = wrapper.vm;
|
||||||
|
wrapper = wrapper.wrapper;
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fetch data correctly', async () => {
|
||||||
|
const fetchSpy = vi
|
||||||
|
.spyOn(vm.arrayData, 'fetch')
|
||||||
|
.mockResolvedValue({ data: [{ id: 1, name: 'Test Entity' }] });
|
||||||
|
await vm.fetch();
|
||||||
|
|
||||||
|
expect(fetchSpy).toHaveBeenCalledWith({ append: false, updateRouter: false });
|
||||||
|
expect(wrapper.emitted('onFetch')).toBeTruthy();
|
||||||
|
expect(vm.isLoading).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set correct props to the store', () => {
|
||||||
|
expect(vm.store.url).toEqual('cardSummaryUrl');
|
||||||
|
expect(vm.store.filter).toEqual('cardFilter');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should compute entity correctly from store data', () => {
|
||||||
|
vm.store.data = [{ id: 1, name: 'Entity 1' }];
|
||||||
|
expect(vm.entity).toEqual({ id: 1, name: 'Entity 1' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle empty data gracefully', () => {
|
||||||
|
vm.store.data = [];
|
||||||
|
expect(vm.entity).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should respond to prop changes and refetch data', async () => {
|
||||||
|
const newUrl = 'CardSummary/35';
|
||||||
|
const newKey = 'cardSummaryKey/35';
|
||||||
|
const fetchSpy = vi.spyOn(vm.arrayData, 'fetch');
|
||||||
|
await wrapper.setProps({ url: newUrl, filter: { key: newKey } });
|
||||||
|
|
||||||
|
expect(fetchSpy).toHaveBeenCalled();
|
||||||
|
expect(vm.store.url).toBe(newUrl);
|
||||||
|
expect(vm.store.filter).toEqual({ key: newKey });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return true if route path ends with /summary' , () => {
|
||||||
|
expect(vm.isSummary).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
|
@ -7,7 +7,9 @@ import { isDialogOpened } from 'src/filters';
|
||||||
|
|
||||||
const arrayDataStore = useArrayDataStore();
|
const arrayDataStore = useArrayDataStore();
|
||||||
|
|
||||||
export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
export function useArrayData(key, userOptions) {
|
||||||
|
key ??= useRoute().meta.moduleName;
|
||||||
|
|
||||||
if (!key) throw new Error('ArrayData: A key is required to use this composable');
|
if (!key) throw new Error('ArrayData: A key is required to use this composable');
|
||||||
|
|
||||||
if (!arrayDataStore.get(key)) arrayDataStore.set(key);
|
if (!arrayDataStore.get(key)) arrayDataStore.set(key);
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
|
export function useHasContent(selector) {
|
||||||
|
const container = ref({});
|
||||||
|
const hasContent = ref();
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
container.value = document.querySelector(selector);
|
||||||
|
if (!container.value) return;
|
||||||
|
|
||||||
|
const observer = new MutationObserver(() => {
|
||||||
|
if (document.querySelector(selector))
|
||||||
|
hasContent.value = !!container.value.childNodes.length;
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(container.value, {
|
||||||
|
subtree: true,
|
||||||
|
childList: true,
|
||||||
|
attributes: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return hasContent;
|
||||||
|
}
|
|
@ -346,6 +346,7 @@ globals:
|
||||||
countryFk: Country
|
countryFk: Country
|
||||||
companyFk: Company
|
companyFk: Company
|
||||||
changePass: Change password
|
changePass: Change password
|
||||||
|
setPass: Set password
|
||||||
deleteConfirmTitle: Delete selected elements
|
deleteConfirmTitle: Delete selected elements
|
||||||
changeState: Change state
|
changeState: Change state
|
||||||
raid: 'Raid {daysInForward} days'
|
raid: 'Raid {daysInForward} days'
|
||||||
|
@ -388,80 +389,6 @@ cau:
|
||||||
subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.
|
subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.
|
||||||
inputLabel: Explain why this error should not appear
|
inputLabel: Explain why this error should not appear
|
||||||
askPrivileges: Ask for privileges
|
askPrivileges: Ask for privileges
|
||||||
entry:
|
|
||||||
list:
|
|
||||||
newEntry: New entry
|
|
||||||
tableVisibleColumns:
|
|
||||||
created: Creation
|
|
||||||
supplierFk: Supplier
|
|
||||||
isBooked: Booked
|
|
||||||
isConfirmed: Confirmed
|
|
||||||
isOrdered: Ordered
|
|
||||||
companyFk: Company
|
|
||||||
travelFk: Travel
|
|
||||||
isExcludedFromAvailable: Inventory
|
|
||||||
invoiceAmount: Import
|
|
||||||
summary:
|
|
||||||
commission: Commission
|
|
||||||
currency: Currency
|
|
||||||
invoiceNumber: Invoice number
|
|
||||||
ordered: Ordered
|
|
||||||
booked: Booked
|
|
||||||
excludedFromAvailable: Inventory
|
|
||||||
travelReference: Reference
|
|
||||||
travelAgency: Agency
|
|
||||||
travelShipped: Shipped
|
|
||||||
travelDelivered: Delivered
|
|
||||||
travelLanded: Landed
|
|
||||||
travelReceived: Received
|
|
||||||
buys: Buys
|
|
||||||
stickers: Stickers
|
|
||||||
package: Package
|
|
||||||
packing: Pack.
|
|
||||||
grouping: Group.
|
|
||||||
buyingValue: Buying value
|
|
||||||
import: Import
|
|
||||||
pvp: PVP
|
|
||||||
basicData:
|
|
||||||
travel: Travel
|
|
||||||
currency: Currency
|
|
||||||
commission: Commission
|
|
||||||
observation: Observation
|
|
||||||
booked: Booked
|
|
||||||
excludedFromAvailable: Inventory
|
|
||||||
buys:
|
|
||||||
observations: Observations
|
|
||||||
packagingFk: Box
|
|
||||||
color: Color
|
|
||||||
printedStickers: Printed stickers
|
|
||||||
notes:
|
|
||||||
observationType: Observation type
|
|
||||||
latestBuys:
|
|
||||||
tableVisibleColumns:
|
|
||||||
image: Picture
|
|
||||||
itemFk: Item ID
|
|
||||||
weightByPiece: Weight/Piece
|
|
||||||
isActive: Active
|
|
||||||
family: Family
|
|
||||||
entryFk: Entry
|
|
||||||
freightValue: Freight value
|
|
||||||
comissionValue: Commission value
|
|
||||||
packageValue: Package value
|
|
||||||
isIgnored: Is ignored
|
|
||||||
price2: Grouping
|
|
||||||
price3: Packing
|
|
||||||
minPrice: Min
|
|
||||||
ektFk: Ekt
|
|
||||||
packingOut: Package out
|
|
||||||
landing: Landing
|
|
||||||
isExcludedFromAvailable: Es inventory
|
|
||||||
params:
|
|
||||||
toShipped: To
|
|
||||||
fromShipped: From
|
|
||||||
warehouseiNFk: Warehouse
|
|
||||||
daysOnward: Days onward
|
|
||||||
daysAgo: Days ago
|
|
||||||
warehouseInFk: Warehouse in
|
|
||||||
ticket:
|
ticket:
|
||||||
params:
|
params:
|
||||||
ticketFk: Ticket ID
|
ticketFk: Ticket ID
|
||||||
|
@ -578,27 +505,6 @@ parking:
|
||||||
searchBar:
|
searchBar:
|
||||||
info: You can search by parking code
|
info: You can search by parking code
|
||||||
label: Search parking...
|
label: Search parking...
|
||||||
order:
|
|
||||||
field:
|
|
||||||
salesPersonFk: Sales Person
|
|
||||||
form:
|
|
||||||
clientFk: Client
|
|
||||||
addressFk: Address
|
|
||||||
agencyModeFk: Agency
|
|
||||||
list:
|
|
||||||
newOrder: New Order
|
|
||||||
summary:
|
|
||||||
basket: Basket
|
|
||||||
notConfirmed: Not confirmed
|
|
||||||
created: Created
|
|
||||||
createdFrom: Created From
|
|
||||||
address: Address
|
|
||||||
total: Total
|
|
||||||
items: Items
|
|
||||||
orderTicketList: Order Ticket List
|
|
||||||
amount: Amount
|
|
||||||
confirm: Confirm
|
|
||||||
confirmLines: Confirm lines
|
|
||||||
department:
|
department:
|
||||||
chat: Chat
|
chat: Chat
|
||||||
bossDepartment: Boss Department
|
bossDepartment: Boss Department
|
||||||
|
@ -889,7 +795,10 @@ components:
|
||||||
hasMinPrice: Minimum price
|
hasMinPrice: Minimum price
|
||||||
# LatestBuysFilter
|
# LatestBuysFilter
|
||||||
salesPersonFk: Buyer
|
salesPersonFk: Buyer
|
||||||
|
supplierFk: Supplier
|
||||||
from: From
|
from: From
|
||||||
|
to: To
|
||||||
|
visible: Is visible
|
||||||
active: Is active
|
active: Is active
|
||||||
floramondo: Is floramondo
|
floramondo: Is floramondo
|
||||||
showBadDates: Show future items
|
showBadDates: Show future items
|
||||||
|
|
|
@ -348,6 +348,7 @@ globals:
|
||||||
countryFk: País
|
countryFk: País
|
||||||
companyFk: Empresa
|
companyFk: Empresa
|
||||||
changePass: Cambiar contraseña
|
changePass: Cambiar contraseña
|
||||||
|
setPass: Establecer contraseña
|
||||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||||
changeState: Cambiar estado
|
changeState: Cambiar estado
|
||||||
raid: 'Redada {daysInForward} días'
|
raid: 'Redada {daysInForward} días'
|
||||||
|
@ -388,80 +389,6 @@ cau:
|
||||||
subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc
|
subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc
|
||||||
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
|
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
|
||||||
askPrivileges: Solicitar permisos
|
askPrivileges: Solicitar permisos
|
||||||
entry:
|
|
||||||
list:
|
|
||||||
newEntry: Nueva entrada
|
|
||||||
tableVisibleColumns:
|
|
||||||
created: Creación
|
|
||||||
supplierFk: Proveedor
|
|
||||||
isBooked: Asentado
|
|
||||||
isConfirmed: Confirmado
|
|
||||||
isOrdered: Pedida
|
|
||||||
companyFk: Empresa
|
|
||||||
travelFk: Envio
|
|
||||||
isExcludedFromAvailable: Inventario
|
|
||||||
invoiceAmount: Importe
|
|
||||||
summary:
|
|
||||||
commission: Comisión
|
|
||||||
currency: Moneda
|
|
||||||
invoiceNumber: Núm. factura
|
|
||||||
ordered: Pedida
|
|
||||||
booked: Contabilizada
|
|
||||||
excludedFromAvailable: Inventario
|
|
||||||
travelReference: Referencia
|
|
||||||
travelAgency: Agencia
|
|
||||||
travelShipped: F. envio
|
|
||||||
travelWarehouseOut: Alm. salida
|
|
||||||
travelDelivered: Enviada
|
|
||||||
travelLanded: F. entrega
|
|
||||||
travelReceived: Recibida
|
|
||||||
buys: Compras
|
|
||||||
stickers: Etiquetas
|
|
||||||
package: Embalaje
|
|
||||||
packing: Pack.
|
|
||||||
grouping: Group.
|
|
||||||
buyingValue: Coste
|
|
||||||
import: Importe
|
|
||||||
pvp: PVP
|
|
||||||
basicData:
|
|
||||||
travel: Envío
|
|
||||||
currency: Moneda
|
|
||||||
observation: Observación
|
|
||||||
commission: Comisión
|
|
||||||
booked: Asentado
|
|
||||||
excludedFromAvailable: Inventario
|
|
||||||
buys:
|
|
||||||
observations: Observaciónes
|
|
||||||
packagingFk: Embalaje
|
|
||||||
color: Color
|
|
||||||
printedStickers: Etiquetas impresas
|
|
||||||
notes:
|
|
||||||
observationType: Tipo de observación
|
|
||||||
latestBuys:
|
|
||||||
tableVisibleColumns:
|
|
||||||
image: Foto
|
|
||||||
itemFk: Id Artículo
|
|
||||||
weightByPiece: Peso (gramos)/tallo
|
|
||||||
isActive: Activo
|
|
||||||
family: Familia
|
|
||||||
entryFk: Entrada
|
|
||||||
freightValue: Porte
|
|
||||||
comissionValue: Comisión
|
|
||||||
packageValue: Embalaje
|
|
||||||
isIgnored: Ignorado
|
|
||||||
price2: Grouping
|
|
||||||
price3: Packing
|
|
||||||
minPrice: Min
|
|
||||||
ektFk: Ekt
|
|
||||||
packingOut: Embalaje envíos
|
|
||||||
landing: Llegada
|
|
||||||
isExcludedFromAvailable: Es inventario
|
|
||||||
params:
|
|
||||||
toShipped: Hasta
|
|
||||||
fromShipped: Desde
|
|
||||||
warehouseInFk: Alm. entrada
|
|
||||||
daysOnward: Días adelante
|
|
||||||
daysAgo: Días atras
|
|
||||||
ticket:
|
ticket:
|
||||||
params:
|
params:
|
||||||
ticketFk: ID de ticket
|
ticketFk: ID de ticket
|
||||||
|
@ -562,30 +489,6 @@ invoiceOut:
|
||||||
comercial: Comercial
|
comercial: Comercial
|
||||||
errors:
|
errors:
|
||||||
downloadCsvFailed: Error al descargar CSV
|
downloadCsvFailed: Error al descargar CSV
|
||||||
order:
|
|
||||||
field:
|
|
||||||
salesPersonFk: Comercial
|
|
||||||
form:
|
|
||||||
clientFk: Cliente
|
|
||||||
addressFk: Dirección
|
|
||||||
agencyModeFk: Agencia
|
|
||||||
list:
|
|
||||||
newOrder: Nuevo Pedido
|
|
||||||
summary:
|
|
||||||
basket: Cesta
|
|
||||||
notConfirmed: No confirmada
|
|
||||||
created: Creado
|
|
||||||
createdFrom: Creado desde
|
|
||||||
address: Dirección
|
|
||||||
total: Total
|
|
||||||
vat: IVA
|
|
||||||
state: Estado
|
|
||||||
alias: Alias
|
|
||||||
items: Artículos
|
|
||||||
orderTicketList: Tickets del pedido
|
|
||||||
amount: Monto
|
|
||||||
confirm: Confirmar
|
|
||||||
confirmLines: Confirmar lineas
|
|
||||||
shelving:
|
shelving:
|
||||||
list:
|
list:
|
||||||
parking: Parking
|
parking: Parking
|
||||||
|
@ -889,7 +792,11 @@ components:
|
||||||
wareHouseFk: Almacén
|
wareHouseFk: Almacén
|
||||||
# LatestBuysFilter
|
# LatestBuysFilter
|
||||||
salesPersonFk: Comprador
|
salesPersonFk: Comprador
|
||||||
|
supplierFk: Proveedor
|
||||||
|
visible: Visible
|
||||||
active: Activo
|
active: Activo
|
||||||
|
from: Desde
|
||||||
|
to: Hasta
|
||||||
floramondo: Floramondo
|
floramondo: Floramondo
|
||||||
showBadDates: Ver items a futuro
|
showBadDates: Ver items a futuro
|
||||||
userPanel:
|
userPanel:
|
||||||
|
|
|
@ -1,48 +1,56 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { computed, onMounted, ref } from 'vue';
|
import { computed, onMounted, ref, toRefs } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { useAcl } from 'src/composables/useAcl';
|
import { useAcl } from 'src/composables/useAcl';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
|
||||||
import useHasAccount from 'src/composables/useHasAccount.js';
|
|
||||||
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
import VnInputPassword from 'src/components/common/VnInputPassword.vue';
|
||||||
|
import VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
||||||
|
import { useQuasar } from 'quasar';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
entityId: {
|
hasAccount: {
|
||||||
type: Number,
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { hasAccount } = toRefs($props);
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
const { notify } = useNotify();
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
const state = useState();
|
||||||
|
const user = state.getUser();
|
||||||
|
const { notify } = useQuasar();
|
||||||
const account = computed(() => useArrayData('AccountId').store.data[0]);
|
const account = computed(() => useArrayData('AccountId').store.data[0]);
|
||||||
|
account.value.hasAccount = hasAccount.value;
|
||||||
onMounted(async () => {
|
const entityId = computed(() => +route.params.id);
|
||||||
account.value.hasAccount = await useHasAccount($props.entityId);
|
const hasitManagementAccess = ref();
|
||||||
});
|
const hasSysadminAccess = ref();
|
||||||
|
|
||||||
async function updateStatusAccount(active) {
|
async function updateStatusAccount(active) {
|
||||||
if (active) {
|
if (active) {
|
||||||
await axios.post(`Accounts`, { id: $props.entityId });
|
await axios.post(`Accounts`, { id: entityId.value });
|
||||||
} else {
|
} else {
|
||||||
await axios.delete(`Accounts/${$props.entityId}`);
|
await axios.delete(`Accounts/${entityId.value}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
account.value.hasAccount = active;
|
account.value.hasAccount = active;
|
||||||
const status = active ? 'enable' : 'disable';
|
const status = active ? 'enable' : 'disable';
|
||||||
notify({
|
notify({
|
||||||
message: t(`account.card.${status}Account.success`),
|
message: t(`account.card.actions.${status}Account.success`),
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async function updateStatusUser(active) {
|
async function updateStatusUser(active) {
|
||||||
await axios.patch(`VnUsers/${$props.entityId}`, { active });
|
await axios.patch(`VnUsers/${entityId.value}`, { active });
|
||||||
account.value.active = active;
|
account.value.active = active;
|
||||||
const status = active ? 'activate' : 'deactivate';
|
const status = active ? 'activate' : 'deactivate';
|
||||||
notify({
|
notify({
|
||||||
|
@ -50,6 +58,17 @@ async function updateStatusUser(active) {
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function deleteAccount() {
|
||||||
|
const { data } = await axios.delete(`VnUsers/${entityId.value}`);
|
||||||
|
if (data) {
|
||||||
|
notify({
|
||||||
|
message: t('account.card.actions.delete.success'),
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
router.push({ name: 'AccountList' });
|
||||||
|
}
|
||||||
|
}
|
||||||
const showSyncDialog = ref(false);
|
const showSyncDialog = ref(false);
|
||||||
const syncPassword = ref(null);
|
const syncPassword = ref(null);
|
||||||
const shouldSyncPassword = ref(false);
|
const shouldSyncPassword = ref(false);
|
||||||
|
@ -64,11 +83,27 @@ async function sync() {
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const askOldPass = ref(false);
|
||||||
|
const changePassRef = ref();
|
||||||
|
|
||||||
|
const onChangePass = (oldPass) => {
|
||||||
|
askOldPass.value = oldPass;
|
||||||
|
changePassRef.value.show();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
hasitManagementAccess.value = useAcl().hasAny([
|
||||||
|
{ model: 'VnUser', props: 'higherPrivileges', accessType: 'WRITE' },
|
||||||
|
]);
|
||||||
|
hasSysadminAccess.value = useAcl().hasAny([
|
||||||
|
{ model: 'VnUser', props: 'adminUser', accessType: 'WRITE' },
|
||||||
|
]);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnChangePassword
|
<VnChangePassword
|
||||||
ref="changePassRef"
|
ref="changePassRef"
|
||||||
:ask-old-pass="true"
|
:ask-old-pass="askOldPass"
|
||||||
:submit-fn="
|
:submit-fn="
|
||||||
async (newPassword, oldPassword) => {
|
async (newPassword, oldPassword) => {
|
||||||
await axios.patch(`Accounts/change-password`, {
|
await axios.patch(`Accounts/change-password`, {
|
||||||
|
@ -110,18 +145,46 @@ async function sync() {
|
||||||
</template>
|
</template>
|
||||||
</VnConfirm>
|
</VnConfirm>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="
|
v-if="hasitManagementAccess"
|
||||||
entityId == account.id &&
|
|
||||||
useAcl().hasAny([{ model: 'Account', props: '*', accessType: 'WRITE' }])
|
|
||||||
"
|
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="$refs.changePassRef.show()"
|
@click="
|
||||||
|
openConfirmationModal(
|
||||||
|
t('account.card.actions.disableAccount.title'),
|
||||||
|
t('account.card.actions.disableAccount.subtitle'),
|
||||||
|
() => deleteAccount()
|
||||||
|
)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('globals.changePass') }}</QItemSection>
|
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="account.hasAccount"
|
v-if="hasSysadminAccess"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="user.id === account.id ? onChangePass(true) : onChangePass(false)"
|
||||||
|
>
|
||||||
|
<QItemSection v-if="user.id === account.id">
|
||||||
|
{{ t('globals.changePass') }}
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection v-else>{{ t('globals.setPass') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="!account.hasAccount && hasSysadminAccess"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="
|
||||||
|
openConfirmationModal(
|
||||||
|
t('account.card.actions.enableAccount.title'),
|
||||||
|
t('account.card.actions.enableAccount.subtitle'),
|
||||||
|
() => updateStatusAccount(true)
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('account.card.actions.enableAccount.name') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="account.hasAccount && hasSysadminAccess"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="
|
@click="
|
||||||
|
@ -136,7 +199,7 @@ async function sync() {
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
||||||
<QItem
|
<QItem
|
||||||
v-if="!account.active"
|
v-if="!account.active && hasitManagementAccess"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="
|
@click="
|
||||||
|
@ -150,7 +213,7 @@ async function sync() {
|
||||||
<QItemSection>{{ t('account.card.actions.activateUser.name') }}</QItemSection>
|
<QItemSection>{{ t('account.card.actions.activateUser.name') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="account.active"
|
v-if="account.active && hasitManagementAccess"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="
|
@click="
|
||||||
|
@ -163,7 +226,12 @@ async function sync() {
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('account.card.actions.deactivateUser.name') }}</QItemSection>
|
<QItemSection>{{ t('account.card.actions.deactivateUser.name') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem v-ripple clickable @click="showSyncDialog = true">
|
<QItem
|
||||||
|
v-if="useAcl().hasAny([{ model: 'VnRole', props: '*', accessType: 'WRITE' }])"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="showSyncDialog = true"
|
||||||
|
>
|
||||||
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
|
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -11,16 +11,9 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
import VnLv from 'src/components/ui/VnLv.vue';
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
|
import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
|
||||||
import { useState } from 'src/composables/useState';
|
|
||||||
const state = useState();
|
|
||||||
|
|
||||||
const customer = ref();
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
customer.value = state.get('customer');
|
|
||||||
if (customer.value) customer.value.webAccess = data.value?.account?.isActive;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
const customerDebt = ref();
|
||||||
|
const customerCredit = ref();
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -42,10 +35,12 @@ const entityId = computed(() => {
|
||||||
|
|
||||||
const data = ref(useCardDescription());
|
const data = ref(useCardDescription());
|
||||||
const setData = (entity) => {
|
const setData = (entity) => {
|
||||||
|
customerDebt.value = entity?.debt;
|
||||||
|
customerCredit.value = entity?.credit;
|
||||||
data.value = useCardDescription(entity?.name, entity?.id);
|
data.value = useCardDescription(entity?.name, entity?.id);
|
||||||
};
|
};
|
||||||
const debtWarning = computed(() => {
|
const debtWarning = computed(() => {
|
||||||
return customer.value?.debt > customer.value?.credit ? 'negative' : 'primary';
|
return customerDebt.value > customerCredit.value ? 'negative' : 'primary';
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -97,26 +92,21 @@ const debtWarning = computed(() => {
|
||||||
:value="entity.businessType.description"
|
:value="entity.businessType.description"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #icons>
|
<template #icons="{ entity }">
|
||||||
<QCardActions v-if="customer" class="q-gutter-x-md">
|
<QCardActions class="q-gutter-x-md">
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="!customer.isActive"
|
v-if="!entity.isActive"
|
||||||
name="vn:disabled"
|
name="vn:disabled"
|
||||||
size="xs"
|
size="xs"
|
||||||
color="primary"
|
color="primary"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('customer.card.isDisabled') }}</QTooltip>
|
<QTooltip>{{ t('customer.card.isDisabled') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon v-if="entity.isFreezed" name="vn:frozen" size="xs" color="primary">
|
||||||
v-if="customer.isFreezed"
|
|
||||||
name="vn:frozen"
|
|
||||||
size="xs"
|
|
||||||
color="primary"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
|
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="!customer.account?.active"
|
v-if="!entity.account?.active"
|
||||||
color="primary"
|
color="primary"
|
||||||
name="vn:noweb"
|
name="vn:noweb"
|
||||||
size="xs"
|
size="xs"
|
||||||
|
@ -124,7 +114,7 @@ const debtWarning = computed(() => {
|
||||||
<QTooltip>{{ t('customer.card.webAccountInactive') }}</QTooltip>
|
<QTooltip>{{ t('customer.card.webAccountInactive') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="customer.debt > customer.credit"
|
v-if="entity.debt > entity.credit"
|
||||||
name="vn:risk"
|
name="vn:risk"
|
||||||
size="xs"
|
size="xs"
|
||||||
:color="debtWarning"
|
:color="debtWarning"
|
||||||
|
@ -132,7 +122,7 @@ const debtWarning = computed(() => {
|
||||||
<QTooltip>{{ t('customer.card.hasDebt') }}</QTooltip>
|
<QTooltip>{{ t('customer.card.hasDebt') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="!customer.isTaxDataChecked"
|
v-if="!entity.isTaxDataChecked"
|
||||||
name="vn:no036"
|
name="vn:no036"
|
||||||
size="xs"
|
size="xs"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -140,7 +130,7 @@ const debtWarning = computed(() => {
|
||||||
<QTooltip>{{ t('customer.card.notChecked') }}</QTooltip>
|
<QTooltip>{{ t('customer.card.notChecked') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="customer.unpaid"
|
v-if="entity.unpaid"
|
||||||
flat
|
flat
|
||||||
size="sm"
|
size="sm"
|
||||||
icon="vn:Client_unpaid"
|
icon="vn:Client_unpaid"
|
||||||
|
|
|
@ -44,6 +44,7 @@ function handleLocation(data, location) {
|
||||||
:required="true"
|
:required="true"
|
||||||
:rules="validate('client.socialName')"
|
:rules="validate('client.socialName')"
|
||||||
clearable
|
clearable
|
||||||
|
uppercase="true"
|
||||||
v-model="data.socialName"
|
v-model="data.socialName"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
|
|
@ -50,6 +50,14 @@ const columns = computed(() => [
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
create: true,
|
create: true,
|
||||||
columnClass: 'expand',
|
columnClass: 'expand',
|
||||||
|
attrs: {
|
||||||
|
uppercase: true,
|
||||||
|
},
|
||||||
|
columnFilter: {
|
||||||
|
attrs: {
|
||||||
|
uppercase: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
|
@ -11,6 +11,7 @@ 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 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';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -150,6 +151,22 @@ function onAgentCreated({ id, fiscalName }, data) {
|
||||||
</template>
|
</template>
|
||||||
</VnSelectDialog>
|
</VnSelectDialog>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInputNumber
|
||||||
|
:label="t('Longitude')"
|
||||||
|
clearable
|
||||||
|
v-model="data.longitude"
|
||||||
|
:decimal-places="7"
|
||||||
|
:positive="false"
|
||||||
|
/>
|
||||||
|
<VnInputNumber
|
||||||
|
:label="t('Latitude')"
|
||||||
|
clearable
|
||||||
|
v-model="data.latitude"
|
||||||
|
:decimal-places="7"
|
||||||
|
:positive="false"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
</FormModel>
|
</FormModel>
|
||||||
</template>
|
</template>
|
||||||
|
@ -175,4 +192,6 @@ es:
|
||||||
Mobile: Movíl
|
Mobile: Movíl
|
||||||
Incoterms: Incoterms
|
Incoterms: Incoterms
|
||||||
Customs agent: Agente de aduanas
|
Customs agent: Agente de aduanas
|
||||||
|
Longitude: Longitud
|
||||||
|
Latitude: Latitud
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -248,12 +248,14 @@ function handleLocation(data, location) {
|
||||||
clearable
|
clearable
|
||||||
v-model="data.longitude"
|
v-model="data.longitude"
|
||||||
:decimal-places="7"
|
:decimal-places="7"
|
||||||
|
:positive="false"
|
||||||
/>
|
/>
|
||||||
<VnInputNumber
|
<VnInputNumber
|
||||||
:label="t('Latitude')"
|
:label="t('Latitude')"
|
||||||
clearable
|
clearable
|
||||||
v-model="data.latitude"
|
v-model="data.latitude"
|
||||||
:decimal-places="7"
|
:decimal-places="7"
|
||||||
|
:positive="false"
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<h4 class="q-mb-xs">{{ t('Notes') }}</h4>
|
<h4 class="q-mb-xs">{{ t('Notes') }}</h4>
|
||||||
|
|
|
@ -106,7 +106,7 @@ const { openConfirmationModal } = useVnConfirm();
|
||||||
:to="{
|
:to="{
|
||||||
name: 'WorkerList',
|
name: 'WorkerList',
|
||||||
query: {
|
query: {
|
||||||
params: JSON.stringify({ departmentFk: entityId }),
|
table: JSON.stringify({ departmentFk: entityId }),
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,21 +1,13 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||||
import EntryDescriptor from './EntryDescriptor.vue';
|
import EntryDescriptor from './EntryDescriptor.vue';
|
||||||
import EntryFilter from '../EntryFilter.vue';
|
import filter from './EntryFilter.js'
|
||||||
import filter from './EntryFilter.js';
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta
|
||||||
data-key="Entry"
|
data-key="Entry"
|
||||||
base-url="Entries"
|
base-url="Entries"
|
||||||
:filter="filter"
|
|
||||||
:descriptor="EntryDescriptor"
|
:descriptor="EntryDescriptor"
|
||||||
:filter-panel="EntryFilter"
|
:user-filter="filter"
|
||||||
search-data-key="EntryList"
|
|
||||||
:searchbar-props="{
|
|
||||||
url: 'Entries/filter',
|
|
||||||
label: 'Search entries',
|
|
||||||
info: 'You can search by entry reference',
|
|
||||||
}"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -40,7 +40,7 @@ const companiesOptions = ref([]);
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`entryFilter.params.${tag.label}`) }}: </strong>
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -49,7 +49,7 @@ const companiesOptions = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="params.search"
|
v-model="params.search"
|
||||||
:label="t('entryFilter.filter.search')"
|
:label="t('entryFilter.params.search')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -58,7 +58,7 @@ const companiesOptions = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="params.reference"
|
v-model="params.reference"
|
||||||
:label="t('entryFilter.filter.reference')"
|
:label="t('entryFilter.params.reference')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -67,7 +67,7 @@ const companiesOptions = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="params.invoiceNumber"
|
v-model="params.invoiceNumber"
|
||||||
:label="t('params.invoiceNumber')"
|
:label="t('entryFilter.params.invoiceNumber')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -76,7 +76,7 @@ const companiesOptions = ref([]);
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="params.travelFk"
|
v-model="params.travelFk"
|
||||||
:label="t('params.travelFk')"
|
:label="t('entryFilter.params.travelFk')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -84,7 +84,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('params.companyFk')"
|
:label="t('entryFilter.params.companyFk')"
|
||||||
v-model="params.companyFk"
|
v-model="params.companyFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:options="companiesOptions"
|
:options="companiesOptions"
|
||||||
|
@ -100,7 +100,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('params.currencyFk')"
|
:label="t('entryFilter.params.currencyFk')"
|
||||||
v-model="params.currencyFk"
|
v-model="params.currencyFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:options="currenciesOptions"
|
:options="currenciesOptions"
|
||||||
|
@ -116,7 +116,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('params.supplierFk')"
|
:label="t('entryFilter.params.supplierFk')"
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
url="Suppliers"
|
url="Suppliers"
|
||||||
|
@ -148,7 +148,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('params.created')"
|
:label="t('entryFilter.params.created')"
|
||||||
v-model="params.created"
|
v-model="params.created"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
@ -158,7 +158,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('params.from')"
|
:label="t('entryFilter.params.from')"
|
||||||
v-model="params.from"
|
v-model="params.from"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
@ -168,7 +168,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
:label="t('params.to')"
|
:label="t('entryFilter.params.to')"
|
||||||
v-model="params.to"
|
v-model="params.to"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
is-outlined
|
is-outlined
|
||||||
|
@ -178,14 +178,14 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('params.isBooked')"
|
:label="t('entryFilter.params.isBooked')"
|
||||||
v-model="params.isBooked"
|
v-model="params.isBooked"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('params.isConfirmed')"
|
:label="t('entryFilter.params.isConfirmed')"
|
||||||
v-model="params.isConfirmed"
|
v-model="params.isConfirmed"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
|
@ -194,7 +194,7 @@ const companiesOptions = ref([]);
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('params.isOrdered')"
|
:label="t('entryFilter.params.isOrdered')"
|
||||||
v-model="params.isOrdered"
|
v-model="params.isOrdered"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
|
@ -203,34 +203,3 @@ const companiesOptions = ref([]);
|
||||||
</template>
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
en:
|
|
||||||
params:
|
|
||||||
|
|
||||||
invoiceNumber: Invoice number
|
|
||||||
travelFk: Travel
|
|
||||||
companyFk: Company
|
|
||||||
currencyFk: Currency
|
|
||||||
supplierFk: Supplier
|
|
||||||
from: From
|
|
||||||
to: To
|
|
||||||
created: Created
|
|
||||||
isBooked: Booked
|
|
||||||
isConfirmed: Confirmed
|
|
||||||
isOrdered: Ordered
|
|
||||||
es:
|
|
||||||
params:
|
|
||||||
|
|
||||||
invoiceNumber: Núm. factura
|
|
||||||
travelFk: Envío
|
|
||||||
companyFk: Empresa
|
|
||||||
currencyFk: Moneda
|
|
||||||
supplierFk: Proveedor
|
|
||||||
from: Desde
|
|
||||||
to: Hasta
|
|
||||||
created: Fecha creación
|
|
||||||
isBooked: Asentado
|
|
||||||
isConfirmed: Confirmado
|
|
||||||
isOrdered: Pedida
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('globals.weightByPiece'),
|
label: t('entry.latestBuys.tableVisibleColumns.weightByPiece'),
|
||||||
name: 'weightByPiece',
|
name: 'weightByPiece',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'number',
|
component: 'number',
|
||||||
|
@ -157,7 +157,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('entry.buys.packageValue'),
|
label: t('entry.latestBuys.tableVisibleColumns.packageValue'),
|
||||||
name: 'packageValue',
|
name: 'packageValue',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'number',
|
component: 'number',
|
||||||
|
@ -262,8 +262,3 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Edit buy(s): Editar compra(s)
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -2,17 +2,17 @@
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import EntryFilter from './EntryFilter.vue';
|
import EntryFilter from './EntryFilter.vue';
|
||||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import EntrySummary from './Card/EntrySummary.vue';
|
import EntrySummary from './Card/EntrySummary.vue';
|
||||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
const dataKey = 'EntryList';
|
||||||
|
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const entryFilter = {
|
const entryFilter = {
|
||||||
|
@ -178,73 +178,73 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<VnSection
|
||||||
data-key="EntryList"
|
:data-key="dataKey"
|
||||||
|
:columns="columns"
|
||||||
|
prefix="entry"
|
||||||
url="Entries/filter"
|
url="Entries/filter"
|
||||||
:label="t('Search entries')"
|
:array-data-props="{
|
||||||
:info="t('You can search by entry reference')"
|
url: 'Entries/filter',
|
||||||
/>
|
order: 'id DESC',
|
||||||
<RightMenu>
|
userFilter: 'entryFilter',
|
||||||
<template #right-panel>
|
}"
|
||||||
|
>
|
||||||
|
<template #rightMenu>
|
||||||
<EntryFilter data-key="EntryList" />
|
<EntryFilter data-key="EntryList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="EntryList"
|
:data-key="dataKey"
|
||||||
url="Entries/filter"
|
:create="{
|
||||||
:filter="entryFilter"
|
urlCreate: 'Entries',
|
||||||
:create="{
|
title: t('entry.list.newEntry'),
|
||||||
urlCreate: 'Entries',
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
title: t('Create entry'),
|
formInitialData: {},
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
}"
|
||||||
formInitialData: {},
|
:columns="columns"
|
||||||
}"
|
redirect="entry"
|
||||||
order="id DESC"
|
:right-search="false"
|
||||||
:columns="columns"
|
>
|
||||||
redirect="entry"
|
<template #column-status="{ row }">
|
||||||
:right-search="false"
|
<div class="row q-gutter-xs">
|
||||||
>
|
<QIcon
|
||||||
<template #column-status="{ row }">
|
v-if="!!row.isExcludedFromAvailable"
|
||||||
<div class="row q-gutter-xs">
|
name="vn:inventory"
|
||||||
<QIcon
|
color="primary"
|
||||||
v-if="!!row.isExcludedFromAvailable"
|
>
|
||||||
name="vn:inventory"
|
<QTooltip>{{
|
||||||
color="primary"
|
t(
|
||||||
>
|
'entry.list.tableVisibleColumns.isExcludedFromAvailable'
|
||||||
<QTooltip>{{
|
)
|
||||||
t('entry.list.tableVisibleColumns.isExcludedFromAvailable')
|
}}</QTooltip>
|
||||||
}}</QTooltip>
|
</QIcon>
|
||||||
</QIcon>
|
<QIcon v-if="!!row.isRaid" name="vn:net" color="primary">
|
||||||
<QIcon v-if="!!row.isRaid" name="vn:net" color="primary">
|
<QTooltip>
|
||||||
<QTooltip>
|
{{
|
||||||
{{
|
t('globals.raid', {
|
||||||
t('globals.raid', { daysInForward: row.daysInForward })
|
daysInForward: row.daysInForward,
|
||||||
}}</QTooltip
|
})
|
||||||
>
|
}}</QTooltip
|
||||||
</QIcon>
|
>
|
||||||
</div>
|
</QIcon>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #column-supplierFk="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row.supplierName }}
|
||||||
|
<SupplierDescriptorProxy :id="row.supplierFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-travelFk="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row.travelRef }}
|
||||||
|
<TravelDescriptorProxy :id="row.travelFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
<template #column-supplierFk="{ row }">
|
</VnSection>
|
||||||
<span class="link" @click.stop>
|
|
||||||
{{ row.supplierName }}
|
|
||||||
<SupplierDescriptorProxy :id="row.supplierFk" />
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
<template #column-travelFk="{ row }">
|
|
||||||
<span class="link" @click.stop>
|
|
||||||
{{ row.travelRef }}
|
|
||||||
<TravelDescriptorProxy :id="row.travelFk" />
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</VnTable>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Virtual entry: Es una redada
|
|
||||||
Search entries: Buscar entradas
|
|
||||||
You can search by entry reference: Puedes buscar por referencia de la entrada
|
|
||||||
Create entry: Crear entrada
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
@ -19,7 +19,7 @@ const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const columns = [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: 'Id',
|
label: 'Id',
|
||||||
|
@ -31,7 +31,7 @@ const columns = [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'workerFk',
|
name: 'workerFk',
|
||||||
label: t('Buyer'),
|
label: t('entryStockBought.buyer'),
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
component: 'select',
|
component: 'select',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
@ -49,7 +49,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
label: t('Reserve'),
|
label: t('entryStockBought.reserve'),
|
||||||
name: 'reserve',
|
name: 'reserve',
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
create: true,
|
create: true,
|
||||||
|
@ -58,7 +58,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
label: t('Bought'),
|
label: t('entryStockBought.bought'),
|
||||||
name: 'bought',
|
name: 'bought',
|
||||||
summation: true,
|
summation: true,
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
@ -66,7 +66,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('Date'),
|
label: t('entryStockBought.date'),
|
||||||
name: 'dated',
|
name: 'dated',
|
||||||
component: 'date',
|
component: 'date',
|
||||||
visible: false,
|
visible: false,
|
||||||
|
@ -77,7 +77,7 @@ const columns = [
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
title: t('View more details'),
|
title: t('entryStockBought.viewMoreDetails'),
|
||||||
icon: 'search',
|
icon: 'search',
|
||||||
isPrimary: true,
|
isPrimary: true,
|
||||||
action: (row) => {
|
action: (row) => {
|
||||||
|
@ -92,7 +92,7 @@ const columns = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
]);
|
||||||
|
|
||||||
const fetchDataRef = ref();
|
const fetchDataRef = ref();
|
||||||
const travelDialogRef = ref(false);
|
const travelDialogRef = ref(false);
|
||||||
|
@ -166,7 +166,7 @@ function round(value) {
|
||||||
<VnRow class="travel">
|
<VnRow class="travel">
|
||||||
<div v-if="travel">
|
<div v-if="travel">
|
||||||
<span style="color: var(--vn-label-color)">
|
<span style="color: var(--vn-label-color)">
|
||||||
{{ t('Purchase Spaces') }}:
|
{{ t('entryStockBought.purchaseSpaces') }}:
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
{{ travel?.m3 }}
|
{{ travel?.m3 }}
|
||||||
|
@ -177,7 +177,7 @@ function round(value) {
|
||||||
flat
|
flat
|
||||||
icon="edit"
|
icon="edit"
|
||||||
@click="openDialog()"
|
@click="openDialog()"
|
||||||
:title="t('Edit travel')"
|
:title="t('entryStockBought.editTravel')"
|
||||||
color="primary"
|
color="primary"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -226,7 +226,7 @@ function round(value) {
|
||||||
@on-fetch="(data) => setFooter(data)"
|
@on-fetch="(data) => setFooter(data)"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: 'StockBoughts',
|
urlCreate: 'StockBoughts',
|
||||||
title: t('Reserve some space'),
|
title: t('entryStockBought.reserveSomeSpace'),
|
||||||
onDataSaved: () => tableRef.reload(),
|
onDataSaved: () => tableRef.reload(),
|
||||||
formInitialData: {
|
formInitialData: {
|
||||||
workerFk: user.id,
|
workerFk: user.id,
|
||||||
|
@ -288,16 +288,3 @@ function round(value) {
|
||||||
color: $negative !important;
|
color: $negative !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Edit travel: Editar envío
|
|
||||||
Travel: Envíos
|
|
||||||
Purchase Spaces: Espacios de compra
|
|
||||||
Buyer: Comprador
|
|
||||||
Reserve: Reservado
|
|
||||||
Bought: Comprado
|
|
||||||
Date: Fecha
|
|
||||||
View more details: Ver más detalles
|
|
||||||
Reserve some space: Reservar espacio
|
|
||||||
This buyer has already made a reservation for this date: Este comprador ya ha hecho una reserva para esta fecha
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -123,8 +123,8 @@ const printBuys = (rowId) => {
|
||||||
<VnSearchbar
|
<VnSearchbar
|
||||||
data-key="myEntriesList"
|
data-key="myEntriesList"
|
||||||
url="Entries/filter"
|
url="Entries/filter"
|
||||||
:label="t('Search entries')"
|
:label="t('myEntries.search')"
|
||||||
:info="t('You can search by entry reference')"
|
:info="t('myEntries.searchInfo')"
|
||||||
/>
|
/>
|
||||||
<VnTable
|
<VnTable
|
||||||
data-key="myEntriesList"
|
data-key="myEntriesList"
|
||||||
|
@ -137,7 +137,3 @@ const printBuys = (rowId) => {
|
||||||
chip-locale="myEntries"
|
chip-locale="myEntries"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
You can search by entry reference: Puedes buscar por referencia de la entrada
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -1,9 +1,92 @@
|
||||||
entryList:
|
entry:
|
||||||
list:
|
list:
|
||||||
|
newEntry: New entry
|
||||||
|
tableVisibleColumns:
|
||||||
|
created: Creation
|
||||||
|
supplierFk: Supplier
|
||||||
|
isBooked: Booked
|
||||||
|
isConfirmed: Confirmed
|
||||||
|
isOrdered: Ordered
|
||||||
|
companyFk: Company
|
||||||
|
travelFk: Travel
|
||||||
|
isExcludedFromAvailable: Inventory
|
||||||
|
invoiceAmount: Import
|
||||||
inventoryEntry: Inventory entry
|
inventoryEntry: Inventory entry
|
||||||
showEntryReport: Show entry report
|
summary:
|
||||||
|
commission: Commission
|
||||||
|
currency: Currency
|
||||||
|
invoiceNumber: Invoice number
|
||||||
|
ordered: Ordered
|
||||||
|
booked: Booked
|
||||||
|
excludedFromAvailable: Inventory
|
||||||
|
travelReference: Reference
|
||||||
|
travelAgency: Agency
|
||||||
|
travelShipped: Shipped
|
||||||
|
travelDelivered: Delivered
|
||||||
|
travelLanded: Landed
|
||||||
|
travelReceived: Received
|
||||||
|
buys: Buys
|
||||||
|
stickers: Stickers
|
||||||
|
package: Package
|
||||||
|
packing: Pack.
|
||||||
|
grouping: Group.
|
||||||
|
buyingValue: Buying value
|
||||||
|
import: Import
|
||||||
|
pvp: PVP
|
||||||
|
basicData:
|
||||||
|
travel: Travel
|
||||||
|
currency: Currency
|
||||||
|
commission: Commission
|
||||||
|
observation: Observation
|
||||||
|
booked: Booked
|
||||||
|
excludedFromAvailable: Inventory
|
||||||
|
buys:
|
||||||
|
observations: Observations
|
||||||
|
packagingFk: Box
|
||||||
|
color: Color
|
||||||
|
printedStickers: Printed stickers
|
||||||
|
notes:
|
||||||
|
observationType: Observation type
|
||||||
|
latestBuys:
|
||||||
|
tableVisibleColumns:
|
||||||
|
image: Picture
|
||||||
|
itemFk: Item ID
|
||||||
|
weightByPiece: Weight/Piece
|
||||||
|
isActive: Active
|
||||||
|
family: Family
|
||||||
|
entryFk: Entry
|
||||||
|
freightValue: Freight value
|
||||||
|
comissionValue: Commission value
|
||||||
|
packageValue: Package value
|
||||||
|
isIgnored: Is ignored
|
||||||
|
price2: Grouping
|
||||||
|
price3: Packing
|
||||||
|
minPrice: Min
|
||||||
|
ektFk: Ekt
|
||||||
|
packingOut: Package out
|
||||||
|
landing: Landing
|
||||||
|
isExcludedFromAvailable: Es inventory
|
||||||
|
params:
|
||||||
|
toShipped: To
|
||||||
|
fromShipped: From
|
||||||
|
daysOnward: Days onward
|
||||||
|
daysAgo: Days ago
|
||||||
|
warehouseInFk: Warehouse in
|
||||||
|
search: Search entries
|
||||||
|
searchInfo: You can search by entry reference
|
||||||
entryFilter:
|
entryFilter:
|
||||||
filter:
|
params:
|
||||||
|
invoiceNumber: Invoice number
|
||||||
|
travelFk: Travel
|
||||||
|
companyFk: Company
|
||||||
|
currencyFk: Currency
|
||||||
|
supplierFk: Supplier
|
||||||
|
from: From
|
||||||
|
to: To
|
||||||
|
created: Created
|
||||||
|
isBooked: Booked
|
||||||
|
isConfirmed: Confirmed
|
||||||
|
isOrdered: Ordered
|
||||||
search: General search
|
search: General search
|
||||||
reference: Reference
|
reference: Reference
|
||||||
myEntries:
|
myEntries:
|
||||||
|
@ -19,5 +102,18 @@ myEntries:
|
||||||
daysOnward: Days onward
|
daysOnward: Days onward
|
||||||
daysAgo: Days ago
|
daysAgo: Days ago
|
||||||
downloadCsv: Download CSV
|
downloadCsv: Download CSV
|
||||||
|
search: Search entries
|
||||||
|
searchInfo: You can search by entry reference
|
||||||
|
entryStockBought:
|
||||||
|
travel: Travel
|
||||||
|
editTravel: Edit travel
|
||||||
|
purchaseSpaces: Purchase spaces
|
||||||
|
buyer: Buyer
|
||||||
|
reserve: Reserve
|
||||||
|
bought: Bought
|
||||||
|
date: Date
|
||||||
|
viewMoreDetails: View more details
|
||||||
|
reserveSomeSpace: Reserve some space
|
||||||
|
thisBuyerHasReservationThisDate: This buyer has already made a reservation for this date
|
||||||
wasteRecalc:
|
wasteRecalc:
|
||||||
recalcOk: The wastes were successfully recalculated
|
recalcOk: The wastes were successfully recalculated
|
||||||
|
|
|
@ -1,12 +1,93 @@
|
||||||
Search entries: Buscar entradas
|
entry:
|
||||||
You can search by entry reference: Puedes buscar por referencia de la entrada
|
|
||||||
|
|
||||||
entryList:
|
|
||||||
list:
|
list:
|
||||||
|
newEntry: Nueva entrada
|
||||||
|
tableVisibleColumns:
|
||||||
|
created: Creación
|
||||||
|
supplierFk: Proveedor
|
||||||
|
isBooked: Asentado
|
||||||
|
isConfirmed: Confirmado
|
||||||
|
isOrdered: Pedida
|
||||||
|
companyFk: Empresa
|
||||||
|
travelFk: Envio
|
||||||
|
isExcludedFromAvailable: Inventario
|
||||||
|
invoiceAmount: Importe
|
||||||
inventoryEntry: Es inventario
|
inventoryEntry: Es inventario
|
||||||
showEntryReport: Ver informe del pedido
|
summary:
|
||||||
|
commission: Comisión
|
||||||
|
currency: Moneda
|
||||||
|
invoiceNumber: Núm. factura
|
||||||
|
ordered: Pedida
|
||||||
|
booked: Contabilizada
|
||||||
|
excludedFromAvailable: Inventario
|
||||||
|
travelReference: Referencia
|
||||||
|
travelAgency: Agencia
|
||||||
|
travelShipped: F. envio
|
||||||
|
travelWarehouseOut: Alm. salida
|
||||||
|
travelDelivered: Enviada
|
||||||
|
travelLanded: F. entrega
|
||||||
|
travelReceived: Recibida
|
||||||
|
buys: Compras
|
||||||
|
stickers: Etiquetas
|
||||||
|
package: Embalaje
|
||||||
|
packing: Pack.
|
||||||
|
grouping: Group.
|
||||||
|
buyingValue: Coste
|
||||||
|
import: Importe
|
||||||
|
pvp: PVP
|
||||||
|
basicData:
|
||||||
|
travel: Envío
|
||||||
|
currency: Moneda
|
||||||
|
observation: Observación
|
||||||
|
commission: Comisión
|
||||||
|
booked: Asentado
|
||||||
|
excludedFromAvailable: Inventario
|
||||||
|
buys:
|
||||||
|
observations: Observaciónes
|
||||||
|
packagingFk: Embalaje
|
||||||
|
color: Color
|
||||||
|
printedStickers: Etiquetas impresas
|
||||||
|
notes:
|
||||||
|
observationType: Tipo de observación
|
||||||
|
latestBuys:
|
||||||
|
tableVisibleColumns:
|
||||||
|
image: Foto
|
||||||
|
itemFk: Id Artículo
|
||||||
|
weightByPiece: Peso (gramos)/tallo
|
||||||
|
isActive: Activo
|
||||||
|
family: Familia
|
||||||
|
entryFk: Entrada
|
||||||
|
freightValue: Porte
|
||||||
|
comissionValue: Comisión
|
||||||
|
packageValue: Embalaje
|
||||||
|
isIgnored: Ignorado
|
||||||
|
price2: Grouping
|
||||||
|
price3: Packing
|
||||||
|
minPrice: Min
|
||||||
|
ektFk: Ekt
|
||||||
|
packingOut: Embalaje envíos
|
||||||
|
landing: Llegada
|
||||||
|
isExcludedFromAvailable: Es inventario
|
||||||
|
params:
|
||||||
|
toShipped: Hasta
|
||||||
|
fromShipped: Desde
|
||||||
|
warehouseInFk: Alm. entrada
|
||||||
|
daysOnward: Días adelante
|
||||||
|
daysAgo: Días atras
|
||||||
|
search: Buscar entradas
|
||||||
|
searchInfo: Puedes buscar por referencia de entrada
|
||||||
entryFilter:
|
entryFilter:
|
||||||
filter:
|
params:
|
||||||
|
invoiceNumber: Núm. factura
|
||||||
|
travelFk: Envío
|
||||||
|
companyFk: Empresa
|
||||||
|
currencyFk: Moneda
|
||||||
|
supplierFk: Proveedor
|
||||||
|
from: Desde
|
||||||
|
to: Hasta
|
||||||
|
created: Fecha creación
|
||||||
|
isBooked: Asentado
|
||||||
|
isConfirmed: Confirmado
|
||||||
|
isOrdered: Pedida
|
||||||
search: Búsqueda general
|
search: Búsqueda general
|
||||||
reference: Referencia
|
reference: Referencia
|
||||||
myEntries:
|
myEntries:
|
||||||
|
@ -22,5 +103,18 @@ myEntries:
|
||||||
daysOnward: Días adelante
|
daysOnward: Días adelante
|
||||||
daysAgo: Días atras
|
daysAgo: Días atras
|
||||||
downloadCsv: Descargar CSV
|
downloadCsv: Descargar CSV
|
||||||
|
search: Buscar entradas
|
||||||
|
searchInfo: Puedes buscar por referencia de la entrada
|
||||||
|
entryStockBought:
|
||||||
|
travel: Envío
|
||||||
|
editTravel: Editar envío
|
||||||
|
purchaseSpaces: Espacios de compra
|
||||||
|
buyer: Comprador
|
||||||
|
reserve: Reservado
|
||||||
|
bought: Comprado
|
||||||
|
date: Fecha
|
||||||
|
viewMoreDetails: Ver más detalles
|
||||||
|
reserveSomeSpace: Reservar espacio
|
||||||
|
thisBuyerHasReservationThisDate: Este comprador ya ha hecho una reserva para esta fecha
|
||||||
wasteRecalc:
|
wasteRecalc:
|
||||||
recalcOk: Se han recalculado las mermas correctamente
|
recalcOk: Se han recalculado las mermas correctamente
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -166,10 +166,10 @@ const createInvoiceInCorrection = async () => {
|
||||||
<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 :label="t('invoiceIn.summary.booked')" :value="toDate(entity.booked)" />
|
<VnLv :label="t('invoicein.summary.bookedDate')" :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 }}
|
||||||
|
@ -186,7 +186,7 @@ const createInvoiceInCorrection = async () => {
|
||||||
color="primary"
|
color="primary"
|
||||||
:to="routes.getSupplier(entity.supplierFk)"
|
:to="routes.getSupplier(entity.supplierFk)"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('invoiceIn.list.supplier') }}</QTooltip>
|
<QTooltip>{{ t('invoicein.list.supplier') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn
|
<QBtn
|
||||||
size="md"
|
size="md"
|
||||||
|
@ -202,7 +202,7 @@ const createInvoiceInCorrection = async () => {
|
||||||
color="primary"
|
color="primary"
|
||||||
:to="routes.getTickets(entity.supplierFk)"
|
:to="routes.getTickets(entity.supplierFk)"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ t('invoiceOut.card.ticketList') }}</QTooltip>
|
<QTooltip>{{ t('InvoiceOut.card.ticketList') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-if="
|
v-if="
|
||||||
|
|
|
@ -33,15 +33,15 @@ const entityId = computed(() => $props.invoice.id || +currentRoute.value.params.
|
||||||
const invoiceIn = computed(() => arrayData.store.data);
|
const invoiceIn = computed(() => arrayData.store.data);
|
||||||
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 },
|
||||||
|
@ -84,7 +84,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' });
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,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` });
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ function sendPdfInvoice({ address }) {
|
||||||
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>
|
||||||
|
@ -155,28 +155,28 @@ function sendPdfInvoice({ address }) {
|
||||||
@click="triggerMenu('unbook')"
|
@click="triggerMenu('unbook')"
|
||||||
>
|
>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
{{ t('InvoiceIn.descriptorMenu.toUnbook') }}
|
{{ t('invoicein.descriptorMenu.toUnbook') }}
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
v-if="canEditProp('deleteById')"
|
v-if="canEditProp('deleteById')"
|
||||||
v-ripple
|
v-ripple
|
||||||
clickable
|
clickable
|
||||||
@click="triggerMenu('InvoiceIn.descriptorMenu.delete')"
|
@click="triggerMenu('invoicein.descriptorMenu.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
|
||||||
|
@ -186,7 +186,7 @@ function sendPdfInvoice({ address }) {
|
||||||
@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)">
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
},
|
},
|
||||||
|
@ -182,7 +182,7 @@ const cols = computed(() => [
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('InvoiceIn.list.supplierRef')"
|
:label="t('invoicein.list.supplierRef')"
|
||||||
v-model="data.supplierRef"
|
v-model="data.supplierRef"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
@ -194,7 +194,7 @@ const cols = computed(() => [
|
||||||
option-label="code"
|
option-label="code"
|
||||||
:required="true"
|
:required="true"
|
||||||
/>
|
/>
|
||||||
<VnInputDate :label="t('InvoiceIn.summary.issued')" v-model="data.issued" />
|
<VnInputDate :label="t('invoicein.summary.issued')" v-model="data.issued" />
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
InvoiceIn:
|
invoicein:
|
||||||
serial: Serial
|
serial: Serial
|
||||||
isBooked: Is booked
|
isBooked: Is booked
|
||||||
list:
|
list:
|
||||||
|
@ -66,7 +66,6 @@ InvoiceIn:
|
||||||
search: Id or supplier name
|
search: Id or supplier name
|
||||||
correctedFk: Corrected
|
correctedFk: Corrected
|
||||||
isBooked: Is booked
|
isBooked: Is booked
|
||||||
invoicein:
|
|
||||||
params:
|
|
||||||
account: Ledger account
|
account: Ledger account
|
||||||
correctingFk: Rectificative
|
correctingFk: Rectificative
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
InvoiceIn:
|
invoicein:
|
||||||
serial: Serie
|
serial: Serie
|
||||||
isBooked: Contabilizada
|
isBooked: Contabilizada
|
||||||
list:
|
list:
|
||||||
|
@ -63,7 +63,6 @@ InvoiceIn:
|
||||||
params:
|
params:
|
||||||
search: Id o nombre proveedor
|
search: Id o nombre proveedor
|
||||||
correctedFk: Rectificada
|
correctedFk: Rectificada
|
||||||
invoicein:
|
|
||||||
params:
|
|
||||||
account: Cuenta contable
|
account: Cuenta contable
|
||||||
correctingFk: Rectificativa
|
correctingFk: Rectificativa
|
||||||
|
|
||||||
|
|
|
@ -355,7 +355,7 @@ watchEffect(selectedRows);
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="InvoiceOutSerials"
|
url="InvoiceOutSerials"
|
||||||
v-model="data.serial"
|
v-model="data.serial"
|
||||||
:label="t('InvoiceIn.serial')"
|
:label="t('invoicein.serial')"
|
||||||
:options="invoiceOutSerialsOptions"
|
:options="invoiceOutSerialsOptions"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
option-value="code"
|
option-value="code"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, computed, reactive, ref, nextTick, watch } from 'vue';
|
import { onMounted, computed, ref, nextTick } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
||||||
|
@ -22,19 +22,16 @@ import VnSubToolbar from 'components/ui/VnSubToolbar.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const user = state.getUser();
|
const user = state.getUser();
|
||||||
const today = ref(Date.vnNew());
|
const today = Date.vnNew();
|
||||||
|
today.setHours(0, 0, 0, 0);
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
const itemBalancesRef = ref(null);
|
const itemBalances = computed(() => arrayDataItemBalances.store.data);
|
||||||
const itemsBalanceFilter = reactive({
|
const where = computed(() => arrayDataItemBalances.store.filter.where || {});
|
||||||
where: { itemFk: route.params.id, warehouseFk: null, date: null },
|
const showWhatsBeforeInventory = ref(false);
|
||||||
});
|
|
||||||
const itemBalances = ref([]);
|
|
||||||
const warehouseFk = ref(null);
|
|
||||||
const _showWhatsBeforeInventory = ref(false);
|
|
||||||
const inventoriedDate = ref(null);
|
const inventoriedDate = ref(null);
|
||||||
|
let arrayDataItemBalances = useArrayData('ItemBalances');
|
||||||
|
|
||||||
const originTypeMap = {
|
const originTypeMap = {
|
||||||
entry: {
|
entry: {
|
||||||
|
@ -122,36 +119,28 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const showWhatsBeforeInventory = computed({
|
|
||||||
get: () => _showWhatsBeforeInventory.value,
|
|
||||||
set: (val) => {
|
|
||||||
_showWhatsBeforeInventory.value = val;
|
|
||||||
if (!val) itemsBalanceFilter.where.date = null;
|
|
||||||
else itemsBalanceFilter.where.date = inventoriedDate.value ?? new Date();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
today.value.setHours(0, 0, 0, 0);
|
const ref = where.value;
|
||||||
if (route.query.warehouseFk) warehouseFk.value = route.query.warehouseFk;
|
const query = route.query;
|
||||||
else if (user.value) warehouseFk.value = user.value.warehouseFk;
|
inventoriedDate.value =
|
||||||
itemsBalanceFilter.where.warehouseFk = warehouseFk.value;
|
(await axios.get('Configs/findOne')).data?.inventoried || today;
|
||||||
const { data } = await axios.get('Configs/findOne');
|
|
||||||
inventoriedDate.value = data.inventoried;
|
if (query.warehouseFk) ref.warehouseFk = query.warehouseFk;
|
||||||
|
else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk;
|
||||||
|
if (ref.date) showWhatsBeforeInventory.value = true;
|
||||||
|
ref.itemFk = route.params.id;
|
||||||
|
|
||||||
|
arrayDataItemBalances = useArrayData('ItemBalances', {
|
||||||
|
url: 'Items/getBalance',
|
||||||
|
filter: { where: ref },
|
||||||
|
});
|
||||||
|
|
||||||
await fetchItemBalances();
|
await fetchItemBalances();
|
||||||
await scrollToToday();
|
await scrollToToday();
|
||||||
await updateWarehouse(warehouseFk.value);
|
await updateWarehouse(ref.warehouseFk);
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
|
||||||
() => router.currentRoute.value.params.id,
|
|
||||||
(newId) => {
|
|
||||||
itemsBalanceFilter.where.itemFk = newId;
|
|
||||||
itemBalancesRef.value.fetch();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const fetchItemBalances = async () => await itemBalancesRef.value.fetch();
|
|
||||||
|
|
||||||
const getBadgeAttrs = (_date) => {
|
const getBadgeAttrs = (_date) => {
|
||||||
const isSameDate = date.isSameDate(today.value, _date);
|
const isSameDate = date.isSameDate(today.value, _date);
|
||||||
|
@ -178,23 +167,13 @@ const formatDateForAttribute = (dateValue) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function updateWarehouse(warehouseFk) {
|
async function updateWarehouse(warehouseFk) {
|
||||||
const stock = useArrayData('descriptorStock', {
|
const stock = useArrayData('descriptorStock', { userParams: { warehouseFk } });
|
||||||
userParams: {
|
|
||||||
warehouseFk,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
await stock.fetch({});
|
await stock.fetch({});
|
||||||
stock.store.data.itemFk = route.params.id;
|
stock.store.data.itemFk = route.params.id;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
ref="itemBalancesRef"
|
|
||||||
url="Items/getBalance"
|
|
||||||
:filter="itemsBalanceFilter"
|
|
||||||
@on-fetch="(data) => (itemBalances = data)"
|
|
||||||
/>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||||
|
@ -207,27 +186,30 @@ async function updateWarehouse(warehouseFk) {
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('itemDiary.warehouse')"
|
:label="t('itemDiary.warehouse')"
|
||||||
:options="warehousesOptions"
|
:options="warehousesOptions"
|
||||||
hide-selected
|
v-model="where.warehouseFk"
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
dense
|
|
||||||
v-model="itemsBalanceFilter.where.warehouseFk"
|
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
(value) => fetchItemBalances() && updateWarehouse(value)
|
(val) => fetchItemBalances() && updateWarehouse(val)
|
||||||
"
|
"
|
||||||
class="q-mr-lg"
|
class="q-mr-lg"
|
||||||
|
:is-clearable="false"
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('itemDiary.showBefore')"
|
:label="t('itemDiary.showBefore')"
|
||||||
v-model="showWhatsBeforeInventory"
|
v-model="showWhatsBeforeInventory"
|
||||||
@update:model-value="fetchItemBalances"
|
@update:model-value="
|
||||||
|
async (val) => {
|
||||||
|
if (!val) where.date = null;
|
||||||
|
else where.date = inventoriedDate;
|
||||||
|
await fetchItemBalances();
|
||||||
|
}
|
||||||
|
"
|
||||||
class="q-mr-lg"
|
class="q-mr-lg"
|
||||||
/>
|
/>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
v-if="showWhatsBeforeInventory"
|
v-if="showWhatsBeforeInventory"
|
||||||
:label="t('itemDiary.since')"
|
:label="t('itemDiary.since')"
|
||||||
dense
|
dense
|
||||||
v-model="itemsBalanceFilter.where.date"
|
v-model="where.date"
|
||||||
@update:model-value="fetchItemBalances"
|
@update:model-value="fetchItemBalances"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -36,18 +36,7 @@ const exprBuilder = (param, value) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const where = {
|
let arrayData = useArrayData('ItemLastEntries');
|
||||||
itemFk: route.params.id,
|
|
||||||
};
|
|
||||||
|
|
||||||
const arrayData = useArrayData('ItemLastEntries', {
|
|
||||||
url: 'Items/lastEntriesFilter',
|
|
||||||
order: ['landed DESC', 'buyFk DESC'],
|
|
||||||
exprBuilder: exprBuilder,
|
|
||||||
userFilter: {
|
|
||||||
where: where,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const itemLastEntries = ref([]);
|
const itemLastEntries = ref([]);
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -161,25 +150,51 @@ const getDate = (date, type) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateFilter = async () => {
|
const updateFilter = async () => {
|
||||||
let filter;
|
let landed;
|
||||||
if (!from.value && to.value) filter = { lte: to.value };
|
if (!from.value && to.value) landed = { lte: to.value };
|
||||||
else if (from.value && !to.value) filter = { gte: from.value };
|
else if (from.value && !to.value) landed = { gte: from.value };
|
||||||
else if (from.value && to.value) filter = { between: [from.value, to.value] };
|
else if (from.value && to.value) landed = { between: [from.value, to.value] };
|
||||||
|
|
||||||
const userFilter = arrayData.store.userFilter.where;
|
|
||||||
|
|
||||||
userFilter.landed = filter;
|
|
||||||
|
|
||||||
|
arrayData.store.filter.where.landed = landed;
|
||||||
await fetchItemLastEntries();
|
await fetchItemLastEntries();
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const _from = Date.vnNew();
|
const landed = arrayData.store.filter.where?.landed;
|
||||||
_from.setDate(_from.getDate() - 75);
|
arrayData = useArrayData('ItemLastEntries', {
|
||||||
from.value = getDate(_from, 'from');
|
url: 'Items/lastEntriesFilter',
|
||||||
const _to = Date.vnNew();
|
order: ['landed DESC', 'buyFk DESC'],
|
||||||
_to.setDate(_to.getDate() + 10);
|
exprBuilder: exprBuilder,
|
||||||
to.value = getDate(_to, 'to');
|
filter: {
|
||||||
|
where: {
|
||||||
|
itemFk: route.params.id,
|
||||||
|
landed,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (landed) {
|
||||||
|
const key = Object.keys(landed)[0];
|
||||||
|
switch (key) {
|
||||||
|
case 'gte':
|
||||||
|
from.value = landed.gte;
|
||||||
|
break;
|
||||||
|
case 'lte':
|
||||||
|
to.value = landed.lte;
|
||||||
|
break;
|
||||||
|
case 'between':
|
||||||
|
from.value = landed.between[0];
|
||||||
|
to.value = landed.between[1];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const _from = Date.vnNew();
|
||||||
|
_from.setDate(_from.getDate() - 75);
|
||||||
|
from.value = getDate(_from, 'from');
|
||||||
|
const _to = Date.vnNew();
|
||||||
|
_to.setDate(_to.getDate() + 10);
|
||||||
|
to.value = getDate(_to, 'to');
|
||||||
|
}
|
||||||
|
|
||||||
updateFilter();
|
updateFilter();
|
||||||
|
|
||||||
|
|
|
@ -391,7 +391,7 @@ onBeforeMount(async () => {
|
||||||
{{ row?.subName.toUpperCase() }}
|
{{ row?.subName.toUpperCase() }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<FetchedTags :item="row" :columns="3" />
|
<FetchedTags :item="row" />
|
||||||
</template>
|
</template>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<VnInput
|
<VnInput
|
||||||
|
|
|
@ -58,6 +58,7 @@ lastEntries:
|
||||||
pvp: PVP
|
pvp: PVP
|
||||||
label: Label
|
label: Label
|
||||||
grouping: Grouping
|
grouping: Grouping
|
||||||
|
packing: Packing
|
||||||
quantity: Quantity
|
quantity: Quantity
|
||||||
cost: Cost
|
cost: Cost
|
||||||
kg: Kg.
|
kg: Kg.
|
||||||
|
|
|
@ -58,6 +58,7 @@ lastEntries:
|
||||||
pvp: PVP
|
pvp: PVP
|
||||||
label: Eti.
|
label: Eti.
|
||||||
grouping: Grouping
|
grouping: Grouping
|
||||||
|
packing: Packing
|
||||||
quantity: Cantidad
|
quantity: Cantidad
|
||||||
cost: Coste
|
cost: Coste
|
||||||
kg: Kg.
|
kg: Kg.
|
||||||
|
|
|
@ -1,38 +1,12 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue';
|
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
import VnCard from 'components/common/VnCard.vue';
|
|
||||||
import OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue';
|
import OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue';
|
||||||
import OrderFilter from './OrderFilter.vue';
|
|
||||||
import OrderSearchbar from './OrderSearchbar.vue';
|
|
||||||
import OrderCatalogFilter from './OrderCatalogFilter.vue';
|
|
||||||
const config = {
|
|
||||||
OrderCatalog: OrderCatalogFilter,
|
|
||||||
};
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const routeName = computed(() => route.name);
|
|
||||||
const customRouteRedirectName = computed(() => {
|
|
||||||
const route = config[routeName.value];
|
|
||||||
if (route) return null;
|
|
||||||
return 'OrderList';
|
|
||||||
});
|
|
||||||
const customFilterPanel = computed(() => {
|
|
||||||
const filterPanel = config[routeName.value] ?? OrderFilter;
|
|
||||||
return filterPanel;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnCard
|
<VnCardBeta
|
||||||
data-key="Order"
|
data-key="Order"
|
||||||
base-url="Orders"
|
base-url="Orders"
|
||||||
:descriptor="OrderDescriptor"
|
:descriptor="OrderDescriptor"
|
||||||
:filter-panel="customFilterPanel"
|
/>
|
||||||
:search-data-key="customRouteRedirectName"
|
|
||||||
>
|
|
||||||
<template #searchbar>
|
|
||||||
<OrderSearchbar />
|
|
||||||
</template>
|
|
||||||
</VnCard>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -15,15 +15,18 @@ const router = useRouter();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const dataKey = 'OrderCatalogList';
|
const dataKey = 'OrderCatalogList';
|
||||||
const arrayData = useArrayData(dataKey);
|
const catalogParams = {
|
||||||
const store = arrayData.store;
|
|
||||||
const tags = ref([]);
|
|
||||||
const itemRefs = ref({});
|
|
||||||
|
|
||||||
let catalogParams = {
|
|
||||||
orderFk: route.params.id,
|
orderFk: route.params.id,
|
||||||
orderBy: JSON.stringify({ field: 'relevancy DESC, name', way: 'ASC', isTag: false }),
|
orderBy: JSON.stringify({ field: 'relevancy DESC, name', way: 'ASC', isTag: false }),
|
||||||
};
|
};
|
||||||
|
const arrayData = useArrayData(dataKey, {
|
||||||
|
url: 'Orders/CatalogFilter',
|
||||||
|
limit: 50,
|
||||||
|
userParams: catalogParams,
|
||||||
|
});
|
||||||
|
const store = arrayData.store;
|
||||||
|
const tags = ref([]);
|
||||||
|
const itemRefs = ref({});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
|
@ -66,7 +69,6 @@ function extractValueTags(items) {
|
||||||
);
|
);
|
||||||
tagValue.value = resultValueTags;
|
tagValue.value = resultValueTags;
|
||||||
}
|
}
|
||||||
const autoLoad = computed(() => !!JSON.parse(route?.query.table ?? '{}')?.categoryFk);
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => store.data,
|
() => store.data,
|
||||||
|
@ -78,16 +80,15 @@ watch(
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnSearchbar
|
<Teleport to="#section-searchbar" v-if="stateStore.isHeaderMounted()">
|
||||||
:data-key="dataKey"
|
<VnSearchbar
|
||||||
:user-params="catalogParams"
|
:data-key="dataKey"
|
||||||
:static-params="['orderFk', 'orderBy']"
|
:redirect="false"
|
||||||
:redirect="false"
|
:label="t('Search items')"
|
||||||
url="Orders/CatalogFilter"
|
:info="t('You can search items by name or id')"
|
||||||
:label="t('Search items')"
|
:search-remove-params="false"
|
||||||
:info="t('You can search items by name or id')"
|
/>
|
||||||
:search-remove-params="false"
|
</Teleport>
|
||||||
/>
|
|
||||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
||||||
<OrderCatalogFilter
|
<OrderCatalogFilter
|
||||||
:data-key="dataKey"
|
:data-key="dataKey"
|
||||||
|
@ -98,13 +99,7 @@ watch(
|
||||||
</Teleport>
|
</Teleport>
|
||||||
<QPage class="column items-center q-pa-md" data-cy="orderCatalogPage">
|
<QPage class="column items-center q-pa-md" data-cy="orderCatalogPage">
|
||||||
<div class="full-width">
|
<div class="full-width">
|
||||||
<VnPaginate
|
<VnPaginate :data-key="dataKey">
|
||||||
:data-key="dataKey"
|
|
||||||
url="Orders/CatalogFilter"
|
|
||||||
:limit="50"
|
|
||||||
:user-params="catalogParams"
|
|
||||||
:auto-load="autoLoad"
|
|
||||||
>
|
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<div class="catalog-list">
|
<div class="catalog-list">
|
||||||
<div v-if="rows && !rows?.length" class="no-result">
|
<div v-if="rows && !rows?.length" class="no-result">
|
||||||
|
|
|
@ -208,15 +208,28 @@ async function remove(item) {
|
||||||
async function handleConfirm() {
|
async function handleConfirm() {
|
||||||
const result = await confirm(route.params.id);
|
const result = await confirm(route.params.id);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
const sale = await axios.get(`OrderRows`, {
|
||||||
|
params: {
|
||||||
|
filter: JSON.stringify({
|
||||||
|
where: { orderFk: route.params.id },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const ticket = await axios.get(`Sales`, {
|
||||||
|
params: {
|
||||||
|
filter: JSON.stringify({
|
||||||
|
where: { id: sale.data[0].saleFk },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
});
|
||||||
quasar.notify({
|
quasar.notify({
|
||||||
message: t('globals.dataSaved'),
|
message: t('globals.dataSaved'),
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
router.push({
|
router.push({
|
||||||
name: 'TicketList',
|
name: 'TicketSale',
|
||||||
query: {
|
params: { id: ticket.data[0].ticketFk },
|
||||||
table: JSON.stringify({ clientFk: descriptorData.store.data.clientFk }),
|
query: { table: JSON.stringify({ filter: { limit: 20, skip: 0 } }) },
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<VnSearchbar
|
|
||||||
data-key="OrderList"
|
|
||||||
url="Orders/filter"
|
|
||||||
:label="t('Search order')"
|
|
||||||
:info="t('Search orders by ticket id')"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Search order: Buscar orden
|
|
||||||
Search orders by ticket id: Buscar pedido por id ticket
|
|
||||||
</i18n>
|
|
|
@ -8,15 +8,14 @@ import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import OrderSummary from 'pages/Order/Card/OrderSummary.vue';
|
import OrderSummary from 'pages/Order/Card/OrderSummary.vue';
|
||||||
import OrderSearchbar from './Card/OrderSearchbar.vue';
|
|
||||||
import OrderFilter from './Card/OrderFilter.vue';
|
import OrderFilter from './Card/OrderFilter.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
|
||||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -24,6 +23,8 @@ const tableRef = ref();
|
||||||
const agencyList = ref([]);
|
const agencyList = ref([]);
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const addressOptions = ref([]);
|
const addressOptions = ref([]);
|
||||||
|
const dataKey = 'OrderList';
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -178,117 +179,126 @@ const getDateColor = (date) => {
|
||||||
if (difference < 0) return 'bg-success';
|
if (difference < 0) return 'bg-success';
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<OrderSearchbar />
|
<VnSection
|
||||||
<RightMenu>
|
:data-key="dataKey"
|
||||||
<template #right-panel>
|
:columns="columns"
|
||||||
|
prefix="order"
|
||||||
|
:array-data-props="{
|
||||||
|
url: 'Orders/filter',
|
||||||
|
order: ['landed DESC', 'clientFk ASC', 'id DESC'],
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #rightMenu>
|
||||||
<OrderFilter data-key="OrderList" />
|
<OrderFilter data-key="OrderList" />
|
||||||
</template>
|
</template>
|
||||||
</RightMenu>
|
<template #body>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="OrderList"
|
:data-key="dataKey"
|
||||||
url="Orders/filter"
|
:create="{
|
||||||
:order="['landed DESC', 'clientFk ASC', 'id DESC']"
|
urlCreate: 'Orders/new',
|
||||||
:create="{
|
title: t('module.cerateOrder'),
|
||||||
urlCreate: 'Orders/new',
|
onDataSaved: (url) => {
|
||||||
title: t('module.cerateOrder'),
|
tableRef.redirect(`${url}/catalog`);
|
||||||
onDataSaved: (url) => {
|
},
|
||||||
tableRef.redirect(`${url}/catalog`);
|
formInitialData: {
|
||||||
},
|
active: true,
|
||||||
formInitialData: {
|
addressId: null,
|
||||||
active: true,
|
clientFk: null,
|
||||||
addressId: null,
|
},
|
||||||
clientFk: null,
|
}"
|
||||||
},
|
:user-params="{ showEmpty: false }"
|
||||||
}"
|
:columns="columns"
|
||||||
:user-params="{ showEmpty: false }"
|
:right-search="false"
|
||||||
:columns="columns"
|
redirect="order"
|
||||||
:right-search="false"
|
|
||||||
redirect="order"
|
|
||||||
>
|
|
||||||
<template #column-clientFk="{ row }">
|
|
||||||
<span class="link" @click.stop>
|
|
||||||
{{ row?.clientName }}
|
|
||||||
<CustomerDescriptorProxy :id="row?.clientFk" />
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
<template #column-salesPersonFk="{ row }">
|
|
||||||
<span class="link" @click.stop>
|
|
||||||
{{ row?.name }}
|
|
||||||
<WorkerDescriptorProxy :id="row?.salesPersonFk" />
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
<template #column-landed="{ row }">
|
|
||||||
<span v-if="getDateColor(row.landed)">
|
|
||||||
<QChip :class="getDateColor(row.landed)" dense square>
|
|
||||||
{{ toDate(row?.landed) }}
|
|
||||||
</QChip>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
<template #more-create-dialog="{ data }">
|
|
||||||
<VnSelect
|
|
||||||
url="Clients"
|
|
||||||
:include="{ relation: 'addresses' }"
|
|
||||||
v-model="data.clientFk"
|
|
||||||
:label="t('module.customer')"
|
|
||||||
@update:model-value="(id) => fetchClientAddress(id, data)"
|
|
||||||
>
|
>
|
||||||
<template #option="scope">
|
<template #column-clientFk="{ row }">
|
||||||
<QItem v-bind="scope.itemProps">
|
<span class="link" @click.stop>
|
||||||
<QItemSection>
|
{{ row?.clientName }}
|
||||||
<QItemLabel>
|
<CustomerDescriptorProxy :id="row?.clientFk" />
|
||||||
{{ scope.opt.name }}
|
</span>
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ `#${scope.opt.id}` }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
<template #column-salesPersonFk="{ row }">
|
||||||
<VnSelect
|
<span class="link" @click.stop>
|
||||||
v-model="data.addressId"
|
{{ row?.name }}
|
||||||
:options="addressOptions"
|
<WorkerDescriptorProxy :id="row?.salesPersonFk" />
|
||||||
:label="t('module.address')"
|
</span>
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
|
||||||
@update:model-value="() => fetchAgencies(data)"
|
|
||||||
>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel
|
|
||||||
:class="{
|
|
||||||
'color-vn-label': !scope.opt?.isActive,
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
{{
|
|
||||||
`${
|
|
||||||
!scope.opt?.isActive
|
|
||||||
? t('basicData.inactive')
|
|
||||||
: ''
|
|
||||||
} `
|
|
||||||
}}
|
|
||||||
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
|
|
||||||
{{ scope.opt?.city }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
</template>
|
||||||
</VnSelect>
|
<template #column-landed="{ row }">
|
||||||
<VnInputDate
|
<span v-if="getDateColor(row.landed)">
|
||||||
v-model="data.landed"
|
<QChip :class="getDateColor(row.landed)" dense square>
|
||||||
:label="t('module.landed')"
|
{{ toDate(row?.landed) }}
|
||||||
@update:model-value="() => fetchAgencies(data)"
|
</QChip>
|
||||||
/>
|
</span>
|
||||||
<VnSelect
|
</template>
|
||||||
v-model="data.agencyModeId"
|
<template #more-create-dialog="{ data }">
|
||||||
:label="t('module.agency')"
|
<VnSelect
|
||||||
:options="agencyList"
|
url="Clients"
|
||||||
option-value="agencyModeFk"
|
:include="{ relation: 'addresses' }"
|
||||||
option-label="agencyMode"
|
v-model="data.clientFk"
|
||||||
/>
|
:label="t('module.customer')"
|
||||||
|
@update:model-value="(id) => fetchClientAddress(id, data)"
|
||||||
|
>
|
||||||
|
<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
|
||||||
|
v-model="data.addressId"
|
||||||
|
:options="addressOptions"
|
||||||
|
:label="t('module.address')"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nickname"
|
||||||
|
@update:model-value="() => fetchAgencies(data)"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel
|
||||||
|
:class="{
|
||||||
|
'color-vn-label': !scope.opt?.isActive,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
`${
|
||||||
|
!scope.opt?.isActive
|
||||||
|
? t('basicData.inactive')
|
||||||
|
: ''
|
||||||
|
} `
|
||||||
|
}}
|
||||||
|
{{ scope.opt?.nickname }}:
|
||||||
|
{{ scope.opt?.street }},
|
||||||
|
{{ scope.opt?.city }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnInputDate
|
||||||
|
v-model="data.landed"
|
||||||
|
:label="t('module.landed')"
|
||||||
|
@update:model-value="() => fetchAgencies(data)"
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
v-model="data.agencyModeId"
|
||||||
|
:label="t('module.agency')"
|
||||||
|
:options="agencyList"
|
||||||
|
option-value="agencyModeFk"
|
||||||
|
option-label="agencyMode"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
</VnTable>
|
</VnSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -21,3 +21,26 @@ lines:
|
||||||
image: Image
|
image: Image
|
||||||
params:
|
params:
|
||||||
tagGroups: Tags
|
tagGroups: Tags
|
||||||
|
order:
|
||||||
|
field:
|
||||||
|
salesPersonFk: Sales Person
|
||||||
|
form:
|
||||||
|
clientFk: Client
|
||||||
|
addressFk: Address
|
||||||
|
agencyModeFk: Agency
|
||||||
|
list:
|
||||||
|
newOrder: New Order
|
||||||
|
summary:
|
||||||
|
basket: Basket
|
||||||
|
notConfirmed: Not confirmed
|
||||||
|
created: Created
|
||||||
|
createdFrom: Created From
|
||||||
|
address: Address
|
||||||
|
total: Total
|
||||||
|
items: Items
|
||||||
|
orderTicketList: Order Ticket List
|
||||||
|
amount: Amount
|
||||||
|
confirm: Confirm
|
||||||
|
confirmLines: Confirm lines
|
||||||
|
search: Search orders
|
||||||
|
searchInfo: You can search orders by ticket id
|
||||||
|
|
|
@ -21,3 +21,29 @@ lines:
|
||||||
image: Imagen
|
image: Imagen
|
||||||
params:
|
params:
|
||||||
tagGroups: Tags
|
tagGroups: Tags
|
||||||
|
order:
|
||||||
|
field:
|
||||||
|
salesPersonFk: Comercial
|
||||||
|
form:
|
||||||
|
clientFk: Cliente
|
||||||
|
addressFk: Dirección
|
||||||
|
agencyModeFk: Agencia
|
||||||
|
list:
|
||||||
|
newOrder: Nuevo Pedido
|
||||||
|
summary:
|
||||||
|
basket: Cesta
|
||||||
|
notConfirmed: No confirmada
|
||||||
|
created: Creado
|
||||||
|
createdFrom: Creado desde
|
||||||
|
address: Dirección
|
||||||
|
total: Total
|
||||||
|
vat: IVA
|
||||||
|
state: Estado
|
||||||
|
alias: Alias
|
||||||
|
items: Artículos
|
||||||
|
orderTicketList: Tickets del pedido
|
||||||
|
amount: Monto
|
||||||
|
confirm: Confirmar
|
||||||
|
confirmLines: Confirmar lineas
|
||||||
|
search: Buscar pedido
|
||||||
|
searchInfo: Buscar pedidos por el número de ticket
|
||||||
|
|
|
@ -92,6 +92,7 @@ function handleLocation(data, location) {
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.name"
|
v-model="data.name"
|
||||||
:label="t('supplier.fiscalData.name')"
|
:label="t('supplier.fiscalData.name')"
|
||||||
|
uppercase="true"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
|
|
@ -5,6 +5,7 @@ import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import SupplierListFilter from './SupplierListFilter.vue';
|
import SupplierListFilter from './SupplierListFilter.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
@ -23,9 +24,14 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: t('globals.name'),
|
label: t('globals.name'),
|
||||||
name: 'socialName',
|
name: 'socialName',
|
||||||
create: true,
|
attrs: {
|
||||||
|
uppercase: true,
|
||||||
|
},
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
name: 'search',
|
name: 'search',
|
||||||
|
attrs: {
|
||||||
|
uppercase: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
isTitle: true,
|
isTitle: true,
|
||||||
},
|
},
|
||||||
|
@ -118,14 +124,18 @@ const columns = computed(() => [
|
||||||
formInitialData: {},
|
formInitialData: {},
|
||||||
mapper: (data) => {
|
mapper: (data) => {
|
||||||
data.name = data.socialName;
|
data.name = data.socialName;
|
||||||
delete data.socialName;
|
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
}"
|
}"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
order="id ASC"
|
order="id ASC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
/>
|
>
|
||||||
|
<template #more-create-dialog="{ data }">
|
||||||
|
<VnInput :label="t('globals.name')" v-model="data.socialName" :uppercase="true" />
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
|
@ -138,7 +138,11 @@ function uppercaseStreetModel(data) {
|
||||||
return {
|
return {
|
||||||
get: () => (data.street ? data.street.toUpperCase() : ''),
|
get: () => (data.street ? data.street.toUpperCase() : ''),
|
||||||
set: (value) => {
|
set: (value) => {
|
||||||
data.street = value.toUpperCase();
|
if (value) {
|
||||||
|
data.street = value.toUpperCase();
|
||||||
|
} else {
|
||||||
|
data.street = null;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,50 +1,123 @@
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
|
const entryCard = {
|
||||||
|
name: 'EntryCard',
|
||||||
|
path: ':id',
|
||||||
|
component: () => import('src/pages/Entry/Card/EntryCard.vue'),
|
||||||
|
redirect: { name: 'EntrySummary' },
|
||||||
|
meta: {
|
||||||
|
menu: [
|
||||||
|
'EntryBasicData',
|
||||||
|
'EntryBuys',
|
||||||
|
'EntryNotes',
|
||||||
|
'EntryDms',
|
||||||
|
'EntryLog',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'summary',
|
||||||
|
name: 'EntrySummary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'launch',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Entry/Card/EntrySummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'basic-data',
|
||||||
|
name: 'EntryBasicData',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Entry/Card/EntryBasicData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'buys',
|
||||||
|
name: 'EntryBuys',
|
||||||
|
meta: {
|
||||||
|
title: 'buys',
|
||||||
|
icon: 'vn:lines',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Entry/Card/EntryBuys.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'buys/import',
|
||||||
|
name: 'EntryBuysImport',
|
||||||
|
component: () => import('src/pages/Entry/Card/EntryBuysImport.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'notes',
|
||||||
|
name: 'EntryNotes',
|
||||||
|
meta: {
|
||||||
|
title: 'notes',
|
||||||
|
icon: 'vn:notes',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Entry/Card/EntryNotes.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'dms',
|
||||||
|
name: 'EntryDms',
|
||||||
|
meta: {
|
||||||
|
title: 'dms',
|
||||||
|
icon: 'smb_share',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Entry/Card/EntryDms.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'log',
|
||||||
|
name: 'EntryLog',
|
||||||
|
meta: {
|
||||||
|
title: 'log',
|
||||||
|
icon: 'vn:History',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Entry/Card/EntryLog.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/entry',
|
|
||||||
name: 'Entry',
|
name: 'Entry',
|
||||||
|
path: '/entry',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'entries',
|
title: 'entries',
|
||||||
icon: 'vn:entry',
|
icon: 'vn:entry',
|
||||||
moduleName: 'Entry',
|
moduleName: 'Entry',
|
||||||
keyBinding: 'e',
|
keyBinding: 'e',
|
||||||
},
|
menu: [
|
||||||
component: RouterView,
|
|
||||||
redirect: { name: 'EntryMain' },
|
|
||||||
menus: {
|
|
||||||
main: [
|
|
||||||
'EntryList',
|
'EntryList',
|
||||||
'MyEntries',
|
'MyEntries',
|
||||||
'EntryLatestBuys',
|
'EntryLatestBuys',
|
||||||
'EntryStockBought',
|
'EntryStockBought',
|
||||||
'EntryWasteRecalc',
|
'EntryWasteRecalc',
|
||||||
],
|
]
|
||||||
card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryDms', 'EntryLog'],
|
|
||||||
},
|
},
|
||||||
|
component: RouterView,
|
||||||
|
redirect: { name: 'EntryMain' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
|
||||||
name: 'EntryMain',
|
name: 'EntryMain',
|
||||||
|
path: '',
|
||||||
component: () => import('src/components/common/VnModule.vue'),
|
component: () => import('src/components/common/VnModule.vue'),
|
||||||
redirect: { name: 'EntryList' },
|
redirect: { name: 'EntryIndexMain' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'list',
|
path:'',
|
||||||
name: 'EntryList',
|
name: 'EntryIndexMain',
|
||||||
meta: {
|
redirect: { name: 'EntryList' },
|
||||||
title: 'list',
|
|
||||||
icon: 'view_list',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Entry/EntryList.vue'),
|
component: () => import('src/pages/Entry/EntryList.vue'),
|
||||||
},
|
children: [
|
||||||
{
|
{
|
||||||
path: 'my',
|
name: 'EntryList',
|
||||||
name: 'MyEntries',
|
path: 'list',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'labeler',
|
title: 'list',
|
||||||
icon: 'sell',
|
icon: 'view_list',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Entry/MyEntries.vue'),
|
},
|
||||||
|
entryCard,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'create',
|
path: 'create',
|
||||||
|
@ -55,6 +128,15 @@ export default {
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Entry/EntryCreate.vue'),
|
component: () => import('src/pages/Entry/EntryCreate.vue'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'my',
|
||||||
|
name: 'MyEntries',
|
||||||
|
meta: {
|
||||||
|
title: 'labeler',
|
||||||
|
icon: 'sell',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Entry/MyEntries.vue'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'latest-buys',
|
path: 'latest-buys',
|
||||||
name: 'EntryLatestBuys',
|
name: 'EntryLatestBuys',
|
||||||
|
@ -84,72 +166,5 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'EntryCard',
|
|
||||||
path: ':id',
|
|
||||||
component: () => import('src/pages/Entry/Card/EntryCard.vue'),
|
|
||||||
redirect: { name: 'EntrySummary' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'EntrySummary',
|
|
||||||
path: 'summary',
|
|
||||||
meta: {
|
|
||||||
title: 'summary',
|
|
||||||
icon: 'launch',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Entry/Card/EntrySummary.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'basic-data',
|
|
||||||
name: 'EntryBasicData',
|
|
||||||
meta: {
|
|
||||||
title: 'basicData',
|
|
||||||
icon: 'vn:settings',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Entry/Card/EntryBasicData.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'buys',
|
|
||||||
name: 'EntryBuys',
|
|
||||||
meta: {
|
|
||||||
title: 'buys',
|
|
||||||
icon: 'vn:lines',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Entry/Card/EntryBuys.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'buys/import',
|
|
||||||
name: 'EntryBuysImport',
|
|
||||||
component: () => import('src/pages/Entry/Card/EntryBuysImport.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'notes',
|
|
||||||
name: 'EntryNotes',
|
|
||||||
meta: {
|
|
||||||
title: 'notes',
|
|
||||||
icon: 'vn:notes',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Entry/Card/EntryNotes.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'dms',
|
|
||||||
name: 'EntryDms',
|
|
||||||
meta: {
|
|
||||||
title: 'dms',
|
|
||||||
icon: 'smb_share',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Entry/Card/EntryDms.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'log',
|
|
||||||
name: 'EntryLog',
|
|
||||||
meta: {
|
|
||||||
title: 'log',
|
|
||||||
icon: 'vn:History',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Entry/Card/EntryLog.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
|
@ -1,35 +1,102 @@
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
|
const orderCard = {
|
||||||
|
name: 'OrderCard',
|
||||||
|
path: ':id',
|
||||||
|
component: () => import('src/pages/Order/Card/OrderCard.vue'),
|
||||||
|
redirect: { name: 'OrderSummary' },
|
||||||
|
meta: {
|
||||||
|
menu: [
|
||||||
|
'OrderBasicData',
|
||||||
|
'OrderCatalog',
|
||||||
|
'OrderVolume',
|
||||||
|
'OrderLines',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'summary',
|
||||||
|
name: 'OrderSummary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'launch',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Order/Card/OrderSummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'basic-data',
|
||||||
|
name: 'OrderBasicData',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Order/Card/OrderBasicData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'catalog',
|
||||||
|
name: 'OrderCatalog',
|
||||||
|
meta: {
|
||||||
|
title: 'catalog',
|
||||||
|
icon: 'vn:basket',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Order/Card/OrderCatalog.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'volume',
|
||||||
|
name: 'OrderVolume',
|
||||||
|
meta: {
|
||||||
|
title: 'volume',
|
||||||
|
icon: 'vn:volume',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Order/Card/OrderVolume.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'line',
|
||||||
|
name: 'OrderLines',
|
||||||
|
meta: {
|
||||||
|
title: 'lines',
|
||||||
|
icon: 'vn:lines',
|
||||||
|
},
|
||||||
|
component: () => import('src/pages/Order/Card/OrderLines.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: '/order',
|
|
||||||
name: 'Order',
|
name: 'Order',
|
||||||
|
path: '/order',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'order',
|
title: 'order',
|
||||||
icon: 'vn:basket',
|
icon: 'vn:basket',
|
||||||
moduleName: 'Order',
|
moduleName: 'Order',
|
||||||
keyBinding: 'o',
|
keyBinding: 'o',
|
||||||
|
menu: ['OrderList'],
|
||||||
},
|
},
|
||||||
component: RouterView,
|
component: RouterView,
|
||||||
redirect: { name: 'OrderMain' },
|
redirect: { name: 'OrderMain' },
|
||||||
menus: {
|
|
||||||
main: ['OrderList'],
|
|
||||||
card: ['OrderBasicData', 'OrderCatalog', 'OrderVolume', 'OrderLines'],
|
|
||||||
},
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
|
||||||
name: 'OrderMain',
|
name: 'OrderMain',
|
||||||
|
path: '',
|
||||||
component: () => import('src/components/common/VnModule.vue'),
|
component: () => import('src/components/common/VnModule.vue'),
|
||||||
redirect: { name: 'OrderList' },
|
redirect: { name: 'OrderIndexMain' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'list',
|
path: '',
|
||||||
name: 'OrderList',
|
name: 'OrderIndexMain',
|
||||||
meta: {
|
redirect: { name: 'OrderList' },
|
||||||
title: 'orderList',
|
|
||||||
icon: 'view_list',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Order/OrderList.vue'),
|
component: () => import('src/pages/Order/OrderList.vue'),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'OrderList',
|
||||||
|
path: 'list',
|
||||||
|
meta: {
|
||||||
|
title: 'orderList',
|
||||||
|
icon: 'view_list',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
orderCard,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'create',
|
path: 'create',
|
||||||
|
@ -42,58 +109,5 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'OrderCard',
|
|
||||||
path: ':id',
|
|
||||||
component: () => import('src/pages/Order/Card/OrderCard.vue'),
|
|
||||||
redirect: { name: 'OrderSummary' },
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'OrderSummary',
|
|
||||||
path: 'summary',
|
|
||||||
meta: {
|
|
||||||
title: 'summary',
|
|
||||||
icon: 'launch',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Order/Card/OrderSummary.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'OrderBasicData',
|
|
||||||
path: 'basic-data',
|
|
||||||
meta: {
|
|
||||||
title: 'basicData',
|
|
||||||
icon: 'vn:settings',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Order/Card/OrderBasicData.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'OrderCatalog',
|
|
||||||
path: 'catalog',
|
|
||||||
meta: {
|
|
||||||
title: 'catalog',
|
|
||||||
icon: 'vn:basket',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Order/Card/OrderCatalog.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'OrderVolume',
|
|
||||||
path: 'volume',
|
|
||||||
meta: {
|
|
||||||
title: 'volume',
|
|
||||||
icon: 'vn:volume',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Order/Card/OrderVolume.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'OrderLines',
|
|
||||||
path: 'line',
|
|
||||||
meta: {
|
|
||||||
title: 'lines',
|
|
||||||
icon: 'vn:lines',
|
|
||||||
},
|
|
||||||
component: () => import('src/pages/Order/Card/OrderLines.vue'),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
|
@ -7,7 +7,14 @@ import useNotify from 'src/composables/useNotify.js';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
const initInvoicing = {
|
||||||
|
invoicing: false,
|
||||||
|
nRequests: 0,
|
||||||
|
nPdfs: 0,
|
||||||
|
totalPdfs: 0,
|
||||||
|
addressIndex: 0,
|
||||||
|
errors: [],
|
||||||
|
};
|
||||||
export const useInvoiceOutGlobalStore = defineStore({
|
export const useInvoiceOutGlobalStore = defineStore({
|
||||||
id: 'invoiceOutGlobal',
|
id: 'invoiceOutGlobal',
|
||||||
state: () => ({
|
state: () => ({
|
||||||
|
@ -23,16 +30,11 @@ export const useInvoiceOutGlobalStore = defineStore({
|
||||||
addresses: [],
|
addresses: [],
|
||||||
minInvoicingDate: null,
|
minInvoicingDate: null,
|
||||||
parallelism: null,
|
parallelism: null,
|
||||||
invoicing: false,
|
|
||||||
isInvoicing: false,
|
|
||||||
status: null,
|
status: null,
|
||||||
addressIndex: 0,
|
|
||||||
errors: [],
|
|
||||||
printer: null,
|
printer: null,
|
||||||
nRequests: 0,
|
|
||||||
nPdfs: 0,
|
|
||||||
totalPdfs: 0,
|
|
||||||
formData: null,
|
formData: null,
|
||||||
|
...initInvoicing,
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
async init() {
|
async init() {
|
||||||
|
@ -117,12 +119,13 @@ export const useInvoiceOutGlobalStore = defineStore({
|
||||||
);
|
);
|
||||||
throw new Error("There aren't addresses to invoice");
|
throw new Error("There aren't addresses to invoice");
|
||||||
}
|
}
|
||||||
this.invoicing = false;
|
|
||||||
this.status = 'invoicing';
|
|
||||||
this.formData = formData;
|
this.formData = formData;
|
||||||
this.addressIndex = 0;
|
this.status = 'invoicing';
|
||||||
this.errors = [];
|
//reset data
|
||||||
await this.invoiceClient();
|
for (const key in initInvoicing) {
|
||||||
|
this[key] = initInvoicing[key];
|
||||||
|
}
|
||||||
|
this.invoiceClient();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.handleError(err);
|
this.handleError(err);
|
||||||
}
|
}
|
||||||
|
@ -184,7 +187,6 @@ export const useInvoiceOutGlobalStore = defineStore({
|
||||||
async invoiceClient() {
|
async invoiceClient() {
|
||||||
if (this.invoicing || this.nRequests >= this.parallelism) return;
|
if (this.invoicing || this.nRequests >= this.parallelism) return;
|
||||||
const address = this.addresses[this.addressIndex];
|
const address = this.addresses[this.addressIndex];
|
||||||
|
|
||||||
if (!address || !this.status || this.status == 'stopping') {
|
if (!address || !this.status || this.status == 'stopping') {
|
||||||
this.status = 'stopping';
|
this.status = 'stopping';
|
||||||
this.invoicing = false;
|
this.invoicing = false;
|
||||||
|
@ -192,6 +194,7 @@ export const useInvoiceOutGlobalStore = defineStore({
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.invoicing = true;
|
this.invoicing = true;
|
||||||
|
this.nRequests++;
|
||||||
const params = {
|
const params = {
|
||||||
clientId: address.clientId,
|
clientId: address.clientId,
|
||||||
addressId: address.id,
|
addressId: address.id,
|
||||||
|
@ -215,6 +218,7 @@ export const useInvoiceOutGlobalStore = defineStore({
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.invoicing = false;
|
this.invoicing = false;
|
||||||
|
this.nRequests--;
|
||||||
this.addressIndex++;
|
this.addressIndex++;
|
||||||
this.invoiceClient();
|
this.invoiceClient();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('ClaimPhoto', () => {
|
// redmine.verdnatura.es/issues/8417
|
||||||
|
describe.skip('ClaimPhoto', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const claimId = 1;
|
const claimId = 1;
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
|
|
|
@ -8,8 +8,8 @@ describe('EntryMy when is supplier', () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8418
|
||||||
it('should open buyLabel when is supplier', () => {
|
it.skip('should open buyLabel when is supplier', () => {
|
||||||
cy.get(
|
cy.get(
|
||||||
'[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
|
'[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
|
||||||
).click();
|
).click();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
|
// https://redmine.verdnatura.es/issues/8419
|
||||||
describe('InvoiceInCorrective', () => {
|
describe.skip('InvoiceInCorrective', () => {
|
||||||
const createCorrective = '.q-menu > .q-list > :nth-child(6) > .q-item__section';
|
const createCorrective = '.q-menu > .q-list > :nth-child(6) > .q-item__section';
|
||||||
const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)';
|
const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)';
|
||||||
const saveDialog = '.q-card > .q-card__actions > .q-btn--standard ';
|
const saveDialog = '.q-card > .q-card__actions > .q-btn--standard ';
|
||||||
|
|
|
@ -21,8 +21,8 @@ describe('InvoiceInList', () => {
|
||||||
cy.url().should('include', `/invoice-in/${id}/summary`);
|
cy.url().should('include', `/invoice-in/${id}/summary`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8420
|
||||||
it('should open the details', () => {
|
it.skip('should open the details', () => {
|
||||||
cy.get(firstDetailBtn).click();
|
cy.get(firstDetailBtn).click();
|
||||||
cy.get(summaryHeaders).eq(1).contains('Basic data');
|
cy.get(summaryHeaders).eq(1).contains('Basic data');
|
||||||
cy.get(summaryHeaders).eq(4).contains('Vat');
|
cy.get(summaryHeaders).eq(4).contains('Vat');
|
||||||
|
|
|
@ -35,8 +35,8 @@ describe('InvoiceOut summary', () => {
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
cy.dataCy('VnConfirm_confirm').click();
|
||||||
cy.checkNotification('InvoiceOut deleted');
|
cy.checkNotification('InvoiceOut deleted');
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8415
|
||||||
it('should transfer the invoice ', () => {
|
it.skip('should transfer the invoice ', () => {
|
||||||
cy.typeSearchbar('T1111111{enter}');
|
cy.typeSearchbar('T1111111{enter}');
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get('.q-menu > .q-list > :nth-child(1)').click();
|
cy.get('.q-menu > .q-list > :nth-child(1)').click();
|
||||||
|
|
|
@ -15,8 +15,8 @@ describe('Item list', () => {
|
||||||
cy.get('.q-menu .q-item').contains('Anthurium').click();
|
cy.get('.q-menu .q-item').contains('Anthurium').click();
|
||||||
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
|
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8421
|
||||||
it('should create an item', () => {
|
it.skip('should create an item', () => {
|
||||||
const data = {
|
const data = {
|
||||||
Description: { val: `Test item` },
|
Description: { val: `Test item` },
|
||||||
Type: { val: `Crisantemo`, type: 'select' },
|
Type: { val: `Crisantemo`, type: 'select' },
|
||||||
|
|
|
@ -18,8 +18,8 @@ describe('Item tag', () => {
|
||||||
+cy.dataCy('crudModelDefaultSaveBtn').click();
|
+cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||||
cy.checkNotification("The tag or priority can't be repeated for an item");
|
cy.checkNotification("The tag or priority can't be repeated for an item");
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8422
|
||||||
it('should add a new tag', () => {
|
it.skip('should add a new tag', () => {
|
||||||
cy.get('.q-page').should('be.visible');
|
cy.get('.q-page').should('be.visible');
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.get('.q-page-sticky > div').click();
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.get('.q-page-sticky > div').click();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
|
// https://redmine.verdnatura.es/issues/8423
|
||||||
describe('Ticket expedtion', () => {
|
describe.skip('Ticket expedtion', () => {
|
||||||
const tableContent = '.q-table .q-virtual-scroll__content';
|
const tableContent = '.q-table .q-virtual-scroll__content';
|
||||||
const stateTd = 'td:nth-child(9)';
|
const stateTd = 'td:nth-child(9)';
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,8 @@ describe('TicketList', () => {
|
||||||
cy.get(firstRow).find('.q-btn:first').click();
|
cy.get(firstRow).find('.q-btn:first').click();
|
||||||
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
|
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8424
|
||||||
it('should open ticket summary', () => {
|
it.skip('should open ticket summary', () => {
|
||||||
searchResults();
|
searchResults();
|
||||||
cy.get(firstRow).find('.q-btn:last').click();
|
cy.get(firstRow).find('.q-btn:last').click();
|
||||||
cy.dataCy('ticketSummary').should('exist');
|
cy.dataCy('ticketSummary').should('exist');
|
||||||
|
|
|
@ -53,7 +53,8 @@ describe('VnLocation', () => {
|
||||||
cy.waitForElement('.q-card');
|
cy.waitForElement('.q-card');
|
||||||
cy.get(inputLocation).click();
|
cy.get(inputLocation).click();
|
||||||
});
|
});
|
||||||
it('Show all options', function () {
|
// https://redmine.verdnatura.es/issues/8436
|
||||||
|
it.skip('Show all options', function () {
|
||||||
cy.get(locationOptions).should('have.length.at.least', 5);
|
cy.get(locationOptions).should('have.length.at.least', 5);
|
||||||
});
|
});
|
||||||
it('input filter location as "al"', function () {
|
it('input filter location as "al"', function () {
|
||||||
|
|
|
@ -18,8 +18,8 @@ describe('ZoneWarehouse', () => {
|
||||||
cy.get(saveBtn).click();
|
cy.get(saveBtn).click();
|
||||||
cy.checkNotification(dataError);
|
cy.checkNotification(dataError);
|
||||||
});
|
});
|
||||||
|
// https://redmine.verdnatura.es/issues/8425
|
||||||
it('should create & remove a warehouse', () => {
|
it.skip('should create & remove a warehouse', () => {
|
||||||
cy.addBtnClick();
|
cy.addBtnClick();
|
||||||
cy.fillInForm(data);
|
cy.fillInForm(data);
|
||||||
cy.get(saveBtn).click();
|
cy.get(saveBtn).click();
|
||||||
|
|
Loading…
Reference in New Issue