diff --git a/src/components/FormPopup.vue b/src/components/FormPopup.vue index 951d697d5..b6eff5d80 100644 --- a/src/components/FormPopup.vue +++ b/src/components/FormPopup.vue @@ -2,7 +2,7 @@ import { ref } from 'vue'; import { useI18n } from 'vue-i18n'; -const emit = defineEmits(['onDataSaved']); +const emit = defineEmits(['onSubmit']); const $props = defineProps({ title: { @@ -13,7 +13,7 @@ const $props = defineProps({ type: String, default: '', }, - defaultSaveButton: { + defaultSubmitButton: { type: Boolean, default: true, }, @@ -21,6 +21,10 @@ const $props = defineProps({ type: Boolean, default: true, }, + customSubmitButtonLabel: { + type: String, + default: '', + }, }); const { t } = useI18n(); @@ -28,8 +32,8 @@ const { t } = useI18n(); const closeButton = ref(null); const isLoading = ref(false); -const onDataSaved = (dataSaved) => { - emit('onDataSaved', dataSaved); +const onSubmit = () => { + emit('onSubmit'); closeForm(); }; @@ -40,7 +44,7 @@ const closeForm = () => { @@ -173,18 +166,3 @@ es: Type: Tipo Transferred invoice: Factura transferida - - diff --git a/src/composables/useVnConfirm.js b/src/composables/useVnConfirm.js new file mode 100644 index 000000000..430a290be --- /dev/null +++ b/src/composables/useVnConfirm.js @@ -0,0 +1,23 @@ +import VnConfirm from 'components/ui/VnConfirm.vue'; +import { useQuasar } from 'quasar'; + +export function useSummaryDialog() { + const quasar = useQuasar(); + + const openConfirmationModal = (title, message, promise, successFn) => { + quasar + .dialog({ + component: VnConfirm, + componentProps: { + title: title, + message: message, + promise: promise, + }, + }) + .onOk(async () => { + if (successFn) successFn(); + }); + }; + + return { openConfirmationModal }; +} diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue index 76b9cefdc..fc84c042b 100644 --- a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue +++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue @@ -1,12 +1,17 @@ @@ -68,22 +154,53 @@ const showSendInvoiceForm = (type) => { - + {{ t('Send PDF') }} - + {{ t('Send CSV') }} - + {{ t('Delete invoice') }} - + {{ t('Book invoice') }} - + {{ t('Generate PDF invoice') }} @@ -93,22 +210,22 @@ const showSendInvoiceForm = (type) => { - + {{ t('With warehouse') }} - + {{ t('Without warehouse') }} + + {{ t('Create a single ticket with all the content of the current invoice') }} + - - - @@ -126,4 +243,18 @@ es: Send CSV: Enviar CSV With warehouse: Con almacén Without warehouse: Sin almacén + InvoiceOut deleted: Factura eliminada + Confirm deletion: Confirmar eliminación + Are you sure you want to delete this invoice?: Estas seguro de eliminar esta factura? + Are you sure you want to book this invoice?: Estas seguro de querer asentar esta factura? + InvoiceOut booked: Factura asentada + Generate PDF invoice document: Generar PDF de la factura + Are you sure you want to generate/regenerate the PDF invoice?: ¿Seguro que quieres generar/regenerar el PDF de la factura? + The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado + Create a single ticket with all the content of the current invoice: Crear un ticket único con todo el contenido de la factura actual + refundInvoiceSuccessMessage: Se ha creado el siguiente ticket de abono {refundTicket} + The email can't be empty: El email no puede estar vacío + +en: + refundInvoiceSuccessMessage: The following refund ticket have been created {refundTicket}