0
0
Fork 0

Merge branch '7884-AddLabelerField' of https://gitea.verdnatura.es/verdnatura/salix-front into 7884-AddLabelerField

This commit is contained in:
Jon Elias 2024-10-01 11:32:17 +02:00
commit 90ce9b2cd3
142 changed files with 4249 additions and 1801 deletions

View File

@ -1,3 +1,184 @@
# Version 24.38 - 2024-09-17
### Added 🆕
- chore: refs #6772 fix e2e (origin/6772-warmfix-fixE2e) by:jorgep
- chore: refs #7323 worker changes by:jorgep
- chore: refs #7353 fix warnings by:jorgep
- chore: refs #7353 use Vue component nomenclature by:jorgep
- chore: refs #7356 fix type by:jorgep
- feat(AccountConnections): use VnToken by:alexm
- feat: add key to routerView by:Javier Segarra
- feat: add plus shortcut in VnTable by:Javier Segarra
- feat: add row by:Javier Segarra
- feat: addRow withour dialog by:Javier Segarra
- feat: apply mixin by:Javier Segarra
- feat by:Javier Segarra
- feat: change navBar buttons by:Javier Segarra
- feat: dense rows by:Javier Segarra
- feat: fields with wrong name by:jgallego
- feat: fix bugs and filters by:Javier Segarra
- feat: fix refund parameters by:jgallego
- feat: handle create row by:Javier Segarra
- feat: handle dates by:Javier Segarra
- feat: handle qCheckbox 3rd state by:Javier Segarra
- feat: imrpove VnInputTime to set cursor at start by:Javier Segarra
- feat: keyShortcut directive by:Javier Segarra
- feat: minor fixes by:jgallego
- feat: only filter by isDestiny by:Javier Segarra
- feat: refs #211153 businessDataLinkGrafana by:robert
- feat: refs #7129 add km start and end on create form by:pablone
- feat: refs #7353 add filter & fix customTags by:jorgep
- feat: refs #7353 add locale by:jorgep
- feat: refs #7353 add no one opt by:jorgep
- feat: refs #7353 add right icons by:jorgep
- feat: refs #7353 imporve toDateFormat by:jorgep
- feat: refs #7353 salesPerson nickname & id by:jorgep
- feat: refs #7353 split sections by:jorgep
- feat: refs #7847 remove reload btn by:jorgep
- feat: refs #7847 remove reload fn by:jorgep
- feat: refs #7889 added shortcuts to modules by:Jon
- feat: refs #7911 added shortcut to modules by:Jon
- feat: refuncInvoiceForm component by:jgallego
- feat: remove duplicity by:Javier Segarra
- feat: remove future itemFixedPrices by:Javier Segarra
- feat: replace stickyButtons by subtoolbar by:Javier Segarra
- feat: required validation by:Javier Segarra
- feat: show bad dates by:Javier Segarra
- feat: showdate icons by:Javier Segarra
- feat: solve ItemFixedFilterPanel by:Javier Segarra
- feat: transfer an invoice by:jgallego
- feat: try to fix ItemFixedFilterPanel by:Javier Segarra
- feat: unnecessary changes by:Javier Segarra
- feat: update changelog (origin/7896_down_devToTest_2436) by:Javier Segarra
- feat: updates by:Javier Segarra
- feat: update version and changelog by:Javier Segarra
- feat: vnInput\* by:Javier Segarra
- feat: with VnTable by:Javier Segarra
- refs #6772 feat: fix approach by:Javier Segarra
- refs #6772 feat: refresh shelving.basic-data by:Javier Segarra
- style: show subName value by:Javier Segarra
### Changed 📦
- perf: add v-shortcut in VnCard by:Javier Segarra
- perf: approach by:Javier Segarra
- perf: change directive location by:Javier Segarra
- perf: change slots order by:Javier Segarra
- perf: examples by:Javier Segarra
- perf: hide icon for VnInputDate by:Javier Segarra
- perf: improve ItemFixedPricefilterPanel by:Javier Segarra
- perf: improve mainShrotcutMixin by:Javier Segarra
- perf: minor clean code by:Javier Segarra
- perf: onRowchange by:Javier Segarra
- perf: order by by:Javier Segarra
- perf: order components by:Javier Segarra
- perf: refs #7889 perf shortcut test by:Jon
- perf: remove console.log by:Javier Segarra
- perf: remove icons in header slot by:Javier Segarra
- perf: remove print variables by:Javier Segarra
- perf: restore CustomerBasicData by:Javier Segarra
- refactor: deleted useless prop by:Jon
- refactor: deleted useless prop in FetchedTags by:Jon
- refactor: refs #7323 drop useless code by:jorgep
- refactor: refs #7353 clients correction by:jorgep
- refactor: refs #7353 clients correction wip by:jorgep
- refactor: refs #7353 ease logic by:jorgep
- refactor: refs #7353 order correction by:jorgep
- refactor: refs #7353 simplify code by:jorgep
- refactor: refs #7353 tickets correction by:jorgep
- refactor: refs #7353 use global locales by:jorgep
- refactor: refs #7354 changed descriptor menu options by:Jon
- refactor: refs #7354 changed icon color in table and notification when deleting a zone by:Jon
- refactor: refs #7354 fix tableFilters by:Jon
- refactor: refs #7354 modified VnInputTime by:Jon
- refactor: refs #7354 refactor deliveryPanel by:Jon
- refactor: refs #7354 refactor zones section and fixed e2e tests by:Jon
- refactor: refs #7354 requested changes by:Jon
- refactor: refs #7354 reverse deliveryPanel changes by:Jon
- refactor: refs #7354 Zone migration changes by:Jon
- refactor: refs #7889 deleted subtitle attr and use keyBinding instead by:Jon
- refactor: refs #7889 modified shortcut and dashboard, and added tootlip in LeftMenu by:Jon
- refs #6722 perf: not fetch when id not exists by:Javier Segarra
- refs #6772 perf: change variable name by:JAVIER SEGARRA MARTINEZ
- refs #6772 perf: use ArrayData (6772_reload_sections) by:Javier Segarra
- refs #7283 refactor fix ItemDescriptor by:carlossa
- refs #7283 refactor ItexDescriptor by:carlossa
### Fixed 🛠️
- chore: refs #6772 fix e2e (origin/6772-warmfix-fixE2e) by:jorgep
- chore: refs #7353 fix warnings by:jorgep
- chore: refs #7356 fix type by:jorgep
- feat: fix bugs and filters by:Javier Segarra
- feat: fix refund parameters by:jgallego
- feat: minor fixes by:jgallego
- feat: refs #7353 add filter & fix customTags by:jorgep
- feat: try to fix ItemFixedFilterPanel by:Javier Segarra
- fix: add border-top by:Javier Segarra
- fix: added missing descriptors and small details by:Jon
- fix branch by:carlossa
- fix: call upsert when crudModel haschanges by:Javier Segarra
- fix(ClaimList): fix summary by:alexm
- fix: cli warnings by:Javier Segarra
- fix: editTableOptions by:Javier Segarra
- fix events and descriptor menu by:Jon
- fix: InvoiceIn sections (origin/6772_reload_sections) by:Javier Segarra
- fix: minor changes by:Javier Segarra
- fix: minor error whit dates by:Javier Segarra
- fix: module icon by:Javier Segarra
- fix: options QDate by:Javier Segarra
- fix: refs #6900 e2e error by:jorgep
- fix: refs #6900 rollback by:jorgep
- fix: refs #7353 css by:jorgep
- fix: refs #7353 hide search param (origin/7353-warmfix-fixSearchbar) by:jorgep
- fix: refs #7353 iron out filter by:jorgep
- fix: refs #7353 iron out ticket table by:jorgep
- fix: refs #7353 padding by:jorgep
- fix: refs #7353 salesClientTable by:jorgep
- fix: refs #7353 salesorderTable by:jorgep
- fix: refs #7353 saleTicketMonitors by:jorgep
- fix: refs #7353 use same datakey by:jorgep
- fix: refs #7353 vnTable colors by:jorgep
- fix: refs #7354 e2e tests by:Jon
- fix: refs #7354 fix delivery days by:Jon
- fix: refs #7354 fix list searchbar and filters by:Jon
- fix: refs #7354 fix VnSearchbar search for zone section & finished basic tests by:Jon
- fix: refs #7354 fix VnTable filters and agency field by:Jon
- fix: refs #7354 fix zoneSearchbar by:Jon
- fix: refs #7354 requested changes by:Jon
- fix: refs #7356 colors by:jorgep
- fix: refs #7356 create claim dialog by:jorgep
- fix: refs #7889 fixed shortcut test by:Jon
- fix: refs #7903 fixed ticket's search bar and keybinding tooltip by:Jon
- fix: refs #7911 fixed shortcut and related files by:Jon
- fix: remove condition duplicated by:Javier Segarra
- fix: remove property by:Javier Segarra
- fix tootltip by:carlossa
- fix traduction by:carlossa
- fix(VnSectionMain): add QPage by:alexm
- fix(zone): zoneLocation and the others searchbar by:alexm
- refactor: refs #7354 fix tableFilters by:Jon
- refactor: refs #7354 refactor zones section and fixed e2e tests by:Jon
- refs #6772 feat: fix approach by:Javier Segarra
- refs #6772 fix: claimPhoto reload by:Javier Segarra
- refs #6896 fix searchbar by:carlossa
- refs #6897 fix entry by:carlossa
- refs #6899 fix invoiceFix by:carlossa
- refs #6899 fix order by:carlossa
- refs #7283 fix by:carlossa
- refs #7283 fix ItemDescriptor warehouse by:carlossa
- refs #7283 refactor fix ItemDescriptor by:carlossa
- refs #7355 #7366 fix account, summary, list, travelList, tooltip by:carlossa
- refs #7355 fix accountPrivileges by:carlossa
- refs #7355 fix accounts, vnTable by:carlossa
- refs #7355 fix privileges by:carlossa
- refs #7355 fix roles filters by:carlossa
- refs #7355 fix total by:carlossa
- refs #7355 fix views summarys, entryList, travelList refact by:carlossa
- refs #7366 fix travel hours by:carlossa
- test: fix e2e by:Javier Segarra
# Version 24.36 - 2024-08-27
### Added 🆕

View File

@ -1,6 +1,6 @@
{
"name": "salix-front",
"version": "24.40.0",
"version": "24.42.0",
"description": "Salix frontend",
"productName": "Salix",
"author": "Verdnatura",

View File

@ -2,9 +2,15 @@ import { boot } from 'quasar/wrappers';
import qFormMixin from './qformMixin';
import mainShortcutMixin from './mainShortcutMixin';
import keyShortcut from './keyShortcut';
import useNotify from 'src/composables/useNotify.js';
const { notify } = useNotify();
export default boot(({ app }) => {
app.mixin(qFormMixin);
app.mixin(mainShortcutMixin);
app.directive('shortcut', keyShortcut);
app.config.errorHandler = function (err) {
console.error(err);
notify('globals.error', 'negative', 'error');
};
});

View File

@ -234,6 +234,8 @@ async function remove(data) {
newData = newData.filter((form) => !ids.some((id) => id == form[pk]));
fetch(newData);
});
} else {
reset();
}
emit('update:selected', []);
}

View File

@ -297,11 +297,12 @@ const removeTag = (index, params, search) => {
/>
</QItem>
<QItem class="q-mt-lg">
<QIcon
name="add_circle"
<QBtn
icon="add_circle"
shortcut="+"
flat
class="fill-icon-on-hover q-px-xs"
color="primary"
size="sm"
@click="tagValues.push({})"
/>
</QItem>

View File

@ -4,7 +4,7 @@ import { useArrayData } from 'composables/useArrayData';
const model = defineModel({ type: Object });
const $props = defineProps({
name: {
type: String,
type: [String, Boolean],
default: '',
},
label: {

View File

@ -53,6 +53,10 @@ const $props = defineProps({
type: Boolean,
default: true,
},
bottom: {
type: Object,
default: null,
},
cardClass: {
type: String,
default: 'flex-one',
@ -69,10 +73,7 @@ const $props = defineProps({
type: Boolean,
default: false,
},
disableInfiniteScroll: {
type: Boolean,
default: false,
},
hasSubToolbar: {
type: Boolean,
default: null,
@ -101,6 +102,14 @@ const $props = defineProps({
type: String,
default: '90vh',
},
footer: {
type: Boolean,
default: false,
},
disabledAttr: {
type: Boolean,
default: false,
},
});
const { t } = useI18n();
const stateStore = useStateStore();
@ -146,7 +155,7 @@ onMounted(() => {
quasar.platform.is.mobile && !$props.disableOption?.card
? CARD_MODE
: $props.defaultMode;
stateStore.rightDrawer = true;
stateStore.rightDrawer = quasar.screen.gt.xs;
columnsVisibilitySkipped.value = [
...splittedColumns.value.columns
.filter((c) => c.visible == false)
@ -196,7 +205,7 @@ function setUserParams(watchedParams, watchedOrder) {
function sanitizer(params) {
for (const [key, value] of Object.entries(params)) {
if (typeof value == 'object') {
if (value && typeof value == 'object') {
const param = Object.values(value)[0];
if (typeof param == 'string') params[key] = param.replaceAll('%', '');
}
@ -301,6 +310,7 @@ defineExpose({
redirect: redirectFn,
selected,
CrudModelRef,
params,
});
function handleOnDataSaved(_) {
@ -368,9 +378,7 @@ function handleOnDataSaved(_) {
ref="CrudModelRef"
@on-fetch="(...args) => emit('onFetch', ...args)"
:search-url="searchUrl"
:disable-infinite-scroll="
$attrs['disableInfiniteScroll'] ? isTableMode : !disableInfiniteScroll
"
:disable-infinite-scroll="isTableMode"
@save-changes="reload"
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
:auto-load="hasParams || $attrs['auto-load']"
@ -390,7 +398,7 @@ function handleOnDataSaved(_) {
card-container-class="grid-three"
flat
:style="isTableMode && `max-height: ${tableHeight}`"
virtual-scroll
:virtual-scroll="isTableMode"
@virtual-scroll="
(event) =>
event.index > rows.length - 2 &&
@ -420,7 +428,7 @@ function handleOnDataSaved(_) {
<QBtn
v-if="$props.rightSearch"
icon="filter_alt"
class="bg-vn-section-color q-ml-md"
class="bg-vn-section-color q-ml-sm"
dense
@click="stateStore.toggleRightDrawer()"
/>
@ -507,8 +515,12 @@ function handleOnDataSaved(_) {
:key="index"
:title="btn.title"
:icon="btn.icon"
class="q-px-sm text-primary-light"
class="q-pa-xs"
flat
dense
:class="
btn.isPrimary ? 'text-primary-light' : 'color-vn-text '
"
:style="`visibility: ${
(btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden'
}`"
@ -516,6 +528,29 @@ function handleOnDataSaved(_) {
/>
</QTd>
</template>
<template #bottom v-if="bottom">
<slot name="bottom-table">
<QBtn
@click="
() =>
createAsDialog
? (showForm = !showForm)
: handleOnDataSaved(create)
"
class="cursor-pointer fill-icon"
color="primary"
icon="add_circle"
size="md"
round
flat
shortcut="+"
:disabled="!disabledAttr"
/>
<QTooltip>
{{ createForm.title }}
</QTooltip>
</slot>
</template>
<template #item="{ row, colsMap }">
<component
:is="$props.redirect ? 'router-link' : 'span'"
@ -632,6 +667,20 @@ function handleOnDataSaved(_) {
</QCard>
</component>
</template>
<template #bottom-row="{ cols }" v-if="footer">
<QTr v-if="rows.length" class="bg-header" style="height: 30px">
<QTh
v-for="col of cols.filter((cols) => cols.visible ?? true)"
:key="col?.id"
class="text-center"
>
<slot
:name="`column-footer-${col.name}`"
:class="getColAlign(col)"
/>
</QTh>
</QTr>
</template>
</QTable>
</template>
</CrudModel>
@ -699,7 +748,7 @@ es:
}
.bg-header {
background-color: var(--vn-header-color);
background-color: var(--vn-accent-color);
color: var(--vn-text-color);
}
@ -709,9 +758,7 @@ es:
.q-table--dark .q-table__bottom,
.q-table--dark thead,
.q-table--dark tr,
.q-table--dark th,
.q-table--dark td {
.q-table--dark tr {
border-color: var(--vn-section-color);
}
@ -747,10 +794,16 @@ es:
}
}
.q-table th {
.q-table {
th {
padding: 0;
}
&__top {
padding: 12px 0px;
top: 0;
}
}
.vnTable {
thead tr th {
position: sticky;
@ -831,4 +884,13 @@ es:
cursor: text;
user-select: all;
}
.full-width-slot {
width: 100%;
display: flex;
text-align: center;
color: var(--vn-text-color);
margin-bottom: -1%;
background-color: var(--vn-header-color);
}
</style>

View File

@ -135,7 +135,7 @@ onMounted(async () => {
});
</script>
<template>
<QBtn icon="vn:visible_columns" class="bg-vn-section-color q-mr-md q-px-sm" dense>
<QBtn icon="vn:visible_columns" class="bg-vn-section-color q-mr-sm q-px-sm" dense>
<QPopupProxy ref="popupProxyRef">
<QCard class="column q-pa-md">
<QIcon name="info" size="sm" class="info-icon">

View File

@ -24,7 +24,9 @@ const stateStore = useStateStore();
const route = useRoute();
const router = useRouter();
const url = computed(() => {
if (props.baseUrl) return `${props.baseUrl}/${route.params.id}`;
if (props.baseUrl) {
return `${props.baseUrl}/${route.params.id}`;
}
return props.customUrl;
});
const searchRightDataKey = computed(() => {
@ -40,8 +42,10 @@ onBeforeMount(async () => {
try {
if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id };
await arrayData.fetch({ append: false, updateRouter: false });
} catch (e) {
router.push({ name: 'WorkerList' });
} catch {
const { matched: matches } = router.currentRoute.value;
const { path } = matches.at(-1);
router.push({ path: path.replace(/:id.*/, '') });
}
});

View File

@ -17,17 +17,15 @@ const $props = defineProps({
},
});
let mixed;
const componentArray = computed(() => {
if (typeof $props.prop === 'object') return [$props.prop];
return $props.prop;
});
function mix(toComponent) {
if (mixed) return mixed;
const { component, attrs, event } = toComponent;
const customComponent = $props.components[component];
mixed = {
return {
component: customComponent?.component ?? component,
attrs: {
...toValueAttrs(attrs),
@ -37,7 +35,6 @@ function mix(toComponent) {
},
event: { ...customComponent?.event, ...event },
};
return mixed;
}
function toValueAttrs(attrs) {

View File

@ -400,7 +400,14 @@ defineExpose({
/>
</QDialog>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn fab color="primary" icon="add" @click="showFormDialog()" class="fill-icon">
<QBtn
fab
color="primary"
icon="add"
shortcut="+"
@click="showFormDialog()"
class="fill-icon"
>
<QTooltip>
{{ t('Upload file') }}
</QTooltip>

View File

@ -103,6 +103,7 @@ const mixinRules = [
@click="
() => {
value = null;
vnInputRef.focus();
emit('remove');
}
"

View File

@ -20,6 +20,7 @@ const { validations } = useValidator();
const { t } = useI18n();
const requiredFieldRule = (val) => validations().required($attrs.required, val);
const vnInputDateRef = ref(null);
const dateFormat = 'DD/MM/YYYY';
const isPopupOpen = ref();
@ -91,6 +92,7 @@ const styleAttrs = computed(() => {
<template>
<div @mouseover="hover = true" @mouseleave="hover = false">
<QInput
ref="vnInputDateRef"
v-model="formattedDate"
class="vn-input-date"
:mask="mask"
@ -113,6 +115,7 @@ const styleAttrs = computed(() => {
!$attrs.disable
"
@click="
vnInputDateRef.focus();
model = null;
isPopupOpen = false;
"

View File

@ -16,6 +16,7 @@ const props = defineProps({
default: false,
},
});
const vnInputTimeRef = ref(null);
const initialDate = ref(model.value ?? Date.vnNew());
const { t } = useI18n();
const requiredFieldRule = (val) => validations().required($attrs.required, val);
@ -69,6 +70,7 @@ function dateToTime(newDate) {
<template>
<div @mouseover="hover = true" @mouseleave="hover = false">
<QInput
ref="vnInputTimeRef"
class="vn-input-time"
mask="##:##"
placeholder="--:--"
@ -92,6 +94,7 @@ function dateToTime(newDate) {
!$attrs.disable
"
@click="
vnInputTimeRef.focus();
model = null;
isPopupOpen = false;
"

View File

@ -2,21 +2,37 @@
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
import { useI18n } from 'vue-i18n';
import { ref } from 'vue';
const { t } = useI18n();
const value = defineModel({ type: [String, Number, Object] });
const emit = defineEmits(['update:model-value', 'update:options']);
const props = defineProps({
location: {
type: Object,
default: null,
},
});
const modelValue = ref(
props.location
? `${props.location?.postcode}, ${props.location?.city}(${props.location?.province?.name}), ${props.location?.country?.name}`
: null
);
function showLabel(data) {
return `${data.code} - ${data.town}(${data.province}), ${data.country}`;
return `${data.code}, ${data.town}(${data.province}), ${data.country}`;
}
const handleModelValue = (data) => {
emit('update:model-value', data);
};
</script>
<template>
<VnSelectDialog
v-model="value"
option-value="code"
v-model="modelValue"
option-filter-value="search"
:option-label="(opt) => showLabel(opt)"
:option-label="
(opt) => (typeof modelValue === 'string' ? modelValue : showLabel(opt))
"
url="Postcodes/filter"
@update:model-value="handleModelValue"
:use-like="false"
:label="t('Location')"
:placeholder="t('search_by_postalcode')"
@ -27,7 +43,14 @@ function showLabel(data) {
:emit-value="false"
>
<template #form>
<CreateNewPostcode @on-data-saved="(newValue) => (value = newValue)" />
<CreateNewPostcode
@on-data-saved="
(newValue) => {
modelValue = newValue;
emit('update:model-value', newValue);
}
"
/>
</template>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">

View File

@ -2,6 +2,7 @@
import { useStateStore } from 'stores/useStateStore';
import LeftMenu from 'components/LeftMenu.vue';
import { onMounted } from 'vue';
import { useQuasar } from 'quasar';
const stateStore = useStateStore();
const $props = defineProps({
@ -10,7 +11,9 @@ const $props = defineProps({
default: true,
},
});
onMounted(() => (stateStore.leftDrawer = $props.leftDrawer));
onMounted(
() => (stateStore.leftDrawer = useQuasar().screen.gt.xs ? $props.leftDrawer : false)
);
</script>
<template>

View File

@ -38,6 +38,10 @@ const $props = defineProps({
type: [Array],
default: () => [],
},
exprBuilder: {
type: Function,
default: null,
},
isClearable: {
type: Boolean,
default: true,
@ -179,6 +183,7 @@ 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;

View File

@ -0,0 +1,52 @@
<script setup>
import { onBeforeMount, ref, useAttrs } from 'vue';
import axios from 'axios';
import VnSelect from 'components/common/VnSelect.vue';
const { schema, table, column, translation, defaultOptions } = defineProps({
schema: {
type: String,
default: 'vn',
},
table: {
type: String,
required: true,
},
column: {
type: String,
required: true,
},
translation: {
type: Function,
default: null,
},
defaultOptions: {
type: Array,
default: () => [],
},
});
const $attrs = useAttrs();
const options = ref([]);
onBeforeMount(async () => {
options.value = [].concat(defaultOptions);
const { data } = await axios.get(`Applications/get-enum-values`, {
params: { schema, table, column },
});
for (const value of data)
options.value.push({
[$attrs['option-value'] ?? 'id']: value,
[$attrs['option-label'] ?? 'name']: translation ? translation(value) : value,
});
});
</script>
<template>
<VnSelect
v-bind="$attrs"
:options="options"
:key="options.length"
:input-debounce="0"
/>
</template>

View File

@ -47,6 +47,7 @@ let store;
let entity;
const isLoading = ref(false);
const isSameDataKey = computed(() => $props.dataKey === route.meta.moduleName);
const menuRef = ref();
defineExpose({ getData });
onBeforeMount(async () => {
@ -170,7 +171,7 @@ const toModule = computed(() =>
<QTooltip>
{{ t('components.cardDescriptor.moreOptions') }}
</QTooltip>
<QMenu ref="menuRef">
<QMenu :ref="menuRef">
<QList>
<slot name="menu" :entity="entity" :menu-ref="menuRef" />
</QList>

View File

@ -59,6 +59,7 @@ const $props = defineProps({
});
defineExpose({ search, sanitizer });
const emit = defineEmits([
'update:modelValue',
'refresh',

View File

@ -131,9 +131,8 @@ async function fetch(params) {
useArrayData(props.dataKey, params);
arrayData.reset(['filter.skip', 'skip']);
await arrayData.fetch({ append: false });
if (!store.hasMoreData) {
isLoading.value = false;
}
if (!store.hasMoreData) isLoading.value = false;
emit('onFetch', store.data);
return store.data;
}

View File

@ -1,15 +1,18 @@
import { useSession } from './useSession';
import axios from 'axios';
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
export function usePrintService() {
const quasar = useQuasar();
const { t } = useI18n();
const { getTokenMultimedia } = useSession();
function sendEmail(path, params) {
return axios.post(path, params).then(() =>
quasar.notify({
message: 'Notification sent',
message: t('globals.notificationSent'),
type: 'positive',
icon: 'check',
})

View File

@ -268,6 +268,7 @@ input::-webkit-inner-spin-button {
max-width: 400px;
}
}
.edit-photo-btn {
position: absolute;
right: 12px;
@ -280,3 +281,10 @@ input::-webkit-inner-spin-button {
color: var(--vn-label-color);
text-transform: uppercase;
}
.q-date {
&__today {
border: 2px solid $info;
color: $info;
}
}

View File

@ -36,7 +36,6 @@ $color-font-secondary: #777;
.bg-success {
background-color: $positive;
}
.bg-notice {
background-color: $info;
}

View File

@ -104,8 +104,10 @@ globals:
ticket: Ticket
campaign: Campaign
weight: Weight
error: Ups! Something went wrong
pageTitles:
logIn: Login
addressEdit: Update address
summary: Summary
basicData: Basic data
log: Logs
@ -158,6 +160,7 @@ globals:
dms: File management
entryCreate: New entry
latestBuys: Latest buys
reserves: Reserves
tickets: Tickets
ticketCreate: New Tickets
boxing: Boxing
@ -493,6 +496,8 @@ ticket:
warehouse: Warehouse
customerCard: Customer card
alias: Alias
ticketList: Ticket List
newOrder: New Order
boxing:
expedition: Expedition
item: Item
@ -514,6 +519,7 @@ ticket:
landed: Landed
consigneePhone: Consignee phone
consigneeMobile: Consignee mobile
consigneeAddress: Consignee address
clientPhone: Client phone
clientMobile: Client mobile
consignee: Consignee
@ -543,6 +549,11 @@ ticket:
weight: Weight
goTo: Go to
summaryAmount: Summary
purchaseRequest: Purchase request
service: Service
description: Description
attender: Attender
ok: Ok
create:
client: Client
address: Address
@ -566,7 +577,6 @@ invoiceOut:
client: Client
company: Company
customerCard: Customer card
ticketList: Ticket List
summary:
issued: Issued
created: Created
@ -899,6 +909,7 @@ supplier:
account: Account
payMethod: Pay Method
payDay: Pay Day
country: Country
summary:
responsible: Responsible
notes: Notes
@ -1072,7 +1083,7 @@ item:
producer: Producer
landed: Landed
fixedPrice:
itemId: Item ID
itemFk: Item ID
groupingPrice: Grouping price
packingPrice: Packing price
hasMinPrice: Has min price

View File

@ -64,7 +64,7 @@ globals:
shipped: F. envío
totalEntries: Ent. totales
amount: Importe
packages: Bultos
packages: Embalajes
download: Descargar
downloadPdf: Descargar PDF
selectRows: 'Seleccionar las { numberRows } filas(s)'
@ -106,8 +106,10 @@ globals:
ticket: Ticket
campaign: Campaña
weight: Peso
error: ¡Ups! Algo salió mal
pageTitles:
logIn: Inicio de sesión
addressEdit: Modificar consignatario
summary: Resumen
basicData: Datos básicos
log: Historial
@ -161,6 +163,7 @@ globals:
dms: Gestión documental
entryCreate: Nueva entrada
latestBuys: Últimas compras
reserves: Reservas
tickets: Tickets
ticketCreate: Nuevo ticket
boxing: Encajado
@ -265,7 +268,7 @@ globals:
tracking: Estados
components: Componentes
pictures: Fotos
packages: Bultos
packages: Embalajes
ldap: LDAP
samba: Samba
twoFactor: Doble factor
@ -484,7 +487,7 @@ ticket:
tracking: Estados
components: Componentes
pictures: Fotos
packages: Bultos
packages: Embalajes
list:
nickname: Alias
state: Estado
@ -502,6 +505,8 @@ ticket:
warehouse: Almacén
customerCard: Ficha del cliente
alias: Alias
ticketList: Listado de tickets
newOrder: Nuevo pedido
boxing:
expedition: Expedición
item: Artículo
@ -523,6 +528,7 @@ ticket:
landed: Entregado
consigneePhone: Tel. consignatario
consigneeMobile: Móv. consignatario
consigneeAddress: Dir. consignatario
clientPhone: Tel. cliente
clientMobile: Móv. cliente
consignee: Consignatario
@ -552,6 +558,10 @@ ticket:
weight: Peso
goTo: Ir a
summaryAmount: Resumen
purchaseRequest: Petición de compra
service: Servicio
description: Descripción
attender: Consignatario
create:
client: Cliente
address: Dirección
@ -884,6 +894,7 @@ supplier:
account: Cuenta
payMethod: Método de pago
payDay: Dia de pago
country: País
summary:
responsible: Responsable
notes: Notas
@ -1057,7 +1068,7 @@ item:
producer: Productor
landed: F. entrega
fixedPrice:
itemId: ID Artículo
itemFk: ID Artículo
groupingPrice: Precio grouping
packingPrice: Precio packing
hasMinPrice: Tiene precio mínimo

View File

@ -2,6 +2,7 @@
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
import FormModel from 'components/FormModel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import { ref, watch } from 'vue';
@ -24,7 +25,7 @@ watch(
<template>
<FormModel
ref="formModelRef"
:url="`VnUsers/preview`"
url="VnUsers/preview"
:url-update="`VnUsers/${route.params.id}/update-user`"
:filter="accountFilter"
model="Accounts"
@ -43,6 +44,15 @@ watch(
option-value="code"
option-label="code"
/>
<VnSelectEnum
schema="account"
table="user"
column="twoFactor"
v-model="data.twoFactor"
:label="t('account.card.twoFactor')"
option-value="code"
option-label="code"
/>
</div>
</template>
</FormModel>

View File

@ -142,7 +142,13 @@ const redirectToRoleSummary = (id) =>
<SubRoleCreateForm @on-submit-create-subrole="createSubRole" />
</QDialog>
<QPageSticky position="bottom-right" :offset="[18, 18]">
<QBtn fab icon="add" color="primary" @click="openCreateSubRoleForm()">
<QBtn
fab
icon="add"
shortcut="+"
color="primary"
@click="openCreateSubRoleForm()"
>
<QTooltip>{{ t('warehouses.add') }}</QTooltip>
</QBtn>
</QPageSticky>

View File

@ -35,6 +35,7 @@ account:
willDeactivated: User will be deactivated
activated: User activated!
deactivated: User deactivated!
twoFactor: Two factor
actions:
setPassword: Set password
disableAccount:

View File

@ -32,6 +32,7 @@ account:
activated: ¡Usuario activado!
deactivated: ¡Usuario desactivado!
newUser: Nuevo usuario
twoFactor: Doble factor
privileges:
delegate: Puede delegar privilegios
actions:

View File

@ -3,58 +3,18 @@ import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectEnum from 'src/components/common/VnSelectEnum.vue';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import axios from 'axios';
import VnAvatar from 'src/components/ui/VnAvatar.vue';
const route = useRoute();
const { t } = useI18n();
const claimStates = ref([]);
const claimStatesCopy = ref([]);
const optionsList = ref([]);
const workersOptions = ref([]);
function setClaimStates(data) {
claimStates.value = data;
claimStatesCopy.value = data;
}
async function getEnumValues() {
optionsList.value = [{ id: null, description: t('claim.null') }];
const { data } = await axios.get(`Applications/get-enum-values`, {
params: {
schema: 'vn',
table: 'claim',
column: 'pickup',
},
});
for (let value of data)
optionsList.value.push({ id: value, description: t(`claim.${value}`) });
}
getEnumValues();
const statesFilter = {
options: claimStates,
filterFn: (options, value) => {
const search = value.toLowerCase();
if (value === '') return claimStatesCopy.value;
return options.value.filter((row) => {
const description = row.description.toLowerCase();
return description.indexOf(search) > -1;
});
},
};
</script>
<template>
<FetchData
@ -70,7 +30,7 @@ const statesFilter = {
auto-load
:reload="true"
>
<template #form="{ data, validate, filter }">
<template #form="{ data, validate }">
<VnRow>
<VnInput
v-model="data.client.name"
@ -101,20 +61,14 @@ const statesFilter = {
/>
</template>
</VnSelect>
<QSelect
<VnSelect
v-model="data.claimStateFk"
:options="claimStates"
option-value="id"
option-label="description"
emit-value
url="ClaimStates"
:label="t('claim.state')"
map-options
use-input
@filter="(value, update) => filter(value, update, statesFilter)"
option-label="description"
:rules="validate('claim.claimStateFk')"
:input-debounce="0"
>
</QSelect>
/>
</VnRow>
<VnRow>
<QInput
@ -123,16 +77,14 @@ const statesFilter = {
:rules="validate('claim.packages')"
type="number"
/>
<QSelect
<VnSelectEnum
v-model="data.pickup"
:options="optionsList"
option-value="id"
option-label="description"
emit-value
:label="t('claim.pickup')"
map-options
use-input
:input-debounce="0"
table="claim"
column="pickup"
option-label="description"
:translation="(value) => t(`claim.${value}`)"
:default-options="[{ id: null, description: t('claim.null') }]"
/>
</VnRow>
</template>

View File

@ -317,7 +317,7 @@ async function saveWhenHasChanges() {
</div>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn fab color="primary" icon="add" @click="showImportDialog()" />
<QBtn fab color="primary" shortcut="+" icon="add" @click="showImportDialog()" />
</QPageSticky>
</template>

View File

@ -246,7 +246,13 @@ function onDrag() {
</QDialog>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<label for="fileInput">
<QBtn fab @click="inputFile.nativeEl.click()" icon="add" color="primary">
<QBtn
fab
@click="inputFile.nativeEl.click()"
shortcut="+"
icon="add"
color="primary"
>
<QInput
ref="inputFile"
type="file"

View File

@ -5,15 +5,12 @@ import { useRoute, useRouter } from 'vue-router';
import axios from 'axios';
import FetchData from 'components/FetchData.vue';
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const addresses = ref([]);
const client = ref(null);
const provincesLocation = ref([]);
const addressFilter = {
fields: [
@ -41,7 +38,13 @@ const addressFilter = {
{
relation: 'province',
scope: {
fields: ['id', 'name'],
fields: ['id', 'name', 'countryFk'],
include: [
{
relation: 'country',
scope: { fields: ['id', 'name'] },
},
],
},
},
],
@ -83,13 +86,6 @@ const getClientData = async (id) => {
}
};
const setProvince = (provinceFk) => {
const result = provincesLocation.value.filter(
(province) => province.id === provinceFk
);
return result[0]?.name || '';
};
const isDefaultAddress = (address) => {
return client?.value?.defaultAddressFk === address.id ? 1 : 0;
};
@ -128,12 +124,6 @@ const toCustomerAddressEdit = (addressId) => {
</script>
<template>
<FetchData
@on-fetch="(data) => (provincesLocation = data)"
auto-load
url="Provinces/location"
/>
<div class="full-width flex justify-center">
<QCard class="card-width q-pa-lg" v-if="addresses.length">
<QCardSection>
@ -177,7 +167,7 @@ const toCustomerAddressEdit = (addressId) => {
<div>{{ item.street }}</div>
<div>
{{ item.postalCode }} - {{ item.city }},
{{ setProvince(item.provinceFk) }}
{{ item.province.name }}
</div>
<div>
{{ item.phone }}

View File

@ -16,7 +16,7 @@ import { useVnConfirm } from 'composables/useVnConfirm';
import VnTable from 'components/VnTable/VnTable.vue';
import VnInput from 'components/common/VnInput.vue';
import VnSubToolbar from 'components/ui/VnSubToolbar.vue';
import VnFilter from 'components/VnTable/VnFilter.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment.vue';
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
@ -33,9 +33,9 @@ const stateStore = useStateStore();
const user = state.getUser();
const clientRisk = ref([]);
const companies = ref([]);
const tableRef = ref();
const companyId = ref(user.value.companyFk);
const companyLastId = ref(user.value.companyFk);
const balances = ref([]);
const vnFilterRef = ref({});
const filter = computed(() => {
@ -45,33 +45,6 @@ const filter = computed(() => {
};
});
const companyFilterColumn = {
align: 'left',
name: 'companyId',
label: t('Company'),
component: 'select',
attrs: {
url: 'Companies',
optionLabel: 'code',
sortBy: 'code',
limit: 0,
},
columnFilter: {
event: {
remove: () => (companyId.value = null),
'update:modelValue': (newCompanyFk) => {
if (!newCompanyFk) return;
vnFilterRef.value.addFilter(newCompanyFk);
companyLastId.value = newCompanyFk;
},
blur: () =>
!companyId.value &&
(companyId.value = companyLastId.value ?? user.value.companyFk),
},
},
visible: false,
};
const columns = computed(() => [
{
align: 'right',
@ -166,6 +139,11 @@ onBeforeMount(() => {
});
async function getCurrentBalance(data) {
currentBalance.value[companyId.value] = {
amount: 0,
code: companies.value.find((c) => c.id === companyId.value)?.code,
};
for (const balance of data) {
currentBalance.value[balance.companyFk] = {
code: balance.company.code,
@ -192,14 +170,21 @@ const showBalancePdf = ({ id }) => {
<template>
<FetchData
url="Companies"
auto-load
@on-fetch="(data) => (companies = data)"
></FetchData>
<FetchData
v-if="companies.length > 0"
url="clientRisks"
:filter="{
include: { relation: 'company', scope: { fields: ['code'] } },
where: { clientFk: route.params.id, companyFk: companyId },
where: { clientFk: route.params.id },
}"
auto-load
@on-fetch="getCurrentBalance"
></FetchData>
<VnSubToolbar class="q-mb-md">
<template #st-data>
<div class="column justify-center q-px-md q-py-sm">
@ -212,13 +197,15 @@ const showBalancePdf = ({ id }) => {
</template>
<template #st-actions>
<div>
<VnFilter
<VnSelect
:label="t('Company')"
ref="vnFilterRef"
v-model="companyId"
data-key="CustomerBalance"
:column="companyFilterColumn"
search-url="balance"
/>
:options="companies"
option-label="code"
option-value="id"
></VnSelect>
</div>
</template>
</VnSubToolbar>

View File

@ -16,6 +16,19 @@ const { t } = useI18n();
const businessTypes = ref([]);
const contactChannels = ref([]);
const title = ref();
const handleSalesModelValue = (val) => ({
or: [
{ name: val },
{ nickname: { like: '%' + val + '%' } },
{ code: { like: `${val}%` } },
],
});
const exprBuilder = (param, value) => {
return {
and: [{ active: { neq: false } }, handleSalesModelValue(value)],
};
};
</script>
<template>
<FetchData
@ -34,7 +47,7 @@ const title = ref();
<VnRow>
<VnInput
:label="t('globals.name')"
:rules="validate('client.socialName')"
:rules="validate('client.name')"
autofocus
clearable
v-model="data.name"
@ -98,8 +111,10 @@ const title = ref();
}"
:fields="['id', 'nickname']"
sort-by="nickname ASC"
option-label="nickname"
option-value="id"
:rules="validate('client.salesPersonFk')"
:use-like="false"
:expr-builder="exprBuilder"
emit-value
auto-load
>

View File

@ -0,0 +1,177 @@
<script setup>
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import { QItem } from 'quasar';
import VnSelect from 'src/components/common/VnSelect.vue';
import { QItemSection } from 'quasar';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import { toDate } from 'src/filters';
const { t } = useI18n();
defineProps({ dataKey: { type: String, required: true } });
</script>
<template>
<VnFilterPanel :data-key="dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params }">
<QItem>
<QItemSection>
<VnInput
:label="t('params.item')"
v-model="params.itemId"
is-outlined
lazy-rules
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
v-model="params.buyerId"
url="TicketRequests/getItemTypeWorker"
:fields="['id', 'nickname']"
sort-by="nickname ASC"
:label="t('params.buyer')"
option-value="id"
option-label="nickname"
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
v-model="params.typeId"
url="ItemTypes"
:include="['category']"
:fields="['id', 'name', 'categoryFk']"
sort-by="name ASC"
:label="t('params.typeId')"
option-label="name"
option-value="id"
dense
outlined
rounded
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
<QItemLabel caption>{{
scope.opt?.category?.name
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
v-model="params.categoryId"
url="ItemCategories"
:fields="['id', 'name']"
sort-by="name ASC"
:label="t('params.categoryId')"
option-label="name"
option-value="id"
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
v-model="params.campaignId"
url="Campaigns/latest"
sort-by="dated DESC"
:label="t('params.campaignId')"
option-label="code"
option-value="id"
dense
outlined
rounded
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>{{
t(`params.${scope.opt?.code}`)
}}</QItemLabel>
<QItemLabel caption>{{
toDate(scope.opt.dated)
}}</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.from')"
v-model="params.from"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.to')"
v-model="params.to"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
item: Item id
buyer: Buyer
type: Type
category: Category
itemId: Item id
buyerId: Buyer
typeId: Type
categoryId: Category
from: From
to: To
campaignId: Campaña
valentinesDay: Valentine's Day
mothersDay: Mother's Day
allSaints: All Saints' Day
es:
params:
item: Id artículo
buyer: Comprador
type: Tipo
category: Categoría
itemId: Id Artículo
buyerId: Comprador
typeId: Tipo
categoryId: Reino
from: Desde
to: Hasta
campaignId: Campaña
valentinesDay: Día de San Valentín
mothersDay: Día de la Madre
allSaints: Día de Todos los Santos
</i18n>

View File

@ -56,17 +56,18 @@ const customerContactsRef = ref(null);
</div>
</VnRow>
<VnRow>
<QIcon
<QBtn
@click="customerContactsRef.insert()"
class="cursor-pointer"
color="primary"
name="add"
size="sm"
flat
icon="add"
shortcut="+"
>
<QTooltip>
{{ t('Add contact') }}
</QTooltip>
</QIcon>
</QBtn>
</VnRow>
</QCard>
</template>

View File

@ -190,6 +190,18 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
>
<QTooltip>{{ t('Go to user') }}</QTooltip>
</QBtn>
<QBtn
v-if="entity.supplier"
:to="{
name: 'SupplierSummary',
params: { id: entity.supplier.id },
}"
size="md"
icon="vn:supplier"
color="primary"
>
<QTooltip>{{ t('Go to supplier') }}</QTooltip>
</QBtn>
</QCardActions>
</template>
</CardDescriptor>
@ -204,6 +216,7 @@ es:
Customer ticket list: Listado de tickets del cliente
Customer invoice out list: Listado de facturas del cliente
Go to user: Ir al usuario
Go to supplier: Ir al proveedor
Customer unpaid: Cliente impago
Unpaid: Impagado
unpaidDated: 'Fecha {dated}'

View File

@ -236,6 +236,7 @@ const toCustomerFileManagementCreate = () => {
@click.stop="toCustomerFileManagementCreate()"
color="primary"
fab
shortcut="+"
icon="add"
/>
<QTooltip>

View File

@ -94,7 +94,7 @@ function handleLocation(data, location) {
<VnLocation
:rules="validate('Worker.postcode')"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
v-model="data.postcode"
:location="data"
@update:model-value="(location) => handleLocation(data, location)"
/>
</VnRow>
@ -134,15 +134,17 @@ function handleLocation(data, location) {
</QTooltip>
</QIcon>
</div>
<QCheckbox :label="t('Verified data')" v-model="data.isTaxDataChecked" />
<QCheckbox :label="t('Daily invoice')" v-model="data.hasDailyInvoice" />
</VnRow>
<VnRow>
<QCheckbox
:label="t('Electronic invoice')"
v-model="data.hasElectronicInvoice"
/><QCheckbox
:label="t('Verified data')"
v-model="data.isTaxDataChecked"
/>
<QCheckbox :label="t('Daily invoice')" v-model="data.hasDailyInvoice" />
</VnRow>
</template>
</FormModel>

View File

@ -99,7 +99,13 @@ const tableRef = ref();
</VnTable>
<QPageSticky :offset="[18, 18]">
<QBtn @click.stop="toCustomerSamplesCreate()" color="primary" fab icon="add" />
<QBtn
@click.stop="toCustomerSamplesCreate()"
color="primary"
fab
icon="add"
shortcut="+"
/>
<QTooltip>
{{ t('Send sample') }}
</QTooltip>

View File

@ -1,35 +1,20 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
const { t } = useI18n();
const props = defineProps({
defineProps({
dataKey: {
type: String,
required: true,
},
});
const provinces = ref();
const workers = ref();
const zones = ref();
</script>
<template>
<FetchData url="Provinces" @on-fetch="(data) => (provinces = data)" auto-load />
<FetchData url="Zones" @on-fetch="(data) => (zones = data)" auto-load />
<FetchData
url="Workers/activeWithInheritedRole"
:filter="{ where: { role: 'salesPerson' } }"
@on-fetch="(data) => (workers = data)"
auto-load
/>
<VnFilterPanel :data-key="props.dataKey" :search-button="true" search-url="table">
<VnFilterPanel :data-key="dataKey" :search-button="true" search-url="table">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
@ -65,15 +50,14 @@ const zones = ref();
</QItemSection>
</QItem>
<QItem class="q-mb-sm">
<QItemSection v-if="!workers">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="workers">
<QItemSection>
<VnSelect
url="Workers/activeWithInheritedRole"
:filter="{ where: { role: 'salesPerson' } }"
auto-load
:label="t('Salesperson')"
v-model="params.salesPersonFk"
@update:model-value="searchFn()"
:options="workers"
option-value="id"
option-label="name"
emit-value
@ -88,15 +72,12 @@ const zones = ref();
</QItemSection>
</QItem>
<QItem class="q-mb-sm">
<QItemSection v-if="!provinces">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="provinces">
<VnSelect
<QItemSection
><VnSelect
url="Provinces"
:label="t('Province')"
v-model="params.provinceFk"
@update:model-value="searchFn()"
:options="provinces"
option-value="id"
option-label="name"
emit-value
@ -105,6 +86,7 @@ const zones = ref();
dense
outlined
rounded
auto-load
:input-debounce="0"
/>
</QItemSection>
@ -135,15 +117,11 @@ const zones = ref();
</QItemSection>
</QItem>
<QItem>
<QItemSection v-if="!zones">
<QSkeleton type="QInput" class="full-width" />
</QItemSection>
<QItemSection v-if="zones">
<VnSelect
url="Zones"
:label="t('Zone')"
v-model="params.zoneFk"
@update:model-value="searchFn()"
:options="zones"
option-value="id"
option-label="name"
emit-value
@ -152,8 +130,8 @@ const zones = ref();
dense
outlined
rounded
auto-load
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>

View File

@ -8,10 +8,10 @@ import VnLocation from 'src/components/common/VnLocation.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import CustomerSummary from './Card/CustomerSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import { toDate } from 'src/filters';
import CustomerFilter from './CustomerFilter.vue';
const { t } = useI18n();
const router = useRouter();
@ -397,6 +397,11 @@ function handleLocation(data, location) {
:label="t('Search customer')"
data-key="Customer"
/>
<RightMenu>
<template #right-panel>
<CustomerFilter data-key="Customer" />
</template>
</RightMenu>
<VnTable
ref="tableRef"
data-key="Customer"
@ -413,6 +418,7 @@ function handleLocation(data, location) {
order="id DESC"
:columns="columns"
redirect="customer"
:right-search="false"
auto-load
>
<template #more-create-dialog="{ data }">
@ -423,9 +429,10 @@ function handleLocation(data, location) {
:params="{
departmentCodes: ['VT', 'shopping'],
}"
option-label="nickname"
option-value="id"
:fields="['id', 'nickname']"
sort-by="nickname ASC"
:use-like="false"
emit-value
auto-load
>

View File

@ -134,6 +134,7 @@ function handleLocation(data, location) {
option-label="fiscalName"
option-value="id"
v-model="data.customsAgentFk"
:tooltip="t('Create a new expense')"
>
<template #form>
<CustomerNewCustomsAgent @on-data-saved="refreshData()" />

View File

@ -11,7 +11,7 @@ import VnRow from 'components/ui/VnRow.vue';
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 CustomsNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
const { t } = useI18n();
const route = useRoute();
@ -177,7 +177,12 @@ function handleLocation(data, location) {
<VnLocation
:rules="validate('Worker.postcode')"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
v-model="data.postalCode"
:location="{
postcode: data.postalCode,
city: data.city,
province: data.province,
country: data.province.country,
}"
@update:model-value="(location) => handleLocation(data, location)"
></VnLocation>
</div>
@ -221,9 +226,10 @@ function handleLocation(data, location) {
option-label="fiscalName"
option-value="id"
v-model="data.customsAgentFk"
:tooltip="t('New customs agent')"
>
<template #form>
<CustomsNewCustomsAgent />
<CustomerNewCustomsAgent />
</template>
</VnSelectDialog>
</div>
@ -267,16 +273,17 @@ function handleLocation(data, location) {
</div>
</VnRow>
<QIcon
<QBtn
@click.stop="addNote()"
class="cursor-pointer add-icon q-mt-md"
name="add"
size="sm"
flat
icon="add"
shortcut="+"
>
<QTooltip>
{{ t('Add note') }}
</QTooltip>
</QIcon>
</QBtn>
</template>
</FormModel>
</template>
@ -303,6 +310,7 @@ es:
Mobile: Movíl
Incoterms: Incoterms
Customs agent: Agente de aduanas
New customs agent: Nuevo agente de aduanas
Notes: Notas
Observation type: Tipo de observación
Description: Descripción

View File

@ -46,7 +46,6 @@ const onSubmit = async () => {
};
try {
await axios.patch(`Clients/${$props.id}/setPassword`, payload);
await $props.promise();
} catch (error) {
notify('errors.create', 'negative');
} finally {

View File

@ -35,6 +35,7 @@ const filter = {
],
where: { clientFk: route.params.id },
order: ['shipped DESC', 'id'],
limit: 30,
};
const columns = computed(() => [
@ -149,7 +150,6 @@ const setShippedColor = (date) => {
auto-load
order="shipped DESC, id"
:disable-option="{ card: true, table: true }"
limit="5"
class="full-width"
:disable-infinite-scroll="true"
>

View File

@ -58,7 +58,7 @@ customer:
vies: VIES
payMethod: Método de pago
bankAccount: Cuenta bancaria
dueDay: Día de pago
dueDay: Vencimiento
hasLcr: Recibido LCR
hasCoreVnl: Recibido core VNL
hasB2BVnl: Recibido B2B VNL

View File

@ -138,7 +138,13 @@ const columns = computed(() => [
</template>
</CrudModel>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn fab color="primary" icon="add" @click="entryObservationsRef.insert()" />
<QBtn
fab
color="primary"
icon="add"
shortcut="+"
@click="entryObservationsRef.insert()"
/>
</QPageSticky>
</template>
<i18n>

View File

@ -10,6 +10,7 @@ import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.v
import { toDate, toCurrency } from 'src/filters';
import { getUrl } from 'src/composables/getUrl';
import axios from 'axios';
import FetchedTags from 'src/components/ui/FetchedTags.vue';
const route = useRoute();
const { t } = useI18n();
@ -163,7 +164,7 @@ const fetchEntryBuys = async () => {
>
<template #header-left>
<router-link
v-if="route.name !== 'EntrySummary'"
v-if="route?.name !== 'EntrySummary'"
:to="{ name: 'EntrySummary', params: { id: entityId } }"
class="header link"
:href="entryUrl"
@ -184,7 +185,10 @@ const fetchEntryBuys = async () => {
<QIcon name="open_in_new" />
</router-link>
<VnLv :label="t('entry.summary.commission')" :value="entry.commission" />
<VnLv :label="t('entry.summary.currency')" :value="entry.currency.name" />
<VnLv
:label="t('entry.summary.currency')"
:value="entry.currency?.name"
/>
<VnLv :label="t('entry.summary.company')" :value="entry.company.code" />
<VnLv :label="t('entry.summary.reference')" :value="entry.reference" />
<VnLv
@ -210,12 +214,12 @@ const fetchEntryBuys = async () => {
</VnLv>
<VnLv
:label="t('entry.summary.travelAgency')"
:value="entry.travel.agency.name"
:value="entry.travel.agency?.name"
/>
<VnLv :label="t('shipped')" :value="toDate(entry.travel.shipped)" />
<VnLv
:label="t('entry.summary.travelWarehouseOut')"
:value="entry.travel.warehouseOut.name"
:value="entry.travel.warehouseOut?.name"
/>
<QCheckbox
:label="t('entry.summary.travelDelivered')"
@ -225,7 +229,7 @@ const fetchEntryBuys = async () => {
<VnLv :label="t('landed')" :value="toDate(entry.travel.landed)" />
<VnLv
:label="t('entry.summary.travelWarehouseIn')"
:value="entry.travel.warehouseIn.name"
:value="entry.travel.warehouseIn?.name"
/>
<QCheckbox
:label="t('entry.summary.travelReceived')"
@ -281,17 +285,17 @@ const fetchEntryBuys = async () => {
>
<template #body="{ cols, row, rowIndex }">
<QTr no-hover>
<QTd v-for="col in cols" :key="col.name">
<QTd v-for="col in cols" :key="col?.name">
<component
:is="tableColumnComponents[col.name].component(props)"
v-bind="tableColumnComponents[col.name].props(props)"
@click="tableColumnComponents[col.name].event(props)"
:is="tableColumnComponents[col?.name].component()"
v-bind="tableColumnComponents[col?.name].props()"
@click="tableColumnComponents[col?.name].event()"
class="col-content"
>
<template
v-if="
col.name !== 'observation' &&
col.name !== 'isConfirmed'
col?.name !== 'observation' &&
col?.name !== 'isConfirmed'
"
>{{ col.value }}</template
>

View File

@ -1,16 +1,17 @@
<script setup>
import { onMounted, onUnmounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue';
import { useStateStore } from 'stores/useStateStore';
import { toDate } from 'src/filters';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import VnImg from 'src/components/ui/VnImg.vue';
const stateStore = useStateStore();
const { t } = useI18n();
import { toDate } from 'src/filters';
import VnImg from 'src/components/ui/VnImg.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
const columns = [
{
align: 'center',

View File

@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnInput from 'components/common/VnInput.vue';
import VnSelect from 'components/common/VnSelect.vue';
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
@ -18,6 +19,7 @@ defineProps({
const itemTypeWorkersOptions = ref([]);
const suppliersOptions = ref([]);
const tagValues = ref([]);
</script>
<template>

View File

@ -0,0 +1,293 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useState } from 'src/composables/useState';
import { useQuasar } from 'quasar';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import FetchData from 'components/FetchData.vue';
import FormModelPopup from 'components/FormModelPopup.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnRow from 'components/ui/VnRow.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import EntryStockBoughtFilter from './EntryStockBoughtFilter.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import EntryStockBoughtDetail from 'src/pages/Entry/EntryStockBoughtDetail.vue';
const { t } = useI18n();
const quasar = useQuasar();
const state = useState();
const user = state.getUser();
const columns = [
{
align: 'left',
label: 'Id',
name: 'id',
isId: true,
columnFilter: false,
visible: false,
},
{
align: 'left',
name: 'workerFk',
label: t('Buyer'),
isTitle: true,
component: 'select',
cardVisible: true,
create: true,
attrs: {
url: 'Workers/activeWithInheritedRole',
fields: ['id', 'name'],
where: { role: 'buyer' },
optionFilter: 'firstName',
optionLabel: 'name',
optionValue: 'id',
useLike: false,
},
},
{
align: 'left',
label: t('Reserve'),
name: 'reserve',
columnFilter: false,
create: true,
component: 'number',
summation: true,
},
{
align: 'center',
label: t('Bought'),
name: 'bought',
summation: true,
cardVisible: true,
columnFilter: false,
},
{
align: 'left',
label: t('Date'),
name: 'dated',
component: 'date',
visible: false,
create: true,
},
{
align: 'left',
name: 'tableActions',
actions: [
{
title: t('More'),
icon: 'search',
isPrimary: true,
action: (row) => {
quasar.dialog({
component: EntryStockBoughtDetail,
componentProps: {
workerFk: row.workerFk,
dated: userParams.value.dated,
},
});
},
},
],
},
];
const fetchDataRef = ref();
const travelDialogRef = ref(false);
const tableRef = ref();
const travel = ref(null);
const userParams = ref({
dated: Date.vnNew(),
});
const filter = ref({
fields: ['id', 'm3', 'warehouseInFk'],
include: [
{
relation: 'warehouseIn',
scope: {
fields: ['code'],
},
},
],
where: {
shipped: (userParams.value.dated
? new Date(userParams.value.dated)
: Date.vnNew()
).setHours(0, 0, 0, 0),
m3: { neq: null },
},
});
const setUserParams = async ({ dated }) => {
const shipped = (dated ? new Date(dated) : Date.vnNew()).setHours(0, 0, 0, 0);
filter.value.where.shipped = shipped;
fetchDataRef.value?.fetch();
};
function openDialog() {
travelDialogRef.value = true;
}
function setFooter(data) {
const footer = {
bought: 0,
reserve: 0,
};
data.forEach((row) => {
footer.bought += row?.bought;
footer.reserve += row?.reserve;
});
tableRef.value.footer = footer;
}
</script>
<template>
<VnSubToolbar>
<template #st-data>
<FetchData
ref="fetchDataRef"
url="Travels"
auto-load
:filter="filter"
@on-fetch="
(data) => {
travel = data.find((data) => data.warehouseIn.code === 'VNH');
}
"
/>
<VnRow class="travel">
<div v-if="travel">
<span style="color: var(--vn-label-color)">
{{ t('Booked trucks') }}:
</span>
<span>
{{ travel?.m3 }}
</span>
<QBtn
v-if="travel?.m3"
style="max-width: 20%"
flat
icon="edit"
@click="openDialog()"
:title="t('Edit travel')"
color="primary"
/>
</div>
</VnRow>
</template>
</VnSubToolbar>
<QDialog v-model="travelDialogRef" :maximized="true" :class="['vn-row', 'wrap']">
<FormModelPopup
:url-update="`Travels/${travel?.id}`"
model="travel"
:title="t('Travel m3')"
:form-initial-data="{ id: travel?.id, m3: travel?.m3 }"
@on-data-saved="fetchDataRef.fetch()"
>
<template #form-inputs="{ data }">
<VnInput
v-model="data.id"
:label="t('id')"
type="number"
disable
readonly
/>
<VnInput v-model="data.m3" :label="t('m3')" type="number" />
</template>
</FormModelPopup>
</QDialog>
<RightMenu>
<template #right-panel>
<EntryStockBoughtFilter
data-key="StockBoughts"
@set-user-params="setUserParams"
/>
</template>
</RightMenu>
<div class="table-container">
<QPage class="column items-center q-pa-md">
<VnTable
ref="tableRef"
data-key="StockBoughts"
url="StockBoughts/getStockBought"
save-url="StockBoughts/crud"
order="reserve DESC"
:right-search="false"
:is-editable="true"
@on-fetch="(data) => setFooter(data)"
:create="{
urlCreate: 'StockBoughts',
title: t('Reserve some space'),
onDataSaved: () => tableRef.reload(),
formInitialData: {
workerFk: user.id,
dated: Date.vnNow(),
},
}"
:columns="columns"
:user-params="userParams"
:footer="true"
auto-load
>
<template #column-workerFk="{ row }">
<span class="link" @click.stop>
{{ row?.worker?.user?.name }}
<WorkerDescriptorProxy :id="row?.workerFk" />
</span>
</template>
<template #column-bought="{ row }">
<span :class="{ 'text-negative': row.reserve < row.bought }">
{{ row?.bought }}
</span>
</template>
<template #column-footer-reserve>
<span>
{{ tableRef.footer.reserve }}
</span>
</template>
<template #column-footer-bought>
<span
:class="{
'text-negative':
tableRef.footer.reserve < tableRef.footer.bought,
}"
>
{{ tableRef.footer.bought }}
</span>
</template>
</VnTable>
</QPage>
</div>
</template>
<style lang="scss" scoped>
.travel {
margin-bottom: 0px;
}
.table-container {
display: flex;
justify-content: center;
}
.column {
display: flex;
flex-direction: column;
align-items: center;
width: 40%;
}
.text-negative {
color: $negative !important;
}
</style>
<i18n>
es:
Edit travel: Editar envío
Travel: Envíos
Booked trucks: Camiones reservados
Buyer: Comprador
Reserve: Reservado
Bought: Comprado
More: Más
Date: Fecha
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>

View File

@ -0,0 +1,129 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnTable from 'components/VnTable/VnTable.vue';
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
const { t } = useI18n();
const tableRef = ref();
const $props = defineProps({
workerFk: {
type: Number,
required: true,
},
dated: {
type: Date,
required: true,
},
});
const customUrl = `StockBoughts/getStockBoughtDetail?workerFk=${$props.workerFk}&date=${$props.dated}`;
const columns = [
{
align: 'left',
label: t('Entry'),
name: 'entryFk',
isTitle: true,
isId: true,
columnFilter: false,
},
{
align: 'left',
name: 'itemFk',
label: t('Item'),
columnFilter: false,
},
{
align: 'left',
label: t('Name'),
name: 'itemName',
create: true,
columnClass: 'expand',
columnFilter: false,
cardVisible: true,
},
{
align: 'left',
name: 'volume',
label: t('Volume'),
columnFilter: false,
cardVisible: true,
},
{
align: 'left',
label: t('Packaging'),
name: 'packagingFk',
columnFilter: false,
cardVisible: true,
},
{
align: 'left',
label: 'Packing',
name: 'packing',
columnFilter: false,
cardVisible: true,
},
];
</script>
<template>
<QDialog>
<div class="container">
<VnTable
ref="tableRef"
data-key="StockBoughtsDetail"
:url="customUrl"
order="itemName DESC"
:columns="columns"
:right-search="false"
:disable-infinite-scroll="true"
:limit="0"
auto-load
>
<template #top-left>
<QBtn
flat
icon="Close"
color="primary"
class="bg-vn-section-color q-pa-xs"
v-close-popup
/>
</template>
<template #column-entryFk="{ row }">
<span class="link">
{{ row?.entryFk }}
<EntryDescriptorProxy :id="row.entryFk" />
</span>
</template>
<template #column-itemName="{ row }">
<span class="link">
{{ row?.itemName }}
<ItemDescriptorProxy :id="row.itemFk" />
</span>
</template>
</VnTable>
</div>
</QDialog>
</template>
<style lang="css" scoped>
.container {
max-width: 50vw;
overflow: auto;
justify-content: center;
align-items: center;
margin: auto;
}
</style>
<i18n>
es:
Buyer: Comprador
Reserve: Reservado
Bought: Comprado
More: Más
Date: Fecha
Entry: Entrada
Item: Artículo
Name: Nombre
Volume: Volumen
Packaging: Embalage
</i18n>

View File

@ -0,0 +1,63 @@
<script setup>
import { useI18n } from 'vue-i18n';
import { onMounted } from 'vue';
import { useStateStore } from 'stores/useStateStore';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
const { t } = useI18n();
const props = defineProps({
dataKey: {
type: String,
required: true,
},
});
const stateStore = useStateStore();
const emit = defineEmits(['set-user-params']);
const setUserParams = (params) => {
emit('set-user-params', params);
};
onMounted(async () => {
stateStore.rightDrawer = true;
});
</script>
<template>
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
search-url="table"
@set-user-params="setUserParams"
>
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params }">
<QItem class="q-my-sm">
<QItemSection>
<VnInputDate
id="date"
v-model="params.dated"
:label="t('Date')"
is-outlined
/>
</QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
dated: Date
workerFk: Worker
es:
Date: Fecha
params:
dated: Date
workerFk: Trabajador
</i18n>

View File

@ -281,6 +281,7 @@ async function onSubmit() {
v-else
icon="add_circle"
round
shortcut="+"
padding="xs"
@click="setCreateDms()"
>

View File

@ -230,7 +230,7 @@ async function insert() {
</template>
</CrudModel>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn color="primary" icon="add" size="lg" round @click="insert" />
<QBtn color="primary" icon="add" shortcut="+" size="lg" round @click="insert" />
</QPageSticky>
</template>
<style lang="scss" scoped>

View File

@ -224,6 +224,7 @@ const formatOpt = (row, { model, options }, prop) => {
<QBtn
color="primary"
icon="add"
shortcut="+"
size="lg"
round
@click="invoiceInFormRef.insert()"

View File

@ -405,6 +405,7 @@ const formatOpt = (row, { model, options }, prop) => {
color="primary"
icon="add"
size="lg"
shortcut="+"
round
@click="invoiceInFormRef.insert()"
>

View File

@ -1,5 +1,6 @@
<script setup>
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
import InvoiceOutSummary from './InvoiceOutSummary.vue';
const $props = defineProps({
id: {
@ -10,6 +11,10 @@ const $props = defineProps({
</script>
<template>
<QPopupProxy>
<InvoiceOutDescriptor v-if="$props.id" :id="$props.id" />
<InvoiceOutDescriptor
v-if="$props.id"
:id="$props.id"
:summary="InvoiceOutSummary"
/>
</QPopupProxy>
</template>

View File

@ -177,7 +177,7 @@ watchEffect(selectedRows);
<VnSearchbar
:info="t('youCanSearchByInvoiceReference')"
:label="t('searchInvoice')"
data-key="InvoiceOutList"
data-key="invoiceOut"
/>
<VnSubToolbar>
<template #st-actions>

View File

@ -65,17 +65,18 @@ const focusLastInput = () => {
</QTooltip>
</QIcon>
</div>
<QIcon
<QBtn
@click="insertRow()"
class="cursor-pointer fill-icon-on-hover"
color="primary"
name="add_circle"
size="sm"
icon="add_circle"
shortcut="+"
flat
>
<QTooltip>
{{ t('Add barcode') }}
</QTooltip>
</QIcon>
</QBtn>
</QCard>
</template>
</CrudModel>

View File

@ -12,7 +12,7 @@ import ItemListFilter from '../ItemListFilter.vue';
search-data-key="ItemList"
:searchbar-props="{
url: 'Items/filter',
label: 'searchbar.labelr',
label: 'searchbar.label',
info: 'searchbar.info',
}"
/>

View File

@ -11,7 +11,6 @@ import VnConfirm from 'components/ui/VnConfirm.vue';
import RegularizeStockForm from 'components/RegularizeStockForm.vue';
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
import useCardDescription from 'src/composables/useCardDescription';
import { getUrl } from 'src/composables/getUrl';
import axios from 'axios';
import { dashIfEmpty } from 'src/filters';
@ -51,10 +50,8 @@ const entityId = computed(() => {
const regularizeStockFormDialog = ref(null);
const available = ref(null);
const visible = ref(null);
const salixUrl = ref();
onMounted(async () => {
salixUrl.value = await getUrl('');
await getItemConfigs();
await updateStock();
});
@ -200,16 +197,11 @@ const openCloneDialog = async () => {
<template #actions="{}">
<QCardActions class="row justify-center">
<QBtn
:href="
salixUrl +
'item/' +
entityId +
'/diary?' +
'warehouseFk=' +
warehouseFk +
'&lineFk=' +
$props.saleFk
"
:to="{
name: 'ItemDiary',
params: { id: entityId },
query: { warehouseFk, lineFk: $props.saleFk },
}"
size="md"
icon="vn:transaction"
color="primary"

View File

@ -168,19 +168,20 @@ const insertTag = (rows) => {
</div>
</VnRow>
<VnRow class="justify-center items-center">
<QIcon
<QBtn
@click="insertTag(rows)"
class="cursor-pointer"
:disable="!validRow"
color="primary"
name="add"
size="sm"
flat
icon="add"
shortcut="+"
style="flex: 0"
>
<QTooltip>
{{ t('itemTags.addTag') }}
</QTooltip>
</QIcon>
</QBtn>
</VnRow>
</QCard>
</template>

View File

@ -36,23 +36,23 @@ const user = state.getUser();
const fixedPrices = ref([]);
const warehousesOptions = ref([]);
const rowsSelected = ref([]);
const itemFixedPriceFilterRef = ref();
const params = reactive({});
const defaultColumnAttrs = {
align: 'left',
sortable: true,
};
onMounted(async () => {
stateStore.rightDrawer = true;
params.warehouseFk = user.value.warehouseFk;
});
onUnmounted(() => (stateStore.rightDrawer = false));
const defaultColumnAttrs = {
align: 'left',
sortable: true,
};
const columns = computed(() => [
{
label: t('item.fixedPrice.itemId'),
name: 'itemId',
label: t('item.fixedPrice.itemFk'),
name: 'itemFk',
...defaultColumnAttrs,
isId: true,
cardVisible: true,
@ -426,7 +426,7 @@ function handleOnDataSave({ CrudModelRef }) {
:default-save="false"
data-key="ItemFixedPrices"
url="FixedPrices/filter"
:order="['itemFk ASC']"
:order="['description DESC']"
save-url="FixedPrices/crud"
:user-params="{ warehouseFk: user.warehouseFk }"
ref="tableRef"
@ -460,7 +460,7 @@ function handleOnDataSave({ CrudModelRef }) {
<QCheckbox flat v-model="scope.selected" />
</template>
<template #column-itemId="props">
<template #column-itemFk="props">
<VnSelect
style="max-width: 100px"
url="Items/withName"

View File

@ -212,6 +212,7 @@ const decrement = (paramsObj, key) => {
flat
dense
size="12px"
shortcut="+"
@click="add(params, 'scopeDays')"
/>
<QBtn

View File

@ -139,7 +139,11 @@ const columns = computed(() => [
</VnTable>
</template>
<style lang="scss" scoped>
.full-width .vn-row > * {
flex: 0.4;
.full-width .vn-row {
margin-bottom: 0;
flex-direction: row;
> * {
max-width: 125px;
}
}
</style>

View File

@ -132,7 +132,6 @@ const openTab = (id) =>
:table="{
'row-key': 'id',
selection: 'multiple',
'hide-bottom': true,
}"
default-mode="table"
:row-click="({ id }) => openTab(id)"

View File

@ -11,7 +11,7 @@ import FetchData from 'src/components/FetchData.vue';
import { dateRange } from 'src/filters';
defineProps({ dataKey: { type: String, required: true } });
const { t } = useI18n();
const { t, te } = useI18n();
const warehouses = ref();
const groupedStates = ref();
@ -26,6 +26,12 @@ const handleScopeDays = (params, days, callback) => {
}
if (callback) callback();
};
const getLocale = (label) => {
const param = label.split('.').at(-1);
const globalLocale = `globals.params.${param}`;
return te(globalLocale) ? t(globalLocale) : t(`params.${param}`);
};
</script>
<template>
<FetchData url="Warehouses" auto-load @on-fetch="(data) => (warehouses = data)" />
@ -43,10 +49,11 @@ const handleScopeDays = (params, days, callback) => {
:hidden-tags="['from', 'to', 'search']"
:custom-tags="['scopeDays']"
:unremovable-params="['from', 'to', 'scopeDays']"
search-url="saleMonitorTickets"
>
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong v-text="`${t(`params.${tag.label}`)}:`" />
<strong v-text="`${getLocale(tag.label)}:`" />
<span v-text="formatFn(tag.value)" />
</div>
</template>
@ -110,7 +117,7 @@ const handleScopeDays = (params, days, callback) => {
url="Workers/search"
:params="{ departmentCodes: ['VT'] }"
is-outlined
option-value="code"
option-value="id"
option-label="name"
:no-one="true"
>

View File

@ -54,7 +54,6 @@ const columns = computed(() => [
label: t('salesTicketsTable.problems'),
name: 'totalProblems',
align: 'left',
columnFilter: false,
attrs: {
dense: true,
@ -65,7 +64,6 @@ const columns = computed(() => [
name: 'id',
field: 'id',
align: 'left',
columnFilter: {
component: 'number',
name: 'id',
@ -108,9 +106,7 @@ const columns = computed(() => [
{
label: t('salesTicketsTable.date'),
name: 'shippedDate',
style: { 'max-width': '100px' },
align: 'left',
columnFilter: {
component: 'date',
name: 'shippedDate',
@ -164,7 +160,6 @@ const columns = computed(() => [
label: t('salesTicketsTable.state'),
name: 'state',
align: 'left',
style: { 'max-width': '100px' },
columnFilter: {
component: 'select',
name: 'stateFk',
@ -193,7 +188,6 @@ const columns = computed(() => [
label: t('salesTicketsTable.zone'),
name: 'zoneFk',
align: 'left',
columnFilter: {
component: 'select',
name: 'zoneFk',
@ -210,8 +204,6 @@ const columns = computed(() => [
name: 'totalWithVat',
field: 'totalWithVat',
align: 'left',
style: { 'max-width': '75px' },
columnFilter: {
component: 'number',
name: 'totalWithVat',
@ -370,7 +362,7 @@ const openTab = (id) =>
</QCheckbox>
</template>
<template #column-totalProblems="{ row }">
<QTd class="no-padding" style="max-width: 60px">
<span>
<QIcon
v-if="row.isTaxDataChecked === 0"
name="vn:no036"
@ -424,30 +416,27 @@ const openTab = (id) =>
>
<QTooltip>{{ $t('salesTicketsTable.tooLittle') }}</QTooltip>
</QIcon>
</QTd>
</span>
</template>
<template #column-id="{ row }">
<QTd class="no-padding">
<span class="link" @click.stop.prevent>
{{ row.id }}
<TicketDescriptorProxy :id="row.id" />
</span>
</QTd>
</template>
<template #column-clientFk="{ row }">
<QTd class="no-padding" @click.stop :title="row.nickname">
<span class="link">{{ row.nickname }}</span>
<div @click.stop :title="row.nickname">
<span class="link" v-text="row.nickname" />
<CustomerDescriptorProxy :id="row.clientFk" />
</QTd>
</div>
</template>
<template #column-salesPersonFk="{ row }">
<QTd class="no-padding" @click.stop :title="row.userName">
<div @click.stop :title="row.userName">
<span class="link" v-text="dashIfEmpty(row.userName)" />
<WorkerDescriptorProxy :id="row.salesPersonFk" />
</QTd>
</div>
</template>
<template #column-shippedDate="{ row }">
<QTd class="no-padding">
<QBadge
v-bind="getBadgeAttrs(row.shippedDate)"
class="q-pa-sm"
@ -455,15 +444,12 @@ const openTab = (id) =>
>
{{ formatShippedDate(row.shippedDate) }}
</QBadge>
</QTd>
</template>
<template #column-provinceFk="{ row }">
<QTd class="no-padding">
<span :title="row.province" v-text="row.province" />
</QTd>
</template>
<template #column-state="{ row }">
<QTd class="no-padding" @click.stop.prevent>
<div @click.stop.prevent>
<div v-if="row.refFk">
<span class="link">{{ row.refFk }}</span>
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
@ -477,23 +463,20 @@ const openTab = (id) =>
>
{{ row.state }}
</QBadge>
</QTd>
</div>
</template>
<template #column-isFragile="{ row }">
<QTd class="no-padding">
<QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm">
<QTooltip>{{ $t('salesTicketsTable.isFragile') }}</QTooltip>
</QIcon>
</QTd>
</template>
<template #column-zoneFk="{ row }">
<QTd class="no-padding" @click.stop.prevent :title="row.zoneName">
<div @click.stop.prevent :title="row.zoneName">
<span class="link">{{ row.zoneName }}</span>
<ZoneDescriptorProxy :id="row.zoneFk" />
</QTd>
</div>
</template>
<template #column-totalWithVat="{ row }">
<QTd class="no-padding">
<QBadge
:color="totalPriceColor(row) || 'transparent'"
:text-color="totalPriceColor(row) ? 'black' : 'white'"
@ -502,7 +485,11 @@ const openTab = (id) =>
>
{{ toCurrency(row.totalWithVat) }}
</QBadge>
</QTd>
</template>
</VnTable>
</template>
<style lang="scss" scoped>
td .q-icon {
margin: 0 2px;
}
</style>

View File

@ -374,8 +374,10 @@ function addOrder(value, field, params) {
/>
</QItem>
<QItem class="q-mt-lg">
<QIcon
name="add_circle"
<QBtn
icon="add_circle"
shortcut="+"
flat
class="filter-icon"
@click="tagValues.push({})"
/>

View File

@ -249,7 +249,7 @@ watch(
@on-fetch="(data) => (orderSummary.vat = data)"
auto-load
/>
<QDrawer side="right" :width="270" v-model="stateStore.rightDrawer">
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<QCard
class="order-lines-summary q-pa-lg"
v-if="orderSummary.vat && orderSummary.total"

View File

@ -14,14 +14,15 @@ import OrderFilter from './Card/OrderFilter.vue';
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
import { toDateTimeFormat } from 'src/filters/date';
import { onMounted } from 'vue';
import { useRoute } from 'vue-router';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const tableRef = ref();
const agencyList = ref([]);
const addressesList = ref([]);
const clientId = ref();
const route = useRoute();
const columns = computed(() => [
{
align: 'left',
@ -169,6 +170,13 @@ const getDateColor = (date) => {
if (comparation == 0) return 'bg-warning';
if (comparation < 0) return 'bg-success';
};
onMounted(() => {
if (!route.query.createForm) return;
const clientId = route.query.createForm;
const id = JSON.parse(clientId);
fetchClientAddress(id.clientFk, id);
});
</script>
<template>
<OrderSearchbar />
@ -184,13 +192,14 @@ const getDateColor = (date) => {
:order="['landed DESC', 'clientFk ASC', 'id DESC']"
:create="{
urlCreate: 'Orders/new',
title: 'Create Order',
title: t('module.cerateOrder'),
onDataSaved: (url) => {
tableRef.redirect(url);
},
formInitialData: {
active: true,
addressId: null,
clientFk: null,
},
}"
:user-params="{ showEmpty: false }"
@ -221,7 +230,7 @@ const getDateColor = (date) => {
<VnSelect
url="Clients"
:include="{ relation: 'addresses' }"
v-model="clientId"
v-model="data.clientFk"
:label="t('module.customer')"
@update:model-value="(id) => fetchClientAddress(id, data)"
/>

View File

@ -10,6 +10,7 @@ module:
total: Total
salesPerson: Sales Person
address: Address
cerateOrder: Create order
lines:
item: Item
warehouse: Warehouse

View File

@ -10,6 +10,7 @@ module:
total: Total
salesPerson: Comercial
address: Dirección
cerateOrder: Crear cesta
lines:
item: Artículo
warehouse: Almacén

View File

@ -88,7 +88,7 @@ async function deleteWorCenter(id) {
</VnPaginate>
</div>
<QPageSticky :offset="[18, 18]">
<QBtn @click.stop="dialog.show()" color="primary" fab icon="add">
<QBtn @click.stop="dialog.show()" color="primary" fab shortcut="+" icon="add">
<QDialog ref="dialog">
<FormModelPopup
:title="t('Add work center')"

View File

@ -3,7 +3,6 @@ import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
</script>
<template>
<VnSearchbar
data-key="RouteList"

View File

@ -103,8 +103,8 @@ es:
Roadmap: Troncal
ETD date: Fecha ETD
ETD hour: Hora ETD
Tractor plate: Matrícula tractor
Trailer plate: Matrícula trailer
Tractor plate: Matrícula tractora
Trailer plate: Matrícula remolque
Carrier: Transportista
Price: Precio
Driver name: Nombre del conductor

View File

@ -164,8 +164,8 @@ en:
to: To
es:
params:
tractorPlate: Matrícula del tractor
trailerPlate: Matrícula del trailer
tractorPlate: Matrícula tractora
trailerPlate: Matrícula remolque
supplierFk: Transportista
price: Precio
driverName: Nombre del conductor
@ -174,8 +174,8 @@ es:
to: Hasta
From: Desde
To: Hasta
Tractor Plate: Matrícula del tractor
Trailer Plate: Matrícula del trailer
Tractor Plate: Matrícula tractora
Trailer Plate: Matrícula remolque
Carrier: Transportista
Price: Precio
Driver name: Nombre del conductor

View File

@ -65,9 +65,10 @@ const updateDefaultStop = (data) => {
</div>
</QCardSection>
<QCardSection>
<QIcon
name="add"
size="sm"
<QBtn
flat
icon="add"
shortcut="+"
class="cursor-pointer"
color="primary"
@click="roadmapStopsCrudRef.insert()"
@ -75,7 +76,7 @@ const updateDefaultStop = (data) => {
<QTooltip>
{{ t('Add stop') }}
</QTooltip>
</QIcon>
</QBtn>
</QCardSection>
</QCard>
</template>

View File

@ -149,8 +149,8 @@ const filter = {
<i18n>
es:
Carrier: Transportista
Tractor Plate: Matrícula tractor
Trailer Plate: Matrícula trailer
Tractor Plate: Matrícula tractora
Trailer Plate: Matrícula remolque
Phone: Teléfono
Worker: Trabajador
Observations: Observaciones

View File

@ -237,4 +237,5 @@ es:
Price: Precio
Observations: Observaciones
Preview: Vista previa
Select the estimated date of departure (ETD): Selecciona la fecha estimada de salida
</i18n>

View File

@ -396,7 +396,7 @@ const openSmsDialog = async () => {
</VnPaginate>
</div>
<QPageSticky :offset="[20, 20]">
<QBtn fab icon="add" color="primary" @click="openTicketsDialog">
<QBtn fab icon="add" shortcut="+" color="primary" @click="openTicketsDialog">
<QTooltip>
{{ t('Add ticket') }}
</QTooltip>

View File

@ -102,9 +102,7 @@ const setWireTransfer = async () => {
<VnInput :label="t('supplier.accounts.iban')" v-model="row.iban">
<template #append>
<QIcon name="info" class="cursor-info">
<QTooltip>{{
t('components.iban_tooltip')
}}</QTooltip>
<QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
</QIcon>
</template>
</VnInput>
@ -165,9 +163,10 @@ const setWireTransfer = async () => {
</div>
</VnRow>
<VnRow>
<QIcon
name="add"
size="sm"
<QBtn
flat
icon="add"
shortcut="+"
class="cursor-pointer"
color="primary"
@click="supplierAccountRef.insert()"
@ -175,7 +174,7 @@ const setWireTransfer = async () => {
<QTooltip>
{{ t('Add account') }}
</QTooltip>
</QIcon>
</QBtn>
</VnRow>
</QCard>
</template>

View File

@ -26,7 +26,13 @@ const addressesFilter = {
{
relation: 'province',
scope: {
fields: ['id', 'name'],
fields: ['id', 'name', 'countryFk'],
include: [
{
relation: 'country',
scope: { fields: ['id', 'name'] },
},
],
},
},
],

View File

@ -21,6 +21,7 @@ const newAddressForm = reactive({
provinceFk: null,
phone: null,
mobile: null,
province: null,
});
const onDataSaved = () => {
@ -84,7 +85,16 @@ function handleLocation(data, location) {
<VnLocation
:rules="validate('Worker.postcode')"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
v-model="data.location"
:location="
data.postalCode
? {
postcode: data.postalCode,
city: data.city,
province: data.province,
country: data.province.country,
}
: null
"
@update:model-value="(location) => handleLocation(data, location)"
>
</VnLocation>

View File

@ -84,9 +84,10 @@ const insertRow = () => {
</VnRow>
</QCardSection>
<VnRow>
<QIcon
name="add"
size="sm"
<QBtn
flat
icon="add"
shortcut="+"
class="cursor-pointer"
color="primary"
@click="insertRow()"
@ -94,7 +95,7 @@ const insertRow = () => {
<QTooltip>
{{ t('Add contact') }}
</QTooltip>
</QIcon>
</QBtn>
</VnRow>
</QCard>
</template>

View File

@ -109,7 +109,7 @@ const getEntryQueryParams = (supplier) => {
:subtitle="data.subtitle"
:filter="filter"
@on-fetch="setData"
data-key="supplier"
data-key="supplierDescriptor"
:summary="$props.summary"
>
<template #body="{ entity }">

View File

@ -51,6 +51,23 @@ function handleLocation(data, location) {
:url="`Suppliers/${route.params.id}`"
:url-update="`Suppliers/${route.params.id}/updateFiscalData`"
model="supplier"
:filter="{
fields: ['id', 'name', 'city', 'postCode', 'countryFk', 'provinceFk'],
include: [
{
relation: 'province',
scope: {
fields: ['id', 'name'],
},
},
{
relation: 'country',
scope: {
fields: ['id', 'name'],
},
},
],
}"
auto-load
:clear-store-on-unmount="false"
>
@ -130,7 +147,12 @@ function handleLocation(data, location) {
<VnLocation
:rules="validate('Worker.postcode')"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
v-model="data.postCode"
:location="{
postcode: data.postCode,
city: data.city,
province: data.province,
country: data.country,
}"
@update:model-value="(location) => handleLocation(data, location)"
>
</VnLocation>

View File

@ -75,6 +75,19 @@ const columns = computed(() => [
},
visible: false,
},
{
align: 'left',
label: t('supplier.list.tableVisibleColumns.country'),
name: 'country',
columnFilter: {
component: 'select',
name: 'countryFk',
attrs: {
url: 'countries',
fields: ['id', 'name'],
},
},
},
]);
</script>

View File

@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import FetchData from 'components/FetchData.vue';
import { useStateStore } from 'stores/useStateStore';
@ -115,7 +114,7 @@ const totalNewPrice = computed(() => {
const totalDifference = computed(() => {
return rows.value.reduce((acc, item) => acc + item.component?.difference || 0, 0);
});
const showMovablecolumn = computed(() => (haveDifferences.value > 0 ? ['movable'] : []));
const showMovableColumn = computed(() => (haveDifferences.value > 0 ? ['movable'] : []));
const haveDifferences = computed(() => _ticketData.value.sale?.haveDifferences);
const ticketHaveNegatives = () => {
let _haveNegatives = false;
@ -145,8 +144,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
@on-fetch="(data) => (ticketUpdateActions = data)"
auto-load
/>
<RightMenu>
<template #right-panel>
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<QCard
class="q-pa-md q-mb-md q-ma-md color-vn-text"
bordered
@ -158,18 +156,18 @@ onUnmounted(() => (stateStore.rightDrawer = false));
{{ t('basicData.total') }}
</span>
</QCardSection>
<QCardSection class="column items-center" horizontal>
<QCardSection class="column items-left" horizontal>
<span>
{{ t('basicData.price') }}:
{{ toCurrency(totalPrice) }}
</span>
</QCardSection>
<QCardSection class="column items-center" horizontal>
<QCardSection class="column items-left" horizontal>
<span>
{{ t('basicData.newPrice') }}: {{ toCurrency(totalNewPrice) }}
</span>
</QCardSection>
<QCardSection class="column items-center" horizontal>
<QCardSection class="column items-left" horizontal>
<span>
{{ t('basicData.difference') }}: {{ toCurrency(totalDifference) }}
</span>
@ -220,10 +218,9 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</QIcon>
</QCardSection>
</QCard>
</template>
</RightMenu>
</QDrawer>
<QTable
:visible-columns="showMovablecolumn"
:visible-columns="showMovableColumn"
:rows="rows"
:columns="columns"
row-key="id"
@ -233,15 +230,15 @@ onUnmounted(() => (stateStore.rightDrawer = false));
flat
>
<template #body-cell-item="{ row }">
<QTd>
<QBtn flat color="primary">
<QTd @click.stop class="link">
<QBtn flat>
{{ row.itemFk }}
<ItemDescriptorProxy :id="row.itemFk" />
</QBtn>
</QTd>
</template>
<template #body-cell-description="{ row }">
<QTd>
<QTd style="display: contents">
<div class="column">
<span>{{ row.item.name }}</span>
<span class="color-vn-label">{{ row.item.subName }}</span>

View File

@ -12,6 +12,7 @@ import VnInputTime from 'components/common/VnInputTime.vue';
import axios from 'axios';
import useNotify from 'src/composables/useNotify.js';
import { useValidator } from 'src/composables/useValidator';
import { toTimeFormat } from 'filters/date.js';
const $props = defineProps({
@ -23,7 +24,7 @@ const $props = defineProps({
});
const emit = defineEmits(['updateForm']);
const { validate } = useValidator();
const { notify } = useNotify();
const router = useRouter();
const { t } = useI18n();
@ -51,18 +52,18 @@ const agencyByWarehouseFilter = computed(() => ({
},
}));
const zonesFilter = computed(() => ({
fields: ['id', 'name'],
order: 'name ASC',
where: formData.value?.agencyModeFk
function zoneWhere() {
if (formData?.value?.agencyModeFk) {
return formData.value?.agencyModeFk
? {
shipped: formData.value?.shipped,
addressFk: formData.value?.addressFk,
agencyModeFk: formData.value?.agencyModeFk,
warehouseFk: formData.value?.warehouseFk,
}
: {},
}));
: {};
}
}
const getLanded = async (params) => {
try {
@ -293,13 +294,6 @@ onMounted(() => onFormModelInit());
@on-fetch="(data) => (agenciesOptions = data)"
auto-load
/>
<FetchData
ref="zonesFetchRef"
url="Zones/includingExpired"
:filter="zonesFilter"
@on-fetch="(data) => (zonesOptions = data)"
auto-load
/>
<QForm>
<VnRow>
<VnSelect
@ -313,6 +307,7 @@ onMounted(() => onFormModelInit());
hide-selected
map-options
:required="true"
:rules="validate('basicData.client')"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
@ -333,6 +328,7 @@ onMounted(() => onFormModelInit());
hide-selected
map-options
:required="true"
:rules="validate('basicData.warehouse')"
/>
</VnRow>
<VnRow>
@ -345,6 +341,7 @@ onMounted(() => onFormModelInit());
hide-selected
map-options
:required="true"
:rules="validate('basicData.address')"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
@ -392,6 +389,7 @@ onMounted(() => onFormModelInit());
:label="t('basicData.alias')"
v-model="formData.nickname"
:required="true"
:rules="validate('basicData.alias')"
/>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md no-wrap">
@ -404,6 +402,7 @@ onMounted(() => onFormModelInit());
hide-selected
map-options
:required="true"
:rules="validate('basicData.company')"
/>
<VnSelect
:label="t('basicData.agency')"
@ -414,17 +413,22 @@ onMounted(() => onFormModelInit());
hide-selected
map-options
@focus="agencyFetchRef.fetch()"
:rules="validate('basicData.agency')"
/>
<VnSelect
:label="t('basicData.zone')"
v-model="zoneId"
option-value="id"
option-label="name"
:options="zonesOptions"
url="Zones/includingExpired"
:fields="['id', 'name']"
sort-by="id"
:where="zoneWhere"
hide-selected
map-options
:required="true"
@focus="zonesFetchRef.fetch()"
:rules="validate('basicData.zone')"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
@ -444,16 +448,19 @@ onMounted(() => onFormModelInit());
:label="t('basicData.shipped')"
v-model="formData.shipped"
:required="true"
:rules="validate('basicData.shipped')"
/>
<VnInputTime
:label="t('basicData.shippedHour')"
v-model="formData.shipped"
:required="true"
:rules="validate('basicData.shippedHour')"
/>
<VnInputDate
:label="t('basicData.landed')"
v-model="formData.landed"
:required="true"
:rules="validate('basicData.landed')"
/>
</VnRow>
</QForm>

View File

@ -3,7 +3,7 @@ import { ref, onBeforeMount } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
import BasicDataTable from './BasicDataTable.vue';
import TicketBasicData from './TicketBasicData.vue';
import TicketBasicDataForm from './TicketBasicDataForm.vue';
import { useVnConfirm } from 'composables/useVnConfirm';
@ -158,7 +158,10 @@ onBeforeMount(async () => await getTicketData());
color="primary"
animated
keep-alive
style="max-width: 800px; margin: auto"
style="margin: auto"
:style="{
'max-width': step > 1 ? 'none' : '800px',
}"
>
<QStep :name="1" :title="t('globals.pageTitles.basicData')" :done="step > 1">
<TicketBasicDataForm
@ -168,7 +171,7 @@ onBeforeMount(async () => await getTicketData());
/>
</QStep>
<QStep :name="2" :title="t('basicData.priceDifference')">
<BasicDataTable
<TicketBasicData
:form-data="formData"
v-model:haveNegatives="haveNegatives"
@update-form="($event) => (formData = $event)"

View File

@ -31,6 +31,7 @@ const router = useRouter();
const { notify } = useNotify();
const newTicketFormData = reactive({});
const date = new Date();
const createTicket = async () => {
try {
@ -64,7 +65,11 @@ const createTicket = async () => {
>
<template #form-inputs="{ data }">
<VnRow>
<VnInputDate :label="t('expedition.landed')" v-model="data.landed" />
<VnInputDate
:label="t('expedition.landed')"
v-model="data.landed"
:model-value="date"
/>
</VnRow>
<VnRow>
<VnInput

View File

@ -5,15 +5,16 @@ import { useRoute } from 'vue-router';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import FetchData from 'components/FetchData.vue';
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import VnImg from 'src/components/ui/VnImg.vue';
import { useStateStore } from 'stores/useStateStore';
import { dashIfEmpty } from 'src/filters';
import { useArrayData } from 'composables/useArrayData';
import { toCurrency } from 'filters/index';
import axios from 'axios';
import VnTable from 'src/components/VnTable/VnTable.vue';
const route = useRoute();
const stateStore = useStateStore();
@ -75,22 +76,39 @@ const columns = computed(() => [
name: 'item',
align: 'left',
},
{
align: 'left',
label: t('lines.image'),
name: 'image',
columnField: {
component: VnImg,
attrs: (id) => {
return {
id,
width: '50px',
};
},
},
columnFilter: false,
},
{
label: t('ticketComponents.description'),
name: 'description',
align: 'left',
columnClass: 'expand',
},
{
label: t('ticketComponents.quantity'),
name: 'quantity',
field: 'quantity',
align: 'left',
format: (val) => dashIfEmpty(val),
format: (row) => dashIfEmpty(row.quantity),
},
{
label: t('ticketComponents.serie'),
name: 'serie',
align: 'left',
format: (row) => dashIfEmpty(row.serie),
},
{
label: t('ticketComponents.components'),
@ -174,14 +192,8 @@ onUnmounted(() => (stateStore.rightDrawer = false));
@on-fetch="(data) => (components = data)"
auto-load
/>
<RightMenu>
<template #right-panel>
<QCard
class="q-pa-sm color-vn-text"
bordered
flat
style="border-color: black"
>
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
<QCardSection horizontal>
<span class="text-weight-bold text-subtitle1 text-center full-width">
{{ t('ticketComponents.total') }}
@ -200,12 +212,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
<span>{{ toCurrency(getTotal) }}</span>
</QCardSection>
</QCard>
<QCard
class="q-pa-sm color-vn-text"
bordered
flat
style="border-color: black"
>
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
<QCardSection horizontal>
<span class="text-weight-bold text-subtitle1 text-center full-width">
{{ t('ticketComponents.components') }}
@ -224,12 +231,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
}}</span>
</QCardSection>
</QCard>
<QCard
class="q-pa-sm color-vn-text"
bordered
flat
style="border-color: black"
>
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
<QCardSection horizontal>
<span class="text-weight-bold text-subtitle1 text-center full-width">
{{ t('ticketComponents.zoneBreakdown') }}
@ -269,12 +271,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
<span>{{ dashIfEmpty(ticketData?.packages) }}</span>
</QCardSection>
</QCard>
<QCard
class="q-pa-sm color-vn-text"
bordered
flat
style="border-color: black"
>
<QCard class="q-pa-sm color-vn-text" bordered flat style="border-color: black">
<QCardSection horizontal>
<span class="text-weight-bold text-subtitle1 text-center full-width">
{{ t('ticketComponents.theoricalCost') }}
@ -287,68 +284,74 @@ onUnmounted(() => (stateStore.rightDrawer = false));
<span>{{ toCurrency(theoricalCost, 'EUR', 2) }}</span>
</QCardSection>
</QCard>
</template>
</RightMenu>
<QTable
:rows="components"
</QDrawer>
<VnTable
ref="tableRef"
data-key="TicketComponents"
url="Sales"
:user-filter="salesFilter"
:columns="columns"
row-key="id"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md"
:no-data-label="t('globals.noResults')"
:right-search="false"
auto-load
:disable-option="{ card: true }"
:column-search="false"
>
<template #body-cell-item="{ row }">
<QTd>
<QBtn flat color="primary">
<span class="link">{{ row.itemFk }}</span>
<template #column-item="{ row }">
<span @click.stop flat class="link">
{{ row.itemFk }}
<ItemDescriptorProxy :id="row.itemFk" />
</QBtn>
</QTd>
</span>
</template>
<template #body-cell-description="{ row }">
<QTd>
<template #column-image="{ row }">
<div class="image-wrapper">
<VnImg :id="parseInt(row?.item?.id)" class="rounded" />
</div>
</template>
<template #column-description="{ row }">
<div class="column">
<span>{{ row.item.name }}</span>
<span class="color-vn-label">{{ row.item.subName }}</span>
<FetchedTags :item="row.item" />
</div>
</QTd>
</template>
<template #body-cell-serie="{ row }">
<QTd>
<template #column-serie="{ row }">
<div class="column">
<span v-for="(saleComponent, index) in row.components" :key="index">
{{ saleComponent.component?.componentType?.name }}
</span>
</div>
</QTd>
</template>
<template #body-cell-components="{ row }">
<QTd>
<template #column-components="{ row }">
<div class="column">
<span v-for="(saleComponent, index) in row.components" :key="index">
{{ saleComponent.component?.name }}
</span>
</div>
</QTd>
</template>
<template #body-cell-import="{ row }">
<QTd>
<div class="column text-right">
<template #column-import="{ row }">
<div class="column text-left">
<span v-for="(saleComponent, index) in row.components" :key="index">
{{ toCurrency(saleComponent.value, 'EUR', 3) }}
</span>
</div>
</QTd>
</template>
<template #body-cell-total="{ row }">
<QTd>
<div class="column text-right">
<template #column-total="{ row }">
<div class="column">
<span v-for="(saleComponent, index) in row.components" :key="index">
{{ toCurrency(saleComponent.value * row.quantity, 'EUR', 3) }}
<!-- <QTooltip>
{{ saleComponent.component?.name }}:
{{ toCurrency(saleComponent.value, 'EUR', 3) }}
</QTooltip> -->
</span>
</div>
</QTd>
</template>
</QTable>
</VnTable>
</template>
<style lang="scss" scoped>
.image-wrapper {
width: 40px;
height: 40px;
}
</style>

View File

@ -2,13 +2,13 @@
import { ref, computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { toDate } from 'src/filters';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import useCardDescription from 'src/composables/useCardDescription';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import { toDateTimeFormat } from 'src/filters/date';
const $props = defineProps({
id: {
@ -30,13 +30,24 @@ const filter = {
{
relation: 'address',
scope: {
fields: ['id', 'name', 'mobile', 'phone'],
fields: ['id', 'name', 'mobile', 'phone', 'incotermsFk'],
},
},
{
relation: 'client',
scope: {
fields: ['id', 'name', 'salesPersonFk', 'phone', 'mobile', 'email'],
fields: [
'id',
'name',
'salesPersonFk',
'phone',
'mobile',
'email',
'isActive',
'isFreezed',
'isTaxDataChecked',
'hasElectronicInvoice',
],
include: [
{
relation: 'user',
@ -87,6 +98,10 @@ const filter = {
};
const data = ref(useCardDescription());
function ticketFilter(ticket) {
return JSON.stringify({ clientFk: ticket.clientFk });
}
</script>
<template>
@ -128,7 +143,10 @@ const data = ref(useCardDescription());
/>
</template>
</VnLv>
<VnLv :label="t('ticket.card.shipped')" :value="toDate(entity.shipped)" />
<VnLv
:label="t('ticket.card.shipped')"
:value="toDateTimeFormat(entity.shipped)"
/>
<VnLv
v-if="entity.agencyMode"
:label="t('ticket.card.agency')"
@ -138,7 +156,39 @@ const data = ref(useCardDescription());
<VnLv :label="t('ticket.card.alias')" :value="entity.nickname" />
</template>
<template #icons="{ entity }">
<QCardActions>
<QCardActions class="q-gutter-x-xs">
<QIcon
v-if="entity.client.isActive == false"
name="vn:disabled"
size="xs"
color="primary"
>
<QTooltip>{{ t('Client inactive') }}</QTooltip>
</QIcon>
<QIcon
v-if="entity.client.isFreezed == true"
name="vn:frozen"
size="xs"
color="primary"
>
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
</QIcon>
<QIcon
v-if="entity.problem.includes('hasRisk')"
name="vn:risk"
size="xs"
color="primary"
>
<QTooltip>{{ t('Client has debt') }}</QTooltip>
</QIcon>
<QIcon
v-if="entity.client.isTaxDataChecked == false"
name="vn:no036"
size="xs"
color="primary"
>
<QTooltip>{{ t('Client not checked') }}</QTooltip>
</QIcon>
<QIcon
v-if="entity.isDeleted == true"
name="vn:deletedTicket"
@ -159,6 +209,27 @@ const data = ref(useCardDescription());
>
<QTooltip>{{ t('ticket.card.customerCard') }}</QTooltip>
</QBtn>
<QBtn
size="md"
icon="vn:ticket"
color="primary"
:to="{ name: 'TicketList', query: { table: ticketFilter(entity) } }"
>
<QTooltip>{{ t('ticket.card.ticketList') }}</QTooltip>
</QBtn>
<QBtn
size="md"
icon="vn:basketadd"
color="primary"
:to="{
name: 'OrderList',
query: {
createForm: JSON.stringify({ clientFk: entity.clientFk }),
},
}"
>
<QTooltip>{{ t('ticket.card.newOrder') }}</QTooltip>
</QBtn>
</QCardActions>
</template>
</CardDescriptor>
@ -168,4 +239,8 @@ const data = ref(useCardDescription());
es:
This ticket is deleted: Este ticket está eliminado
Go to module index: Ir al índice del modulo
Client inactive: Cliente inactivo
Client not checked: Cliente no verificado
Client has debt: Cliente con deuda
Client Frozen: Cliente congelado
</i18n>

View File

@ -1,6 +1,6 @@
<script setup>
import axios from 'axios';
import { ref } from 'vue';
import { ref, toRefs } from 'vue';
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
@ -9,6 +9,11 @@ import SendEmailDialog from 'components/common/SendEmailDialog.vue';
import VnConfirm from 'components/ui/VnConfirm.vue';
import VnSmsDialog from 'components/common/VnSmsDialog.vue';
import toDate from 'filters/toDate';
import FormPopup from 'components/FormPopup.vue';
import VnSelect from 'components/common/VnSelect.vue';
import FetchData from 'components/FetchData.vue';
import VnInputTime from 'src/components/common/VnInputTime.vue';
import { useAcl } from 'src/composables/useAcl';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import { useArrayData } from 'src/composables/useArrayData';
@ -24,8 +29,16 @@ const { dialog, notify } = useQuasar();
const { t } = useI18n();
const { openReport, sendEmail } = usePrintService();
const ticketSummary = useArrayData('TicketSummary');
const ticket = ref(props.ticket);
const { ticket } = toRefs(props);
const ticketId = currentRoute.value.params.id;
const client = ref();
const showTransferDialog = ref(false);
const showTurnDialog = ref(false);
const showChangeTimeDialog = ref(false);
const dialogRef = ref();
const isEditable = ref();
const hasInvoicing = useAcl('invoicing');
const hasPdf = ref();
const weight = ref();
const actions = {
clone: async () => {
@ -76,6 +89,7 @@ const actions = {
notify({
message: t('You can undo this action within the first hour'),
icon: 'info',
type: 'warning',
});
push({ name: 'TicketList' });
@ -87,10 +101,14 @@ const actions = {
function openDeliveryNote(type = 'deliveryNote', documentType = 'pdf') {
const path = `Tickets/${ticket.value.id}/delivery-note-${documentType}`;
openReport(path, {
openReport(
path,
{
recipientId: ticket.value.clientFk,
type: type,
});
},
'_blank'
);
}
function sendDeliveryNoteConfirmation(type = 'deliveryNote', documentType = 'pdf') {
@ -173,34 +191,280 @@ function openConfirmDialog(callback) {
dialog({
component: VnConfirm,
componentProps: {
title: t('This ticket will be removed from current route! Continue anyway?'),
message: t('You are going to delete this ticket'),
promise: actions[callback],
},
});
}
function generatePdfDialog() {
dialog({
component: VnConfirm,
componentProps: {
promise: generatePdfInvoice,
},
});
}
async function generatePdfInvoice() {
const { data } = await axios.get('invoiceOuts', {
params: {
filter: JSON.stringify({
where: { ref: ticket.value.refFk },
}),
},
});
const invoiceId = data[0].id;
const { response } = await axios.post(`InvoiceOuts/${invoiceId}/createPdf`);
if (!response) {
notify({
message: 'The invoice PDF document has been regenerated',
type: 'positive',
});
}
}
function makeInvoiceDialog() {
dialog({
component: VnConfirm,
componentProps: {
title: t('Are you sure you want to invoice this ticket?'),
message: t('You are going to invoice this ticket'),
promise: makeInvoice,
},
});
}
async function makeInvoice() {
const params = {
ticketsIds: [parseInt(ticketId)],
};
await axios.post(`Tickets/invoiceTicketsAndPdf`, params);
notify({
message: t('Ticket invoiced'),
type: 'positive',
});
window.location.reload();
}
async function transferClient(client) {
const params = {
clientFk: client,
};
const { data } = await axios.patch(`Tickets/${ticketId}/transferClient`, params);
if (data) window.location.reload();
}
async function addTurn(day) {
const params = {
ticketFk: parseInt(ticketId),
weekDay: day,
agencyModeFk: ticket.value.agencyModeFk,
};
await axios.patch(`TicketWeeklies`, params);
notify({
message: t('Current ticket deleted and added to shift'),
type: 'positive',
});
window.location.reload();
}
async function createRefund(withWarehouse) {
const params = {
ticketsIds: [parseInt(ticketId)],
withWarehouse: withWarehouse,
};
const { data } = await axios.post(`Tickets/refund`, params);
if (data) {
const refundTicket = data;
push({ name: 'TicketSale', params: { id: refundTicket[0].id } });
}
}
async function changeShippedHour(time) {
const params = {
shipped: time,
};
const { data } = await axios.post(`Tickets/${ticketId}/updateEditableTicket`, params);
if (data) window.location.reload();
}
function openRecalculateDialog() {
dialog({
component: VnConfirm,
componentProps: {
title: t('Recalculate components'),
message: t('Are you sure you want to recalculate components?'),
promise: recalculateComponents,
},
});
}
async function recalculateComponents() {
await axios.post(`Tickets/${ticketId}/recalculateComponents`);
notify({
message: t('Data saved'),
type: 'positive',
});
window.location.reload();
}
const handleFetchData = (data) => {
isEditable.value = data;
handleInvoiceOutData();
};
async function handleInvoiceOutData() {
const { data } = await axios.get(`InvoiceOuts`, {
params: {
filter: JSON.stringify({ where: { ref: ticket.value.refFk } }),
},
});
hasPdf.value = data[0]?.hasPdf;
}
</script>
<template>
<FetchData
:url="`Tickets/${ticketId}/isEditable`"
auto-load
@on-fetch="handleFetchData"
/>
<QItem @click="showTransferDialog = !showTransferDialog" v-ripple clickable>
<QItemSection avatar>
<QIcon name="content_paste" />
</QItemSection>
<QItemSection>{{ t('Transfer client') }}</QItemSection>
</QItem>
<QDialog ref="dialogRef" v-model="showTransferDialog">
<FormPopup
@on-submit="transferClient(client)"
:title="t('Transfer client')"
:custom-submit-button-label="t('Transfer client')"
:default-cancel-button="false"
>
<template #form-inputs>
<VnSelect
url="Clients"
:fields="['id', 'name']"
option-label="name"
option-value="id"
v-model="client"
:label="t('Client')"
auto-load
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ `#${scope.opt.id} - ` }}
{{ scope.opt.name }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</template>
</FormPopup>
</QDialog>
<QItem @click="showTurnDialog = !showTurnDialog" v-ripple clickable>
<QItemSection avatar>
<QIcon name="vn:calendar" />
</QItemSection>
<QItemSection>{{ t('addTurn') }}</QItemSection>
</QItem>
<QDialog ref="dialogRef" v-model="showTurnDialog">
<FormPopup
@on-submit="addTurn"
:title="t('What is the day of receipt of the ticket?')"
:default-submit-button="false"
:default-cancel-button="false"
style="text-align: center"
>
<template #form-inputs>
<QBtnGroup spread>
<QBtn
:label="t('weekdays.mon')"
color="primary"
@click="addTurn(0)"
v-ripple
class="weekdaysBtn"
/>
<QBtn
:label="t('weekdays.tue')"
color="primary"
@click="addTurn(1)"
v-ripple
class="weekdaysBtn"
/>
<QBtn
:label="t('weekdays.wed')"
color="primary"
@click="addTurn(2)"
v-ripple
class="weekdaysBtn"
/>
<QBtn
:label="t('weekdays.thu')"
color="primary"
@click="addTurn(3)"
v-ripple
class="weekdaysBtn"
/>
<QBtn
:label="t('weekdays.fri')"
color="primary"
@click="addTurn(4)"
v-ripple
class="weekdaysBtn"
/>
<QBtn
:label="t('weekdays.sat')"
color="primary"
@click="addTurn(5)"
v-ripple
class="weekdaysBtn"
/>
<QBtn
:label="t('weekdays.sun')"
color="primary"
@click="addTurn(6)"
v-ripple
class="weekdaysBtn"
/>
</QBtnGroup>
</template>
</FormPopup>
</QDialog>
<QItem v-ripple clickable>
<QItemSection avatar>
<QIcon name="picture_as_pdf" />
</QItemSection>
<QItemSection>{{ t('Open Delivery Note...') }}</QItemSection>
<QItemSection>{{ t('Show Delivery Note...') }}</QItemSection>
<QItemSection side>
<QIcon name="keyboard_arrow_right" />
</QItemSection>
<QMenu anchor="top end" self="top start" auto-close bordered>
<QList>
<QItem @click="openDeliveryNote('deliveryNote')" v-ripple clickable>
<QItemSection>{{ t('With prices') }}</QItemSection>
<QItemSection>{{ t('as PDF') }}</QItemSection>
</QItem>
<QItem @click="openDeliveryNote('withoutPrices')" v-ripple clickable>
<QItemSection>{{ t('Without prices') }}</QItemSection>
<QItemSection>{{ t('as PDF without prices') }}</QItemSection>
</QItem>
<QItem
@click="openDeliveryNote('deliveryNote', 'csv')"
v-ripple
clickable
>
<QItemSection>{{ t('As CSV') }}</QItemSection>
<QItemSection>{{ t('as CSV') }}</QItemSection>
</QItem>
</QList>
</QMenu>
@ -220,21 +484,21 @@ function openConfirmDialog(callback) {
v-ripple
clickable
>
<QItemSection>{{ t('With prices') }}</QItemSection>
<QItemSection>{{ t('Send PDF') }}</QItemSection>
</QItem>
<QItem
@click="sendDeliveryNoteConfirmation('withoutPrices')"
v-ripple
clickable
>
<QItemSection>{{ t('Without prices') }}</QItemSection>
<QItemSection>{{ t('Send PDF to tablet') }}</QItemSection>
</QItem>
<QItem
@click="sendDeliveryNoteConfirmation('deliveryNote', 'csv')"
v-ripple
clickable
>
<QItemSection>{{ t('As CSV') }}</QItemSection>
<QItemSection>{{ t('Send CSV') }}</QItemSection>
</QItem>
</QList>
</QMenu>
@ -243,8 +507,26 @@ function openConfirmDialog(callback) {
<QItemSection avatar>
<QIcon name="receipt" />
</QItemSection>
<QItemSection>{{ t('Open Proforma Invoice') }}</QItemSection>
<QItemSection>{{ t('Show Proforma') }}</QItemSection>
</QItem>
<QItem
v-if="isEditable"
@click="showChangeTimeDialog = !showChangeTimeDialog"
v-ripple
clickable
>
<QItemSection avatar>
<QIcon name="schedule" />
</QItemSection>
<QItemSection>{{ t('Change shipped hour') }}</QItemSection>
</QItem>
<QDialog ref="dialogRef" v-model="showChangeTimeDialog">
<FormPopup @on-submit="changeShippedHour(time)" :title="t('Change shipped hour')">
<template #form-inputs>
<VnInputTime v-model="time" :label="t('Shipped hour')" clearable />
</template>
</FormPopup>
</QDialog>
<QItem v-ripple clickable>
<QItemSection avatar>
<QIcon name="sms" />
@ -259,24 +541,72 @@ function openConfirmDialog(callback) {
<QItemSection>{{ t('Pending payment') }}</QItemSection>
</QItem>
<QItem @click="showSmsDialog('minAmount')" v-ripple clickable>
<QItemSection>{{ t('Minimum amount') }}</QItemSection>
<QItemSection>{{ t('Minimum import') }}</QItemSection>
</QItem>
<QItem
@click="showSmsDialogWithChanges('orderChanges')"
v-ripple
clickable
>
<QItemSection>{{ t('Order changes') }}</QItemSection>
<QItemSection>{{ t('Notify changes') }}</QItemSection>
</QItem>
</QList>
</QMenu>
</QItem>
<QItem @click="makeInvoiceDialog()" v-ripple clickable v-if="isEditable">
<QItemSection avatar>
<QIcon name="picture_as_pdf" />
</QItemSection>
<QItemSection>{{ t('Make invoice') }}</QItemSection>
</QItem>
<QItem
@click="generatePdfDialog()"
v-ripple
clickable
v-if="ticket.refFk !== null && (hasInvoicing || hasPdf)"
>
<QItemSection avatar>
<QIcon name="picture_as_pdf" />
</QItemSection>
<QItemSection>{{
hasPdf ? t('Regenerate PDF invoice') : t('Generate PDF invoice')
}}</QItemSection>
</QItem>
<QItem @click="openConfirmDialog('clone')" v-ripple clickable>
<QItemSection avatar>
<QIcon name="content_copy" />
</QItemSection>
<QItemSection>{{ t('To clone ticket') }}</QItemSection>
</QItem>
<QItem v-if="isEditable" @click="openRecalculateDialog()" v-ripple clickable>
<QItemSection avatar>
<QIcon name="refresh" />
</QItemSection>
<QItemSection>{{ t('Recalculate components') }}</QItemSection>
</QItem>
<QItem v-ripple clickable>
<QItemSection avatar>
<QIcon name="monetization_on" />
</QItemSection>
<QItemSection>{{ t('Refund all...') }}</QItemSection>
<QItemSection side>
<QIcon name="keyboard_arrow_right" />
</QItemSection>
<QMenu anchor="top end" self="top start" auto-close bordered>
<QList>
<QItem v-ripple clickable @click="createRefund(true)">
<QItemSection>
{{ t('with warehouse') }}
</QItemSection>
</QItem>
<QItem v-ripple clickable @click="createRefund(false)">
<QItemSection>
{{ t('without warehouse') }}
</QItemSection>
</QItem>
</QList>
</QMenu>
</QItem>
<QItem @click="$refs.weightDialog.show()" v-ripple clickable>
<QItemSection avatar>
<QIcon name="weight" />
@ -307,29 +637,61 @@ function openConfirmDialog(callback) {
</template>
</VnConfirm>
</template>
<style lang="scss" scoped>
.weekdaysBtn {
margin: 1%;
}
</style>
<i18n>
en:
addTurn: Add turn
invoiceIds: "Invoices have been generated with the following ids: {invoiceIds}"
es:
Open Delivery Note...: Abrir albarán...
Show Delivery Note...: Ver albarán...
Send Delivery Note...: Enviar albarán...
With prices: Con precios
Without prices: Sin precios
As CSV: Como CSV
Open Proforma Invoice: Abrir factura proforma
as PDF: como PDF
as PDF without prices: como PDF sin precios
as CSV: Como CSV
Send PDF: Enviar PDF
Send PDF to tablet: Enviar PDF a tablet
Send CSV: Enviar CSV
Show Proforma: Ver proforma
Delete ticket: Eliminar ticket
Send SMS...: Enviar SMS
Send SMS...: Enviar SMS...
Pending payment: Pago pendiente
Minimum amount: Importe mínimo
Order changes: Cambios del pedido
Minimum import: Importe mínimo
Notify changes: Notificar cambios
Ticket deleted: Ticket eliminado
You can undo this action within the first hour: Puedes deshacer esta acción dentro de la primera hora
To clone ticket: Clonar ticket
Ticket cloned: Ticked clonado
It was not able to clone the ticket: No se pudo clonar el ticket
Generate PDF invoice: Generar PDF factura
Regenerate PDF invoice: Regenerar PDF factura
The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado
Transfer client: Transferir cliente
Client: Cliente
addTurn: Añadir a turno
What is the day of receipt of the ticket?: ¿Cuál es el día de preparación del pedido?
Current ticket deleted and added to shift: Ticket actual eliminado y añadido al turno
Refund all...: Abonar todo...
with warehouse: con almacén
without warehouse: sin almacén
Make invoice: Crear factura
Change shipped hour: Cambiar hora de envío
Shipped hour: Hora de envío
Recalculate components: Recalcular componentes
Are you sure you want to recalculate components?: ¿Seguro que quieres recalcular los componentes?
Data saved: Datos guardados
Are you sure you want to invoice this ticket?: ¿Seguro que quieres facturar este ticket?
You are going to invoice this ticket: Vas a facturar este ticket
Ticket invoiced: Ticket facturado
Set weight: Establecer peso
Weight set: Peso establecido
This ticket may be invoiced, do you want to continue?: Es posible que se facture este ticket, desea continuar?
invoiceIds: "Se han generado las facturas con los siguientes ids: {invoiceIds}"
This ticket will be removed from current route! Continue anyway?: ¡Se eliminará el ticket de la ruta actual! ¿Continuar de todas formas?
You are going to delete this ticket: Vas a eliminar este ticket
</i18n>

View File

@ -1,39 +1,35 @@
<script setup>
import { onMounted, ref, computed, onUnmounted, reactive, watch } from 'vue';
import { onMounted, ref, computed, onUnmounted, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnInput from 'src/components/common/VnInput.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import TicketEditManaProxy from './TicketEditMana.vue';
import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import ExpeditionNewTicket from './ExpeditionNewTicket.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import { useStateStore } from 'stores/useStateStore';
import { toCurrency, toPercentage } from 'src/filters';
import { useArrayData } from 'composables/useArrayData';
import { useVnConfirm } from 'composables/useVnConfirm';
import useNotify from 'src/composables/useNotify.js';
import { toDateTimeFormat } from 'src/filters/date';
import axios from 'axios';
import VnTable from 'src/components/VnTable/VnTable.vue';
const route = useRoute();
const stateStore = useStateStore();
const { t } = useI18n();
const { notify } = useNotify();
const { openConfirmationModal } = useVnConfirm();
const editPriceProxyRef = ref(null);
const newTicketDialogRef = ref(null);
const logsTableDialogRef = ref(null);
const tableRef = ref();
const expeditionsLogsData = ref([]);
const selectedExpeditions = ref([]);
const allColumnNames = ref([]);
const visibleColumns = ref([]);
const newTicketWithRoute = ref(false);
const selectedRows = ref([]);
const hasSelectedRows = computed(() => selectedRows.value.length > 0);
const exprBuilder = (param, value) => {
switch (param) {
@ -54,8 +50,6 @@ const expeditionsArrayData = useArrayData('ticketExpeditions', {
filter: expeditionsFilter.value,
exprBuilder: exprBuilder,
});
const expeditionsStore = expeditionsArrayData.store;
const ticketExpeditions = computed(() => expeditionsStore.data);
const ticketArrayData = useArrayData('ticketData');
const ticketStore = ticketArrayData.store;
@ -73,129 +67,87 @@ watch(
{ immediate: true }
);
const params = reactive({});
const applyColumnFilter = async (col) => {
try {
const paramKey = col.columnFilter?.filterParamKey || col.field;
params[paramKey] = col.columnFilter.filterValue;
await expeditionsArrayData.addFilter({ filter: expeditionsFilter.value, params });
} catch (err) {
console.error('Error applying column filter', err);
}
};
const getInputEvents = (col) => {
return col.columnFilter.type === 'select'
? { 'update:modelValue': () => applyColumnFilter(col) }
: {
'keyup.enter': () => applyColumnFilter(col),
};
};
const columns = computed(() => [
{
align: 'left',
label: t('expedition.id'),
name: 'id',
field: 'id',
align: 'left',
sortable: true,
columnFilter: {
component: VnInput,
type: 'text',
filterParamKey: 'expeditionFk',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
chip: {
condition: () => true,
},
isId: true,
columnFilter: {
inWhere: true,
},
},
{
label: t('expedition.item'),
name: 'item',
name: 'packagingItemFk',
align: 'left',
cardVisible: true,
columnFilter: {
component: VnInput,
type: 'text',
filterParamKey: 'packageItemName',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
inWhere: true,
},
},
{
label: t('expedition.name'),
name: 'name',
field: 'packageItemName',
name: 'packageItemName',
align: 'left',
isTitle: true,
columnFilter: {
component: VnSelect,
type: 'select',
filterValue: null,
event: getInputEvents,
attrs: {
url: 'Items',
fields: ['id', 'name'],
'sort-by': 'name ASC',
'option-value': 'id',
'option-label': 'name',
dense: true,
},
inWhere: true,
},
},
{
label: t('expedition.packageType'),
name: 'packageType',
field: 'freightItemName',
name: 'freightItemName',
align: 'left',
columnFilter: {
component: VnInput,
type: 'text',
// filterParamKey: 'expeditionFk',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
},
inWhere: true,
},
},
{
label: t('expedition.counter'),
name: 'counter',
field: 'counter',
align: 'left',
columnFilter: null,
columnFilter: {
inWhere: true,
},
},
{
label: t('expedition.externalId'),
name: 'externalId',
field: 'externalId',
align: 'left',
columnFilter: null,
cardVisible: true,
columnFilter: {
inWhere: true,
},
},
{
label: t('expedition.created'),
name: 'created',
field: 'created',
align: 'left',
columnFilter: null,
format: (value) => toDateTimeFormat(value),
cardVisible: true,
format: (row) => toDateTimeFormat(row.created),
},
{
label: t('expedition.state'),
name: 'state',
field: 'state',
align: 'left',
columnFilter: null,
cardVisible: true,
columnFilter: { inWhere: true },
},
{
label: '',
name: 'history',
align: 'left',
columnFilter: null,
align: 'right',
name: 'tableActions',
actions: [
{
title: t('expedition.historyAction'),
icon: 'history',
isPrimary: true,
action: (row) => showLog(row),
},
],
},
]);
@ -204,23 +156,29 @@ const logTableColumns = computed(() => [
label: t('expedition.state'),
name: 'state',
field: 'state',
align: 'left',
align: 'center',
sortable: true,
},
{
label: t('expedition.name'),
name: 'name',
align: 'name',
field: 'name',
align: 'center',
columnFilter: null,
},
{
label: t('expedition.created'),
name: 'created',
field: 'created',
align: 'left',
columnFilter: null,
align: 'center',
format: (value) => toDateTimeFormat(value),
},
{
label: t('expedition.isScanned'),
name: 'isScanned',
field: 'isScanned',
align: 'center',
},
]);
const showNewTicketDialog = (withRoute = false) => {
@ -255,10 +213,20 @@ const getExpeditionState = async (expedition) => {
order: ['created DESC'],
};
const { data } = await axios.get(`ExpeditionStates/filter`, {
const { data: expeditionStates } = await axios.get(`ExpeditionStates/filter`, {
params: { filter: JSON.stringify(filter) },
});
expeditionsLogsData.value = data;
const { data: scannedStates } = await axios.get(`ExpeditionStates`, {
params: { filter: JSON.stringify(filter), fields: ['id', 'isScanned'] },
});
expeditionsLogsData.value = expeditionStates.map((state) => {
const scannedState = scannedStates.find((s) => s.id === state.id);
return {
...state,
isScanned: scannedState ? scannedState.isScanned : false,
};
});
} catch (error) {
console.error(error);
}
@ -275,21 +243,13 @@ onUnmounted(() => (stateStore.rightDrawer = false));
<template>
<VnSubToolbar>
<template #st-data>
<TableVisibleColumns
:all-columns="allColumnNames"
table-code="expeditionIndex"
labels-traductions-path="expedition"
@on-config-saved="visibleColumns = [...$event, 'history']"
/>
</template>
<template #st-actions>
<QBtnGroup push class="q-gutter-x-sm" flat>
<QBtnDropdown
ref="btnDropdownRef"
color="primary"
:label="t('expedition.move')"
:disable="!selectedExpeditions.length"
:disable="!hasSelectedRows"
>
<template #label>
<QTooltip>{{ t('Select lines to see the options') }}</QTooltip>
@ -322,7 +282,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</QList>
</QBtnDropdown>
<QBtn
:disable="!selectedExpeditions.length"
:disable="!hasSelectedRows"
icon="delete"
color="primary"
@click="
@ -332,115 +292,34 @@ onUnmounted(() => (stateStore.rightDrawer = false));
deleteExpedition
)
"
/>
>
<QTooltip>{{ t('expedition.removeExpedition') }}</QTooltip>
</QBtn>
</QBtnGroup>
</template>
</VnSubToolbar>
<QTable
:rows="ticketExpeditions"
<VnTable
ref="tableRef"
data-key="TicketExpedition"
url="Expeditions/filter"
:columns="columns"
row-key="id"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md"
selection="multiple"
v-model:selected="selectedExpeditions"
:visible-columns="visibleColumns"
:no-data-label="t('globals.noResults')"
:filter="expeditionsFilter"
v-model:selected="selectedRows"
:table="{
'row-key': 'id',
selection: 'multiple',
}"
auto-load
order="created DESC"
>
<template #top-row="{ cols }">
<QTr>
<QTd />
<QTd v-for="(col, index) in cols" :key="index" style="max-width: 100px">
<component
:is="col.columnFilter.component"
v-if="col.columnFilter"
v-model="col.columnFilter.filterValue"
v-bind="col.columnFilter.attrs"
v-on="col.columnFilter.event(col)"
dense
/>
</QTd>
</QTr>
</template>
<template #body-cell-item="{ row }">
<QTd auto-width @click.stop>
<QBtn flat color="primary">{{ row.packagingItemFk }}</QBtn>
<template #column-packagingItemFk="{ row }">
<span class="link" @click.stop>
{{ row.packagingItemFk }}
<ItemDescriptorProxy :id="row.packagingItemFk" />
</QTd>
</span>
</template>
<template #body-cell-available="{ row }">
<QTd @click.stop>
<QBadge :color="row.available < 0 ? 'alert' : 'transparent'" dense>
{{ row.available }}
</QBadge>
</QTd>
</template>
<template #body-cell-price="{ row }">
<QTd>
<template v-if="isTicketEditable && row.id">
<QBtn flat color="primary" dense @click="onOpenEditPricePopover(row)">
{{ toCurrency(row.price) }}
</QBtn>
<TicketEditManaProxy
ref="editPriceProxyRef"
:mana="mana"
:new-price="getNewPrice"
@save="updatePrice(row)"
>
<VnInput
v-model.number="edit.price"
:label="t('ticketSale.price')"
type="number"
/>
</TicketEditManaProxy>
</template>
<span v-else>{{ toCurrency(row.price) }}</span>
</QTd>
</template>
<template #body-cell-discount="{ row }">
<QTd>
<template v-if="!isLocked && row.id">
<QBtn
flat
color="primary"
dense
@click="onOpenEditDiscountPopover(row)"
>
{{ toPercentage(row.discount / 100) }}
</QBtn>
<TicketEditManaProxy
:mana="mana"
:new-price="getNewPrice"
@save="changeDiscount(row)"
>
<VnInput
v-model.number="edit.discount"
:label="t('ticketSale.discount')"
type="number"
/>
</TicketEditManaProxy>
</template>
<span v-else>{{ toPercentage(row.discount / 100) }}</span>
</QTd>
</template>
<template #body-cell-history="{ row }">
<QTd>
<QBtn
@click.stop="showLog(row)"
color="primary"
icon="history"
size="md"
flat
>
<QTooltip class="text-no-wrap">
{{ t('expedition.historyAction') }}
</QTooltip>
</QBtn>
</QTd>
</template>
</QTable>
</VnTable>
<QDialog ref="newTicketDialogRef" transition-show="scale" transition-hide="scale">
<ExpeditionNewTicket
:ticket="ticketData"
@ -454,12 +333,23 @@ onUnmounted(() => (stateStore.rightDrawer = false));
data-key="TicketExpeditionLog"
:rows="expeditionsLogsData"
:columns="logTableColumns"
class="q-pa-sm"
class="q-pa-md full-width"
>
<template #body-cell-name="{ row }">
<QTd auto-width>
<QBtn flat dense color="primary">{{ row.name }}</QBtn>
<QTd style="text-align: center">
<span class="link" @click.stop>
<QBtn flat dense>{{ row.name }}</QBtn>
<WorkerDescriptorProxy :id="row.workerFk" />
</span>
</QTd>
</template>
<template #body-cell-isScanned="{ row }">
<QTd style="text-align: center">
<QCheckbox disable v-model="row.isScanned">
{{
row.isScanned === 1 ? t('expedition.yes') : t('expedition.no')
}}
</QCheckbox>
</QTd>
</template>
</QTable>

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