8713-testToMaster #1539
|
@ -143,6 +143,7 @@ const exprBuilder = (param, value) => {
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
auto-load
|
auto-load
|
||||||
|
sortBy="name ASC"
|
||||||
/></QItemSection>
|
/></QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-mb-sm">
|
<QItem class="q-mb-sm">
|
||||||
|
|
|
@ -78,10 +78,20 @@ const columns = computed(() => [
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Workers/activeWithInheritedRole',
|
url: 'Workers/activeWithInheritedRole',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name', 'firstName'],
|
||||||
where: { role: 'salesPerson' },
|
where: { role: 'salesPerson' },
|
||||||
optionFilter: 'firstName',
|
optionFilter: 'firstName',
|
||||||
},
|
},
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Workers/activeWithInheritedRole',
|
||||||
|
fields: ['id', 'name', 'firstName'],
|
||||||
|
where: { role: 'salesPerson' },
|
||||||
|
optionLabel: 'firstName',
|
||||||
|
optionValue: 'id',
|
||||||
|
},
|
||||||
|
},
|
||||||
create: false,
|
create: false,
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
|
|
|
@ -27,7 +27,7 @@ const user = state.getUser();
|
||||||
const today = Date.vnNew();
|
const today = Date.vnNew();
|
||||||
today.setHours(0, 0, 0, 0);
|
today.setHours(0, 0, 0, 0);
|
||||||
const warehousesOptions = ref([]);
|
const warehousesOptions = ref([]);
|
||||||
const itemBalances = computed(() => arrayDataItemBalances.store.data);
|
const itemBalances = computed(() => arrayDataItemBalances.store.data || []);
|
||||||
const where = computed(() => arrayDataItemBalances.store.filter.where || {});
|
const where = computed(() => arrayDataItemBalances.store.filter.where || {});
|
||||||
const showWhatsBeforeInventory = ref(false);
|
const showWhatsBeforeInventory = ref(false);
|
||||||
const inventoriedDate = ref(null);
|
const inventoriedDate = ref(null);
|
||||||
|
@ -313,8 +313,8 @@ async function updateWarehouse(warehouseFk) {
|
||||||
row.lineFk == row.lastPreparedLineFk
|
row.lineFk == row.lastPreparedLineFk
|
||||||
? 'black'
|
? 'black'
|
||||||
: row.balance < 0
|
: row.balance < 0
|
||||||
? 'negative'
|
? 'negative'
|
||||||
: ''
|
: ''
|
||||||
"
|
"
|
||||||
dense
|
dense
|
||||||
style="font-size: 14px"
|
style="font-size: 14px"
|
||||||
|
|
|
@ -87,7 +87,7 @@ const insertTag = (rows) => {
|
||||||
tagFk: undefined,
|
tagFk: undefined,
|
||||||
}"
|
}"
|
||||||
:default-remove="false"
|
:default-remove="false"
|
||||||
:filter="{
|
:user-filter="{
|
||||||
fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'],
|
fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'],
|
||||||
where: { itemFk: route.params.id },
|
where: { itemFk: route.params.id },
|
||||||
include: {
|
include: {
|
||||||
|
@ -119,6 +119,7 @@ const insertTag = (rows) => {
|
||||||
"
|
"
|
||||||
:required="true"
|
:required="true"
|
||||||
:rules="validate('itemTag.tagFk')"
|
:rules="validate('itemTag.tagFk')"
|
||||||
|
:data-cy="`tag${row?.tag?.name}`"
|
||||||
/>
|
/>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-if="row.tag?.isFree === false"
|
v-if="row.tag?.isFree === false"
|
||||||
|
@ -145,6 +146,7 @@ const insertTag = (rows) => {
|
||||||
:label="t('itemTags.value')"
|
:label="t('itemTags.value')"
|
||||||
:is-clearable="false"
|
:is-clearable="false"
|
||||||
@keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
|
@keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
|
||||||
|
:data-cy="`tag${row?.tag?.name}Value`"
|
||||||
/>
|
/>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('itemBasicData.relevancy')"
|
:label="t('itemBasicData.relevancy')"
|
||||||
|
@ -162,6 +164,7 @@ const insertTag = (rows) => {
|
||||||
name="delete"
|
name="delete"
|
||||||
size="sm"
|
size="sm"
|
||||||
dense
|
dense
|
||||||
|
:data-cy="`deleteTag${row?.tag?.name}`"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('itemTags.removeTag') }}
|
{{ t('itemTags.removeTag') }}
|
||||||
|
@ -177,6 +180,7 @@ const insertTag = (rows) => {
|
||||||
icon="add"
|
icon="add"
|
||||||
v-shortcut="'+'"
|
v-shortcut="'+'"
|
||||||
fab
|
fab
|
||||||
|
data-cy="createNewTag"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('itemTags.addTag') }}
|
{{ t('itemTags.addTag') }}
|
||||||
|
|
|
@ -175,17 +175,21 @@ const getSaleTotal = (sale) => {
|
||||||
return price - discount;
|
return price - discount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getRowUpdateInputEvents = (sale) => ({
|
||||||
|
'keyup.enter': () => {
|
||||||
|
changeQuantity(sale);
|
||||||
|
},
|
||||||
|
blur: () => {
|
||||||
|
changeQuantity(sale);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const resetChanges = async () => {
|
const resetChanges = async () => {
|
||||||
arrayData.fetch({ append: false });
|
arrayData.fetch({ append: false });
|
||||||
tableRef.value.reload();
|
tableRef.value.reload();
|
||||||
};
|
};
|
||||||
const rowToUpdate = ref(null);
|
|
||||||
const changeQuantity = async (sale) => {
|
const changeQuantity = async (sale) => {
|
||||||
if (
|
if (!sale.itemFk || sale.quantity == null || sale?.originalQuantity === sale.quantity)
|
||||||
!sale.itemFk ||
|
|
||||||
sale.quantity == null ||
|
|
||||||
edit.value?.oldQuantity === sale.quantity
|
|
||||||
)
|
|
||||||
return;
|
return;
|
||||||
if (!sale.id) return addSale(sale);
|
if (!sale.id) return addSale(sale);
|
||||||
|
|
||||||
|
@ -197,11 +201,8 @@ const changeQuantity = async (sale) => {
|
||||||
const updateQuantity = async (sale) => {
|
const updateQuantity = async (sale) => {
|
||||||
try {
|
try {
|
||||||
let { quantity, id } = sale;
|
let { quantity, id } = sale;
|
||||||
if (!rowToUpdate.value) return;
|
|
||||||
rowToUpdate.value = null;
|
|
||||||
sale.isNew = false;
|
sale.isNew = false;
|
||||||
const params = { quantity: quantity };
|
await axios.post(`Sales/${id}/updateQuantity`, { quantity });
|
||||||
await axios.post(`Sales/${id}/updateQuantity`, params);
|
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
tableRef.value.reload();
|
tableRef.value.reload();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -772,9 +773,7 @@ watch(
|
||||||
v-if="row.isNew || isTicketEditable"
|
v-if="row.isNew || isTicketEditable"
|
||||||
type="number"
|
type="number"
|
||||||
v-model.number="row.quantity"
|
v-model.number="row.quantity"
|
||||||
@blur="changeQuantity(row)"
|
v-on="getRowUpdateInputEvents(row)"
|
||||||
@keyup.enter.stop="changeQuantity(row)"
|
|
||||||
@update:model-value="() => (rowToUpdate = row)"
|
|
||||||
@focus="edit.oldQuantity = row.quantity"
|
@focus="edit.oldQuantity = row.quantity"
|
||||||
/>
|
/>
|
||||||
<span v-else>{{ row.quantity }}</span>
|
<span v-else>{{ row.quantity }}</span>
|
||||||
|
|
|
@ -50,6 +50,7 @@ const { dialog } = useQuasar();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const acl = useAcl();
|
const acl = useAcl();
|
||||||
const btnDropdownRef = ref(null);
|
const btnDropdownRef = ref(null);
|
||||||
|
const editManaProxyRef = ref(null);
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
|
||||||
const newDiscount = ref(null);
|
const newDiscount = ref(null);
|
||||||
|
@ -131,13 +132,13 @@ const createClaim = () => {
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('Claim out of time'),
|
t('Claim out of time'),
|
||||||
t('Do you want to continue?'),
|
t('Do you want to continue?'),
|
||||||
onCreateClaimAccepted
|
onCreateClaimAccepted,
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('Do you want to create a claim?'),
|
t('Do you want to create a claim?'),
|
||||||
false,
|
false,
|
||||||
onCreateClaimAccepted
|
onCreateClaimAccepted,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -216,8 +217,15 @@ const createRefund = async (withWarehouse) => {
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<TicketEditManaProxy :mana="props.mana" @save="changeMultipleDiscount()">
|
<TicketEditManaProxy
|
||||||
|
ref="editManaProxyRef"
|
||||||
|
:sale="row"
|
||||||
|
:mana="props.mana"
|
||||||
|
@save="changeMultipleDiscount"
|
||||||
|
>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
autofocus
|
||||||
|
@keyup.enter.stop="() => editManaProxyRef.save(row)"
|
||||||
v-model.number="newDiscount"
|
v-model.number="newDiscount"
|
||||||
:label="t('ticketSale.discount')"
|
:label="t('ticketSale.discount')"
|
||||||
type="number"
|
type="number"
|
||||||
|
|
|
@ -46,6 +46,15 @@ const descriptorData = useArrayData('Ticket');
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
|
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() {
|
function isEditable() {
|
||||||
try {
|
try {
|
||||||
|
@ -238,7 +247,7 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.consigneeStreet')"
|
:label="t('ticket.summary.consigneeStreet')"
|
||||||
:value="entity.address?.street"
|
:value="formattedAddress"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="entity.notes.length">
|
<QCard class="vn-one" v-if="entity.notes.length">
|
||||||
|
|
|
@ -293,6 +293,7 @@ en:
|
||||||
clientFk: Customer
|
clientFk: Customer
|
||||||
orderFk: Order
|
orderFk: Order
|
||||||
from: From
|
from: From
|
||||||
|
shipped: Shipped
|
||||||
to: To
|
to: To
|
||||||
salesPersonFk: Salesperson
|
salesPersonFk: Salesperson
|
||||||
stateFk: State
|
stateFk: State
|
||||||
|
@ -320,6 +321,7 @@ es:
|
||||||
clientFk: Cliente
|
clientFk: Cliente
|
||||||
orderFk: Pedido
|
orderFk: Pedido
|
||||||
from: Desde
|
from: Desde
|
||||||
|
shipped: F. envío
|
||||||
to: Hasta
|
to: Hasta
|
||||||
salesPersonFk: Comercial
|
salesPersonFk: Comercial
|
||||||
stateFk: Estado
|
stateFk: Estado
|
||||||
|
|
|
@ -108,13 +108,11 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'shippedDate',
|
name: 'shipped',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
label: t('ticketList.shipped'),
|
label: t('ticketList.shipped'),
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'date',
|
component: 'date',
|
||||||
alias: 't',
|
|
||||||
inWhere: true,
|
|
||||||
},
|
},
|
||||||
format: ({ shippedDate }) => toDate(shippedDate),
|
format: ({ shippedDate }) => toDate(shippedDate),
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,36 +1,33 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
describe('Item tag', () => {
|
describe('Item tag', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/item/1/tags`);
|
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', () => {
|
it('should throw an error adding an existent tag', () => {
|
||||||
cy.get('.q-page').should('be.visible');
|
cy.dataCy(createNewTag).click();
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.dataCy(newTag).should('be.visible').click().type('Genero{enter}');
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.dataCy('tagGeneroValue').eq(1).should('be.visible');
|
||||||
cy.dataCy('Tag_select').eq(7).type('Tallos');
|
cy.dataCy(saveBtn).click();
|
||||||
cy.get('.q-menu .q-item').contains('Tallos').click();
|
|
||||||
cy.get(':nth-child(8) > [label="Value"]').type('1');
|
|
||||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
|
||||||
cy.checkNotification("The tag or priority can't be repeated for an item");
|
cy.checkNotification("The tag or priority can't be repeated for an item");
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add a new tag', () => {
|
it('should add a new tag', () => {
|
||||||
cy.get('.q-page').should('be.visible');
|
cy.dataCy(createNewTag).click();
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.dataCy(newTag).should('be.visible').click().type('Forma{enter}');
|
||||||
cy.get('.q-page-sticky > div').click();
|
cy.dataCy('tagFormaValue').should('be.visible').type('50');
|
||||||
cy.dataCy('Tag_select').eq(7).click();
|
cy.dataCy(saveBtn).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.checkNotification('Data saved');
|
cy.checkNotification('Data saved');
|
||||||
cy.dataCy('itemTags')
|
cy.dataCy('deleteTagForma').should('be.visible').click();
|
||||||
.children(':nth-child(8)')
|
cy.dataCy('VnConfirm_confirm').should('be.visible').click();
|
||||||
.find('.justify-center > .q-icon')
|
|
||||||
.click();
|
|
||||||
cy.dataCy('VnConfirm_confirm').click();
|
|
||||||
cy.checkNotification('Data saved');
|
cy.checkNotification('Data saved');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue