diff --git a/src/composables/usePrintService.js b/src/composables/usePrintService.js index 68a009d7b..c6c212ad8 100644 --- a/src/composables/usePrintService.js +++ b/src/composables/usePrintService.js @@ -1,15 +1,18 @@ import { useSession } from './useSession'; import axios from 'axios'; import { useQuasar } from 'quasar'; +import { useI18n } from 'vue-i18n'; export function usePrintService() { const quasar = useQuasar(); + const { t } = useI18n(); + const { getTokenMultimedia } = useSession(); function sendEmail(path, params) { return axios.post(path, params).then(() => quasar.notify({ - message: 'Notification sent', + message: t('globals.notificationSent'), type: 'positive', icon: 'check', }) diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index 2a1991bbd..f148194f8 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -16,7 +16,7 @@ import { useVnConfirm } from 'composables/useVnConfirm'; import VnTable from 'components/VnTable/VnTable.vue'; import VnInput from 'components/common/VnInput.vue'; import VnSubToolbar from 'components/ui/VnSubToolbar.vue'; -import VnFilter from 'components/VnTable/VnFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment.vue'; import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue'; @@ -33,9 +33,9 @@ const stateStore = useStateStore(); const user = state.getUser(); const clientRisk = ref([]); +const companies = ref([]); const tableRef = ref(); const companyId = ref(user.value.companyFk); -const companyLastId = ref(user.value.companyFk); const balances = ref([]); const vnFilterRef = ref({}); const filter = computed(() => { @@ -45,33 +45,6 @@ const filter = computed(() => { }; }); -const companyFilterColumn = { - align: 'left', - name: 'companyId', - label: t('Company'), - component: 'select', - attrs: { - url: 'Companies', - optionLabel: 'code', - sortBy: 'code', - limit: 0, - }, - columnFilter: { - event: { - remove: () => (companyId.value = null), - 'update:modelValue': (newCompanyFk) => { - if (!newCompanyFk) return; - vnFilterRef.value.addFilter(newCompanyFk); - companyLastId.value = newCompanyFk; - }, - blur: () => - !companyId.value && - (companyId.value = companyLastId.value ?? user.value.companyFk), - }, - }, - visible: false, -}; - const columns = computed(() => [ { align: 'right', @@ -166,6 +139,11 @@ onBeforeMount(() => { }); async function getCurrentBalance(data) { + currentBalance.value[companyId.value] = { + amount: 0, + code: companies.value.find((c) => c.id === companyId.value)?.code, + }; + for (const balance of data) { currentBalance.value[balance.companyFk] = { code: balance.company.code, @@ -192,14 +170,21 @@ const showBalancePdf = ({ id }) => {