fix: refs #7984 currency merge in dev
This commit is contained in:
parent
84f2948f8b
commit
f309d21682
|
@ -10,34 +10,5 @@ import filter from './OrderFilter.js';
|
||||||
url="Orders"
|
url="Orders"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
:descriptor="OrderDescriptor"
|
:descriptor="OrderDescriptor"
|
||||||
:user-filter="{
|
|
||||||
include: [
|
|
||||||
{ relation: 'agencyMode', scope: { fields: ['name'] } },
|
|
||||||
{
|
|
||||||
relation: 'address',
|
|
||||||
scope: { fields: ['nickname'] },
|
|
||||||
},
|
|
||||||
{ relation: 'rows', scope: { fields: ['id'] } },
|
|
||||||
{
|
|
||||||
relation: 'client',
|
|
||||||
scope: {
|
|
||||||
fields: [
|
|
||||||
'salesPersonFk',
|
|
||||||
'name',
|
|
||||||
'isActive',
|
|
||||||
'isFreezed',
|
|
||||||
'isTaxDataChecked',
|
|
||||||
],
|
|
||||||
include: {
|
|
||||||
relation: 'salesPersonUser',
|
|
||||||
scope: { fields: ['id', 'name'] },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'currency',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -22,5 +22,8 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
relation: 'currency',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,7 +20,7 @@ const { t } = useI18n();
|
||||||
const { hasAny } = useRole();
|
const { hasAny } = useRole();
|
||||||
|
|
||||||
const ticketUpdateActions = ref(null);
|
const ticketUpdateActions = ref(null);
|
||||||
const rows = computed(() => formData.value?.ticket?.sales || []);
|
const rows = computed(() => formData.value?.sale?.sales || []);
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,7 @@ async function ticketHaveNegatives() {
|
||||||
let _haveNegatives = false;
|
let _haveNegatives = false;
|
||||||
let haveNotNegatives = false;
|
let haveNotNegatives = false;
|
||||||
formData.value.withoutNegatives = false;
|
formData.value.withoutNegatives = false;
|
||||||
formData.value?.sale?.items.forEach((item) => {
|
formData.value?.sale?.sales.forEach((item) => {
|
||||||
if (item.quantity > item.movable) _haveNegatives = true;
|
if (item.quantity > item.movable) _haveNegatives = true;
|
||||||
else haveNotNegatives = true;
|
else haveNotNegatives = true;
|
||||||
});
|
});
|
||||||
|
@ -130,7 +130,7 @@ onMounted(async () => {
|
||||||
<span>
|
<span>
|
||||||
{{ t('basicData.price') }}:
|
{{ t('basicData.price') }}:
|
||||||
<VnCurrency
|
<VnCurrency
|
||||||
:model="formData?.ticket"
|
:model="formData.sale"
|
||||||
local-field="totalUnitPrice"
|
local-field="totalUnitPrice"
|
||||||
foreign-field="totalForeignUnitPrice"
|
foreign-field="totalForeignUnitPrice"
|
||||||
:currency-code="formData.currency.code"
|
:currency-code="formData.currency.code"
|
||||||
|
@ -141,7 +141,7 @@ onMounted(async () => {
|
||||||
<span>
|
<span>
|
||||||
{{ t('basicData.newPrice') }}:
|
{{ t('basicData.newPrice') }}:
|
||||||
<VnCurrency
|
<VnCurrency
|
||||||
:model="formData?.ticket"
|
:model="formData.sale"
|
||||||
local-field="totalNewPrice"
|
local-field="totalNewPrice"
|
||||||
foreign-field="totalForeignNewPrice"
|
foreign-field="totalForeignNewPrice"
|
||||||
:currency-code="formData.currency.code"
|
:currency-code="formData.currency.code"
|
||||||
|
@ -152,7 +152,7 @@ onMounted(async () => {
|
||||||
<span>
|
<span>
|
||||||
{{ t('basicData.difference') }}:
|
{{ t('basicData.difference') }}:
|
||||||
<VnCurrency
|
<VnCurrency
|
||||||
:model="formData?.ticket"
|
:model="formData.sale"
|
||||||
local-field="totalDifference"
|
local-field="totalDifference"
|
||||||
foreign-field="totalForeignDifference"
|
foreign-field="totalForeignDifference"
|
||||||
:currency-code="formData.currency.code"
|
:currency-code="formData.currency.code"
|
||||||
|
|
|
@ -9,8 +9,7 @@ import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
import useNotify from 'src/composables/useNotify';
|
||||||
import { useArrayData } from 'src/composables/useArrayData';
|
|
||||||
|
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -43,7 +42,7 @@ const getPriceDifference = async () => {
|
||||||
zoneId: ticket.value.zoneFk,
|
zoneId: ticket.value.zoneFk,
|
||||||
warehouseId: ticket.value.warehouseFk,
|
warehouseId: ticket.value.warehouseFk,
|
||||||
shipped: ticket.value.shipped,
|
shipped: ticket.value.shipped,
|
||||||
currencyId: formData.value.currencyFk,
|
currencyId: ticket.value.currencyFk,
|
||||||
};
|
};
|
||||||
const { data } = await axios.post(
|
const { data } = await axios.post(
|
||||||
`tickets/${ticket.value.id}/priceDifference`,
|
`tickets/${ticket.value.id}/priceDifference`,
|
||||||
|
@ -69,7 +68,7 @@ const submit = async () => {
|
||||||
option: ticket.value.option,
|
option: ticket.value.option,
|
||||||
isWithoutNegatives: ticket.value.withoutNegatives,
|
isWithoutNegatives: ticket.value.withoutNegatives,
|
||||||
withWarningAccept: ticket.value.withWarningAccept,
|
withWarningAccept: ticket.value.withWarningAccept,
|
||||||
currencyFk: formData.value.currencyFk,
|
currencyFk: ticket.value.currencyFk,
|
||||||
keepPrice: false,
|
keepPrice: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { toDateTimeFormat } from 'src/filters/date';
|
||||||
import filter from './TicketFilter.js';
|
import filter from './TicketFilter.js';
|
||||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
id: {
|
id: {
|
||||||
|
|
|
@ -310,7 +310,10 @@ const changePrice = async (sale) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const updatePrice = async (sale, newPrice) => {
|
const updatePrice = async (sale, newPrice) => {
|
||||||
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
await axios.post(`Sales/${sale.id}/updatePrice`, {
|
||||||
|
newPrice,
|
||||||
|
isForeign: user.value.foreignCurrency,
|
||||||
|
});
|
||||||
sale.price = newPrice;
|
sale.price = newPrice;
|
||||||
edit.value = { ...DEFAULT_EDIT };
|
edit.value = { ...DEFAULT_EDIT };
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
|
@ -739,7 +742,7 @@ watch(
|
||||||
{{ row?.item?.subName.toUpperCase() }}
|
{{ row?.item?.subName.toUpperCase() }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<FetchedTags :item="row.item" :max-length="6" />
|
<FetchedTags v-if="row.item" :item="row.item" :max-length="6" />
|
||||||
<QPopupProxy v-if="row.id && isTicketEditable">
|
<QPopupProxy v-if="row.id && isTicketEditable">
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="row.concept"
|
v-model="row.concept"
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { computed, ref, onBeforeMount, watch, onMounted, markRaw } from 'vue';
|
import { computed, ref, onBeforeMount, watch, onMounted } from 'vue';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { QChip, useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { toDate, dashIfEmpty } from 'src/filters/index';
|
import { toDate, toCurrency, dashIfEmpty } from 'src/filters/index';
|
||||||
import useNotify from 'src/composables/useNotify';
|
import useNotify from 'src/composables/useNotify';
|
||||||
import TicketSummary from './Card/TicketSummary.vue';
|
import TicketSummary from './Card/TicketSummary.vue';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
|
@ -470,10 +470,6 @@ function setReference(data) {
|
||||||
|
|
||||||
dialogData.value.value.description = newDescription;
|
dialogData.value.value.description = newDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isLittle(row) {
|
|
||||||
return row.totalWithVat > 0 && row.totalWithVat < 50;
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -573,9 +569,9 @@ function isLittle(row) {
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-totalWithVat="{ row }">
|
<template #column-totalWithVat="{ row }">
|
||||||
<component
|
<QChip
|
||||||
:is="isLittle(row) ? markRaw(QChip) : 'span'"
|
v-if="row.totalWithVat > 0 && row.totalWithVat < 50"
|
||||||
:class="{ 'bg-warning': isLittle(row) }"
|
class="bg-warning"
|
||||||
dense
|
dense
|
||||||
square
|
square
|
||||||
>
|
>
|
||||||
|
@ -584,7 +580,7 @@ function isLittle(row) {
|
||||||
:currency-code="row.currencyCode"
|
:currency-code="row.currencyCode"
|
||||||
local-field="totalWithVat"
|
local-field="totalWithVat"
|
||||||
/>
|
/>
|
||||||
</component>
|
</QChip>
|
||||||
</template>
|
</template>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
|
@ -680,33 +676,16 @@ function isLittle(row) {
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<<<<<<< HEAD
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
:sort-by="['name']"
|
:sort-by="['name']"
|
||||||
:label="t('globals.warehouse')"
|
:label="t('globals.warehouse')"
|
||||||
v-model="data.warehouseId"
|
v-model="data.warehouseId"
|
||||||
:options="warehousesOptions"
|
:options="warehousesOptions"
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
required
|
required
|
||||||
@update:model-value="() => fetchAvailableAgencies(data)"
|
@update:model-value="() => fetchAvailableAgencies(data)"
|
||||||
/>
|
/>
|
||||||
=======
|
|
||||||
<div class="col">
|
|
||||||
<VnSelect
|
|
||||||
url="Warehouses"
|
|
||||||
:sort-by="['name']"
|
|
||||||
:label="t('globals.warehouse')"
|
|
||||||
v-model="data.warehouseId"
|
|
||||||
:options="warehousesOptions"
|
|
||||||
hide-selected
|
|
||||||
required
|
|
||||||
@update:model-value="() => fetchAvailableAgencies(data)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
>>>>>>> d078969dd6f2dbabac05ef54ce07cca5884d3cc8
|
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
|
Loading…
Reference in New Issue