Merge branch 'dev' into 7305-CustomerFiscalDataWarning
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
a6e57127f9
|
@ -34,5 +34,7 @@ module.exports = defineConfig({
|
|||
require('cypress-mochawesome-reporter/plugin')(on);
|
||||
// implement node event listeners here
|
||||
},
|
||||
viewportWidth: 1280,
|
||||
viewportHeight: 720,
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salix-front",
|
||||
"version": "25.04.0",
|
||||
"version": "25.06.0",
|
||||
"description": "Salix frontend",
|
||||
"productName": "Salix",
|
||||
"author": "Verdnatura",
|
||||
|
|
|
@ -1,29 +1,17 @@
|
|||
<script setup>
|
||||
import { ref, onMounted, useSlots } from 'vue';
|
||||
import { onMounted, useSlots } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useHasContent } from 'src/composables/useHasContent';
|
||||
|
||||
const { t } = useI18n();
|
||||
const quasar = useQuasar();
|
||||
const stateStore = useStateStore();
|
||||
const slots = useSlots();
|
||||
const hasContent = ref(false);
|
||||
const rightPanel = ref(null);
|
||||
const hasContent = useHasContent('#right-panel');
|
||||
|
||||
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)
|
||||
stateStore.rightDrawer = false;
|
||||
});
|
||||
|
|
|
@ -42,10 +42,13 @@ const $props = defineProps({
|
|||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
uppercase: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const vnInputRef = ref(null);
|
||||
const showPassword = ref(false);
|
||||
const value = computed({
|
||||
get() {
|
||||
return $props.modelValue;
|
||||
|
@ -117,6 +120,10 @@ const handleInsertMode = (e) => {
|
|||
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
|
||||
});
|
||||
};
|
||||
|
||||
const handleUppercase = () => {
|
||||
value.value = value.value?.toUpperCase() || '';
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -159,7 +166,16 @@ const handleInsertMode = (e) => {
|
|||
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" />
|
||||
<QIcon v-if="info" name="info">
|
||||
<QTooltip max-width="350px">
|
||||
|
@ -170,3 +186,14 @@ const handleInsertMode = (e) => {
|
|||
</QInput>
|
||||
</div>
|
||||
</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>
|
|
@ -105,6 +105,7 @@ const manageDate = (date) => {
|
|||
:rules="mixinRules"
|
||||
:clearable="false"
|
||||
@click="isPopupOpen = !isPopupOpen"
|
||||
@keydown="isPopupOpen = false"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template #append>
|
||||
|
|
|
@ -79,6 +79,7 @@ function dateToTime(newDate) {
|
|||
style="min-width: 100px"
|
||||
:rules="mixinRules"
|
||||
@click="isPopupOpen = !isPopupOpen"
|
||||
@keydown="isPopupOpen = false"
|
||||
type="time"
|
||||
hide-bottom-space
|
||||
>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
||||
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { computed } from 'vue';
|
||||
import { ref, watch } from 'vue';
|
||||
import { useAttrs } from 'vue';
|
||||
import { useRequired } from 'src/composables/useRequired';
|
||||
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 locationProperties = [
|
||||
'postcode',
|
||||
|
@ -43,9 +51,7 @@ const formatLocation = (obj, properties = locationProperties) => {
|
|||
return filteredParts.join(', ');
|
||||
};
|
||||
|
||||
const modelValue = computed(() =>
|
||||
props.location ? formatLocation(props.location, locationProperties) : null
|
||||
);
|
||||
const modelValue = ref(props.location ? formatLocation(props.location) : null);
|
||||
|
||||
function showLabel(data) {
|
||||
const dataProperties = [
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
import RightMenu from './RightMenu.vue';
|
||||
import VnSearchbar from 'components/ui/VnSearchbar.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 { useRoute } from 'vue-router';
|
||||
import { useHasContent } from 'src/composables/useHasContent';
|
||||
|
||||
const $props = defineProps({
|
||||
section: {
|
||||
|
@ -51,10 +52,13 @@ const sectionValue = computed(() => $props.section ?? $props.dataKey);
|
|||
const isMainSection = computed(() => {
|
||||
const isSame = sectionValue.value == route.name;
|
||||
if (!isSame && arrayData) {
|
||||
arrayData.reset(['userParams', 'userFilter']);
|
||||
arrayData.reset(['userParams', 'filter']);
|
||||
arrayData.setCurrentFilter();
|
||||
}
|
||||
return isSame;
|
||||
});
|
||||
const searchbarId = 'section-searchbar';
|
||||
const hasContent = useHasContent(`#${searchbarId}`);
|
||||
|
||||
onBeforeMount(() => {
|
||||
if ($props.dataKey)
|
||||
|
@ -69,14 +73,14 @@ onBeforeMount(() => {
|
|||
<template>
|
||||
<slot name="searchbar">
|
||||
<VnSearchbar
|
||||
v-if="searchBar"
|
||||
v-if="searchBar && !hasContent"
|
||||
v-bind="arrayDataProps"
|
||||
:data-key="dataKey"
|
||||
:label="$t(`${prefix}.search`)"
|
||||
:info="$t(`${prefix}.searchInfo`)"
|
||||
/>
|
||||
<div :id="searchbarId"></div>
|
||||
</slot>
|
||||
|
||||
<RightMenu>
|
||||
<template #right-panel v-if="$slots['rightMenu'] || rightFilter">
|
||||
<slot name="rightMenu">
|
||||
|
|
|
@ -232,12 +232,15 @@ async function fetchFilter(val) {
|
|||
} else defaultWhere = { [key]: getVal(val) };
|
||||
const where = { ...(val ? defaultWhere : {}), ...$props.where };
|
||||
$props.exprBuilder && Object.assign(where, $props.exprBuilder(key, val));
|
||||
const fetchOptions = { where, include, limit };
|
||||
if (fields) fetchOptions.fields = fields;
|
||||
if (sortBy) fetchOptions.order = sortBy;
|
||||
const filterOptions = { where, include, limit };
|
||||
if (fields) filterOptions.fields = fields;
|
||||
if (sortBy) filterOptions.order = sortBy;
|
||||
arrayData.resetPagination();
|
||||
|
||||
const { data } = await arrayData.applyFilter({ filter: fetchOptions });
|
||||
const { data } = await arrayData.applyFilter(
|
||||
{ filter: filterOptions },
|
||||
{ updateRouter: false }
|
||||
);
|
||||
setOptions(data);
|
||||
return data;
|
||||
}
|
||||
|
@ -294,7 +297,7 @@ async function onScroll({ to, direction, from, index }) {
|
|||
}
|
||||
}
|
||||
|
||||
defineExpose({ opts: myOptions });
|
||||
defineExpose({ opts: myOptions, vnSelectRef });
|
||||
|
||||
function handleKeyDown(event) {
|
||||
if (event.key === 'Tab' && !event.shiftKey) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRole } from 'src/composables/useRole';
|
||||
import { useAcl } from 'src/composables/useAcl';
|
||||
|
||||
|
@ -7,6 +7,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
|||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
const value = defineModel({ type: [String, Number, Object] });
|
||||
const select = ref(null);
|
||||
const $props = defineProps({
|
||||
rolesAllowedToCreate: {
|
||||
type: Array,
|
||||
|
@ -33,10 +34,13 @@ const isAllowedToCreate = computed(() => {
|
|||
if ($props.acls.length) return acl.hasAny($props.acls);
|
||||
return role.hasAny($props.rolesAllowedToCreate);
|
||||
});
|
||||
|
||||
defineExpose({ vnSelectDialogRef: select });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnSelect
|
||||
ref="select"
|
||||
v-model="value"
|
||||
v-bind="$attrs"
|
||||
@update:model-value="(...args) => emit('update:modelValue', ...args)"
|
||||
|
|
|
@ -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 { useRoute } from 'vue-router';
|
||||
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { isDialogOpened } from 'src/filters';
|
||||
import VnMoreOptions from './VnMoreOptions.vue';
|
||||
|
|
|
@ -18,8 +18,7 @@ const $props = defineProps({
|
|||
},
|
||||
columns: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: null,
|
||||
default: 3,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -1,32 +1,42 @@
|
|||
<template>
|
||||
<div class="header bg-primary q-pa-sm q-mb-md">
|
||||
<QSkeleton type="rect" square />
|
||||
<QSkeleton type="rect" square />
|
||||
</div>
|
||||
<div class="row q-pa-md q-col-gutter-md q-mb-md">
|
||||
<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 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 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 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 class="col">
|
||||
<QSkeleton type="rect" class="q-mb-md" square />
|
||||
<QSkeleton type="text" square />
|
||||
<QSkeleton type="text" square />
|
||||
|
@ -34,6 +44,7 @@
|
|||
<QSkeleton type="text" square />
|
||||
<QSkeleton type="text" square />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -113,23 +113,20 @@ onMounted(() => {
|
|||
});
|
||||
|
||||
async function search() {
|
||||
const staticParams = Object.keys(store.userParams ?? {}).length
|
||||
? store.userParams
|
||||
: store.defaultParams;
|
||||
arrayData.resetPagination();
|
||||
|
||||
const filter = {
|
||||
params: {
|
||||
search: searchText.value,
|
||||
},
|
||||
filter: props.filter,
|
||||
};
|
||||
let filter = { params: { search: searchText.value } };
|
||||
|
||||
if (!props.searchRemoveParams || !searchText.value) {
|
||||
filter.params = {
|
||||
...staticParams,
|
||||
filter = {
|
||||
params: {
|
||||
...store.userParams,
|
||||
search: searchText.value,
|
||||
},
|
||||
filter: store.filter,
|
||||
};
|
||||
} else {
|
||||
arrayData.reset(['currentFilter', 'userParams']);
|
||||
}
|
||||
|
||||
if (props.whereFilter) {
|
||||
|
|
|
@ -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();
|
||||
|
||||
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 (!arrayDataStore.get(key)) arrayDataStore.set(key);
|
||||
|
@ -31,10 +33,11 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
: JSON.parse(params?.filter ?? '{}');
|
||||
delete params.filter;
|
||||
|
||||
store.userParams = { ...store.userParams, ...params };
|
||||
store.userParams = params;
|
||||
store.filter = { ...filter, ...store.userFilter };
|
||||
if (filter?.order) store.order = filter.order;
|
||||
}
|
||||
setCurrentFilter();
|
||||
});
|
||||
|
||||
if (key && userOptions) setOptions();
|
||||
|
@ -76,11 +79,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
|
||||
cancelRequest();
|
||||
canceller = new AbortController();
|
||||
const { params, limit } = getCurrentFilter();
|
||||
|
||||
store.currentFilter = JSON.parse(JSON.stringify(params));
|
||||
delete store.currentFilter.filter.include;
|
||||
store.currentFilter.filter = JSON.stringify(store.currentFilter.filter);
|
||||
const { params, limit } = setCurrentFilter();
|
||||
|
||||
let exprFilter;
|
||||
if (store?.exprBuilder) {
|
||||
|
@ -105,7 +104,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
store.hasMoreData = limit && response.data.length >= limit;
|
||||
|
||||
if (!append && !isDialogOpened() && updateRouter) {
|
||||
if (updateStateParams(response.data)?.redirect) return;
|
||||
if (updateStateParams(response.data)?.redirect && !store.keepData) return;
|
||||
}
|
||||
store.isLoading = false;
|
||||
canceller = null;
|
||||
|
@ -140,12 +139,12 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
}
|
||||
}
|
||||
|
||||
async function applyFilter({ filter, params }) {
|
||||
async function applyFilter({ filter, params }, fetchOptions = {}) {
|
||||
if (filter) store.userFilter = filter;
|
||||
store.filter = {};
|
||||
if (params) store.userParams = { ...params };
|
||||
|
||||
const response = await fetch({});
|
||||
const response = await fetch(fetchOptions);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
@ -274,14 +273,14 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
}
|
||||
|
||||
function getCurrentFilter() {
|
||||
if (!Object.keys(store.userParams).length)
|
||||
store.userParams = store.defaultParams ?? {};
|
||||
|
||||
const filter = {
|
||||
limit: store.limit,
|
||||
...store.userFilter,
|
||||
};
|
||||
|
||||
let userParams = { ...store.userParams };
|
||||
|
||||
Object.assign(filter, store.userFilter);
|
||||
|
||||
let where;
|
||||
if (filter?.where || store.filter?.where)
|
||||
where = Object.assign(filter?.where ?? {}, store.filter?.where ?? {});
|
||||
|
@ -289,7 +288,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
filter.where = where;
|
||||
const params = { filter };
|
||||
|
||||
Object.assign(params, userParams);
|
||||
Object.assign(params, store.userParams);
|
||||
if (params.filter) params.filter.skip = store.skip;
|
||||
if (store?.order && typeof store?.order == 'string') store.order = [store.order];
|
||||
if (store.order?.length) params.filter.order = [...store.order];
|
||||
|
@ -298,6 +297,14 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
return { filter, params, limit: filter.limit };
|
||||
}
|
||||
|
||||
function setCurrentFilter() {
|
||||
const { params, limit } = getCurrentFilter();
|
||||
store.currentFilter = JSON.parse(JSON.stringify(params));
|
||||
delete store.currentFilter.filter.include;
|
||||
store.currentFilter.filter = JSON.stringify(store.currentFilter.filter);
|
||||
return { params, limit };
|
||||
}
|
||||
|
||||
function processData(data, { map = true, append = true }) {
|
||||
if (!append) {
|
||||
store.data = [];
|
||||
|
@ -331,6 +338,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
|||
applyFilter,
|
||||
addFilter,
|
||||
getCurrentFilter,
|
||||
setCurrentFilter,
|
||||
addFilterWhere,
|
||||
addOrder,
|
||||
deleteOrder,
|
||||
|
|
|
@ -29,8 +29,12 @@ export function useFilterParams(key) {
|
|||
orders.value = orderObject;
|
||||
}
|
||||
|
||||
function setUserParams(watchedParams) {
|
||||
if (!watchedParams || Object.keys(watchedParams).length == 0) return;
|
||||
function setUserParams(watchedParams = {}) {
|
||||
if (Object.keys(watchedParams).length == 0) {
|
||||
params.value = {};
|
||||
orders.value = {};
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof watchedParams == 'string') watchedParams = JSON.parse(watchedParams);
|
||||
if (typeof watchedParams?.filter == 'string')
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -310,6 +310,14 @@ input::-webkit-inner-spin-button {
|
|||
.no-visible {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.q-item > .q-item__section:has(.q-checkbox) {
|
||||
max-width: min-content;
|
||||
}
|
||||
|
||||
.row > .column:has(.q-checkbox) {
|
||||
max-width: min-content;
|
||||
}
|
||||
.q-field__inner {
|
||||
.q-field__control {
|
||||
min-height: auto !important;
|
||||
|
|
|
@ -16,6 +16,7 @@ import getUpdatedValues from './getUpdatedValues';
|
|||
import getParamWhere from './getParamWhere';
|
||||
import parsePhone from './parsePhone';
|
||||
import isDialogOpened from './isDialogOpened';
|
||||
import toCelsius from './toCelsius';
|
||||
|
||||
export {
|
||||
getUpdatedValues,
|
||||
|
@ -36,4 +37,5 @@ export {
|
|||
dashIfEmpty,
|
||||
dateRange,
|
||||
getParamWhere,
|
||||
toCelsius,
|
||||
};
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
export default function toCelsius(value) {
|
||||
return value ? `${value}°C` : '';
|
||||
}
|
|
@ -346,6 +346,7 @@ globals:
|
|||
countryFk: Country
|
||||
companyFk: Company
|
||||
changePass: Change password
|
||||
setPass: Set password
|
||||
deleteConfirmTitle: Delete selected elements
|
||||
changeState: Change state
|
||||
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.
|
||||
inputLabel: Explain why this error should not appear
|
||||
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:
|
||||
params:
|
||||
ticketFk: Ticket ID
|
||||
|
@ -578,27 +505,6 @@ parking:
|
|||
searchBar:
|
||||
info: You can search by parking code
|
||||
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:
|
||||
chat: Chat
|
||||
bossDepartment: Boss Department
|
||||
|
@ -798,6 +704,7 @@ travel:
|
|||
totalEntries: Total entries
|
||||
totalEntriesTooltip: Total entries
|
||||
daysOnward: Landed days onwards
|
||||
awb: AWB
|
||||
summary:
|
||||
entryId: Entry Id
|
||||
freight: Freight
|
||||
|
@ -889,7 +796,10 @@ components:
|
|||
hasMinPrice: Minimum price
|
||||
# LatestBuysFilter
|
||||
salesPersonFk: Buyer
|
||||
supplierFk: Supplier
|
||||
from: From
|
||||
to: To
|
||||
visible: Is visible
|
||||
active: Is active
|
||||
floramondo: Is floramondo
|
||||
showBadDates: Show future items
|
||||
|
|
|
@ -348,6 +348,7 @@ globals:
|
|||
countryFk: País
|
||||
companyFk: Empresa
|
||||
changePass: Cambiar contraseña
|
||||
setPass: Establecer contraseña
|
||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||
changeState: Cambiar estado
|
||||
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
|
||||
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
|
||||
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:
|
||||
params:
|
||||
ticketFk: ID de ticket
|
||||
|
@ -562,30 +489,6 @@ invoiceOut:
|
|||
comercial: Comercial
|
||||
errors:
|
||||
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:
|
||||
list:
|
||||
parking: Parking
|
||||
|
@ -797,6 +700,7 @@ travel:
|
|||
totalEntries: ∑
|
||||
totalEntriesTooltip: Entradas totales
|
||||
daysOnward: Días de llegada en adelante
|
||||
awb: AWB
|
||||
summary:
|
||||
entryId: Id entrada
|
||||
freight: Porte
|
||||
|
@ -889,7 +793,11 @@ components:
|
|||
wareHouseFk: Almacén
|
||||
# LatestBuysFilter
|
||||
salesPersonFk: Comprador
|
||||
supplierFk: Proveedor
|
||||
visible: Visible
|
||||
active: Activo
|
||||
from: Desde
|
||||
to: Hasta
|
||||
floramondo: Floramondo
|
||||
showBadDates: Ver items a futuro
|
||||
userPanel:
|
||||
|
|
|
@ -1,48 +1,56 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { computed, onMounted, ref, toRefs } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useAcl } from 'src/composables/useAcl';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { useState } from 'src/composables/useState';
|
||||
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 VnChangePassword from 'src/components/common/VnChangePassword.vue';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const $props = defineProps({
|
||||
entityId: {
|
||||
type: Number,
|
||||
hasAccount: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
const { hasAccount } = toRefs($props);
|
||||
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]);
|
||||
|
||||
onMounted(async () => {
|
||||
account.value.hasAccount = await useHasAccount($props.entityId);
|
||||
});
|
||||
account.value.hasAccount = hasAccount.value;
|
||||
const entityId = computed(() => +route.params.id);
|
||||
const hasitManagementAccess = ref();
|
||||
const hasSysadminAccess = ref();
|
||||
|
||||
async function updateStatusAccount(active) {
|
||||
if (active) {
|
||||
await axios.post(`Accounts`, { id: $props.entityId });
|
||||
await axios.post(`Accounts`, { id: entityId.value });
|
||||
} else {
|
||||
await axios.delete(`Accounts/${$props.entityId}`);
|
||||
await axios.delete(`Accounts/${entityId.value}`);
|
||||
}
|
||||
|
||||
account.value.hasAccount = active;
|
||||
const status = active ? 'enable' : 'disable';
|
||||
notify({
|
||||
message: t(`account.card.${status}Account.success`),
|
||||
message: t(`account.card.actions.${status}Account.success`),
|
||||
type: 'positive',
|
||||
});
|
||||
}
|
||||
async function updateStatusUser(active) {
|
||||
await axios.patch(`VnUsers/${$props.entityId}`, { active });
|
||||
await axios.patch(`VnUsers/${entityId.value}`, { active });
|
||||
account.value.active = active;
|
||||
const status = active ? 'activate' : 'deactivate';
|
||||
notify({
|
||||
|
@ -50,6 +58,17 @@ async function updateStatusUser(active) {
|
|||
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 syncPassword = ref(null);
|
||||
const shouldSyncPassword = ref(false);
|
||||
|
@ -64,11 +83,27 @@ async function sync() {
|
|||
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>
|
||||
<template>
|
||||
<VnChangePassword
|
||||
ref="changePassRef"
|
||||
:ask-old-pass="true"
|
||||
:ask-old-pass="askOldPass"
|
||||
:submit-fn="
|
||||
async (newPassword, oldPassword) => {
|
||||
await axios.patch(`Accounts/change-password`, {
|
||||
|
@ -110,18 +145,46 @@ async function sync() {
|
|||
</template>
|
||||
</VnConfirm>
|
||||
<QItem
|
||||
v-if="
|
||||
entityId == account.id &&
|
||||
useAcl().hasAny([{ model: 'Account', props: '*', accessType: 'WRITE' }])
|
||||
"
|
||||
v-if="hasitManagementAccess"
|
||||
v-ripple
|
||||
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
|
||||
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
|
||||
clickable
|
||||
@click="
|
||||
|
@ -136,7 +199,7 @@ async function sync() {
|
|||
</QItem>
|
||||
|
||||
<QItem
|
||||
v-if="!account.active"
|
||||
v-if="!account.active && hasitManagementAccess"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="
|
||||
|
@ -150,7 +213,7 @@ async function sync() {
|
|||
<QItemSection>{{ t('account.card.actions.activateUser.name') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="account.active"
|
||||
v-if="account.active && hasitManagementAccess"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="
|
||||
|
@ -163,7 +226,12 @@ async function sync() {
|
|||
>
|
||||
<QItemSection>{{ t('account.card.actions.deactivateUser.name') }}</QItemSection>
|
||||
</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>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
|
|
|
@ -38,7 +38,7 @@ const getBankEntities = (data, formData) => {
|
|||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
v-model="data.payMethod"
|
||||
v-model="data.payMethodFk"
|
||||
/>
|
||||
<VnInput :label="t('Due day')" clearable v-model="data.dueDay" />
|
||||
</VnRow>
|
||||
|
|
|
@ -59,6 +59,7 @@ const columns = computed(() => [
|
|||
</script>
|
||||
<template>
|
||||
<VnTable
|
||||
:user-filter="{ include: filter.include }"
|
||||
ref="tableRef"
|
||||
data-key="ClientCredit"
|
||||
url="ClientCredits"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
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 VnUserLink from 'src/components/ui/VnUserLink.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({
|
||||
id: {
|
||||
type: Number,
|
||||
|
@ -42,10 +35,12 @@ const entityId = computed(() => {
|
|||
|
||||
const data = ref(useCardDescription());
|
||||
const setData = (entity) => {
|
||||
customerDebt.value = entity?.debt;
|
||||
customerCredit.value = entity?.credit;
|
||||
data.value = useCardDescription(entity?.name, entity?.id);
|
||||
};
|
||||
const debtWarning = computed(() => {
|
||||
return customer.value?.debt > customer.value?.credit ? 'negative' : 'primary';
|
||||
return customerDebt.value > customerCredit.value ? 'negative' : 'primary';
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -97,26 +92,21 @@ const debtWarning = computed(() => {
|
|||
:value="entity.businessType.description"
|
||||
/>
|
||||
</template>
|
||||
<template #icons>
|
||||
<QCardActions v-if="customer" class="q-gutter-x-md">
|
||||
<template #icons="{ entity }">
|
||||
<QCardActions class="q-gutter-x-md">
|
||||
<QIcon
|
||||
v-if="!customer.isActive"
|
||||
v-if="!entity.isActive"
|
||||
name="vn:disabled"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('customer.card.isDisabled') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="customer.isFreezed"
|
||||
name="vn:frozen"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QIcon v-if="entity.isFreezed" name="vn:frozen" size="xs" color="primary">
|
||||
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="!customer.account?.active"
|
||||
v-if="!entity.account?.active"
|
||||
color="primary"
|
||||
name="vn:noweb"
|
||||
size="xs"
|
||||
|
@ -124,7 +114,7 @@ const debtWarning = computed(() => {
|
|||
<QTooltip>{{ t('customer.card.webAccountInactive') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="customer.debt > customer.credit"
|
||||
v-if="entity.debt > entity.credit"
|
||||
name="vn:risk"
|
||||
size="xs"
|
||||
:color="debtWarning"
|
||||
|
@ -132,7 +122,7 @@ const debtWarning = computed(() => {
|
|||
<QTooltip>{{ t('customer.card.hasDebt') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="!customer.isTaxDataChecked"
|
||||
v-if="!entity.isTaxDataChecked"
|
||||
name="vn:no036"
|
||||
size="xs"
|
||||
color="primary"
|
||||
|
@ -140,7 +130,7 @@ const debtWarning = computed(() => {
|
|||
<QTooltip>{{ t('customer.card.notChecked') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QBtn
|
||||
v-if="customer.unpaid"
|
||||
v-if="entity.unpaid"
|
||||
flat
|
||||
size="sm"
|
||||
icon="vn:Client_unpaid"
|
||||
|
|
|
@ -44,6 +44,7 @@ function handleLocation(data, location) {
|
|||
:required="true"
|
||||
:rules="validate('client.socialName')"
|
||||
clearable
|
||||
uppercase="true"
|
||||
v-model="data.socialName"
|
||||
>
|
||||
<template #append>
|
||||
|
|
|
@ -84,6 +84,7 @@ const columns = computed(() => [
|
|||
component: 'number',
|
||||
autofocus: true,
|
||||
required: true,
|
||||
positive: false,
|
||||
},
|
||||
format: ({ amount }) => toCurrency(amount),
|
||||
create: true,
|
||||
|
|
|
@ -50,6 +50,14 @@ const columns = computed(() => [
|
|||
isTitle: true,
|
||||
create: true,
|
||||
columnClass: 'expand',
|
||||
attrs: {
|
||||
uppercase: true,
|
||||
},
|
||||
columnFilter: {
|
||||
attrs: {
|
||||
uppercase: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -423,7 +431,7 @@ function handleLocation(data, location) {
|
|||
:label="t('customer.summary.salesPerson')"
|
||||
v-model="data.salesPersonFk"
|
||||
:params="{
|
||||
departmentCodes: ['VT', 'shopping'],
|
||||
departmentCodes: ['VT'],
|
||||
}"
|
||||
:has-avatar="true"
|
||||
:id-value="data.salesPersonFk"
|
||||
|
|
|
@ -11,6 +11,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
|||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||
import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
@ -150,6 +151,22 @@ function onAgentCreated({ id, fiscalName }, data) {
|
|||
</template>
|
||||
</VnSelectDialog>
|
||||
</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>
|
||||
</FormModel>
|
||||
</template>
|
||||
|
@ -175,4 +192,6 @@ es:
|
|||
Mobile: Movíl
|
||||
Incoterms: Incoterms
|
||||
Customs agent: Agente de aduanas
|
||||
Longitude: Longitud
|
||||
Latitude: Latitud
|
||||
</i18n>
|
||||
|
|
|
@ -106,7 +106,7 @@ const { openConfirmationModal } = useVnConfirm();
|
|||
:to="{
|
||||
name: 'WorkerList',
|
||||
query: {
|
||||
params: JSON.stringify({ departmentFk: entityId }),
|
||||
table: JSON.stringify({ departmentFk: entityId }),
|
||||
},
|
||||
}"
|
||||
>
|
||||
|
|
|
@ -3,7 +3,6 @@ import { ref } from 'vue';
|
|||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRole } from 'src/composables/useRole';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
|
@ -11,7 +10,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
|||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||
import FilterTravelForm from 'src/components/FilterTravelForm.vue';
|
||||
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import { toDate } from 'src/filters';
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -26,6 +25,7 @@ const onFilterTravelSelected = (formData, id) => {
|
|||
formData.travelFk = id;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
ref="companiesRef"
|
||||
|
@ -93,14 +93,13 @@ const onFilterTravelSelected = (formData, id) => {
|
|||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
>{{ scope.opt?.agencyModeName }} -
|
||||
{{ scope.opt?.warehouseInName }} ({{
|
||||
toDate(scope.opt?.shipped)
|
||||
}}) → {{ scope.opt?.warehouseOutName }} ({{
|
||||
toDate(scope.opt?.landed)
|
||||
}})</QItemLabel
|
||||
>
|
||||
<QItemLabel>
|
||||
{{ scope.opt?.agencyModeName }} -
|
||||
{{ scope.opt?.warehouseInName }}
|
||||
({{ toDate(scope.opt?.shipped) }}) →
|
||||
{{ scope.opt?.warehouseOutName }}
|
||||
({{ toDate(scope.opt?.landed) }})
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
@ -126,6 +125,13 @@ const onFilterTravelSelected = (formData, id) => {
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInputNumber
|
||||
:label="t('entry.summary.commission')"
|
||||
v-model="data.commission"
|
||||
step="1"
|
||||
autofocus
|
||||
:positive="false"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('entry.summary.currency')"
|
||||
v-model="data.currencyFk"
|
||||
|
@ -133,12 +139,23 @@ const onFilterTravelSelected = (formData, id) => {
|
|||
option-value="id"
|
||||
option-label="code"
|
||||
/>
|
||||
<QInput
|
||||
:label="t('entry.summary.commission')"
|
||||
v-model="data.commission"
|
||||
type="number"
|
||||
autofocus
|
||||
min="0"
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInputNumber
|
||||
v-model="data.initialTemperature"
|
||||
name="initialTemperature"
|
||||
:label="t('entry.basicData.initialTemperature')"
|
||||
:step="0.5"
|
||||
:decimal-places="2"
|
||||
:positive="false"
|
||||
/>
|
||||
<VnInputNumber
|
||||
v-model="data.finalTemperature"
|
||||
name="finalTemperature"
|
||||
:label="t('entry.basicData.finalTemperature')"
|
||||
:step="0.5"
|
||||
:decimal-places="2"
|
||||
:positive="false"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
|
|
|
@ -1,21 +1,13 @@
|
|||
<script setup>
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import VnCardBeta from 'components/common/VnCardBeta.vue';
|
||||
import EntryDescriptor from './EntryDescriptor.vue';
|
||||
import EntryFilter from '../EntryFilter.vue';
|
||||
import filter from './EntryFilter.js';
|
||||
import filter from './EntryFilter.js'
|
||||
</script>
|
||||
<template>
|
||||
<VnCard
|
||||
<VnCardBeta
|
||||
data-key="Entry"
|
||||
base-url="Entries"
|
||||
:filter="filter"
|
||||
:descriptor="EntryDescriptor"
|
||||
:filter-panel="EntryFilter"
|
||||
search-data-key="EntryList"
|
||||
:searchbar-props="{
|
||||
url: 'Entries/filter',
|
||||
label: 'Search entries',
|
||||
info: 'You can search by entry reference',
|
||||
}"
|
||||
:user-filter="filter"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -7,7 +7,7 @@ import CardSummary from 'components/ui/CardSummary.vue';
|
|||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
||||
|
||||
import { toDate, toCurrency } from 'src/filters';
|
||||
import { toDate, toCurrency, toCelsius } from 'src/filters';
|
||||
import { getUrl } from 'src/composables/getUrl';
|
||||
import axios from 'axios';
|
||||
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
||||
|
@ -193,6 +193,14 @@ const fetchEntryBuys = async () => {
|
|||
:label="t('entry.summary.invoiceNumber')"
|
||||
:value="entry.invoiceNumber"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('entry.basicData.initialTemperature')"
|
||||
:value="toCelsius(entry.initialTemperature)"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('entry.basicData.finalTemperature')"
|
||||
:value="toCelsius(entry.finalTemperature)"
|
||||
/>
|
||||
</QCard>
|
||||
<QCard class="vn-one">
|
||||
<VnTitle
|
||||
|
|
|
@ -40,7 +40,7 @@ const companiesOptions = ref([]);
|
|||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||
<strong>{{ t(`entryFilter.params.${tag.label}`) }}: </strong>
|
||||
<span>{{ formatFn(tag.value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -49,7 +49,7 @@ const companiesOptions = ref([]);
|
|||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.search"
|
||||
:label="t('entryFilter.filter.search')"
|
||||
:label="t('entryFilter.params.search')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
|
@ -58,7 +58,7 @@ const companiesOptions = ref([]);
|
|||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.reference"
|
||||
:label="t('entryFilter.filter.reference')"
|
||||
:label="t('entryFilter.params.reference')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
|
@ -67,7 +67,7 @@ const companiesOptions = ref([]);
|
|||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.invoiceNumber"
|
||||
:label="t('params.invoiceNumber')"
|
||||
:label="t('entryFilter.params.invoiceNumber')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
|
@ -76,7 +76,7 @@ const companiesOptions = ref([]);
|
|||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.travelFk"
|
||||
:label="t('params.travelFk')"
|
||||
:label="t('entryFilter.params.travelFk')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
|
@ -84,7 +84,7 @@ const companiesOptions = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.companyFk')"
|
||||
:label="t('entryFilter.params.companyFk')"
|
||||
v-model="params.companyFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="companiesOptions"
|
||||
|
@ -100,7 +100,7 @@ const companiesOptions = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.currencyFk')"
|
||||
:label="t('entryFilter.params.currencyFk')"
|
||||
v-model="params.currencyFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="currenciesOptions"
|
||||
|
@ -116,7 +116,7 @@ const companiesOptions = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('params.supplierFk')"
|
||||
:label="t('entryFilter.params.supplierFk')"
|
||||
v-model="params.supplierFk"
|
||||
@update:model-value="searchFn()"
|
||||
url="Suppliers"
|
||||
|
@ -148,7 +148,7 @@ const companiesOptions = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
:label="t('params.created')"
|
||||
:label="t('entryFilter.params.created')"
|
||||
v-model="params.created"
|
||||
@update:model-value="searchFn()"
|
||||
is-outlined
|
||||
|
@ -158,7 +158,7 @@ const companiesOptions = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
:label="t('params.from')"
|
||||
:label="t('entryFilter.params.from')"
|
||||
v-model="params.from"
|
||||
@update:model-value="searchFn()"
|
||||
is-outlined
|
||||
|
@ -168,7 +168,7 @@ const companiesOptions = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
:label="t('params.to')"
|
||||
:label="t('entryFilter.params.to')"
|
||||
v-model="params.to"
|
||||
@update:model-value="searchFn()"
|
||||
is-outlined
|
||||
|
@ -178,14 +178,14 @@ const companiesOptions = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('params.isBooked')"
|
||||
:label="t('entryFilter.params.isBooked')"
|
||||
v-model="params.isBooked"
|
||||
toggle-indeterminate
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('params.isConfirmed')"
|
||||
:label="t('entryFilter.params.isConfirmed')"
|
||||
v-model="params.isConfirmed"
|
||||
toggle-indeterminate
|
||||
/>
|
||||
|
@ -194,7 +194,7 @@ const companiesOptions = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('params.isOrdered')"
|
||||
:label="t('entryFilter.params.isOrdered')"
|
||||
v-model="params.isOrdered"
|
||||
toggle-indeterminate
|
||||
/>
|
||||
|
@ -203,34 +203,3 @@ const companiesOptions = ref([]);
|
|||
</template>
|
||||
</VnFilterPanel>
|
||||
</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',
|
||||
label: t('globals.weightByPiece'),
|
||||
label: t('entry.latestBuys.tableVisibleColumns.weightByPiece'),
|
||||
name: 'weightByPiece',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
|
@ -157,7 +157,7 @@ const columns = [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('entry.buys.packageValue'),
|
||||
label: t('entry.latestBuys.tableVisibleColumns.packageValue'),
|
||||
name: 'packageValue',
|
||||
columnFilter: {
|
||||
component: 'number',
|
||||
|
@ -262,8 +262,3 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
:right-search="false"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Edit buy(s): Editar compra(s)
|
||||
</i18n>
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
import { ref, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import EntryFilter from './EntryFilter.vue';
|
||||
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import { toDate } from 'src/filters';
|
||||
import { toCelsius, toDate } from 'src/filters';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import EntrySummary from './Card/EntrySummary.vue';
|
||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const tableRef = ref();
|
||||
const dataKey = 'EntryList';
|
||||
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const entryFilter = {
|
||||
|
@ -157,6 +157,20 @@ const columns = computed(() => [
|
|||
name: 'invoiceAmount',
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'initialTemperature',
|
||||
label: t('entry.basicData.initialTemperature'),
|
||||
field: 'initialTemperature',
|
||||
format: (row) => toCelsius(row.initialTemperature),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'finalTemperature',
|
||||
label: t('entry.basicData.finalTemperature'),
|
||||
field: 'finalTemperature',
|
||||
format: (row) => toCelsius(row.finalTemperature),
|
||||
},
|
||||
{
|
||||
label: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
|
||||
name: 'isExcludedFromAvailable',
|
||||
|
@ -178,30 +192,32 @@ const columns = computed(() => [
|
|||
},
|
||||
]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnSearchbar
|
||||
data-key="EntryList"
|
||||
<VnSection
|
||||
:data-key="dataKey"
|
||||
:columns="columns"
|
||||
prefix="entry"
|
||||
url="Entries/filter"
|
||||
:label="t('Search entries')"
|
||||
:info="t('You can search by entry reference')"
|
||||
/>
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
:array-data-props="{
|
||||
url: 'Entries/filter',
|
||||
order: 'id DESC',
|
||||
userFilter: entryFilter,
|
||||
}"
|
||||
>
|
||||
<template #rightMenu>
|
||||
<EntryFilter data-key="EntryList" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<template #body>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="EntryList"
|
||||
url="Entries/filter"
|
||||
:filter="entryFilter"
|
||||
:data-key="dataKey"
|
||||
:create="{
|
||||
urlCreate: 'Entries',
|
||||
title: t('Create entry'),
|
||||
title: t('entry.list.newEntry'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: {},
|
||||
}"
|
||||
order="id DESC"
|
||||
:columns="columns"
|
||||
redirect="entry"
|
||||
:right-search="false"
|
||||
|
@ -214,13 +230,17 @@ const columns = computed(() => [
|
|||
color="primary"
|
||||
>
|
||||
<QTooltip>{{
|
||||
t('entry.list.tableVisibleColumns.isExcludedFromAvailable')
|
||||
t(
|
||||
'entry.list.tableVisibleColumns.isExcludedFromAvailable'
|
||||
)
|
||||
}}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="!!row.isRaid" name="vn:net" color="primary">
|
||||
<QTooltip>
|
||||
{{
|
||||
t('globals.raid', { daysInForward: row.daysInForward })
|
||||
t('globals.raid', {
|
||||
daysInForward: row.daysInForward,
|
||||
})
|
||||
}}</QTooltip
|
||||
>
|
||||
</QIcon>
|
||||
|
@ -239,12 +259,6 @@ const columns = computed(() => [
|
|||
</span>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
</VnSection>
|
||||
</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>
|
||||
import { ref } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useState } from 'src/composables/useState';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
@ -19,7 +19,7 @@ const { t } = useI18n();
|
|||
const quasar = useQuasar();
|
||||
const state = useState();
|
||||
const user = state.getUser();
|
||||
const columns = [
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
label: 'Id',
|
||||
|
@ -31,7 +31,7 @@ const columns = [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'workerFk',
|
||||
label: t('Buyer'),
|
||||
label: t('entryStockBought.buyer'),
|
||||
isTitle: true,
|
||||
component: 'select',
|
||||
cardVisible: true,
|
||||
|
@ -49,7 +49,7 @@ const columns = [
|
|||
},
|
||||
{
|
||||
align: 'center',
|
||||
label: t('Reserve'),
|
||||
label: t('entryStockBought.reserve'),
|
||||
name: 'reserve',
|
||||
columnFilter: false,
|
||||
create: true,
|
||||
|
@ -58,7 +58,7 @@ const columns = [
|
|||
},
|
||||
{
|
||||
align: 'center',
|
||||
label: t('Bought'),
|
||||
label: t('entryStockBought.bought'),
|
||||
name: 'bought',
|
||||
summation: true,
|
||||
cardVisible: true,
|
||||
|
@ -66,7 +66,7 @@ const columns = [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('Date'),
|
||||
label: t('entryStockBought.date'),
|
||||
name: 'dated',
|
||||
component: 'date',
|
||||
visible: false,
|
||||
|
@ -77,7 +77,7 @@ const columns = [
|
|||
name: 'tableActions',
|
||||
actions: [
|
||||
{
|
||||
title: t('View more details'),
|
||||
title: t('entryStockBought.viewMoreDetails'),
|
||||
icon: 'search',
|
||||
isPrimary: true,
|
||||
action: (row) => {
|
||||
|
@ -92,7 +92,7 @@ const columns = [
|
|||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
]);
|
||||
|
||||
const fetchDataRef = ref();
|
||||
const travelDialogRef = ref(false);
|
||||
|
@ -166,7 +166,7 @@ function round(value) {
|
|||
<VnRow class="travel">
|
||||
<div v-if="travel">
|
||||
<span style="color: var(--vn-label-color)">
|
||||
{{ t('Purchase Spaces') }}:
|
||||
{{ t('entryStockBought.purchaseSpaces') }}:
|
||||
</span>
|
||||
<span>
|
||||
{{ travel?.m3 }}
|
||||
|
@ -177,7 +177,7 @@ function round(value) {
|
|||
flat
|
||||
icon="edit"
|
||||
@click="openDialog()"
|
||||
:title="t('Edit travel')"
|
||||
:title="t('entryStockBought.editTravel')"
|
||||
color="primary"
|
||||
/>
|
||||
</div>
|
||||
|
@ -226,7 +226,7 @@ function round(value) {
|
|||
@on-fetch="(data) => setFooter(data)"
|
||||
:create="{
|
||||
urlCreate: 'StockBoughts',
|
||||
title: t('Reserve some space'),
|
||||
title: t('entryStockBought.reserveSomeSpace'),
|
||||
onDataSaved: () => tableRef.reload(),
|
||||
formInitialData: {
|
||||
workerFk: user.id,
|
||||
|
@ -288,16 +288,3 @@ function round(value) {
|
|||
color: $negative !important;
|
||||
}
|
||||
</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
|
||||
data-key="myEntriesList"
|
||||
url="Entries/filter"
|
||||
:label="t('Search entries')"
|
||||
:info="t('You can search by entry reference')"
|
||||
:label="t('myEntries.search')"
|
||||
:info="t('myEntries.searchInfo')"
|
||||
/>
|
||||
<VnTable
|
||||
data-key="myEntriesList"
|
||||
|
@ -137,7 +137,3 @@ const printBuys = (rowId) => {
|
|||
chip-locale="myEntries"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
You can search by entry reference: Puedes buscar por referencia de la entrada
|
||||
</i18n>
|
||||
|
|
|
@ -1,9 +1,94 @@
|
|||
entryList:
|
||||
entry:
|
||||
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
|
||||
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
|
||||
initialTemperature: Ini °C
|
||||
finalTemperature: Fin °C
|
||||
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:
|
||||
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
|
||||
reference: Reference
|
||||
myEntries:
|
||||
|
@ -19,5 +104,18 @@ myEntries:
|
|||
daysOnward: Days onward
|
||||
daysAgo: Days ago
|
||||
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:
|
||||
recalcOk: The wastes were successfully recalculated
|
||||
|
|
|
@ -1,12 +1,95 @@
|
|||
Search entries: Buscar entradas
|
||||
You can search by entry reference: Puedes buscar por referencia de la entrada
|
||||
|
||||
entryList:
|
||||
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
|
||||
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
|
||||
initialTemperature: Ini °C
|
||||
finalTemperature: Fin °C
|
||||
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:
|
||||
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
|
||||
reference: Referencia
|
||||
myEntries:
|
||||
|
@ -22,5 +105,18 @@ myEntries:
|
|||
daysOnward: Días adelante
|
||||
daysAgo: Días atras
|
||||
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:
|
||||
recalcOk: Se han recalculado las mermas correctamente
|
||||
|
|
|
@ -6,24 +6,16 @@ import axios from 'axios';
|
|||
import { toCurrency, toDate } from 'src/filters';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||
import InvoiceInDescriptorMenu from './InvoiceInDescriptorMenu.vue';
|
||||
|
||||
const $props = defineProps({ id: { type: Number, default: null } });
|
||||
const { push, currentRoute } = useRouter();
|
||||
const { currentRoute } = useRouter();
|
||||
const { t } = useI18n();
|
||||
|
||||
const cardDescriptorRef = ref();
|
||||
const correctionDialogRef = ref();
|
||||
const entityId = computed(() => $props.id || +currentRoute.value.params.id);
|
||||
const totalAmount = ref();
|
||||
const config = ref();
|
||||
const cplusRectificationTypes = ref([]);
|
||||
const siiTypeInvoiceIns = ref([]);
|
||||
const invoiceCorrectionTypes = ref([]);
|
||||
|
||||
const filter = {
|
||||
include: [
|
||||
|
@ -85,12 +77,6 @@ const routes = reactive({
|
|||
return { name: 'EntryCard', params: { id } };
|
||||
},
|
||||
});
|
||||
const correctionFormData = reactive({
|
||||
invoiceReason: 2,
|
||||
invoiceType: 2,
|
||||
invoiceClass: 6,
|
||||
});
|
||||
const isNotFilled = computed(() => Object.values(correctionFormData).includes(null));
|
||||
|
||||
onBeforeMount(async () => {
|
||||
await setInvoiceCorrection(entityId.value);
|
||||
|
@ -122,38 +108,8 @@ async function setInvoiceCorrection(id) {
|
|||
(corrected) => corrected.correctingFk
|
||||
);
|
||||
}
|
||||
|
||||
const createInvoiceInCorrection = async () => {
|
||||
const { data: correctingId } = await axios.post(
|
||||
'InvoiceIns/corrective',
|
||||
Object.assign(correctionFormData, { id: entityId.value })
|
||||
);
|
||||
push({ path: `/invoice-in/${correctingId}/summary` });
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
url="InvoiceInConfigs"
|
||||
:where="{ fields: ['sageWithholdingFk'] }"
|
||||
auto-load
|
||||
@on-fetch="(data) => (config = data)"
|
||||
/>
|
||||
<FetchData
|
||||
url="CplusRectificationTypes"
|
||||
@on-fetch="(data) => (cplusRectificationTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="SiiTypeInvoiceIns"
|
||||
:where="{ code: { like: 'R%' } }"
|
||||
@on-fetch="(data) => (siiTypeInvoiceIns = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="InvoiceCorrectionTypes"
|
||||
@on-fetch="(data) => (invoiceCorrectionTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<CardDescriptor
|
||||
ref="cardDescriptorRef"
|
||||
module="InvoiceIn"
|
||||
|
@ -167,7 +123,10 @@ const createInvoiceInCorrection = async () => {
|
|||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv :label="t('invoicein.list.issued')" :value="toDate(entity.issued)" />
|
||||
<VnLv :label="t('invoicein.summary.bookedDate')" :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.supplier')">
|
||||
<template #value>
|
||||
|
@ -227,65 +186,6 @@ const createInvoiceInCorrection = async () => {
|
|||
</QCardActions>
|
||||
</template>
|
||||
</CardDescriptor>
|
||||
<QDialog ref="correctionDialogRef">
|
||||
<QCard>
|
||||
<QCardSection>
|
||||
<QItem class="q-px-none">
|
||||
<span class="text-primary text-h6 full-width">
|
||||
{{ t('Create rectificative invoice') }}
|
||||
</span>
|
||||
<QBtn icon="close" flat round dense v-close-popup />
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
<QCardSection>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QInput
|
||||
:label="t('Original invoice')"
|
||||
v-model="entityId"
|
||||
readonly
|
||||
/>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.class'))}`"
|
||||
v-model="correctionFormData.invoiceClass"
|
||||
:options="siiTypeInvoiceIns"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
:required="true"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.type'))}`"
|
||||
v-model="correctionFormData.invoiceType"
|
||||
:options="cplusRectificationTypes"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:required="true"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.reason'))}`"
|
||||
v-model="correctionFormData.invoiceReason"
|
||||
:options="invoiceCorrectionTypes"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:required="true"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
<QCardActions class="justify-end q-mr-sm">
|
||||
<QBtn flat :label="t('globals.close')" color="primary" v-close-popup />
|
||||
<QBtn
|
||||
:label="t('globals.save')"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
@click="createInvoiceInCorrection"
|
||||
:disable="isNotFilled"
|
||||
/>
|
||||
</QCardActions>
|
||||
</QCard>
|
||||
</QDialog>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.q-dialog {
|
||||
|
|
|
@ -8,9 +8,12 @@ import { useAcl } from 'src/composables/useAcl';
|
|||
import { downloadFile } from 'src/composables/downloadFile';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { usePrintService } from 'composables/usePrintService';
|
||||
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import InvoiceInToBook from '../InvoiceInToBook.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
|
||||
const { hasAny } = useAcl();
|
||||
const { t } = useI18n();
|
||||
|
@ -31,6 +34,10 @@ const correctionDialogRef = ref();
|
|||
const invoiceInCorrection = reactive({ correcting: [], corrected: null });
|
||||
const entityId = computed(() => $props.invoice.id || +currentRoute.value.params.id);
|
||||
const invoiceIn = computed(() => arrayData.store.data);
|
||||
const isNotFilled = computed(() => Object.values(correctionFormData).includes(null));
|
||||
const invoiceCorrectionTypes = ref([]);
|
||||
const cplusRectificationTypes = ref([]);
|
||||
const siiTypeInvoiceIns = ref([]);
|
||||
const actions = {
|
||||
unbook: {
|
||||
title: t('assertAction', { action: t('invoicein.descriptorMenu.unbook') }),
|
||||
|
@ -48,6 +55,11 @@ const actions = {
|
|||
sendPdf: { cb: sendPdfInvoiceConfirmation },
|
||||
correct: { cb: () => correctionDialogRef.value.show() },
|
||||
};
|
||||
const correctionFormData = reactive({
|
||||
invoiceReason: 2,
|
||||
invoiceType: 2,
|
||||
invoiceClass: 8,
|
||||
});
|
||||
const canEditProp = (props) =>
|
||||
hasAny([{ model: 'InvoiceIn', props, accessType: 'WRITE' }]);
|
||||
|
||||
|
@ -133,9 +145,39 @@ function sendPdfInvoice({ address }) {
|
|||
recipient: address,
|
||||
});
|
||||
}
|
||||
|
||||
const createInvoiceInCorrection = async () => {
|
||||
const { data: correctingId } = await axios.post(
|
||||
'InvoiceIns/corrective',
|
||||
Object.assign(correctionFormData, { id: entityId.value })
|
||||
);
|
||||
push({ path: `/invoice-in/${correctingId}/summary` });
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="InvoiceCorrectionTypes"
|
||||
@on-fetch="(data) => (invoiceCorrectionTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="CplusRectificationTypes"
|
||||
@on-fetch="(data) => (cplusRectificationTypes = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="SiiTypeInvoiceIns"
|
||||
:where="{ code: { like: 'R%' } }"
|
||||
@on-fetch="(data) => (siiTypeInvoiceIns = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="InvoiceInConfigs"
|
||||
:where="{ fields: ['sageWithholdingFk'] }"
|
||||
auto-load
|
||||
@on-fetch="(data) => (config = data)"
|
||||
/>
|
||||
<InvoiceInToBook>
|
||||
<template #content="{ book }">
|
||||
<QItem
|
||||
|
@ -162,7 +204,7 @@ function sendPdfInvoice({ address }) {
|
|||
v-if="canEditProp('deleteById')"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="triggerMenu('invoicein.descriptorMenu.delete')"
|
||||
@click="triggerMenu('delete')"
|
||||
>
|
||||
<QItemSection>{{ t('invoicein.descriptorMenu.deleteInvoice') }}</QItemSection>
|
||||
</QItem>
|
||||
|
@ -192,6 +234,79 @@ function sendPdfInvoice({ address }) {
|
|||
<QItem v-if="invoice.dmsFk" v-ripple clickable @click="downloadFile(invoice.dmsFk)">
|
||||
<QItemSection>{{ t('components.smartCard.downloadFile') }}</QItemSection>
|
||||
</QItem>
|
||||
<QDialog ref="correctionDialogRef">
|
||||
<QCard>
|
||||
<QCardSection>
|
||||
<QItem class="q-px-none">
|
||||
<span class="text-primary text-h6 full-width">
|
||||
{{ t('Create rectificative invoice') }}
|
||||
</span>
|
||||
<QBtn icon="close" flat round dense v-close-popup />
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
<QCardSection>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QInput
|
||||
:label="t('Original invoice')"
|
||||
v-model="entityId"
|
||||
readonly
|
||||
/>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.class'))}`"
|
||||
v-model="correctionFormData.invoiceClass"
|
||||
:options="siiTypeInvoiceIns"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
:required="true"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.type'))}`"
|
||||
v-model="correctionFormData.invoiceType"
|
||||
:options="cplusRectificationTypes"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:required="true"
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
{{ console.log('opt: ', opt) }}
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
>{{ opt.id }} -
|
||||
{{ opt.description }}</QItemLabel
|
||||
>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<div></div>
|
||||
</template>
|
||||
</VnSelect>
|
||||
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.reason'))}`"
|
||||
v-model="correctionFormData.invoiceReason"
|
||||
:options="invoiceCorrectionTypes"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:required="true"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
<QCardActions class="justify-end q-mr-sm">
|
||||
<QBtn flat :label="t('globals.close')" color="primary" v-close-popup />
|
||||
<QBtn
|
||||
:label="t('globals.save')"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
@click="createInvoiceInCorrection"
|
||||
:disable="isNotFilled"
|
||||
/>
|
||||
</QCardActions>
|
||||
</QCard>
|
||||
</QDialog>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -25,6 +25,7 @@ const sageTaxTypes = ref([]);
|
|||
const sageTransactionTypes = ref([]);
|
||||
const rowsSelected = ref([]);
|
||||
const invoiceInFormRef = ref();
|
||||
const expenseRef = ref();
|
||||
|
||||
defineProps({
|
||||
actionIcon: {
|
||||
|
@ -89,6 +90,11 @@ const columns = computed(() => [
|
|||
field: (row) => row.foreignValue,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'total',
|
||||
label: 'Total',
|
||||
align: 'left',
|
||||
},
|
||||
]);
|
||||
|
||||
const filter = {
|
||||
|
@ -128,8 +134,26 @@ function autocompleteExpense(evt, row, col) {
|
|||
({ id }) => id == useAccountShortToStandard(param)
|
||||
);
|
||||
|
||||
if (lookup) row[col.model] = lookup;
|
||||
expenseRef.value.vnSelectDialogRef.vnSelectRef.toggleOption(lookup);
|
||||
}
|
||||
|
||||
const taxableBaseTotal = computed(() => {
|
||||
return getTotal(invoiceInFormRef.value.formData, 'taxableBase', );
|
||||
});
|
||||
|
||||
const taxRateTotal = computed(() => {
|
||||
return getTotal(invoiceInFormRef.value.formData, null, {
|
||||
cb: taxRate,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
const combinedTotal = computed(() => {
|
||||
return +taxableBaseTotal.value + +taxRateTotal.value;
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -167,6 +191,7 @@ function autocompleteExpense(evt, row, col) {
|
|||
<template #body-cell-expense="{ row, col }">
|
||||
<QTd>
|
||||
<VnSelectDialog
|
||||
ref="expenseRef"
|
||||
v-model="row[col.model]"
|
||||
:options="col.options"
|
||||
:option-value="col.optionValue"
|
||||
|
@ -270,26 +295,20 @@ function autocompleteExpense(evt, row, col) {
|
|||
<QTd />
|
||||
<QTd />
|
||||
<QTd>
|
||||
{{ getTotal(rows, 'taxableBase', { currency: 'default' }) }}
|
||||
{{ toCurrency(taxableBaseTotal) }}
|
||||
</QTd>
|
||||
<QTd />
|
||||
<QTd />
|
||||
<QTd>
|
||||
{{
|
||||
getTotal(rows, null, { cb: taxRate, currency: 'default' })
|
||||
}}</QTd
|
||||
>
|
||||
{{ toCurrency(taxRateTotal) }}
|
||||
</QTd>
|
||||
<QTd />
|
||||
<QTd>
|
||||
<template v-if="isNotEuro(invoiceIn.currency.code)">
|
||||
{{
|
||||
getTotal(rows, 'foreignValue', {
|
||||
currency: invoiceIn.currency.code,
|
||||
})
|
||||
}}
|
||||
</template>
|
||||
{{ toCurrency(combinedTotal) }}
|
||||
</QTd>
|
||||
</QTr>
|
||||
</template>
|
||||
|
||||
<template #item="props">
|
||||
<div class="q-pa-xs col-xs-12 col-sm-6 grid-style-transition">
|
||||
<QCard bordered flat class="q-my-xs">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup>
|
||||
import { onMounted, computed, reactive, ref, nextTick, watch } from 'vue';
|
||||
import { onMounted, computed, ref, nextTick } from 'vue';
|
||||
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 EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
||||
|
@ -22,19 +22,16 @@ import VnSubToolbar from 'components/ui/VnSubToolbar.vue';
|
|||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const state = useState();
|
||||
const user = state.getUser();
|
||||
const today = ref(Date.vnNew());
|
||||
const today = Date.vnNew();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
const warehousesOptions = ref([]);
|
||||
const itemBalancesRef = ref(null);
|
||||
const itemsBalanceFilter = reactive({
|
||||
where: { itemFk: route.params.id, warehouseFk: null, date: null },
|
||||
});
|
||||
const itemBalances = ref([]);
|
||||
const warehouseFk = ref(null);
|
||||
const _showWhatsBeforeInventory = ref(false);
|
||||
const itemBalances = computed(() => arrayDataItemBalances.store.data);
|
||||
const where = computed(() => arrayDataItemBalances.store.filter.where || {});
|
||||
const showWhatsBeforeInventory = ref(false);
|
||||
const inventoriedDate = ref(null);
|
||||
let arrayDataItemBalances = useArrayData('ItemBalances');
|
||||
|
||||
const originTypeMap = {
|
||||
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 () => {
|
||||
today.value.setHours(0, 0, 0, 0);
|
||||
if (route.query.warehouseFk) warehouseFk.value = route.query.warehouseFk;
|
||||
else if (user.value) warehouseFk.value = user.value.warehouseFk;
|
||||
itemsBalanceFilter.where.warehouseFk = warehouseFk.value;
|
||||
const { data } = await axios.get('Configs/findOne');
|
||||
inventoriedDate.value = data.inventoried;
|
||||
const ref = where.value;
|
||||
const query = route.query;
|
||||
inventoriedDate.value =
|
||||
(await axios.get('Configs/findOne')).data?.inventoried || today;
|
||||
|
||||
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 scrollToToday();
|
||||
await updateWarehouse(warehouseFk.value);
|
||||
await updateWarehouse(ref.warehouseFk);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => router.currentRoute.value.params.id,
|
||||
(newId) => {
|
||||
itemsBalanceFilter.where.itemFk = newId;
|
||||
itemBalancesRef.value.fetch();
|
||||
}
|
||||
);
|
||||
|
||||
const fetchItemBalances = async () => await itemBalancesRef.value.fetch();
|
||||
const fetchItemBalances = async () => await arrayDataItemBalances.fetch({});
|
||||
|
||||
const getBadgeAttrs = (_date) => {
|
||||
const isSameDate = date.isSameDate(today.value, _date);
|
||||
|
@ -178,23 +167,13 @@ const formatDateForAttribute = (dateValue) => {
|
|||
};
|
||||
|
||||
async function updateWarehouse(warehouseFk) {
|
||||
const stock = useArrayData('descriptorStock', {
|
||||
userParams: {
|
||||
warehouseFk,
|
||||
},
|
||||
});
|
||||
const stock = useArrayData('descriptorStock', { userParams: { warehouseFk } });
|
||||
await stock.fetch({});
|
||||
stock.store.data.itemFk = route.params.id;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
ref="itemBalancesRef"
|
||||
url="Items/getBalance"
|
||||
:filter="itemsBalanceFilter"
|
||||
@on-fetch="(data) => (itemBalances = data)"
|
||||
/>
|
||||
<FetchData
|
||||
url="Warehouses"
|
||||
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||
|
@ -207,27 +186,30 @@ async function updateWarehouse(warehouseFk) {
|
|||
<VnSelect
|
||||
:label="t('itemDiary.warehouse')"
|
||||
:options="warehousesOptions"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
dense
|
||||
v-model="itemsBalanceFilter.where.warehouseFk"
|
||||
v-model="where.warehouseFk"
|
||||
@update:model-value="
|
||||
(value) => fetchItemBalances() && updateWarehouse(value)
|
||||
(val) => fetchItemBalances() && updateWarehouse(val)
|
||||
"
|
||||
class="q-mr-lg"
|
||||
:is-clearable="false"
|
||||
/>
|
||||
<QCheckbox
|
||||
:label="t('itemDiary.showBefore')"
|
||||
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"
|
||||
/>
|
||||
<VnInputDate
|
||||
v-if="showWhatsBeforeInventory"
|
||||
:label="t('itemDiary.since')"
|
||||
dense
|
||||
v-model="itemsBalanceFilter.where.date"
|
||||
v-model="where.date"
|
||||
@update:model-value="fetchItemBalances"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -36,18 +36,7 @@ const exprBuilder = (param, value) => {
|
|||
}
|
||||
};
|
||||
|
||||
const where = {
|
||||
itemFk: route.params.id,
|
||||
};
|
||||
|
||||
const arrayData = useArrayData('ItemLastEntries', {
|
||||
url: 'Items/lastEntriesFilter',
|
||||
order: ['landed DESC', 'buyFk DESC'],
|
||||
exprBuilder: exprBuilder,
|
||||
userFilter: {
|
||||
where: where,
|
||||
},
|
||||
});
|
||||
let arrayData = useArrayData('ItemLastEntries');
|
||||
const itemLastEntries = ref([]);
|
||||
|
||||
const columns = computed(() => [
|
||||
|
@ -161,25 +150,51 @@ const getDate = (date, type) => {
|
|||
};
|
||||
|
||||
const updateFilter = async () => {
|
||||
let filter;
|
||||
if (!from.value && to.value) filter = { lte: to.value };
|
||||
else if (from.value && !to.value) filter = { gte: from.value };
|
||||
else if (from.value && to.value) filter = { between: [from.value, to.value] };
|
||||
|
||||
const userFilter = arrayData.store.userFilter.where;
|
||||
|
||||
userFilter.landed = filter;
|
||||
let landed;
|
||||
if (!from.value && to.value) landed = { lte: to.value };
|
||||
else if (from.value && !to.value) landed = { gte: from.value };
|
||||
else if (from.value && to.value) landed = { between: [from.value, to.value] };
|
||||
|
||||
arrayData.store.filter.where.landed = landed;
|
||||
await fetchItemLastEntries();
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
const landed = arrayData.store.filter.where?.landed;
|
||||
arrayData = useArrayData('ItemLastEntries', {
|
||||
url: 'Items/lastEntriesFilter',
|
||||
order: ['landed DESC', 'buyFk DESC'],
|
||||
exprBuilder: exprBuilder,
|
||||
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();
|
||||
|
||||
|
|
|
@ -391,7 +391,7 @@ onBeforeMount(async () => {
|
|||
{{ row?.subName.toUpperCase() }}
|
||||
</div>
|
||||
</div>
|
||||
<FetchedTags :item="row" :columns="3" />
|
||||
<FetchedTags :item="row" />
|
||||
</template>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<VnInput
|
||||
|
|
|
@ -58,6 +58,7 @@ lastEntries:
|
|||
pvp: PVP
|
||||
label: Label
|
||||
grouping: Grouping
|
||||
packing: Packing
|
||||
quantity: Quantity
|
||||
cost: Cost
|
||||
kg: Kg.
|
||||
|
|
|
@ -58,6 +58,7 @@ lastEntries:
|
|||
pvp: PVP
|
||||
label: Eti.
|
||||
grouping: Grouping
|
||||
packing: Packing
|
||||
quantity: Cantidad
|
||||
cost: Coste
|
||||
kg: Kg.
|
||||
|
|
|
@ -1,38 +1,12 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import VnCard from 'components/common/VnCard.vue';
|
||||
import VnCardBeta from 'components/common/VnCardBeta.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>
|
||||
|
||||
<template>
|
||||
<VnCard
|
||||
<VnCardBeta
|
||||
data-key="Order"
|
||||
base-url="Orders"
|
||||
:descriptor="OrderDescriptor"
|
||||
:filter-panel="customFilterPanel"
|
||||
:search-data-key="customRouteRedirectName"
|
||||
>
|
||||
<template #searchbar>
|
||||
<OrderSearchbar />
|
||||
</template>
|
||||
</VnCard>
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -15,15 +15,18 @@ const router = useRouter();
|
|||
const stateStore = useStateStore();
|
||||
const { t } = useI18n();
|
||||
const dataKey = 'OrderCatalogList';
|
||||
const arrayData = useArrayData(dataKey);
|
||||
const store = arrayData.store;
|
||||
const tags = ref([]);
|
||||
const itemRefs = ref({});
|
||||
|
||||
let catalogParams = {
|
||||
const catalogParams = {
|
||||
orderFk: route.params.id,
|
||||
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(() => {
|
||||
stateStore.rightDrawer = true;
|
||||
|
@ -66,7 +69,6 @@ function extractValueTags(items) {
|
|||
);
|
||||
tagValue.value = resultValueTags;
|
||||
}
|
||||
const autoLoad = computed(() => !!JSON.parse(route?.query.table ?? '{}')?.categoryFk);
|
||||
|
||||
watch(
|
||||
() => store.data,
|
||||
|
@ -78,16 +80,15 @@ watch(
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport to="#section-searchbar" v-if="stateStore.isHeaderMounted()">
|
||||
<VnSearchbar
|
||||
:data-key="dataKey"
|
||||
:user-params="catalogParams"
|
||||
:static-params="['orderFk', 'orderBy']"
|
||||
:redirect="false"
|
||||
url="Orders/CatalogFilter"
|
||||
:label="t('Search items')"
|
||||
:info="t('You can search items by name or id')"
|
||||
:search-remove-params="false"
|
||||
/>
|
||||
</Teleport>
|
||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
||||
<OrderCatalogFilter
|
||||
:data-key="dataKey"
|
||||
|
@ -98,13 +99,7 @@ watch(
|
|||
</Teleport>
|
||||
<QPage class="column items-center q-pa-md" data-cy="orderCatalogPage">
|
||||
<div class="full-width">
|
||||
<VnPaginate
|
||||
:data-key="dataKey"
|
||||
url="Orders/CatalogFilter"
|
||||
:limit="50"
|
||||
:user-params="catalogParams"
|
||||
:auto-load="autoLoad"
|
||||
>
|
||||
<VnPaginate :data-key="dataKey">
|
||||
<template #body="{ rows }">
|
||||
<div class="catalog-list">
|
||||
<div v-if="rows && !rows?.length" class="no-result">
|
||||
|
|
|
@ -208,15 +208,28 @@ async function remove(item) {
|
|||
async function handleConfirm() {
|
||||
const result = await confirm(route.params.id);
|
||||
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({
|
||||
message: t('globals.dataSaved'),
|
||||
type: 'positive',
|
||||
});
|
||||
router.push({
|
||||
name: 'TicketSale',
|
||||
query: {
|
||||
table: JSON.stringify({ id: route.params.id }),
|
||||
},
|
||||
params: { id: ticket.data[0].ticketFk },
|
||||
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 OrderSummary from 'pages/Order/Card/OrderSummary.vue';
|
||||
import OrderSearchbar from './Card/OrderSearchbar.vue';
|
||||
import OrderFilter from './Card/OrderFilter.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
|
@ -24,6 +23,8 @@ const tableRef = ref();
|
|||
const agencyList = ref([]);
|
||||
const route = useRoute();
|
||||
const addressOptions = ref([]);
|
||||
const dataKey = 'OrderList';
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -178,18 +179,24 @@ const getDateColor = (date) => {
|
|||
if (difference < 0) return 'bg-success';
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<OrderSearchbar />
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
<VnSection
|
||||
:data-key="dataKey"
|
||||
:columns="columns"
|
||||
prefix="order"
|
||||
:array-data-props="{
|
||||
url: 'Orders/filter',
|
||||
order: ['landed DESC', 'clientFk ASC', 'id DESC'],
|
||||
}"
|
||||
>
|
||||
<template #rightMenu>
|
||||
<OrderFilter data-key="OrderList" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<template #body>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="OrderList"
|
||||
url="Orders/filter"
|
||||
:order="['landed DESC', 'clientFk ASC', 'id DESC']"
|
||||
:data-key="dataKey"
|
||||
:create="{
|
||||
urlCreate: 'Orders/new',
|
||||
title: t('module.cerateOrder'),
|
||||
|
@ -270,7 +277,8 @@ const getDateColor = (date) => {
|
|||
: ''
|
||||
} `
|
||||
}}
|
||||
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
|
||||
{{ scope.opt?.nickname }}:
|
||||
{{ scope.opt?.street }},
|
||||
{{ scope.opt?.city }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
|
@ -291,4 +299,6 @@ const getDateColor = (date) => {
|
|||
/>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
</VnSection>
|
||||
</template>
|
||||
|
|
|
@ -21,3 +21,26 @@ lines:
|
|||
image: Image
|
||||
params:
|
||||
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
|
||||
params:
|
||||
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
|
||||
|
|
|
@ -68,6 +68,8 @@ function handleLocation(data, location) {
|
|||
'supplierActivityFk',
|
||||
'healthRegister',
|
||||
'street',
|
||||
'isVies',
|
||||
'isTrucker',
|
||||
],
|
||||
include: [
|
||||
{
|
||||
|
@ -92,6 +94,7 @@ function handleLocation(data, location) {
|
|||
<VnInput
|
||||
v-model="data.name"
|
||||
:label="t('supplier.fiscalData.name')"
|
||||
uppercase="true"
|
||||
clearable
|
||||
/>
|
||||
<VnInput
|
||||
|
|
|
@ -5,6 +5,7 @@ import VnTable from 'components/VnTable/VnTable.vue';
|
|||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import SupplierListFilter from './SupplierListFilter.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const tableRef = ref();
|
||||
|
@ -23,9 +24,14 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
label: t('globals.name'),
|
||||
name: 'socialName',
|
||||
create: true,
|
||||
attrs: {
|
||||
uppercase: true,
|
||||
},
|
||||
columnFilter: {
|
||||
name: 'search',
|
||||
attrs: {
|
||||
uppercase: false,
|
||||
},
|
||||
},
|
||||
isTitle: true,
|
||||
},
|
||||
|
@ -118,14 +124,18 @@ const columns = computed(() => [
|
|||
formInitialData: {},
|
||||
mapper: (data) => {
|
||||
data.name = data.socialName;
|
||||
delete data.socialName;
|
||||
|
||||
return data;
|
||||
},
|
||||
}"
|
||||
:right-search="false"
|
||||
order="id ASC"
|
||||
:columns="columns"
|
||||
/>
|
||||
>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<VnInput :label="t('globals.name')" v-model="data.socialName" :uppercase="true" />
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -54,7 +54,6 @@ const transfer = ref({
|
|||
});
|
||||
const tableRef = ref([]);
|
||||
const canProceed = ref();
|
||||
const isLoading = ref(false);
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
|
@ -197,6 +196,7 @@ const changeQuantity = async (sale) => {
|
|||
try {
|
||||
if (!rowToUpdate.value) return;
|
||||
rowToUpdate.value = null;
|
||||
sale.isNew = false;
|
||||
await updateQuantity(sale);
|
||||
} catch (e) {
|
||||
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
|
||||
|
@ -214,9 +214,6 @@ const updateQuantity = async ({ quantity, id }) => {
|
|||
};
|
||||
|
||||
const addSale = async (sale) => {
|
||||
if (isLoading.value) return;
|
||||
|
||||
isLoading.value = true;
|
||||
const params = {
|
||||
barcode: sale.itemFk,
|
||||
quantity: sale.quantity,
|
||||
|
@ -237,6 +234,7 @@ const addSale = async (sale) => {
|
|||
sale.item = newSale.item;
|
||||
|
||||
notify('globals.dataSaved', 'positive');
|
||||
sale.isNew = false;
|
||||
arrayData.fetch({});
|
||||
};
|
||||
|
||||
|
@ -754,6 +752,7 @@ watch(
|
|||
option-label="name"
|
||||
option-value="id"
|
||||
v-model="row.itemFk"
|
||||
:use-like="false"
|
||||
@update:model-value="updateItem(row)"
|
||||
>
|
||||
<template #option="scope">
|
||||
|
|
|
@ -166,8 +166,10 @@ async function handleSave() {
|
|||
v-model="row.ticketServiceTypeFk"
|
||||
:options="ticketServiceOptions"
|
||||
option-label="name"
|
||||
:roles-allowed-to-create="['administrative']"
|
||||
option-value="id"
|
||||
hide-selected
|
||||
sort-by="name ASC"
|
||||
>
|
||||
<template #form>
|
||||
<TicketCreateServiceType
|
||||
|
|
|
@ -7,6 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
|||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
|
@ -81,15 +82,12 @@ const getGroupedStates = (data) => {
|
|||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('Salesperson')"
|
||||
<VnSelectWorker
|
||||
:label="t('globals.salesPerson')"
|
||||
v-model="params.salesPersonFk"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
:where="{ role: 'salesPerson' }"
|
||||
option-value="id"
|
||||
option-label="firstName"
|
||||
:use-like="false"
|
||||
sort-by="firstName ASC"
|
||||
:params="{
|
||||
departmentCodes: ['VT'],
|
||||
}"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
|
|
|
@ -9,7 +9,7 @@ import VnTitle from 'src/components/common/VnTitle.vue';
|
|||
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import { toDate, toCurrency } from 'src/filters';
|
||||
import { toDate, toCurrency, toCelsius } from 'src/filters';
|
||||
import axios from 'axios';
|
||||
import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue';
|
||||
|
||||
|
@ -97,6 +97,20 @@ const entriesTableColumns = computed(() => {
|
|||
showValue: true,
|
||||
},
|
||||
{ label: 'm³', field: 'm3', name: 'm3', align: 'left', showValue: true },
|
||||
{
|
||||
label: t('entry.basicData.initialTemperature'),
|
||||
field: 'initialTemperature',
|
||||
name: 'initialTemperature',
|
||||
align: 'left',
|
||||
format: (val) => toCelsius(val),
|
||||
},
|
||||
{
|
||||
label: t('entry.basicData.finalTemperature'),
|
||||
field: 'finalTemperature',
|
||||
name: 'finalTemperature',
|
||||
align: 'left',
|
||||
format: (val) => toCelsius(val),
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
field: 'observation',
|
||||
|
@ -127,14 +141,14 @@ const thermographsTableColumns = computed(() => {
|
|||
field: 'maxTemperature',
|
||||
name: 'maxTemperature',
|
||||
align: 'left',
|
||||
format: (val) => (val ? `${val}°` : ''),
|
||||
format: (val) => toCelsius(val),
|
||||
},
|
||||
{
|
||||
label: t('globals.minTemperature'),
|
||||
field: 'minTemperature',
|
||||
name: 'minTemperature',
|
||||
align: 'left',
|
||||
format: (val) => (val ? `${val}°` : ''),
|
||||
format: (val) => toCelsius(val),
|
||||
},
|
||||
{
|
||||
label: t('globals.state'),
|
||||
|
|
|
@ -10,7 +10,7 @@ import FetchData from 'src/components/FetchData.vue';
|
|||
|
||||
import axios from 'axios';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
import { toDate } from 'src/filters';
|
||||
import { toDate, toCelsius } from 'src/filters';
|
||||
import { downloadFile } from 'src/composables/downloadFile';
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -52,14 +52,14 @@ const TableColumns = computed(() => {
|
|||
field: 'maxTemperature',
|
||||
name: 'maxTemperature',
|
||||
align: 'left',
|
||||
format: (val) => (val ? `${val}°` : ''),
|
||||
format: (val) => toCelsius(val),
|
||||
},
|
||||
{
|
||||
label: t('globals.minTemperature'),
|
||||
field: 'minTemperature',
|
||||
name: 'minTemperature',
|
||||
align: 'left',
|
||||
format: (val) => (val ? `${val}°` : ''),
|
||||
format: (val) => toCelsius(val),
|
||||
},
|
||||
{
|
||||
label: t('globals.state'),
|
||||
|
|
|
@ -79,6 +79,13 @@ const columns = computed(() => [
|
|||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'awb',
|
||||
label: t('travel.travelList.tableVisibleColumns.awb'),
|
||||
columnFilter: false,
|
||||
format: (row) => row.awbCode,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'warehouseInFk',
|
||||
|
|
|
@ -27,7 +27,7 @@ const initialData = computed(() => {
|
|||
return {
|
||||
userFk: routeId.value,
|
||||
deviceProductionFk: null,
|
||||
simSerialNumber: null,
|
||||
simFk: null,
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -42,7 +42,7 @@ const deallocatePDA = async (deviceProductionFk) => {
|
|||
|
||||
function reloadData() {
|
||||
initialData.value.deviceProductionFk = null;
|
||||
initialData.value.simSerialNumber = null;
|
||||
initialData.value.simFk = null;
|
||||
paginate.value.fetch();
|
||||
}
|
||||
</script>
|
||||
|
@ -89,7 +89,7 @@ function reloadData() {
|
|||
/>
|
||||
<VnInput
|
||||
:label="t('Current SIM')"
|
||||
:model-value="row?.simSerialNumber"
|
||||
:model-value="row?.simFk"
|
||||
disable
|
||||
/>
|
||||
<QBtn
|
||||
|
@ -150,7 +150,7 @@ function reloadData() {
|
|||
</template>
|
||||
</VnSelect>
|
||||
<VnInput
|
||||
v-model="data.simSerialNumber"
|
||||
v-model="data.simFk"
|
||||
:label="t('SIM serial number')"
|
||||
id="simSerialNumber"
|
||||
use-input
|
||||
|
|
|
@ -283,21 +283,22 @@ const fetchWeekData = async () => {
|
|||
year: selectedDateYear.value,
|
||||
week: selectedWeekNumber.value,
|
||||
};
|
||||
const mail = (
|
||||
await axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||
try {
|
||||
const [{ data: mailData }, { data: countData }] = await Promise.all([
|
||||
axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||
params: { filter: { where } },
|
||||
})
|
||||
).data[0];
|
||||
}),
|
||||
axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }),
|
||||
]);
|
||||
|
||||
if (!mail) state.value = null;
|
||||
else {
|
||||
state.value = mail.state;
|
||||
reason.value = mail.reason;
|
||||
const mail = mailData[0];
|
||||
|
||||
state.value = mail?.state;
|
||||
reason.value = mail?.reason;
|
||||
canResend.value = !!countData.count;
|
||||
} catch {
|
||||
state.value = null;
|
||||
}
|
||||
|
||||
canResend.value = !!(
|
||||
await axiosNoError.get('WorkerTimeControlMails/count', { params: { where } })
|
||||
).data.count;
|
||||
};
|
||||
|
||||
const setHours = (data) => {
|
||||
|
|
|
@ -138,7 +138,11 @@ function uppercaseStreetModel(data) {
|
|||
return {
|
||||
get: () => (data.street ? data.street.toUpperCase() : ''),
|
||||
set: (value) => {
|
||||
if (value) {
|
||||
data.street = value.toUpperCase();
|
||||
} else {
|
||||
data.street = null;
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,98 +1,23 @@
|
|||
import { RouterView } from 'vue-router';
|
||||
|
||||
export default {
|
||||
path: '/entry',
|
||||
name: 'Entry',
|
||||
meta: {
|
||||
title: 'entries',
|
||||
icon: 'vn:entry',
|
||||
moduleName: 'Entry',
|
||||
keyBinding: 'e',
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'EntryMain' },
|
||||
menus: {
|
||||
main: [
|
||||
'EntryList',
|
||||
'MyEntries',
|
||||
'EntryLatestBuys',
|
||||
'EntryStockBought',
|
||||
'EntryWasteRecalc',
|
||||
],
|
||||
card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryDms', 'EntryLog'],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'EntryMain',
|
||||
component: () => import('src/components/common/VnModule.vue'),
|
||||
redirect: { name: 'EntryList' },
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: 'EntryList',
|
||||
meta: {
|
||||
title: 'list',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () => import('src/pages/Entry/EntryList.vue'),
|
||||
},
|
||||
{
|
||||
path: 'my',
|
||||
name: 'MyEntries',
|
||||
meta: {
|
||||
title: 'labeler',
|
||||
icon: 'sell',
|
||||
},
|
||||
component: () => import('src/pages/Entry/MyEntries.vue'),
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
name: 'EntryCreate',
|
||||
meta: {
|
||||
title: 'entryCreate',
|
||||
icon: 'add',
|
||||
},
|
||||
component: () => import('src/pages/Entry/EntryCreate.vue'),
|
||||
},
|
||||
{
|
||||
path: 'latest-buys',
|
||||
name: 'EntryLatestBuys',
|
||||
meta: {
|
||||
title: 'latestBuys',
|
||||
icon: 'contact_support',
|
||||
},
|
||||
component: () => import('src/pages/Entry/EntryLatestBuys.vue'),
|
||||
},
|
||||
{
|
||||
path: 'stock-Bought',
|
||||
name: 'EntryStockBought',
|
||||
meta: {
|
||||
title: 'reserves',
|
||||
icon: 'deployed_code_history',
|
||||
},
|
||||
component: () => import('src/pages/Entry/EntryStockBought.vue'),
|
||||
},
|
||||
{
|
||||
path: 'waste-recalc',
|
||||
name: 'EntryWasteRecalc',
|
||||
meta: {
|
||||
title: 'wasteRecalc',
|
||||
icon: 'compost',
|
||||
},
|
||||
component: () => import('src/pages/Entry/EntryWasteRecalc.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
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: [
|
||||
{
|
||||
name: 'EntrySummary',
|
||||
path: 'summary',
|
||||
name: 'EntrySummary',
|
||||
meta: {
|
||||
title: 'summary',
|
||||
icon: 'launch',
|
||||
|
@ -150,6 +75,96 @@ export default {
|
|||
component: () => import('src/pages/Entry/Card/EntryLog.vue'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'Entry',
|
||||
path: '/entry',
|
||||
meta: {
|
||||
title: 'entries',
|
||||
icon: 'vn:entry',
|
||||
moduleName: 'Entry',
|
||||
keyBinding: 'e',
|
||||
menu: [
|
||||
'EntryList',
|
||||
'MyEntries',
|
||||
'EntryLatestBuys',
|
||||
'EntryStockBought',
|
||||
'EntryWasteRecalc',
|
||||
]
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'EntryMain' },
|
||||
children: [
|
||||
{
|
||||
name: 'EntryMain',
|
||||
path: '',
|
||||
component: () => import('src/components/common/VnModule.vue'),
|
||||
redirect: { name: 'EntryIndexMain' },
|
||||
children: [
|
||||
{
|
||||
path:'',
|
||||
name: 'EntryIndexMain',
|
||||
redirect: { name: 'EntryList' },
|
||||
component: () => import('src/pages/Entry/EntryList.vue'),
|
||||
children: [
|
||||
{
|
||||
name: 'EntryList',
|
||||
path: 'list',
|
||||
meta: {
|
||||
title: 'list',
|
||||
icon: 'view_list',
|
||||
},
|
||||
},
|
||||
entryCard,
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
name: 'EntryCreate',
|
||||
meta: {
|
||||
title: 'entryCreate',
|
||||
icon: 'add',
|
||||
},
|
||||
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',
|
||||
name: 'EntryLatestBuys',
|
||||
meta: {
|
||||
title: 'latestBuys',
|
||||
icon: 'contact_support',
|
||||
},
|
||||
component: () => import('src/pages/Entry/EntryLatestBuys.vue'),
|
||||
},
|
||||
{
|
||||
path: 'stock-Bought',
|
||||
name: 'EntryStockBought',
|
||||
meta: {
|
||||
title: 'reserves',
|
||||
icon: 'deployed_code_history',
|
||||
},
|
||||
component: () => import('src/pages/Entry/EntryStockBought.vue'),
|
||||
},
|
||||
{
|
||||
path: 'waste-recalc',
|
||||
name: 'EntryWasteRecalc',
|
||||
meta: {
|
||||
title: 'wasteRecalc',
|
||||
icon: 'compost',
|
||||
},
|
||||
component: () => import('src/pages/Entry/EntryWasteRecalc.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
|
@ -1,35 +1,102 @@
|
|||
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 {
|
||||
path: '/order',
|
||||
name: 'Order',
|
||||
path: '/order',
|
||||
meta: {
|
||||
title: 'order',
|
||||
icon: 'vn:basket',
|
||||
moduleName: 'Order',
|
||||
keyBinding: 'o',
|
||||
menu: ['OrderList'],
|
||||
},
|
||||
component: RouterView,
|
||||
redirect: { name: 'OrderMain' },
|
||||
menus: {
|
||||
main: ['OrderList'],
|
||||
card: ['OrderBasicData', 'OrderCatalog', 'OrderVolume', 'OrderLines'],
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'OrderMain',
|
||||
path: '',
|
||||
component: () => import('src/components/common/VnModule.vue'),
|
||||
redirect: { name: 'OrderIndexMain' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'OrderMain',
|
||||
component: () => import('src/components/common/VnModule.vue'),
|
||||
name: 'OrderIndexMain',
|
||||
redirect: { name: 'OrderList' },
|
||||
component: () => import('src/pages/Order/OrderList.vue'),
|
||||
children: [
|
||||
{
|
||||
path: 'list',
|
||||
name: 'OrderList',
|
||||
path: 'list',
|
||||
meta: {
|
||||
title: 'orderList',
|
||||
icon: 'view_list',
|
||||
},
|
||||
component: () => import('src/pages/Order/OrderList.vue'),
|
||||
},
|
||||
orderCard,
|
||||
],
|
||||
},
|
||||
{
|
||||
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';
|
||||
|
||||
const { notify } = useNotify();
|
||||
|
||||
const initInvoicing = {
|
||||
invoicing: false,
|
||||
nRequests: 0,
|
||||
nPdfs: 0,
|
||||
totalPdfs: 0,
|
||||
addressIndex: 0,
|
||||
errors: [],
|
||||
};
|
||||
export const useInvoiceOutGlobalStore = defineStore({
|
||||
id: 'invoiceOutGlobal',
|
||||
state: () => ({
|
||||
|
@ -23,16 +30,11 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
addresses: [],
|
||||
minInvoicingDate: null,
|
||||
parallelism: null,
|
||||
invoicing: false,
|
||||
isInvoicing: false,
|
||||
status: null,
|
||||
addressIndex: 0,
|
||||
errors: [],
|
||||
|
||||
printer: null,
|
||||
nRequests: 0,
|
||||
nPdfs: 0,
|
||||
totalPdfs: 0,
|
||||
formData: null,
|
||||
...initInvoicing,
|
||||
}),
|
||||
actions: {
|
||||
async init() {
|
||||
|
@ -117,12 +119,13 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
);
|
||||
throw new Error("There aren't addresses to invoice");
|
||||
}
|
||||
this.invoicing = false;
|
||||
this.status = 'invoicing';
|
||||
this.formData = formData;
|
||||
this.addressIndex = 0;
|
||||
this.errors = [];
|
||||
await this.invoiceClient();
|
||||
this.status = 'invoicing';
|
||||
//reset data
|
||||
for (const key in initInvoicing) {
|
||||
this[key] = initInvoicing[key];
|
||||
}
|
||||
this.invoiceClient();
|
||||
} catch (err) {
|
||||
this.handleError(err);
|
||||
}
|
||||
|
@ -184,7 +187,6 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
async invoiceClient() {
|
||||
if (this.invoicing || this.nRequests >= this.parallelism) return;
|
||||
const address = this.addresses[this.addressIndex];
|
||||
|
||||
if (!address || !this.status || this.status == 'stopping') {
|
||||
this.status = 'stopping';
|
||||
this.invoicing = false;
|
||||
|
@ -192,6 +194,7 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
}
|
||||
try {
|
||||
this.invoicing = true;
|
||||
this.nRequests++;
|
||||
const params = {
|
||||
clientId: address.clientId,
|
||||
addressId: address.id,
|
||||
|
@ -215,6 +218,7 @@ export const useInvoiceOutGlobalStore = defineStore({
|
|||
}
|
||||
} finally {
|
||||
this.invoicing = false;
|
||||
this.nRequests--;
|
||||
this.addressIndex++;
|
||||
this.invoiceClient();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('ClaimPhoto', () => {
|
||||
// redmine.verdnatura.es/issues/8417
|
||||
describe.skip('ClaimPhoto', () => {
|
||||
beforeEach(() => {
|
||||
const claimId = 1;
|
||||
cy.login('developer');
|
||||
|
|
|
@ -8,8 +8,8 @@ describe('EntryMy when is supplier', () => {
|
|||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('should open buyLabel when is supplier', () => {
|
||||
// https://redmine.verdnatura.es/issues/8418
|
||||
it.skip('should open buyLabel when is supplier', () => {
|
||||
cy.get(
|
||||
'[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
|
||||
).click();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
describe('InvoiceInCorrective', () => {
|
||||
// https://redmine.verdnatura.es/issues/8419
|
||||
describe.skip('InvoiceInCorrective', () => {
|
||||
const createCorrective = '.q-menu > .q-list > :nth-child(6) > .q-item__section';
|
||||
const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)';
|
||||
const saveDialog = '.q-card > .q-card__actions > .q-btn--standard ';
|
||||
|
|
|
@ -21,8 +21,8 @@ describe('InvoiceInList', () => {
|
|||
cy.url().should('include', `/invoice-in/${id}/summary`);
|
||||
});
|
||||
});
|
||||
|
||||
it('should open the details', () => {
|
||||
// https://redmine.verdnatura.es/issues/8420
|
||||
it.skip('should open the details', () => {
|
||||
cy.get(firstDetailBtn).click();
|
||||
cy.get(summaryHeaders).eq(1).contains('Basic data');
|
||||
cy.get(summaryHeaders).eq(4).contains('Vat');
|
||||
|
|
|
@ -9,7 +9,6 @@ describe('InvoiceOut summary', () => {
|
|||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/invoice-out/list`);
|
||||
cy.typeSearchbar('{enter}');
|
||||
});
|
||||
|
||||
it('should generate the invoice PDF', () => {
|
||||
|
@ -19,13 +18,12 @@ describe('InvoiceOut summary', () => {
|
|||
cy.dataCy('VnConfirm_confirm').click();
|
||||
cy.checkNotification('The invoice PDF document has been regenerated');
|
||||
});
|
||||
|
||||
it('should refund the invoice ', () => {
|
||||
cy.typeSearchbar('T1111111{enter}');
|
||||
cy.dataCy('descriptor-more-opts').click();
|
||||
cy.get('.q-menu > .q-list > :nth-child(7)').click();
|
||||
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
|
||||
cy.checkNotification('The following refund ticket have been created 1000000');
|
||||
cy.checkNotification('The following refund ticket have been created');
|
||||
});
|
||||
|
||||
it('should delete an invoice ', () => {
|
||||
|
@ -35,7 +33,6 @@ describe('InvoiceOut summary', () => {
|
|||
cy.dataCy('VnConfirm_confirm').click();
|
||||
cy.checkNotification('InvoiceOut deleted');
|
||||
});
|
||||
|
||||
it('should transfer the invoice ', () => {
|
||||
cy.typeSearchbar('T1111111{enter}');
|
||||
cy.dataCy('descriptor-more-opts').click();
|
||||
|
|
|
@ -15,8 +15,8 @@ describe('Item list', () => {
|
|||
cy.get('.q-menu .q-item').contains('Anthurium').click();
|
||||
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
|
||||
});
|
||||
|
||||
it('should create an item', () => {
|
||||
// https://redmine.verdnatura.es/issues/8421
|
||||
it.skip('should create an item', () => {
|
||||
const data = {
|
||||
Description: { val: `Test item` },
|
||||
Type: { val: `Crisantemo`, type: 'select' },
|
||||
|
|
|
@ -18,8 +18,8 @@ describe('Item tag', () => {
|
|||
+cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||
cy.checkNotification("The tag or priority can't be repeated for an item");
|
||||
});
|
||||
|
||||
it('should add a new tag', () => {
|
||||
// https://redmine.verdnatura.es/issues/8422
|
||||
it.skip('should add a new tag', () => {
|
||||
cy.get('.q-page').should('be.visible');
|
||||
cy.get('.q-page-sticky > div').click();
|
||||
cy.get('.q-page-sticky > div').click();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
describe('Ticket expedtion', () => {
|
||||
// https://redmine.verdnatura.es/issues/8423
|
||||
describe.skip('Ticket expedtion', () => {
|
||||
const tableContent = '.q-table .q-virtual-scroll__content';
|
||||
const stateTd = 'td:nth-child(9)';
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ describe('TicketList', () => {
|
|||
cy.get(firstRow).find('.q-btn:first').click();
|
||||
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
|
||||
});
|
||||
|
||||
it('should open ticket summary', () => {
|
||||
// https://redmine.verdnatura.es/issues/8424
|
||||
it.skip('should open ticket summary', () => {
|
||||
searchResults();
|
||||
cy.get(firstRow).find('.q-btn:last').click();
|
||||
cy.dataCy('ticketSummary').should('exist');
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
const c = require('croppie');
|
||||
|
||||
describe('TicketSale', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
|
|
|
@ -49,7 +49,8 @@ describe('VnLocation', () => {
|
|||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
cy.visit('/#/worker/create', { timeout: 5000 });
|
||||
cy.visit('/#/worker/list', { timeout: 5000 });
|
||||
cy.dataCy('vnTableCreateBtn').click();
|
||||
cy.waitForElement('.q-card');
|
||||
cy.get(inputLocation).click();
|
||||
});
|
||||
|
|
|
@ -10,8 +10,8 @@ describe('WorkerList', () => {
|
|||
|
||||
it('should open the worker summary', () => {
|
||||
cy.get(inputName).type('jessica{enter}');
|
||||
cy.get(searchBtn).click();
|
||||
cy.intercept('GET', /\/api\/Workers\/summary+/).as('worker');
|
||||
cy.get(searchBtn).click();
|
||||
cy.wait('@worker').then(() =>
|
||||
cy.get(descriptorTitle).should('include.text', 'Jessica')
|
||||
);
|
||||
|
|
|
@ -18,8 +18,8 @@ describe('ZoneWarehouse', () => {
|
|||
cy.get(saveBtn).click();
|
||||
cy.checkNotification(dataError);
|
||||
});
|
||||
|
||||
it('should create & remove a warehouse', () => {
|
||||
// https://redmine.verdnatura.es/issues/8425
|
||||
it.skip('should create & remove a warehouse', () => {
|
||||
cy.addBtnClick();
|
||||
cy.fillInForm(data);
|
||||
cy.get(saveBtn).click();
|
||||
|
|
Loading…
Reference in New Issue