forked from verdnatura/salix-front
Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6897-entryBuyListRefactor
This commit is contained in:
commit
ce89d4a31b
|
@ -328,7 +328,6 @@ en:
|
|||
active: Is active
|
||||
visible: Is visible
|
||||
floramondo: Is floramondo
|
||||
salesPersonFk: Buyer
|
||||
categoryFk: Category
|
||||
|
||||
es:
|
||||
|
@ -339,7 +338,6 @@ es:
|
|||
active: Activo
|
||||
visible: Visible
|
||||
floramondo: Floramondo
|
||||
salesPersonFk: Comprador
|
||||
categoryFk: Categoría
|
||||
Plant: Planta natural
|
||||
Flower: Flor fresca
|
||||
|
|
|
@ -15,6 +15,7 @@ const model = defineModel({ type: [String, Number, Object] });
|
|||
:fields="['id', 'name', 'nickname', 'nif']"
|
||||
:filter-options="['id', 'name', 'nickname', 'nif']"
|
||||
sort-by="name ASC"
|
||||
data-cy="vnSupplierSelect"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
|
|
@ -796,7 +796,6 @@ supplier:
|
|||
tableVisibleColumns:
|
||||
nif: NIF/CIF
|
||||
account: Cuenta
|
||||
|
||||
summary:
|
||||
responsible: Responsable
|
||||
verified: Verificado
|
||||
|
|
|
@ -117,7 +117,7 @@ const toCustomerAddressEdit = (addressId) => {
|
|||
data-key="CustomerAddresses"
|
||||
order="id DESC"
|
||||
ref="vnPaginateRef"
|
||||
:user-filter="addressFilter"
|
||||
:filter="addressFilter"
|
||||
:url="`Clients/${route.params.id}/addresses`"
|
||||
/>
|
||||
<div class="full-width flex justify-center">
|
||||
|
@ -189,11 +189,11 @@ const toCustomerAddressEdit = (addressId) => {
|
|||
|
||||
<QSeparator
|
||||
class="q-mx-lg"
|
||||
v-if="item.observations.length"
|
||||
v-if="item?.observations?.length"
|
||||
vertical
|
||||
/>
|
||||
|
||||
<div v-if="item.observations.length">
|
||||
<div v-if="item?.observations?.length">
|
||||
<div
|
||||
:key="obIndex"
|
||||
class="flex q-mb-sm"
|
||||
|
|
|
@ -61,6 +61,23 @@ const columns = computed(() => [
|
|||
columnFilter: false,
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'buyerId',
|
||||
label: t('customer.params.buyerId'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'TicketRequests/getItemTypeWorker',
|
||||
optionLabel: 'nickname',
|
||||
optionValue: 'id',
|
||||
|
||||
fields: ['id', 'nickname'],
|
||||
sortBy: ['nickname ASC'],
|
||||
optionFilter: 'firstName',
|
||||
},
|
||||
cardVisible: false,
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
name: 'description',
|
||||
align: 'left',
|
||||
|
@ -74,6 +91,7 @@ const columns = computed(() => [
|
|||
name: 'quantity',
|
||||
label: t('globals.quantity'),
|
||||
cardVisible: true,
|
||||
visible: true,
|
||||
columnFilter: {
|
||||
inWhere: true,
|
||||
},
|
||||
|
@ -138,11 +156,11 @@ const updateDateParams = (value, params) => {
|
|||
const campaign = campaignList.value.find((c) => c.id === value);
|
||||
if (!campaign) return;
|
||||
|
||||
const { dated, previousDays, scopeDays } = campaign;
|
||||
const _date = new Date(dated);
|
||||
const [from, to] = dateRange(_date);
|
||||
params.from = new Date(from.setDate(from.getDate() - previousDays)).toISOString();
|
||||
params.to = new Date(to.setDate(to.getDate() + scopeDays)).toISOString();
|
||||
const { dated, scopeDays } = campaign;
|
||||
const from = new Date(dated);
|
||||
from.setDate(from.getDate() - scopeDays);
|
||||
params.from = from;
|
||||
params.to = dated;
|
||||
return params;
|
||||
};
|
||||
</script>
|
||||
|
@ -205,24 +223,57 @@ const updateDateParams = (value, params) => {
|
|||
<template #moreFilterPanel="{ params }">
|
||||
<div class="column no-wrap flex-center q-gutter-y-md q-mt-xs q-pr-xl">
|
||||
<VnSelect
|
||||
v-model="params.campaign"
|
||||
:options="campaignList"
|
||||
:label="t('globals.campaign')"
|
||||
:filled="true"
|
||||
class="q-px-sm q-pt-none fit"
|
||||
url="ItemTypes"
|
||||
v-model="params.typeId"
|
||||
:label="t('item.list.typeName')"
|
||||
:fields="['id', 'name', 'categoryFk']"
|
||||
:include="'category'"
|
||||
:sortBy="'name ASC'"
|
||||
dense
|
||||
option-label="code"
|
||||
@update:model-value="(data) => updateDateParams(data, params)"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
{{ scope.opt?.code }}
|
||||
{{
|
||||
new Date(scope.opt?.dated).getFullYear()
|
||||
}}</QItemLabel
|
||||
>
|
||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||
<QItemLabel caption>{{
|
||||
scope.opt?.category?.name
|
||||
}}</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<VnSelect
|
||||
:filled="true"
|
||||
class="q-px-sm q-pt-none fit"
|
||||
url="ItemCategories"
|
||||
v-model="params.categoryId"
|
||||
:label="t('item.list.category')"
|
||||
:fields="['id', 'name']"
|
||||
:sortBy="'name ASC'"
|
||||
dense
|
||||
@update:model-value="(data) => updateDateParams(data, params)"
|
||||
/>
|
||||
<VnSelect
|
||||
v-model="params.campaign"
|
||||
:options="campaignList"
|
||||
:label="t('globals.campaign')"
|
||||
:filled="true"
|
||||
class="q-px-sm q-pt-none fit"
|
||||
:option-label="(opt) => t(opt.code)"
|
||||
:fields="['id', 'code', 'dated', 'scopeDays']"
|
||||
@update:model-value="(data) => updateDateParams(data, params)"
|
||||
dense
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel> {{ t(scope.opt?.code) }} </QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ new Date(scope.opt?.dated).getFullYear() }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
@ -247,7 +298,19 @@ const updateDateParams = (value, params) => {
|
|||
</template>
|
||||
|
||||
<i18n>
|
||||
en:
|
||||
|
||||
valentinesDay: Valentine's Day
|
||||
mothersDay: Mother's Day
|
||||
allSaints: All Saints' Day
|
||||
es:
|
||||
Enter a new search: Introduce una nueva búsqueda
|
||||
Group by items: Agrupar por artículos
|
||||
valentinesDay: Día de San Valentín
|
||||
mothersDay: Día de la Madre
|
||||
allSaints: Día de Todos los Santos
|
||||
Campaign consumption: Consumo campaña
|
||||
Campaign: Campaña
|
||||
From: Desde
|
||||
To: Hasta
|
||||
</i18n>
|
||||
|
|
|
@ -107,6 +107,9 @@ customer:
|
|||
defaulterSinced: Defaulted Since
|
||||
hasRecovery: Has Recovery
|
||||
socialName: Social name
|
||||
typeId: Type
|
||||
buyerId: Buyer
|
||||
categoryId: Category
|
||||
city: City
|
||||
phone: Phone
|
||||
postcode: Postcode
|
||||
|
|
|
@ -108,6 +108,9 @@ customer:
|
|||
hasRecovery: Tiene recobro
|
||||
socialName: Razón social
|
||||
campaign: Campaña
|
||||
typeId: Familia
|
||||
buyerId: Comprador
|
||||
categoryId: Reino
|
||||
city: Ciudad
|
||||
phone: Teléfono
|
||||
postcode: Código postal
|
||||
|
|
|
@ -54,8 +54,8 @@ const transferEntry = async () => {
|
|||
<i18n>
|
||||
en:
|
||||
transferEntryDialog: The entries will be transferred to the next day
|
||||
transferEntry: Transfer Entry
|
||||
transferEntry: Partial delay
|
||||
es:
|
||||
transferEntryDialog: Se van a transferir las compras al dia siguiente
|
||||
transferEntry: Transferir Entrada
|
||||
transferEntry: Retraso parcial
|
||||
</i18n>
|
||||
|
|
|
@ -149,6 +149,7 @@ function deleteFile(dmsFk) {
|
|||
option-value="id"
|
||||
option-label="id"
|
||||
:filter-options="['id', 'name']"
|
||||
data-cy="UnDeductibleVatSelect"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
|
|
@ -97,12 +97,19 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'companyCode',
|
||||
name: 'companyFk',
|
||||
label: t('globals.company'),
|
||||
cardVisible: true,
|
||||
component: 'select',
|
||||
attrs: { url: 'Companies', optionLabel: 'code', optionValue: 'id' },
|
||||
columnField: { component: null },
|
||||
attrs: {
|
||||
url: 'Companies',
|
||||
optionLabel: 'code',
|
||||
optionValue: 'id',
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.companyCode),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('InvoiceInBasicData', () => {
|
||||
const formInputs = '.q-form > .q-card input';
|
||||
const firstFormSelect = '.q-card > .vn-row:nth-child(1) > .q-select';
|
||||
const documentBtns = '[data-cy="dms-buttons"] button';
|
||||
const dialogInputs = '.q-dialog input';
|
||||
const resetBtn = '.q-btn-group--push > .q-btn--flat';
|
||||
const getDocumentBtns = (opt) => `[data-cy="dms-buttons"] > :nth-child(${opt})`;
|
||||
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
|
@ -11,13 +11,16 @@ describe('InvoiceInBasicData', () => {
|
|||
});
|
||||
|
||||
it('should edit the provideer and supplier ref', () => {
|
||||
cy.selectOption(firstFormSelect, 'Bros');
|
||||
cy.get('[title="Reset"]').click();
|
||||
cy.get(formInputs).eq(1).type('{selectall}4739');
|
||||
cy.saveCard();
|
||||
cy.dataCy('UnDeductibleVatSelect').type('4751000000');
|
||||
cy.get('.q-menu .q-item').contains('4751000000').click();
|
||||
cy.get(resetBtn).click();
|
||||
|
||||
cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Plants nick');
|
||||
cy.get(formInputs).eq(1).invoke('val').should('eq', '4739');
|
||||
cy.waitForElement('#formModel').within(() => {
|
||||
cy.dataCy('vnSupplierSelect').type('Bros nick');
|
||||
})
|
||||
cy.get('.q-menu .q-item').contains('Bros nick').click();
|
||||
cy.saveCard();
|
||||
cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Bros nick');
|
||||
});
|
||||
|
||||
it('should edit, remove and create the dms data', () => {
|
||||
|
@ -25,18 +28,18 @@ describe('InvoiceInBasicData', () => {
|
|||
const secondInput = "I don't know what posting here!";
|
||||
|
||||
//edit
|
||||
cy.get(documentBtns).eq(1).click();
|
||||
cy.get(getDocumentBtns(2)).click();
|
||||
cy.get(dialogInputs).eq(0).type(`{selectall}${firtsInput}`);
|
||||
cy.get('textarea').type(`{selectall}${secondInput}`);
|
||||
cy.get('[data-cy="FormModelPopup_save"]').click();
|
||||
cy.get(documentBtns).eq(1).click();
|
||||
cy.get(getDocumentBtns(2)).click();
|
||||
cy.get(dialogInputs).eq(0).invoke('val').should('eq', firtsInput);
|
||||
cy.get('textarea').invoke('val').should('eq', secondInput);
|
||||
cy.get('[data-cy="FormModelPopup_save"]').click();
|
||||
cy.checkNotification('Data saved');
|
||||
|
||||
//remove
|
||||
cy.get(documentBtns).eq(2).click();
|
||||
cy.get(getDocumentBtns(3)).click();
|
||||
cy.get('[data-cy="VnConfirm_confirm"]').click();
|
||||
cy.checkNotification('Data saved');
|
||||
|
||||
|
|
Loading…
Reference in New Issue