{{ t('Compensation') }}
@@ -287,27 +282,8 @@ async function getAmountPaid() {
-
-
-
-
-
+
diff --git a/src/pages/Customer/composables/__tests__/getAddresses.spec.js b/src/pages/Customer/composables/__tests__/getAddresses.spec.js
index 8c90bf281..76825377d 100644
--- a/src/pages/Customer/composables/__tests__/getAddresses.spec.js
+++ b/src/pages/Customer/composables/__tests__/getAddresses.spec.js
@@ -17,7 +17,21 @@ describe('getAddresses', () => {
expect(axios.get).toHaveBeenCalledWith(`Clients/${clientId}/addresses`, {
params: {
filter: JSON.stringify({
- fields: ['nickname', 'street', 'city', 'id', 'isActive'],
+ include: [
+ {
+ relation: 'client',
+ scope: {
+ fields: ['defaultAddressFk'],
+ include: {
+ relation: 'defaultAddress',
+ scope: {
+ fields: ['id', 'agencyModeFk'],
+ },
+ },
+ },
+ },
+ ],
+ fields: ['nickname', 'street', 'city', 'id', 'isActive', 'clientFk'],
where: { isActive: true },
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
}),
diff --git a/src/pages/Customer/composables/getAddresses.js b/src/pages/Customer/composables/getAddresses.js
index 5f18530e7..568b7b571 100644
--- a/src/pages/Customer/composables/getAddresses.js
+++ b/src/pages/Customer/composables/getAddresses.js
@@ -4,7 +4,21 @@ export async function getAddresses(clientId, _filter = {}) {
if (!clientId) return;
const filter = {
..._filter,
- fields: ['nickname', 'street', 'city', 'id', 'isActive'],
+ include: [
+ {
+ relation: 'client',
+ scope: {
+ fields: ['defaultAddressFk'],
+ include: {
+ relation: 'defaultAddress',
+ scope: {
+ fields: ['id', 'agencyModeFk'],
+ },
+ },
+ },
+ },
+ ],
+ fields: ['nickname', 'street', 'city', 'id', 'isActive', 'clientFk'],
where: { isActive: true },
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
};
diff --git a/src/pages/Customer/locale/en.yml b/src/pages/Customer/locale/en.yml
index b6d495335..6724a5a7b 100644
--- a/src/pages/Customer/locale/en.yml
+++ b/src/pages/Customer/locale/en.yml
@@ -20,7 +20,7 @@ customer:
name: Name
contact: Contact
mobile: Mobile
- salesPerson: Sales person
+ team: Team
contactChannel: Contact channel
socialName: Social name
fiscalId: Fiscal ID
@@ -78,7 +78,6 @@ customer:
id: Identifier
socialName: Social name
fi: Tax number
- salesPersonFk: Salesperson
creditInsurance: Credit insurance
phone: Phone
street: Street
diff --git a/src/pages/Customer/locale/es.yml b/src/pages/Customer/locale/es.yml
index f50d049da..4a266e07a 100644
--- a/src/pages/Customer/locale/es.yml
+++ b/src/pages/Customer/locale/es.yml
@@ -20,7 +20,7 @@ customer:
name: Nombre
contact: Contacto
mobile: Móvil
- salesPerson: Comercial
+ team: Equipo
contactChannel: Canal de contacto
socialName: Razón social
fiscalId: NIF/CIF
@@ -78,7 +78,6 @@ customer:
id: Identificador
socialName: Razón social
fi: NIF / CIF
- salesPersonFk: Comercial
creditInsurance: Crédito asegurado
phone: Teléfono
street: Dirección fiscal
diff --git a/src/pages/Entry/Card/EntryBasicData.vue b/src/pages/Entry/Card/EntryBasicData.vue
index 6462ed24a..f6d15a977 100644
--- a/src/pages/Entry/Card/EntryBasicData.vue
+++ b/src/pages/Entry/Card/EntryBasicData.vue
@@ -13,6 +13,9 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import VnSelectTravelExtended from 'src/components/common/VnSelectTravelExtended.vue';
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
+import VnCheckbox from 'src/components/common/VnCheckbox.vue';
+import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
+import VnDmsInput from 'src/components/common/VnDmsInput.vue';
const route = useRoute();
const { t } = useI18n();
@@ -23,6 +26,7 @@ const user = state.getUser().fn();
const companiesOptions = ref([]);
const currenciesOptions = ref([]);
+const entryRef = ref({});
onMounted(() => {
checkEntryLock(route.params.id, user.id);
@@ -47,13 +51,14 @@ onMounted(() => {
auto-load
/>
-
+
{
:required="true"
/>
-
-
-
+
+
-
+
{
:options="companiesOptions"
option-value="id"
option-label="code"
+ sort-by="code"
map-options
hide-selected
:required="true"
/>
-
+
{
:options="currenciesOptions"
option-value="id"
option-label="code"
+ sort-by="code"
/>
-
+
{
name="finalTemperature"
:label="t('entry.basicData.finalTemperature')"
:step="0.5"
- :decimal-places="2"
:positive="false"
/>
-
-
+
+
+
+
+
+ {
fill-input
/>
-
-
-
-
+
-
+
+ {
@@ -294,7 +267,7 @@ const columns = [
align: 'center',
label: t('Amount'),
name: 'amount',
- width: '45px',
+ width: '75px',
component: 'number',
attrs: {
positive: false,
@@ -310,7 +283,9 @@ const columns = [
toolTip: t('Package'),
name: 'price2',
component: 'number',
- createDisable: true,
+ createAttrs: {
+ disable: true,
+ },
width: '35px',
create: true,
format: (row) => parseFloat(row['price2']).toFixed(2),
@@ -320,7 +295,9 @@ const columns = [
label: t('Box'),
name: 'price3',
component: 'number',
- createDisable: true,
+ createAttrs: {
+ disable: true,
+ },
cellEvent: {
'update:modelValue': async (value, oldValue, row) => {
row['price2'] = row['price2'] * (value / oldValue);
@@ -340,13 +317,6 @@ const columns = [
toggleIndeterminate: false,
},
component: 'checkbox',
- cellEvent: {
- 'update:modelValue': async (value, oldValue, row) => {
- await axios.patch(`Items/${row['itemFk']}`, {
- hasMinPrice: value,
- });
- },
- },
width: '25px',
},
{
@@ -356,13 +326,6 @@ const columns = [
toolTip: t('Minimum price'),
name: 'minPrice',
component: 'number',
- cellEvent: {
- 'update:modelValue': async (value, oldValue, row) => {
- await axios.patch(`Items/${row['itemFk']}`, {
- minPrice: value,
- });
- },
- },
width: '35px',
style: (row) => {
if (!row?.hasMinPrice) return { color: 'var(--vn-label-color)' };
@@ -425,6 +388,23 @@ const columns = [
},
},
];
+const buyerFk = ref(null);
+const itemTypeFk = ref(null);
+const inkFk = ref(null);
+const tag1 = ref(null);
+const tag2 = ref(null);
+const tag1Filter = ref(null);
+const tag2Filter = ref(null);
+const filter = computed(() => {
+ const where = {};
+ where.workerFk = buyerFk.value;
+ where.itemTypeFk = itemTypeFk.value;
+ where.inkFk = inkFk.value;
+ where.tag1 = tag1.value;
+ where.tag2 = tag2.value;
+
+ return { where };
+});
function getQuantityStyle(row) {
if (row?.quantity !== row?.stickers * row?.packing)
@@ -521,6 +501,23 @@ async function setBuyUltimate(itemFk, data) {
});
}
+async function transferBuys(rows, newEntry) {
+ if (!newEntry) return;
+
+ const promises = rows.map((row) => {
+ return axios.patch('Buys', { id: row.id, entryFk: newEntry });
+ });
+
+ await Promise.all(promises);
+
+ await axios.post(`Entries/${newEntry}/recalcEntryPrices`);
+ await axios.post(`Entries/${entityId.value}/recalcEntryPrices`);
+
+ entryBuysRef.value.reload();
+ newEntryRef.value = null;
+ dialogRef.value = false;
+}
+
onMounted(() => {
stateStore.rightDrawer = false;
if ($props.editableMode) checkEntryLock(entityId.value, user.id);
@@ -595,6 +592,47 @@ onMounted(() => {
+
+
+
+
+ {{ t('Transfer buys') }}
+
+
+
+
+
+
+
+
+
+
+
+
{
:url="`Entries/${entityId}/getBuyList`"
search-url="EntryBuys"
save-url="Buys/crud"
+ :filter="editableMode ? filter : {}"
:disable-option="{ card: true }"
v-model:selected="selectedRows"
@on-fetch="() => footerFetchDataRef.fetch()"
@@ -643,7 +682,7 @@ onMounted(() => {
},
columnGridStyle: {
'max-width': '50%',
- 'margin-right': '30px',
+ 'margin-right': '5%',
flex: 1,
},
previousStyle: {
@@ -655,7 +694,7 @@ onMounted(() => {
:is-editable="editableMode"
:without-header="!editableMode"
:with-filters="editableMode"
- :right-search="editableMode"
+ :right-search="false"
:row-click="false"
:columns="columns"
:beforeSaveFn="beforeSave"
@@ -666,6 +705,47 @@ onMounted(() => {
data-cy="entry-buys"
overlay
>
+
+
+
+
+
+
+
+
+
@@ -696,7 +776,7 @@ onMounted(() => {