feat: transfer an invoice
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javi Gallego 2024-09-03 15:25:36 +02:00
parent ea8fde49ff
commit 5b53e9dc37
2 changed files with 17 additions and 8 deletions

View File

@ -26,7 +26,6 @@ const { notify } = useNotify();
const checked = ref(true); const checked = ref(true);
const transferInvoiceParams = reactive({ const transferInvoiceParams = reactive({
id: $props.invoiceOutData?.id, id: $props.invoiceOutData?.id,
refFk: $props.invoiceOutData?.ref,
}); });
const rectificativeTypeOptions = ref([]); const rectificativeTypeOptions = ref([]);
@ -46,7 +45,6 @@ const makeInvoice = async () => {
cplusRectificationTypeFk: transferInvoiceParams.cplusRectificationTypeFk, cplusRectificationTypeFk: transferInvoiceParams.cplusRectificationTypeFk,
invoiceCorrectionTypeFk: transferInvoiceParams.invoiceCorrectionTypeFk, invoiceCorrectionTypeFk: transferInvoiceParams.invoiceCorrectionTypeFk,
newClientFk: transferInvoiceParams.newClientFk, newClientFk: transferInvoiceParams.newClientFk,
refFk: transferInvoiceParams.refFk,
siiTypeInvoiceOutFk: transferInvoiceParams.siiTypeInvoiceOutFk, siiTypeInvoiceOutFk: transferInvoiceParams.siiTypeInvoiceOutFk,
makeInvoice: checked.value, makeInvoice: checked.value,
}; };
@ -74,7 +72,7 @@ const makeInvoice = async () => {
} }
} }
const { data } = await axios.post('InvoiceOuts/transferInvoice', params); const { data } = await axios.post('InvoiceOuts/transfer', params);
notify(t('Transferred invoice'), 'positive'); notify(t('Transferred invoice'), 'positive');
const id = data?.[0]; const id = data?.[0];
if (id) router.push({ name: 'InvoiceOutSummary', params: { id } }); if (id) router.push({ name: 'InvoiceOutSummary', params: { id } });

View File

@ -228,11 +228,19 @@ const showTransferInvoiceForm = async () => {
</QItemSection> </QItemSection>
<QMenu anchor="top end" self="top start"> <QMenu anchor="top end" self="top start">
<QList> <QList>
<QItem v-ripple clickable @click="refundInvoice(true)"> <QItem v-ripple clickable @click="refundInvoice(true, false)">
<QItemSection>{{ t('With warehouse') }}</QItemSection> <QItemSection>{{ t('With warehouse, no invoice') }}</QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable @click="refundInvoice(false)"> <QItem v-ripple clickable @click="refundInvoice(false, false)">
<QItemSection>{{ t('Without warehouse') }}</QItemSection> <QItemSection>{{ t('Without warehouse, no invoice') }}</QItemSection>
</QItem>
<QItem v-ripple clickable @click="refundInvoice(true, true)">
<QItemSection>{{ t('With warehouse, with invoice') }}</QItemSection>
</QItem>
<QItem v-ripple clickable @click="refundInvoice(false, true)">
<QItemSection>{{
t('Without warehouse, with invoice')
}}</QItemSection>
</QItem> </QItem>
</QList> </QList>
</QMenu> </QMenu>
@ -255,7 +263,10 @@ es:
As CSV: como CSV As CSV: como CSV
Send PDF: Enviar PDF Send PDF: Enviar PDF
Send CSV: Enviar CSV Send CSV: Enviar CSV
With warehouse: Con almacén With warehouse, no invoice: Con almacén, sin factura
Without warehouse, no invoice: Sin almacén, sin factura
With warehouse, with invoice: Con almacén, con factura
Without warehouse, with invoice: Sin almacén, con factura
Without warehouse: Sin almacén Without warehouse: Sin almacén
InvoiceOut deleted: Factura eliminada InvoiceOut deleted: Factura eliminada
Confirm deletion: Confirmar eliminación Confirm deletion: Confirmar eliminación