diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index 11db92eab94..15f80b2f652 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -20,6 +20,7 @@ import VnFilter from 'components/VnTable/VnFilter.vue'; import CustomerNewPayment from 'src/pages/Customer/components/CustomerNewPayment.vue'; import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue'; +import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; const { openConfirmationModal } = useVnConfirm(); const { sendEmail, openReport } = usePrintService(); @@ -89,15 +90,7 @@ const columns = computed(() => [ { align: 'left', label: t('Employee'), - columnField: { - component: 'userLink', - attrs: ({ row }) => { - return { - workerId: row.workerFk, - name: row.userName, - }; - }, - }, + name: 'workerFk', cardVisible: true, }, { @@ -131,7 +124,6 @@ const columns = computed(() => [ align: 'left', name: 'balance', label: t('Balance'), - format: ({ balance }) => toCurrency(balance), cardVisible: true, }, { @@ -146,12 +138,14 @@ const columns = computed(() => [ actions: [ { title: t('globals.downloadPdf'), + isPrimary: true, icon: 'cloud_download', show: (row) => row.isInvoice, action: (row) => showBalancePdf(row), }, { title: t('Send compensation'), + isPrimary: true, icon: 'outgoing_mail', show: (row) => !!row.isCompensation, action: ({ id }) => @@ -256,6 +250,12 @@ const showBalancePdf = ({ id }) => { {{ toCurrency(balances[rowIndex]?.balance) }} + + + {{ row.userName }} + + + {{ t('bill', { ref: row.description }) }} diff --git a/src/pages/Customer/components/CustomerNewPayment.vue b/src/pages/Customer/components/CustomerNewPayment.vue index ac80fdaa4d2..fb3804d5573 100644 --- a/src/pages/Customer/components/CustomerNewPayment.vue +++ b/src/pages/Customer/components/CustomerNewPayment.vue @@ -3,18 +3,20 @@ import { onBeforeMount, reactive, ref } from 'vue'; import { useI18n } from 'vue-i18n'; 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 { getClientRisk } from '../composables/getClientRisk'; import { usePrintService } from 'composables/usePrintService'; import useNotify from 'src/composables/useNotify.js'; + +import FormModelPopup from 'components/FormModelPopup.vue'; import FetchData from 'components/FetchData.vue'; -import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputNumber from 'components/common/VnInputNumber.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnInput from 'src/components/common/VnInput.vue'; +import VnAccountNumber from 'src/components/common/VnAccountNumber.vue'; const { t } = useI18n(); const route = useRoute(); @@ -48,7 +50,7 @@ const maxAmount = ref(); const accountingType = ref({}); const isCash = ref(false); const formModelRef = ref(false); - +const amountToReturn = ref(); const filterBanks = { fields: ['id', 'bank', 'accountingTypeFk'], include: { relation: 'accountingType' }, @@ -90,7 +92,7 @@ function setPaymentType(data, accounting) { let descriptions = []; if (accountingType.value.receiptDescription) descriptions.push(accountingType.value.receiptDescription); - if (data.description) descriptions.push(data.description); + if (data.description > 0) descriptions.push(data.description); data.description = descriptions.join(', '); } @@ -100,7 +102,7 @@ const calculateFromAmount = (event) => { }; const calculateFromDeliveredAmount = (event) => { - initialData.amountToReturn = parseFloat(event) - initialData.amountPaid; + amountToReturn.value = event - initialData.amountPaid; }; function onBeforeSave(data) { @@ -121,17 +123,16 @@ async function onDataSaved(formData, { id }) { recipient: formData.email, }); - if (viewReceipt.value) openReport(`Receipts/${id}/receipt-pdf`); + if (viewReceipt.value) openReport(`Receipts/${id}/receipt-pdf`, {}, '_blank'); } finally { if ($props.promise) $props.promise(); if (closeButton.value) closeButton.value.click(); } } -async function accountShortToStandard({ target: { value } }) { +async function getSupplierClientReferences(value) { if (!value) return (initialData.description = ''); - initialData.compensationAccount = value.replace('.', '0'.repeat(11 - value.length)); - const params = { bankAccount: initialData.compensationAccount }; + const params = { bankAccount: value }; const { data } = await axios(`Clients/getClientOrSupplierReference`, { params }); if (!data.clientId) { initialData.description = t('Supplier Compensation Reference', { @@ -241,17 +242,16 @@ async function getAmountPaid() { @update:model-value="getAmountPaid()" /> - - + {{ t('Compensation') }} - @@ -261,8 +261,7 @@ async function getAmountPaid() { clearable v-model="data.description" /> - - + {{ t('Cash') }}