From 22cf914dc6509879b634002a94c6a757fac2a813 Mon Sep 17 00:00:00 2001
From: carlosfonseca <carlos.fonseca@mindshore.io>
Date: Wed, 29 Nov 2023 11:48:06 -0500
Subject: [PATCH] Correcciones post PR

---
 src/components/ui/CardDescriptor.vue          | 30 +++++++------------
 .../InvoiceOut/Card/InvoiceOutDescriptor.vue  |  4 +++
 .../Card/InvoiceOutDescriptorMenu.vue         | 23 ++++++++++++++
 3 files changed, 38 insertions(+), 19 deletions(-)
 create mode 100644 src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue

diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue
index 0b15f2998..9116425df 100644
--- a/src/components/ui/CardDescriptor.vue
+++ b/src/components/ui/CardDescriptor.vue
@@ -57,20 +57,6 @@ async function getData() {
     emit('onFetch', data);
 }
 
-// watch($props, async () => {
-//     entity.value = null;
-//     await fetch();
-// });
-
-const options = [
-    'Transferir factura a ...',
-    'Ver factura ...',
-    'Enviar factura ...',
-    'Eliminar factura',
-    'Asentar factura',
-    'Regenerar PDF factura',
-    'Abono ...',
-];
 const emit = defineEmits(['onFetch']);
 </script>
 
@@ -110,15 +96,21 @@ const emit = defineEmits(['onFetch']);
                     </QBtn>
                 </RouterLink>
 
-                <QBtn color="white" dense flat icon="more_vert" round size="md">
+                <QBtn
+                    color="white"
+                    dense
+                    flat
+                    icon="more_vert"
+                    round
+                    size="md"
+                    v-if="slots.menu"
+                >
                     <QTooltip>
                         {{ t('components.cardDescriptor.moreOptions') }}
                     </QTooltip>
                     <QMenu>
-                        <QList dense v-for="option in options" :key="option">
-                            <QItem v-ripple clickable>
-                                {{ option }}
-                            </QItem>
+                        <QList>
+                            <slot name="menu" :entity="entity" />
                         </QList>
                     </QMenu>
                 </QBtn>
diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue
index 4271f7f38..d3e38a1fe 100644
--- a/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue
+++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue
@@ -7,6 +7,7 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
 import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
 import VnLv from 'src/components/ui/VnLv.vue';
 import useCardDescription from 'src/composables/useCardDescription';
+import InvoiceOutDescriptorMenu from './InvoiceOutDescriptorMenu.vue';
 
 const $props = defineProps({
     id: {
@@ -59,6 +60,9 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity.
         @on-fetch="setData"
         data-key="invoiceOutData"
     >
+        <template #menu="{ entity }">
+            <InvoiceOutDescriptorMenu :invoiceOut="entity" />
+        </template>
         <template #body="{ entity }">
             <VnLv :label="t('invoiceOut.card.issued')" :value="toDate(entity.issued)" />
             <VnLv
diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue
new file mode 100644
index 000000000..53cac7ccd
--- /dev/null
+++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptorMenu.vue
@@ -0,0 +1,23 @@
+<template>
+    <QItem v-ripple clickable>
+        <QItemSection>Transferir factura a ...</QItemSection>
+    </QItem>
+    <QItem v-ripple clickable>
+        <QItemSection>Ver factura ...</QItemSection>
+    </QItem>
+    <QItem v-ripple clickable>
+        <QItemSection>Enviar factura ...</QItemSection>
+    </QItem>
+    <QItem v-ripple clickable>
+        <QItemSection>Eliminar factura</QItemSection>
+    </QItem>
+    <QItem v-ripple clickable>
+        <QItemSection>Asentar factura</QItemSection>
+    </QItem>
+    <QItem v-ripple clickable>
+        <QItemSection>Regenerar PDF factura</QItemSection>
+    </QItem>
+    <QItem v-ripple clickable>
+        <QItemSection>Abono ...</QItemSection>
+    </QItem>
+</template>