diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb
index ab530b603..f900e0f50 100644
--- a/AF/AF.aspx.vb
+++ b/AF/AF.aspx.vb
@@ -1172,8 +1172,8 @@ Partial Class AF_AF
End If
If Adjunto.Trim.Length > 0 Then
- Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/AF/Placas/" & Adjunto & "." & extencion
- Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "AF/Placas/" & Adjunto & "." & extencion
+ Dim linkDescarga As String = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/AF/Placas/" & Adjunto & "." & extencion
+ Dim linkDescargaArchivo As String = UsuarioActual.Empresa.Ruta & "AF/Placas/" & Adjunto & "." & extencion
If File.Exists(linkDescargaArchivo) Then
ImgDownLoad.Visible = True
diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb
index 54581d959..120c6bcdb 100644
--- a/App_Code/ClsAcumuladores.vb
+++ b/App_Code/ClsAcumuladores.vb
@@ -760,9 +760,15 @@ Public Class ClsAcumuladores
End With
Try
SqlAdapter.Fill(Data)
- Retorno = True
- Catch ex As SqlException
- OnError("Ocurrió un al agregar la garantia detalle. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Retorno = True
+ Catch ex As SqlException
+ If ex.Message.Contains("Número: 2627;") And ex.Message.Contains("UK_Acum_GarantiasDetalle_Folio_Ensamble_Inspeccion_Comprobante") Then
+ Alert(String.Format("las condiciones ya se encuentran registradas. Comprobante:'{0}', CodigoEnsamble:'{1}', CodigoInspeccion:'{2}' ", Comprobante, CodigoEnsamble, CodigoInspeccion), TipoMensaje.MsgAdvertencia)
+ GuardaLogAD(String.Format("el folio ya se encuentra registrado {0} {1}", ex.Message, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
+ Else
+ OnError("Ocurrió un al agregar la garantia detalle. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
+
End Try
Return Retorno
End Function
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index f12d507c9..b9bcdf016 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -61,7 +61,7 @@ Public Class ClsBancos
Public Property FechaDocumento As DateTime
Public Property Folio As String
Public Property PagueseA As String
- Public Property Importe As Double
+ Public Property Importe As Decimal
Public Property CveMoneda As Integer
Public Property Moneda As String
Public Property TipoCambio As Decimal
@@ -728,7 +728,7 @@ Public Class ClsBancos
Me.FechaDocumento = Data.Rows(0)("FechaDocumento").ToString.ToDate
Me.Folio = Data.Rows(0)("Folio").ToString
Me.PagueseA = Data.Rows(0)("PagueseA").ToString
- Me.Importe = Data.Rows(0)("Importe").ToString.ToDouble
+ Me.Importe = Data.Rows(0)("Importe").ToString.ToDecimal
Me.CveMoneda = Data.Rows(0)("CveMoneda").ToString.ToEntero
Me.Moneda = Data.Rows(0)("Moneda").ToString
Me.TipoCambio = Data.Rows(0)("TipoCambio").ToString.ToDecimal
@@ -1040,58 +1040,58 @@ Public Class ClsBancos
Select Case dr("ClaveFormaPagoSAT").ToString
Case "02"
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(11, 18) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 11, 18 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
End If
Case "03"
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(10, 16, 18) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 10, 16, 18 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 18)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 18 caracteres."
End If
Case "04"
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(16) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 16 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
End If
Case "05"
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(10, 11, 15, 16, 18, 50) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
End If
Case "06"
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(10) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 10 caracteres."
End If
CuentaBeneficiario = ""
Case "28"
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(16) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 16 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
End If
Case "29"
If Cuentapago <> "" AndAlso Not Cuentapago.Length.Contiene(15, 16) Then
- Mensaje = "La cuenta ordenante no cumple con el formato esperado."
+ Mensaje = $"La cuenta ordenante {Cuentapago} no cumple con el formato esperado 15, 16 caracteres."
End If
If CuentaBeneficiario <> "" AndAlso Not (CuentaBeneficiario.Length.Contiene(10, 11, 15, 16, 18, 50)) Then
- Mensaje = $"{Mensaje} La Cuenta Beneficiario no cumple con el formato esperado."
+ Mensaje = $"{Mensaje} La Cuenta Beneficiario {CuentaBeneficiario} no cumple con el formato esperado 10, 11, 15, 16, 18, 50 caracteres."
End If
Case Else
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 72954ea76..336499c97 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -6435,6 +6435,10 @@ Public Class ClsContabilidad
Try
SqlAdapter.Fill(Data)
Retorno = True
+ Catch ex As sqlException
+ If ex.Message.Contains("50015;") Then
+ OnError("No se puede registrar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
Catch ex As Exception
Me.OnError("Ocurrió un error al obtener traspasar las Prepolizas", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb
index 2e7b3b93f..64b381f1d 100644
--- a/App_Code/ClsOS.vb
+++ b/App_Code/ClsOS.vb
@@ -67,6 +67,10 @@ Public Class ClsOS
Public Property SubProyecto As String
Public Property Condiciones As String
+ Public Property CveMedico As Integer = -1
+ Public Property CveProcedimiento As Integer = -1
+ Public Property CveTipoVenta As Integer = -1
+
Private Class Especificaciones
@@ -547,6 +551,11 @@ Public Class ClsOS
Me.SubProyecto = Data.Rows(0)("SubProyecto").ToString
Me.Condiciones = Data.Rows(0)("Condiciones").ToString
+ Me.CveMedico = Data.Rows(0)("CveMedico").ToString.ToEntero
+ Me.CveProcedimiento = Data.Rows(0)("CveProcedimiento").ToString.ToEntero
+ Me.CveTipoVenta = Data.Rows(0)("CveTipoVenta").ToString.ToEntero
+
+
End If
Retorno = True
Catch ex As Exception
@@ -601,7 +610,7 @@ Public Class ClsOS
Public Function AddOrdenesServicios(CveCliente As Integer, CveSubProyecto As Integer, PersonaSolicito As String, FechaRecepcion As Date, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer,
CveUsuario As Integer, CveEmpresa As Integer, CveCotizacion As Integer, CveVenta As Integer, CveOSPadre As Integer, CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1,
Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1, Optional Año As String = "-1", Optional Correo As String = "",
- Optional Condiciones As String = "") As Boolean
+ Optional Condiciones As String = "", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional FechaCita As DateTime = MinFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OS_OrdenesServiciosAdd")
@@ -628,6 +637,10 @@ Public Class ClsOS
.Add("@Año", SqlDbType.VarChar).Value = Año
.Add("@Correo", SqlDbType.VarChar).Value = Correo
.Add("@Condiciones", SqlDbType.VarChar).Value = Condiciones
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
+ .Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
+ .Add("@FechaCita", SqlDbType.DateTime).Value = FechaCita
.Add("@CveOS", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@vFolio", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -672,7 +685,8 @@ Public Class ClsOS
End Function
Public Function UpdateOrdenesServicios(PersonaSolicito As String, FechaRecepcion As String, Descripcion As String, CveUsuarioRecibio As Integer, CveEstatusOrdenServicio As Integer, CveOS As Integer, CveUsuarioModifico As Integer,
CveOSTipo As Integer, Optional CveClienteSucursal As Integer = -1, Optional Direccion As String = "-1", Optional Telefono As String = "", Optional CveModeloAuto As Integer = -1,
- Optional Año As String = "-1", Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional Condiciones As String = "") As Boolean
+ Optional Año As String = "-1", Optional CveSubProyecto As Integer = -1, Optional Correo As String = "-1", Optional Condiciones As String = "",
+ Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional FechaCita As DateTime = MinFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OS_OrdenesServiciosUpdate")
@@ -695,6 +709,10 @@ Public Class ClsOS
.Add("@Año", SqlDbType.VarChar).Value = Año
.Add("@Correo", SqlDbType.VarChar).Value = Correo
.Add("@Condiciones", SqlDbType.VarChar).Value = Condiciones
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
+ .Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
+ .Add("@FechaCita", SqlDbType.DateTime).Value = FechaCita
End With
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 772323ed2..0af6d6c27 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -2123,6 +2123,60 @@ Public Class ClsPaginas
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
+
+ Property GlobalDTTipoVenta(Optional CveEmpresa As Integer = -1) As DataTable
+ Get
+ Dim AppNombre As String = $"GlobalDTTipoVenta"
+ 'sino existe, recarga los datos
+ If Application(AppNombre) Is Nothing Then
+ Dim ObjVentas As New ClsVentas
+ If ObjVentas.GetTipoVenta() Then Application(AppNombre) = ObjVentas.DtResultados
+ ObjVentas.Dispose()
+ End If
+ GlobalDTTipoVenta = DirectCast(Application(AppNombre), DataTable)
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = $"GlobalDTTipoVenta"
+ Application(AppNombre) = value
+ End Set
+ End Property
+
+ Property GlobalDTMedicos(CveEmpresa As Integer) As DataTable
+ Get
+ Dim AppNombre As String = $"GlobalDTAgentes-{CveEmpresa}"
+ 'sino existe, recarga los datos
+ If Application(AppNombre) Is Nothing Then
+ Dim ObjVentas As New ClsVentas
+ If ObjVentas.GetMedicos(-1, CveEmpresa, -1) Then Application(AppNombre) = ObjVentas.DtResultados
+ ObjVentas.Dispose()
+ End If
+ GlobalDTMedicos = DirectCast(Application(AppNombre), DataTable)
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = $"GlobalDTAgentes-{CveEmpresa}"
+ Application(AppNombre) = value
+ End Set
+ End Property
+
+
+
+
+ Property GlobalDTProcedimientos(CveEmpresa As Integer) As DataTable
+ Get
+ Dim AppNombre As String = $"GlobalDTProcedimientos-{CveEmpresa}"
+ 'sino existe, recarga los datos
+ If Application(AppNombre) Is Nothing Then
+ Dim ObjVentas As New ClsVentas
+ If ObjVentas.GetProcedimientos(-1, CveEmpresa, -1) Then Application(AppNombre) = ObjVentas.DtResultados
+ ObjVentas.Dispose()
+ End If
+ GlobalDTProcedimientos = DirectCast(Application(AppNombre), DataTable)
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = $"GlobalDTProcedimientos-{CveEmpresa}"
+ Application(AppNombre) = value
+ End Set
+ End Property
Public Shared Property GlobalDTClientesCorporativo(CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = $"GlobalDTClientesCorporativo-{CveEmpresa}"
@@ -5492,7 +5546,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("RetIVA", Vta.RetIVA.ToString.FormatoNumero(2)))
params.Add(New ReportParameter("RetISR", Vta.RetISR.ToString.FormatoNumero(2)))
params.Add(New ReportParameter("Total", Vta.Total.ToString.FormatoNumero(2)))
- params.Add(New ReportParameter("ImporteLetra", Vta.Total.ToString.ToDouble.Texto2Letras(Vta.CveMoneda)))
+ params.Add(New ReportParameter("ImporteLetra", Vta.Total.ToString.ToDecimal.Texto2Letras(Vta.CveMoneda)))
'DATOS GENERALES
If UsuarioActual.CveEmpresa.Contiene(15) Then
@@ -6460,7 +6514,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("RetISR", ObjOC.RetISR.ToString.FormatoNumero(2)))
params.Add(New ReportParameter("IEPS", ObjOC.IEPS.ToString.FormatoNumero(2)))
params.Add(New ReportParameter("Total", ObjOC.Total.ToString))
- params.Add(New ReportParameter("ImporteLetra", (ObjOC.Total).ToString.ToDouble.Texto2Letras(ObjOC.CveMoneda)))
+ params.Add(New ReportParameter("ImporteLetra", (ObjOC.Total).ToString.ToDecimal.Texto2Letras(ObjOC.CveMoneda)))
params.Add(New ReportParameter("CorreoControl", If(drAut IsNot Nothing, drAut("Correo").ToString, "")))
params.Add(New ReportParameter("Moneda", ObjOC.Moneda))
params.Add(New ReportParameter("TipoCambio", TipoCambio))
@@ -6902,7 +6956,7 @@ Public Class ClsPaginas
RptParametro.Add(New ReportParameter("Total", If(indemnizacion, ajusteindemnizacion, ObjNomina.Total - ajusteindemnizacion).ToString()))
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
cQr = CBB.GenerarCBBBytes(UsuarioActual.Empresa.RFC, ObjPersonal.RFC, ObjNomina.Total.ToString().ToDecimal(), FolioFiscal)
- RptParametro.Add(New ReportParameter("ImporteLetra", ObjNomina.Total.ToString.ToDouble.Texto2Letras))
+ RptParametro.Add(New ReportParameter("ImporteLetra", ObjNomina.Total.ToString.ToDecimal.Texto2Letras))
RptParametro.Add(New ReportParameter("Clave", "84111505"))
Else
TieneError = True
@@ -7217,7 +7271,7 @@ Public Class ClsPaginas
Dr("FormaDePagoP") = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPagoSAT", $"ClaveFormaPagoSAT= '{Pagos.Attributes("FormaDePagoP").Value}'")
Dr("FechaPago") = Pagos.Attributes("FechaPago").Value
FechaRecibo = Pagos.Attributes("FechaPago").Value
- TotalLetra = Pagos.Attributes("Monto").Value.ToString.ToDouble.Texto2Letras(CveMoneda)
+ TotalLetra = Pagos.Attributes("Monto").Value.ToString.ToDecimal.Texto2Letras(CveMoneda)
DTConceptosPago.Rows.Add(Dr)
For Each Relacionado As XmlNode In Pagos.SelectNodes(String.Format("//{0}:DoctoRelacionado", PagoVersion), namespaces)
Dim DrRelacionado As DataRow = DTConceptosPagoRelacionado.NewRow
@@ -9340,11 +9394,11 @@ Public Class ClsPaginas
PaginaDict.Add("/Ventas/RepCancelacionesVentas.aspx".ToUpper(), 1325)
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx".ToUpper(), 1331)
PaginaDict.Add("/Ventas/RepLineasAdicionales.aspx?OP=OP".ToUpper(), 1332)
-
PaginaDict.Add("/Ventas/FacturacionAcarreos.aspx".ToUpper(), 784)
-
-
PaginaDict.Add("/Ventas/RepIndicadoresPorProyecto.aspx".ToUpper(), 617)
+ PaginaDict.Add("/Ventas/CatMedicos.aspx".ToUpper(), 1343)
+ PaginaDict.Add("/Ventas/CatProcedimientos.aspx".ToUpper(), 1344)
+ PaginaDict.Add("/Ventas/VentasMedicas.aspx".ToUpper(), 1345)
@@ -9410,8 +9464,13 @@ Public Class ClsPaginas
PaginaDict.Add("/Acumuladores/RepPolizasVirtuales.aspx".ToUpper(), 1322)
PaginaDict.Add("/Acumuladores/RepAcumuladoresVigencia.aspx".ToUpper(), 174)
+#End Region
+
+#Region "Transportes"
+ PaginaDict.Add("/Transportes/ContratoTransporte.aspx".ToUpper(), 598)
#End Region
'Antes de aquí.
+
Application("GlobalSIGAppPaginas") = PaginaDict
Else
PaginaDict = DirectCast(Application("GlobalSIGAppPaginas"), Hashtable)
diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb
index 5788f496d..0a5030349 100644
--- a/App_Code/ClsRH.vb
+++ b/App_Code/ClsRH.vb
@@ -7156,7 +7156,7 @@ Public Class ClsRH
End If
ListaTagsDocumentost.Add(New TagsDocumentos("{Sexo}", DtResultados(0)("Genero").ToString))
- Dim SalarioDiarioTag As String = DtResultados(0)("SalarioDiario").ToString.ToDouble.Texto2Letras()
+ Dim SalarioDiarioTag As String = DtResultados(0)("SalarioDiario").ToString.ToDecimal.Texto2Letras()
ListaTagsDocumentost.Add(New TagsDocumentos("{Sueldo}", DtResultados(0)("SalarioDiario").ToString.ToDouble.ToString("###,###,###.00")))
ListaTagsDocumentost.Add(New TagsDocumentos("{SueldoLetra}", SalarioDiarioTag))
ListaTagsDocumentost.Add(New TagsDocumentos("{Nacionalidad}", DtResultados(0)("ClaveSATPaisDescripcion").ToString))
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index fa6c2089a..e1eab6eec 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -418,7 +418,9 @@ Public Class ClsVentas
Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1,
Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0,
Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False, Optional VentaDesglosaIEPS As Boolean = False, Optional ServicioDomicilio As Boolean = False, Optional RFCReceptor As String = "", Optional Adjunto As String = "-1",
- Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1, Optional DescripcionVenta As String = "") As Boolean
+ Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1, Optional DescripcionVenta As String = "",
+ Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1
+ ) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VentasAdd")
@@ -518,6 +520,11 @@ Public Class ClsVentas
.Add("@EsGarantia", SqlDbType.Bit).Value = EsGarantia
.Add("@CveLineaAdicional", SqlDbType.Int).Value = CveLineaAdicional
.Add("@DescripcionVenta", SqlDbType.VarChar).Value = DescripcionVenta
+
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
+ .Add("@CveTipoVenta", SqlDbType.Int).Value = CveTipoVenta
+
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
'SqlTypes.SqlDateTime.Null
@@ -1338,12 +1345,12 @@ Public Class ClsVentas
Return Retorno
End Function
- Public Function AddVentaDetalle(CveVenta As Integer, CvePS As Integer, Cantidad As Double, CveUnidadMedida As Integer, PU As Double, IVA As Double,
- Total As Double, Observaciones As String, Descuento As Double, TipoDescuento As Integer, CveSubProyecto As Integer,
+ Public Function AddVentaDetalle(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, PU As Decimal, IVA As Decimal,
+ Total As Decimal, Observaciones As String, Descuento As Decimal, TipoDescuento As Integer, CveSubProyecto As Integer,
CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1,
- Optional CveContratoDetalle As Integer = -1, Optional PorcentajeIVA As Decimal = 0, Optional IEPS As Double = -1, Optional PorcentajeIEPS As Double = 0, Optional CvePromocionDetalle As Integer = -1,
- Optional CveMovimientoDetallePedido As Integer = -1, Optional ImporteRetIVA As Double = 0, Optional PorcentajeRetIVA As Double = 0,
- Optional ImporteRetISR As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional NumTurnos As Decimal = 0D) As Boolean
+ Optional CveContratoDetalle As Integer = -1, Optional PorcentajeIVA As Decimal = 0, Optional IEPS As Decimal = -1, Optional PorcentajeIEPS As Double = 0, Optional CvePromocionDetalle As Integer = -1,
+ Optional CveMovimientoDetallePedido As Integer = -1, Optional ImporteRetIVA As Decimal = 0, Optional PorcentajeRetIVA As Double = 0,
+ Optional ImporteRetISR As Decimal = 0, Optional PorcentajeRetISR As Decimal = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional NumTurnos As Decimal = 0D) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VentasDetalleAdd")
@@ -5939,6 +5946,204 @@ Public Class ClsVentas
+#Region "TIPO VENTA"
+
+ Public Function GetTipoVenta() As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_TipoVentaGet")
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los Tipos de Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+#End Region
+
+#Region "AGENTES"
+
+ Public Function GetMedicos(CveMedico As Integer, CveEmpresa As Integer, Estatus As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_MedicosGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los Medicos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+
+
+
+ Public Function AddMedico(Medico As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, DiasAtencion As String, Horario As String, Lugar As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_MedicosAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CedulaProfesional", SqlDbType.VarChar).Value = CedulaProfesional
+ .Add("@Medico", SqlDbType.VarChar).Value = Medico
+ .Add("@FechaNacimiento", SqlDbType.Date).Value = FechaNacimiento
+ .Add("@Notas", SqlDbType.VarChar).Value = Notas
+ .Add("@DiasAtencion", SqlDbType.VarChar).Value = DiasAtencion
+ .Add("@Horario", SqlDbType.VarChar).Value = Horario
+ .Add("@Lugar", SqlDbType.VarChar).Value = Lugar
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al guardar el Medico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+ Public Function UpdateMedico(CveMedico As Integer, Medico As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, DiasAtencion As String, Horario As String, Lugar As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_MedicosUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@Medico", SqlDbType.VarChar).Value = Medico
+ .Add("@CedulaProfesional", SqlDbType.VarChar).Value = CedulaProfesional
+ .Add("@FechaNacimiento", SqlDbType.Date).Value = FechaNacimiento
+ .Add("@Notas", SqlDbType.VarChar).Value = Notas
+ .Add("@DiasAtencion", SqlDbType.VarChar).Value = DiasAtencion
+ .Add("@Horario", SqlDbType.VarChar).Value = Horario
+ .Add("@Lugar", SqlDbType.VarChar).Value = Lugar
+ .Add("@Estatus", SqlDbType.Bit).Value = Estatus
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el Medico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+ Public Function RemoveMedico(CveMedico As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_MedicosRemove")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el Medico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+#End Region
+#Region "PRODEDIMIENTOS"
+
+ Public Function GetProcedimientos(CveProcedimiento As Integer, CveEmpresa As Integer, Estatus As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_ProcedimientosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los Procedimientos .", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+ Public Function AddProcedimiento(Procedimiento As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_ProcedimientosAdd")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@Procedimiento", SqlDbType.VarChar).Value = Procedimiento
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al guardar el Procedimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+ Public Function UpdateProcedimiento(CveProcedimiento As Integer, Procedimiento As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_ProcedimientosUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
+ .Add("@Procedimiento", SqlDbType.VarChar).Value = Procedimiento
+ .Add("@Estatus", SqlDbType.Int).Value = Estatus
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el Procedimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+ Public Function RemoveProcedimiento(CveProcedimiento As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_ProcedimientosRemove")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el Procedimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+ Return Retorno
+
+ End Function
+
+#End Region
+
#Region "IDisposable Support"
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 841e529e5..ff11bd35f 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -18,9 +18,9 @@ Namespace Modelos
Public Property ConceptoP As String
Public Property LabelValorP As String
Public Property CveConceptoP As Integer
- Public Property ImporteP As Double
- Public Property ImporteGravadoP As Double
- Public Property ValorP As Double
+ Public Property ImporteP As Decimal
+ Public Property ImporteGravadoP As Decimal
+ Public Property ValorP As Decimal
Public Property EstatusP As Integer
Public Property isSavedP As Integer
Public Property isEditedP As Integer
@@ -32,9 +32,9 @@ Namespace Modelos
Public Property ConceptoD As String
Public Property LabelValorD As String
Public Property CveConceptoD As Integer
- Public Property ImporteD As Double
- Public Property ImporteGravadoD As Double
- Public Property ValorD As Double
+ Public Property ImporteD As Decimal
+ Public Property ImporteGravadoD As Decimal
+ Public Property ValorD As Decimal
Public Property EstatusD As Integer
Public Property isSavedD As Integer
Public Property isEditedD As Integer
@@ -46,9 +46,9 @@ Namespace Modelos
Public Property ConceptoO As String
Public Property LabelValorO As String
Public Property CveConceptoO As Integer
- Public Property ImporteO As Double
- Public Property ImporteGravadoO As Double
- Public Property ValorO As Double
+ Public Property ImporteO As Decimal
+ Public Property ImporteGravadoO As Decimal
+ Public Property ValorO As Decimal
Public Property EstatusO As Integer
Public Property isEditedO As Integer
Public Property isOnlyBisibleO As Integer
@@ -548,50 +548,21 @@ Namespace Modelos
End Sub
Private Sub IniciaValores()
- Me.FolioFiscal = ""
- Me.CveContratoSecciones = ""
- Me.Version = "3.3"
+
If UsuarioActual IsNot Nothing Then
Me.CveUsuario = UsuarioActual.CveUsuario
Me.CveEmpresa = UsuarioActual.CveEmpresa
Me.UsuarioCreo = UsuarioActual.Usuario
End If
- Me.TipoCambio = 0
- Me.ConvertirPesos = False
+
Me.CveMoneda = 1
- Me.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda} ")
- Me.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda} ")
- Me.RefDocto = ""
- ' Me.CveMesa = -1
+ Me.Moneda = "Pesos" 'ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda} ")
+ Me.MonedaSAT = "MXN" 'ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda} ")
+
Me.Fecha = ClsPaginas.NowADS()
- Me.CvePrePoliza = -1
Me.FechaPago = ClsPaginas.NowADS()
- Me.MotivoDescuento = ""
- Me.Observaciones = ""
Me.FechaEjecucion = ClsPaginas.NowADS()
- Me.CveCondicionEntrega = -1
- Me.CondicionEntrega = ""
- Me.NumeroCuenta = ""
- Me.CondicionesPago = 0
- Me.FormaPago = 0
- Me.PedidoContrato = ""
- Me.NumeroContrato = ""
- Me.DescripcionContrato = ""
- Me.CveCorte = -1
- Me.Alfa1 = ""
- Me.Alfa2 = ""
- Me.Alfa3 = ""
- Me.Descuento = 0
- Me.Amortizacion = 0
- Me.CveContrato = 0
- Me.SubTotal = 0
- Me.Descuento = 0
- Me.Amortizacion = 0
- Me.IVA = IVA
- Me.RetIVA = 0
- Me.RetISR = 0
- Me.IEPS = 0
- Me.CveAlmacenTraspasoOrigen = 0
+
End Sub
Private Sub IniciaValoresVentas(Optional EsCancelacion As Boolean = False)
If CveVenta > 0 AndAlso CveEmpresa > 0 Then
@@ -1289,10 +1260,10 @@ Namespace Modelos
ObjFactura.Version = "4.0"
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
- ObjFactura.CveMoneda = CveMoneda
- ObjFactura.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
- ObjFactura.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
- ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, ClsPaginas.GlobalTipoCambio(ClsPaginas.NowADS()).ToDecimal())
+ 'ObjFactura.CveMoneda = CveMoneda
+ 'ObjFactura.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
+ 'ObjFactura.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {ObjFactura.CveMoneda}")
+ 'ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, ClsPaginas.GlobalTipoCambio(ClsPaginas.NowADS()).ToDecimal())
ObjFactura.TipoDocto = TipoDocto
ObjFactura.Folio = -1
ObjFactura.Serie = "-1"
@@ -1304,8 +1275,6 @@ Namespace Modelos
ObjFactura.FechaEjecucion = DateTime.Today
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
ObjFactura.CondicionesPago = 0
-
-
ObjFactura.TipoDocumento = "Factura"
'Totales, Y se llena TmpDTImpuestos
@@ -1957,13 +1926,13 @@ Namespace Modelos
factura.DtDetalle = tmpcon
- Dim TotalSubTotal As Decimal = tmpcon.SUM("TotalImporte").ToDecimal
- Dim TotalDescuentos As Decimal = tmpcon.SUM("Descuento").ToDecimal
+ Dim TotalSubTotal As Decimal = tmpcon.SUM("TotalImporte")
+ Dim TotalDescuentos As Decimal = tmpcon.SUM("Descuento")
- Dim TotalIVA As Decimal = tmpcon.SUM("ImporteIVA").ToDecimal
- Dim TotalIEPS As Decimal = tmpcon.SUM("ImporteIEPS").ToDecimal
- Dim TotalRetIVA As Decimal = tmpcon.SUM("ImporteRetIVA").ToDecimal
- Dim TotalRetISR As Decimal = tmpcon.SUM("ImporteRetISR").ToDecimal
+ Dim TotalIVA As Decimal = tmpcon.SUM("ImporteIVA")
+ Dim TotalIEPS As Decimal = tmpcon.SUM("ImporteIEPS")
+ Dim TotalRetIVA As Decimal = tmpcon.SUM("ImporteRetIVA")
+ Dim TotalRetISR As Decimal = tmpcon.SUM("ImporteRetISR")
Dim Total As Decimal = 0
Dim TotalImpuestosLocales As Decimal = 0
Total = (TotalSubTotal - TotalDescuentos + TotalIVA + TotalIEPS - TotalRetIVA - TotalRetISR - TotalImpuestosLocales)
@@ -2219,14 +2188,14 @@ Namespace Modelos
'Se agregan los PS
For Each Row As DataRow In TmpDTDetalle.Rows
- If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
- Row("PU").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Math.Round((Row("Total").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
- Row("Obs").ToString, Row("Descuento").ToString.ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero,
+ If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal, Row("CveUM").ToString.ToEntero,
+ Row("PU").ToString.ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString.ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Math.Round((Row("Total").ToString.ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString.ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
+ Row("Obs").ToString, Row("Descuento").ToString.ToDecimal(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString.ToEntero, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoIngreso").ToString.ToEntero,
TiempoEntrega:=Row("TiempoEntrega").ToString, CveVentaDetallePadre:=Row("CveVentaDetalle").ToString.ToEntero, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero,
CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString}").ToEntero, -1),
- IEPS:=Row("ImporteIEPS").ToString.ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString.ToEntero,
- ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDouble,
- PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDouble, CuentaPredial:=Row("CuentaPredial").ToString,
+ IEPS:=Row("ImporteIEPS").ToString.ToDecimal, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString.ToEntero,
+ ImporteRetIVA:=Row("ImporteRetIVA").ToString.ToDecimal, ImporteRetISR:=Row("ImporteRetISR").ToString.ToDecimal,
+ PorcentajeIEPS:=Row("PorcentajeIEPS").ToString.ToDecimal, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString.ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString.ToDecimal, CuentaPredial:=Row("CuentaPredial").ToString,
PorcentajeIVA:=Row("PorcentajeIVA").ToString.ToDecimal) Then
ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la factura. Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For
@@ -4591,7 +4560,7 @@ Namespace Modelos
Next
If Not OcurrioError Then
- ValorInventario = (DtCostos.SUM("Total", "").ToDecimal).RoundSQL
+ ValorInventario = (DtCostos.SUM("Total", "")).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, True, ValorInventario, ValorInventario, 68, Me.SerieFolio, Me.SerieFolio, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, CveSubProyecto:=Me.CveSubProyecto) Then
OcurrioError = True
End If
@@ -7163,7 +7132,7 @@ Namespace Modelos
Public Property SubProyectoMatriz As Modelos.SubProyectoModel
'CFDi
- Public Property Version As String = ""
+ Public Property Version As String = "4.0"
Public Property Serie As String = ""
Public Property Folio As Integer = -1
@@ -7298,7 +7267,7 @@ Namespace Modelos
End Property
Public Property CveUsuario As Integer
Public Property SerieFolioPadre As String
- Public Property CveMoneda As Integer
+ Public Property CveMoneda As Integer = 1
Public Property Moneda As String
Public Property MonedaSAT As String
Public Property UsuarioCreo As String
@@ -7473,7 +7442,7 @@ Namespace Modelos
Public Property FechaPago As Date
Public Property CveNCaVincular As Integer
- Public Property FolioFiscal As String
+ Public Property FolioFiscal As String = ""
Public Property NoSerieCertificado As String
Public Property SelloCFDi As String = ""
Public Property SelloSAT As String = ""
@@ -7694,7 +7663,7 @@ Namespace Modelos
End Set
End Property
- Public Property CveContratoSecciones As String
+ Public Property CveContratoSecciones As String = ""
Public Property CveEstatus As Integer
Public Property GenerarPDFFactura As Boolean = False
#End Region
diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb
index 644e8ed38..f0f2001cf 100644
--- a/App_Code/modExtensiones.vb
+++ b/App_Code/modExtensiones.vb
@@ -275,8 +275,8 @@ Namespace Extensiones
Public Function GetTagValue(Obj As String, tag As String) As String
Try
- Dim Regex = New Regex($"<{tag}>(.*){tag}>")
- Dim match = Regex.Match(Obj)
+ Dim Regex As New Regex($"<{tag}>(.*){tag}>")
+ Dim match As RegularExpressions.Match = Regex.Match(Obj)
Return match.Groups(1).ToString()
Catch ex As Exception
Return ""
@@ -461,7 +461,7 @@ Namespace Extensiones
Dim Plus As String = ClsPaginas.NowADS().Ticks.ToString
Dim headerclas As String = ""
- Dim showalert = True
+ Dim showalert As Boolean = True
Mensaje = Mensaje.Replace("'"c, "\'").Replace(vbCrLf, "").Replace("""", "\'").Replace(vbLf, " ")
JSBtnAceptar = JSBtnAceptar.Replace("'"c, "\'")
Dim onEscape As String = ""
@@ -823,7 +823,7 @@ Namespace Extensiones
End Function
- Public Function Texto2Letras(ByVal Importe As Double, Optional CveMoneda As Integer = 1) As String
+ Public Function Texto2Letras(ByVal Importe As Decimal, Optional CveMoneda As Integer = 1) As String
Dim Moneda, AbrevMoneda As String
Select Case CveMoneda
Case 2 : Moneda = "Dólares" : AbrevMoneda = "USD"
@@ -1171,7 +1171,7 @@ Namespace Extensiones
Public Function FiltraPorIndices(dt As DataTable, Inicio As Integer, Fin As Integer) As DataTable
Dim TmpDt As DataTable = dt.Clone()
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
- For i = Inicio To Fin
+ For i As Integer = Inicio To Fin
Dim Row As DataRow = TmpDt.NewRow
Row.ItemArray = dt.Rows(i).ItemArray
TmpDt.Rows.Add(Row)
@@ -1215,7 +1215,7 @@ Namespace Extensiones
Dim Query As New StringBuilder
For Each groupitem As String In item
row(groupitem) = GroupRow(groupitem)
- Dim coltipo = TmpDt.Columns(groupitem).DataType.ToString().ToUpper
+ Dim coltipo As String = TmpDt.Columns(groupitem).DataType.ToString().ToUpper
If GroupRow.IsNull(groupitem) Then
Query.AppendFormat("{0} {1} IS NULL", prefix, groupitem)
Else
@@ -1264,7 +1264,7 @@ Namespace Extensiones
End If
If indexgrupo = 2 Then
Dim query2 As New StringBuilder
- Dim coltipo = TmpDt.Columns(item(0)).DataType.ToString().ToUpper
+ Dim coltipo As String = TmpDt.Columns(item(0)).DataType.ToString().ToUpper
If GroupRow.IsNull(item(0)) Then
query2.AppendFormat("{0} {1} IS NULL", "", item(0))
Else
@@ -1289,7 +1289,7 @@ Namespace Extensiones
Next
TmpDt.AcceptChanges()
indexgrupo -= 1
- For i = 1 To indexgrupo Step 1
+ For i As Integer = 1 To indexgrupo Step 1
order2.AppendFormat("GroupADS{0},", i)
Next
order2.Append("GroupADSType")
@@ -1417,8 +1417,8 @@ Namespace Extensiones
End Function
- Public Function SUM(DT As DataTable, Campo As String, Optional ByVal Filtro As String = "") As Double
- Return If(DT IsNot Nothing, DT.Compute(String.Format("SUM({0})", Campo), Filtro).ToString.ToDouble, 0)
+ Public Function SUM(DT As DataTable, Campo As String, Optional ByVal Filtro As String = "") As Decimal
+ Return If(DT IsNot Nothing, DT.Compute(String.Format("SUM({0})", Campo), Filtro).ToString.ToDecimal, 0)
End Function
Public Function SUMD(DT As DataTable, Campo As String, Optional ByVal Filtro As String = "") As Decimal
@@ -1713,7 +1713,7 @@ Namespace Extensiones
name = name.ToLower()
Dim headerCells As TableCellCollection = Nothing
If gv.Columns.Count > 0 Then
- For i = 0 To gv.Columns.Count - 1 'Si las columnas son autogeneradas, el número de columnas siempre es 0
+ For i As Integer = 0 To gv.Columns.Count - 1 'Si las columnas son autogeneradas, el número de columnas siempre es 0
Dim col = gv.Columns(i)
If TypeOf col Is BoundField Then
Dim field As BoundField = CType(col, BoundField)
@@ -1783,7 +1783,7 @@ Namespace Extensiones
Dim Folio, Observacion, UsuarioRegistro, TextoImporte, PagueseA, Ruta, Banco, NumCuenta, AbonoCuenta, SubProyecto, NotificarA, RefCrediproveedor As String
Dim FechaExpedicion As Date = ClsPaginas.NowADS()
- Dim Importe As Double
+ Dim Importe As Decimal
Dim tCveEmpresa As Integer = tEmpresa.CveEmpresa
Dim CveTipoTransaccion, CveProveedor, CvePersonal As Integer
Dim ObjIE As New ClsBancos()
@@ -1994,13 +1994,13 @@ Namespace Extensiones
Dim htw1 As New HtmlTextWriter(sw1)
GridView.RenderControl(htw1)
- Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
+ Dim options As HtmlLoadOptions = GemBox.Spreadsheet.LoadOptions.HtmlDefault
- Dim htmlStream1 = New MemoryStream(options.Encoding.GetBytes(sw1.ToString()))
+ Dim htmlStream1 As New MemoryStream(options.Encoding.GetBytes(sw1.ToString()))
htmlStream1.Position = 0
Dim sr1 As New StreamReader(htmlStream1)
- Dim myStr1 = sr1.ReadToEnd()
+ Dim myStr1 As String = sr1.ReadToEnd()
sr1.Dispose()
htmlStream1.Dispose()
sw1.Dispose()
@@ -2009,7 +2009,7 @@ Namespace Extensiones
HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "")
- Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto))
+ Dim htmlStream5 As New MemoryStream(options.Encoding.GetBytes(HtmlCompleto))
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet)
@@ -2023,13 +2023,13 @@ Namespace Extensiones
Dim TotalRowFooter As Integer = 2
- Dim worksheet = excel.Worksheets(0)
+ Dim worksheet As ExcelWorksheet = excel.Worksheets(0)
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
- Dim celdasConTexto = worksheet.GetUsedCellRange(True)
+ Dim celdasConTexto As CellRange = worksheet.GetUsedCellRange(True)
If celdasConTexto Is Nothing Then Exit Sub 'No se recuperaron datos, salir de sin guardar porque soltará error
celdasConTexto.Style.Font.Name = "Calibri Light"
- Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
+ Dim RangoNombreEmpresa As CellRange = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
RangoNombreEmpresa.Merged = True
RangoNombreEmpresa.Value = Usuario.Empresa.Empresa
RangoNombreEmpresa.Style.Font.Size = 18 * 20
@@ -2038,7 +2038,7 @@ Namespace Extensiones
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
- Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
+ Dim RangoTitulo As CellRange = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
RangoTitulo.Style.Font.Size = 20 * 20
@@ -2047,7 +2047,7 @@ Namespace Extensiones
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
If DatoTituloExtra.Length > 0 Then
- Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(TotalRowHeader, celdasConTexto.FirstColumnIndex, TotalRowHeader, celdasConTexto.LastColumnIndex)
+ Dim RangoDatoTituloExtra As CellRange = worksheet.Cells.GetSubrangeAbsolute(TotalRowHeader, celdasConTexto.FirstColumnIndex, TotalRowHeader, celdasConTexto.LastColumnIndex)
RangoDatoTituloExtra.Merged = True
RangoDatoTituloExtra.Value = DatoTituloExtra
RangoDatoTituloExtra.Style.Font.Size = 20 * 20
@@ -2062,7 +2062,7 @@ Namespace Extensiones
Dim Arreglo As String() = DatosFiltros.Split("|"c)
worksheet.Rows.InsertEmpty(TotalRowHeader, Arreglo.Count)
For Each TextoFiltro As String In Arreglo
- Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(TotalRowHeader, celdasConTexto.FirstColumnIndex, TotalRowHeader, celdasConTexto.LastColumnIndex)
+ Dim RangoDatoTituloExtra As CellRange = worksheet.Cells.GetSubrangeAbsolute(TotalRowHeader, celdasConTexto.FirstColumnIndex, TotalRowHeader, celdasConTexto.LastColumnIndex)
RangoDatoTituloExtra.Merged = True
RangoDatoTituloExtra.Value = TextoFiltro
RangoDatoTituloExtra.Style.Font.Size = 12 * 20
@@ -2076,7 +2076,7 @@ Namespace Extensiones
' TotalRowHeader += 2
- For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
+ For i As Integer = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
worksheet.Rows(TotalRowHeader).Cells(i).Style.Font.Size = 12 * 20
worksheet.Rows(TotalRowHeader).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
@@ -2114,21 +2114,18 @@ Namespace Extensiones
End If
- For I = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
+ For I As Integer = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
If I > 0 Then
-
If 1 = 1 Then
worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00"
Else
worksheet.Columns(I + 1).Style.NumberFormat = "#,##"
End If
-
Try
worksheet.Columns(I).AutoFit(1)
Catch ex As Exception
End Try
-
End If
Next
@@ -2148,8 +2145,8 @@ Namespace Extensiones
'excel.Worksheets.Add(NombreTabla)
- Dim workbookDTExtra = New ExcelFile
- Dim worksheetDTExtra = workbookDTExtra.Worksheets.Add(NombreTabla)
+ Dim workbookDTExtra As New ExcelFile
+ Dim worksheetDTExtra As ExcelWorksheet = workbookDTExtra.Worksheets.Add(NombreTabla)
worksheetDTExtra.InsertDataTable(DTExtra,
@@ -2161,7 +2158,7 @@ Namespace Extensiones
- Dim columnCount = worksheetDTExtra.CalculateMaxUsedColumns()
+ Dim columnCount As Integer = worksheetDTExtra.CalculateMaxUsedColumns()
For i As Integer = 0 To columnCount - 1
worksheetDTExtra.Columns(i).AutoFit(1, worksheetDTExtra.Rows(1), worksheetDTExtra.Rows(worksheetDTExtra.Rows.Count - 1))
worksheetDTExtra.Cells(0, i).Style.FillPattern.SetSolid(Drawing.ColorTranslator.FromHtml("#4b77be"))
@@ -2370,21 +2367,21 @@ Namespace Extensiones
GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet)
Dim excel As GemBox.Spreadsheet.ExcelFile
- Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault
- Using htmlStream = New MemoryStream(options.Encoding.GetBytes(sw.ToString()))
+ Dim options As HtmlLoadOptions = GemBox.Spreadsheet.LoadOptions.HtmlDefault
+ Using htmlStream As New MemoryStream(options.Encoding.GetBytes(sw.ToString()))
excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream, options)
If Usuario IsNot Nothing Then
Dim TotalRowHeader As Integer = 8
Dim TotalRowFooter As Integer = 2
- Dim worksheet = excel.Worksheets(0)
+ Dim worksheet As ExcelWorksheet = excel.Worksheets(0)
worksheet.Name = ValidFileName(NombreArchivoXLSx, 31)
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
- Dim celdasConTexto = worksheet.GetUsedCellRange(True)
+ Dim celdasConTexto As CellRange = worksheet.GetUsedCellRange(True)
celdasConTexto.Style.Font.Name = "Calibri Light"
celdasConTexto.Style.Borders = Nothing
- Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
+ Dim RangoNombreEmpresa As CellRange = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
RangoNombreEmpresa.Merged = True
RangoNombreEmpresa.Value = Usuario.Empresa.Empresa
RangoNombreEmpresa.Style.Font.Size = 18 * 20
@@ -2392,7 +2389,7 @@ Namespace Extensiones
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
- Dim RangoFiltros = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
+ Dim RangoFiltros As CellRange = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
RangoFiltros.Merged = True
RangoFiltros.Value = Filtros
RangoFiltros.Style.Font.Size = 15 * 20
@@ -2400,7 +2397,7 @@ Namespace Extensiones
RangoFiltros.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
RangoFiltros.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
- Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
+ Dim RangoTitulo As CellRange = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
RangoTitulo.Style.Font.Size = 20 * 20
@@ -2408,7 +2405,7 @@ Namespace Extensiones
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
- Dim RangoColTitulos = worksheet.Cells.GetSubrangeAbsolute(8, celdasConTexto.FirstColumnIndex, 8, celdasConTexto.LastColumnIndex)
+ Dim RangoColTitulos As CellRange = worksheet.Cells.GetSubrangeAbsolute(8, celdasConTexto.FirstColumnIndex, 8, celdasConTexto.LastColumnIndex)
RangoColTitulos.Style.Font.Size = 12 * 20
RangoColTitulos.Style.Font.Name = "Calibri"
RangoColTitulos.Style.Font.Weight = GemBox.Spreadsheet.ExcelFont.BoldWeight
@@ -2417,7 +2414,7 @@ Namespace Extensiones
RangoColTitulos.Style.FillPattern.SetSolid(GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190))
RangoColTitulos.Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
- For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
+ For i As Integer = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
Try
worksheet.Columns(i).AutoFit(0.95)
Catch ex As Exception
@@ -2457,7 +2454,7 @@ Namespace Extensiones
If Dt.TableName Is Nothing Then Dt.TableName = NombreArchivoXLSx
Dim excel As New GemBox.Spreadsheet.ExcelFile
- Dim item = excel.Worksheets.Add(ValidFileName(Dt.TableName, 31))
+ Dim item As ExcelWorksheet = excel.Worksheets.Add(ValidFileName(Dt.TableName, 31))
item.InsertDataTable(Dt, New InsertDataTableOptions() With
{
@@ -2470,14 +2467,14 @@ Namespace Extensiones
Dim TotalRowHeader As Integer = 8
Dim TotalRowFooter As Integer = 2
- Dim worksheet = excel.Worksheets(0)
+ Dim worksheet As ExcelWorksheet = excel.Worksheets(0)
'worksheet.Name = ValidFileName(NombreArchivoXLSx, 31)
worksheet.Rows.InsertEmpty(0, TotalRowHeader)
- Dim celdasConTexto = worksheet.GetUsedCellRange(True)
+ Dim celdasConTexto As CellRange = worksheet.GetUsedCellRange(True)
celdasConTexto.Style.Font.Name = "Calibri Light"
celdasConTexto.Style.Borders = Nothing
- Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
+ Dim RangoNombreEmpresa As CellRange = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex)
RangoNombreEmpresa.Merged = True
RangoNombreEmpresa.Value = Usuario.Empresa.Empresa
RangoNombreEmpresa.Style.Font.Size = 18 * 20
@@ -2485,7 +2482,7 @@ Namespace Extensiones
RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
- Dim RangoFiltros = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
+ Dim RangoFiltros As CellRange = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex)
RangoFiltros.Merged = True
RangoFiltros.Value = Filtros
RangoFiltros.Style.Font.Size = 15 * 20
@@ -2493,7 +2490,7 @@ Namespace Extensiones
RangoFiltros.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left
RangoFiltros.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
- Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
+ Dim RangoTitulo As CellRange = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex)
RangoTitulo.Merged = True
RangoTitulo.Value = Titulo
RangoTitulo.Style.Font.Size = 20 * 20
@@ -2501,7 +2498,7 @@ Namespace Extensiones
RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center
RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center
- Dim RangoColTitulos = worksheet.Cells.GetSubrangeAbsolute(8, celdasConTexto.FirstColumnIndex, 8, celdasConTexto.LastColumnIndex)
+ Dim RangoColTitulos As CellRange = worksheet.Cells.GetSubrangeAbsolute(8, celdasConTexto.FirstColumnIndex, 8, celdasConTexto.LastColumnIndex)
RangoColTitulos.Style.Font.Size = 12 * 20
RangoColTitulos.Style.Font.Name = "Calibri"
RangoColTitulos.Style.Font.Weight = GemBox.Spreadsheet.ExcelFont.BoldWeight
@@ -2510,7 +2507,7 @@ Namespace Extensiones
RangoColTitulos.Style.FillPattern.SetSolid(GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190))
RangoColTitulos.Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)
- For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
+ For i As Integer = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex
Try
worksheet.Columns(i).AutoFit(0.95)
Catch ex As Exception
@@ -2864,21 +2861,21 @@ Namespace Extensiones
Dim pdfDoc As New PdfDocument(New PdfWriter(HttpContext.Current.Response.OutputStream))
Dim document As New Document(pdfDoc, PageSize.A4)
document.SetMargins(10.0F, 10.0F, 0.0F, 10.0F)
- Dim request = HttpContext.Current.Request
- Dim baseUrl = request.Url.OriginalString.Replace(request.Url.PathAndQuery, "") + request.ApplicationPath
+ Dim request As HttpRequest = HttpContext.Current.Request
+ Dim baseUrl As String = request.Url.OriginalString.Replace(request.Url.PathAndQuery, "") + request.ApplicationPath
Dim properties As New ConverterProperties()
properties.SetBaseUri(baseUrl) 'Se tiene que usar la URL en vez del BaseDirectory para que cargue correctamente los StyleBundle que son paths virtuales en el servidor
properties.SetFontProvider(New DefaultFontProvider(True, False, False))
'SECCIÓN ENCABEZADO REPORTE
- Dim table = New Element.Table(UnitValue.CreatePercentArray(New Single() {10, 50, 40})).UseAllAvailableWidth()
+ Dim table As Element.Table = New Element.Table(UnitValue.CreatePercentArray(New Single() {10, 50, 40})).UseAllAvailableWidth()
Dim Imagen As New FileInfo(String.Format("{0}/Logo.png", usuario.Empresa.Ruta))
If Imagen.Exists Then
Dim Ruta As String = String.Format("{0}/Logo.png", usuario.Empresa.Ruta)
Using sr As New StreamReader(Ruta)
Dim ms As New MemoryStream()
sr.BaseStream.CopyTo(ms)
- Dim logo = New Element.Image(iText.IO.Image.ImageDataFactory.Create(Imagen.FullName))
+ Dim logo As New Element.Image(iText.IO.Image.ImageDataFactory.Create(Imagen.FullName))
table.AddCell(New Element.Cell(2, 1).Add(logo.SetAutoScale(True)).SetVerticalAlignment(VerticalAlignment.MIDDLE))
End Using
Else
@@ -2973,13 +2970,13 @@ Namespace Extensiones
Public Function ToBase64Encode(ByVal plainText As String) As String
- Dim plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText)
+ Dim plainTextBytes As Byte() = System.Text.Encoding.UTF8.GetBytes(plainText)
Return System.Convert.ToBase64String(plainTextBytes)
End Function
Public Function ToBase64Decode(ByVal base64EncodedData As String) As String
- Dim base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData)
+ Dim base64EncodedBytes As Byte() = System.Convert.FromBase64String(base64EncodedData)
Return System.Text.Encoding.UTF8.GetString(base64EncodedBytes)
End Function
Public Function DecriptaConexion() As String
@@ -3169,7 +3166,7 @@ Namespace Extensiones
End Function
Public Function EncodeGeocerca(GeoCerca As String) As String
- Dim Str = New StringBuilder
+ Dim Str As New StringBuilder
Dim PrimerSplit As Boolean = True
GeoCerca = GeoCerca.Replace("POLYGON ((", "").Replace("))", "")
Dim S() As String = GeoCerca.Split(","c)
@@ -3186,7 +3183,7 @@ Namespace Extensiones
End Function
Public Function Encode(lats As Double, lngs As Double) As String
- Dim str = New StringBuilder()
+ Dim str As New StringBuilder()
Dim encodeDiff = DirectCast(Function(diff) As Integer
Dim shifted As Integer = diff << 1
If diff < 0 Then
@@ -3212,7 +3209,7 @@ Namespace Extensiones
End Function
Public Function EncodeGeocercaString(GeoCerca As String) As String
- Dim Str = New StringBuilder
+ Dim Str As New StringBuilder
Dim PrimerSplit As Boolean = True
GeoCerca = GeoCerca.Replace("POLYGON ((", "").Replace("))", "")
Dim S() As String = GeoCerca.Split(","c)
diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx
index d40007c3b..3e8039f23 100644
--- a/Ashx/CargaEventos.ashx
+++ b/Ashx/CargaEventos.ashx
@@ -117,6 +117,8 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
Dim ColorIndex As Integer = 0
+
+
If DtTempSubproyectos.Rows.Count > 0 Then
For Each drow As DataRow In DtTempSubproyectos.Rows
@@ -140,9 +142,9 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
Dim EsCoordinador As Boolean = False
+ Dim usuarioActual_ As Usuario = UsuarioActual(context)
If context IsNot Nothing AndAlso CveOS = -2 Then
- Dim usuario As Usuario = UsuarioActual(context)
- If usuario.TienePermisoProceso(348) Then
+ If usuarioActual_.TienePermisoProceso(348) Then
EsCoordinador = True
End If
End If
@@ -234,6 +236,22 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.backgroundColor = If(cevent.backgroundColor.Trim = "", "#1BBC9B", cevent.backgroundColor.Trim)
End If
+
+ If usuarioActual_.Empresa.Funcionalidad(578) = "1" Then
+
+ If dr("TipoEstatusOS").ToString.ToEntero.Contiene(1, 2, 3) Then
+ cevent.backgroundColor = "#006699"
+ ElseIf dr("TipoEstatusOS").ToString.ToEntero.Contiene(4) Then
+ cevent.backgroundColor = "#025716"
+ ElseIf dr("TipoEstatusOS").ToString.ToEntero.Contiene(5) Then
+ cevent.backgroundColor = "#730505"
+ Else
+ cevent.backgroundColor = "#006699"
+ End If
+
+
+ End If
+
'VERIFICAMOS SI TIENE O NO RECURRENCIA
If Not cevent.recurrenciatipo > 0 Then
@@ -407,4 +425,4 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
End Property
-End Class
\ No newline at end of file
+End Class
diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx
index 8a967d3cf..24e9e93bf 100644
--- a/Ashx/E119.ashx
+++ b/Ashx/E119.ashx
@@ -142,9 +142,12 @@ Public Class E119 : Implements IHttpHandler
Catch ex As Exception
context.Response.ContentType = "text/html"
- retorno = ex.ToString()
- ex.GuardaLog(ex.ToString())
+ Dim respuesta As New AuthMessage
+ respuesta.ErrorMessage = New ResponseMsgError() With {.message = "La solicitud no se pudo procesar."}
+ respuesta.IsSucces = False
+ respuesta.StatusCode = 200
+ retorno = JsonConvert.SerializeObject(respuesta.ErrorMessage)
context.Response.Write(retorno)
End Try
End Sub
@@ -343,154 +346,141 @@ Public Class E119 : Implements IHttpHandler
If JsonRequest Is Nothing Then
TieneError = True
End If
+ Else
+ TieneError = True
End If
End Using
End If
If TieneError Then
+ RespuestaError.message = "No se pudo procesar la solicitud - Formato mal formado"
context.Response.StatusCode = 200
- Return JsonConvert.SerializeObject("xx")
+ Return JsonConvert.SerializeObject(RespuestaError)
+
End If
If Not TieneError Then
Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
- Dim ObjFactura As Modelos.Factura
+ Dim ObjFactura As Modelos.Factura = Nothing
Dim Resp As New Modelos.Factura.MMensajeFactura
If Usuario IsNot Nothing Then
- End If
-
- Dim ObjClientes As New ClsClientes()
- Dim ObjInventario As New ClsInventarios(ObjClientes.IniciaTransacSQL())
-
- Dim CveSubProyecto, CveCliente, CveMoneda, CvePS As Integer
- Dim Cantidad, PU, Descuento As Decimal
- Dim Obs As String = ""
- CveSubProyecto = 12659 ' fijo Ecommerce
- CveCliente = 0
- CveMoneda = 1
- Descuento = 0
- Dim RFC As String = If(JsonRequest("billing") Is Nothing, "", JsonRequest("billing")("first_name").ToString())
- Dim NombreCliente As String = If(JsonRequest("billing") Is Nothing, "", JsonRequest("billing")("first_name").ToString() & " " & JsonRequest("billing")("last_name").ToString())
- 'BUSCAR SI ESTÁ REGISTRADO EL CLIENTE
- If ObjClientes.GetClientes(-1, "-1", "-1", "-1", RFC, "-1", "-1", -1, CveEmpresa, 1, TipoCliente:=-1, TopSelect:=1) Then
- If ObjClientes.DtResultados.Rows.Count > 0 Then
- 'Resp.TieneError = False
- CveCliente = ObjClientes.CveCliente
- 'Resp.Mensajes.Add("El RFC ya existe en el sistema")
+ Dim ObjClientes As New ClsClientes()
+ Dim ObjInventario As New ClsInventarios(ObjClientes.IniciaTransacSQL())
+ Dim CveSubProyecto, CveCliente, CveMoneda, CvePS As Integer
+ Dim Cantidad, PU, Descuento As Decimal
+ Dim Obs As String = ""
+ CveSubProyecto = 12659 ' fijo Ecommerce
+ CveCliente = 0
+ CveMoneda = 1
+ Descuento = 0
+ Dim RFC As String = If(JsonRequest("billing") Is Nothing, "", JsonRequest("billing")("first_name").ToString())
+ Dim NombreCliente As String = If(JsonRequest("billing") Is Nothing, "", JsonRequest("billing")("first_name").ToString() & " " & JsonRequest("billing")("last_name").ToString())
+ 'BUSCAR SI ESTÁ REGISTRADO EL CLIENTE
+ If ObjClientes.GetClientes(-1, "-1", "-1", "-1", RFC, "-1", "-1", -1, CveEmpresa, 1, TipoCliente:=-1, TopSelect:=1) Then
+ If ObjClientes.DtResultados.Rows.Count > 0 Then
+ 'Resp.TieneError = False
+ CveCliente = ObjClientes.CveCliente
+ 'Resp.Mensajes.Add("El RFC ya existe en el sistema")
+ End If
End If
- End If
- If CveCliente = 0 Then
- ' 'DATOS DE BILLING
- If JsonRequest("billing") IsNot Nothing Then
- Dim CveEstado As Integer = -1
- Dim Direccion As String = If(JsonRequest("billing")("address_1") Is Nothing, "", JsonRequest("billing")("address_1").ToString())
- Dim NumExt As String = ""
- Dim NumInt As String = ""
- Dim Colonia As String = ""
- Dim Ciudad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString())
- Dim Localidad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString())
- Dim CP As String = If(JsonRequest("billing")("postcode") Is Nothing, "", JsonRequest("billing")("postcode").ToString())
- Dim Telefono As String = If(JsonRequest("billing")("phone") Is Nothing, "", JsonRequest("billing")("phone").ToString())
- Dim Correo As String = If(JsonRequest("billing")("email") Is Nothing, "", JsonRequest("billing")("email").ToString())
- Dim Estado As String = If(JsonRequest("billing")("state") Is Nothing, "", JsonRequest("billing")("state").ToString())
- If Not String.IsNullOrEmpty(Estado) Then
- CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero()
- If CveEstado <= 0 Then 'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
+ If CveCliente = 0 Then
+ ' 'DATOS DE BILLING
+ If JsonRequest("billing") IsNot Nothing Then
+ Dim CveEstado As Integer = -1
+ Dim Direccion As String = If(JsonRequest("billing")("address_1") Is Nothing, "", JsonRequest("billing")("address_1").ToString())
+ Dim NumExt As String = ""
+ Dim NumInt As String = ""
+ Dim Colonia As String = ""
+ Dim Ciudad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString())
+ Dim Localidad As String = If(JsonRequest("billing")("city") Is Nothing, "", JsonRequest("billing")("city").ToString())
+ Dim CP As String = If(JsonRequest("billing")("postcode") Is Nothing, "", JsonRequest("billing")("postcode").ToString())
+ Dim Telefono As String = If(JsonRequest("billing")("phone") Is Nothing, "", JsonRequest("billing")("phone").ToString())
+ Dim Correo As String = If(JsonRequest("billing")("email") Is Nothing, "", JsonRequest("billing")("email").ToString())
+ Dim Estado As String = If(JsonRequest("billing")("state") Is Nothing, "", JsonRequest("billing")("state").ToString())
+ If Not String.IsNullOrEmpty(Estado) Then
+ CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero()
+ If CveEstado <= 0 Then 'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
+ CveEstado = 26
+ End If
+ Else
CveEstado = 26
End If
- Else
- CveEstado = 26
- End If
- If ObjClientes.AgregarClienteNoFrecuente(NombreCliente, Direccion, NumExt, NumInt, Colonia, Localidad, Ciudad, CveEstado, RFC, CP, Telefono, Correo, CveSubProyecto, CveUsuario, CveEmpresa, "", -1, -1) Then
- If ObjClientes.DtResultados.Rows.Count > 0 Then
- CveCliente = ObjClientes.DtResultados(0)("CveCliente").ToString().ToEntero()
+ If ObjClientes.AgregarClienteNoFrecuente(NombreCliente, Direccion, NumExt, NumInt, Colonia, Localidad, Ciudad, CveEstado, RFC, CP, Telefono, Correo, CveSubProyecto, CveUsuario, CveEmpresa, "", -1, -1) Then
+ If ObjClientes.DtResultados.Rows.Count > 0 Then
+ CveCliente = ObjClientes.DtResultados(0)("CveCliente").ToString().ToEntero()
+ End If
End If
End If
+
End If
- End If
+ Try
- Try
+ ObjFactura = Modelos.Factura.CrearVentaNueva(Usuario, CveSubProyecto, CveCliente, CveMoneda, "Rem")
+ Dim ListaPS As JArray = JArray.Parse(JsonRequest("line_items").ToString())
+ Dim Consec As Integer = 1
+ For Each JsonPS As JObject In ListaPS
+ Cantidad = JsonPS("quantity").ToString.ToDecimal()
+ PU = JsonPS("price").ToString.ToDecimal()
+ CvePS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa, Codigo:=JsonPS("sku").ToString()).FiltroPrimeroValor("CvePS").ToEntero()
- ObjFactura = Modelos.Factura.CrearVentaNueva(Usuario, CveSubProyecto, CveCliente, CveMoneda, "Rem")
- Dim ListaPS As JArray = JArray.Parse(JsonRequest("line_items").ToString())
- Dim Consec As Integer = 1
- For Each JsonPS As JObject In ListaPS
- Cantidad = JsonPS("quantity").ToString.ToDecimal()
- PU = JsonPS("price").ToString.ToDecimal()
- CvePS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa, Codigo:=JsonPS("sku").ToString()).FiltroPrimeroValor("CvePS").ToEntero()
+ ObjFactura.AgregarPS(CvePS, Cantidad, PU, Descuento, Obs, CveSubProyecto:=CveSubProyecto)
- ObjFactura.AgregarPS(CvePS, Cantidad, PU, Descuento, Obs, CveSubProyecto:=CveSubProyecto)
-
- ''VALIDAR QUE SEA EL MISMO PRODUCTO
- If CvePS <= 0 Then
- TieneError = True
- 'Retorno.Mensajes.Add(String.Format("No se encontró el producto: {0}", JsonPS("name").ToString()))
- Exit For
- End If
-
- ''VALIDA EXISTENCIA ANTES DE GENERAR LA FACTURA
- 'If ObjFactura.TipoDocto = "Ing" AndAlso DrPS("CveTipoPS").ToString() = "2" Then
- ' Dim Existencia As Decimal = ObjInventarios.GetExistenciasPS(DrPS("CvePS").ToString.ToEntero, DrPS("CveUnidadMedida").ToString.ToEntero, UsuarioActual.CveEmpresa, ObjFactura.CveAlmacen, CveSubProyecto:=ObjFactura.CveSubProyecto, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), ExcluyeAdelantado:=1, PendientePorSurtir:=1, RestringirAlmacenes:=1, ExcluyeApartados:=-1)
-
- ' If Cantidad > Existencia Then
- ' Retorno.TieneError = True
- ' Retorno.Mensajes.Add(String.Format("No hay existencia suficiente para este producto: {0}, cuenta con : {1}", DrPS("PSCodigo").ToString(), Existencia))
- ' Exit For
- ' End If
- 'End If
- Consec += 1
- Next
+ ''VALIDAR QUE SEA EL MISMO PRODUCTO
+ If CvePS <= 0 Then
+ TieneError = True
+ 'Retorno.Mensajes.Add(String.Format("No se encontró el producto: {0}", JsonPS("name").ToString()))
+ Exit For
+ End If
+ Consec += 1
+ Next
- ObjFactura.CalculaTotales()
+ ObjFactura.CalculaTotales()
- If ObjFactura IsNot Nothing Then
- Resp = ObjFactura.EmitirFactura(False, Transac:=ObjClientes.IniciaTransacSQL())
+ If ObjFactura IsNot Nothing Then
+ Resp = ObjFactura.EmitirFactura(False, Transac:=ObjClientes.IniciaTransacSQL())
- If Resp.CveVenta > 0 Then
- Respuesta.status = "success"
- Respuesta.data = Resp.SerieFolio
+ If Resp.CveVenta > 0 Then
+ Respuesta.status = "success"
+ Respuesta.data = Resp.SerieFolio
+ Else
+ TieneError = True
+ End If
+
+ If TieneError Then
+ Dim sb As New StringBuilder()
+ For Each msg As String In Resp.Mensajes
+ sb.AppendFormat("{0}. ", msg)
+ Next
+ RespuestaError.message = sb.ToString()
+ End If
Else
TieneError = True
- End If
-
- If TieneError Then
Dim sb As New StringBuilder()
For Each msg As String In Resp.Mensajes
sb.AppendFormat("{0}. ", msg)
Next
RespuestaError.message = sb.ToString()
End If
- Else
+
+ Catch ex As Exception
TieneError = True
- Dim sb As New StringBuilder()
- For Each msg As String In Resp.Mensajes
- sb.AppendFormat("{0}. ", msg)
- Next
- RespuestaError.message = sb.ToString()
+ End Try
+
+ If TieneError Then
+ ObjClientes.RollBack()
+ ObjClientes.Dispose()
+ ObjInventario.Dispose()
+ Else
+ ObjClientes.Commit()
+ ObjClientes.Dispose()
+ ObjInventario.Dispose()
End If
-
- Catch ex As Exception
- TieneError = True
- End Try
-
- If TieneError Then
- ObjClientes.RollBack()
- ObjClientes.Dispose()
- ObjInventario.Dispose()
- Else
- ObjClientes.Commit()
- ObjClientes.Dispose()
- ObjInventario.Dispose()
-
+ If ObjFactura IsNot Nothing Then ObjFactura.Dispose()
End If
-
- If ObjFactura IsNot Nothing Then ObjFactura.Dispose()
- 'End If
-
End If
If TieneError Then
diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx
index 70cfe6ec9..f223e5237 100644
--- a/Ashx/SIGFacturacion.ashx
+++ b/Ashx/SIGFacturacion.ashx
@@ -63,7 +63,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
'EnviarCorreoFactura(New Modelos.Factura(Usuario, 844966, 1, context.ModExtensiones.DirectorioBaseEmpresas), Usuario)
If String.IsNullOrEmpty(pFechaI) AndAlso String.IsNullOrEmpty(pFechaF) Then
- Dim FechaReferencia = ClsPaginas.NowADS()
+ Dim FechaReferencia As Date = ClsPaginas.NowADS()
If FechaReferencia.DayOfWeek = DayOfWeek.Sunday Then
Dim Sabado = FechaReferencia.AddDays(-1)
Dim DomingoAnterior = FechaReferencia.AddDays(-7)
@@ -273,7 +273,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
End If
ObjFolios.Dispose()
- Dim ObjFactura = New Modelos.Factura(UsuarioActual)
+ Dim ObjFactura As New Modelos.Factura(UsuarioActual)
ObjFactura.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.TextoLimpio
ObjFactura.Serie = Serie
ObjFactura.Folio = Folio.ToEntero()
@@ -361,12 +361,12 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
ObjFactura.DtRemisionesPS = DTRemisionesPS
- Dim TotalImporte As Decimal = ObjFactura.DtDetalle.SUM("TotalImporte").ToDecimal()
- Dim ImporteIVA As Decimal = ObjFactura.DtDetalle.SUM("ImporteIVA").ToDecimal()
- Dim ImporteRetIVA As Decimal = ObjFactura.DtDetalle.SUM("ImporteRetIVA").ToDecimal()
- Dim ImporteRetISR As Decimal = ObjFactura.DtDetalle.SUM("ImporteRetISR").ToDecimal()
- Dim ImporteIEPS As Decimal = ObjFactura.DtDetalle.SUM("ImporteIEPS").ToDecimal()
- Dim Descuento As Decimal = ObjFactura.DtDetalle.SUM("Descuento").ToDecimal()
+ Dim TotalImporte As Decimal = ObjFactura.DtDetalle.SUM("TotalImporte")
+ Dim ImporteIVA As Decimal = ObjFactura.DtDetalle.SUM("ImporteIVA")
+ Dim ImporteRetIVA As Decimal = ObjFactura.DtDetalle.SUM("ImporteRetIVA")
+ Dim ImporteRetISR As Decimal = ObjFactura.DtDetalle.SUM("ImporteRetISR")
+ Dim ImporteIEPS As Decimal = ObjFactura.DtDetalle.SUM("ImporteIEPS")
+ Dim Descuento As Decimal = ObjFactura.DtDetalle.SUM("Descuento")
Dim Amortizacion As Decimal = 0
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
@@ -530,7 +530,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Return Timbre
End Function
Private Function CreaDTDetalle(ByRef Retorno As Modelos.Factura.MMensajeFactura, UsuarioActual As Usuario, DtRemisionesPS As DataTable) As DataTable
- Dim TmpDT = New DataTable
+ Dim TmpDT As New DataTable
TmpDT.Columns.Add("CveVenta", GetType(Integer))
TmpDT.Columns.Add("Consec", GetType(Integer))
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
@@ -770,9 +770,9 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", ClsPaginas.UrlSitio, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
Try
- Using httpClient = New HttpClient()
+ Using httpClient As New HttpClient()
httpClient.Timeout = New TimeSpan(0, 15, 0)
- Using request = New HttpRequestMessage(HttpMethod.Get, Url)
+ Using request As New HttpRequestMessage(HttpMethod.Get, Url)
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO=100", CveEmpresa, DateTime.UtcNow.Ticks)))
Dim response = httpClient.SendAsync(request).Result
If response.StatusCode = Net.HttpStatusCode.OK Then
@@ -795,8 +795,8 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Dim Mail As String = ""
Dim MailCC As String = ""
- Dim ArchivoXML = ""
- Dim ArchivoPDF = ""
+ Dim ArchivoXML As String = ""
+ Dim ArchivoPDF As String = ""
Dim ArchivoPDFBytes As Byte() = Nothing
Dim ExistePDF As Boolean = False
Try
@@ -812,7 +812,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
If ObjFactura.CveClienteSucursal > 0 Then
If ObjCliente.GetSucursales(ObjFactura.CveCliente, ObjFactura.CveClienteSucursal) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
- Dim Correo = ObjCliente.DtResultados.Rows(0)("Correo").ToString
+ Dim Correo As String = ObjCliente.DtResultados.Rows(0)("Correo").ToString
If Correo.Trim.Length > 0 Then
Mail = Correo
End If
@@ -839,7 +839,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Dim Cuerpo As String = String.Empty
Dim ResultadoMail As Integer = 0
- Dim TipoComprobante = ""
+ Dim TipoComprobante As String = ""
If ObjFactura.TipoDocto = "Ing" Then TipoComprobante = "Factura"
If ObjFactura.TipoDocto = "Egs" Then TipoComprobante = "Nota de Crédito"
diff --git a/Ashx/SIGFacturacionCiclica.ashx b/Ashx/SIGFacturacionCiclica.ashx
index 8e5998a6a..d123a32f1 100644
--- a/Ashx/SIGFacturacionCiclica.ashx
+++ b/Ashx/SIGFacturacionCiclica.ashx
@@ -106,7 +106,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
If DTCicloComercial IsNot Nothing Then
For Each RowEmpresa As DataRow In DTCicloComercial.FiltraParametros("", DistinctColumns:={"CveEmpresa"}).Rows
Dim CveEmpresa As Integer = RowEmpresa("CveEmpresa").ToString().ToEntero()
- Dim UsuarioActual = ValidaUsuarioSistema(CveEmpresa)
+ Dim UsuarioActual As Usuario = ValidaUsuarioSistema(CveEmpresa)
If UsuarioActual IsNot Nothing Then
Retorno = EjecutarFacturacionMasiva(UsuarioActual, DTCicloComercial.FiltraParametros($"CveEmpresa = {CveEmpresa}"))
End If
@@ -158,7 +158,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
Private Function EmitirImprimir(UsuarioActual As Usuario, RowCiclo As DataRow) As Modelos.Factura.MMensajeFactura
Dim Resp As New Modelos.Factura.MMensajeFactura
- Dim ObjFactura = CreaObjetosVenta(UsuarioActual, RowCiclo)
+ Dim ObjFactura As Modelos.Factura = CreaObjetosVenta(UsuarioActual, RowCiclo)
If ObjFactura Is Nothing Then
Resp.Mensajes.Add("Ocurrió un error al procesar los datos de la Venta ")
@@ -181,7 +181,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
#Region "P R E P A R A - V E N T A"
Private Function CreaDTVentas() As DataTable
- Dim TmpDT = New DataTable
+ Dim TmpDT As New DataTable
TmpDT.Columns.Add("CveVenta", GetType(Integer))
TmpDT.Columns.Add("Consec", GetType(Integer))
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
@@ -218,7 +218,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
TmpDT.Columns.Add("Total", GetType(Decimal))
'Para uso del módulo contable
- TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
+ TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
TmpDT.Columns.Add("Proyecto", GetType(String))
@@ -270,7 +270,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
Return TmpDT
End Function
Private Function CreaObjetosVenta(UsuarioActual As Usuario, DR As DataRow) As Modelos.Factura
- Dim ObjFactura = New Modelos.Factura(UsuarioActual)
+ Dim ObjFactura As New Modelos.Factura(UsuarioActual)
Try
ObjFactura.DirectorioServidor = HttpContext.Current.Server.MapPath("/")
@@ -350,11 +350,11 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
objContratos.Dispose()
Dim DtR As DataRow
- ObjFactura.SubTotal = SUM(DtDetalle, "Total").ToDecimal
- ObjFactura.IVA = SUM(DtDetalle, "ImporteIVA").ToDecimal
- ObjFactura.RetIVA = SUM(DtDetalle, "ImporteRetIVA").ToDecimal
- ObjFactura.RetISR = SUM(DtDetalle, "ImporteRetISR").ToDecimal
- ObjFactura.IEPS = SUM(DtDetalle, "ImporteIEPS").ToDecimal
+ ObjFactura.SubTotal = SUM(DtDetalle, "Total")
+ ObjFactura.IVA = SUM(DtDetalle, "ImporteIVA")
+ ObjFactura.RetIVA = SUM(DtDetalle, "ImporteRetIVA")
+ ObjFactura.RetISR = SUM(DtDetalle, "ImporteRetISR")
+ ObjFactura.IEPS = SUM(DtDetalle, "ImporteIEPS")
ObjFactura.Total = ObjFactura.SubTotal + ObjFactura.IVA + ObjFactura.IEPS - (ObjFactura.RetIVA + ObjFactura.RetISR)
For Each row As DataRow In DtDetalle.Rows
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 1746f7e3f..b1442d461 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -3609,7 +3609,7 @@ Partial Class Bancos_IE
Dim Retorno As String = ""
If contextKey.ToDouble >= 0 Then
- Retorno = String.Format("---{0}---", contextKey.ToDouble.Texto2Letras(tCveMoneda))
+ Retorno = String.Format("---{0}---", contextKey.ToDecimal.Texto2Letras(tCveMoneda))
End If
Return Retorno
@@ -4387,7 +4387,7 @@ Partial Class Bancos_IE
BtnGuardar.Enabled = False
Else
TxtImporte.Text = DrOC("ImporteAnticipo").ToString.FormatoNumero
- TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDouble.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero)
+ TxtImporteLetra.Text = DrOC("ImporteAnticipo").ToString.ToDecimal.Texto2Letras(DrOC("CveMoneda").ToString.ToEntero)
ImporteOriginalDolaras = DrOC("ImporteAnticipo").ToString.ToDecimal
End If
@@ -4728,7 +4728,7 @@ Partial Class Bancos_IE
If ObjBancos.GetSolicitudesViaticos(CveSolicitudViatico, UsuarioActual.CveEmpresa) AndAlso ObjBancos.DtResultados.Rows.Count > 0 Then
TxtImporte.Text = ObjBancos.DtResultados.FiltroPrimeroValor("Importe").ToString.FormatoNumero
- TxtImporteLetra.Text = ObjBancos.DtResultados.FiltroPrimeroValor("Importe").ToString.ToDouble.Texto2Letras()
+ TxtImporteLetra.Text = ObjBancos.DtResultados.FiltroPrimeroValor("Importe").ToString.ToDecimal.Texto2Letras()
TxtObservaciones.Text = $"SOLICITUD DE VIÁTICOS - FOLIO {ObjBancos.DtResultados.FiltroPrimeroValor("Folio").ToString()}: {ObjBancos.DtResultados.FiltroPrimeroValor("Asunto").ToString()}."
End If
ObjBancos.Dispose()
@@ -4762,7 +4762,7 @@ Partial Class Bancos_IE
'TxtImporte.Attributes.Add("onkeyup", $"FormatoMoneda(this);ValidarCantidad(this,{UrlParametros("SALDO").ToString});")
TxtDevolución.Attributes.Add("onkeyup", $"FormatoMoneda(this);ValidarCantidadDev( {UrlParametros("SALDO").ToString});")
TxtOtrosIngresosEgresos.Attributes.Add("onkeyup", $"ValidarCantidadDev();")
- TxtImporteLetra.Text = UrlParametros("SALDO").ToString.ToDouble.Texto2Letras(UrlParametros("CVEMONEDA").ToString.ToEntero)
+ TxtImporteLetra.Text = UrlParametros("SALDO").ToString.ToDecimal.Texto2Letras(UrlParametros("CVEMONEDA").ToString.ToEntero)
CargaCliente(CveCliente)
'BuscarCliente()
@@ -4792,7 +4792,7 @@ Partial Class Bancos_IE
ImporteOriginalDevDin = UrlParametros("ORIGINAL").ToString.ToDecimal.RoundSQL(6)
TxtImporte.Text = UrlParametros("SALDO").ToString.FormatoNumero()
TxtImporte.Attributes.Add("onkeyup", $"FormatoMoneda(this);ValidarCantidad(this,{UrlParametros("SALDO").ToString});")
- TxtImporteLetra.Text = UrlParametros("SALDO").ToString.ToDouble.Texto2Letras(UrlParametros("CVEMONEDA").ToString.ToEntero)
+ TxtImporteLetra.Text = UrlParametros("SALDO").ToString.ToDecimal.Texto2Letras(UrlParametros("CVEMONEDA").ToString.ToEntero)
CargaProveedor(CveProveedor, "-1")
diff --git a/Bancos/ProveedoresCreditos.aspx.vb b/Bancos/ProveedoresCreditos.aspx.vb
index 99759eb43..4af9d468c 100644
--- a/Bancos/ProveedoresCreditos.aspx.vb
+++ b/Bancos/ProveedoresCreditos.aspx.vb
@@ -507,9 +507,9 @@ Partial Class Bancos_ProveedoresCreditos
GvV.DataSource = ObjBancos.DtResultados
End If
- TxtImporte.Text = ObjBancos.DtResultados.SUM("Total").ToString().ToDouble.Texto2Letras(CveMoneda)
+ TxtImporte.Text = ObjBancos.DtResultados.SUM("Total").ToString().ToDecimal.Texto2Letras(CveMoneda)
- TxtImporteLetra.Text = "---" & ObjBancos.DtResultados.SUM("Total").ToString().ToDouble.Texto2Letras(CveMoneda) & "---"
+ TxtImporteLetra.Text = "---" & TxtImporte.Text & "---"
ObjBancos.Dispose()
GvV.DataBind()
@@ -773,7 +773,7 @@ Partial Class Bancos_ProveedoresCreditos
Dim Dep As New ClsGenerales
If Dep.GetCuentasDepositos(CveProveedor:=CveProveedor) Then
- Dim Row = Dep.DtResultados.FiltroPrimero(String.Format("CveCuentaDeposito = {0}", DdlCuentaDeposito.SelectedValue.ToEntero))
+ Dim Row As DataRow = Dep.DtResultados.FiltroPrimero(String.Format("CveCuentaDeposito = {0}", DdlCuentaDeposito.SelectedValue.ToEntero))
If Row IsNot Nothing AndAlso Row("Estatus").ToString = "False" Then
Alert("La cuenta depósito del proveedor esta inactiva.", TipoMensaje.MsgAdvertencia)
Dep.Dispose()
@@ -853,7 +853,7 @@ Partial Class Bancos_ProveedoresCreditos
If Not gvr.FCCheckBox("ChkPagar").Checked Then
Continue For
End If
- Dim importeMovimiento = gvr.DataKey("Total").ToDecimal
+ Dim importeMovimiento As Decimal = gvr.DataKey("Total").ToDecimal
Dim CveCreditoDetalle As Integer = gvr.DataKey("CveCreditoDetalle").ToEntero
Dim CveCredito As Integer = gvr.DataKey("CveCredito").ToEntero
Dim DtDetallesCredito As DataTable
@@ -979,21 +979,21 @@ Partial Class Bancos_ProveedoresCreditos
End If
- Dim CreditoMensualidad = DtDetallesCredito.FiltroPrimeroValor("Mensualidad", $"CveCreditoDetalle = {CveCreditoDetalle}").ToString.ToDecimal
- Dim CreditoIvaCapital = DtDetallesCredito.FiltroPrimeroValor("IVACapital", $"CveCreditoDetalle = {CveCreditoDetalle}").ToString.ToDecimal
- Dim CreditoIvaIntereses = DtDetallesCredito.FiltroPrimeroValor("IVAIntereses", $"CveCreditoDetalle = {CveCreditoDetalle}").ToString.ToDecimal
+ Dim CreditoMensualidad As Decimal = DtDetallesCredito.FiltroPrimeroValor("Mensualidad", $"CveCreditoDetalle = {CveCreditoDetalle}").ToString.ToDecimal
+ Dim CreditoIvaCapital As Decimal = DtDetallesCredito.FiltroPrimeroValor("IVACapital", $"CveCreditoDetalle = {CveCreditoDetalle}").ToString.ToDecimal
+ Dim CreditoIvaIntereses As Decimal = DtDetallesCredito.FiltroPrimeroValor("IVAIntereses", $"CveCreditoDetalle = {CveCreditoDetalle}").ToString.ToDecimal
- Dim CreditoIntereses = DtDetallesCredito.FiltroPrimeroValor("Intereses", $"CveCreditoDetalle = {CveCreditoDetalle}").ToString.ToDecimal
+ Dim CreditoIntereses As Decimal = DtDetallesCredito.FiltroPrimeroValor("Intereses", $"CveCreditoDetalle = {CveCreditoDetalle}").ToString.ToDecimal
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) AndAlso ObjMov.DtResultados.Rows.Count > 0 Then
- Dim DtPlantilla = ObjMov.DtResultados
+ Dim DtPlantilla As DataTable = ObjMov.DtResultados
- Dim ConceptoContable = 0
- Dim TipoMovimiento = False
- Dim Concepto = ""
- Dim Referencia = $"Crédito: {TxtFolio.Text}"
- Dim FechaMovimiento = NowADS().ToDate
+ Dim ConceptoContable As Integer = 0
+ Dim TipoMovimiento As Boolean = False
+ Dim Concepto As String = ""
+ Dim Referencia As String = $"Crédito: {TxtFolio.Text}"
+ Dim FechaMovimiento As Date = NowADS().ToDate
For Each Row As DataRow In DtPlantilla.Rows
@@ -1232,7 +1232,7 @@ Partial Class Bancos_ProveedoresCreditos
Dim Retorno As String = ""
If contextKey.ToDouble >= 0 Then
- Retorno = String.Format("---{0}---", contextKey.ToDouble.Texto2Letras(tCveMoneda))
+ Retorno = String.Format("---{0}---", contextKey.ToDecimal.Texto2Letras(tCveMoneda))
End If
Return Retorno
diff --git a/Bin/ADSNetLibrary.dll b/Bin/ADSNetLibrary.dll
index effde59a8..f8f0cd514 100644
Binary files a/Bin/ADSNetLibrary.dll and b/Bin/ADSNetLibrary.dll differ
diff --git a/CGame/AsignacionEmpaque.aspx.cs b/CGame/AsignacionEmpaque.aspx.cs
index fc4331e0c..65ca283bd 100644
--- a/CGame/AsignacionEmpaque.aspx.cs
+++ b/CGame/AsignacionEmpaque.aspx.cs
@@ -103,7 +103,7 @@ public partial class CGame_AsignacionEmpaque : ClsPaginas
{
ClsCGame ObjCGame = new ClsCGame();
- Double TotalCajas = 0, TotalBins = 0;
+ decimal TotalCajas = 0, TotalBins = 0;
if (ObjCGame.GetProduccionResultado(-1, CveEmpresa: UsuarioActual.CveEmpresa))
{
@@ -333,7 +333,7 @@ public partial class CGame_AsignacionEmpaque : ClsPaginas
int CveCalidad = DdlCalidad.SelectedValue.ToEntero();
int CveEtiqueta = DdlEtiqueta.SelectedValue.ToEntero();
- Double TotalCajas = 0, TotalBins = 0;
+ decimal TotalCajas = 0, TotalBins = 0;
ClsCGame ObjCGame = new ClsCGame();
if (ObjCGame.GetProduccionResultado(-1, -1, -1, UsuarioActual.CveEmpresa, -1, CveHuerta, CveFruto, CveVariedad, CveTipoProduccion, CveTamaño, CveCalidad, CveEtiqueta, CveTipoEmpaque))
diff --git a/CGame/AsignacionEmpaque2.aspx.cs b/CGame/AsignacionEmpaque2.aspx.cs
index 1f404259f..df703a80b 100644
--- a/CGame/AsignacionEmpaque2.aspx.cs
+++ b/CGame/AsignacionEmpaque2.aspx.cs
@@ -152,7 +152,7 @@ public partial class CGame_AsignacionEmpaque2 : ClsPaginas
{
ClsCGame ObjCGame = new ClsCGame();
- Double TotalCajas = 0, TotalBins = 0;
+ decimal TotalCajas = 0, TotalBins = 0;
int CveHuerta = DdlHuerta.SelectedValue.ToEntero();
int CveFruto = DdlFruto.SelectedValue.ToEntero();
diff --git a/CGame/Liquidacion.aspx.cs b/CGame/Liquidacion.aspx.cs
index 39055f314..2e74ac2cf 100644
--- a/CGame/Liquidacion.aspx.cs
+++ b/CGame/Liquidacion.aspx.cs
@@ -172,7 +172,7 @@ public partial class CGame_Liquidacion : ClsPaginas
DtIngresosAgrupados= ObjCGame.DtResultados;
}
ObjCGame.Dispose();
- double TotIngresosPri = 0, TotIngresosSeg = 0, TotIngresosJug = 0, TotPesoPri = 0, TotPesoSeg = 0, TotPesoJug = 0, TotCantidadPri = 0, TotCantidadSeg = 0, TotCantidadJug = 0, Merma = 0;
+ decimal TotIngresosPri = 0, TotIngresosSeg = 0, TotIngresosJug = 0, TotPesoPri = 0, TotPesoSeg = 0, TotPesoJug = 0, TotCantidadPri = 0, TotCantidadSeg = 0, TotCantidadJug = 0, Merma = 0;
if (DtIngresos.Rows.Count > 0)
{
TotIngresosPri = DtIngresos.SUM("ImportePrimera");
@@ -184,7 +184,7 @@ public partial class CGame_Liquidacion : ClsPaginas
TotCantidadPri = DtIngresos.SUM("CantidadPrimera");
TotCantidadSeg = DtIngresos.SUM("CantidadSegunda");
TotCantidadJug = DtIngresos.SUM("CantidadJugo");
- Merma = DtIngresos.Rows[0]["Merma"].ToString().ToDouble();
+ Merma = DtIngresos.Rows[0]["Merma"].ToString().ToDecimal();
LblPesoNeto.Text = DtIngresos.Rows[0]["PesoNeto"].ToString().FormatoNumero();
HplNumCortes.Text = DtIngresos.Rows[0]["NumCortes"].ToString().FormatoNumero(0);
if (DtGastosTotales.Rows.Count > 0)
@@ -258,7 +258,7 @@ public partial class CGame_Liquidacion : ClsPaginas
{
if ((DtIngresos.Rows.Count > 0 || DtGastosTotales.Rows.Count > 0))
{
- double TotIngresosPri = 0, TotIngresosSeg = 0, TotIngresosJug = 0, TotPesoPri = 0, TotPesoSeg = 0, TotPesoJug = 0, TotCantidadPri = 0, TotCantidadSeg = 0, TotCantidadJug = 0, Merma = 0,PesoNeto=0;
+ decimal TotIngresosPri = 0, TotIngresosSeg = 0, TotIngresosJug = 0, TotPesoPri = 0, TotPesoSeg = 0, TotPesoJug = 0, TotCantidadPri = 0, TotCantidadSeg = 0, TotCantidadJug = 0, Merma = 0,PesoNeto=0;
if (DtIngresos.Rows.Count > 0)
{
TotIngresosPri = DtIngresos.SUM("ImportePrimera");
@@ -270,8 +270,8 @@ public partial class CGame_Liquidacion : ClsPaginas
TotCantidadPri = DtIngresos.SUM("CantidadPrimera");
TotCantidadSeg = DtIngresos.SUM("CantidadSegunda");
TotCantidadJug = DtIngresos.SUM("CantidadJugo");
- Merma = DtIngresos.Rows[0]["Merma"].ToString().ToDouble();
- PesoNeto = DtIngresos.Rows[0]["PesoNeto"].ToString().ToDouble();
+ Merma = DtIngresos.Rows[0]["Merma"].ToString().ToDecimal();
+ PesoNeto = DtIngresos.Rows[0]["PesoNeto"].ToString().ToDecimal();
}
System.IO.FileInfo Imagen = new System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png");
diff --git a/CGame/OrdenProduccion.aspx.vb b/CGame/OrdenProduccion.aspx.vb
index 27f74b826..c91d9ee7f 100644
--- a/CGame/OrdenProduccion.aspx.vb
+++ b/CGame/OrdenProduccion.aspx.vb
@@ -1693,7 +1693,7 @@ Partial Class CGame_OrdenProduccion
If Dt.Rows.Count > 0 Then
params.Add(New ReportParameter("Manifiesto", Dt.Rows(0)("Manifiesto").ToString))
params.Add(New ReportParameter("SubTotal", Dt.SUM("Importe").ToString.FormatoNumero()))
- params.Add(New ReportParameter("CantidadConLetra", Texto2Letras(Dt.SUM("Importe").ToString.ToDouble, 2)))
+ params.Add(New ReportParameter("CantidadConLetra", Texto2Letras(Dt.SUM("Importe").ToString.ToDecimal, 2)))
End If
End If
ImprimirPDF("Empresas/Grales/Formatos/Manifiesto.rdlc", Dt, params, String.Format("Manifiesto -{0}", NowADS().ToDateTime.ToShortDateString))
diff --git a/CRM/Acercamiento.aspx b/CRM/Acercamiento.aspx
index 4a287efb1..47b1508a6 100644
--- a/CRM/Acercamiento.aspx
+++ b/CRM/Acercamiento.aspx
@@ -441,6 +441,56 @@
+
+
+
+
+
+