Merge branch 'master' into hotfix_hasDocuware_call
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Javier Segarra 2025-05-20 20:31:42 +00:00
commit 9e270ad1a6
12 changed files with 73 additions and 25 deletions

View File

@ -7,7 +7,6 @@ import axios from 'axios';
import { usePrintService } from 'composables/usePrintService'; import { usePrintService } from 'composables/usePrintService';
import VnUserLink from '../ui/VnUserLink.vue'; import VnUserLink from '../ui/VnUserLink.vue';
import { downloadFile } from 'src/composables/downloadFile';
import VnImg from 'components/ui/VnImg.vue'; import VnImg from 'components/ui/VnImg.vue';
import VnPaginate from 'components/ui/VnPaginate.vue'; import VnPaginate from 'components/ui/VnPaginate.vue';
import VnDms from 'src/components/common/VnDms.vue'; import VnDms from 'src/components/common/VnDms.vue';

View File

@ -5,7 +5,7 @@ import { useRoute, useRouter } from 'vue-router';
import { QBadge, QBtn, QCheckbox } from 'quasar'; import { QBadge, QBtn, QCheckbox } from 'quasar';
import { downloadFile } from 'src/composables/downloadFile'; import { usePrintService } from 'composables/usePrintService';
import { toDateTimeFormat } from 'src/filters/date'; import { toDateTimeFormat } from 'src/filters/date';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
@ -15,7 +15,7 @@ import CustomerFileManagementActions from 'src/pages/Customer/components/Custome
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const { openReport } = usePrintService();
const ClientDmsRef = ref(null); const ClientDmsRef = ref(null);
const rows = ref([]); const rows = ref([]);
@ -87,7 +87,7 @@ const tableColumnComponents = {
file: { file: {
component: QBtn, component: QBtn,
props: () => ({ flat: true }), props: () => ({ flat: true }),
event: ({ row }) => downloadFile(row.dmsFk), event: ({ row }) => openReport(`dms/${row.dmsFk}/downloadFile`, {}, '_blank'),
}, },
employee: { employee: {
component: QBtn, component: QBtn,

View File

@ -4,6 +4,7 @@ export default {
'id', 'id',
'workerFk', 'workerFk',
'agencyModeFk', 'agencyModeFk',
'dated',
'created', 'created',
'm3', 'm3',
'warehouseFk', 'warehouseFk',

View File

@ -187,11 +187,11 @@ const getRowUpdateInputEvents = (sale) => {
}; };
const resetChanges = async () => { const resetChanges = async () => {
const _selectedRows = selectedRows.value;
await arrayData.fetch({ append: false }); await arrayData.fetch({ append: false });
tableRef.value.CrudModelRef.hasChanges = false; tableRef.value.CrudModelRef.hasChanges = false;
await tableRef.value.reload(); await tableRef.value.reload();
tableRef.value.selected = _selectedRows;
selectedRows.value = [];
}; };
const changeQuantity = async (sale) => { const changeQuantity = async (sale) => {
if (!sale.itemFk || sale.quantity == null || sale?.originalQuantity === sale.quantity) if (!sale.itemFk || sale.quantity == null || sale?.originalQuantity === sale.quantity)

View File

@ -366,7 +366,11 @@ function openBalanceDialog(ticket) {
); );
if (!isSameClient) { if (!isSameClient) {
throw new Error('You cannot make a payment on account from multiple clients'); notify(
t('You cannot make a payment on account from multiple clients'),
'negative',
);
return;
} }
for (let ticketData of checkedTickets) { for (let ticketData of checkedTickets) {
@ -664,4 +668,5 @@ es:
Zone: Zona Zone: Zona
New ticket: Nuevo ticket New ticket: Nuevo ticket
Component lack: Faltan componentes Component lack: Faltan componentes
You cannot make a payment on account from multiple clients: No puedes hacer un pago a cuenta de varios clientes
</i18n> </i18n>

View File

@ -52,30 +52,50 @@ const filterBanks = {
const state = useState(); const state = useState();
const user = state.getUser(); const user = state.getUser();
const originalDescription = ref('');
const initialData = ref({ const initialData = ref({
...$props.formData, ...$props.formData,
companyFk: user.value.companyFk, companyFk: user.value.companyFk,
payed: Date.vnNew(), payed: Date.vnNew(),
originalDescription: '',
}); });
function setPaymentType(data, accounting) { function setPaymentType(data, accounting) {
data.bankFk = accounting.id;
if (!accounting) return; if (!accounting) return;
data.bankFk = accounting.id;
accountingType.value = accounting.accountingType; accountingType.value = accounting.accountingType;
data.description = []; data.description = [];
data.payed = Date.vnNew();
isCash.value = accountingType.value.code == 'cash'; isCash.value = accountingType.value.code == 'cash';
viewReceipt.value = isCash.value; viewReceipt.value = isCash.value;
if (accountingType.value.daysInFuture)
data.payed.setDate(data.payed.getDate() + accountingType.value.daysInFuture);
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
if (accountingType.value.code == 'compensation') return (data.description = '');
let descriptions = []; switch (accountingType.value.code) {
if (accountingType.value.receiptDescription) case 'compensation':
descriptions.push(accountingType.value.receiptDescription); data.description.push($props.formData.description);
if (data.description > 0) descriptions.push(data.description); break;
data.description = descriptions.join(', ');
default:
if (
accountingType.value.receiptDescription != null &&
accountingType.value.receiptDescription != ''
) {
data.description.push(accountingType.value.receiptDescription);
}
const originalDescription =
data.originalDescription || $props.formData.description;
if (originalDescription) {
data.description.push(originalDescription);
}
}
data.description = data.description.join(', ');
data.payed = Date.vnNew();
if (accountingType.value.daysInFuture) {
data.payed.setDate(data.payed.getDate() + accountingType.value.daysInFuture);
}
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
} }
const calculateFromAmount = (event) => { const calculateFromAmount = (event) => {

View File

@ -7,6 +7,7 @@ services:
depends_on: depends_on:
- db - db
dns_search: . dns_search: .
pull_policy: always
front: front:
image: lilium-dev:latest image: lilium-dev:latest
command: pnpm exec quasar dev command: pnpm exec quasar dev
@ -16,5 +17,7 @@ services:
- CI - CI
- TZ - TZ
dns_search: . dns_search: .
pull_policy: never
db: db:
image: 'registry.verdnatura.es/salix-db:${COMPOSE_TAG:-dev}' image: 'registry.verdnatura.es/salix-db:${COMPOSE_TAG:-dev}'
pull_policy: always

View File

@ -7,8 +7,8 @@ Cypress.Commands.add('selectTravel', (warehouse = '1') => {
}); });
Cypress.Commands.add('deleteEntry', () => { Cypress.Commands.add('deleteEntry', () => {
cy.dataCy('descriptor-more-opts').should('be.visible').click(); cy.openActionsDescriptor();
cy.waitForElement('div[data-cy="delete-entry"]').click(); cy.get('[data-cy="delete-entry"]').click();
}); });
Cypress.Commands.add('createEntry', () => { Cypress.Commands.add('createEntry', () => {

View File

@ -94,8 +94,10 @@ describe.skip('EntryBuys', () => {
cy.get('button[data-cy="vnTableCreateBtn"]').click(); cy.get('button[data-cy="vnTableCreateBtn"]').click();
cy.get('input[data-cy="itemFk-create-popup"]').type('1'); cy.get('input[data-cy="itemFk-create-popup"]').type('1');
cy.intercept('GET', /\/api\/Items\/1\/getVisibleAvailable/).as('item');
cy.get('div[role="listbox"] > div > div[role="option"]').eq(0).click(); cy.get('div[role="listbox"] > div > div[role="option"]').eq(0).click();
cy.wait('@item');
cy.get('input[data-cy="Grouping mode_select"]').should('have.value', 'packing'); cy.get('input[data-cy="Grouping mode_select"]').should('have.value', 'packing');
cy.get('button[data-cy="FormModelPopup_save"]').click(); cy.saveFormModel();
} }
}); });

View File

@ -6,7 +6,7 @@ describe('TicketBasicData', () => {
cy.visit('/#/ticket/31/basic-data'); cy.visit('/#/ticket/31/basic-data');
}); });
it('Should redirect to customer basic data', () => { it.skip('Should redirect to customer basic data', () => {
cy.get('.q-page').should('be.visible'); cy.get('.q-page').should('be.visible');
cy.get(':nth-child(2) > div > .text-primary').click(); cy.get(':nth-child(2) > div > .text-primary').click();
cy.dataCy('Address_select').click(); cy.dataCy('Address_select').click();
@ -16,7 +16,7 @@ describe('TicketBasicData', () => {
).click(); ).click();
cy.url().should('include', '/customer/1104/basic-data'); cy.url().should('include', '/customer/1104/basic-data');
}); });
it.only('stepper', () => { it('stepper', () => {
cy.get('.q-stepper__tab--active').should('have.class', 'q-stepper__tab--active'); cy.get('.q-stepper__tab--active').should('have.class', 'q-stepper__tab--active');
cy.get('.q-stepper__nav > .q-btn--standard').click(); cy.get('.q-stepper__nav > .q-btn--standard').click();

View File

@ -26,6 +26,24 @@ describe('TicketList', () => {
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/); cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
}); });
it('should create payment ticket', () => {
cy.searchInFilterPanel().click();
const rowSelected =
'tbody > :nth-child(2) > :nth-child(1) > .q-checkbox > .q-checkbox__inner ';
cy.get(rowSelected).click();
cy.get(
'[style="transform: translate(-256px, 0px); margin: 140px 20px; z-index: 2;"] > div > .q-btn',
).click();
const description = 'Albaran: 31';
cy.dataCy('Reference_input').should('have.value', description);
cy.selectOption('[data-cy="paymentBank"]', 'Cash');
cy.dataCy('Delivered amount_input').clear().type('41.62');
cy.dataCy('Reference_input').should('have.value', `Cash, ${description}`);
cy.get('[aria-label="View recipt"]').click();
cy.get('.q-btn--standard > .q-btn__content > .block').click();
});
it('should open ticket summary', () => { it('should open ticket summary', () => {
searchResults(); searchResults();
cy.getRow().find('.q-btn:last').click(); cy.getRow().find('.q-btn:last').click();

View File

@ -133,7 +133,7 @@ describe.skip('TicketSale', { testIsolation: true }, () => {
cy.dataCy('recalculatePriceItem').click(); cy.dataCy('recalculatePriceItem').click();
cy.wait('@recalculatePrice').its('response.statusCode').should('eq', 200); cy.wait('@recalculatePrice').its('response.statusCode').should('eq', 200);
cy.checkNotification('Data saved'); cy.checkNotification('Data saved');
cy.dataCy('ticketSaleMoreActionsDropdown').should('be.disabled'); cy.dataCy('ticketSaleMoreActionsDropdown').should('not.be.disabled');
}); });
it('should update discount when "Update discount" is clicked', () => { it('should update discount when "Update discount" is clicked', () => {
@ -155,7 +155,7 @@ describe.skip('TicketSale', { testIsolation: true }, () => {
cy.dataCy('saveManaBtn').click(); cy.dataCy('saveManaBtn').click();
cy.wait('@updateDiscount').its('response.statusCode').should('eq', 204); cy.wait('@updateDiscount').its('response.statusCode').should('eq', 204);
cy.checkNotification('Data saved'); cy.checkNotification('Data saved');
cy.dataCy('ticketSaleMoreActionsDropdown').should('be.disabled'); cy.dataCy('ticketSaleMoreActionsDropdown').should('not.be.disabled');
}); });
it('adds claim', () => { it('adds claim', () => {