#8667: Modified ClientPayment #1622

Merged
jsegarra merged 15 commits from 8667-FixClientNewPayment into dev 2025-03-31 08:17:36 +00:00
2 changed files with 20 additions and 20 deletions
Showing only changes of commit 4460b7110e - Show all commits

View File

@ -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,
},
{
@ -146,12 +139,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 }) =>
@ -253,8 +248,14 @@ const showBalancePdf = ({ id }) => {
:disable-option="{ card: true }"
auto-load
>
<template #column-balance="{ rowIndex }">
{{ toCurrency(balances[rowIndex]?.balance) }}
<template #column-balance="{ row }">
{{ toCurrency(balances[row]?.balance) }}

esto no puede ir en format?
Veo que tiene dependencia con balances pero yo creo que al hacerlo en el onfetch todavía no renderiza

esto no puede ir en format? Veo que tiene dependencia con balances pero yo creo que al hacerlo en el onfetch todavía no renderiza
</template>
<template #column-workerFk="{ row }">
<span class="link">
jon marked this conversation as resolved
Review

@click.stop

@click.stop
{{ row.userName }}
<WorkerDescriptorProxy :id="row.workerFk" />
</span>
</template>
<template #column-description="{ row }">
<span class="link" v-if="row.isInvoice" @click.stop>

View File

@ -48,6 +48,7 @@ const maxAmount = ref();
const accountingType = ref({});
const isCash = ref(false);
const formModelRef = ref(false);
jon marked this conversation as resolved
Review

Sobra el import de FormModel

Sobra el import de FormModel
const amountToReturn = ref();
const filterBanks = {
fields: ['id', 'bank', 'accountingTypeFk'],
@ -90,7 +91,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 +101,7 @@ const calculateFromAmount = (event) => {
};
const calculateFromDeliveredAmount = (event) => {
initialData.amountToReturn = parseFloat(event) - initialData.amountPaid;
amountToReturn.value = event - initialData.amountPaid;
};
function onBeforeSave(data) {
@ -121,7 +122,7 @@ 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');
jon marked this conversation as resolved Outdated
Prefiero usar useOpenURL https://redmine.verdnatura.es/issues/8810
} finally {
if ($props.promise) $props.promise();
if (closeButton.value) closeButton.value.click();
@ -241,13 +242,12 @@ async function getAmountPaid() {
@update:model-value="getAmountPaid()"
/>
</VnRow>
<div v-if="data.bankFk?.accountingType?.code == 'compensation'">
<div v-if="accountingType.code == 'compensation'">
<div class="text-h6">
{{ t('Compensation') }}
</div>
<VnRow>
<VnInputNumber
<VnInput

VnAccountNumber?

VnAccountNumber?
:label="t('Compensation account')"
clearable
v-model="data.compensationAccount"
@ -261,8 +261,7 @@ async function getAmountPaid() {
clearable
v-model="data.description"
/>
<div v-if="data.bankFk?.accountingType?.code == 'cash'">
<div v-if="accountingType.code == 'cash'">
<div class="text-h6">{{ t('Cash') }}</div>
<VnRow>
<VnInputNumber
@ -274,7 +273,7 @@ async function getAmountPaid() {
<VnInputNumber
:label="t('Amount to return')"
disable
v-model="data.amountToReturn"
v-model="amountToReturn"
/>
</VnRow>
<VnRow>