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