Merge pull request '8315-devToTest' (!1094) from 8315-devToTest into test
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #1094 Reviewed-by: Guillermo Bonet <guillermo@verdnatura.es>
This commit is contained in:
commit
5f438de06e
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salix-front",
|
||||
"version": "24.50.0",
|
||||
"version": "24.52.0",
|
||||
"description": "Salix frontend",
|
||||
"productName": "Salix",
|
||||
"author": "Verdnatura",
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
import routes from 'src/router/modules';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
let isNotified = false;
|
||||
|
||||
export default {
|
||||
created: function () {
|
||||
const router = useRouter();
|
||||
const keyBindingMap = routes
|
||||
.filter((route) => route.meta.keyBinding)
|
||||
.reduce((map, route) => {
|
||||
map['Key' + route.meta.keyBinding.toUpperCase()] = route.path;
|
||||
return map;
|
||||
}, {});
|
||||
|
||||
const handleKeyDown = (event) => {
|
||||
const { ctrlKey, altKey, code } = event;
|
||||
|
||||
if (ctrlKey && altKey && keyBindingMap[code] && !isNotified) {
|
||||
event.preventDefault();
|
||||
router.push(keyBindingMap[code]);
|
||||
isNotified = true;
|
||||
}
|
||||
};
|
||||
|
||||
const handleKeyUp = (event) => {
|
||||
const { ctrlKey, altKey } = event;
|
||||
if (!ctrlKey || !altKey) {
|
||||
isNotified = false;
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
window.addEventListener('keyup', handleKeyUp);
|
||||
},
|
||||
};
|
|
@ -1,14 +1,37 @@
|
|||
import { getCurrentInstance } from 'vue';
|
||||
|
||||
function focusFirstInput(input) {
|
||||
input.focus();
|
||||
}
|
||||
export default {
|
||||
mounted: function () {
|
||||
const vm = getCurrentInstance();
|
||||
if (vm.type.name === 'QForm') {
|
||||
if (!['searchbarForm', 'filterPanelForm'].includes(this.$el?.id)) {
|
||||
// TODO: AUTOFOCUS IS NOT FOCUSING
|
||||
const that = this;
|
||||
this.$el.addEventListener('keyup', function (evt) {
|
||||
if (evt.key === 'Enter' && !that.$attrs['prevent-submit']) {
|
||||
|
||||
const form = document.querySelector('.q-form#formModel');
|
||||
if (!form) return;
|
||||
try {
|
||||
const inputsFormCard = form.querySelectorAll(
|
||||
`input:not([disabled]):not([type="checkbox"])`
|
||||
);
|
||||
if (inputsFormCard.length) {
|
||||
focusFirstInput(inputsFormCard[0]);
|
||||
}
|
||||
const textareas = document.querySelectorAll(
|
||||
'textarea:not([disabled]), [contenteditable]:not([disabled])'
|
||||
);
|
||||
if (textareas.length) {
|
||||
focusFirstInput(textareas[textareas.length - 1]);
|
||||
}
|
||||
const inputs = document.querySelectorAll(
|
||||
'form#formModel input:not([disabled]):not([type="checkbox"])'
|
||||
);
|
||||
const input = inputs[0];
|
||||
if (!input) return;
|
||||
|
||||
focusFirstInput(input);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
form.addEventListener('keyup', function (evt) {
|
||||
if (evt.key === 'Enter') {
|
||||
const input = evt.target;
|
||||
if (input.type == 'textarea' && evt.shiftKey) {
|
||||
evt.preventDefault();
|
||||
|
@ -24,7 +47,5 @@ export default {
|
|||
that.onSubmit();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
import axios from 'axios';
|
||||
import { boot } from 'quasar/wrappers';
|
||||
import qFormMixin from './qformMixin';
|
||||
import keyShortcut from './keyShortcut';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
import { CanceledError } from 'axios';
|
||||
|
||||
const { notify } = useNotify();
|
||||
import { QForm } from 'quasar';
|
||||
import { QLayout } from 'quasar';
|
||||
import mainShortcutMixin from './mainShortcutMixin';
|
||||
import { useCau } from 'src/composables/useCau';
|
||||
|
||||
export default boot(({ app }) => {
|
||||
app.mixin(qFormMixin);
|
||||
QForm.mixins = [qFormMixin];
|
||||
QLayout.mixins = [mainShortcutMixin];
|
||||
|
||||
app.directive('shortcut', keyShortcut);
|
||||
app.config.errorHandler = (error) => {
|
||||
app.config.errorHandler = async (error) => {
|
||||
let message;
|
||||
const response = error.response;
|
||||
const responseData = response?.data;
|
||||
|
@ -40,12 +43,12 @@ export default boot(({ app }) => {
|
|||
}
|
||||
|
||||
console.error(error);
|
||||
if (error instanceof CanceledError) {
|
||||
if (error instanceof axios.CanceledError) {
|
||||
const env = process.env.NODE_ENV;
|
||||
if (env && env !== 'development') return;
|
||||
message = 'Duplicate request';
|
||||
}
|
||||
|
||||
notify(message ?? 'globals.error', 'negative', 'error');
|
||||
await useCau(response, message);
|
||||
};
|
||||
});
|
||||
|
|
|
@ -177,6 +177,7 @@ function normalize(text) {
|
|||
class="full-width"
|
||||
filled
|
||||
dense
|
||||
autofocus
|
||||
/>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
|
|
|
@ -612,6 +612,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
|||
$props.rowClick && $props.rowClick(row);
|
||||
}
|
||||
"
|
||||
style="height: 100%"
|
||||
>
|
||||
<QCardSection
|
||||
vertical
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<script setup>
|
||||
import { toDateFormat } from 'src/filters/date.js';
|
||||
|
||||
defineProps({ date: { type: [Date, String], required: true } });
|
||||
|
||||
function getBadgeAttrs(date) {
|
||||
let today = Date.vnNew();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
let timeTicket = new Date(date);
|
||||
timeTicket.setHours(0, 0, 0, 0);
|
||||
|
||||
let timeDiff = today - timeTicket;
|
||||
|
||||
if (timeDiff == 0) return { color: 'warning', 'text-color': 'black' };
|
||||
if (timeDiff < 0) return { color: 'success', 'text-color': 'black' };
|
||||
return { color: 'transparent', 'text-color': 'white' };
|
||||
}
|
||||
|
||||
function formatShippedDate(date) {
|
||||
if (!date) return '-';
|
||||
const dateSplit = date.split('T');
|
||||
const [year, month, day] = dateSplit[0].split('-');
|
||||
const newDate = new Date(year, month - 1, day);
|
||||
return toDateFormat(newDate);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<QBadge v-bind="getBadgeAttrs(date)" class="q-pa-sm" style="font-size: 14px">
|
||||
{{ formatShippedDate(date) }}
|
||||
</QBadge>
|
||||
</template>
|
|
@ -1,13 +1,28 @@
|
|||
<script setup>
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import { ref } from 'vue';
|
||||
import { useAttrs } from 'vue';
|
||||
|
||||
defineProps({
|
||||
step: { type: Number, default: 0.01 },
|
||||
decimalPlaces: { type: Number, default: 2 },
|
||||
positive: { type: Boolean, default: true },
|
||||
});
|
||||
|
||||
const model = defineModel({ type: [Number, String] });
|
||||
const $attrs = useAttrs();
|
||||
const step = ref($attrs.step || 0.01);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnInput v-bind="$attrs" v-model.number="model" type="number" :step="step" />
|
||||
<VnInput
|
||||
v-bind="$attrs"
|
||||
v-model.number="model"
|
||||
type="number"
|
||||
:step="step"
|
||||
@input="
|
||||
(evt) => {
|
||||
const val = evt.target.value;
|
||||
if (positive && val < 0) return (model = 0);
|
||||
const [, decimal] = val.split('.');
|
||||
if (val && decimal?.length > decimalPlaces)
|
||||
model = parseFloat(val).toFixed(decimalPlaces);
|
||||
}
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -238,6 +238,7 @@ async function openPointRecord(id, modelLog) {
|
|||
pointRecord.value = parseProps(propNames, locale, data);
|
||||
}
|
||||
async function setLogTree(data) {
|
||||
if (!data) return;
|
||||
logTree.value = getLogTree(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
|||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { useRequired } from 'src/composables/useRequired';
|
||||
import dataByOrder from 'src/utils/dataByOrder';
|
||||
import { QItemLabel } from 'quasar';
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'update:options', 'remove']);
|
||||
const $attrs = useAttrs();
|
||||
|
@ -33,6 +34,10 @@ const $props = defineProps({
|
|||
type: String,
|
||||
default: 'id',
|
||||
},
|
||||
optionCaption: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
optionFilter: {
|
||||
type: String,
|
||||
default: null,
|
||||
|
@ -101,6 +106,10 @@ const $props = defineProps({
|
|||
type: String,
|
||||
default: null,
|
||||
},
|
||||
isOutlined: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
||||
|
@ -115,6 +124,15 @@ const noOneOpt = ref({
|
|||
[optionValue.value]: false,
|
||||
[optionLabel.value]: noOneText,
|
||||
});
|
||||
const styleAttrs = computed(() => {
|
||||
return $props.isOutlined
|
||||
? {
|
||||
dense: true,
|
||||
outlined: true,
|
||||
rounded: true,
|
||||
}
|
||||
: {};
|
||||
});
|
||||
const isLoading = ref(false);
|
||||
const useURL = computed(() => $props.url);
|
||||
const value = computed({
|
||||
|
@ -288,7 +306,7 @@ function handleKeyDown(event) {
|
|||
}
|
||||
|
||||
const focusableElements = document.querySelectorAll(
|
||||
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
||||
'a:not([disabled]), button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), details:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])'
|
||||
);
|
||||
const currentIndex = Array.prototype.indexOf.call(
|
||||
focusableElements,
|
||||
|
@ -307,9 +325,8 @@ function handleKeyDown(event) {
|
|||
:options="myOptions"
|
||||
:option-label="optionLabel"
|
||||
:option-value="optionValue"
|
||||
v-bind="$attrs"
|
||||
v-bind="{ ...$attrs, ...styleAttrs }"
|
||||
@filter="filterHandler"
|
||||
@keydown="handleKeyDown"
|
||||
:emit-value="nullishToTrue($attrs['emit-value'])"
|
||||
:map-options="nullishToTrue($attrs['map-options'])"
|
||||
:use-input="nullishToTrue($attrs['use-input'])"
|
||||
|
@ -324,13 +341,15 @@ function handleKeyDown(event) {
|
|||
:input-debounce="useURL ? '300' : '0'"
|
||||
:loading="isLoading"
|
||||
@virtual-scroll="onScroll"
|
||||
@keydown="handleKeyDown"
|
||||
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
|
||||
:data-url="url"
|
||||
>
|
||||
<template #append>
|
||||
<QIcon
|
||||
v-show="isClearable && value"
|
||||
name="close"
|
||||
@click.stop="
|
||||
@click="
|
||||
() => {
|
||||
value = null;
|
||||
emit('remove');
|
||||
|
@ -358,6 +377,21 @@ function handleKeyDown(event) {
|
|||
</div>
|
||||
<slot v-else :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
</template>
|
||||
<template #option="{ opt, itemProps }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection v-if="opt[optionValue] == opt[optionLabel]">
|
||||
<QItemLabel>{{ opt[optionLabel] }}</QItemLabel>
|
||||
</QItemSection>
|
||||
<QItemSection v-else>
|
||||
<QItemLabel>
|
||||
{{ opt[optionLabel] }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption v-if="optionCaption !== false">
|
||||
{{ `#${opt[optionCaption] || opt[optionValue]}` }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</QSelect>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
<script setup>
|
||||
import { computed, useAttrs } from 'vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
const $props = defineProps({
|
||||
hasAvatar: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasInfo: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
modelValue: {
|
||||
type: [String, Number, Object],
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
const $attrs = useAttrs();
|
||||
|
||||
const value = computed({
|
||||
get() {
|
||||
return $props.modelValue;
|
||||
},
|
||||
set(val) {
|
||||
emit('update:modelValue', val);
|
||||
},
|
||||
});
|
||||
|
||||
const url = computed(() => {
|
||||
let url = 'Workers/search';
|
||||
const { departmentCodes } = $attrs.params ?? {};
|
||||
if (!departmentCodes) return url;
|
||||
const params = new URLSearchParams({
|
||||
departmentCodes: JSON.stringify(departmentCodes),
|
||||
});
|
||||
|
||||
return url.concat(`?${params.toString()}`);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnSelect
|
||||
:label="$t('globals.worker')"
|
||||
v-bind="$attrs"
|
||||
v-model="value"
|
||||
:url="url"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
:fields="['id', 'name', 'nickname', 'code']"
|
||||
sort-by="nickname ASC"
|
||||
>
|
||||
<template #prepend v-if="$props.hasAvatar">
|
||||
<VnAvatar :worker-id="value" color="primary" :title="title" />
|
||||
</template>
|
||||
<template #append v-if="$props.hasInfo">
|
||||
<QIcon name="info" class="cursor-pointer">
|
||||
<QTooltip>{{ $t($props.hasInfo) }}</QTooltip>
|
||||
</QIcon>
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
{{ scope.opt.name }}
|
||||
</QItemLabel>
|
||||
<QItemLabel v-if="!scope.opt.id">
|
||||
{{ scope.opt.nickname }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption v-else>
|
||||
{{ scope.opt.nickname }}, {{ scope.opt.code }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Responsible for approving invoices: Responsable de aprobar las facturas
|
||||
</i18n>
|
|
@ -222,8 +222,8 @@ const toModule = computed(() =>
|
|||
/>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.body {
|
||||
<style lang="scss" scoped>
|
||||
:deep(.body) {
|
||||
background-color: var(--vn-section-color);
|
||||
.text-h5 {
|
||||
font-size: 20px;
|
||||
|
@ -262,9 +262,7 @@ const toModule = computed(() =>
|
|||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, toRef } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import VnLv from 'components/ui/VnLv.vue';
|
||||
|
@ -13,7 +13,7 @@ const DEFAULT_PRICE_KG = 0;
|
|||
|
||||
const { t } = useI18n();
|
||||
|
||||
defineProps({
|
||||
const props = defineProps({
|
||||
item: {
|
||||
type: Object,
|
||||
required: true,
|
||||
|
@ -25,57 +25,63 @@ defineProps({
|
|||
});
|
||||
|
||||
const dialog = ref(null);
|
||||
const card = toRef(props, 'item');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container order-catalog-item overflow-hidden">
|
||||
<QCard class="card shadow-6">
|
||||
<div class="img-wrapper">
|
||||
<VnImg :id="item.id" class="image" zoom-resolution="1600x900" />
|
||||
<div v-if="item.hex && isCatalog" class="item-color-container">
|
||||
<VnImg :id="card.id" class="image" zoom-resolution="1600x900" />
|
||||
<div v-if="card.hex && isCatalog" class="item-color-container">
|
||||
<div
|
||||
class="item-color"
|
||||
:style="{ backgroundColor: `#${item.hex}` }"
|
||||
:style="{ backgroundColor: `#${card.hex}` }"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<span class="link">
|
||||
{{ item.name }}
|
||||
<ItemDescriptorProxy :id="item.id" />
|
||||
{{ card.name }}
|
||||
<ItemDescriptorProxy :id="card.id" />
|
||||
</span>
|
||||
<p class="subName">{{ item.subName }}</p>
|
||||
<p class="subName">{{ card.subName }}</p>
|
||||
<template v-for="index in 4" :key="`tag-${index}`">
|
||||
<VnLv
|
||||
v-if="item?.[`tag${index + 4}`]"
|
||||
:label="item?.[`tag${index + 4}`] + ':'"
|
||||
:value="item?.[`value${index + 4}`]"
|
||||
v-if="card?.[`tag${index + 4}`]"
|
||||
:label="card?.[`tag${index + 4}`] + ':'"
|
||||
:value="card?.[`value${index + 4}`]"
|
||||
/>
|
||||
</template>
|
||||
<div v-if="item.minQuantity" class="min-quantity">
|
||||
<div v-if="card.minQuantity" class="min-quantity">
|
||||
<QIcon name="production_quantity_limits" size="xs" />
|
||||
{{ item.minQuantity }}
|
||||
{{ card.minQuantity }}
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="price">
|
||||
<p v-if="isCatalog">
|
||||
{{ item.available }} {{ t('to') }}
|
||||
{{ toCurrency(item.price) }}
|
||||
{{ card.available }} {{ t('to') }}
|
||||
{{ toCurrency(card.price) }}
|
||||
</p>
|
||||
<slot name="price" />
|
||||
<QIcon v-if="isCatalog" name="add_circle" class="icon">
|
||||
<QTooltip>{{ t('globals.add') }}</QTooltip>
|
||||
<QPopupProxy ref="dialog">
|
||||
<OrderCatalogItemDialog
|
||||
:item="item"
|
||||
@added="() => dialog.hide()"
|
||||
:item="card"
|
||||
@added="
|
||||
(quantityAdded) => {
|
||||
card.available += quantityAdded;
|
||||
dialog.hide();
|
||||
}
|
||||
"
|
||||
/>
|
||||
</QPopupProxy>
|
||||
</QIcon>
|
||||
</div>
|
||||
<p v-if="item.priceKg" class="price-kg">
|
||||
<p v-if="card.priceKg" class="price-kg">
|
||||
{{ t('price-kg') }}
|
||||
{{ toCurrency(item.priceKg) || DEFAULT_PRICE_KG }}
|
||||
{{ toCurrency(card.priceKg) || DEFAULT_PRICE_KG }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -98,6 +98,7 @@ function cancel() {
|
|||
/>
|
||||
<QBtn
|
||||
:label="t('globals.confirm')"
|
||||
:title="t('globals.confirm')"
|
||||
color="primary"
|
||||
:loading="isLoading"
|
||||
@click="confirm()"
|
||||
|
|
|
@ -6,7 +6,7 @@ import { useRoute } from 'vue-router';
|
|||
import toDate from 'filters/toDate';
|
||||
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { t, te } = useI18n();
|
||||
const $props = defineProps({
|
||||
modelValue: {
|
||||
type: Object,
|
||||
|
@ -61,6 +61,7 @@ const emit = defineEmits([
|
|||
'update:modelValue',
|
||||
'refresh',
|
||||
'clear',
|
||||
'search',
|
||||
'init',
|
||||
'remove',
|
||||
'setUserParams',
|
||||
|
@ -227,6 +228,14 @@ function sanitizer(params) {
|
|||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
const getLocale = (label) => {
|
||||
const param = label.split('.').at(-1);
|
||||
const globalLocale = `globals.params.${param}`;
|
||||
if (te(globalLocale)) return t(globalLocale);
|
||||
else if (te(t(`params.${param}`)));
|
||||
else return t(`${route.meta.moduleName}.params.${param}`);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -276,7 +285,12 @@ function sanitizer(params) {
|
|||
@remove="remove(chip.label)"
|
||||
data-cy="vnFilterPanelChip"
|
||||
>
|
||||
<slot name="tags" :tag="chip" :format-fn="formatValue">
|
||||
<slot
|
||||
name="tags"
|
||||
:tag="chip"
|
||||
:format-fn="formatValue"
|
||||
:get-locale="getLocale"
|
||||
>
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ chip.label }}:</strong>
|
||||
<span>"{{ formatValue(chip.value) }}"</span>
|
||||
|
@ -289,6 +303,7 @@ function sanitizer(params) {
|
|||
:params="userParams"
|
||||
:tags="customTags"
|
||||
:format-fn="formatValue"
|
||||
:get-locale="getLocale"
|
||||
:search-fn="search"
|
||||
/>
|
||||
</div>
|
||||
|
@ -296,7 +311,12 @@ function sanitizer(params) {
|
|||
<QSeparator />
|
||||
</QList>
|
||||
<QList dense class="list q-gutter-y-sm q-mt-sm">
|
||||
<slot name="body" :params="sanitizer(userParams)" :search-fn="search"></slot>
|
||||
<slot
|
||||
name="body"
|
||||
:params="sanitizer(userParams)"
|
||||
:get-locale="getLocale"
|
||||
:search-fn="search"
|
||||
></slot>
|
||||
</QList>
|
||||
</QForm>
|
||||
<QInnerLoading
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import axios from 'axios';
|
||||
export async function getExchange(amount, currencyFk, dated, decimalPlaces = 2) {
|
||||
try {
|
||||
const { data } = await axios.get('ReferenceRates/findOne', {
|
||||
params: {
|
||||
filter: {
|
||||
fields: ['value'],
|
||||
where: { currencyFk, dated },
|
||||
},
|
||||
},
|
||||
});
|
||||
return (amount / data.value).toFixed(decimalPlaces);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
import { toCurrency } from 'src/filters';
|
||||
|
||||
export function getTotal(rows, key, opts = {}) {
|
||||
const { currency, cb } = opts;
|
||||
const { currency, cb, decimalPlaces } = opts;
|
||||
const total = rows.reduce((acc, row) => acc + +(cb ? cb(row) : row[key] || 0), 0);
|
||||
|
||||
return currency
|
||||
? toCurrency(total, currency == 'default' ? undefined : currency)
|
||||
: total;
|
||||
: parseFloat(total).toFixed(decimalPlaces ?? 2);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
export function useAccountShortToStandard(val) {
|
||||
if (!val || !/^\d+(\.\d*)$/.test(val)) return;
|
||||
return val?.replace('.', '0'.repeat(11 - val.length));
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import { useVnConfirm } from 'src/composables/useVnConfirm';
|
||||
import axios from 'axios';
|
||||
import { ref } from 'vue';
|
||||
import { i18n } from 'src/boot/i18n';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
|
||||
export async function useCau(res, message) {
|
||||
const { notify } = useNotify();
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
const { config, headers, request, status, statusText, data } = res || {};
|
||||
const { params, url, method, signal, headers: confHeaders } = config || {};
|
||||
const { message: resMessage, code, name } = data?.error || {};
|
||||
|
||||
const additionalData = {
|
||||
path: location.hash,
|
||||
message: resMessage,
|
||||
code,
|
||||
request: request?.responseURL,
|
||||
status,
|
||||
name,
|
||||
statusText: statusText,
|
||||
config: {
|
||||
url,
|
||||
method,
|
||||
params,
|
||||
headers: confHeaders,
|
||||
aborted: signal?.aborted,
|
||||
version: headers?.['salix-version'],
|
||||
},
|
||||
};
|
||||
const opts = {
|
||||
actions: [
|
||||
{
|
||||
icon: 'support_agent',
|
||||
color: 'primary',
|
||||
dense: true,
|
||||
flat: false,
|
||||
round: true,
|
||||
handler: async () => {
|
||||
const locale = i18n.global.t;
|
||||
const reason = ref(
|
||||
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : ''
|
||||
);
|
||||
openConfirmationModal(
|
||||
locale('cau.title'),
|
||||
locale('cau.subtitle'),
|
||||
async () => {
|
||||
await axios.post('OsTickets/send-to-support', {
|
||||
reason: reason.value,
|
||||
additionalData,
|
||||
});
|
||||
},
|
||||
null,
|
||||
{
|
||||
component: VnInput,
|
||||
props: {
|
||||
modelValue: reason,
|
||||
'onUpdate:modelValue': (val) => (reason.value = val),
|
||||
label: locale('cau.inputLabel'),
|
||||
class: 'full-width',
|
||||
required: true,
|
||||
autofocus: true,
|
||||
},
|
||||
}
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
notify(message ?? 'globals.error', 'negative', 'error', opts);
|
||||
}
|
|
@ -2,7 +2,7 @@ import { Notify } from 'quasar';
|
|||
import { i18n } from 'src/boot/i18n';
|
||||
|
||||
export default function useNotify() {
|
||||
const notify = (message, type, icon) => {
|
||||
const notify = (message, type, icon, opts = {}) => {
|
||||
const defaultIcons = {
|
||||
warning: 'warning',
|
||||
negative: 'error',
|
||||
|
@ -13,6 +13,7 @@ export default function useNotify() {
|
|||
message: i18n.global.t(message),
|
||||
type: type,
|
||||
icon: icon ? icon : defaultIcons[type],
|
||||
...opts,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -1,20 +1,27 @@
|
|||
import { h } from 'vue';
|
||||
import { Dialog } from 'quasar';
|
||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
||||
export function useVnConfirm() {
|
||||
const quasar = useQuasar();
|
||||
|
||||
const openConfirmationModal = (title, message, promise, successFn) => {
|
||||
quasar
|
||||
.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
const openConfirmationModal = (
|
||||
title,
|
||||
message,
|
||||
promise,
|
||||
successFn,
|
||||
customHTML = {}
|
||||
) => {
|
||||
const { component, props } = customHTML;
|
||||
Dialog.create({
|
||||
component: h(
|
||||
VnConfirm,
|
||||
{
|
||||
title: title,
|
||||
message: message,
|
||||
promise: promise,
|
||||
},
|
||||
})
|
||||
.onOk(async () => {
|
||||
{ customHTML: () => h(component, props) }
|
||||
),
|
||||
}).onOk(async () => {
|
||||
if (successFn) successFn();
|
||||
});
|
||||
};
|
||||
|
|
|
@ -129,6 +129,7 @@ globals:
|
|||
small: Small
|
||||
medium: Medium
|
||||
big: Big
|
||||
email: Email
|
||||
pageTitles:
|
||||
logIn: Login
|
||||
addressEdit: Update address
|
||||
|
@ -329,13 +330,26 @@ globals:
|
|||
email: Email
|
||||
SSN: SSN
|
||||
fi: FI
|
||||
packing: ITP
|
||||
myTeam: My team
|
||||
departmentFk: Department
|
||||
from: From
|
||||
to: To
|
||||
supplierFk: Supplier
|
||||
supplierRef: Supplier ref
|
||||
serial: Serial
|
||||
amount: Importe
|
||||
awbCode: AWB
|
||||
correctedFk: Rectified
|
||||
correctingFk: Rectificative
|
||||
daysOnward: Days onward
|
||||
countryFk: Country
|
||||
companyFk: Company
|
||||
changePass: Change password
|
||||
deleteConfirmTitle: Delete selected elements
|
||||
changeState: Change state
|
||||
raid: 'Raid {daysInForward} days'
|
||||
isVies: Vies
|
||||
errors:
|
||||
statusUnauthorized: Access denied
|
||||
statusInternalServerError: An internal server error has ocurred
|
||||
|
@ -369,6 +383,11 @@ resetPassword:
|
|||
repeatPassword: Repeat password
|
||||
passwordNotMatch: Passwords don't match
|
||||
passwordChanged: Password changed
|
||||
cau:
|
||||
title: Send cau
|
||||
subtitle: By sending this ticket, all the data related to the error, the section, the user, etc., are already sent.
|
||||
inputLabel: Explain why this error should not appear
|
||||
askPrivileges: Ask for privileges
|
||||
entry:
|
||||
list:
|
||||
newEntry: New entry
|
||||
|
@ -398,8 +417,8 @@ entry:
|
|||
buys: Buys
|
||||
stickers: Stickers
|
||||
package: Package
|
||||
packing: Packing
|
||||
grouping: Grouping
|
||||
packing: Pack.
|
||||
grouping: Group.
|
||||
buyingValue: Buying value
|
||||
import: Import
|
||||
pvp: PVP
|
||||
|
@ -724,7 +743,6 @@ supplier:
|
|||
sageTransactionTypeFk: Sage transaction type
|
||||
supplierActivityFk: Supplier activity
|
||||
isTrucker: Trucker
|
||||
isVies: Vies
|
||||
billingData:
|
||||
payMethodFk: Billing data
|
||||
payDemFk: Payment deadline
|
||||
|
|
|
@ -131,6 +131,7 @@ globals:
|
|||
small: Pequeño/a
|
||||
medium: Mediano/a
|
||||
big: Grande
|
||||
email: Correo
|
||||
pageTitles:
|
||||
logIn: Inicio de sesión
|
||||
addressEdit: Modificar consignatario
|
||||
|
@ -335,11 +336,22 @@ globals:
|
|||
SSN: NSS
|
||||
fi: NIF
|
||||
myTeam: Mi equipo
|
||||
from: Desde
|
||||
to: Hasta
|
||||
supplierFk: Proveedor
|
||||
supplierRef: Ref. proveedor
|
||||
serial: Serie
|
||||
amount: Importe
|
||||
awbCode: AWB
|
||||
daysOnward: Días adelante
|
||||
packing: ITP
|
||||
countryFk: País
|
||||
companyFk: Empresa
|
||||
changePass: Cambiar contraseña
|
||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||
changeState: Cambiar estado
|
||||
raid: 'Redada {daysInForward} días'
|
||||
isVies: Vies
|
||||
errors:
|
||||
statusUnauthorized: Acceso denegado
|
||||
statusInternalServerError: Ha ocurrido un error interno del servidor
|
||||
|
@ -371,6 +383,11 @@ resetPassword:
|
|||
repeatPassword: Repetir contraseña
|
||||
passwordNotMatch: Las contraseñas no coinciden
|
||||
passwordChanged: Contraseña cambiada
|
||||
cau:
|
||||
title: Enviar cau
|
||||
subtitle: Al enviar este cau ya se envían todos los datos relacionados con el error, la sección, el usuario, etc
|
||||
inputLabel: Explique el motivo por el que no deberia aparecer este fallo
|
||||
askPrivileges: Solicitar permisos
|
||||
entry:
|
||||
list:
|
||||
newEntry: Nueva entrada
|
||||
|
@ -401,8 +418,8 @@ entry:
|
|||
buys: Compras
|
||||
stickers: Etiquetas
|
||||
package: Embalaje
|
||||
packing: Packing
|
||||
grouping: Grouping
|
||||
packing: Pack.
|
||||
grouping: Group.
|
||||
buyingValue: Coste
|
||||
import: Importe
|
||||
pvp: PVP
|
||||
|
@ -492,7 +509,7 @@ invoiceOut:
|
|||
ticketList: Listado de tickets
|
||||
summary:
|
||||
issued: Fecha
|
||||
dued: Vencimiento
|
||||
dued: Fecha límite
|
||||
booked: Contabilizada
|
||||
taxBreakdown: Desglose impositivo
|
||||
taxableBase: Base imp.
|
||||
|
@ -719,7 +736,6 @@ supplier:
|
|||
sageTransactionTypeFk: Tipo de transacción sage
|
||||
supplierActivityFk: Actividad proveedor
|
||||
isTrucker: Transportista
|
||||
isVies: Vies
|
||||
billingData:
|
||||
payMethodFk: Forma de pago
|
||||
payDemFk: Plazo de pago
|
||||
|
|
|
@ -1,50 +1,10 @@
|
|||
<script setup>
|
||||
import { useQuasar } from 'quasar';
|
||||
import Navbar from 'src/components/NavBar.vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import routes from 'src/router/modules';
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
const quasar = useQuasar();
|
||||
|
||||
onMounted(() => {
|
||||
let isNotified = false;
|
||||
|
||||
const router = useRouter();
|
||||
const keyBindingMap = routes
|
||||
.filter((route) => route.meta.keyBinding)
|
||||
.reduce((map, route) => {
|
||||
map['Key' + route.meta.keyBinding.toUpperCase()] = route.path;
|
||||
return map;
|
||||
}, {});
|
||||
|
||||
const handleKeyDown = (event) => {
|
||||
const { ctrlKey, altKey, code } = event;
|
||||
|
||||
if (ctrlKey && altKey && keyBindingMap[code] && !isNotified) {
|
||||
event.preventDefault();
|
||||
router.push(keyBindingMap[code]);
|
||||
isNotified = true;
|
||||
}
|
||||
};
|
||||
|
||||
const handleKeyUp = (event) => {
|
||||
const { ctrlKey, altKey } = event;
|
||||
|
||||
if (!ctrlKey || !altKey) {
|
||||
isNotified = false;
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
window.addEventListener('keyup', handleKeyUp);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<QLayout view="hHh LpR fFf" v-shortcut>
|
||||
<Navbar />
|
||||
<RouterView></RouterView>
|
||||
<QFooter v-if="quasar.platform.is.mobile"></QFooter>
|
||||
<QFooter v-if="$q.platform.is.mobile"></QFooter>
|
||||
</QLayout>
|
||||
</template>
|
||||
|
|
|
@ -31,7 +31,6 @@ const rolesOptions = ref([]);
|
|||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:search-button="true"
|
||||
:hidden-tags="['search']"
|
||||
:redirect="false"
|
||||
search-url="table"
|
||||
>
|
||||
|
|
|
@ -7,6 +7,7 @@ import AccountSummary from './Card/AccountSummary.vue';
|
|||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import AccountFilter from './AccountFilter.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const tableRef = ref();
|
||||
|
@ -22,10 +23,27 @@ const columns = computed(() => [
|
|||
field: 'id',
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'name',
|
||||
label: t('Name'),
|
||||
component: 'input',
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'roleFk',
|
||||
label: t('role'),
|
||||
label: t('Role'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'VnRoles',
|
||||
optionValue: 'id',
|
||||
optionLabel: 'name',
|
||||
},
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
name: 'roleFk',
|
||||
|
@ -35,7 +53,11 @@ const columns = computed(() => [
|
|||
optionLabel: 'name',
|
||||
},
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: ({ role }, dashIfEmpty) => dashIfEmpty(role?.name),
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -51,20 +73,32 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'name',
|
||||
label: t('Name'),
|
||||
name: 'email',
|
||||
label: t('Email'),
|
||||
component: 'input',
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'email',
|
||||
label: t('email'),
|
||||
component: 'input',
|
||||
name: 'password',
|
||||
label: t('Password'),
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
attrs: {},
|
||||
required: true,
|
||||
visible: false,
|
||||
},
|
||||
|
||||
{
|
||||
align: 'left',
|
||||
name: 'active',
|
||||
label: t('Active'),
|
||||
component: 'checkbox',
|
||||
create: true,
|
||||
visible: false,
|
||||
},
|
||||
|
@ -101,7 +135,6 @@ const exprBuilder = (param, value) => {
|
|||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnSearchbar
|
||||
data-key="AccountList"
|
||||
|
@ -119,6 +152,12 @@ const exprBuilder = (param, value) => {
|
|||
ref="tableRef"
|
||||
data-key="AccountList"
|
||||
url="VnUsers/preview"
|
||||
:create="{
|
||||
urlCreate: 'VnUsers',
|
||||
title: t('Create user'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: {},
|
||||
}"
|
||||
:filter="filter"
|
||||
order="id DESC"
|
||||
:columns="columns"
|
||||
|
@ -127,7 +166,19 @@ const exprBuilder = (param, value) => {
|
|||
:use-model="true"
|
||||
:right-search="false"
|
||||
auto-load
|
||||
>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<QCardSection>
|
||||
<VnInput
|
||||
:label="t('Password')"
|
||||
v-model="data.password"
|
||||
type="password"
|
||||
:required="true"
|
||||
autocomplete="new-password"
|
||||
/>
|
||||
</QCardSection>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
@ -135,4 +186,7 @@ const exprBuilder = (param, value) => {
|
|||
Id: Id
|
||||
Nickname: Nickname
|
||||
Name: Nombre
|
||||
Password: Contraseña
|
||||
Active: Activo
|
||||
Role: Rol
|
||||
</i18n>
|
||||
|
|
|
@ -37,11 +37,7 @@ onBeforeMount(() => {
|
|||
@on-fetch="(data) => (rolesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:search-button="true"
|
||||
:hidden-tags="['search']"
|
||||
>
|
||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ t(`acls.aclFilter.${tag.label}`) }}: </strong>
|
||||
|
|
|
@ -13,12 +13,7 @@ const props = defineProps({
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<VnFilterPanel
|
||||
:data-key="props.dataKey"
|
||||
:search-button="true"
|
||||
:hidden-tags="['search']"
|
||||
:redirect="false"
|
||||
>
|
||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true" :redirect="false">
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ t(`role.${tag.label}`) }}: </strong>
|
||||
|
|
|
@ -6,6 +6,7 @@ import CrudModel from 'components/CrudModel.vue';
|
|||
import FetchData from 'components/FetchData.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import { tMobile } from 'composables/tMobile';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
|
@ -157,19 +158,14 @@ const columns = computed(() => [
|
|||
auto-width
|
||||
@keyup.ctrl.enter.stop="claimDevelopmentForm.saveChanges()"
|
||||
>
|
||||
<VnSelect
|
||||
<VnSelectWorker
|
||||
v-if="col.name == 'worker'"
|
||||
v-model="row[col.model]"
|
||||
:url="col.url"
|
||||
:where="col.where"
|
||||
:sort-by="col.sortBy"
|
||||
:options="col.options"
|
||||
:option-value="col.optionValue"
|
||||
:option-label="col.optionLabel"
|
||||
:autofocus="col.tabIndex == 1"
|
||||
input-debounce="0"
|
||||
hide-selected
|
||||
>
|
||||
<template #option="scope" v-if="col.name == 'worker'">
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||
|
@ -180,7 +176,20 @@ const columns = computed(() => [
|
|||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</VnSelectWorker>
|
||||
<VnSelect
|
||||
v-else
|
||||
v-model="row[col.model]"
|
||||
:url="col.url"
|
||||
:where="col.where"
|
||||
:sort-by="col.sortBy"
|
||||
:options="col.options"
|
||||
:option-value="col.optionValue"
|
||||
:option-label="col.optionLabel"
|
||||
:autofocus="col.tabIndex == 1"
|
||||
input-debounce="0"
|
||||
hide-selected
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #item="props">
|
||||
|
|
|
@ -120,13 +120,13 @@ const developmentColumns = ref([
|
|||
{
|
||||
name: 'claimReason',
|
||||
label: 'claim.reason',
|
||||
field: (row) => row.claimReason.description,
|
||||
field: (row) => row.claimReason?.description,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'claimResult',
|
||||
label: 'claim.result',
|
||||
field: (row) => row.claimResult.description,
|
||||
field: (row) => row.claimResult?.description,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@ import FormModel from 'components/FormModel.vue';
|
|||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -16,7 +16,6 @@ const { t } = useI18n();
|
|||
|
||||
const businessTypes = ref([]);
|
||||
const contactChannels = ref([]);
|
||||
const title = ref();
|
||||
const handleSalesModelValue = (val) => ({
|
||||
or: [
|
||||
{ id: val },
|
||||
|
@ -117,41 +116,17 @@ function onBeforeSave(formData, originalData) {
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
url="Workers/search"
|
||||
v-model="data.salesPersonFk"
|
||||
<VnSelectWorker
|
||||
:label="t('customer.summary.salesPerson')"
|
||||
v-model="data.salesPersonFk"
|
||||
:params="{
|
||||
departmentCodes: ['VT', 'shopping'],
|
||||
}"
|
||||
:fields="['id', 'nickname']"
|
||||
sort-by="nickname ASC"
|
||||
option-label="nickname"
|
||||
option-value="id"
|
||||
:has-avatar="true"
|
||||
:rules="validate('client.salesPersonFk')"
|
||||
:expr-builder="exprBuilder"
|
||||
emit-value
|
||||
auto-load
|
||||
>
|
||||
<template #prepend>
|
||||
<VnAvatar
|
||||
:worker-id="data.salesPersonFk"
|
||||
color="primary"
|
||||
:title="title"
|
||||
/>
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||
<QItemLabel caption
|
||||
>{{ scope.opt?.nickname }},
|
||||
{{ scope.opt?.code }}</QItemLabel
|
||||
>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<VnSelect
|
||||
v-model="data.contactChannelFk"
|
||||
:options="contactChannels"
|
||||
|
|
|
@ -110,7 +110,7 @@ function handleLocation(data, location) {
|
|||
<VnRow>
|
||||
<QCheckbox :label="t('Has to invoice')" v-model="data.hasToInvoice" />
|
||||
<div>
|
||||
<QCheckbox :label="t('Vies')" v-model="data.isVies" />
|
||||
<QCheckbox :label="t('globals.isVies')" v-model="data.isVies" />
|
||||
<QIcon name="info" class="cursor-info q-ml-sm" size="sm">
|
||||
<QTooltip>
|
||||
{{ t('whenActivatingIt') }}
|
||||
|
@ -169,7 +169,6 @@ es:
|
|||
Active: Activo
|
||||
Frozen: Congelado
|
||||
Has to invoice: Factura
|
||||
Vies: Vies
|
||||
Notify by email: Notificar vía e-mail
|
||||
Invoice by address: Facturar por consignatario
|
||||
Is equalizated: Recargo de equivalencia
|
||||
|
|
|
@ -173,7 +173,7 @@ const sumRisk = ({ clientRisks }) => {
|
|||
:label="t('customer.summary.notifyByEmail')"
|
||||
:value="entity.isToBeMailed"
|
||||
/>
|
||||
<VnLv :label="t('customer.summary.vies')" :value="entity.isVies" />
|
||||
<VnLv :label="t('globals.isVies')" :value="entity.isVies" />
|
||||
</VnRow>
|
||||
</QCard>
|
||||
<QCard class="vn-one">
|
||||
|
|
|
@ -3,6 +3,7 @@ import { useI18n } from 'vue-i18n';
|
|||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
defineProps({
|
||||
|
@ -65,19 +66,14 @@ const exprBuilder = (param, value) => {
|
|||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
url="Workers/search"
|
||||
<VnSelectWorker
|
||||
:label="t('Salesperson')"
|
||||
v-model="params.salesPersonFk"
|
||||
:params="{
|
||||
departmentCodes: ['VT'],
|
||||
}"
|
||||
auto-load
|
||||
:label="t('Salesperson')"
|
||||
:expr-builder="exprBuilder"
|
||||
v-model="params.salesPersonFk"
|
||||
@update:model-value="searchFn()"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
sort-by="nickname ASC"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
|
@ -86,18 +82,7 @@ const exprBuilder = (param, value) => {
|
|||
outlined
|
||||
rounded
|
||||
:input-debounce="0"
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ opt.nickname }},{{ opt.code }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template></VnSelect
|
||||
>
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import { ref, computed, markRaw } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||
|
@ -12,7 +11,7 @@ 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';
|
||||
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
|
@ -264,7 +263,7 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('customer.extendedList.tableVisibleColumns.isVies'),
|
||||
label: t('globals.isVies'),
|
||||
name: 'isVies',
|
||||
columnFilter: {
|
||||
inWhere: true,
|
||||
|
@ -422,40 +421,17 @@ function handleLocation(data, location) {
|
|||
auto-load
|
||||
>
|
||||
<template #more-create-dialog="{ data }">
|
||||
<VnSelect
|
||||
url="Workers/search"
|
||||
v-model="data.salesPersonFk"
|
||||
<VnSelectWorker
|
||||
:label="t('customer.summary.salesPerson')"
|
||||
v-model="data.salesPersonFk"
|
||||
:params="{
|
||||
departmentCodes: ['VT', 'shopping'],
|
||||
}"
|
||||
:fields="['id', 'nickname', 'code']"
|
||||
sort-by="nickname ASC"
|
||||
option-label="nickname"
|
||||
option-value="id"
|
||||
:has-avatar="true"
|
||||
:id-value="data.salesPersonFk"
|
||||
emit-value
|
||||
auto-load
|
||||
>
|
||||
<template #prepend>
|
||||
<VnAvatar
|
||||
:worker-id="data.salesPersonFk"
|
||||
color="primary"
|
||||
:title="title"
|
||||
/>
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||
<QItemLabel caption
|
||||
>{{ scope.opt?.nickname }},
|
||||
{{ scope.opt?.code }}</QItemLabel
|
||||
>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
|
||||
<VnLocation
|
||||
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
|
||||
v-model="data.location"
|
||||
|
|
|
@ -12,6 +12,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
|||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||
import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
@ -144,7 +145,6 @@ function handleLocation(data, location) {
|
|||
:url="`Addresses/${route.params.addressId}`"
|
||||
@on-data-saved="onDataSaved()"
|
||||
auto-load
|
||||
model="customer"
|
||||
>
|
||||
<template #moreActions>
|
||||
<QBtn
|
||||
|
@ -220,7 +220,6 @@ function handleLocation(data, location) {
|
|||
</div>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<div class="col">
|
||||
<VnSelect
|
||||
:label="t('Incoterms')"
|
||||
:options="incoterms"
|
||||
|
@ -229,8 +228,6 @@ function handleLocation(data, location) {
|
|||
option-value="code"
|
||||
v-model="data.incotermsFk"
|
||||
/>
|
||||
</div>
|
||||
<div class="col">
|
||||
<VnSelectDialog
|
||||
:label="t('Customs agent')"
|
||||
:options="customsAgents"
|
||||
|
@ -244,7 +241,14 @@ function handleLocation(data, location) {
|
|||
<CustomerNewCustomsAgent />
|
||||
</template>
|
||||
</VnSelectDialog>
|
||||
</div>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInputNumber
|
||||
:label="t('Longitude')"
|
||||
clearable
|
||||
v-model="data.longitude"
|
||||
/>
|
||||
<VnInputNumber :label="t('Latitude')" clearable v-model="data.latitude" />
|
||||
</VnRow>
|
||||
<h4 class="q-mb-xs">{{ t('Notes') }}</h4>
|
||||
<VnRow
|
||||
|
@ -322,4 +326,6 @@ es:
|
|||
Description: Descripción
|
||||
Add note: Añadir nota
|
||||
Remove note: Eliminar nota
|
||||
Longitude: Longitud
|
||||
Latitude: Latitud
|
||||
</i18n>
|
||||
|
|
|
@ -88,7 +88,6 @@ customer:
|
|||
businessTypeFk: Business type
|
||||
sageTaxTypeFk: Sage tax type
|
||||
sageTransactionTypeFk: Sage tr. type
|
||||
isVies: Vies
|
||||
isTaxDataChecked: Verified data
|
||||
isFreezed: Freezed
|
||||
hasToInvoice: Invoice
|
||||
|
|
|
@ -90,7 +90,6 @@ customer:
|
|||
businessTypeFk: Tipo de negocio
|
||||
sageTaxTypeFk: Tipo de impuesto Sage
|
||||
sageTransactionTypeFk: Tipo tr. sage
|
||||
isVies: Vies
|
||||
isTaxDataChecked: Datos comprobados
|
||||
isFreezed: Congelado
|
||||
hasToInvoice: Factura
|
||||
|
|
|
@ -6,6 +6,7 @@ import FormModel from 'components/FormModel.vue';
|
|||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -48,14 +49,9 @@ const { t } = useI18n();
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
<VnSelectWorker
|
||||
:label="t('department.bossDepartment')"
|
||||
v-model="data.workerFk"
|
||||
url="Workers/search"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
hide-selected
|
||||
map-options
|
||||
:rules="validate('department.workerFk')"
|
||||
/>
|
||||
<VnSelect
|
||||
|
|
|
@ -83,7 +83,7 @@ const { openConfirmationModal } = useVnConfirm();
|
|||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv :label="t('department.chat')" :value="entity.chatName" />
|
||||
<VnLv :label="t('department.email')" :value="entity.notificationEmail" copy />
|
||||
<VnLv :label="t('globals.email')" :value="entity.notificationEmail" copy />
|
||||
<VnLv
|
||||
:label="t('department.selfConsumptionCustomer')"
|
||||
:value="entity.client?.name"
|
||||
|
|
|
@ -58,7 +58,7 @@ onMounted(async () => {
|
|||
dash
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('department.email')"
|
||||
:label="t('globals.email')"
|
||||
:value="department.notificationEmail"
|
||||
dash
|
||||
/>
|
||||
|
|
|
@ -249,6 +249,7 @@ function deleteFile(dmsFk) {
|
|||
:options="currencies"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
sort-by="id"
|
||||
/>
|
||||
|
||||
<VnSelect
|
||||
|
@ -262,7 +263,7 @@ function deleteFile(dmsFk) {
|
|||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('invoiceIn.summary.sage')"
|
||||
:label="t('InvoiceIn.summary.sage')"
|
||||
v-model="data.withholdingSageFk"
|
||||
:options="sageWithholdings"
|
||||
option-value="id"
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ref, computed, capitalize } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||
import CrudModel from 'src/components/CrudModel.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
|
||||
const { push, currentRoute } = useRouter();
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
||||
const invoiceId = +currentRoute.value.params.id;
|
||||
const arrayData = useArrayData();
|
||||
const invoiceIn = computed(() => arrayData.store.data);
|
||||
const invoiceInCorrectionRef = ref();
|
||||
const filter = {
|
||||
include: { relation: 'invoiceIn' },
|
||||
where: { correctingFk: invoiceId },
|
||||
where: { correctingFk: route.params.id },
|
||||
};
|
||||
const columns = computed(() => [
|
||||
{
|
||||
|
@ -31,7 +29,7 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
name: 'type',
|
||||
label: useCapitalize(t('globals.type')),
|
||||
label: capitalize(t('globals.type')),
|
||||
field: (row) => row.cplusRectificationTypeFk,
|
||||
options: cplusRectificationTypes.value,
|
||||
model: 'cplusRectificationTypeFk',
|
||||
|
@ -43,10 +41,10 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
name: 'class',
|
||||
label: useCapitalize(t('globals.class')),
|
||||
field: (row) => row.siiTypeInvoiceOutFk,
|
||||
options: siiTypeInvoiceOuts.value,
|
||||
model: 'siiTypeInvoiceOutFk',
|
||||
label: capitalize(t('globals.class')),
|
||||
field: (row) => row.siiTypeInvoiceInFk,
|
||||
options: siiTypeInvoiceIns.value,
|
||||
model: 'siiTypeInvoiceInFk',
|
||||
optionValue: 'id',
|
||||
optionLabel: 'code',
|
||||
sortable: true,
|
||||
|
@ -55,7 +53,7 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
name: 'reason',
|
||||
label: useCapitalize(t('globals.reason')),
|
||||
label: capitalize(t('globals.reason')),
|
||||
field: (row) => row.invoiceCorrectionTypeFk,
|
||||
options: invoiceCorrectionTypes.value,
|
||||
model: 'invoiceCorrectionTypeFk',
|
||||
|
@ -67,13 +65,10 @@ const columns = computed(() => [
|
|||
},
|
||||
]);
|
||||
const cplusRectificationTypes = ref([]);
|
||||
const siiTypeInvoiceOuts = ref([]);
|
||||
const siiTypeInvoiceIns = ref([]);
|
||||
const invoiceCorrectionTypes = ref([]);
|
||||
const rowsSelected = ref([]);
|
||||
|
||||
const requiredFieldRule = (val) => val || t('globals.requiredField');
|
||||
|
||||
const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`);
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -82,9 +77,9 @@ const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`
|
|||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="SiiTypeInvoiceOuts"
|
||||
url="SiiTypeInvoiceIns"
|
||||
:where="{ code: { like: 'R%' } }"
|
||||
@on-fetch="(data) => (siiTypeInvoiceOuts = data)"
|
||||
@on-fetch="(data) => (siiTypeInvoiceIns = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
|
@ -99,17 +94,14 @@ const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`
|
|||
url="InvoiceInCorrections"
|
||||
:filter="filter"
|
||||
auto-load
|
||||
v-model:selected="rowsSelected"
|
||||
primary-key="correctingFk"
|
||||
@save-changes="onSave"
|
||||
:default-remove="false"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<QTable
|
||||
v-model:selected="rowsSelected"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="$index"
|
||||
selection="single"
|
||||
:grid="$q.screen.lt.sm"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
>
|
||||
|
@ -121,8 +113,17 @@ const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`
|
|||
:options="col.options"
|
||||
:option-value="col.optionValue"
|
||||
:option-label="col.optionLabel"
|
||||
:readonly="row.invoiceIn.isBooked"
|
||||
/>
|
||||
:disable="row.invoiceIn.isBooked"
|
||||
:filter-options="['description']"
|
||||
>
|
||||
<template #option="{ opt, itemProps }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ opt.description }}</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-class="{ row, col }">
|
||||
|
@ -134,8 +135,20 @@ const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`
|
|||
:option-value="col.optionValue"
|
||||
:option-label="col.optionLabel"
|
||||
:rules="[requiredFieldRule]"
|
||||
:readonly="row.invoiceIn.isBooked"
|
||||
/>
|
||||
:filter-options="['code', 'description']"
|
||||
:disable="row.invoiceIn.isBooked"
|
||||
>
|
||||
<template #option="{ opt, itemProps }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
>{{ opt.code }} -
|
||||
{{ opt.description }}</QItemLabel
|
||||
>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-reason="{ row, col }">
|
||||
|
@ -147,7 +160,7 @@ const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`
|
|||
:option-value="col.optionValue"
|
||||
:option-label="col.optionLabel"
|
||||
:rules="[requiredFieldRule]"
|
||||
:readonly="row.invoiceIn.isBooked"
|
||||
:disable="row.invoiceIn.isBooked"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
|
@ -155,7 +168,6 @@ const onSave = (data) => data.deletes && push(`/invoice-in/${invoiceId}/summary`
|
|||
</template>
|
||||
</CrudModel>
|
||||
</template>
|
||||
<style lang="scss" scoped></style>
|
||||
<i18n>
|
||||
es:
|
||||
Original invoice: Factura origen
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, reactive, computed, onBeforeMount } from 'vue';
|
||||
import { ref, reactive, computed, onBeforeMount, capitalize } from 'vue';
|
||||
import { useRouter, onBeforeRouteUpdate } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
@ -15,7 +15,6 @@ import FetchData from 'src/components/FetchData.vue';
|
|||
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||
import InvoiceInToBook from '../InvoiceInToBook.vue';
|
||||
|
||||
|
@ -37,7 +36,7 @@ const totalAmount = ref();
|
|||
const currentAction = ref();
|
||||
const config = ref();
|
||||
const cplusRectificationTypes = ref([]);
|
||||
const siiTypeInvoiceOuts = ref([]);
|
||||
const siiTypeInvoiceIns = ref([]);
|
||||
const invoiceCorrectionTypes = ref([]);
|
||||
const actions = {
|
||||
unbook: {
|
||||
|
@ -91,7 +90,7 @@ const routes = reactive({
|
|||
return {
|
||||
name: 'InvoiceInList',
|
||||
query: {
|
||||
params: JSON.stringify({ supplierFk: id }),
|
||||
table: JSON.stringify({ supplierFk: id }),
|
||||
},
|
||||
};
|
||||
},
|
||||
|
@ -100,7 +99,7 @@ const routes = reactive({
|
|||
return {
|
||||
name: 'InvoiceInList',
|
||||
query: {
|
||||
params: JSON.stringify({ correctedFk: entityId.value }),
|
||||
table: JSON.stringify({ correctedFk: entityId.value }),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -119,21 +118,21 @@ const routes = reactive({
|
|||
const correctionFormData = reactive({
|
||||
invoiceReason: 2,
|
||||
invoiceType: 2,
|
||||
invoiceClass: 6,
|
||||
invoiceClass: 8,
|
||||
});
|
||||
const isNotFilled = computed(() => Object.values(correctionFormData).includes(null));
|
||||
|
||||
onBeforeMount(async () => {
|
||||
await setInvoiceCorrection(entityId.value);
|
||||
const { data } = await axios.get(`InvoiceIns/${entityId.value}/getTotals`);
|
||||
totalAmount.value = data.totalDueDay;
|
||||
totalAmount.value = data.totalTaxableBase;
|
||||
});
|
||||
|
||||
onBeforeRouteUpdate(async (to, from) => {
|
||||
if (to.params.id !== from.params.id) {
|
||||
await setInvoiceCorrection(to.params.id);
|
||||
const { data } = await axios.get(`InvoiceIns/${to.params.id}/getTotals`);
|
||||
totalAmount.value = data.totalDueDay;
|
||||
totalAmount.value = data.totalTaxableBase;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -207,7 +206,8 @@ const isAgricultural = () => {
|
|||
};
|
||||
|
||||
function showPdfInvoice() {
|
||||
if (isAgricultural()) openReport(`InvoiceIns/${entityId.value}/invoice-in-pdf`);
|
||||
if (isAgricultural())
|
||||
openReport(`InvoiceIns/${entityId.value}/invoice-in-pdf`, null, '_blank');
|
||||
}
|
||||
|
||||
function sendPdfInvoiceConfirmation() {
|
||||
|
@ -262,9 +262,9 @@ const createInvoiceInCorrection = async () => {
|
|||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="SiiTypeInvoiceOuts"
|
||||
url="siiTypeInvoiceIns"
|
||||
:where="{ code: { like: 'R%' } }"
|
||||
@on-fetch="(data) => (siiTypeInvoiceOuts = data)"
|
||||
@on-fetch="(data) => (siiTypeInvoiceIns = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
|
@ -355,10 +355,13 @@ const createInvoiceInCorrection = async () => {
|
|||
</QItem>
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv :label="t('invoiceIn.list.issued')" :value="toDate(entity.issued)" />
|
||||
<VnLv :label="t('invoiceIn.summary.booked')" :value="toDate(entity.booked)" />
|
||||
<VnLv :label="t('invoiceIn.list.amount')" :value="toCurrency(totalAmount)" />
|
||||
<VnLv :label="t('invoiceIn.list.supplier')">
|
||||
<VnLv :label="t('InvoiceIn.list.issued')" :value="toDate(entity.issued)" />
|
||||
<VnLv
|
||||
:label="t('InvoiceIn.summary.bookedDate')"
|
||||
:value="toDate(entity.booked)"
|
||||
/>
|
||||
<VnLv :label="t('InvoiceIn.list.amount')" :value="toCurrency(totalAmount)" />
|
||||
<VnLv :label="t('InvoiceIn.list.supplier')">
|
||||
<template #value>
|
||||
<span class="link">
|
||||
{{ entity?.supplier?.nickname }}
|
||||
|
@ -375,7 +378,7 @@ const createInvoiceInCorrection = async () => {
|
|||
color="primary"
|
||||
:to="routes.getSupplier(entity.supplierFk)"
|
||||
>
|
||||
<QTooltip>{{ t('invoiceIn.list.supplier') }}</QTooltip>
|
||||
<QTooltip>{{ t('InvoiceIn.list.supplier') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
size="md"
|
||||
|
@ -391,7 +394,7 @@ const createInvoiceInCorrection = async () => {
|
|||
color="primary"
|
||||
:to="routes.getTickets(entity.supplierFk)"
|
||||
>
|
||||
<QTooltip>{{ t('invoiceOut.card.ticketList') }}</QTooltip>
|
||||
<QTooltip>{{ t('InvoiceIn.descriptor.ticketList') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
v-if="
|
||||
|
@ -435,9 +438,9 @@ const createInvoiceInCorrection = async () => {
|
|||
readonly
|
||||
/>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.class'))}`"
|
||||
:label="`${capitalize(t('globals.class'))}`"
|
||||
v-model="correctionFormData.invoiceClass"
|
||||
:options="siiTypeInvoiceOuts"
|
||||
:options="siiTypeInvoiceIns"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
:required="true"
|
||||
|
@ -445,15 +448,27 @@ const createInvoiceInCorrection = async () => {
|
|||
</QItemSection>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.type'))}`"
|
||||
:label="`${capitalize(t('globals.type'))}`"
|
||||
v-model="correctionFormData.invoiceType"
|
||||
:options="cplusRectificationTypes"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:required="true"
|
||||
/>
|
||||
>
|
||||
<template #option="{ opt }">
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
>{{ opt.code }} -
|
||||
{{ opt.description }}</QItemLabel
|
||||
>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<div></div>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<VnSelect
|
||||
:label="`${useCapitalize(t('globals.reason'))}`"
|
||||
:label="`${capitalize(t('globals.reason'))}`"
|
||||
v-model="correctionFormData.invoiceReason"
|
||||
:options="invoiceCorrectionTypes"
|
||||
option-value="id"
|
||||
|
|
|
@ -25,6 +25,7 @@ const banks = ref([]);
|
|||
const invoiceInFormRef = ref();
|
||||
const invoiceId = +route.params.id;
|
||||
const filter = { where: { invoiceInFk: invoiceId } };
|
||||
const areRows = ref(false);
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
|
@ -143,8 +144,6 @@ async function insert() {
|
|||
}"
|
||||
:disable="!isNotEuro(currency)"
|
||||
v-model="row.foreignValue"
|
||||
clearable
|
||||
clear-icon="close"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
|
@ -230,7 +229,14 @@ async function insert() {
|
|||
</template>
|
||||
</CrudModel>
|
||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||
<QBtn color="primary" icon="add" shortcut="+" size="lg" round @click="insert" />
|
||||
<QBtn
|
||||
color="primary"
|
||||
icon="add"
|
||||
shortcut="+"
|
||||
size="lg"
|
||||
round
|
||||
@click="!areRows ? insert() : invoiceInFormRef.insert()"
|
||||
/>
|
||||
</QPageSticky>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -26,7 +26,7 @@ const columns = computed(() => [
|
|||
options: intrastats.value,
|
||||
model: 'intrastatFk',
|
||||
optionValue: 'id',
|
||||
optionLabel: 'description',
|
||||
optionLabel: (row) => `${row.id}: ${row.description}`,
|
||||
sortable: true,
|
||||
tabIndex: 1,
|
||||
align: 'left',
|
||||
|
@ -68,12 +68,6 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
},
|
||||
]);
|
||||
|
||||
const formatOpt = (row, { model, options }, prop) => {
|
||||
const obj = row[model];
|
||||
const option = options.find(({ id }) => id == obj);
|
||||
return option ? `${obj}:${option[prop]}` : '';
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -118,12 +112,10 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
<VnSelect
|
||||
v-model="row[col.model]"
|
||||
:options="col.options"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:option-value="col.optionValue"
|
||||
:option-label="col.optionLabel"
|
||||
:filter-options="['id', 'description']"
|
||||
:hide-selected="false"
|
||||
:fill-input="false"
|
||||
:display-value="formatOpt(row, col, 'description')"
|
||||
data-cy="intrastat-code"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
@ -138,8 +130,8 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
<VnSelect
|
||||
v-model="row[col.model]"
|
||||
:options="col.options"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
:option-value="col.optionValue"
|
||||
:option-label="col.optionLabel"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
|
@ -154,7 +146,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
{{ getTotal(rows, 'net') }}
|
||||
</QTd>
|
||||
<QTd>
|
||||
{{ getTotal(rows, 'stems') }}
|
||||
{{ getTotal(rows, 'stems', { decimalPlaces: 0 }) }}
|
||||
</QTd>
|
||||
<QTd />
|
||||
</QTr>
|
||||
|
@ -174,7 +166,9 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
v-model="props.row['intrastatFk']"
|
||||
:options="intrastats"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
:option-label="
|
||||
(row) => `${row.id}:${row.description}`
|
||||
"
|
||||
:filter-options="['id', 'description']"
|
||||
>
|
||||
<template #option="scope">
|
||||
|
@ -248,11 +242,6 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.q-table tr .q-td:nth-child(2) input) {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<i18n>
|
||||
en:
|
||||
amount: Amount
|
||||
|
@ -261,7 +250,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
country: Country
|
||||
es:
|
||||
Code: Código
|
||||
amount: Cantidad
|
||||
amount: Valor mercancía
|
||||
net: Neto
|
||||
stems: Tallos
|
||||
country: País
|
||||
|
|
|
@ -26,14 +26,14 @@ const intrastatTotals = ref({ amount: 0, net: 0, stems: 0 });
|
|||
const vatColumns = ref([
|
||||
{
|
||||
name: 'expense',
|
||||
label: 'invoiceIn.summary.expense',
|
||||
label: 'InvoiceIn.summary.expense',
|
||||
field: (row) => row.expenseFk,
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'landed',
|
||||
label: 'invoiceIn.summary.taxableBase',
|
||||
label: 'InvoiceIn.summary.taxableBase',
|
||||
field: (row) => row.taxableBase,
|
||||
format: (value) => toCurrency(value),
|
||||
sortable: true,
|
||||
|
@ -41,7 +41,7 @@ const vatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'vat',
|
||||
label: 'invoiceIn.summary.sageVat',
|
||||
label: 'InvoiceIn.summary.sageVat',
|
||||
field: (row) => {
|
||||
if (row.taxTypeSage) return `#${row.taxTypeSage.id} : ${row.taxTypeSage.vat}`;
|
||||
},
|
||||
|
@ -51,7 +51,7 @@ const vatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'transaction',
|
||||
label: 'invoiceIn.summary.sageTransaction',
|
||||
label: 'InvoiceIn.summary.sageTransaction',
|
||||
field: (row) => {
|
||||
if (row.transactionTypeSage)
|
||||
return `#${row.transactionTypeSage.id} : ${row.transactionTypeSage?.transaction}`;
|
||||
|
@ -62,7 +62,7 @@ const vatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'rate',
|
||||
label: 'invoiceIn.summary.rate',
|
||||
label: 'InvoiceIn.summary.rate',
|
||||
field: (row) => taxRate(row.taxableBase, row.taxTypeSage?.rate),
|
||||
format: (value) => toCurrency(value),
|
||||
sortable: true,
|
||||
|
@ -70,7 +70,7 @@ const vatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'currency',
|
||||
label: 'invoiceIn.summary.currency',
|
||||
label: 'InvoiceIn.summary.currency',
|
||||
field: (row) => row.foreignValue,
|
||||
format: (val) => val && toCurrency(val, currency.value),
|
||||
sortable: true,
|
||||
|
@ -81,21 +81,21 @@ const vatColumns = ref([
|
|||
const dueDayColumns = ref([
|
||||
{
|
||||
name: 'date',
|
||||
label: 'invoiceIn.summary.dueDay',
|
||||
label: 'InvoiceIn.summary.dueDay',
|
||||
field: (row) => toDate(row.dueDated),
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'bank',
|
||||
label: 'invoiceIn.summary.bank',
|
||||
label: 'InvoiceIn.summary.bank',
|
||||
field: (row) => row.bank.bank,
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'amount',
|
||||
label: 'invoiceIn.list.amount',
|
||||
label: 'InvoiceIn.list.amount',
|
||||
field: (row) => row.amount,
|
||||
format: (value) => toCurrency(value),
|
||||
sortable: true,
|
||||
|
@ -103,7 +103,7 @@ const dueDayColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'landed',
|
||||
label: 'invoiceIn.summary.foreignValue',
|
||||
label: 'InvoiceIn.summary.foreignValue',
|
||||
field: (row) => row.foreignValue,
|
||||
format: (val) => val && toCurrency(val, currency.value),
|
||||
sortable: true,
|
||||
|
@ -114,7 +114,7 @@ const dueDayColumns = ref([
|
|||
const intrastatColumns = ref([
|
||||
{
|
||||
name: 'code',
|
||||
label: 'invoiceIn.summary.code',
|
||||
label: 'InvoiceIn.summary.code',
|
||||
field: (row) => {
|
||||
return `${row.intrastat.id}: ${row.intrastat?.description}`;
|
||||
},
|
||||
|
@ -123,21 +123,21 @@ const intrastatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'amount',
|
||||
label: 'invoiceIn.list.amount',
|
||||
label: 'InvoiceIn.list.amount',
|
||||
field: (row) => toCurrency(row.amount),
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'net',
|
||||
label: 'invoiceIn.summary.net',
|
||||
label: 'InvoiceIn.summary.net',
|
||||
field: (row) => row.net,
|
||||
sortable: true,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'stems',
|
||||
label: 'invoiceIn.summary.stems',
|
||||
label: 'InvoiceIn.summary.stems',
|
||||
field: (row) => row.stems,
|
||||
format: (value) => value,
|
||||
sortable: true,
|
||||
|
@ -145,7 +145,7 @@ const intrastatColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'landed',
|
||||
label: 'invoiceIn.summary.country',
|
||||
label: 'InvoiceIn.summary.country',
|
||||
field: (row) => row.country?.code,
|
||||
format: (value) => value,
|
||||
sortable: true,
|
||||
|
@ -210,7 +210,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
/>
|
||||
</QCardSection>
|
||||
<VnLv
|
||||
:label="t('invoiceIn.list.supplier')"
|
||||
:label="t('InvoiceIn.list.supplier')"
|
||||
:value="entity.supplier?.name"
|
||||
>
|
||||
<template #value>
|
||||
|
@ -221,14 +221,18 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
</template>
|
||||
</VnLv>
|
||||
<VnLv
|
||||
:label="t('invoiceIn.list.supplierRef')"
|
||||
:label="t('InvoiceIn.list.supplierRef')"
|
||||
:value="entity.supplierRef"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoiceIn.summary.currency')"
|
||||
:label="t('InvoiceIn.summary.currency')"
|
||||
:value="entity.currency?.code"
|
||||
/>
|
||||
<VnLv :label="t('invoiceIn.serial')" :value="`${entity.serial}`" />
|
||||
<VnLv :label="t('InvoiceIn.serial')" :value="`${entity.serial}`" />
|
||||
<VnLv
|
||||
:label="t('globals.country')"
|
||||
:value="entity.supplier?.country?.code"
|
||||
/>
|
||||
</QCard>
|
||||
<QCard class="vn-one">
|
||||
<QCardSection class="q-pa-none">
|
||||
|
@ -239,21 +243,22 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
</QCardSection>
|
||||
<VnLv
|
||||
:ellipsis-value="false"
|
||||
:label="t('invoiceIn.summary.issued')"
|
||||
:label="t('InvoiceIn.summary.issued')"
|
||||
:value="toDate(entity.issued)"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoiceIn.summary.operated')"
|
||||
:label="t('InvoiceIn.summary.operated')"
|
||||
:value="toDate(entity.operated)"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoiceIn.summary.bookEntried')"
|
||||
:label="t('InvoiceIn.summary.bookEntried')"
|
||||
:value="toDate(entity.bookEntried)"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoiceIn.summary.bookedDate')"
|
||||
:label="t('InvoiceIn.summary.bookedDate')"
|
||||
:value="toDate(entity.booked)"
|
||||
/>
|
||||
<VnLv :label="t('globals.isVies')" :value="entity.supplier?.isVies" />
|
||||
</QCard>
|
||||
<QCard class="vn-one">
|
||||
<QCardSection class="q-pa-none">
|
||||
|
@ -263,18 +268,18 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
/>
|
||||
</QCardSection>
|
||||
<VnLv
|
||||
:label="t('invoiceIn.summary.sage')"
|
||||
:label="t('InvoiceIn.summary.sage')"
|
||||
:value="entity.sageWithholding?.withholding"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoiceIn.summary.vat')"
|
||||
:label="t('InvoiceIn.summary.vat')"
|
||||
:value="entity.expenseDeductible?.name"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('invoiceIn.card.company')"
|
||||
:label="t('InvoiceIn.card.company')"
|
||||
:value="entity.company?.code"
|
||||
/>
|
||||
<VnLv :label="t('invoiceIn.isBooked')" :value="invoiceIn?.isBooked" />
|
||||
<VnLv :label="t('InvoiceIn.isBooked')" :value="invoiceIn?.isBooked" />
|
||||
</QCard>
|
||||
<QCard class="vn-one">
|
||||
<QCardSection class="q-pa-none">
|
||||
|
@ -285,11 +290,11 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
</QCardSection>
|
||||
<QCardSection class="q-pa-none">
|
||||
<VnLv
|
||||
:label="t('invoiceIn.summary.taxableBase')"
|
||||
:label="t('InvoiceIn.summary.taxableBase')"
|
||||
:value="toCurrency(entity.totals.totalTaxableBase)"
|
||||
/>
|
||||
<VnLv label="Total" :value="toCurrency(entity.totals.totalVat)" />
|
||||
<VnLv :label="t('invoiceIn.summary.dueTotal')">
|
||||
<VnLv :label="t('InvoiceIn.summary.dueTotal')">
|
||||
<template #value>
|
||||
<QChip
|
||||
dense
|
||||
|
@ -297,8 +302,8 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
:color="amountsNotMatch ? 'negative' : 'transparent'"
|
||||
:title="
|
||||
amountsNotMatch
|
||||
? t('invoiceIn.summary.noMatch')
|
||||
: t('invoiceIn.summary.dueTotal')
|
||||
? t('InvoiceIn.summary.noMatch')
|
||||
: t('InvoiceIn.summary.dueTotal')
|
||||
"
|
||||
>
|
||||
{{ toCurrency(entity.totals.totalDueDay) }}
|
||||
|
@ -309,7 +314,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
</QCard>
|
||||
<!--Vat-->
|
||||
<QCard v-if="entity.invoiceInTax.length" class="vat">
|
||||
<VnTitle :url="getLink('vat')" :text="t('invoiceIn.card.vat')" />
|
||||
<VnTitle :url="getLink('vat')" :text="t('InvoiceIn.card.vat')" />
|
||||
<QTable
|
||||
:columns="vatColumns"
|
||||
:rows="entity.invoiceInTax"
|
||||
|
@ -357,7 +362,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
</QCard>
|
||||
<!--Due Day-->
|
||||
<QCard v-if="entity.invoiceInDueDay.length" class="due-day">
|
||||
<VnTitle :url="getLink('due-day')" :text="t('invoiceIn.card.dueDay')" />
|
||||
<VnTitle :url="getLink('due-day')" :text="t('InvoiceIn.card.dueDay')" />
|
||||
<QTable :columns="dueDayColumns" :rows="entity.invoiceInDueDay" flat>
|
||||
<template #header="dueDayProps">
|
||||
<QTr :props="dueDayProps" class="bg">
|
||||
|
@ -395,7 +400,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
|
|||
<QCard v-if="entity.invoiceInIntrastat.length">
|
||||
<VnTitle
|
||||
:url="getLink('intrastat')"
|
||||
:text="t('invoiceIn.card.intrastat')"
|
||||
:text="t('InvoiceIn.card.intrastat')"
|
||||
/>
|
||||
<QTable
|
||||
:columns="intrastatColumns"
|
||||
|
|
|
@ -11,12 +11,14 @@ import CrudModel from 'src/components/CrudModel.vue';
|
|||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||
import CreateNewExpenseForm from 'src/components/CreateNewExpenseForm.vue';
|
||||
import { getExchange } from 'src/composables/getExchange';
|
||||
import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const arrayData = useArrayData();
|
||||
const route = useRoute();
|
||||
const invoiceIn = computed(() => arrayData.store.data);
|
||||
const invoiceId = +useRoute().params.id;
|
||||
const currency = computed(() => invoiceIn.value?.currency?.code);
|
||||
const expenses = ref([]);
|
||||
const sageTaxTypes = ref([]);
|
||||
|
@ -39,9 +41,8 @@ const columns = computed(() => [
|
|||
options: expenses.value,
|
||||
model: 'expenseFk',
|
||||
optionValue: 'id',
|
||||
optionLabel: 'id',
|
||||
optionLabel: (row) => `${row.id}: ${row.name}`,
|
||||
sortable: true,
|
||||
tabIndex: 1,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
|
@ -50,7 +51,6 @@ const columns = computed(() => [
|
|||
field: (row) => row.taxableBase,
|
||||
model: 'taxableBase',
|
||||
sortable: true,
|
||||
tabIndex: 2,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
|
@ -60,9 +60,8 @@ const columns = computed(() => [
|
|||
options: sageTaxTypes.value,
|
||||
model: 'taxTypeSageFk',
|
||||
optionValue: 'id',
|
||||
optionLabel: 'id',
|
||||
optionLabel: (row) => `${row.id}: ${row.vat}`,
|
||||
sortable: true,
|
||||
tabindex: 3,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
|
@ -72,16 +71,14 @@ const columns = computed(() => [
|
|||
options: sageTransactionTypes.value,
|
||||
model: 'transactionTypeSageFk',
|
||||
optionValue: 'id',
|
||||
optionLabel: 'id',
|
||||
optionLabel: (row) => `${row.id}: ${row.transaction}`,
|
||||
sortable: true,
|
||||
tabIndex: 4,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'rate',
|
||||
label: t('Rate'),
|
||||
sortable: true,
|
||||
tabIndex: 5,
|
||||
field: (row) => taxRate(row, row.taxTypeSageFk),
|
||||
align: 'left',
|
||||
},
|
||||
|
@ -89,7 +86,6 @@ const columns = computed(() => [
|
|||
name: 'foreignvalue',
|
||||
label: t('Foreign value'),
|
||||
sortable: true,
|
||||
tabIndex: 6,
|
||||
field: (row) => row.foreignValue,
|
||||
align: 'left',
|
||||
},
|
||||
|
@ -106,7 +102,7 @@ const filter = {
|
|||
'transactionTypeSageFk',
|
||||
],
|
||||
where: {
|
||||
invoiceInFk: invoiceId,
|
||||
invoiceInFk: route.params.id,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -120,14 +116,20 @@ function taxRate(invoiceInTax) {
|
|||
const taxTypeSage = taxRateSelection?.rate ?? 0;
|
||||
const taxableBase = invoiceInTax?.taxableBase ?? 0;
|
||||
|
||||
return (taxTypeSage / 100) * taxableBase;
|
||||
return ((taxTypeSage / 100) * taxableBase).toFixed(2);
|
||||
}
|
||||
|
||||
const formatOpt = (row, { model, options }, prop) => {
|
||||
const obj = row[model];
|
||||
const option = options.find(({ id }) => id == obj);
|
||||
return option ? `${obj}:${option[prop]}` : '';
|
||||
};
|
||||
function autocompleteExpense(evt, row, col) {
|
||||
const val = evt.target.value;
|
||||
if (!val) return;
|
||||
|
||||
const param = isNaN(val) ? row[col.model] : val;
|
||||
const lookup = expenses.value.find(
|
||||
({ id }) => id == useAccountShortToStandard(param)
|
||||
);
|
||||
|
||||
if (lookup) row[col.model] = lookup;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -148,10 +150,10 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
data-key="InvoiceInTaxes"
|
||||
url="InvoiceInTaxes"
|
||||
:filter="filter"
|
||||
:data-required="{ invoiceInFk: invoiceId }"
|
||||
:data-required="{ invoiceInFk: $route.params.id }"
|
||||
auto-load
|
||||
v-model:selected="rowsSelected"
|
||||
:go-to="`/invoice-in/${invoiceId}/due-day`"
|
||||
:go-to="`/invoice-in/${$route.params.id}/due-day`"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<QTable
|
||||
|
@ -171,6 +173,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
:option-label="col.optionLabel"
|
||||
:filter-options="['id', 'name']"
|
||||
:tooltip="t('Create a new expense')"
|
||||
@keydown.tab="autocompleteExpense($event, row, col)"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
@ -187,13 +190,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
</template>
|
||||
<template #body-cell-taxablebase="{ row }">
|
||||
<QTd>
|
||||
{{ currency }}
|
||||
<VnInputNumber
|
||||
:class="{
|
||||
'no-pointer-events': isNotEuro(currency),
|
||||
}"
|
||||
:disable="isNotEuro(currency)"
|
||||
label=""
|
||||
clear-icon="close"
|
||||
v-model="row.taxableBase"
|
||||
clearable
|
||||
|
@ -208,9 +205,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
:option-value="col.optionValue"
|
||||
:option-label="col.optionLabel"
|
||||
:filter-options="['id', 'vat']"
|
||||
:hide-selected="false"
|
||||
:fill-input="false"
|
||||
:display-value="formatOpt(row, col, 'vat')"
|
||||
data-cy="vat-sageiva"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
@ -233,11 +228,6 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
:option-value="col.optionValue"
|
||||
:option-label="col.optionLabel"
|
||||
:filter-options="['id', 'transaction']"
|
||||
:autofocus="col.tabIndex == 1"
|
||||
input-debounce="0"
|
||||
:hide-selected="false"
|
||||
:fill-input="false"
|
||||
:display-value="formatOpt(row, col, 'transaction')"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
@ -262,6 +252,16 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
}"
|
||||
:disable="!isNotEuro(currency)"
|
||||
v-model="row.foreignValue"
|
||||
@update:model-value="
|
||||
async (val) => {
|
||||
if (!isNotEuro(currency)) return;
|
||||
row.taxableBase = await getExchange(
|
||||
val,
|
||||
row.currencyFk,
|
||||
invoiceIn.issued
|
||||
);
|
||||
}
|
||||
"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
|
@ -305,7 +305,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
v-model="props.row['expenseFk']"
|
||||
:options="expenses"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
:option-label="(row) => `${row.id}:${row.name}`"
|
||||
:filter-options="['id', 'name']"
|
||||
:tooltip="t('Create a new expense')"
|
||||
>
|
||||
|
@ -339,7 +339,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
v-model="props.row['taxTypeSageFk']"
|
||||
:options="sageTaxTypes"
|
||||
option-value="id"
|
||||
option-label="vat"
|
||||
:option-label="(row) => `${row.id}:${row.vat}`"
|
||||
:filter-options="['id', 'vat']"
|
||||
>
|
||||
<template #option="scope">
|
||||
|
@ -362,7 +362,9 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
v-model="props.row['transactionTypeSageFk']"
|
||||
:options="sageTransactionTypes"
|
||||
option-value="id"
|
||||
option-label="transaction"
|
||||
:option-label="
|
||||
(row) => `${row.id}:${row.transaction}`
|
||||
"
|
||||
:filter-options="['id', 'transaction']"
|
||||
>
|
||||
<template #option="scope">
|
||||
|
@ -418,11 +420,6 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
.bg {
|
||||
background-color: var(--vn-light-gray);
|
||||
}
|
||||
|
||||
:deep(.q-table tr td:nth-child(n + 4):nth-child(-n + 5) input) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: $breakpoint-xs) {
|
||||
.q-dialog {
|
||||
.q-card {
|
||||
|
|
|
@ -83,7 +83,7 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
|
|||
</template>
|
||||
</VnSelect>
|
||||
<VnInput
|
||||
:label="t('invoiceIn.list.supplierRef')"
|
||||
:label="t('InvoiceIn.list.supplierRef')"
|
||||
v-model="data.supplierRef"
|
||||
/>
|
||||
</VnRow>
|
||||
|
@ -97,10 +97,10 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
|
|||
map-options
|
||||
hide-selected
|
||||
:required="true"
|
||||
:rules="validate('invoiceIn.companyFk')"
|
||||
:rules="validate('InvoiceIn.companyFk')"
|
||||
/>
|
||||
<VnInputDate
|
||||
:label="t('invoiceIn.summary.issued')"
|
||||
:label="t('InvoiceIn.summary.issued')"
|
||||
v-model="data.issued"
|
||||
/>
|
||||
</VnRow>
|
||||
|
|
|
@ -1,41 +1,66 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import { dateRange } from 'src/filters';
|
||||
import { date } from 'quasar';
|
||||
|
||||
const { t } = useI18n();
|
||||
defineProps({ dataKey: { type: String, required: true } });
|
||||
const activities = ref([]);
|
||||
const dateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
|
||||
|
||||
function handleDaysAgo(params, daysAgo) {
|
||||
const [from, to] = dateRange(Date.vnNew());
|
||||
if (!daysAgo && daysAgo !== 0) {
|
||||
Object.assign(params, { from: undefined, to: undefined });
|
||||
} else {
|
||||
from.setDate(from.getDate() - daysAgo);
|
||||
Object.assign(params, {
|
||||
from: date.formatDate(from, dateFormat),
|
||||
to: date.formatDate(to, dateFormat),
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="SupplierActivities"
|
||||
auto-load
|
||||
@on-fetch="(data) => (activities = data)"
|
||||
/>
|
||||
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<VnFilterPanel :data-key="dataKey" :search-button="true" :hidden-tags="['daysAgo']">
|
||||
<template #tags="{ tag, formatFn, getLocale }">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||
<strong>{{ getLocale(tag.label) }}: </strong>
|
||||
<span>{{ formatFn(tag.value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #body="{ params, searchFn }">
|
||||
<template #body="{ params, searchFn, getLocale }">
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate :label="t('From')" v-model="params.from" is-outlined />
|
||||
<VnInputDate
|
||||
:label="$t('globals.from')"
|
||||
v-model="params.from"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate :label="t('To')" v-model="params.to" is-outlined />
|
||||
<VnInputDate
|
||||
:label="$t('globals.to')"
|
||||
v-model="params.to"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputNumber
|
||||
:label="$t('globals.daysAgo')"
|
||||
v-model="params.daysAgo"
|
||||
is-outlined
|
||||
:step="0"
|
||||
@update:model-value="(val) => handleDaysAgo(params, val)"
|
||||
@remove="(val) => handleDaysAgo(params, val)"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
|
@ -44,20 +69,18 @@ const activities = ref([]);
|
|||
v-model="params.supplierFk"
|
||||
url="Suppliers"
|
||||
:fields="['id', 'nickname']"
|
||||
:label="t('params.supplierFk')"
|
||||
option-value="id"
|
||||
:label="getLocale('supplierFk')"
|
||||
option-label="nickname"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
:filter-options="['id', 'name']"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.supplierRef')"
|
||||
:label="getLocale('supplierRef')"
|
||||
v-model="params.supplierRef"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
|
@ -67,7 +90,7 @@ const activities = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.fi')"
|
||||
:label="getLocale('fi')"
|
||||
v-model="params.fi"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
|
@ -77,7 +100,7 @@ const activities = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.serial')"
|
||||
:label="getLocale('serial')"
|
||||
v-model="params.serial"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
|
@ -87,7 +110,7 @@ const activities = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.account')"
|
||||
:label="getLocale('account')"
|
||||
v-model="params.account"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
|
@ -97,7 +120,7 @@ const activities = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.awb')"
|
||||
:label="getLocale('globals.params.awbCode')"
|
||||
v-model="params.awbCode"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
|
@ -107,24 +130,34 @@ const activities = ref([]);
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputNumber
|
||||
:label="t('Amount')"
|
||||
:label="$t('globals.amount')"
|
||||
v-model="params.amount"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
v-model="params.companyFk"
|
||||
:label="$t('globals.company')"
|
||||
url="Companies"
|
||||
option-label="code"
|
||||
:fields="['id', 'code']"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('invoiceIn.isBooked')"
|
||||
:label="$t('InvoiceIn.isBooked')"
|
||||
v-model="params.isBooked"
|
||||
@update:model-value="searchFn()"
|
||||
toggle-indeterminate
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
:label="t('params.correctingFk')"
|
||||
:label="getLocale('params.correctingFk')"
|
||||
v-model="params.correctingFk"
|
||||
@update:model-value="searchFn()"
|
||||
toggle-indeterminate
|
||||
|
@ -134,54 +167,3 @@ const activities = ref([]);
|
|||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
en:
|
||||
params:
|
||||
search: Id or supplier name
|
||||
supplierRef: Supplier ref.
|
||||
supplierFk: Supplier
|
||||
fi: Supplier fiscal id
|
||||
clientFk: Customer
|
||||
amount: Amount
|
||||
created: Created
|
||||
awb: AWB
|
||||
dued: Dued
|
||||
serialNumber: Serial Number
|
||||
serial: Serial
|
||||
account: Ledger account
|
||||
isBooked: is booked
|
||||
correctedFk: Rectified
|
||||
issued: Issued
|
||||
to: To
|
||||
from: From
|
||||
awbCode: AWB
|
||||
correctingFk: Rectificative
|
||||
supplierActivityFk: Supplier activity
|
||||
es:
|
||||
params:
|
||||
search: Id o nombre proveedor
|
||||
supplierRef: Ref. proveedor
|
||||
supplierFk: Proveedor
|
||||
clientFk: Cliente
|
||||
fi: CIF proveedor
|
||||
serialNumber: Num. serie
|
||||
serial: Serie
|
||||
awb: AWB
|
||||
amount: Importe
|
||||
issued: Emitida
|
||||
isBooked: Contabilizada
|
||||
account: Cuenta contable
|
||||
created: Creada
|
||||
dued: Vencida
|
||||
correctedFk: Rectificada
|
||||
correctingFk: Rectificativa
|
||||
supplierActivityFk: Actividad proveedor
|
||||
from: Desde
|
||||
to: Hasta
|
||||
From: Desde
|
||||
To: Hasta
|
||||
Amount: Importe
|
||||
Issued: Fecha factura
|
||||
Id or supplier: Id o proveedor
|
||||
</i18n>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useState } from 'src/composables/useState';
|
||||
import { downloadFile } from 'src/composables/downloadFile';
|
||||
import { toDate, toCurrency } from 'src/filters/index';
|
||||
import InvoiceInFilter from './InvoiceInFilter.vue';
|
||||
|
@ -14,8 +15,10 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
|
|||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
|
||||
const stateStore = useStateStore();
|
||||
const user = useState().getUser();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const { t } = useI18n();
|
||||
|
||||
|
@ -23,7 +26,14 @@ onMounted(async () => (stateStore.rightDrawer = true));
|
|||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
|
||||
const tableRef = ref();
|
||||
const companies = ref([]);
|
||||
const cols = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
name: 'isBooked',
|
||||
label: t('InvoiceIn.isBooked'),
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
|
@ -32,7 +42,7 @@ const cols = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'supplierFk',
|
||||
label: t('invoiceIn.list.supplier'),
|
||||
label: t('InvoiceIn.list.supplier'),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
|
@ -45,16 +55,16 @@ const cols = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'supplierRef',
|
||||
label: t('invoiceIn.list.supplierRef'),
|
||||
label: t('InvoiceIn.list.supplierRef'),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'serial',
|
||||
label: t('invoiceIn.serial'),
|
||||
label: t('InvoiceIn.serial'),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('invoiceIn.list.issued'),
|
||||
label: t('InvoiceIn.list.issued'),
|
||||
name: 'issued',
|
||||
component: null,
|
||||
columnFilter: {
|
||||
|
@ -64,21 +74,38 @@ const cols = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'isBooked',
|
||||
label: t('invoiceIn.isBooked'),
|
||||
columnFilter: false,
|
||||
label: t('InvoiceIn.list.dueDated'),
|
||||
name: 'dueDated',
|
||||
component: null,
|
||||
columnFilter: {
|
||||
component: 'date',
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(toDate(row.dueDated)),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'awbCode',
|
||||
label: t('invoiceIn.list.awb'),
|
||||
label: t('InvoiceIn.list.awb'),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'amount',
|
||||
label: t('invoiceIn.list.amount'),
|
||||
label: t('InvoiceIn.list.amount'),
|
||||
format: ({ amount }) => toCurrency(amount),
|
||||
},
|
||||
{
|
||||
name: 'companyFk',
|
||||
label: t('globals.company'),
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Companies',
|
||||
fields: ['id', 'code'],
|
||||
optionLabel: 'code',
|
||||
},
|
||||
},
|
||||
format: (row) => row.code,
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
name: 'tableActions',
|
||||
|
@ -101,6 +128,7 @@ const cols = computed(() => [
|
|||
]);
|
||||
</script>
|
||||
<template>
|
||||
<FetchData url="Companies" @on-fetch="(data) => (companies = data)" auto-load />
|
||||
<InvoiceInSearchbar />
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
|
@ -116,7 +144,7 @@ const cols = computed(() => [
|
|||
urlCreate: 'InvoiceIns',
|
||||
title: t('globals.createInvoiceIn'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: {},
|
||||
formInitialData: { companyFk: user.companyFk, issued: Date.vnNew() },
|
||||
}"
|
||||
redirect="invoice-in"
|
||||
:columns="cols"
|
||||
|
@ -151,7 +179,7 @@ const cols = computed(() => [
|
|||
</template>
|
||||
</VnSelect>
|
||||
<VnInput
|
||||
:label="t('invoiceIn.list.supplierRef')"
|
||||
:label="t('InvoiceIn.list.supplierRef')"
|
||||
v-model="data.supplierRef"
|
||||
/>
|
||||
<VnSelect
|
||||
|
@ -163,7 +191,7 @@ const cols = computed(() => [
|
|||
option-label="code"
|
||||
:required="true"
|
||||
/>
|
||||
<VnInputDate :label="t('invoiceIn.summary.issued')" v-model="data.issued" />
|
||||
<VnInputDate :label="t('InvoiceIn.summary.issued')" v-model="data.issued" />
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
|
|
@ -58,6 +58,14 @@ onBeforeMount(async () => {
|
|||
:right-search="false"
|
||||
:user-params="{ daysAgo }"
|
||||
:disable-option="{ card: true }"
|
||||
:row-click="
|
||||
(row) => {
|
||||
$router.push({
|
||||
name: 'InvoiceInList',
|
||||
query: { table: JSON.stringify({ serial: row.serial }) },
|
||||
});
|
||||
}
|
||||
"
|
||||
auto-load
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -8,7 +8,11 @@ defineProps({ dataKey: { type: String, required: true } });
|
|||
const { t } = useI18n();
|
||||
</script>
|
||||
<template>
|
||||
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
||||
<VnFilterPanel
|
||||
:data-key="dataKey"
|
||||
:search-button="true"
|
||||
:unremovable-params="['daysAgo']"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
invoiceIn:
|
||||
InvoiceIn:
|
||||
serial: Serial
|
||||
isBooked: Is booked
|
||||
list:
|
||||
|
@ -7,8 +7,11 @@ invoiceIn:
|
|||
supplierRef: Supplier ref.
|
||||
file: File
|
||||
issued: Issued
|
||||
dueDated: Due dated
|
||||
awb: AWB
|
||||
amount: Amount
|
||||
descriptor:
|
||||
ticketList: Ticket list
|
||||
card:
|
||||
client: Client
|
||||
company: Company
|
||||
|
@ -39,3 +42,9 @@ invoiceIn:
|
|||
net: Net
|
||||
stems: Stems
|
||||
country: Country
|
||||
params:
|
||||
search: Id or supplier name
|
||||
account: Ledger account
|
||||
correctingFk: Rectificative
|
||||
correctedFk: Corrected
|
||||
isBooked: Is booked
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
invoiceIn:
|
||||
InvoiceIn:
|
||||
serial: Serie
|
||||
isBooked: Contabilizada
|
||||
list:
|
||||
ref: Referencia
|
||||
supplier: Proveedor
|
||||
supplierRef: Ref. proveedor
|
||||
shortIssued: F. emisión
|
||||
issued: F. emisión
|
||||
dueDated: F. vencimiento
|
||||
file: Fichero
|
||||
issued: Fecha emisión
|
||||
awb: AWB
|
||||
amount: Importe
|
||||
descriptor:
|
||||
ticketList: Listado de tickets
|
||||
card:
|
||||
client: Cliente
|
||||
company: Empresa
|
||||
|
@ -38,3 +40,8 @@ invoiceIn:
|
|||
net: Neto
|
||||
stems: Tallos
|
||||
country: País
|
||||
params:
|
||||
search: Id o nombre proveedor
|
||||
account: Cuenta contable
|
||||
correctingFk: Rectificativa
|
||||
correctedFk: Rectificada
|
||||
|
|
|
@ -115,6 +115,9 @@ onMounted(async () => {
|
|||
<VnSelect
|
||||
:label="t('invoiceOutSerialType')"
|
||||
v-model="formData.serialType"
|
||||
@update:model-value="
|
||||
invoiceOutGlobalStore.fetchInvoiceOutConfig(formData)
|
||||
"
|
||||
:options="serialTypesOptions"
|
||||
option-value="type"
|
||||
option-label="type"
|
||||
|
|
|
@ -2,12 +2,15 @@
|
|||
import { ref, nextTick } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import axios from 'axios';
|
||||
|
||||
import CrudModel from 'src/components/CrudModel.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const { notify } = useNotify();
|
||||
|
||||
const itemBarcodeRef = ref(null);
|
||||
|
||||
|
@ -23,6 +26,24 @@ const focusLastInput = () => {
|
|||
if (lastInput) lastInput.focus();
|
||||
});
|
||||
};
|
||||
|
||||
const removeRow = (row) => {
|
||||
itemBarcodeRef.value.remove([row]);
|
||||
};
|
||||
|
||||
const submit = async (rows) => {
|
||||
const params = rows[rows.length - 1];
|
||||
let { data } = await axios.get('ItemBarcodes');
|
||||
const code = params.code;
|
||||
|
||||
if (data.some((codes) => codes.code === code)) {
|
||||
notify(t('Codes can not be repeated'), 'negative');
|
||||
itemBarcodeRef.value.reset();
|
||||
return;
|
||||
}
|
||||
await axios.patch(`ItemBarcodes`, params);
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<div class="full-width flex justify-center">
|
||||
|
@ -39,6 +60,7 @@ const focusLastInput = () => {
|
|||
ref="itemBarcodeRef"
|
||||
url="ItemBarcodes"
|
||||
auto-load
|
||||
:save-fn="submit"
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<QCard class="q-px-lg q-py-md">
|
||||
|
@ -54,7 +76,7 @@ const focusLastInput = () => {
|
|||
focusable-input
|
||||
/>
|
||||
<QIcon
|
||||
@click="itemBarcodeRef.remove([row])"
|
||||
@click="removeRow(row)"
|
||||
class="cursor-pointer q-ml-md"
|
||||
color="primary"
|
||||
name="delete"
|
||||
|
@ -89,4 +111,5 @@ es:
|
|||
Code: Código
|
||||
Remove barcode: Quitar código de barras
|
||||
Add barcode: Añadir código de barras
|
||||
Codes can not be repeated: Los códigos no puden ser repetidos
|
||||
</i18n>
|
||||
|
|
|
@ -70,6 +70,7 @@ const onIntrastatCreated = (response, formData) => {
|
|||
option-label="name"
|
||||
hide-selected
|
||||
map-options
|
||||
required
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
|
|
@ -16,7 +16,7 @@ import { cloneItem } from 'src/pages/Item/composables/cloneItem';
|
|||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
type: Number,
|
||||
type: [Number, String],
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
|
@ -29,7 +29,7 @@ const $props = defineProps({
|
|||
default: null,
|
||||
},
|
||||
saleFk: {
|
||||
type: Number,
|
||||
type: [Number, String],
|
||||
default: null,
|
||||
},
|
||||
warehouseFk: {
|
||||
|
@ -61,7 +61,7 @@ onMounted(async () => {
|
|||
const data = ref(useCardDescription());
|
||||
const setData = async (entity) => {
|
||||
if (!entity) return;
|
||||
data.value = useCardDescription(entity.name, entity.id);
|
||||
data.value = useCardDescription(entity?.name, entity?.id);
|
||||
await updateStock();
|
||||
};
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ const $props = defineProps({
|
|||
default: null,
|
||||
},
|
||||
entityId: {
|
||||
type: String,
|
||||
type: [String, Number],
|
||||
default: null,
|
||||
},
|
||||
showEditButton: {
|
||||
|
@ -67,7 +67,7 @@ const handlePhotoUpdated = (evt = false) => {
|
|||
|
||||
<template>
|
||||
<div class="relative-position">
|
||||
<VnImg ref="image" :id="$props.entityId" zoom-resolution="1600x900">
|
||||
<VnImg ref="image" :id="parseInt($props.entityId)" zoom-resolution="1600x900">
|
||||
<template #error>
|
||||
<div class="absolute-full picture text-center q-pa-md flex flex-center">
|
||||
<div>
|
||||
|
|
|
@ -1,21 +1,30 @@
|
|||
<script setup>
|
||||
import { onMounted, computed, onUnmounted, ref, watch } from 'vue';
|
||||
import { onMounted, computed, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { dateRange } from 'src/filters';
|
||||
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
|
||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { toDateTimeFormat } from 'src/filters/date.js';
|
||||
import VnDateBadge from 'src/components/common/VnDateBadge.vue';
|
||||
import { dashIfEmpty } from 'src/filters';
|
||||
import { toCurrency } from 'filters/index';
|
||||
import { useArrayData } from 'composables/useArrayData';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
import axios from 'axios';
|
||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const stateStore = useStateStore();
|
||||
const from = ref();
|
||||
const to = ref();
|
||||
const hideInventory = ref(true);
|
||||
const inventorySupplierFk = ref();
|
||||
|
||||
async function getInventorySupplier() {
|
||||
inventorySupplierFk.value = (
|
||||
await axios.get(`InventoryConfigs`)
|
||||
)?.data[0]?.supplierFk;
|
||||
}
|
||||
|
||||
const exprBuilder = (param, value) => {
|
||||
switch (param) {
|
||||
|
@ -36,25 +45,27 @@ const exprBuilder = (param, value) => {
|
|||
}
|
||||
};
|
||||
|
||||
const from = ref();
|
||||
const to = ref();
|
||||
const where = {
|
||||
itemFk: route.params.id,
|
||||
};
|
||||
|
||||
if (hideInventory.value) {
|
||||
where.supplierFk = { neq: inventorySupplierFk };
|
||||
}
|
||||
|
||||
const arrayData = useArrayData('ItemLastEntries', {
|
||||
url: 'Items/lastEntriesFilter',
|
||||
order: ['landed DESC', 'buyFk DESC'],
|
||||
exprBuilder: exprBuilder,
|
||||
userFilter: {
|
||||
where: {
|
||||
itemFk: route.params.id,
|
||||
},
|
||||
where: where,
|
||||
},
|
||||
});
|
||||
|
||||
const itemLastEntries = ref([]);
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
label: t('lastEntries.ig'),
|
||||
label: 'Nv',
|
||||
name: 'ig',
|
||||
align: 'center',
|
||||
},
|
||||
|
@ -62,33 +73,38 @@ const columns = computed(() => [
|
|||
label: t('itemDiary.warehouse'),
|
||||
name: 'warehouse',
|
||||
field: 'warehouse',
|
||||
align: 'left',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: t('lastEntries.landed'),
|
||||
name: 'id',
|
||||
name: 'date',
|
||||
field: 'landed',
|
||||
align: 'left',
|
||||
format: (val) => toDateTimeFormat(val),
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: t('lastEntries.entry'),
|
||||
name: 'entry',
|
||||
field: 'stateName',
|
||||
align: 'left',
|
||||
align: 'center',
|
||||
format: (val) => dashIfEmpty(val),
|
||||
},
|
||||
{
|
||||
label: t('lastEntries.pvp'),
|
||||
name: 'pvp',
|
||||
field: 'reference',
|
||||
align: 'left',
|
||||
align: 'center',
|
||||
format: (_, row) => toCurrency(row.price2) + ' / ' + toCurrency(row.price3),
|
||||
},
|
||||
|
||||
{
|
||||
label: t('lastEntries.printedStickers'),
|
||||
name: 'printedStickers',
|
||||
field: 'printedStickers',
|
||||
align: 'center',
|
||||
format: (val) => dashIfEmpty(val),
|
||||
},
|
||||
{
|
||||
label: t('lastEntries.label'),
|
||||
name: 'label',
|
||||
name: 'stickers',
|
||||
field: 'stickers',
|
||||
align: 'center',
|
||||
format: (val) => dashIfEmpty(val),
|
||||
|
@ -96,11 +112,13 @@ const columns = computed(() => [
|
|||
{
|
||||
label: t('shelvings.packing'),
|
||||
name: 'packing',
|
||||
field: 'packing',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: t('lastEntries.grouping'),
|
||||
name: 'grouping',
|
||||
field: 'grouping',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
|
@ -111,18 +129,19 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
label: t('lastEntries.quantity'),
|
||||
name: 'stems',
|
||||
name: 'quantity',
|
||||
field: 'quantity',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: t('lastEntries.cost'),
|
||||
name: 'cost',
|
||||
align: 'left',
|
||||
field: 'cost',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: t('lastEntries.kg'),
|
||||
name: 'stems',
|
||||
label: 'Kg',
|
||||
name: 'weight',
|
||||
field: 'weight',
|
||||
align: 'center',
|
||||
},
|
||||
|
@ -134,9 +153,9 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
label: t('lastEntries.supplier'),
|
||||
name: 'stems',
|
||||
name: 'supplier',
|
||||
field: 'supplier',
|
||||
align: 'left',
|
||||
align: 'center',
|
||||
},
|
||||
]);
|
||||
|
||||
|
@ -160,11 +179,18 @@ const updateFilter = async () => {
|
|||
else if (from.value && !to.value) filter = { gte: from.value };
|
||||
else if (from.value && to.value) filter = { between: [from.value, to.value] };
|
||||
|
||||
arrayData.store.userFilter.where.landed = filter;
|
||||
const userFilter = arrayData.store.userFilter.where;
|
||||
|
||||
userFilter.landed = filter;
|
||||
if (hideInventory.value) userFilter.supplierFk = { neq: inventorySupplierFk };
|
||||
else delete userFilter.supplierFk;
|
||||
|
||||
await fetchItemLastEntries();
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await getInventorySupplier();
|
||||
|
||||
const _from = Date.vnNew();
|
||||
_from.setDate(_from.getDate() - 75);
|
||||
from.value = getDate(_from, 'from');
|
||||
|
@ -174,16 +200,13 @@ onMounted(async () => {
|
|||
|
||||
updateFilter();
|
||||
|
||||
watch([from, to], ([nFrom, nTo], [oFrom, oTo]) => {
|
||||
watch([from, to, hideInventory], ([nFrom, nTo], [oFrom, oTo]) => {
|
||||
if (nFrom && nFrom != oFrom) nFrom = getDate(new Date(nFrom), 'from');
|
||||
if (nTo && nTo != oTo) nTo = getDate(new Date(nTo), 'to');
|
||||
updateFilter();
|
||||
});
|
||||
});
|
||||
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnSubToolbar>
|
||||
<template #st-data>
|
||||
|
@ -192,27 +215,45 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
dense
|
||||
v-model="from"
|
||||
class="q-mr-lg"
|
||||
data-cy="from"
|
||||
/>
|
||||
<VnInputDate
|
||||
:label="t('lastEntries.to')"
|
||||
v-model="to"
|
||||
dense
|
||||
class="q-mr-lg"
|
||||
data-cy="to"
|
||||
/>
|
||||
<QCheckbox
|
||||
:label="t('Hide inventory supplier')"
|
||||
v-model="hideInventory"
|
||||
dense
|
||||
class="q-mr-lg"
|
||||
data-cy="hideInventory"
|
||||
/>
|
||||
<VnInputDate :label="t('lastEntries.to')" dense v-model="to" />
|
||||
</template>
|
||||
</VnSubToolbar>
|
||||
<QPage class="column items-center q-pa-xd">
|
||||
<QTable
|
||||
:rows="itemLastEntries"
|
||||
:columns="columns"
|
||||
class="full-width q-mt-md"
|
||||
class="table full-width q-mt-md"
|
||||
:no-data-label="t('globals.noResults')"
|
||||
>
|
||||
<template #body-cell-ig="{ row }">
|
||||
<QTd @click.stop>
|
||||
<QCheckbox
|
||||
v-model="row.isIgnored"
|
||||
:disable="true"
|
||||
:false-value="0"
|
||||
:true-value="1"
|
||||
<QTd class="text-center">
|
||||
<QIcon
|
||||
:name="row.isIgnored ? 'check_box' : 'check_box_outline_blank'"
|
||||
style="color: var(--vn-label-color)"
|
||||
size="sm"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-date="{ row }">
|
||||
<QTd class="text-center">
|
||||
<VnDateBadge :date="row.landed" />
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-entry="{ row }">
|
||||
<QTd @click.stop>
|
||||
<div class="full-width flex justify-center">
|
||||
|
@ -234,8 +275,8 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-pvp="{ value }">
|
||||
<QTd @click.stop
|
||||
><span> {{ value }}</span>
|
||||
<QTd @click.stop class="text-center">
|
||||
<span> {{ value }}</span>
|
||||
<QTooltip>
|
||||
{{ t('lastEntries.grouping') }}/{{ t('lastEntries.packing') }}
|
||||
</QTooltip></QTd
|
||||
|
@ -254,7 +295,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-cost="{ row }">
|
||||
<QTd @click.stop>
|
||||
<QTd @click.stop class="text-center">
|
||||
<span>
|
||||
{{ toCurrency(row.cost, 'EUR', 3) }}
|
||||
<QTooltip>
|
||||
|
@ -272,10 +313,25 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
</span>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-supplier="{ row }">
|
||||
<QTd @click.stop>
|
||||
<div class="full-width flex justify-center">
|
||||
<SupplierDescriptorProxy
|
||||
:id="row.supplierFk"
|
||||
class="q-ma-none"
|
||||
dense
|
||||
/>
|
||||
<span class="link">{{ row.supplier }}</span>
|
||||
</div>
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable>
|
||||
</QPage>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Hide inventory supplier: Ocultar proveedor inventario
|
||||
</i18n>
|
||||
<style lang="scss" scoped>
|
||||
.q-badge--rounded {
|
||||
border-radius: 50%;
|
||||
|
@ -287,4 +343,10 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
padding: 0 11px;
|
||||
height: 28px;
|
||||
}
|
||||
.th :first-child {
|
||||
.td {
|
||||
text-align: center;
|
||||
background-color: red;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
<script setup>
|
||||
import { onMounted, ref, computed, reactive } from 'vue';
|
||||
import { onMounted, ref, computed, reactive, watchEffect } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||
|
||||
import { toDateFormat } from 'src/filters/date.js';
|
||||
import { dashIfEmpty } from 'src/filters';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||
import axios from 'axios';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
|
||||
const stateStore = useStateStore();
|
||||
|
||||
|
@ -21,8 +17,9 @@ const route = useRoute();
|
|||
const { t } = useI18n();
|
||||
const { notify } = useNotify();
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
||||
const rowsSelected = ref([]);
|
||||
const tableRef = ref();
|
||||
const selectedRows = ref([]);
|
||||
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
||||
|
||||
const exprBuilder = (param, value) => {
|
||||
switch (param) {
|
||||
|
@ -36,6 +33,11 @@ const exprBuilder = (param, value) => {
|
|||
};
|
||||
|
||||
const params = reactive({ itemFk: route.params.id });
|
||||
const filter = reactive({
|
||||
where: {
|
||||
itemFk: route.params.id,
|
||||
},
|
||||
});
|
||||
|
||||
const arrayData = useArrayData('ItemShelvings', {
|
||||
url: 'ItemShelvingPlacementSupplyStocks',
|
||||
|
@ -44,58 +46,32 @@ const arrayData = useArrayData('ItemShelvings', {
|
|||
});
|
||||
const rows = computed(() => arrayData.store.data || []);
|
||||
|
||||
const applyColumnFilter = async (col) => {
|
||||
const paramKey = col.columnFilter?.filterParamKey || col.field;
|
||||
params[paramKey] = col.columnFilter.filterValue;
|
||||
await arrayData.addFilter({ filter: null, params });
|
||||
};
|
||||
|
||||
const getInputEvents = (col) => {
|
||||
return col.columnFilter.type === 'select'
|
||||
? { 'update:modelValue': () => applyColumnFilter(col) }
|
||||
: {
|
||||
'keyup.enter': () => applyColumnFilter(col),
|
||||
};
|
||||
};
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
label: t('shelvings.created'),
|
||||
name: 'created',
|
||||
field: 'created',
|
||||
align: 'left',
|
||||
sortable: true,
|
||||
columnFilter: null,
|
||||
format: (val) => toDateFormat(val),
|
||||
columnFilter: false,
|
||||
format: (row) => toDateFormat(row.created),
|
||||
},
|
||||
|
||||
{
|
||||
label: t('shelvings.item'),
|
||||
name: 'item',
|
||||
field: 'itemFk',
|
||||
name: 'itemFk',
|
||||
align: 'left',
|
||||
sortable: true,
|
||||
columnFilter: null,
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
label: t('shelvings.concept'),
|
||||
name: 'concept',
|
||||
name: 'longName',
|
||||
align: 'left',
|
||||
sortable: true,
|
||||
columnFilter: null,
|
||||
columnFilter: false,
|
||||
},
|
||||
{
|
||||
label: t('shelvings.parking'),
|
||||
name: 'parking',
|
||||
field: 'parking',
|
||||
align: 'left',
|
||||
sortable: true,
|
||||
format: (val) => dashIfEmpty(val),
|
||||
columnFilter: {
|
||||
component: VnSelect,
|
||||
type: 'select',
|
||||
filterValue: null,
|
||||
event: getInputEvents,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'parkings',
|
||||
fields: ['code'],
|
||||
|
@ -104,20 +80,13 @@ const columns = computed(() => [
|
|||
'option-label': 'code',
|
||||
dense: true,
|
||||
},
|
||||
},
|
||||
columnField: { component: null },
|
||||
},
|
||||
{
|
||||
label: t('shelvings.shelving'),
|
||||
name: 'shelving',
|
||||
field: 'shelving',
|
||||
align: 'left',
|
||||
sortable: true,
|
||||
format: (val) => dashIfEmpty(val),
|
||||
columnFilter: {
|
||||
component: VnSelect,
|
||||
type: 'select',
|
||||
filterValue: null,
|
||||
event: getInputEvents,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'shelvings',
|
||||
fields: ['code'],
|
||||
|
@ -126,41 +95,20 @@ const columns = computed(() => [
|
|||
'option-label': 'code',
|
||||
dense: true,
|
||||
},
|
||||
},
|
||||
columnField: { component: null },
|
||||
},
|
||||
{
|
||||
label: t('shelvings.label'),
|
||||
name: 'label',
|
||||
align: 'left',
|
||||
sortable: true,
|
||||
format: (_, row) => (row.stock / row.packing).toFixed(2),
|
||||
columnFilter: {
|
||||
component: VnInput,
|
||||
type: 'text',
|
||||
filterParamKey: 'label',
|
||||
filterValue: null,
|
||||
event: getInputEvents,
|
||||
attrs: {
|
||||
dense: true,
|
||||
},
|
||||
},
|
||||
columnFilter: { inWhere: true },
|
||||
format: (row) => (row.stock / row.packing).toFixed(2),
|
||||
},
|
||||
{
|
||||
label: t('shelvings.packing'),
|
||||
field: 'packing',
|
||||
name: 'packing',
|
||||
attrs: { inWhere: true },
|
||||
align: 'left',
|
||||
sortable: true,
|
||||
columnFilter: {
|
||||
component: VnInput,
|
||||
type: 'text',
|
||||
filterValue: null,
|
||||
event: getInputEvents,
|
||||
attrs: {
|
||||
dense: true,
|
||||
},
|
||||
},
|
||||
format: (val) => dashIfEmpty(val),
|
||||
},
|
||||
]);
|
||||
|
||||
|
@ -169,15 +117,16 @@ const totalLabels = computed(() =>
|
|||
);
|
||||
|
||||
const removeLines = async () => {
|
||||
const itemShelvingIds = rowsSelected.value.map((row) => row.itemShelvingFk);
|
||||
const itemShelvingIds = selectedRows.value.map((row) => row.itemShelvingFk);
|
||||
await axios.post('ItemShelvings/deleteItemShelvings', { itemShelvingIds });
|
||||
rowsSelected.value = [];
|
||||
selectedRows.value = [];
|
||||
notify('shelvings.shelvingsRemoved', 'positive');
|
||||
await arrayData.fetch({ append: false });
|
||||
await tableRef.value.reload();
|
||||
};
|
||||
onMounted(async () => {
|
||||
await arrayData.fetch({ append: false });
|
||||
});
|
||||
watchEffect(selectedRows);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -203,7 +152,7 @@ onMounted(async () => {
|
|||
<QBtn
|
||||
color="primary"
|
||||
icon="delete"
|
||||
:disabled="!rowsSelected.length"
|
||||
:disabled="!hasSelectedCards"
|
||||
@click="
|
||||
openConfirmationModal(
|
||||
t('shelvings.removeConfirmTitle'),
|
||||
|
@ -219,41 +168,27 @@ onMounted(async () => {
|
|||
</Teleport>
|
||||
</template>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<QTable
|
||||
:rows="rows"
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="ItemShelving"
|
||||
:columns="columns"
|
||||
row-key="id"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
class="full-width q-mt-md"
|
||||
selection="multiple"
|
||||
v-model:selected="rowsSelected"
|
||||
:no-data-label="t('globals.noResults')"
|
||||
:url="`ItemShelvingPlacementSupplyStocks`"
|
||||
:filter="filter"
|
||||
:expr-builder="exprBuilder"
|
||||
:right-search="false"
|
||||
v-model:selected="selectedRows"
|
||||
:table="{
|
||||
'row-key': 'itemShelvingFk',
|
||||
selection: 'multiple',
|
||||
}"
|
||||
auto-load
|
||||
>
|
||||
<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-concept="{ row }">
|
||||
<QTd @click.stop>
|
||||
<span class="link">{{ row.longName }}</span>
|
||||
<template #column-longName="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.longName }}
|
||||
<ItemDescriptorProxy :id="row.itemFk" />
|
||||
</QTd>
|
||||
</span>
|
||||
</template>
|
||||
</QTable>
|
||||
</VnTable>
|
||||
</QPage>
|
||||
</template>
|
||||
|
|
|
@ -46,7 +46,7 @@ const getUrl = (id, param) => `#/Item/${id}/${param}`;
|
|||
<template #body="{ entity: { item, tags, visible, available, botanical } }">
|
||||
<QCard class="vn-one photo">
|
||||
<ItemDescriptorImage
|
||||
:entity-id="entityId"
|
||||
:entity-id="Number(entityId)"
|
||||
:visible="visible"
|
||||
:available="available"
|
||||
:show-edit-button="false"
|
||||
|
@ -89,7 +89,7 @@ const getUrl = (id, param) => `#/Item/${id}/${param}`;
|
|||
<QCard class="vn-one">
|
||||
<VnTitle
|
||||
:url="getUrl(entityId, 'basic-data')"
|
||||
:text="t('item.summary.otherData')"
|
||||
:text="t('item.summary.basicData')"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('item.summary.intrastatCode')"
|
||||
|
|
|
@ -8,7 +8,6 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -60,6 +59,10 @@ const insertTag = (rows) => {
|
|||
itemTagsRef.value.formData[itemTagsRef.value.formData.length - 1].priority =
|
||||
getHighestPriority(rows);
|
||||
};
|
||||
|
||||
const submitTags = async (data) => {
|
||||
itemTagsRef.value.onSubmit(data);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -77,7 +80,6 @@ const insertTag = (rows) => {
|
|||
data-key="ItemTags"
|
||||
model="ItemTags"
|
||||
url="ItemTags"
|
||||
update-url="Tags/onSubmit"
|
||||
:data-required="{
|
||||
$index: undefined,
|
||||
itemFk: route.params.id,
|
||||
|
@ -147,6 +149,7 @@ const insertTag = (rows) => {
|
|||
v-model="row.value"
|
||||
:label="t('itemTags.value')"
|
||||
:is-clearable="false"
|
||||
@keyup.enter.stop="submitTags(row)"
|
||||
/>
|
||||
<VnInput
|
||||
:label="t('itemBasicData.relevancy')"
|
||||
|
@ -154,6 +157,7 @@ const insertTag = (rows) => {
|
|||
v-model="row.priority"
|
||||
:required="true"
|
||||
:rules="validate('itemTag.priority')"
|
||||
@keyup.enter.stop="submitTags(row)"
|
||||
/>
|
||||
<div class="row justify-center" style="flex: 0">
|
||||
<QIcon
|
||||
|
@ -189,3 +193,8 @@ const insertTag = (rows) => {
|
|||
</QPage>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Tags can not be repeated: Las etiquetas no pueden repetirse
|
||||
</i18n>
|
||||
|
|
|
@ -28,7 +28,7 @@ const taxesFilter = {
|
|||
],
|
||||
};
|
||||
|
||||
const ItemTaxRef = ref(null);
|
||||
const ItemTaxRef = ref();
|
||||
const taxesOptions = ref([]);
|
||||
|
||||
const submitTaxes = async (data) => {
|
||||
|
@ -36,7 +36,10 @@ const submitTaxes = async (data) => {
|
|||
id: tax.id,
|
||||
taxClassFk: tax.taxClassFk,
|
||||
}));
|
||||
|
||||
if (payload.some((item) => item.taxClassFk === null)) {
|
||||
notify(t('Tax class cannot be blank'), 'negative');
|
||||
return;
|
||||
}
|
||||
await axios.post(`Items/updateTaxes`, payload);
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
};
|
||||
|
|
|
@ -55,17 +55,6 @@ const columns = computed(() => [
|
|||
label: '',
|
||||
name: 'image',
|
||||
align: 'left',
|
||||
columnField: {
|
||||
component: VnImg,
|
||||
attrs: ({ row }) => {
|
||||
return {
|
||||
id: row?.id,
|
||||
zoomResolution: '1600x900',
|
||||
zoom: true,
|
||||
class: 'rounded',
|
||||
};
|
||||
},
|
||||
},
|
||||
columnFilter: false,
|
||||
cardVisible: true,
|
||||
},
|
||||
|
@ -184,7 +173,7 @@ const columns = computed(() => [
|
|||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
label: t('globals.origin'),
|
||||
label: t('item.list.origin'),
|
||||
name: 'origin',
|
||||
align: 'left',
|
||||
component: 'select',
|
||||
|
@ -228,7 +217,8 @@ const columns = computed(() => [
|
|||
},
|
||||
},
|
||||
{
|
||||
label: t('item.list.weightByPiece'),
|
||||
label: t('item.list.weight'),
|
||||
toolTip: t('item.list.weightByPiece'),
|
||||
name: 'weightByPiece',
|
||||
align: 'left',
|
||||
component: 'input',
|
||||
|
@ -322,7 +312,6 @@ const columns = computed(() => [
|
|||
ref="tableRef"
|
||||
data-key="ItemList"
|
||||
url="Items/filter"
|
||||
url-create="Items"
|
||||
:create="{
|
||||
urlCreate: 'Items',
|
||||
title: t('Create Item'),
|
||||
|
@ -333,12 +322,19 @@ const columns = computed(() => [
|
|||
}"
|
||||
:order="['isActive DESC', 'name', 'id']"
|
||||
:columns="columns"
|
||||
auto-load
|
||||
redirect="Item"
|
||||
:is-editable="false"
|
||||
:right-search="false"
|
||||
:filer="itemFilter"
|
||||
:filter="itemFilter"
|
||||
>
|
||||
<template #column-image="{ row }">
|
||||
<VnImg
|
||||
:id="row?.id"
|
||||
zoom-resolution="1600x900"
|
||||
:zoom="true"
|
||||
class="rounded"
|
||||
/>
|
||||
</template>
|
||||
<template #column-id="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.id }}
|
||||
|
@ -348,7 +344,7 @@ const columns = computed(() => [
|
|||
<template #column-userName="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.userName }}
|
||||
<WorkerDescriptorProxy :id="row.workerFk" />
|
||||
<WorkerDescriptorProxy :id="row.buyerFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-description="{ row }">
|
||||
|
|
|
@ -199,7 +199,17 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{
|
||||
t(`params.${scope.opt?.name}`)
|
||||
}}</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
|
@ -434,6 +444,13 @@ en:
|
|||
description: Description
|
||||
name: Name
|
||||
id: Id
|
||||
Accessories: Accessories
|
||||
Artificial: Artificial
|
||||
Flower: Flower
|
||||
Fruit: Fruit
|
||||
Green: Green
|
||||
Handmade: Handmade
|
||||
Plant: Plant
|
||||
es:
|
||||
More fields: Más campos
|
||||
params:
|
||||
|
@ -450,4 +467,11 @@ es:
|
|||
description: Descripción
|
||||
name: Nombre
|
||||
id: Id
|
||||
Accessories: Accesorios
|
||||
Artificial: Artificial
|
||||
Flower: Flor
|
||||
Fruit: Fruta
|
||||
Green: Verde
|
||||
Handmade: Hecho a mano
|
||||
Plant: Planta
|
||||
</i18n>
|
||||
|
|
|
@ -11,8 +11,10 @@ import ItemRequestDenyForm from './ItemRequestDenyForm.vue';
|
|||
import { toDate } from 'src/filters';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import ItemRequestFilter from './ItemRequestFilter.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { notify } = useNotify();
|
||||
const stateStore = useStateStore();
|
||||
|
@ -216,7 +218,7 @@ const onDenyAccept = (_, responseData) => {
|
|||
<template>
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
<ItemRequestFilter data-key="itemRequest" ref="tableRef" />
|
||||
<ItemRequestFilter data-key="itemRequest" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<VnTable
|
||||
|
@ -301,7 +303,6 @@ const onDenyAccept = (_, responseData) => {
|
|||
</template>
|
||||
|
||||
<template #column-denyOptions="{ row, rowIndex }">
|
||||
<QTd class="sticky no-padding">
|
||||
<QIcon
|
||||
v-if="row.response?.length"
|
||||
name="insert_drive_file"
|
||||
|
@ -324,7 +325,6 @@ const onDenyAccept = (_, responseData) => {
|
|||
{{ t('Discard') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
</QTd>
|
||||
</template>
|
||||
</VnTable>
|
||||
<QDialog ref="denyFormRef" transition-show="scale" transition-hide="scale">
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { dateRange } from 'src/filters';
|
||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
|
@ -20,7 +22,8 @@ const stateOptions = [
|
|||
{ code: 'accepted', name: t('accepted') },
|
||||
{ code: 'denied', name: t('denied') },
|
||||
];
|
||||
|
||||
const arrayData = useArrayData(props.dataKey);
|
||||
const fieldFiltersValues = ref([]);
|
||||
const itemTypesOptions = ref([]);
|
||||
const warehousesOptions = ref([]);
|
||||
|
||||
|
@ -41,6 +44,19 @@ const exprBuilder = (param, value) => {
|
|||
};
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
if (arrayData.store?.userParams) {
|
||||
fieldFiltersValues.value = Object.entries(arrayData.store.userParams).map(
|
||||
([key, value]) => ({
|
||||
name: key,
|
||||
value,
|
||||
selectedField: { name: key, label: t(`params.${key}`) },
|
||||
})
|
||||
);
|
||||
}
|
||||
exprBuilder('state', arrayData.store?.userParams?.state);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -129,33 +145,17 @@ const exprBuilder = (param, value) => {
|
|||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
<VnSelectWorker
|
||||
:label="t('params.requesterFk')"
|
||||
v-model="params.requesterFk"
|
||||
@update:model-value="searchFn()"
|
||||
url="Workers/search"
|
||||
:fields="['id', 'name']"
|
||||
order="name ASC"
|
||||
:params="{ departmentCodes: ['VT'] }"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||
<QItemLabel caption
|
||||
>{{ scope.opt?.nickname }},
|
||||
{{ scope.opt?.code }}</QItemLabel
|
||||
>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
|
|
|
@ -10,7 +10,6 @@ const { t } = useI18n();
|
|||
url="ItemTypes"
|
||||
:label="t('Search item type')"
|
||||
:info="t('Search itemType by id, name or code')"
|
||||
search-url="table"
|
||||
/>
|
||||
</template>
|
||||
<i18n>
|
||||
|
|
|
@ -6,6 +6,7 @@ import VnTable from 'components/VnTable/VnTable.vue';
|
|||
import FetchData from 'components/FetchData.vue';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import ItemTypeFilter from './ItemType/ItemTypeFilter.vue';
|
||||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const tableRef = ref();
|
||||
|
@ -31,13 +32,14 @@ const columns = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'name',
|
||||
label: t('name'),
|
||||
label: t('globals.name'),
|
||||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('worker'),
|
||||
name: 'workerFk',
|
||||
create: true,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
|
@ -45,20 +47,20 @@ const columns = computed(() => [
|
|||
optionLabel: 'nickname',
|
||||
optionValue: 'id',
|
||||
},
|
||||
format: (row) => row.worker?.user?.name,
|
||||
cardVisible: true,
|
||||
visible: true,
|
||||
columnField: {
|
||||
component: 'userLink',
|
||||
attrs: ({ row }) => {
|
||||
return {
|
||||
workerId: row?.worker?.id,
|
||||
name: row.worker?.user?.name,
|
||||
defaultName: true,
|
||||
};
|
||||
},
|
||||
},
|
||||
columnField: { component: null },
|
||||
columnFilter: {
|
||||
name: 'workerFk',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name'],
|
||||
where: { role: 'buyer' },
|
||||
optionFilter: 'firstName',
|
||||
optionLabel: 'name',
|
||||
optionValue: 'id',
|
||||
useLike: false,
|
||||
},
|
||||
inWhere: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -135,24 +137,27 @@ const columns = computed(() => [
|
|||
:columns="columns"
|
||||
auto-load
|
||||
:right-search="false"
|
||||
:is-editable="false"
|
||||
:use-model="true"
|
||||
redirect="item/item-type"
|
||||
/>
|
||||
>
|
||||
<template #column-workerFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.worker?.user?.name }}
|
||||
<WorkerDescriptorProxy :id="row.workerFk" />
|
||||
</span>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
id: Id
|
||||
code: Código
|
||||
name: Nombre
|
||||
worker: Trabajador
|
||||
ItemCategory: Reino
|
||||
Temperature: Temperatura
|
||||
Create ItemTypes: Crear familia
|
||||
en:
|
||||
code: Code
|
||||
name: Name
|
||||
worker: Worker
|
||||
ItemCategory: ItemCategory
|
||||
Temperature: Temperature
|
||||
|
|
|
@ -66,6 +66,7 @@ lastEntries:
|
|||
package: Package
|
||||
freight: Freight
|
||||
comission: Comission
|
||||
printedStickers: Pri.
|
||||
itemTags:
|
||||
removeTag: Remove tag
|
||||
addTag: Add tag
|
||||
|
@ -95,6 +96,15 @@ item:
|
|||
mine: For me
|
||||
state: State
|
||||
myTeam: My team
|
||||
shipped: Shipped
|
||||
description: Description
|
||||
quantity: Quantity
|
||||
price: Price
|
||||
item: Item
|
||||
achieved: Achieved
|
||||
concept: Concept
|
||||
denyOptions: Deny
|
||||
scopeDays: Scope days
|
||||
searchbar:
|
||||
label: Search item
|
||||
descriptor:
|
||||
|
@ -112,7 +122,7 @@ item:
|
|||
title: All its properties will be copied
|
||||
subTitle: Do you want to clone this item?
|
||||
list:
|
||||
id: Identifier
|
||||
id: Id
|
||||
grouping: Grouping
|
||||
packing: Packing
|
||||
description: Description
|
||||
|
@ -122,8 +132,9 @@ item:
|
|||
intrastat: Intrastat
|
||||
isActive: Active
|
||||
size: Size
|
||||
origin: Origin
|
||||
origin: Orig.
|
||||
userName: Buyer
|
||||
weight: Weight
|
||||
weightByPiece: Weight/Piece
|
||||
stemMultiplier: Multiplier
|
||||
producer: Producer
|
||||
|
|
|
@ -56,7 +56,7 @@ lastEntries:
|
|||
landed: F. Entrega
|
||||
entry: Entrada
|
||||
pvp: PVP
|
||||
label: Etiquetas
|
||||
label: Eti.
|
||||
grouping: Grouping
|
||||
quantity: Cantidad
|
||||
cost: Coste
|
||||
|
@ -66,6 +66,7 @@ lastEntries:
|
|||
package: Embalaje
|
||||
freight: Porte
|
||||
comission: Comisión
|
||||
printedStickers: Imp.
|
||||
itemTags:
|
||||
removeTag: Quitar etiqueta
|
||||
addTag: Añadir etiqueta
|
||||
|
@ -97,6 +98,15 @@ item:
|
|||
mine: Para mi
|
||||
state: Estado
|
||||
myTeam: Mi equipo
|
||||
shipped: Enviado
|
||||
description: Descripción
|
||||
quantity: Cantidad
|
||||
price: Precio
|
||||
item: Artículo
|
||||
achieved: Conseguido
|
||||
concept: Concepto
|
||||
denyOptions: Denegado
|
||||
scopeDays: Días en adelante
|
||||
searchbar:
|
||||
label: Buscar artículo
|
||||
descriptor:
|
||||
|
@ -114,7 +124,7 @@ item:
|
|||
title: Todas sus propiedades serán copiadas
|
||||
subTitle: ¿Desea clonar este artículo?
|
||||
list:
|
||||
id: Identificador
|
||||
id: Id
|
||||
grouping: Grouping
|
||||
packing: Packing
|
||||
description: Descripción
|
||||
|
@ -124,7 +134,8 @@ item:
|
|||
intrastat: Intrastat
|
||||
isActive: Activo
|
||||
size: Medida
|
||||
origin: Origen
|
||||
origin: Orig.
|
||||
weight: Peso
|
||||
weightByPiece: Peso (gramos)/tallo
|
||||
userName: Comprador
|
||||
stemMultiplier: Multiplicador
|
||||
|
|
|
@ -9,6 +9,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
|||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import { dateRange } from 'src/filters';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
defineProps({ dataKey: { type: String, required: true } });
|
||||
const { t, te } = useI18n();
|
||||
|
@ -112,33 +113,16 @@ const getLocale = (label) => {
|
|||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
<VnSelectWorker
|
||||
outlined
|
||||
dense
|
||||
rounded
|
||||
:label="t('globals.params.salesPersonFk')"
|
||||
v-model="params.salesPersonFk"
|
||||
url="Workers/search"
|
||||
:params="{ departmentCodes: ['VT'] }"
|
||||
is-outlined
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
:no-one="true"
|
||||
>
|
||||
<template #option="{ opt, itemProps }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
||||
<QItemLabel
|
||||
v-if="opt.code"
|
||||
class="text-grey text-caption"
|
||||
>
|
||||
{{ `${opt.nickname}, ${opt.code}` }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
</VnSelectWorker>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
|
@ -150,6 +134,7 @@ const getLocale = (label) => {
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
|
@ -225,6 +210,34 @@ const getLocale = (label) => {
|
|||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
outlined
|
||||
dense
|
||||
rounded
|
||||
:label="t('globals.params.departmentFk')"
|
||||
v-model="params.department"
|
||||
option-label="name"
|
||||
option-value="name"
|
||||
url="Departments"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
outlined
|
||||
dense
|
||||
rounded
|
||||
:label="t('globals.params.packing')"
|
||||
v-model="params.packing"
|
||||
url="ItemPackingTypes"
|
||||
option-label="code"
|
||||
option-value="code"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
|
|
|
@ -10,21 +10,24 @@ import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
|||
import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import { toDateFormat } from 'src/filters/date.js';
|
||||
import { toCurrency, dateRange, dashIfEmpty } from 'src/filters';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import MonitorTicketSearchbar from './MonitorTicketSearchbar.vue';
|
||||
import MonitorTicketFilter from './MonitorTicketFilter.vue';
|
||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||
import VnDateBadge from 'src/components/common/VnDateBadge.vue';
|
||||
import { useStateStore } from 'src/stores/useStateStore';
|
||||
|
||||
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000; // 2min in ms
|
||||
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000;
|
||||
const { t } = useI18n();
|
||||
const autoRefresh = ref(false);
|
||||
const tableRef = ref(null);
|
||||
const provinceOpts = ref([]);
|
||||
const stateOpts = ref([]);
|
||||
const zoneOpts = ref([]);
|
||||
const DepartmentOpts = ref([]);
|
||||
const PayMethodOpts = ref([]);
|
||||
const ItemPackingTypeOpts = ref([]);
|
||||
const stateStore = useStateStore();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
|
||||
|
@ -58,6 +61,8 @@ function exprBuilder(param, value) {
|
|||
case 'nickname':
|
||||
return { [`t.nickname`]: { like: `%${value}%` } };
|
||||
case 'zoneFk':
|
||||
case 'department':
|
||||
return { 'd.name': value };
|
||||
case 'totalWithVat':
|
||||
return { [`t.${param}`]: value };
|
||||
}
|
||||
|
@ -144,6 +149,7 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
format: (row) => row.practicalHour,
|
||||
columnFilter: false,
|
||||
dense: true,
|
||||
},
|
||||
{
|
||||
label: t('salesTicketsTable.preparation'),
|
||||
|
@ -197,6 +203,7 @@ const columns = computed(() => [
|
|||
'false-value': 0,
|
||||
'true-value': 1,
|
||||
},
|
||||
component: false,
|
||||
},
|
||||
{
|
||||
label: t('salesTicketsTable.zone'),
|
||||
|
@ -213,6 +220,21 @@ const columns = computed(() => [
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('salesTicketsTable.payMethod'),
|
||||
name: 'payMethod',
|
||||
align: 'left',
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
url: 'PayMethods',
|
||||
attrs: {
|
||||
options: PayMethodOpts.value,
|
||||
optionValue: 'id',
|
||||
optionLabel: 'name',
|
||||
dense: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('salesTicketsTable.total'),
|
||||
name: 'totalWithVat',
|
||||
|
@ -226,6 +248,33 @@ const columns = computed(() => [
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('salesTicketsTable.department'),
|
||||
name: 'department',
|
||||
align: 'left',
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
options: DepartmentOpts.value,
|
||||
dense: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('salesTicketsTable.packing'),
|
||||
name: 'packing',
|
||||
align: 'left',
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
url: 'ItemPackingTypes',
|
||||
attrs: {
|
||||
options: ItemPackingTypeOpts.value,
|
||||
'option-value': 'code',
|
||||
'option-label': 'code',
|
||||
dense: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
name: 'tableActions',
|
||||
|
@ -257,19 +306,6 @@ const columns = computed(() => [
|
|||
},
|
||||
]);
|
||||
|
||||
const getBadgeAttrs = (date) => {
|
||||
let today = Date.vnNew();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
let timeTicket = new Date(date);
|
||||
timeTicket.setHours(0, 0, 0, 0);
|
||||
|
||||
let timeDiff = today - timeTicket;
|
||||
|
||||
if (timeDiff == 0) return { color: 'warning', 'text-color': 'black' };
|
||||
if (timeDiff < 0) return { color: 'success', 'text-color': 'black' };
|
||||
return { color: 'transparent', 'text-color': 'white' };
|
||||
};
|
||||
|
||||
let refreshTimer = null;
|
||||
|
||||
const autoRefreshHandler = (value) => {
|
||||
|
@ -286,14 +322,6 @@ const totalPriceColor = (ticket) => {
|
|||
if (total > 0 && total < 50) return 'warning';
|
||||
};
|
||||
|
||||
const formatShippedDate = (date) => {
|
||||
if (!date) return '-';
|
||||
const dateSplit = date.split('T');
|
||||
const [year, month, day] = dateSplit[0].split('-');
|
||||
const newDate = new Date(year, month - 1, day);
|
||||
return toDateFormat(newDate);
|
||||
};
|
||||
|
||||
const openTab = (id) =>
|
||||
window.open(`#/ticket/${id}/sale`, '_blank', 'noopener, noreferrer');
|
||||
</script>
|
||||
|
@ -325,6 +353,33 @@ const openTab = (id) =>
|
|||
auto-load
|
||||
@on-fetch="(data) => (zoneOpts = data)"
|
||||
/>
|
||||
<FetchData
|
||||
url="ItemPackingTypes"
|
||||
:filter="{
|
||||
fields: ['code'],
|
||||
order: 'code ASC',
|
||||
}"
|
||||
auto-load
|
||||
@on-fetch="(data) => (ItemPackingTypeOpts = data)"
|
||||
/>
|
||||
<FetchData
|
||||
url="Departments"
|
||||
:filter="{
|
||||
fields: ['id', 'name'],
|
||||
order: 'id ASC',
|
||||
}"
|
||||
auto-load
|
||||
@on-fetch="(data) => (DepartmentOpts = data)"
|
||||
/>
|
||||
<FetchData
|
||||
url="PayMethods"
|
||||
:filter="{
|
||||
fields: ['id', 'name'],
|
||||
order: 'id ASC',
|
||||
}"
|
||||
auto-load
|
||||
@on-fetch="(data) => (PayMethodOpts = data)"
|
||||
/>
|
||||
<MonitorTicketSearchbar />
|
||||
<RightMenu>
|
||||
<template #right-panel>
|
||||
|
@ -389,13 +444,7 @@ const openTab = (id) =>
|
|||
</div>
|
||||
</template>
|
||||
<template #column-shippedDate="{ row }">
|
||||
<QBadge
|
||||
v-bind="getBadgeAttrs(row.shippedDate)"
|
||||
class="q-pa-sm"
|
||||
style="font-size: 14px"
|
||||
>
|
||||
{{ formatShippedDate(row.shippedDate) }}
|
||||
</QBadge>
|
||||
<VnDateBadge :date="row.shippedDate" />
|
||||
</template>
|
||||
<template #column-provinceFk="{ row }">
|
||||
<span :title="row.province" v-text="row.province" />
|
||||
|
|
|
@ -26,8 +26,8 @@ salesTicketsTable:
|
|||
componentLack: Component lack
|
||||
tooLittle: Ticket too little
|
||||
identifier: Identifier
|
||||
theoretical: Theoretical
|
||||
practical: Practical
|
||||
theoretical: H.Theor
|
||||
practical: H.Prac
|
||||
province: Province
|
||||
state: State
|
||||
isFragile: Is fragile
|
||||
|
@ -35,7 +35,10 @@ salesTicketsTable:
|
|||
goToLines: Go to lines
|
||||
preview: Preview
|
||||
total: Total
|
||||
preparation: Preparation
|
||||
preparation: H.Prep
|
||||
payMethod: Pay method
|
||||
department: Department
|
||||
packing: ITP
|
||||
searchBar:
|
||||
label: Search tickets
|
||||
info: Search tickets by id or alias
|
||||
|
|
|
@ -26,8 +26,8 @@ salesTicketsTable:
|
|||
componentLack: Faltan componentes
|
||||
tooLittle: Ticket demasiado pequeño
|
||||
identifier: Identificador
|
||||
theoretical: Teórica
|
||||
practical: Práctica
|
||||
theoretical: H.Teór
|
||||
practical: H.Prác
|
||||
province: Provincia
|
||||
state: Estado
|
||||
isFragile: Es frágil
|
||||
|
@ -35,7 +35,10 @@ salesTicketsTable:
|
|||
goToLines: Ir a líneas
|
||||
preview: Vista previa
|
||||
total: Total
|
||||
preparation: Preparación
|
||||
preparation: H.Prep
|
||||
payMethod: Método de pago
|
||||
department: Departamento
|
||||
packing: ITP
|
||||
searchBar:
|
||||
label: Buscar tickets
|
||||
info: Buscar tickets por identificador o alias
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup>
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { onMounted, onUnmounted, ref, computed, watch, provide, nextTick } from 'vue';
|
||||
import { onMounted, ref, computed, watch } from 'vue';
|
||||
import axios from 'axios';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||
|
@ -30,8 +30,6 @@ onMounted(() => {
|
|||
checkOrderConfirmation();
|
||||
});
|
||||
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
|
||||
async function checkOrderConfirmation() {
|
||||
const response = await axios.get(`Orders/${route.params.id}`);
|
||||
if (response.data.isConfirmed === 1) {
|
||||
|
@ -77,19 +75,6 @@ watch(
|
|||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
const onItemSaved = (updatedItem) => {
|
||||
requestAnimationFrame(() => {
|
||||
scrollToItem(updatedItem.items[0].itemFk);
|
||||
});
|
||||
};
|
||||
|
||||
const scrollToItem = async (id) => {
|
||||
const element = itemRefs.value[id]?.$el;
|
||||
if (element) {
|
||||
element.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
};
|
||||
provide('onItemSaved', onItemSaved);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -102,16 +87,14 @@ provide('onItemSaved', onItemSaved);
|
|||
:label="t('Search items')"
|
||||
:info="t('You can search items by name or id')"
|
||||
/>
|
||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||
<QScrollArea class="fit text-grey-8">
|
||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
||||
<OrderCatalogFilter
|
||||
:data-key="dataKey"
|
||||
:tag-value="tagValue"
|
||||
:tags="tags"
|
||||
:initial-catalog-params="catalogParams"
|
||||
/>
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
</Teleport>
|
||||
<QPage class="column items-center q-pa-md" data-cy="orderCatalogPage">
|
||||
<div class="full-width">
|
||||
<VnPaginate
|
||||
|
|
|
@ -65,7 +65,6 @@ const selectCategory = async (params, category, search) => {
|
|||
params.typeFk = null;
|
||||
params.categoryFk = category.id;
|
||||
await loadTypes(category?.id);
|
||||
await search();
|
||||
};
|
||||
|
||||
const loadTypes = async (id) => {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<script setup>
|
||||
import toCurrency from 'src/filters/toCurrency';
|
||||
import { inject, ref } from 'vue';
|
||||
import { computed, inject, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import axios from 'axios';
|
||||
import { useRoute } from 'vue-router';
|
||||
import useNotify from 'composables/useNotify';
|
||||
import { useArrayData } from 'composables/useArrayData';
|
||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { notify } = useNotify();
|
||||
|
@ -18,10 +18,17 @@ const props = defineProps({
|
|||
required: true,
|
||||
},
|
||||
});
|
||||
const onItemSaved = inject('onItemSaved');
|
||||
const state = useState();
|
||||
|
||||
const orderData = computed(() => state.get('orderData'));
|
||||
|
||||
const prices = ref((props.item.prices || []).map((item) => ({ ...item, quantity: 0 })));
|
||||
const descriptorData = useArrayData('orderData');
|
||||
const isLoading = ref(false);
|
||||
|
||||
const totalQuantity = (items) =>
|
||||
items.reduce((acc, item) => {
|
||||
return acc + item.quantity;
|
||||
}, 0);
|
||||
const addToOrder = async () => {
|
||||
if (isLoading.value) return;
|
||||
isLoading.value = true;
|
||||
|
@ -30,10 +37,19 @@ const addToOrder = async () => {
|
|||
items,
|
||||
orderFk: Number(route.params.id),
|
||||
});
|
||||
|
||||
const { data: orderTotal } = await axios.get(
|
||||
`Orders/${Number(route.params.id)}/getTotal`
|
||||
);
|
||||
|
||||
state.set('orderTotal', orderTotal);
|
||||
const rows = orderData.value.rows.push(...items) || [];
|
||||
state.set('orderData', {
|
||||
...orderData.value,
|
||||
rows,
|
||||
});
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
await descriptorData.fetch({});
|
||||
onItemSaved({ ...props, items, saved: true });
|
||||
emit('added', items);
|
||||
emit('added', -totalQuantity(items));
|
||||
isLoading.value = false;
|
||||
};
|
||||
const canAddToOrder = () => {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<script setup>
|
||||
import { useRouter } from 'vue-router';
|
||||
import { reactive, onMounted, ref } from 'vue';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import axios from 'axios';
|
||||
import { useState } from 'composables/useState';
|
||||
import FormModelPopup from 'components/FormModelPopup.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
|
@ -11,29 +10,12 @@ import VnInputDate from 'components/common/VnInputDate.vue';
|
|||
import { useDialogPluginComponent } from 'quasar';
|
||||
|
||||
const { t } = useI18n();
|
||||
const state = useState();
|
||||
const ORDER_MODEL = 'order';
|
||||
|
||||
const router = useRouter();
|
||||
const agencyList = ref([]);
|
||||
const addressList = ref([]);
|
||||
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
||||
|
||||
const fetchAddressList = async (addressId) => {
|
||||
const { data } = await axios.get('addresses', {
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
fields: ['id', 'nickname', 'street', 'city'],
|
||||
where: { id: addressId },
|
||||
}),
|
||||
},
|
||||
});
|
||||
addressList.value = data;
|
||||
if (addressList.value?.length === 1) {
|
||||
state.get(ORDER_MODEL).addressId = addressList.value[0].id;
|
||||
}
|
||||
};
|
||||
|
||||
const fetchAgencyList = async (landed, addressFk) => {
|
||||
if (!landed || !addressFk) {
|
||||
return;
|
||||
|
@ -59,17 +41,9 @@ const initialFormState = reactive({
|
|||
clientFk: $props.clientFk,
|
||||
});
|
||||
|
||||
const onClientChange = async (clientId = $props.clientFk) => {
|
||||
const { data } = await axios.get(`Clients/${clientId}`);
|
||||
await fetchAddressList(data.defaultAddressFk);
|
||||
};
|
||||
|
||||
async function onDataSaved(_, id) {
|
||||
await router.push({ path: `/order/${id}/catalog` });
|
||||
}
|
||||
onMounted(async () => {
|
||||
await onClientChange();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -90,10 +64,9 @@ onMounted(async () => {
|
|||
option-value="id"
|
||||
option-label="name"
|
||||
:filter="{
|
||||
fields: ['id', 'name', 'defaultAddressFk'],
|
||||
fields: ['id', 'name'],
|
||||
}"
|
||||
hide-selected
|
||||
@update:model-value="onClientChange"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
@ -110,7 +83,7 @@ onMounted(async () => {
|
|||
:label="t('order.form.addressFk')"
|
||||
v-model="data.addressId"
|
||||
url="addresses"
|
||||
:fields="['id', 'nickname', 'defaultAddressFk', 'street', 'city']"
|
||||
:fields="['id', 'nickname', 'street', 'city']"
|
||||
sort-by="id"
|
||||
option-value="id"
|
||||
option-label="street"
|
||||
|
|
|
@ -63,21 +63,26 @@ const setData = (entity) => {
|
|||
if (!entity) return;
|
||||
getTotalRef.value && getTotalRef.value.fetch();
|
||||
data.value = useCardDescription(entity?.client?.name, entity?.id);
|
||||
state.set('orderData', entity);
|
||||
state.set('orderTotal', total);
|
||||
};
|
||||
|
||||
const getConfirmationValue = (isConfirmed) => {
|
||||
return t(isConfirmed ? 'globals.confirmed' : 'order.summary.notConfirmed');
|
||||
};
|
||||
|
||||
const total = ref(null);
|
||||
const orderTotal = computed(() => state.get('orderTotal') ?? 0);
|
||||
const total = ref(0);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
ref="getTotalRef"
|
||||
:url="`Orders/${entityId}/getTotal`"
|
||||
@on-fetch="(response) => (total = response)"
|
||||
@on-fetch="
|
||||
(response) => {
|
||||
total = response;
|
||||
}
|
||||
"
|
||||
/>
|
||||
<CardDescriptor
|
||||
ref="descriptor"
|
||||
|
@ -112,7 +117,7 @@ const total = ref(null);
|
|||
:label="t('order.summary.items')"
|
||||
:value="(entity?.rows?.length || DEFAULT_ITEMS).toString()"
|
||||
/>
|
||||
<VnLv :label="t('order.summary.total')" :value="toCurrency(total)" />
|
||||
<VnLv :label="t('order.summary.total')" :value="toCurrency(orderTotal)" />
|
||||
</template>
|
||||
<template #actions="{ entity }">
|
||||
<QCardActions>
|
||||
|
|
|
@ -6,6 +6,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
|||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import VnInput from 'components/common/VnInput.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
|
@ -61,28 +62,16 @@ const sourceList = ref([]);
|
|||
outlined
|
||||
rounded
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('salesPerson')"
|
||||
<VnSelectWorker
|
||||
:label="t('globals.salesPerson')"
|
||||
v-model="params.workerFk"
|
||||
url="Workers/search"
|
||||
:filter="{ departmentCodes: ['VT'] }"
|
||||
sort-by="nickname ASC"
|
||||
option-label="nickname"
|
||||
:params="{
|
||||
departmentCodes: ['VT'],
|
||||
}"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ opt.nickname }},{{ opt.code }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
/>
|
||||
<VnInputDate
|
||||
v-model="params.from"
|
||||
:label="t('fromLanded')"
|
||||
|
|
|
@ -251,7 +251,7 @@ watch(
|
|||
@on-fetch="(data) => (orderSummary.vat = data)"
|
||||
auto-load
|
||||
/>
|
||||
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
|
||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
||||
<QCard
|
||||
class="order-lines-summary q-pa-lg"
|
||||
v-if="orderSummary.vat && orderSummary.total"
|
||||
|
@ -266,7 +266,7 @@ watch(
|
|||
<VnLv :label="t('VAT') + ': '" :value="toCurrency(orderSummary?.vat)" />
|
||||
<VnLv :label="t('total') + ': '" :value="toCurrency(orderSummary?.total)" />
|
||||
</QCard>
|
||||
</QDrawer>
|
||||
</Teleport>
|
||||
|
||||
<VnTable
|
||||
ref="tableLinesRef"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { computed, ref, onMounted } from 'vue';
|
||||
import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
|
||||
import OrderSummary from 'pages/Order/Card/OrderSummary.vue';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
|
@ -15,14 +15,13 @@ import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vu
|
|||
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import { toDateTimeFormat } from 'src/filters/date';
|
||||
import { useRoute } from 'vue-router';
|
||||
import dataByOrder from 'src/utils/dataByOrder';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const tableRef = ref();
|
||||
const agencyList = ref([]);
|
||||
const addressesList = ref([]);
|
||||
const route = useRoute();
|
||||
const addressOptions = ref([]);
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -148,16 +147,12 @@ onMounted(() => {
|
|||
const id = JSON.parse(clientId);
|
||||
fetchClientAddress(id.clientFk);
|
||||
});
|
||||
|
||||
async function fetchClientAddress(id, formData = {}) {
|
||||
const { data } = await axios.get(`Clients/${id}`, {
|
||||
params: {
|
||||
filter: {
|
||||
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
|
||||
include: { relation: 'addresses' },
|
||||
},
|
||||
},
|
||||
});
|
||||
addressesList.value = data.addresses;
|
||||
const { data } = await axios.get(
|
||||
`Clients/${id}/addresses?filter[order]=isActive DESC`
|
||||
);
|
||||
addressOptions.value = data;
|
||||
formData.addressId = data.defaultAddressFk;
|
||||
fetchAgencies(formData);
|
||||
}
|
||||
|
@ -168,7 +163,7 @@ async function fetchAgencies({ landed, addressId }) {
|
|||
const { data } = await axios.get('Agencies/landsThatDay', {
|
||||
params: { addressFk: addressId, landed },
|
||||
});
|
||||
agencyList.value = dataByOrder(data, 'agencyMode ASC');
|
||||
agencyList.value = data;
|
||||
}
|
||||
|
||||
const getDateColor = (date) => {
|
||||
|
@ -252,34 +247,29 @@ const getDateColor = (date) => {
|
|||
</VnSelect>
|
||||
<VnSelect
|
||||
v-model="data.addressId"
|
||||
:options="addressesList"
|
||||
:options="addressOptions"
|
||||
:label="t('module.address')"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
@update:model-value="() => fetchAgencies(data)"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem
|
||||
v-bind="scope.itemProps"
|
||||
:class="{ disabled: !scope.opt.isActive }"
|
||||
>
|
||||
<QItemSection style="min-width: min-content" avatar>
|
||||
<QIcon
|
||||
v-if="
|
||||
scope.opt.isActive && data.addressId === scope.opt.id
|
||||
"
|
||||
size="sm"
|
||||
color="grey"
|
||||
name="star"
|
||||
class="fill-icon"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
{{ scope.opt.nickname }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ `${scope.opt.street}, ${scope.opt.city}` }}
|
||||
<QItemLabel
|
||||
:class="{
|
||||
'color-vn-label': !scope.opt?.isActive,
|
||||
}"
|
||||
>
|
||||
{{
|
||||
`${
|
||||
!scope.opt?.isActive
|
||||
? t('basicData.inactive')
|
||||
: ''
|
||||
} `
|
||||
}}
|
||||
{{ scope.opt?.nickname }}: {{ scope.opt?.street }},
|
||||
{{ scope.opt?.city }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -4,6 +4,7 @@ import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
|||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
import VnInput from 'components/common/VnInput.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
|
@ -31,29 +32,13 @@ const emit = defineEmits(['search']);
|
|||
<template #body="{ params }">
|
||||
<QItem class="q-my-sm">
|
||||
<QItemSection>
|
||||
<VnSelect
|
||||
:label="t('Worker')"
|
||||
<VnSelectWorker
|
||||
v-model="params.workerFk"
|
||||
url="Workers/search"
|
||||
sort-by="nickname ASC"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
:input-debounce="0"
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ opt.nickname }},{{ opt.code }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-my-sm">
|
||||
|
|
|
@ -11,6 +11,7 @@ import VnInputDate from 'components/common/VnInputDate.vue';
|
|||
import VnInput from 'components/common/VnInput.vue';
|
||||
import axios from 'axios';
|
||||
import VnInputTime from 'components/common/VnInputTime.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
@ -94,26 +95,7 @@ const onSave = (data, response) => {
|
|||
>
|
||||
<template #form="{ data }">
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('Worker')"
|
||||
v-model="data.workerFk"
|
||||
url="Workers/search"
|
||||
sort-by="nickname ASC"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
:input-debounce="0"
|
||||
>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ opt.name }}</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ opt.nickname }}, {{ opt.code }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<VnSelectWorker v-model="data.workerFk" />
|
||||
<VnSelect
|
||||
:label="t('Vehicle')"
|
||||
v-model="data.vehicleFk"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { onMounted, onUnmounted } from 'vue';
|
||||
import { onMounted } from 'vue';
|
||||
import CardList from 'components/ui/CardList.vue';
|
||||
import VnLv from 'components/ui/VnLv.vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
@ -21,7 +21,6 @@ const filter = {
|
|||
};
|
||||
|
||||
onMounted(() => (stateStore.rightDrawer = true));
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
|
||||
function navigate(id) {
|
||||
router.push({ path: `/shelving/${id}` });
|
||||
|
|
|
@ -5,6 +5,7 @@ import FormModel from 'components/FormModel.vue';
|
|||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -30,31 +31,11 @@ const companySizes = [
|
|||
:rules="validate('supplier.nickname')"
|
||||
clearable
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('supplier.basicData.workerFk')"
|
||||
<VnSelectWorker
|
||||
v-model="data.workerFk"
|
||||
url="Workers/search"
|
||||
sort-by="nickname ASC"
|
||||
has-info="Responsible for approving invoices"
|
||||
:rules="validate('supplier.workerFk')"
|
||||
>
|
||||
<template #append>
|
||||
<QIcon name="info" class="cursor-pointer">
|
||||
<QTooltip>{{
|
||||
t('Responsible for approving invoices')
|
||||
}}</QTooltip>
|
||||
</QIcon>
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ scope.opt?.nickname }}, {{ scope.opt?.id }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('supplier.basicData.size')"
|
||||
v-model="data.companySize"
|
||||
|
@ -102,6 +83,5 @@ const companySizes = [
|
|||
|
||||
<i18n>
|
||||
es:
|
||||
Responsible for approving invoices: Responsable de aprobar las facturas
|
||||
Small(1-5), Medium(6-50), Big(> 50): Pequeño(1-5), Mediano(6-50), Grande(> 50)
|
||||
</i18n>
|
||||
|
|
|
@ -174,11 +174,9 @@ onMounted(async () => {
|
|||
</div>
|
||||
</Teleport>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
|
||||
<QScrollArea class="fit text-grey-8">
|
||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
||||
<SupplierConsumptionFilter data-key="SupplierConsumption" />
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
</Teleport>
|
||||
<QTable
|
||||
:rows="rows"
|
||||
row-key="id"
|
||||
|
|
|
@ -180,10 +180,7 @@ function handleLocation(data, location) {
|
|||
:label="t('supplier.fiscalData.isTrucker')"
|
||||
/>
|
||||
<div class="row items-center">
|
||||
<QCheckbox
|
||||
v-model="data.isVies"
|
||||
:label="t('supplier.fiscalData.isVies')"
|
||||
/>
|
||||
<QCheckbox v-model="data.isVies" :label="t('globals.isVies')" />
|
||||
<QIcon name="info" size="xs" class="cursor-pointer q-ml-sm">
|
||||
<QTooltip>
|
||||
{{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted, nextTick } from 'vue';
|
||||
import { ref, computed, onMounted, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||
|
@ -118,8 +118,6 @@ onMounted(async () => {
|
|||
loadDefaultTicketAction();
|
||||
await ticketHaveNegatives();
|
||||
});
|
||||
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { date, useQuasar } from 'quasar';
|
||||
import { useStateStore } from 'src/stores/useStateStore';
|
||||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
@ -8,7 +9,7 @@ import { useRouter } from 'vue-router';
|
|||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const quasar = useQuasar();
|
||||
|
||||
const stateStore = useStateStore();
|
||||
onMounted(async () => {
|
||||
await fetch();
|
||||
});
|
||||
|
@ -84,8 +85,7 @@ async function getVideoList(expeditionId, timed) {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<QDrawer show-if-above side="right">
|
||||
<QScrollArea class="fit">
|
||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
||||
<QList bordered separator style="max-width: 318px">
|
||||
<QItem v-if="lastExpedition && videoList.length">
|
||||
<QItemSection>
|
||||
|
@ -138,9 +138,7 @@ async function getVideoList(expeditionId, timed) {
|
|||
<QItemSection>
|
||||
<QItemLabel caption>{{ t('globals.created') }}</QItemLabel>
|
||||
<QItemLabel>
|
||||
{{
|
||||
date.formatDate(expedition.created, 'YYYY-MM-DD HH:mm:ss')
|
||||
}}
|
||||
{{ date.formatDate(expedition.created, 'YYYY-MM-DD HH:mm:ss') }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption>{{ t('globals.item') }}</QItemLabel>
|
||||
<QItemLabel>{{ expedition.packagingItemFk }}</QItemLabel>
|
||||
|
@ -149,8 +147,7 @@ async function getVideoList(expeditionId, timed) {
|
|||
</QItemSection>
|
||||
</QItem>
|
||||
</QList>
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
</Teleport>
|
||||
|
||||
<QCard>
|
||||
<QCarousel animated v-model="slide" height="max-content">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue';
|
||||
import { ref, computed, onMounted, watch, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
|
@ -168,8 +168,6 @@ const getTicketVolume = async () => {
|
|||
onMounted(() => {
|
||||
stateStore.rightDrawer = true;
|
||||
});
|
||||
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -180,7 +178,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
@on-fetch="(data) => (components = data)"
|
||||
auto-load
|
||||
/>
|
||||
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
|
||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
||||
<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">
|
||||
|
@ -266,7 +264,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
<span>{{ toCurrency(theoricalCost, 'EUR', 2) }}</span>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
</QDrawer>
|
||||
</Teleport>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="TicketComponents"
|
||||
|
|
|
@ -9,6 +9,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
|||
import FetchData from 'components/FetchData.vue';
|
||||
|
||||
import { useState } from 'src/composables/useState';
|
||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||
|
||||
const emit = defineEmits(['onRequestCreated']);
|
||||
|
||||
|
@ -46,29 +47,7 @@ const onStateFkChange = (formData) => (formData.userFk = user.value.id);
|
|||
option-label="name"
|
||||
option-value="id"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('expedition.worker')"
|
||||
v-model="data.userFk"
|
||||
url="Workers/search"
|
||||
fields=" ['id', 'name']"
|
||||
sort-by="name ASC"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
>
|
||||
<template #option="{ opt, itemProps }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
{{ opt.name }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ opt.nickname }}, {{ opt.code }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template></VnSelect
|
||||
>
|
||||
<VnSelectWorker v-model="data.userFk" :fields="['id', 'name']" />
|
||||
</VnRow>
|
||||
</template>
|
||||
</FormModelPopup>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { computed, ref, toRefs } from 'vue';
|
||||
import { computed, onMounted, ref, toRefs, watch } from 'vue';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
@ -24,6 +24,15 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
restoreTicket();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.ticket,
|
||||
() => restoreTicket
|
||||
);
|
||||
|
||||
const { push, currentRoute } = useRouter();
|
||||
const { dialog, notify } = useQuasar();
|
||||
const { t } = useI18n();
|
||||
|
@ -42,6 +51,7 @@ const hasPdf = ref();
|
|||
const weight = ref();
|
||||
const hasDocuwareFile = ref();
|
||||
const quasar = useQuasar();
|
||||
const canRestoreTicket = ref(false);
|
||||
const actions = {
|
||||
clone: async () => {
|
||||
const opts = { message: t('Ticket cloned'), type: 'positive' };
|
||||
|
@ -373,6 +383,54 @@ async function uploadDocuware(force) {
|
|||
|
||||
if (data) notify({ message: t('PDF sent!'), type: 'positive' });
|
||||
}
|
||||
|
||||
const restoreTicket = async () => {
|
||||
const filter = {
|
||||
fields: ['id', 'originFk', 'creationDate', 'newInstance'],
|
||||
where: {
|
||||
originFk: ticketId.value,
|
||||
newInstance: { like: '%"isDeleted":true%' },
|
||||
},
|
||||
order: 'creationDate DESC',
|
||||
limit: 1,
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
|
||||
const { data } = await axios.get(`TicketLogs`, { params });
|
||||
|
||||
if (data && data.length) {
|
||||
const now = Date.vnNew();
|
||||
const maxDate = new Date(data[0].creationDate);
|
||||
maxDate.setHours(maxDate.getHours() + 1);
|
||||
if (now <= maxDate) {
|
||||
return (canRestoreTicket.value = true);
|
||||
}
|
||||
return (canRestoreTicket.value = false);
|
||||
}
|
||||
return (canRestoreTicket.value = false);
|
||||
};
|
||||
|
||||
async function openRestoreConfirmation(force) {
|
||||
if (!force)
|
||||
return quasar
|
||||
.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t('Are you sure you want to restore the ticket?'),
|
||||
message: t('You are going to restore this ticket'),
|
||||
},
|
||||
})
|
||||
.onOk(async () => {
|
||||
ticketToRestore();
|
||||
});
|
||||
}
|
||||
|
||||
async function ticketToRestore() {
|
||||
const { data } = await axios.post(`Tickets/${ticketId.value}/restore`);
|
||||
if (data) {
|
||||
notify({ message: t('Ticket restored'), type: 'positive' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -560,6 +618,12 @@ async function uploadDocuware(force) {
|
|||
</QItemSection>
|
||||
<QItemSection>{{ t('Show Proforma') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-if="canRestoreTicket" @click="openRestoreConfirmation()" v-ripple clickable>
|
||||
<QItemSection avatar>
|
||||
<QIcon name="restore" />
|
||||
</QItemSection>
|
||||
<QItemSection>{{ t('Restore ticket') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="isEditable"
|
||||
@click="showChangeTimeDialog = !showChangeTimeDialog"
|
||||
|
@ -746,4 +810,8 @@ es:
|
|||
You are going to delete this ticket: Vas a eliminar este ticket
|
||||
as PDF signed: como PDF firmado
|
||||
Are you sure you want to replace this delivery note?: ¿Seguro que quieres reemplazar este albarán?
|
||||
Restore ticket: Restaurar ticket
|
||||
Are you sure you want to restore the ticket?: ¿Seguro que quieres restaurar el ticket?
|
||||
You are going to restore this ticket: Vas a restaurar este ticket
|
||||
Ticket restored: Ticket restaurado
|
||||
</i18n>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { onMounted, ref, computed, onUnmounted } from 'vue';
|
||||
import { onMounted, ref, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
|
@ -17,6 +17,7 @@ import axios from 'axios';
|
|||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import VnBtnSelect from 'src/components/common/VnBtnSelect.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
import useOpenURL from 'src/composables/useOpenURL';
|
||||
|
||||
const route = useRoute();
|
||||
const stateStore = useStateStore();
|
||||
|
@ -123,6 +124,12 @@ const columns = computed(() => [
|
|||
isPrimary: true,
|
||||
action: (row) => showLog(row),
|
||||
},
|
||||
{
|
||||
title: t('Grafana'),
|
||||
icon: 'vn:grafana',
|
||||
isPrimary: true,
|
||||
action: ({ id }) => openGrafana(id),
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
@ -192,13 +199,17 @@ const getExpeditionState = async (expedition) => {
|
|||
}));
|
||||
};
|
||||
|
||||
const openGrafana = (expeditionFk) => {
|
||||
useOpenURL(
|
||||
`https://grafana.verdnatura.es/d/d552ab74-85b4-4e7f-a279-fab7cd9c6124/control-de-expediciones?orgId=1&var-expeditionFk=${expeditionFk}`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
stateStore.rightDrawer = true;
|
||||
const filteredColumns = columns.value.filter((col) => col.name !== 'history');
|
||||
allColumnNames.value = filteredColumns.map((col) => col.name);
|
||||
const filteredColumns = columns.value.filter(({ name }) => name !== 'history');
|
||||
allColumnNames.value = filteredColumns.map(({ name }) => name);
|
||||
});
|
||||
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { onMounted, ref, computed, onUnmounted, watch } from 'vue';
|
||||
import { onMounted, ref, computed, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { useQuasar } from 'quasar';
|
||||
|
@ -421,8 +421,6 @@ onMounted(async () => {
|
|||
getConfig();
|
||||
});
|
||||
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
|
||||
const items = ref([]);
|
||||
const newRow = ref({});
|
||||
|
||||
|
@ -619,7 +617,7 @@ watch(
|
|||
</QBtnGroup>
|
||||
</template>
|
||||
</VnSubToolbar>
|
||||
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
|
||||
<Teleport to="#right-panel" v-if="stateStore.isHeaderMounted()">
|
||||
<div
|
||||
class="q-pa-md q-mb-md q-ma-md color-vn-text"
|
||||
style="border: 2px solid black"
|
||||
|
@ -640,8 +638,8 @@ watch(
|
|||
<span class="q-mr-xs color-vn-label"> {{ t('basicData.total') }}: </span>
|
||||
<span>{{ toCurrency(store.data?.totalWithVat) }}</span>
|
||||
</QCardSection>
|
||||
</div></QDrawer
|
||||
>
|
||||
</div>
|
||||
</Teleport>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="TicketSales"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue';
|
||||
import { ref, computed, onMounted, watch, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
|
@ -90,8 +90,6 @@ const applyVolumes = async (salesData) => {
|
|||
};
|
||||
|
||||
onMounted(() => (stateStore.rightDrawer = true));
|
||||
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -102,11 +100,9 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
@on-fetch="(data) => applyVolumes(data)"
|
||||
auto-load
|
||||
/>
|
||||
<QDrawer
|
||||
v-if="packingTypeVolume.length"
|
||||
side="right"
|
||||
:width="265"
|
||||
v-model="stateStore.rightDrawer"
|
||||
<Teleport
|
||||
to="#right-panel"
|
||||
v-if="stateStore.isHeaderMounted() && packingTypeVolume.length"
|
||||
>
|
||||
<QCard
|
||||
v-for="(packingType, index) in packingTypeVolume"
|
||||
|
@ -126,8 +122,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
<span> {{ t('volume.volume') }}: {{ packingType.volume }} </span>
|
||||
</QCardSection>
|
||||
</QCard>
|
||||
</QDrawer>
|
||||
|
||||
</Teleport>
|
||||
<VnTable
|
||||
ref="tableRef"
|
||||
data-key="TicketVolume"
|
||||
|
|
|
@ -37,6 +37,7 @@ const userParams = reactive({
|
|||
ipt: 'H',
|
||||
futureIpt: 'H',
|
||||
isFullMovable: true,
|
||||
onlyWithDestination: true,
|
||||
});
|
||||
|
||||
const ticketColumns = computed(() => [
|
||||
|
@ -465,6 +466,7 @@ watch(
|
|||
color="primary"
|
||||
name="vn:agency-term"
|
||||
size="xs"
|
||||
class="q-mr-xs"
|
||||
>
|
||||
<QTooltip class="column">
|
||||
<span>
|
||||
|
@ -483,6 +485,14 @@ watch(
|
|||
</span>
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row.saleClonedFk"
|
||||
color="primary"
|
||||
name="content_copy"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>{{ t('advanceTickets.clonedSales') }}</QTooltip>
|
||||
</QIcon>
|
||||
</template>
|
||||
<template #column-id="{ row }">
|
||||
<QBtn flat class="link">
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue