diff --git a/src/pages/Customer/Card/CustomerMandates.vue b/src/pages/Customer/Card/CustomerMandates.vue index 81a643142..2511f5730 100644 --- a/src/pages/Customer/Card/CustomerMandates.vue +++ b/src/pages/Customer/Card/CustomerMandates.vue @@ -17,7 +17,6 @@ const filter = { { relation: 'company', scope: { fields: ['id', 'code'] } }, ], order: ['created DESC'], - limit: 20, }; const columns = computed(() => [ @@ -31,7 +30,7 @@ const columns = computed(() => [ { align: 'left', cardVisible: true, - format: ({ company }) => company.code, + format: ({ company }) => company?.code, label: t('globals.company'), name: 'company', }, diff --git a/src/pages/Customer/components/CustomerNewPayment.vue b/src/pages/Customer/components/CustomerNewPayment.vue index 6ecccc544..ac80fdaa4 100644 --- a/src/pages/Customer/components/CustomerNewPayment.vue +++ b/src/pages/Customer/components/CustomerNewPayment.vue @@ -5,7 +5,7 @@ import { useRoute } from 'vue-router'; import axios from 'axios'; import { getClientRisk } from '../composables/getClientRisk'; import { useDialogPluginComponent } from 'quasar'; - +import FormModelPopup from 'components/FormModelPopup.vue'; import { usePrintService } from 'composables/usePrintService'; import useNotify from 'src/composables/useNotify.js'; import FetchData from 'components/FetchData.vue'; @@ -74,26 +74,24 @@ onBeforeMount(() => { urlCreate.value = `Clients/${route.params.id}/createReceipt`; }); -function setPaymentType(accounting) { +function setPaymentType(data, accounting) { + data.bankFk = accounting.id; if (!accounting) return; accountingType.value = accounting.accountingType; - initialData.description = []; - initialData.payed = Date.vnNew(); + data.description = []; + data.payed = Date.vnNew(); isCash.value = accountingType.value.code == 'cash'; viewReceipt.value = isCash.value; if (accountingType.value.daysInFuture) - initialData.payed.setDate( - initialData.payed.getDate() + 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 (initialData.description = ''); + if (accountingType.value.code == 'compensation') return (data.description = ''); let descriptions = []; if (accountingType.value.receiptDescription) descriptions.push(accountingType.value.receiptDescription); - if (initialData.description) descriptions.push(initialData.description); - initialData.description = descriptions.join(', '); + if (data.description) descriptions.push(data.description); + data.description = descriptions.join(', '); } const calculateFromAmount = (event) => { @@ -113,7 +111,6 @@ function onBeforeSave(data) { if (isCash.value && shouldSendEmail.value && !data.email) return notify(t('There is no assigned email for this client'), 'negative'); - data.bankFk = data.bankFk?.id; return data; } @@ -181,42 +178,19 @@ async function getAmountPaid() { auto-load url="Clients/findOne" /> - -