diff --git a/src/components/RefundInvoiceForm.vue b/src/components/RefundInvoiceForm.vue new file mode 100644 index 000000000..1b545103a --- /dev/null +++ b/src/components/RefundInvoiceForm.vue @@ -0,0 +1,173 @@ + + + + ( + (rectificativeTypeOptions = data), + (invoiceParams.cplusRectificationTypeFk = data.filter( + (type) => type.description == 'I – Por diferencias' + )[0].id) + ) + " + auto-load + /> + ( + (siiTypeInvoiceOutsOptions = data), + (invoiceParams.siiTypeInvoiceOutFk = data.filter( + (type) => type.code == 'R4' + )[0].id) + ) + " + auto-load + /> + (invoiceCorrectionTypesOptions = data)" + auto-load + /> + + + + + + + + + + + + + + {{ scope.opt?.code }} - + {{ scope.opt?.description }} + + + + + + + + + + + + + {{ t('Inherit warehouse tooltip') }} + + + + + + + + + +en: + Refund invoice: Refund invoice + Rectificative type: Rectificative type + Class: Class + Type: Type + Refunded invoice: Refunded invoice + Inherit warehouse: Inherit the warehouse + Inherit warehouse tooltip: Select this option to inherit the warehouse when refunding the invoice + Accept: Accept + Error refunding invoice: Error refunding invoice +es: + Refund invoice: Abonar factura + Rectificative type: Tipo rectificativa + Class: Clase + Type: Tipo + Refunded invoice: Factura abonada + Inherit warehouse: Heredar el almacén + Inherit warehouse tooltip: Seleccione esta opción para heredar el almacén al abonar la factura. + Accept: Aceptar + Error refunding invoice: Error abonando factura + diff --git a/src/components/TransferInvoiceForm.vue b/src/components/TransferInvoiceForm.vue index 23c988ee7..f7050cdba 100644 --- a/src/components/TransferInvoiceForm.vue +++ b/src/components/TransferInvoiceForm.vue @@ -2,13 +2,12 @@ import { ref, reactive } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; -import { useQuasar } from 'quasar'; +import { useQuasar, useDialogPluginComponent } from 'quasar'; import VnConfirm from 'components/ui/VnConfirm.vue'; import VnRow from 'components/ui/VnRow.vue'; import FetchData from 'components/FetchData.vue'; import VnSelect from 'components/common/VnSelect.vue'; import FormPopup from './FormPopup.vue'; -import { useDialogPluginComponent } from 'quasar'; import axios from 'axios'; import useNotify from 'src/composables/useNotify.js'; @@ -18,18 +17,19 @@ const $props = defineProps({ default: () => {}, }, }); + const { dialogRef } = useDialogPluginComponent(); const quasar = useQuasar(); const { t } = useI18n(); const router = useRouter(); const { notify } = useNotify(); + +const rectificativeTypeOptions = ref([]); +const siiTypeInvoiceOutsOptions = ref([]); const checked = ref(true); const transferInvoiceParams = reactive({ id: $props.invoiceOutData?.id, }); - -const rectificativeTypeOptions = ref([]); -const siiTypeInvoiceOutsOptions = ref([]); const invoiceCorrectionTypesOptions = ref([]); const selectedClient = (client) => { @@ -43,9 +43,9 @@ const makeInvoice = async () => { const params = { id: transferInvoiceParams.id, cplusRectificationTypeFk: transferInvoiceParams.cplusRectificationTypeFk, + siiTypeInvoiceOutFk: transferInvoiceParams.siiTypeInvoiceOutFk, invoiceCorrectionTypeFk: transferInvoiceParams.invoiceCorrectionTypeFk, newClientFk: transferInvoiceParams.newClientFk, - siiTypeInvoiceOutFk: transferInvoiceParams.siiTypeInvoiceOutFk, makeInvoice: checked.value, }; diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue index 0ded54688..6a3bb5a78 100644 --- a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue +++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue @@ -5,6 +5,7 @@ import { useRouter } from 'vue-router'; import { useQuasar } from 'quasar'; import TransferInvoiceForm from 'src/components/TransferInvoiceForm.vue'; +import RefundInvoiceForm from 'src/components/RefundInvoiceForm.vue'; import SendEmailDialog from 'components/common/SendEmailDialog.vue'; import useNotify from 'src/composables/useNotify'; @@ -37,7 +38,6 @@ const { openConfirmationModal } = useVnConfirm(); const quasar = useQuasar(); const salixUrl = ref(); const invoiceFormType = ref('pdf'); -const defaultEmailAddress = ref($props.invoiceOutData.client?.email); const showInvoicePdf = () => { const url = `api/InvoiceOuts/${$props.invoiceOutData.id}/download?access_token=${token}`; @@ -54,12 +54,6 @@ const showSendInvoiceDialog = (type) => { invoiceFormType.value = type; quasar.dialog({ component: SendEmailDialog, - componentProps: { - data: { - address: defaultEmailAddress.value, - }, - promise: sendEmailInvoice, - }, }); }; @@ -141,6 +135,15 @@ const showTransferInvoiceForm = async () => { }, }); }; + +const showRefundInvoiceForm = () => { + quasar.dialog({ + component: RefundInvoiceForm, + componentProps: { + invoiceOutData: $props.invoiceOutData, + }, + }); +}; @@ -228,19 +231,14 @@ const showTransferInvoiceForm = async () => { - + {{ t('With warehouse, no invoice') }} - + {{ t('Without warehouse, no invoice') }} - - {{ t('With warehouse, with invoice') }} - - - {{ - t('Without warehouse, with invoice') - }} + + {{ t('Invoiced') }} @@ -265,8 +263,7 @@ es: Send CSV: Enviar CSV 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 + Invoiced: Facturado Without warehouse: Sin almacén InvoiceOut deleted: Factura eliminada Confirm deletion: Confirmar eliminación