diff --git a/src/components/POS/GoogleForm.vue b/src/components/POS/GoogleForm.vue new file mode 100644 index 0000000..92f846e --- /dev/null +++ b/src/components/POS/GoogleForm.vue @@ -0,0 +1,125 @@ + + + diff --git a/src/pages/POS/Factura/Index.vue b/src/pages/POS/Factura/Index.vue index 4c8fa14..f3a318d 100644 --- a/src/pages/POS/Factura/Index.vue +++ b/src/pages/POS/Factura/Index.vue @@ -11,6 +11,7 @@ import Input from '@Holos/Form/Input.vue'; import PrimaryButton from '@Holos/Button/Primary.vue'; import SelectUsoCfdi from '@Components/POS/CfdiSelector.vue'; import SelectRegimenFiscal from '@Components/POS/RegimenSelector.vue'; +import GoogleForm from '@Components/POS/GoogleForm.vue'; /** Definidores */ const route = useRoute(); @@ -27,6 +28,7 @@ const formErrors = ref({}); const searchingRfc = ref(false); const rfcSearch = ref(''); const rfcSearchError = ref(''); +const showGoogleForm = ref(true); const form = ref({ name: '', @@ -73,6 +75,8 @@ const canRequestInvoice = computed(() => { /** Helpers */ const getRegimenFiscalLabel = (value) => regimenFiscalOptions.find(o => o.value === value)?.label ?? value; const getUsoCfdiLabel = (value) => usoCfdiOptions.find(o => o.value === value)?.label ?? value; +const statusLabels = { pending: 'Pendiente', processed: 'Completada', rejected: 'Rechazada' }; +const getStatusLabel = (status) => statusLabels[status] ?? status; /** Métodos */ const fetchSaleData = () => { loading.value = true; @@ -186,6 +190,7 @@ const submitForm = () => { window.axios.post(apiURL(`facturacion/${invoiceNumber.value}`), form.value) .then(() => { submitted.value = true; + showGoogleForm.value = true; }) .catch(({ response }) => { if (response?.status === 422 && response.data?.errors) { @@ -247,7 +252,7 @@ onMounted(() => {
Estado: - {{ existingInvoiceRequest.status }} + {{ getStatusLabel(existingInvoiceRequest.status) }}

@@ -371,7 +376,7 @@ onMounted(() => { Solicitud #{{ request.id }} - {{ request.status }} + {{ getStatusLabel(request.status) }}

@@ -658,8 +663,17 @@ onMounted(() => {
-

¿Tiene dudas? Contáctenos

+

¿Tiene dudas? Visitanos para poder ayudarte.

+ \ No newline at end of file diff --git a/src/pages/POS/Point.vue b/src/pages/POS/Point.vue index b4e0ec0..86804ca 100644 --- a/src/pages/POS/Point.vue +++ b/src/pages/POS/Point.vue @@ -8,6 +8,7 @@ import { useBarcodeScanner } from '@/composables/useBarcodeScanner'; import useCart from '@Stores/cart'; import salesService from '@Services/salesService'; import ticketService from '@Services/ticketService'; +import quoteService from '@Services/quoteService'; import serialService from '@Services/serialService'; import GoogleIcon from '@Shared/GoogleIcon.vue'; @@ -291,6 +292,25 @@ const handleBundleSerialConfirm = (serialConfig) => { closeBundleSerialSelector(); }; +const generateQuote = async () => { + if (cart.isEmpty) { + window.Notify.error('El carrito está vacío'); + return; + } + try { + window.Notify.info('Generando cotización...'); + await quoteService.generate( + cart.items, + { subtotal: cart.subtotal, tax: cart.tax, total: cart.total }, + { autoDownload: true } + ); + window.Notify.success('Cotización generada correctamente'); + } catch (e) { + console.error('Error generando cotización:', e); + window.Notify.error('Error al generar la cotización'); + } +}; + const handleClearCart = () => { if (confirm(t('cart.clearConfirm'))) { cart.clear(); @@ -913,6 +933,16 @@ watch(activeTab, (newTab) => { {{ $t('cart.checkout') }} + +