-
-
-
-
-
- {{ t('New price') }}
-
- {{ toCurrency($props.newPrice) }}
-
-
+
+
+
+
+
+
+
+
+ {{ t('New price') }}
+
+ {{ toCurrency($props.newPrice) }}
+
+
store.data?.ticketState?.state?.code);
const transfer = ref({
@@ -175,17 +174,21 @@ const getSaleTotal = (sale) => {
return price - discount;
};
+const getRowUpdateInputEvents = (sale) => ({
+ 'keyup.enter': () => {
+ changeQuantity(sale);
+ },
+ blur: () => {
+ changeQuantity(sale);
+ },
+});
+
const resetChanges = async () => {
arrayData.fetch({ append: false });
tableRef.value.reload();
};
-const rowToUpdate = ref(null);
const changeQuantity = async (sale) => {
- if (
- !sale.itemFk ||
- sale.quantity == null ||
- edit.value?.oldQuantity === sale.quantity
- )
+ if (!sale.itemFk || sale.quantity == null || sale?.originalQuantity === sale.quantity)
return;
if (!sale.id) return addSale(sale);
@@ -197,11 +200,8 @@ const changeQuantity = async (sale) => {
const updateQuantity = async (sale) => {
try {
let { quantity, id } = sale;
- if (!rowToUpdate.value) return;
- rowToUpdate.value = null;
sale.isNew = false;
- const params = { quantity: quantity };
- await axios.post(`Sales/${id}/updateQuantity`, params);
+ await axios.post(`Sales/${id}/updateQuantity`, { quantity });
notify('globals.dataSaved', 'positive');
tableRef.value.reload();
} catch (e) {
@@ -258,18 +258,6 @@ const DEFAULT_EDIT = {
oldQuantity: null,
};
const edit = ref({ ...DEFAULT_EDIT });
-const usesMana = ref(null);
-
-const getUsesMana = async () => {
- const { data } = await axios.get('Sales/usesMana');
- usesMana.value = data;
-};
-
-const getMana = async () => {
- const { data } = await axios.get(`Tickets/${route.params.id}/getSalesPersonMana`);
- mana.value = data;
- await getUsesMana();
-};
const selectedValidSales = computed(() => {
if (!sales.value) return;
@@ -277,7 +265,6 @@ const selectedValidSales = computed(() => {
});
const onOpenEditPricePopover = async (sale) => {
- await getMana();
edit.value = {
sale: JSON.parse(JSON.stringify(sale)),
price: sale.price,
@@ -285,7 +272,6 @@ const onOpenEditPricePopover = async (sale) => {
};
const onOpenEditDiscountPopover = async (sale) => {
- await getMana();
if (isLocked.value) return;
if (sale) {
edit.value = {
@@ -306,7 +292,6 @@ const changePrice = async (sale) => {
await confirmUpdate(() => updatePrice(sale, newPrice));
} else updatePrice(sale, newPrice);
}
- await getMana();
};
const updatePrice = async (sale, newPrice) => {
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
@@ -599,9 +584,7 @@ watch(
:is-ticket-editable="isTicketEditable"
:sales="selectedValidSales"
:disable="!hasSelectedRows"
- :mana="mana"
:ticket-config="ticketConfig"
- @get-mana="getMana()"
@update-discounts="updateDiscounts"
@refresh-table="resetChanges"
/>
@@ -772,9 +755,7 @@ watch(
v-if="row.isNew || isTicketEditable"
type="number"
v-model.number="row.quantity"
- @blur="changeQuantity(row)"
- @keyup.enter.stop="changeQuantity(row)"
- @update:model-value="() => (rowToUpdate = row)"
+ v-on="getRowUpdateInputEvents(row)"
@focus="edit.oldQuantity = row.quantity"
/>
{{ row.quantity }}
@@ -786,7 +767,6 @@ watch(
diff --git a/src/pages/Ticket/Card/TicketSaleMoreActions.vue b/src/pages/Ticket/Card/TicketSaleMoreActions.vue
index 4cc96e9e2..840b62507 100644
--- a/src/pages/Ticket/Card/TicketSaleMoreActions.vue
+++ b/src/pages/Ticket/Card/TicketSaleMoreActions.vue
@@ -34,10 +34,6 @@ const props = defineProps({
type: Array,
default: () => [],
},
- mana: {
- type: Number,
- default: null,
- },
ticketConfig: {
type: Array,
default: () => [],
@@ -50,6 +46,7 @@ const { dialog } = useQuasar();
const { notify } = useNotify();
const acl = useAcl();
const btnDropdownRef = ref(null);
+const editManaProxyRef = ref(null);
const { openConfirmationModal } = useVnConfirm();
const newDiscount = ref(null);
@@ -131,13 +128,13 @@ const createClaim = () => {
openConfirmationModal(
t('Claim out of time'),
t('Do you want to continue?'),
- onCreateClaimAccepted
+ onCreateClaimAccepted,
);
else
openConfirmationModal(
t('Do you want to create a claim?'),
false,
- onCreateClaimAccepted
+ onCreateClaimAccepted,
);
};
@@ -216,8 +213,14 @@ const createRefund = async (withWarehouse) => {
{{ t('Update discount') }}
-
+
editManaProxyRef.save(row)"
v-model.number="newDiscount"
:label="t('ticketSale.discount')"
type="number"
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index 5df08b881..5838efa88 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -46,6 +46,15 @@ const descriptorData = useArrayData('Ticket');
onMounted(async () => {
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
});
+const formattedAddress = computed(() => {
+ if (!ticket.value) return '';
+
+ const address = ticket.value.address;
+ const postcode = address.postalCode;
+ const province = address.province ? `(${address.province.name})` : '';
+
+ return `${address.street} - ${postcode} - ${address.city} ${province}`;
+});
function isEditable() {
try {
@@ -238,7 +247,7 @@ onMounted(async () => {
/>
diff --git a/src/pages/Ticket/TicketFilter.vue b/src/pages/Ticket/TicketFilter.vue
index 4b50892b0..c82c0067f 100644
--- a/src/pages/Ticket/TicketFilter.vue
+++ b/src/pages/Ticket/TicketFilter.vue
@@ -293,6 +293,7 @@ en:
clientFk: Customer
orderFk: Order
from: From
+ shipped: Shipped
to: To
salesPersonFk: Salesperson
stateFk: State
@@ -320,6 +321,7 @@ es:
clientFk: Cliente
orderFk: Pedido
from: Desde
+ shipped: F. envĂo
to: Hasta
salesPersonFk: Comercial
stateFk: Estado
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index 88878076d..78bebc297 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -108,13 +108,11 @@ const columns = computed(() => [
},
{
align: 'left',
- name: 'shippedDate',
+ name: 'shipped',
cardVisible: true,
label: t('ticketList.shipped'),
columnFilter: {
component: 'date',
- alias: 't',
- inWhere: true,
},
format: ({ shippedDate }) => toDate(shippedDate),
},
diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue
index 6025ae289..e3582a2d5 100644
--- a/src/pages/Worker/Card/WorkerBusiness.vue
+++ b/src/pages/Worker/Card/WorkerBusiness.vue
@@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnTable from 'components/VnTable/VnTable.vue';
-import { toDate } from 'src/filters';
+import { dashIfEmpty, toDate } from 'src/filters';
import { useQuasar } from 'quasar';
import axios from 'axios';
@@ -15,7 +15,7 @@ const quasar = useQuasar();
async function reactivateWorker() {
const hasToReactive = tableRef.value.CrudModelRef.formData.find(
- (data) => !data.ended
+ (data) => !data.ended,
);
if (hasToReactive) {
quasar
@@ -38,25 +38,25 @@ const columns = computed(() => [
{
name: 'started',
label: t('worker.business.tableVisibleColumns.started'),
- align: 'left',
format: ({ started }) => toDate(started),
component: 'date',
cardVisible: true,
create: true,
+ width: '90px',
},
{
name: 'ended',
label: t('worker.business.tableVisibleColumns.ended'),
- align: 'left',
format: ({ ended }) => toDate(ended),
component: 'date',
cardVisible: true,
create: true,
+ width: '90px',
},
{
label: t('worker.business.tableVisibleColumns.company'),
- align: 'left',
+ toolTip: t('worker.business.tableVisibleColumns.company'),
name: 'companyCodeFk',
component: 'select',
attrs: {
@@ -65,23 +65,23 @@ const columns = computed(() => [
optionLabel: 'code',
optionValue: 'code',
},
- cardVisible: true,
create: true,
+ width: '60px',
},
{
- align: 'left',
name: 'reasonEndFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.reasonEnd'),
+ toolTip: t('worker.business.tableVisibleColumns.reasonEnd'),
attrs: {
url: 'BusinessReasonEnds',
fields: ['id', 'reason'],
optionLabel: 'reason',
},
cardVisible: true,
+ format: ({ reason }, dashIfEmpty) => dashIfEmpty(reason),
},
{
- align: 'left',
name: 'departmentFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.department'),
@@ -89,15 +89,19 @@ const columns = computed(() => [
url: 'Departments',
fields: ['id', 'name'],
optionLabel: 'name',
+ optionValue: 'id',
},
cardVisible: true,
create: true,
+ width: '80px',
+ format: ({ departmentName }, dashIfEmpty) => dashIfEmpty(departmentName),
},
{
align: 'left',
name: 'workerBusinessProfessionalCategoryFk',
component: 'select',
label: t('worker.business.tableVisibleColumns.professionalCategory'),
+ toolTip: t('worker.business.tableVisibleColumns.professionalCategory'),
attrs: {
url: 'WorkerBusinessProfessionalCategories',
fields: ['id', 'description', 'code'],
@@ -105,6 +109,9 @@ const columns = computed(() => [
},
cardVisible: true,
create: true,
+ width: '100px',
+ format: ({ professionalDescription }, dashIfEmpty) =>
+ dashIfEmpty(professionalDescription),
},
{
align: 'left',
@@ -118,6 +125,8 @@ const columns = computed(() => [
},
cardVisible: true,
create: true,
+ format: ({ calendarTypeDescription }, dashIfEmpty) =>
+ dashIfEmpty(calendarTypeDescription),
},
{
align: 'left',
@@ -131,6 +140,8 @@ const columns = computed(() => [
},
cardVisible: true,
create: true,
+ width: '100px',
+ format: ({ workCenterName }, dashIfEmpty) => dashIfEmpty(workCenterName),
},
{
align: 'left',
@@ -144,6 +155,7 @@ const columns = computed(() => [
},
cardVisible: true,
create: true,
+ format: ({ payrollDescription }, dashIfEmpty) => dashIfEmpty(payrollDescription),
},
{
align: 'left',
@@ -157,6 +169,7 @@ const columns = computed(() => [
},
cardVisible: true,
create: true,
+ format: ({ occupationName }, dashIfEmpty) => dashIfEmpty(occupationName),
},
{
align: 'left',
@@ -165,6 +178,7 @@ const columns = computed(() => [
component: 'input',
cardVisible: true,
create: true,
+ width: '50px',
},
{
align: 'left',
@@ -177,6 +191,8 @@ const columns = computed(() => [
},
cardVisible: true,
create: true,
+ format: ({ workerBusinessTypeName }, dashIfEmpty) =>
+ dashIfEmpty(workerBusinessTypeName),
},
{
align: 'left',
@@ -185,6 +201,7 @@ const columns = computed(() => [
component: 'input',
cardVisible: true,
create: true,
+ width: '70px',
},
{
align: 'left',
@@ -193,6 +210,7 @@ const columns = computed(() => [
component: 'input',
cardVisible: true,
create: true,
+ width: '70px',
},
{
name: 'notes',
@@ -208,7 +226,7 @@ const columns = computed(() => [
reactivateWorker(data)"
/>
diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue
index de3f634e2..0e946f1dd 100644
--- a/src/pages/Worker/Card/WorkerDescriptor.vue
+++ b/src/pages/Worker/Card/WorkerDescriptor.vue
@@ -111,6 +111,7 @@ const handlePhotoUpdated = (evt = false) => {
{
.photo {
height: 256px;
}
+.ellipsis-text {
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js
index d1596f693..425eaffe6 100644
--- a/test/cypress/integration/item/itemTag.spec.js
+++ b/test/cypress/integration/item/itemTag.spec.js
@@ -1,36 +1,33 @@
-///
describe('Item tag', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/item/1/tags`);
+ cy.get('.q-page').should('be.visible');
+ cy.waitForElement('[data-cy="itemTags"]');
});
+ const createNewTag = 'createNewTag';
+ const saveBtn = 'crudModelDefaultSaveBtn';
+ const newTag = 'tagundefined';
+
it('should throw an error adding an existent tag', () => {
- cy.get('.q-page').should('be.visible');
- cy.get('.q-page-sticky > div').click();
- cy.get('.q-page-sticky > div').click();
- cy.dataCy('Tag_select').eq(7).type('Tallos');
- cy.get('.q-menu .q-item').contains('Tallos').click();
- cy.get(':nth-child(8) > [label="Value"]').type('1');
- cy.dataCy('crudModelDefaultSaveBtn').click();
+ cy.dataCy(createNewTag).click();
+ cy.dataCy(newTag).should('be.visible').click().type('Genero{enter}');
+ cy.dataCy('tagGeneroValue').eq(1).should('be.visible');
+ cy.dataCy(saveBtn).click();
cy.checkNotification("The tag or priority can't be repeated for an item");
});
it('should add a new tag', () => {
- cy.get('.q-page').should('be.visible');
- cy.get('.q-page-sticky > div').click();
- cy.get('.q-page-sticky > div').click();
- cy.dataCy('Tag_select').eq(7).click();
- cy.get('.q-menu .q-item').contains('Ancho de la base').type('{enter}');
- cy.get(':nth-child(8) > [label="Value"]').type('50');
- cy.dataCy('crudModelDefaultSaveBtn').click();
+ cy.dataCy(createNewTag).click();
+ cy.dataCy(newTag).should('be.visible').click().type('Forma{enter}');
+ cy.dataCy('tagFormaValue').should('be.visible').type('50');
+ cy.dataCy(saveBtn).click();
+
cy.checkNotification('Data saved');
- cy.dataCy('itemTags')
- .children(':nth-child(8)')
- .find('.justify-center > .q-icon')
- .click();
- cy.dataCy('VnConfirm_confirm').click();
+ cy.dataCy('deleteTagForma').should('be.visible').click();
+ cy.dataCy('VnConfirm_confirm').should('be.visible').click();
cy.checkNotification('Data saved');
});
});