{{ t('Total by company') }}
-
- {{ currentBalance[companyId]?.code }}:
- {{ toCurrency(currentBalance[companyId]?.amount) }}
+
+ {{ clientRisk[0].company.code }}:
+ {{ toCurrency(clientRisk[0].amount) }}
-
+ :column="companyFilterColumn"
+ search-url="balance"
+ />
@@ -219,6 +248,7 @@ const showBalancePdf = ({ id }) => {
:right-search="false"
:is-editable="false"
:column-search="false"
+ @on-fetch="onFetch"
:disable-option="{ card: true }"
auto-load
>
diff --git a/src/pages/Customer/Card/CustomerCredits.vue b/src/pages/Customer/Card/CustomerCredits.vue
index 377d95412..1fa7047e5 100644
--- a/src/pages/Customer/Card/CustomerCredits.vue
+++ b/src/pages/Customer/Card/CustomerCredits.vue
@@ -49,7 +49,9 @@ const columns = computed(() => [
name: 'credit',
create: true,
visible: false,
- attrs: {
+ columnCreate: {
+ component: 'number',
+ required: true,
autofocus: true,
},
},
diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue
index 43103bd68..40166aefe 100644
--- a/src/pages/Customer/Card/CustomerDescriptor.vue
+++ b/src/pages/Customer/Card/CustomerDescriptor.vue
@@ -150,7 +150,7 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
-
+
+ {{ t('New ticket') }}
+
+ {{ t('New order') }}
+
-
- {{ t('globals.pageTitles.createTicket') }}
-
-
-
-
-
-
-
- {{ t('globals.pageTitles.createOrder') }}
-
-
-
-
-
{{ t('Send SMS') }}
diff --git a/src/pages/Customer/Card/CustomerFiscalData.vue b/src/pages/Customer/Card/CustomerFiscalData.vue
index 1f5775715..6c5086149 100644
--- a/src/pages/Customer/Card/CustomerFiscalData.vue
+++ b/src/pages/Customer/Card/CustomerFiscalData.vue
@@ -53,11 +53,11 @@ function handleLocation(data, location) {
-
+
-
+
@@ -68,6 +68,7 @@ function handleLocation(data, location) {
option-label="vat"
option-value="id"
v-model="data.sageTaxTypeFk"
+ :required="data.isTaxDataChecked"
/>
@@ -96,6 +98,7 @@ function handleLocation(data, location) {
:roles-allowed-to-create="['deliveryAssistant', 'administrative']"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
:location="data"
+ :required="true"
@update:model-value="(location) => handleLocation(data, location)"
/>
diff --git a/src/pages/Customer/Card/CustomerGreuges.vue b/src/pages/Customer/Card/CustomerGreuges.vue
index 1d8b8585f..dcf297d12 100644
--- a/src/pages/Customer/Card/CustomerGreuges.vue
+++ b/src/pages/Customer/Card/CustomerGreuges.vue
@@ -80,6 +80,11 @@ const columns = computed(() => [
align: 'left',
name: 'amount',
label: t('Amount'),
+ columnCreate: {
+ component: 'number',
+ autofocus: true,
+ required: true,
+ },
format: ({ amount }) => toCurrency(amount),
create: true,
},
diff --git a/src/pages/Customer/Card/CustomerRecoveries.vue b/src/pages/Customer/Card/CustomerRecoveries.vue
index 48576ca20..3a8cffff8 100644
--- a/src/pages/Customer/Card/CustomerRecoveries.vue
+++ b/src/pages/Customer/Card/CustomerRecoveries.vue
@@ -56,6 +56,7 @@ const columns = computed(() => [
label: t('Period'),
create: true,
...componentColumn('number'),
+ required: true,
},
{
align: 'left',
diff --git a/src/pages/Customer/Card/CustomerSummary.vue b/src/pages/Customer/Card/CustomerSummary.vue
index 8b5f0f2c2..8e41119ef 100644
--- a/src/pages/Customer/Card/CustomerSummary.vue
+++ b/src/pages/Customer/Card/CustomerSummary.vue
@@ -1,13 +1,15 @@
@@ -241,7 +239,7 @@ async function getAmountPaid() {
-
- [
},
{
align: 'left',
- format: (row) => row.agencyMode.name,
+ format: (row) => dashIfEmpty(row.agencyMode?.name),
columnClass: 'expand',
label: t('Agency'),
},
@@ -111,7 +111,11 @@ const columns = computed(() => [
{
title: t('customer.summary.goToLines'),
icon: 'vn:lines',
- action: ({ id }) => router.push({ params: { id }, name: 'TicketSale' }),
+ action: ({ id }) =>
+ window.open(
+ router.resolve({ params: { id }, name: 'TicketSale' }).href,
+ '_blank'
+ ),
isPrimary: true,
},
{
@@ -150,6 +154,8 @@ const setShippedColor = (date) => {
if (difference == 0) return 'warning';
if (difference < 0) return 'success';
};
+const rowClick = ({ id }) =>
+ window.open(router.resolve({ params: { id }, name: 'TicketSummary' }).href, '_blank');
const getItemPackagingType = (ticketSales) => {
if (!ticketSales?.length) return '-';
@@ -177,13 +183,15 @@ const getItemPackagingType = (ticketSales) => {
:column-search="false"
url="Tickets"
:columns="columns"
- search-url="tickets"
+ append-params="false"
:without-header="true"
auto-load
+ :row-click="rowClick"
order="shipped DESC, id"
:disable-option="{ card: true, table: true }"
class="full-width"
:disable-infinite-scroll="true"
+ search-url="tickets"
>
diff --git a/src/pages/Customer/composables/getClientRisk.js b/src/pages/Customer/composables/getClientRisk.js
new file mode 100644
index 000000000..ebaf545ee
--- /dev/null
+++ b/src/pages/Customer/composables/getClientRisk.js
@@ -0,0 +1,12 @@
+import axios from 'axios';
+
+export async function getClientRisk(_filter) {
+ const filter = {
+ ..._filter,
+ include: { relation: 'company', scope: { fields: ['code'] } },
+ };
+
+ return await axios(`ClientRisks`, {
+ params: { filter: JSON.stringify(filter) },
+ });
+}
diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js
index 22bca15ac..93e53b9f6 100644
--- a/test/cypress/integration/client/clientList.spec.js
+++ b/test/cypress/integration/client/clientList.spec.js
@@ -28,7 +28,7 @@ describe('Client list', () => {
cy.get('.q-mt-lg > .q-btn--standard').click();
- cy.checkNotification('Data created');
+ cy.checkNotification('created');
cy.url().should('include', '/summary');
});
it('Client list search client', () => {
@@ -43,4 +43,21 @@ describe('Client list', () => {
cy.url().should('include', `/customer/${id}/summary`);
});
});
+
+ it('Client founded create ticket', () => {
+ const search = 'Jessica Jones';
+ cy.searchByLabel('Name', search);
+ cy.clickButtonsDescriptor(2);
+ cy.waitForElement('#formModel');
+ cy.waitForElement('.q-form');
+ cy.checkValueForm(1, search);
+ });
+ it('Client founded create order', () => {
+ const search = 'Jessica Jones';
+ cy.searchByLabel('Name', search);
+ cy.clickButtonsDescriptor(4);
+ cy.waitForElement('#formModel');
+ cy.waitForElement('.q-form');
+ cy.checkValueForm(2, search);
+ });
});
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 76bdefd27..6fea4559a 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -264,6 +264,12 @@ Cypress.Commands.add('openActionsDescriptor', () => {
cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
});
+Cypress.Commands.add('clickButtonsDescriptor', (id) => {
+ cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
+ .invoke('removeAttr', 'target')
+ .click();
+});
+
Cypress.Commands.add('openUserPanel', () => {
cy.get(
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
@@ -274,14 +280,25 @@ Cypress.Commands.add('openActions', (row) => {
cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
});
-Cypress.Commands.add('checkNotification', (text) => {
- cy.get('.q-notification')
- .should('be.visible')
- .last()
- .then(($lastNotification) => {
- if (!Cypress.$($lastNotification).text().includes(text))
- throw new Error(`Notification not found: "${text}"`);
- });
+Cypress.Commands.add('checkNotification', (type) => {
+ const values = {
+ created: 'Data created',
+ updated: 'Data saved',
+ deleted: 'Data deleted',
+ };
+ cy.get('.q-notification__message').should('have.text', values[type]);
+});
+
+Cypress.Commands.add('checkValueForm', (id, search) => {
+ cy.get(
+ `.grid-create > :nth-child(${id}) > .q-field__inner>.q-field__control> .q-field__control-container>.q-field__native >.q-field__input`
+ ).should('have.value', search);
+});
+
+Cypress.Commands.add('checkValueSelectForm', (id, search) => {
+ cy.get(
+ `.grid-create > :nth-child(${id}) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container>.q-field__native>.q-field__input`
+ ).should('have.value', search);
});
Cypress.Commands.add('searchByLabel', (label, value) => {