diff --git a/Inventarios/RepEntradasSalidas.aspx b/Inventarios/RepEntradasSalidas.aspx
index fa4219179..2624a9801 100644
--- a/Inventarios/RepEntradasSalidas.aspx
+++ b/Inventarios/RepEntradasSalidas.aspx
@@ -185,14 +185,12 @@
-
-
-
+
-
+
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index 9940754d0..2080c454b 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -8,7 +8,6 @@ Imports Newtonsoft.Json
Partial Class OC_OC
Inherits ClsPaginas
- Private Shared missing As Object = System.Reflection.Missing.Value
#Region "Propiedades"
Private Property CveEmpresaActual As Integer
diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb
index 59ac8f9c2..3fcafaebd 100644
--- a/Planeacion/CatSubProyectos.aspx.vb
+++ b/Planeacion/CatSubProyectos.aspx.vb
@@ -143,7 +143,7 @@ Partial Class CatSubProyectos
Private Sub CargaSegmentosNegocio()
DdlSegmentoNegocio.Items.Clear()
- If UsuarioActual.Empresa.UsaContabilidad Then
+ If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Dim Cuenta As New ClsContPAQi(UsuarioActual.Empresa)
@@ -962,15 +962,17 @@ Partial Class CatSubProyectos
Dim SubProyecto As String = GvRow.DataKey("SubProyecto")
Dim Erroreliminacion As Boolean = False
- Dim ObjUsuarios As New ClsSisUsuarios
- Dim ObjGenerales As New ClsGenerales
+ Dim ObjUsuarios As New ClsSisUsuarios()
+ Dim ObjGenerales As New ClsGenerales(ObjUsuarios.IniciaTransacSQL)
If ObjUsuarios.RemoveSubProyectos(CveUsuario, CveSubProyectoUsuarios, UsuarioActual.CveUsuario) Then
If Not ObjGenerales.AddHistorialBitacora(406, -1, -1, -1, -1, -1, -1, -1, "", SubProyecto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, "-1", "-1", "-1", CveUsuarioTabla:=CveUsuario) Then
Erroreliminacion = True
+ ObjUsuarios.Commit()
End If
Else
Erroreliminacion = True
+ ObjUsuarios.RollBack()
End If
ObjUsuarios.Dispose()
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 2ba4401d1..819d30cfb 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -8974,15 +8974,15 @@ Partial Class Ventas
EsValido = True
End If
- If UsuarioActual.Empresa.Funcionalidad(133).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
- CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo)
- 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
- If PU <= CostoMayor Then
- EsValidoMayor = True
- End If
- Else
- EsValidoMayor = True
- End If
+ 'If UsuarioActual.Empresa.Funcionalidad(133).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then
+ ' CostoMayor = Costo + ((UsuarioActual.Empresa.Funcionalidad(133).ToDecimal / 100) * Costo)
+ ' 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA
+ ' If PU <= CostoMayor Then
+ ' EsValidoMayor = True
+ ' End If
+ 'Else
+ ' EsValidoMayor = True
+ 'End If
'VALIDA PROMOCION: SI TIENE PROMOCION Y EL PRECIO ES MENOR AL PRECIO DE PROMOCION, NO PASA | SI YA CUMPLE NO VUELVE A VALIDAR
If Not EsValido Or PU = 0 Then
@@ -8998,24 +8998,24 @@ Partial Class Ventas
End If
'NO DEJA REGISTRAR CON VALIDACION DE COSTO ALMACEN O PROMOCION
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
- If Not EsValido Then
+ 'If Not EsValido Then
- MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado ", dr("PS").ToString())
- If TienePermisoImportes Then
- MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$ ", Costo)
- MensajeCosto.AppendFormat("El rango menor aceptado es: {0} {1:#,###.00}$ ", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor)
- MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia) ", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
- End If
- End If
+ ' MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado ", dr("PS").ToString())
+ ' If TienePermisoImportes Then
+ ' MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$ ", Costo)
+ ' MensajeCosto.AppendFormat("El rango menor aceptado es: {0} {1:#,###.00}$ ", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor)
+ ' MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia) ", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
+ ' End If
+ 'End If
- If Not EsValidoMayor Then
- MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio mayor de su rango aceptado ", dr("PS").ToString())
- If TienePermisoImportes Then
- MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$ ", Costo)
- MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} {1:#,###.00}$ ", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor)
- MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia) ", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
- End If
- End If
+ 'If Not EsValidoMayor Then
+ ' MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio mayor de su rango aceptado ", dr("PS").ToString())
+ ' If TienePermisoImportes Then
+ ' MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$ ", Costo)
+ ' MensajeCosto.AppendFormat("El rango mayor aceptado es: {0} {1:#,###.00}$ ", UsuarioActual.Empresa.Funcionalidad(133).ToEntero(), CostoMayor)
+ ' MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia) ", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0))
+ ' End If
+ 'End If
' SOLO SI TIENE LA FUNCIONALIDAD DE RESTRICCION VALIDA EL IMPORTE CERO
If UsuarioActual.Empresa.Funcionalidad(139).ToString().ToEntero() > 0 Then
@@ -15776,47 +15776,8 @@ Partial Class Ventas
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
-
- Dim FechaUltimaFluctuacion As Date = MinFecha
- Dim TipoCambioFluctuacion As Decimal = 1
- Dim tFecha As Date = Now
-
- Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
-
-
- If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
- If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
- FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
- TipoCambioFluctuacion = UltimaFluctuacion.TCFluctuacion
- End If
- End If
-
-
- If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS
- tipoCambioPago = 1
- tipoCambioVenta = 1
- tipoCambioVentaValuacion = 1
- PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
- ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN PESOS
- tipoCambioPago = gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
- tipoCambioVenta = TxtTipoCambio.Text.ToDecimal
- tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
- PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
- ElseIf DdlMoneda.SelectedValue.ToEntero() = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 2 Then 'SI LA VENTA VIENE EN DOLARES Y SE VA A PAGAR EN DOLARES
- tipoCambioPago = gvr.DataKey("TipoCambio").ToString().ToDecimal
- tipoCambioVenta = TxtTipoCambio.Text.ToDecimal
- tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
- PorcentajePago = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("Original").ToDecimal
- ElseIf DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 2 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN DOLARES
- tipoCambioPago = gvr.DataKey("TipoCambioHoy").ToDecimal() ' gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
- tipoCambioVenta = 1
- tipoCambioVentaValuacion = If(TxtFecha.Text.ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, TxtTipoCambio.Text.ToDecimal)
- PorcentajePago = (gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
- End If
-
Dim importeMovimiento As Decimal = 0
Dim importeMN As Decimal = 0
- Dim TC As Decimal
Dim IdCtaContable As Integer
Dim TipoMovimiento As Boolean = True
Dim Concepto As String = VentaActual.SerieFolio
@@ -15886,81 +15847,22 @@ Partial Class Ventas
If gvr.DataKey("CveIE").ToEntero() > 0 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
- IdCtaContable = IdCtaContClientes
If importeMovimiento <> 0 Then
Dim Pago As New VentaPago
+ Pago.ImportePagoVenta = importeMovimiento
Pago.ImportePago = importeMovimiento
Pago.CveIE = CveIEAnticipo
Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero()
- Pago.TipoPago = "A"
+ Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal
+ Pago.TipoPago = "I"
+ Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate
Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero()
- Pago.AplicaTraslado = gvr.DataKey("RegresarImpuesto") = "1"
Pago.Referencia = gvr.DataKey("Folio")
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
- ' Agregamos el 2
- If tipoCambioPago = 1 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContClientes, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, CveSubProyecto:=CveSubProyectoVenta) Then
- ErrorConta = True
- End If
- Else 'Cuando son dolares
- If importeMovimiento <> 0 Then
- If IdCtaContComplementaria > 0 Or 0 > 0 Then
- 'Agregamos la Complementaria
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, 0, Concepto, 207, Concepto, Now, IdCtaContComplementaria, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta - importeMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then
- ErrorConta = True
- End If
- 'Agregamos la Extranjera
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then
- ErrorConta = True
- End If
- Else
- 'Agregamos la Extranjera
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, importeMovimiento, Concepto, 2, Concepto, Now, IdCtaContMonedaExtranjera, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=Math.Round(importeMovimiento * tipoCambioVenta, 2, MidpointRounding.AwayFromZero), ImporteME:=importeMovimiento, CveCuenta:=0, TipoCambio:=tipoCambioVenta, CveSubProyecto:=CveSubProyectoVenta) Then
- ErrorConta = True
- End If
- End If
- End If
- End If
-
- importeMovimiento = ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / TxtTotal.Text.ToDecimal) * TxtIVA.Text.ToDecimal)
- importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
-
-
- 'Agregamos el 92
- importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
- importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
- IdCtaContable = IdCtaContAnticipos
-
- If ObjCliente.GetClientes(gvr.DataKey("CveCliente").ToEntero(), "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
- If ObjCliente.DtResultados.Rows.Count > 0 Then
- If Not tipoCambioPago = 1 Then
- IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos
- Else
- IdCtaContable = ObjCliente.IdCtaContAnticipos
- End If
- End If
- End If
-
- If UsuarioActual.CveEmpresa.Contiene(119) Then
- If gvr.DataKey("Fecha").ToDate.Year <= 2017 AndAlso TxtFechaAnticipoCliente.Text.ToDate.Year >= 2018 Then
- If ObjCliente.DtResultados.Rows.Count > 0 Then
- If Not tipoCambioPago = 1 Then
- IdCtaContable = ObjCliente.IdCtaContMonedaExtranjera
- Else
- IdCtaContable = ObjCliente.IdCtaContClientes
- End If
- End If
- End If
- End If
-
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, 555, Concepto, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMN, CveCuenta:=-1, TipoCambio:=tipoCambioPago, CveSubProyecto:=CveSubProyectoVenta) Then
- ErrorConta = True
- End If
-
End If
End If
End Select
|