diff --git a/src/components/Holos/Skeleton/Sidebar/DropdownMenu.vue b/src/components/Holos/Skeleton/Sidebar/DropdownMenu.vue new file mode 100644 index 0000000..56896ad --- /dev/null +++ b/src/components/Holos/Skeleton/Sidebar/DropdownMenu.vue @@ -0,0 +1,70 @@ + + + diff --git a/src/components/Holos/Skeleton/Sidebar/SubLink.vue b/src/components/Holos/Skeleton/Sidebar/SubLink.vue new file mode 100644 index 0000000..266d2b3 --- /dev/null +++ b/src/components/Holos/Skeleton/Sidebar/SubLink.vue @@ -0,0 +1,62 @@ + + + diff --git a/src/components/POS/CartItem.vue b/src/components/POS/CartItem.vue index 115ad0a..ad49c4f 100644 --- a/src/components/POS/CartItem.vue +++ b/src/components/POS/CartItem.vue @@ -32,7 +32,22 @@ const formattedSubtotal = computed(() => { const canIncrement = computed(() => { // Si tiene seriales, no permitir incremento directo if (props.item.track_serials) return false; - return props.item.quantity < props.item.max_stock; + // Si permite decimales, incrementar en 1 + const incrementValue = props.item.allows_decimals ? 1 : 1; + return (props.item.quantity + incrementValue) <= props.item.max_stock; +}); + +const canEditQuantity = computed(() => { + // No permitir edición directa si tiene seriales + return !props.item.track_serials; +}); + +const quantityStep = computed(() => { + return props.item.allows_decimals ? '0.001' : '1'; +}); + +const quantityMin = computed(() => { + return props.item.allows_decimals ? '0.001' : '1'; }); const hasSerials = computed(() => props.item.track_serials); @@ -47,18 +62,33 @@ const needsSerialSelection = computed(() => { /** Métodos */ const increment = () => { if (canIncrement.value) { - emit('update-quantity', props.item.inventory_id, props.item.quantity + 1); + const incrementValue = props.item.allows_decimals ? 1 : 1; + const newQuantity = props.item.quantity + incrementValue; + emit('update-quantity', props.item.inventory_id, newQuantity); } }; const decrement = () => { - if (props.item.quantity > 1) { - emit('update-quantity', props.item.inventory_id, props.item.quantity - 1); + const decrementValue = props.item.allows_decimals ? 1 : 1; + const minValue = props.item.allows_decimals ? 0.001 : 1; + + if (props.item.quantity > minValue) { + const newQuantity = Math.max(minValue, props.item.quantity - decrementValue); + emit('update-quantity', props.item.inventory_id, newQuantity); } else { emit('remove', props.item.inventory_id); } }; +const handleQuantityInput = (event) => { + const value = event.target.value; + const numValue = parseFloat(value); + + if (!isNaN(numValue) && numValue > 0) { + emit('update-quantity', props.item.inventory_id, numValue); + } +}; + const remove = () => { emit('remove', props.item.inventory_id); }; @@ -81,7 +111,7 @@ const remove = () => { -
+
{{ item.sku }} @@ -91,6 +121,13 @@ const remove = () => {
+ +
+

+ {{ item.unit_of_measure.name }} ({{ item.unit_of_measure.abbreviation }}) - Permite decimales +

+
+
@@ -100,13 +137,23 @@ const remove = () => { class="w-7 h-7 flex items-center justify-center rounded-full bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-600 dark:text-gray-300 transition-colors" @click="decrement" > - - + + {{ item.quantity }} diff --git a/src/components/POS/ClientModal.vue b/src/components/POS/ClientModal.vue index 59d761c..b09d202 100644 --- a/src/components/POS/ClientModal.vue +++ b/src/components/POS/ClientModal.vue @@ -16,6 +16,32 @@ const props = defineProps({ } }); +const usoCfdiOptions = [ + { value: 'G01', label: 'G01 - Adquisición de mercancías' }, + { value: 'G02', label: 'G02 - Devoluciones, descuentos o bonificaciones' }, + { value: 'G03', label: 'G03 - Gastos en general' }, + { value: 'I01', label: 'I01 - Construcciones' }, + { value: 'I02', label: 'I02 - Mobiliario y equipo de oficina por inversiones' }, + { value: 'I03', label: 'I03 - Equipo de transporte' }, + { value: 'I04', label: 'I04 - Equipo de computo y accesorios' }, + { value: 'I05', label: 'I05 - Dados, troqueles, moldes, matrices y herramental' }, + { value: 'I06', label: 'I06 - Comunicaciones telefónicas' }, + { value: 'I07', label: 'I07 - Comunicaciones satelitales' }, + { value: 'I08', label: 'I08 - Otra maquinaria y equipo' }, + { value: 'S01', label: 'S01 - Sin efectos fiscales' } +]; + +const regimenFiscalOptions = [ + { value: '601', label: '601 - General de Ley Personas Morales' }, + { value: '603', label: '603 - Personas Morales con Fines no Lucrativos' }, + { value: '610', label: '610 - Residentes en el Extranjero sin Establecimiento Permanentes en México' }, + { value: '620', label: '620 - Sociedades Cooperativas de Producción que optan por diferir sus ingresos' }, + { value: '622', label: '622 - Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras' }, + { value: '623', label: '623 - Opcional para Grupos de Sociedades' }, + { value: '624', label: '624 - Coordinados' }, + { value: '626', label: '626 - Régimen Simplificado de Confianza' } +]; + /** Emits */ const emit = defineEmits(['close', 'save']); @@ -25,9 +51,12 @@ const form = ref({ email: '', phone: '', address: '', - rfc: '' + rfc: '', + razon_social: '', + regimen_fiscal: '', + cp_fiscal: '', + uso_cfdi: '' }); - const saving = ref(false); /** Watchers */ @@ -39,7 +68,11 @@ watch(() => props.show, (isShown) => { email: '', phone: '', address: '', - rfc: '' + rfc: '', + razon_social: '', + regimen_fiscal: '', + cp_fiscal: '', + uso_cfdi: '' }; } }); @@ -80,7 +113,11 @@ const handleClose = () => { email: '', phone: '', address: '', - rfc: '' + rfc: '', + razon_social: '', + regimen_fiscal: '', + cp_fiscal: '', + uso_cfdi: '' }; emit('close'); } @@ -202,6 +239,68 @@ const handleClose = () => {
+ +
+ +
+ + +
+
+ + +
+ + +
+ + +
+ + +
+