diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 689be76ee..d6008de0b 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -507,11 +507,8 @@ function handleOnDataSaved(_) { :key="index" :title="btn.title" :icon="btn.icon" - class="q-px-sm" + class="q-px-sm text-primary-light" flat - :class=" - btn.isPrimary ? 'text-primary-light' : 'color-vn-text ' - " :style="`visibility: ${ (btn.show && btn.show(row)) ?? true ? 'visible' : 'hidden' }`" diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index eb9828bc7..79a79c383 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -231,20 +231,20 @@ defineExpose({ fetch, addFilter, paginate }); diff --git a/src/composables/usePrintService.js b/src/composables/usePrintService.js index ff43c65a1..68a009d7b 100644 --- a/src/composables/usePrintService.js +++ b/src/composables/usePrintService.js @@ -16,7 +16,7 @@ export function usePrintService() { ); } - function openReport(path, params) { + function openReport(path, params, isNewTab = '_self') { if (typeof params === 'string') params = JSON.parse(params); params = Object.assign( { @@ -26,8 +26,7 @@ export function usePrintService() { ); const query = new URLSearchParams(params).toString(); - - window.open(`api/${path}?${query}`); + window.open(`api/${path}?${query}`, isNewTab); } return { diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index d29b864b9..213d302cb 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -133,6 +133,7 @@ globals: fiscalData: Fiscal data billingData: Billing data consignees: Consignees + 'address-create': New address notes: Notes credits: Credits greuges: Greuges diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 3d905509d..72d4fb1b1 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -136,6 +136,7 @@ globals: fiscalData: Datos fiscales billingData: Forma de pago consignees: Consignatarios + 'address-create': Nuevo consignatario notes: Notas credits: Créditos greuges: Greuges diff --git a/src/pages/Customer/Card/CustomerAddress.vue b/src/pages/Customer/Card/CustomerAddress.vue index a9e7affef..d76707079 100644 --- a/src/pages/Customer/Card/CustomerAddress.vue +++ b/src/pages/Customer/Card/CustomerAddress.vue @@ -179,6 +179,13 @@ const toCustomerAddressEdit = (addressId) => { {{ item.postalCode }} - {{ item.city }}, {{ setProvince(item.provinceFk) }} +
+ {{ item.phone }} + , + {{ item.mobile }} + +
[ { - align: 'left', + align: 'right', name: 'payed', label: t('Date'), format: ({ payed }) => toDate(payed), cardVisible: true, }, { - align: 'left', + align: 'right', name: 'created', label: t('Creation date'), format: ({ created }) => toDateHourMin(created), @@ -91,11 +89,10 @@ const columns = computed(() => [ }, { align: 'left', - name: 'workerFk', label: t('Employee'), columnField: { component: 'userLink', - attrs: ({ row }) => ({ workerId: row.workerFk, tag: row.userName }), + attrs: ({ row }) => ({ workerId: row.workerFk, name: row.userName }), }, cardVisible: true, }, @@ -120,14 +117,14 @@ const columns = computed(() => [ isId: true, }, { - align: 'right', + align: 'left', name: 'credit', label: t('Havings'), format: ({ credit }) => credit && toCurrency(credit), cardVisible: true, }, { - align: 'right', + align: 'left', name: 'balance', label: t('Balance'), format: ({ balance }) => toCurrency(balance), @@ -166,41 +163,15 @@ const columns = computed(() => [ onBeforeMount(() => { stateStore.rightDrawer = true; - companyId.value = user.value.companyFk; }); -async function getClientRisk() { - const { data } = await axios.get(`clientRisks`, { - params: { - filter: JSON.stringify({ - include: { relation: 'company', scope: { fields: ['code'] } }, - where: { clientFk: route.params.id, companyFk: user.value.companyFk }, - }), - }, - }); - clientRisk.value = data; - return clientRisk.value; -} - -async function getCurrentBalance() { - const currentBalance = (await getClientRisk()).find((balance) => { - return balance.companyFk === companyId.value; - }); - return currentBalance && currentBalance.amount; -} - -async function onFetch(data) { - balances.value = []; - for (const [index, balance] of data.entries()) { - if (index === 0) { - balance.balance = await getCurrentBalance(); - continue; - } - const previousBalance = data[index - 1]; - balance.balance = - previousBalance?.balance - (previousBalance?.debit - previousBalance?.credit); +async function getCurrentBalance(data) { + for (const balance of data) { + currentBalance.value[balance.companyFk] = { + code: balance.company.code, + amount: balance.amount, + }; } - balances.value = data; } const showNewPaymentDialog = () => { @@ -215,19 +186,27 @@ const showNewPaymentDialog = () => { }; const showBalancePdf = ({ id }) => { - const url = `api/InvoiceOuts/${id}/download?access_token=${tokenMultimedia}`; - window.open(url, '_blank'); + openReport(`InvoiceOuts/${id}/download`, {}, '_blank'); };