diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index ca61f5bd1..d5f0753ce 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -4926,6 +4926,7 @@ Public Class ClsBancos Dim Retorno As Boolean = False DataAdapter("PA_Banc_PagosNoBancarios") + SqlAdapter.SelectCommand.CommandTimeout = 0 With SqlAdapter.SelectCommand.Parameters .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index f210359db..994ef7716 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -3630,7 +3630,7 @@ Public Class ClsContabilidad - Public Function GetSituacionFinanciera(FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveSubProyecto As String, TipoMovtos As Integer, Optional SAT As Integer = 0) As Boolean + Public Function GetSituacionFinanciera(FechaI As Date, FechaF As Date, CveEmpresa As Integer, CveSubProyecto As String, TipoMovtos As Integer, Optional SAT As Integer = 0, Optional Opcion As Integer = 1) As Boolean Dim Retorno = False 'SqlAdapter.SelectCommand.t @@ -3644,6 +3644,7 @@ Public Class ClsContabilidad .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@SAT", SqlDbType.Int).Value = SAT + .Add("@Opcion", SqlDbType.Int).Value = Opcion End With SqlAdapter.SelectCommand.CommandTimeout = 0 @@ -3854,7 +3855,7 @@ Public Class ClsContabilidad End Function 'Public Function GetEstadoActividades(FechaI As Date, FechaF As Date, TipoMovtos As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional SAT As Integer = 0) As Boolean - Public Function GetEstadoActividades(FechaI As Date, FechaF As Date, TipoMovtos As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional SAT As Integer = 0) As Boolean + Public Function GetEstadoActividades(FechaI As Date, FechaF As Date, TipoMovtos As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, Optional SAT As Integer = 0, Optional Opcion As Integer = 1) As Boolean Dim Retorno = False DataAdapter("PA_Conta_EstadoActividadesGet") @@ -3867,6 +3868,7 @@ Public Class ClsContabilidad .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@SAT", SqlDbType.Int).Value = SAT + .Add("@Opcion", SqlDbType.Int).Value = Opcion End With SqlAdapter.SelectCommand.CommandTimeout = 0 diff --git a/App_Code/ClsEncuestas.vb b/App_Code/ClsEncuestas.vb index 5aeff458a..fb9c893d5 100644 --- a/App_Code/ClsEncuestas.vb +++ b/App_Code/ClsEncuestas.vb @@ -568,6 +568,7 @@ Public Class ClsEncuestas .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@Fecha", SqlDbType.Date).Value = Now .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEncuestaAplicada", SqlDbType.Int).Direction = ParameterDirection.Output End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 1ff3db797..908445a59 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -6041,7 +6041,7 @@ Public Class ClsPaginas If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) Then Dim QRDescarga As String = "" Dim cfdi As New RVCFDI33.GeneraCFDI() - Dim Parametros As String = Encripta($"CveVenta={Vta.CveVenta}&CveEmpresa={Vta.CveEmpresa}") + Dim Parametros As String = Encripta($"SerieFolio={Vta.SerieFolio}&TipoDocto={Vta.TipoDocto}&CveEmpresa={Vta.CveEmpresa}") Dim b As Byte() = cfdi.ConvertirQrCode($"http://econollantas.adssistemas.mx/Ashx/E141.ashx?PV={Parametros}") QRDescarga = Convert.ToBase64String(b) params.Add(New ReportParameter("QRDescarga", QRDescarga)) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index c5f8dd4f9..2819ceb5a 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1325,7 +1325,7 @@ Public Class ClsVentas 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 = "") As Boolean + Optional ImporteRetISR As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasDetalleAdd") @@ -1355,6 +1355,7 @@ Public Class ClsVentas .Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle .Add("@CveMovimientoDetallePedido", SqlDbType.Int).Value = CveMovimientoDetallePedido .Add("@CuentaPredial", SqlDbType.VarChar).Value = CuentaPredial + .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista End With Try diff --git a/App_Code/Empresa.vb b/App_Code/Empresa.vb index de0648139..89710bc9b 100644 --- a/App_Code/Empresa.vb +++ b/App_Code/Empresa.vb @@ -97,7 +97,7 @@ Public Class Empresa Public Property Soporte_PWD As String Public Property Soporte_Tipo As String Public Property Timbres As Integer - Public Property RutaArchivos As String + Private Property RutaArchivos As String Public ReadOnly Property Ruta As String Get If Not String.IsNullOrEmpty(RutaArchivos) AndAlso ClsPaginas.EsProduccion Then diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 05806fca4..f9759cb99 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -301,6 +301,11 @@ Namespace Modelos #Region " OBJETOS Ventas" + + Public Class MPrecioSugerido + Public Property CvePrecioLista As Integer + Public Property PrecioSugerido As Decimal + End Class Public Class VentaDescuentos Public Consec As Integer diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx index 7f6bf47cb..9e87ebed5 100644 --- a/Ashx/E141.ashx +++ b/Ashx/E141.ashx @@ -99,16 +99,36 @@ Public Class E141 : Implements IHttpHandler Dim retorno As String = "" Try Dim Params = If(context.Request("P") = Nothing, "", context.Request("P").ToString()) + Dim ParamsV = If(context.Request("PV") = Nothing, "", context.Request("PV").ToString()) + + Dim ParametrosNuevos As Boolean = False + If Not String.IsNullOrEmpty(ParamsV) Then + ParametrosNuevos = True + Params = ParamsV + End If 'DESCARGA DEL PDF If Not String.IsNullOrEmpty(Params) Then Try - Dim UrlParametros As Hashtable = Parametros(Decripta(Params)) + If ParametrosNuevos Then + Dim UrlParametros As Hashtable = Parametros(Decripta(Params)) - Dim File As String = UrlParametros("FILE").ToString() - If Not String.IsNullOrEmpty(File) Then - ImprimirbytesPDF(context, DescargarFactura(File), File) + Dim File As String = String.Format("{0}.pdf", UrlParametros("SERIEFOLIO").ToString()) + Dim TipoDocto As String = UrlParametros("TIPODOCTO").ToString() + Dim CveEmpresaParam As Integer = UrlParametros("CVEEMPRESA").ToString().ToEntero() + + If Not String.IsNullOrEmpty(File) AndAlso Not String.IsNullOrEmpty(TipoDocto) AndAlso CveEmpresaParam > 0 Then + ImprimirbytesPDF(context, DescargarFactura(File, CveEmpresaParam, TipoDocto), File) + End If + Else + Dim UrlParametros As Hashtable = Parametros(Decripta(Params)) + + Dim File As String = UrlParametros("FILE").ToString() + If Not String.IsNullOrEmpty(File) Then + ImprimirbytesPDF(context, DescargarFactura(File, Me.CveEmpresa), File) + End If End If + Catch ex As Exception GuardaLogAD("Ocurrió un error al descargar el pdf. " + ex.ToString() + ".parametros: " + Params, "LogE141") End Try @@ -2202,8 +2222,8 @@ Public Class E141 : Implements IHttpHandler #Region "D E S C A R G A - P D F" - Private Function DescargarFactura(FilePDF As String) As Byte() - Dim Url = New Uri(String.Format("{0}://{1}:{2}/Compras/PopUpVerFactura.aspx?TipoDocto=Ing&File={3}&TipoArchivo=PDF", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, FilePDF)) + Private Function DescargarFactura(FilePDF As String, CveEmpresa As Integer, Optional TipoDocto As String = "Ing") As Byte() + Dim Url = New Uri(String.Format("{0}://{1}:{2}/Compras/PopUpVerFactura.aspx?TipoDocto={4}&File={3}&TipoArchivo=PDF", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, FilePDF, TipoDocto)) Dim File As Byte() = Nothing Try Using httpClient = New HttpClient() diff --git a/Contabilidad2/RepEstadoActividades.aspx b/Contabilidad2/RepEstadoActividades.aspx index 24eae304f..f65afe649 100644 --- a/Contabilidad2/RepEstadoActividades.aspx +++ b/Contabilidad2/RepEstadoActividades.aspx @@ -30,13 +30,14 @@
- -
+ +
- -
+ + +
@@ -53,25 +54,38 @@
- Proyecto: -
+ Proyecto: +
+ SubProyecto: -
+
-
  • Tipo: - + +
    + + Normal + Consolidado + +
    + + + +
    + -
  • - +
    + + +
    diff --git a/Contabilidad2/RepEstadoActividades.aspx.vb b/Contabilidad2/RepEstadoActividades.aspx.vb index 6d7b33fa3..67463cddb 100644 --- a/Contabilidad2/RepEstadoActividades.aspx.vb +++ b/Contabilidad2/RepEstadoActividades.aspx.vb @@ -86,7 +86,8 @@ Partial Class AC_RepEstadoActividades ReporteComplementario = False Else ReporteComplementario = False - liTipoReporte.Visible = False + DivTipo1.Visible = False + DivTipo2.Visible = False LtTitulo.Text = "Estado de Resultados" End If @@ -136,7 +137,7 @@ Partial Class AC_RepEstadoActividades 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) Dim ObjConta As New ClsContabilidad - If ObjConta.GetEstadoActividades(FechaI.ToDate, FechaF.ToDate, TipoReporte, CveProyecto, CveSubProyecto, UsuarioActual.CveEmpresa) Then + If ObjConta.GetEstadoActividades(FechaI.ToDate, FechaF.ToDate, TipoReporte, CveProyecto, CveSubProyecto, UsuarioActual.CveEmpresa, Opcion:=DdlOpcion.SelectedValue.ToEntero) Then DtDatos = ObjConta.DtResultados.FiltraParametros("(ImporteActual <> 0 OR ImporteAcumulado <> 0)") Else DtDatos = Nothing @@ -331,6 +332,10 @@ Partial Class AC_RepEstadoActividades params.Add(New ReportParameter("SubProyecto", DdlSubproyecto.SelectedItem.Text)) ImprimirPDF("AC/Reportes/RepEstadoActividades.rdlc", lrds, params, "EstadoActividades", Formato) + + + ' UsuarioActual.Empresa.GrupoEmpresa + End Sub End Class diff --git a/Contabilidad2/RepSituacionFinanciera.aspx b/Contabilidad2/RepSituacionFinanciera.aspx index 525852a24..6233683c5 100644 --- a/Contabilidad2/RepSituacionFinanciera.aspx +++ b/Contabilidad2/RepSituacionFinanciera.aspx @@ -63,6 +63,15 @@
    + + +
    + + Normal + Consolidado + +
    +
    diff --git a/Contabilidad2/RepSituacionFinanciera.aspx.vb b/Contabilidad2/RepSituacionFinanciera.aspx.vb index 477cbc9a4..459796aae 100644 --- a/Contabilidad2/RepSituacionFinanciera.aspx.vb +++ b/Contabilidad2/RepSituacionFinanciera.aspx.vb @@ -195,7 +195,7 @@ Partial Class AC2_SituacionFinanciera Dim CveSubProyecto As String = DdlSubproyecto.SelectedValue.ToString - If ObjConta.GetSituacionFinanciera("01/01/1900".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, CveSubProyecto, TipoReporte) Then + If ObjConta.GetSituacionFinanciera("01/01/1900".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, CveSubProyecto, TipoReporte, Opcion:=DdlOpcion.SelectedValue.ToEntero) Then DtDatos = ObjConta.DtResultados CargaGrids() diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 98fe4160f..e68a5393f 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -9453,7 +9453,7 @@ public partial class Nomina_Nomina2 : ClsPaginas DdlCuenta.Items.Clear(); DataTable DTCuentas = get_GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa: UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta <> 1 AND UsaLayout = 'True' AND LEN(ConvenioPagoElectronico) > 0 "); DTCuentas.CaseSensitive = false; - DdlCuenta.DataSource = DTCuentas.FiltraParametros(" Banco IN('BANCOMER','BANORTE')"); + DdlCuenta.DataSource = DTCuentas.FiltraParametros(" Banco IN('BANCOMER','BANORTE','BBVA Bancomer','BBVA')"); DdlCuenta.DataBind(); DdlCuenta.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlCuenta.SelectedValueExist("-1"); diff --git a/RH/Asistencias.aspx b/RH/Asistencias.aspx index 7bb6c6fa3..98ae354cd 100644 --- a/RH/Asistencias.aspx +++ b/RH/Asistencias.aspx @@ -10,7 +10,7 @@ Registro de Asistencias - +
  • Lista asistencia
  • @@ -21,13 +21,13 @@
    - + -
    -
    +
    +
    "><%--class="expand"--%> @@ -36,73 +36,71 @@
    -
    +
    Cliente: -
    -
    +
    +
    -
    +
    Proyecto: -
    -
    - - - +
    + + + +
    -
    +
    SubProyecto: -
    -
    - - - -
    - - -
    +
    + + + +
    +
    +
    Turno: -
    -
    +
    - - - + + + +
    -
    +
    +
    + + + + + +
    + +
    - - - - - -
    - - -
    F. Asistencia: -
    -
    -
    - - - - +
    +
    + + + + - - - - - - + + + + + + +
    @@ -113,12 +111,12 @@
    > -
    +
    - + @@ -146,14 +144,14 @@ - + Cliente - + Asistencia diff --git a/RH/Asistencias.aspx.vb b/RH/Asistencias.aspx.vb index 38a03b877..613a70fcd 100644 --- a/RH/Asistencias.aspx.vb +++ b/RH/Asistencias.aspx.vb @@ -167,7 +167,11 @@ Partial Class RH_Asistencias lrds.Add(rds) '"Empresas/Grales/Formatos/EquiposGPS.rdlc" '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" - Dim rutardlc = "GPS/Asistencia.rdlc" + 'Dim rutardlc = "GPS/Asistencia.rdlc" + Dim rutardlc As String = UsuarioActual.Empresa.Ruta & "Formatos/Asistencia.rdlc" + If Not System.IO.File.Exists(rutardlc) Then + rutardlc = "Empresas/Grales/Formatos/Asistencia.rdlc" + End If ImprimirPDF(rutardlc, lrds, params, "Lista de asistencia") End Sub diff --git a/RH/CalculoSBC.aspx.cs b/RH/CalculoSBC.aspx.cs index d031bbd75..edd3a2586 100644 --- a/RH/CalculoSBC.aspx.cs +++ b/RH/CalculoSBC.aspx.cs @@ -698,7 +698,7 @@ public partial class RH_CalculoSBC : ClsPaginas } - string rutarchivos = string.Format("{0}modificacionsalarios\\", UsuarioActual.Empresa.RutaArchivos); + string rutarchivos = string.Format("{0}modificacionsalarios\\", UsuarioActual.Empresa.Ruta); if (!System.IO.Directory.Exists(rutarchivos)) { System.IO.Directory.CreateDirectory(rutarchivos); @@ -900,7 +900,7 @@ public partial class RH_CalculoSBC : ClsPaginas protected void Lnkmostrararchivos_Click(object sender, EventArgs e) { - string rutarchivos = string.Format("{0}\\modificacionsalarios\\", UsuarioActual.Empresa.RutaArchivos); + string rutarchivos = string.Format("{0}\\modificacionsalarios\\", UsuarioActual.Empresa.Ruta); List lisaarchivos = new List(); foreach (var urfile in System.IO.Directory.GetFiles(rutarchivos, "*")) { diff --git a/RH/Personal.aspx b/RH/Personal.aspx index e32b4fe3c..9f87b141b 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -570,7 +570,7 @@
    -
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    +
    + + " + style="display: inline-block; margin-right: -20px; width: 150px;" /> + " + style="margin-top: -3px; float: inherit;" class="btn btn-circle btn-sm label-info"> +
    @@ -1002,10 +1017,7 @@
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    + @@ -1075,16 +1087,19 @@
    + " + style="display: inline-block; margin-right: -20px; width: 150px;" /> + " + style="margin-top: -3px; float: inherit;" class="btn btn-circle btn-sm label-info"> +
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    + @@ -1156,6 +1171,12 @@
    + + " + style="display: inline-block; margin-right: -20px; width: 150px;" /> + " + style="margin-top: -3px; float: inherit;" class="btn btn-circle btn-sm label-info">
    @@ -1163,10 +1184,7 @@
    -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    + ').show(); } else { $('#<%= btnNext.ClientID %>').hide(); - } + } - } - } + } + } - - + \ No newline at end of file diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 3b43bc738..10fd4987a 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1066,12 +1066,21 @@ - - - - - - +
    +
    + +
    +
    +
    +
    + + + + + + +
    +
    @@ -1207,7 +1216,16 @@ <%--9--%> - +
    +
    + +
    +
    +
    +
    + +
    +
    diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7bb812f7d..bab17f0ac 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2734,6 +2734,9 @@ Partial Class Ventas TmpDT.Columns.Add("TieneProntoPago", GetType(String)) TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal)) TmpDT.Columns.Add("CveMarca", GetType(Integer)) + TmpDT.Columns.Add("CvePrecioLista", GetType(Integer)) + TmpDT.Columns.Add("PrecioLista", GetType(String)) + GvPS.DataSource = ObjVentas.DtResultados GvPS.DataBind() @@ -2758,6 +2761,9 @@ Partial Class Ventas TmpDT.Columns.Add("TieneProntoPago", GetType(String)) TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal)) TmpDT.Columns.Add("CveMarca", GetType(Integer)) + TmpDT.Columns.Add("CvePrecioLista", GetType(Integer)) + TmpDT.Columns.Add("PrecioLista", GetType(String)) + GvPS.DataSource = ObjVentas.DtResultados GvPS.DataBind() @@ -3125,6 +3131,11 @@ Partial Class Ventas If Not ExFolioFactura Then SetPermisos() If CveVenta < 1 Then CargaFolios() + + If CveVenta <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(360) = "1" Then + CargaListasPrecios() + End If + 'SELECCIONA VENDEDOR DEL USUARIO CUANDO SEA VENTA NUEVA Y SIN CLIENTE 'If UsuarioActual.CveVendedor > 0 Then ' If CveVenta = -1 AndAlso Not DdlVendedor.SelectedValue.ToEntero() > 0 Then DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString()) @@ -3475,6 +3486,21 @@ Partial Class Ventas End If End Sub + + Private Sub CargaListasPrecios() + DivPrecioLista.Visible = True + + Using ObjVta As New ClsVentas + If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then + DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy() + End If + End Using + + DdlPrecioLista.DataBind() + DdlPrecioLista.Items.Insert(0, New ListItem("Seleccione", "-1")) + + UpPS.Update() + End Sub Private Sub BloqueaClasificaciones() If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then DdlClasificacion.Enabled = False @@ -6076,12 +6102,6 @@ Partial Class Ventas End Sub Private Sub CargaFormaPago(CveMetodoPago As Integer) - 'EN LA VERSION 4.0 NO PERMITE DESBLOEQUEAR RELACION METODO Y FOMA DE PAGO - 'If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then - ' 'permiso para desbloquear la relación entre Método de pago y forma de pago - ' If UsuarioActual.TienePermisoProceso(282) Then CveMetodoPago = -1 - 'End If - Dim dtt As DataTable = Nothing If CveMetodoPago > 0 Then dtt = GlobalDTVtaFormaPago.FiltraParametros(If(CveMetodoPago = 1, " CveFormaPago <> 20 ", "CveFormaPago = 20")) @@ -6117,22 +6137,13 @@ Partial Class Ventas 'End If End Sub Private Sub CargaUsoCFDI() - If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then - RegimenFiscalCliente = "-1" - End If - DdlUsoCFDI.Items.Clear() DdlSucursalUsoCFDI.Items.Clear() - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - Dim EsPersonaMoral As Boolean = (TipoPersona = True) + Dim EsPersonaMoral As Boolean = (TipoPersona = True) - DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente) - DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente) - Else - DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente) - DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente) - End If + DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente) + DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente) DdlUsoCFDI.DataBind() DdlSucursalUsoCFDI.DataBind() @@ -6463,12 +6474,10 @@ Partial Class Ventas ViewState("CliPais") = ObjCliente.Pais ImprimeNombreSucursal = ObjCliente.ImprimeNombreSucursal - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - RegimenFiscalCliente = ObjCliente.DtResultados(0)("CodigoRegimenFiscal").ToString() - RegimenSociedad = ObjCliente.DtResultados(0)("RegimenSociedad").ToString() - TipoPersona = CBool(ObjCliente.DtResultados(0)("TipoPersona")) - CargaUsoCFDI() - End If + RegimenFiscalCliente = ObjCliente.DtResultados(0)("CodigoRegimenFiscal").ToString() + RegimenSociedad = ObjCliente.DtResultados(0)("RegimenSociedad").ToString() + TipoPersona = CBool(ObjCliente.DtResultados(0)("TipoPersona")) + CargaUsoCFDI() 'ViewState("NumCtaPago") = ObjCliente.NumCtaPago ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS If Not ClienteDesglosaIEPS Then @@ -6527,7 +6536,7 @@ Partial Class Ventas End If DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI) 'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES - If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1") AndAlso LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then + If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then 'S01 Sin efectos fiscales. DdlUsoCFDI.SelectedValueExist("23") DdlUsoCFDI.Enabled = False @@ -7061,7 +7070,7 @@ Partial Class Ventas Dim ValorAutorizacion As String = UsuarioActual.Empresa.Funcionalidad(595) 'OBLIGAR PAGO DE CONTADO SI EL CLIENTE NO PERMITE CREDITO - If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then + If Me.PermiteCredito = False AndAlso ((DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso EsCreaApartirDe) OrElse (DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveVenta > 0)) Then RBLPago.SelectedValue = "2" RBLPago.Items(0).Enabled = False RBLPago_SelectedIndexChanged(Nothing, Nothing) @@ -7459,9 +7468,9 @@ Partial Class Ventas LblEstado.Text = ObjCliente.DtResultados.Rows(0)("Estado").ToString() 'TxtNumCtaPago.Text = ObjCliente.DtResultados.Rows(0)("NumCtaPago").ToString() LblTelefono.Text = ObjCliente.DtResultados.Rows(0)("Telefono").ToString() - If Not UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - LblCP.Text = ObjCliente.DtResultados.Rows(0)("CP").ToString() - End If + 'If Not UsuarioActual.Empresa.Funcionalidad(350) = "1" Then + ' LblCP.Text = ObjCliente.DtResultados.Rows(0)("CP").ToString() + 'End If ViewState("CliLocalidad") = ObjCliente.DtResultados.Rows(0)("Localidad").ToString() ViewState("CliPais") = ObjCliente.DtResultados.Rows(0)("Pais").ToString() ViewState("CliNoExt") = ObjCliente.DtResultados.Rows(0)("NoExt").ToString() @@ -7518,7 +7527,7 @@ Partial Class Ventas DdlFormaPago33.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveFormaPago33").ToString()) DdlUsoCFDI.SelectedValueExist(ObjCliente.DtResultados.Rows(0)("CveUsoCFDI").ToString()) 'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES - If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1") AndAlso LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then + If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then 'S01 Sin efectos fiscales. DdlUsoCFDI.SelectedValueExist("23") DdlUsoCFDI.Enabled = False @@ -7560,7 +7569,7 @@ Partial Class Ventas DdlFormaPago33.SelectedValueExist(ObjCliente.CveFormaPago33) DdlUsoCFDI.SelectedValueExist(ObjCliente.CveUsoCFDI) 'SI ES RFC GENERICO NO TIENE OBLIGACIONES FISCALES - If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1") AndAlso LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then + If LblRFC.Text.Contiene("XAXX010101000", "XEXX010101000") Then 'S01 Sin efectos fiscales. DdlUsoCFDI.SelectedValueExist("23") DdlUsoCFDI.Enabled = False @@ -8038,6 +8047,10 @@ Partial Class Ventas End If + If UsuarioActual.Empresa.Funcionalidad(360) = "1" AndAlso e.Row.DBCampo("CvePrecioLista").ToEntero() > 0 Then + e.Row.FCLiteral("LtlPrecioLista").Visible = True + End If + 'CANTIDAD FACTURADA Select Case e.Row.DBCampo("TipoDocto") Case "Cot" @@ -8748,7 +8761,7 @@ Partial Class Ventas DtOCTmpDT = TmpDT.Copy TmpDTError = TmpDT.Copy - If UsuarioActual.Empresa.Funcionalidad(350) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Egs", "Dev") Then + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Egs", "Dev") Then If RegimenFiscalCliente.Contiene("-1", "") Then Alert("El cliente no tiene asignado un régimen fiscal.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -8759,6 +8772,7 @@ Partial Class Ventas Exit Sub End If End If + If ChkEmitirComercioExterior.Checked AndAlso DdlMoneda.SelectedValue.ToEntero() <> 2 Then Alert("La moneda de la factura debe ser dolares cuando aplica comercio exterior.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -8769,7 +8783,7 @@ Partial Class Ventas Exit Sub End If - If UsuarioActual.Empresa.Funcionalidad(350) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs", "Dev") Then + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs", "Dev") Then If LblRFC.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso RegimenFiscalCliente <> "616" Then Alert("El Regimen fiscal del cliente debe ser '616 - Sin obligaciones fiscales' cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) @@ -9396,37 +9410,37 @@ Partial Class Ventas End If 'Verifica versión 3.3.() - If (Not UsuarioActual.Empresa.Funcionalidad(350) = "1") AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then - Dim dttsat As DataTable = TmpDT.FiltraParametros("ISNULL(SATClaveProdServ,'') = '' OR ISNULL(SATClaveUM,'') = '' ") - If dttsat IsNot Nothing AndAlso dttsat.Rows.Count > 0 Then - Dim str As New StringBuilder - str.Append("Los siguientes productos no tiene asignado la clave Producto SAT o Unidad Medida SAT

    ") - For Each drt As DataRow In dttsat.Rows - str.AppendFormat("{0}
    ", drt("CodigoPS")) - Next - Alert(str.ToString(), TipoMensaje.MsgAdvertencia) - dttsat.Dispose() - str.Clear() - Exit Sub - End If - dttsat.Dispose() + 'If (Not UsuarioActual.Empresa.Funcionalidad(350) = "1") AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "PeC") Then + ' Dim dttsat As DataTable = TmpDT.FiltraParametros("ISNULL(SATClaveProdServ,'') = '' OR ISNULL(SATClaveUM,'') = '' ") + ' If dttsat IsNot Nothing AndAlso dttsat.Rows.Count > 0 Then + ' Dim str As New StringBuilder + ' str.Append("Los siguientes productos no tiene asignado la clave Producto SAT o Unidad Medida SAT

    ") + ' For Each drt As DataRow In dttsat.Rows + ' str.AppendFormat("{0}
    ", drt("CodigoPS")) + ' Next + ' Alert(str.ToString(), TipoMensaje.MsgAdvertencia) + ' dttsat.Dispose() + ' str.Clear() + ' Exit Sub + ' End If + ' dttsat.Dispose() - If UsuarioActual.CveEmpresa = 72 Then - Dim DtNoEncontrados As DataTable = TmpDT.FiltraParametros("ISNULL(SATClaveProdServ,'') = '01010101' ") - If DtNoEncontrados IsNot Nothing AndAlso DtNoEncontrados.Rows.Count > 0 Then - Dim StrNoEncontrados As New StringBuilder - StrNoEncontrados.Append("Los siguientes productos no existen en el catálogo del SAT

    ") - For Each drt As DataRow In DtNoEncontrados.Rows - StrNoEncontrados.AppendFormat("{0}
    ", drt("CodigoPS")) - Next - Alert(StrNoEncontrados.ToString(), TipoMensaje.MsgAdvertencia) - DtNoEncontrados.Dispose() - StrNoEncontrados.Clear() - Exit Sub - End If - DtNoEncontrados.Dispose() - End If - End If + ' If UsuarioActual.CveEmpresa = 72 Then + ' Dim DtNoEncontrados As DataTable = TmpDT.FiltraParametros("ISNULL(SATClaveProdServ,'') = '01010101' ") + ' If DtNoEncontrados IsNot Nothing AndAlso DtNoEncontrados.Rows.Count > 0 Then + ' Dim StrNoEncontrados As New StringBuilder + ' StrNoEncontrados.Append("Los siguientes productos no existen en el catálogo del SAT

    ") + ' For Each drt As DataRow In DtNoEncontrados.Rows + ' StrNoEncontrados.AppendFormat("{0}
    ", drt("CodigoPS")) + ' Next + ' Alert(StrNoEncontrados.ToString(), TipoMensaje.MsgAdvertencia) + ' DtNoEncontrados.Dispose() + ' StrNoEncontrados.Clear() + ' Exit Sub + ' End If + ' DtNoEncontrados.Dispose() + ' End If + 'End If 'CREA UNA COPIA DE SEGURIDAD PARA LOS DATOS DEL TMPDT If TmpDTError Is Nothing OrElse TmpDTError.Rows.Count = 0 Then @@ -10068,7 +10082,7 @@ Partial Class Ventas Try If AutoConta Then - If idCuentaContabilizacion > 0 Then + If idCuentaContabilizacion > 0 Or UsuarioActual.CveEmpresa.Contiene(7, 11, 12, 122, 145) Then If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then If ObjContPaq IsNot Nothing Then ObjContPaq.Commit() Else @@ -10643,23 +10657,14 @@ Partial Class Ventas ObjFacturaDevolucion.Fecha = Now + ObjFacturaDevolucion.Version = "4.0" - - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - ObjFacturaDevolucion.Version = "4.0" - - If ObjFacturaDevolucion.Cliente Is Nothing Then - ObjFacturaDevolucion.Cliente = New Modelos.ClienteModel - End If - - ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal - ObjFacturaDevolucion.Cliente.RegimenFiscal = ClienteRegimenFiscal - Else - ObjFacturaDevolucion.Version = "3.3" + If ObjFacturaDevolucion.Cliente Is Nothing Then + ObjFacturaDevolucion.Cliente = New Modelos.ClienteModel End If - - + ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal + ObjFacturaDevolucion.Cliente.RegimenFiscal = ClienteRegimenFiscal ObjFacturaDevolucion.CveMetodoPago33 = 1 ObjFacturaDevolucion.MetodoPago33 = "Pago en una sola exhibición" @@ -10942,20 +10947,15 @@ Partial Class Ventas End If ObjFacturaBonificacion.Fecha = Now + ObjFacturaBonificacion.Version = "4.0" - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - ObjFacturaBonificacion.Version = "4.0" - - If ObjFacturaBonificacion.Cliente Is Nothing Then - ObjFacturaBonificacion.Cliente = New Modelos.ClienteModel - End If - - ObjFacturaBonificacion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal - ObjFacturaBonificacion.Cliente.RegimenFiscal = ClienteRegimenFiscal - Else - ObjFacturaBonificacion.Version = "3.3" + If ObjFacturaBonificacion.Cliente Is Nothing Then + ObjFacturaBonificacion.Cliente = New Modelos.ClienteModel End If + ObjFacturaBonificacion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal + ObjFacturaBonificacion.Cliente.RegimenFiscal = ClienteRegimenFiscal + ObjFacturaBonificacion.CveMetodoPago33 = 1 ObjFacturaBonificacion.MetodoPago33 = "Pago en una sola exhibición" ObjFacturaBonificacion.ClaveMetodoPagoSAT = "PUE" @@ -11368,18 +11368,14 @@ Partial Class Ventas ObjFactura = New Modelos.Factura End If - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - ObjFactura.Version = "4.0" - If ObjFactura.Cliente Is Nothing Then - ObjFactura.Cliente = New Modelos.ClienteModel - End If - - ObjFactura.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal - ObjFactura.Cliente.RegimenFiscal = ClienteRegimenFiscal - Else - ObjFactura.Version = "3.3" + ObjFactura.Version = "4.0" + If ObjFactura.Cliente Is Nothing Then + ObjFactura.Cliente = New Modelos.ClienteModel End If + ObjFactura.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal + ObjFactura.Cliente.RegimenFiscal = ClienteRegimenFiscal + ObjFactura.CveUsuario = UsuarioActual.CveUsuario ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa ObjFactura.TipoCambio = If(DdlMoneda.SelectedValue.ToEntero() = 1, 1, TxtTipoCambio.Text.Trim.ToDecimal) @@ -12154,19 +12150,15 @@ Partial Class Ventas ObjFacturaDevolucion.SerieFolioPadre = HdnFolioFiscalNC.Value.ToString() - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - ObjFacturaDevolucion.Version = "4.0" + ObjFacturaDevolucion.Version = "4.0" - If ObjFacturaDevolucion.Cliente Is Nothing Then - ObjFacturaDevolucion.Cliente = New Modelos.ClienteModel - End If - - ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal - ObjFacturaDevolucion.Cliente.RegimenFiscal = ClienteRegimenFiscal - Else - ObjFacturaDevolucion.Version = "3.3" + If ObjFacturaDevolucion.Cliente Is Nothing Then + ObjFacturaDevolucion.Cliente = New Modelos.ClienteModel End If + ObjFacturaDevolucion.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal + ObjFacturaDevolucion.Cliente.RegimenFiscal = ClienteRegimenFiscal + ObjFacturaDevolucion.CveMetodoPago33 = DdlMetodoPago33.SelectedValue.ToEntero() ObjFacturaDevolucion.MetodoPago33 = If(DdlMetodoPago33.SelectedValue.ToEntero() > 0, DdlMetodoPago33.SelectedItem.Text, "") ObjFacturaDevolucion.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", $"CveMetodoPago = {DdlMetodoPago33.SelectedValue}") @@ -12412,7 +12404,7 @@ Partial Class Ventas Dim Timbre As New CFDITimbre - Timbre.Comprobante.Version = If(UsuarioActual.Empresa.Funcionalidad(350) = "1", "4.0", "3.3") + Timbre.Comprobante.Version = "4.0" Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString() @@ -12441,11 +12433,7 @@ Partial Class Ventas Timbre.Receptor.DomicilioFiscalReceptor = Obj.ClienteSucursal.CP Else Timbre.Receptor.RFC = Obj.Cliente.RFC - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - Timbre.Receptor.Nombre = Obj.Cliente.Nombre - Else - Timbre.Receptor.Nombre = Obj.Cliente.Nombre + " " + Obj.Cliente.RegimenSociedad - End If + Timbre.Receptor.Nombre = Obj.Cliente.Nombre Timbre.Receptor.DomicilioFiscalReceptor = Obj.Cliente.CP End If @@ -13346,11 +13334,9 @@ Partial Class Ventas 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, 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(), - TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(), CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), - IEPS:=Row("ImporteIEPS").ToString().ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), - ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDouble, - PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString()) Then + 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(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(), + CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDouble, + PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero()) 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 Else @@ -17615,7 +17601,13 @@ Partial Class Ventas Dim PrecioSugerido As Decimal = 0 Dim tPrecioSugerido As Decimal = 0 tPrecioSugerido = drPS("Precio").ToString().ToDecimal - PrecioSugerido = CalculaPrecioSugerido(CvePSParametro, drPS("CveClasificacion").ToString().ToEntero()) + Dim ObjPrecioSugerido = CalculaPrecioSugerido(CvePSParametro, drPS("CveClasificacion").ToString().ToEntero()) + + PrecioSugerido = ObjPrecioSugerido.PrecioSugerido + + If ObjPrecioSugerido.CvePrecioLista > 0 AndAlso DivPrecioLista.Visible Then + DdlPrecioLista.SelectedValueExist(ObjPrecioSugerido.CvePrecioLista) + End If If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido @@ -17655,7 +17647,9 @@ Partial Class Ventas End Sub - Private Function CalculaPrecioSugerido(CvePSParametro As Integer, CveClasificacion As Integer) As Decimal + Private Function CalculaPrecioSugerido(CvePSParametro As Integer, CveClasificacion As Integer, Optional CvePrecioListaSugerido As Integer = -1) As Modelos.MPrecioSugerido + Dim Retorno As New Modelos.MPrecioSugerido + Dim PrecioSugerido As Decimal = 0 If UsuarioActual.CveEmpresa.Contiene(1) Then @@ -17698,6 +17692,10 @@ Partial Class Ventas End If + If DivPrecioLista.Visible AndAlso CvePrecioListaSugerido > 0 Then + CvePrecioListaPS = CvePrecioListaSugerido + End If + If CvePrecioListaPS > 0 Then Dim ObjPS As New ClsProductosServicios If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then @@ -17717,7 +17715,8 @@ Partial Class Ventas PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS End If End If - CvePrecioLista = CvePrecioListaPS + Me.CvePrecioLista = CvePrecioListaPS + Retorno.CvePrecioLista = CvePrecioListaPS End If @@ -17729,7 +17728,10 @@ Partial Class Ventas PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1) End If End If - Return PrecioSugerido + + Retorno.PrecioSugerido = PrecioSugerido + + Return Retorno End Function Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange DdlPSIndexChange(DdlPS.SelectedValue.ToEntero(), DdlPS) @@ -18816,11 +18818,29 @@ Partial Class Ventas PU = ObjDescuento.PU End If + Dim CvePrecioListaPS As Integer = -1 + Dim PrecioListaPS As String = "" + + 'VALIDA LA ASIGNACION DE LISTA DE PRECIOS + If DivPrecioLista.Visible Then + If DdlPrecioLista.SelectedValue.ToEntero() > 0 AndAlso DdlPrecioLista.SelectedValue.ToEntero() = Me.CvePrecioLista Then + CvePrecioListaPS = Me.CvePrecioLista + PrecioListaPS = DdlPrecioLista.SelectedItem.Text + Else + Alert("La lista de precios del producto no coincide con la seleccionada", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Else + If Me.CvePrecioLista > 0 Then + CvePrecioListaPS = Me.CvePrecioLista + End If + End If + AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text, CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento, DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text, Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, - ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento) + ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento, CvePrecioLista:=CvePrecioListaPS, PrecioLista:=PrecioListaPS) CalculaUsados() @@ -19011,7 +19031,7 @@ Partial Class Ventas Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0, Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False, - Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Modelos.VentaDescuentos = Nothing) As Boolean + Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Modelos.VentaDescuentos = Nothing, Optional CvePrecioLista As Integer = -1, Optional PrecioLista As String = "") As Boolean Dim Retorno As Boolean = False Try @@ -19267,6 +19287,9 @@ Partial Class Ventas End If + Row("CvePrecioLista") = CvePrecioLista + Row("PrecioLista") = PrecioLista + If UsuarioActual.CveEmpresa.Contiene(119, 13, 83) Then If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA @@ -19501,6 +19524,9 @@ Partial Class Ventas TmpDT.Columns.Add("CodigoObjetoImpuesto", GetType(String)) TmpDT.Columns.Add("CveMarca", GetType(Integer)) + TmpDT.Columns.Add("CvePrecioLista", GetType(Integer)) + TmpDT.Columns.Add("PrecioLista", GetType(String)) + TmpDT.Columns("EsOutSourcing").DefaultValue = False TmpDT.Columns("EsCargo").DefaultValue = False @@ -22227,7 +22253,7 @@ Partial Class Ventas Row("PU").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6), Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, 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), - ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString()) Then + ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero()) Then OcurrioError = True Exit For Else @@ -23410,7 +23436,7 @@ Partial Class Ventas RFVCiudadC.Visible = False RFVLocalidadC.Visible = False RFVSATPais.Visible = False - divRegimenCliente.Visible = UsuarioActual.Empresa.Funcionalidad(350) = "1" + divRegimenCliente.Visible = True RdTipoPersona.SelectedValue = "0" @@ -23440,7 +23466,7 @@ Partial Class Ventas DivCorreoCuentaCliente.Visible = True DivBotonesAgregarCliente.Visible = True DivFormaCliente.Visible = True - divRegimenCliente.Visible = UsuarioActual.Empresa.Funcionalidad(350) = "1" + divRegimenCliente.Visible = True End If End If ObjCliente.Dispose() @@ -23473,17 +23499,13 @@ Partial Class Ventas Else Dim RegimenFiscalCliente As String = "-1" - If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1") AndAlso DdlRegimenFiscalCliente.SelectedValue.ToEntero() > 0 Then + If DdlRegimenFiscalCliente.SelectedValue.ToEntero() > 0 Then RegimenFiscalCliente = GlobalDTRegimenesFiscales().FiltroPrimeroValor("CodigoRegimenFiscal", $"CveRegimenFiscal = {DdlRegimenFiscalCliente.SelectedValue.ToEntero()}") End If DdlUsoCFDICliente.Items.Clear() - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - Dim EsPersonaMoral As Boolean = (RdTipoPersona.SelectedValue = "1") - DdlUsoCFDICliente.DataSource = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente) - Else - DdlUsoCFDICliente.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente) - End If + Dim EsPersonaMoral As Boolean = (RdTipoPersona.SelectedValue = "1") + DdlUsoCFDICliente.DataSource = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente) DdlUsoCFDICliente.DataBind() DdlUsoCFDICliente.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -23505,44 +23527,41 @@ Partial Class Ventas Dim CveRegimenFiscal As Integer = -1 Dim CveUsoCFDI As Integer = 3 - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - CveRegimenFiscal = DdlRegimenFiscalCliente.SelectedValue.ToEntero() - CveUsoCFDI = DdlUsoCFDICliente.SelectedValue.ToEntero() + CveRegimenFiscal = DdlRegimenFiscalCliente.SelectedValue.ToEntero() + CveUsoCFDI = DdlUsoCFDICliente.SelectedValue.ToEntero() - Dim RegimenFiscalCliente As String = "-1" + Dim RegimenFiscalCliente As String = "-1" - If DdlRegimenFiscalCliente.SelectedValue.ToEntero() > 0 Then - RegimenFiscalCliente = GlobalDTRegimenesFiscales().FiltroPrimeroValor("CodigoRegimenFiscal", $"CveRegimenFiscal = {CveRegimenFiscal}") - End If + If DdlRegimenFiscalCliente.SelectedValue.ToEntero() > 0 Then + RegimenFiscalCliente = GlobalDTRegimenesFiscales().FiltroPrimeroValor("CodigoRegimenFiscal", $"CveRegimenFiscal = {CveRegimenFiscal}") + End If - If TxtRFCCliente.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlRegimenFiscalCliente.SelectedValue <> "11" Then - Alert("El Regimen fiscal del cliente debe ser '616 - Sin obligaciones fiscales' cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + If TxtRFCCliente.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlRegimenFiscalCliente.SelectedValue <> "11" Then + Alert("El Regimen fiscal del cliente debe ser '616 - Sin obligaciones fiscales' cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If - If TxtRFCCliente.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlUsoCFDICliente.SelectedValue <> "23" Then - Alert("El uso cfdi del cliente debe ser 'S01 - Sin efectos fiscales' cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + If TxtRFCCliente.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlUsoCFDICliente.SelectedValue <> "23" Then + Alert("El uso cfdi del cliente debe ser 'S01 - Sin efectos fiscales' cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If - If Not TxtRFCCliente.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlRegimenFiscalCliente.SelectedValue = "11" Then - Alert("El Regimen fiscal del cliente no puede ser '616 - Sin obligaciones fiscales' si no se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + If Not TxtRFCCliente.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlRegimenFiscalCliente.SelectedValue = "11" Then + Alert("El Regimen fiscal del cliente no puede ser '616 - Sin obligaciones fiscales' si no se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If - If Not TxtRFCCliente.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlUsoCFDICliente.SelectedValue = "23" Then - Alert("El uso cfdi del cliente no puede ser 'S01 - Sin efectos fiscales' si no se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + If Not TxtRFCCliente.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlUsoCFDICliente.SelectedValue = "23" Then + Alert("El uso cfdi del cliente no puede ser 'S01 - Sin efectos fiscales' si no se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If - Dim EsPersonaMoral As Boolean = (RdTipoPersona.SelectedValue = "1") - Dim DtUsosCFDI = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente).FiltraParametros($"CveUsoCFDI = {CveUsoCFDI}") - - If DtUsosCFDI.Rows.Count = 0 Then - Alert("El Uso CFDI no corresponde con el tipo de persona (fisca, moral) y el régimen fiscal.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + Dim EsPersonaMoral As Boolean = (RdTipoPersona.SelectedValue = "1") + Dim DtUsosCFDI = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente).FiltraParametros($"CveUsoCFDI = {CveUsoCFDI}") + If DtUsosCFDI.Rows.Count = 0 Then + Alert("El Uso CFDI no corresponde con el tipo de persona (fisca, moral) y el régimen fiscal.", TipoMensaje.MsgAdvertencia) + Exit Sub End If If DdlSubProyectoDatos.SelectedValue.ToEntero() > 0 Then @@ -25604,7 +25623,8 @@ Partial Class Ventas If CvePS > 0 Then If PrecioUnitario <= 0 Then - PrecioUnitario = CalculaPrecioSugerido(CvePS, CveClasificacion) + Dim ObjPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion) + PrecioUnitario = ObjPrecioSugerido.PrecioSugerido End If AgregarProductoServicio(Cantidad, CveUM, UM, -1, "", @@ -32988,6 +33008,10 @@ Partial Class Ventas 'REMOVER EVENTO PARA RECARGAR ALMACEN 'spanAlmacen.Attributes.Remove("onclick") + If UsuarioActual.Empresa.Funcionalidad(360) = "1" Then + CargaListasPrecios() + End If + HdnCargarInventario.Value = "False" UpParametros.Update() @@ -34870,19 +34894,15 @@ Partial Class Ventas ObjFacturaProntoPago.Fecha = Now - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - ObjFacturaProntoPago.Version = "4.0" + ObjFacturaProntoPago.Version = "4.0" - If ObjFacturaProntoPago.Cliente Is Nothing Then - ObjFacturaProntoPago.Cliente = New Modelos.ClienteModel - End If - - ObjFacturaProntoPago.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal - ObjFacturaProntoPago.Cliente.RegimenFiscal = ClienteRegimenFiscal - Else - ObjFacturaProntoPago.Version = "3.3" + If ObjFacturaProntoPago.Cliente Is Nothing Then + ObjFacturaProntoPago.Cliente = New Modelos.ClienteModel End If + ObjFacturaProntoPago.Cliente.CodigoRegimenFiscal = ClienteCodigoRegimenFiscal + ObjFacturaProntoPago.Cliente.RegimenFiscal = ClienteRegimenFiscal + ObjFacturaProntoPago.CveMetodoPago33 = 1 ObjFacturaProntoPago.MetodoPago33 = "Pago en una sola exhibición" ObjFacturaProntoPago.ClaveMetodoPagoSAT = "PUE" @@ -35286,7 +35306,8 @@ Partial Class Ventas TmpDT.Columns.Add("CveTamaño", GetType(Integer)) TmpDT.Columns.Add("EsCargo", GetType(Boolean)) TmpDT.Columns.Add("CveMarca", GetType(Integer)) - + TmpDT.Columns.Add("CvePrecioLista", GetType(Integer)) + TmpDT.Columns.Add("PrecioLista", GetType(String)) Return TmpDT End Function Private Function InicializaDTVentasNCProntoPago() As DataTable @@ -35585,40 +35606,36 @@ Partial Class Ventas DVRegimenSociedad.Visible = False DivRazonSocial2.Attributes.Add("class", "col-md-12") - If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then + DivRazonSocial2.Attributes.Add("class", "col-md-8") + DVRegimenSociedad.Visible = True - DivRazonSocial2.Attributes.Add("class", "col-md-8") - DVRegimenSociedad.Visible = True + If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then + DdlRegimenFiscalCliente.DataSource = GlobalDTRegimenesFiscales().FiltraParametros("CveRegimenFiscal = 11") + DdlRegimenFiscalCliente.DataBind() + Else + Dim dt As DataTable = GlobalDTRegimenesFiscales(RdTipoPersona.SelectedValue.ToEntero).FiltraParametros("", "CodigoRegimenFiscal") + Dim Val As String = "" - If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then - DdlRegimenFiscalCliente.DataSource = GlobalDTRegimenesFiscales().FiltraParametros("CveRegimenFiscal = 11") - DdlRegimenFiscalCliente.DataBind() - Else - Dim dt As DataTable = GlobalDTRegimenesFiscales(RdTipoPersona.SelectedValue.ToEntero).FiltraParametros("", "CodigoRegimenFiscal") - Dim Val As String = "" - - If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then - 'verifico que sino existe el valor. lo limpie - Val = dt.FiltroPrimeroValor("CveRegimenFiscal", "CveRegimenFiscal = " & DdlRegimenFiscalCliente.SelectedValue) - If Val = "" Then 'sino encuentra valor, lo limpia - DdlRegimenFiscalCliente.Items.Clear() - DdlRegimenFiscalCliente.SelectedValue = Nothing - End If + If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then + 'verifico que sino existe el valor. lo limpie + Val = dt.FiltroPrimeroValor("CveRegimenFiscal", "CveRegimenFiscal = " & DdlRegimenFiscalCliente.SelectedValue) + If Val = "" Then 'sino encuentra valor, lo limpia + DdlRegimenFiscalCliente.Items.Clear() + DdlRegimenFiscalCliente.SelectedValue = Nothing End If - - DdlRegimenFiscalCliente.DataSource = dt - DdlRegimenFiscalCliente.DataBind() - DdlRegimenFiscalCliente.SelectedValueExist(Val) - End If - DdlRegimenFiscalCliente.Items.Insert(0, New ListItem("Seleccione", "-1")) - - DdlUsoCFDICliente.Items.Clear() - DdlUsoCFDICliente.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlRegimenFiscalCliente.DataSource = dt + DdlRegimenFiscalCliente.DataBind() + DdlRegimenFiscalCliente.SelectedValueExist(Val) End If + DdlRegimenFiscalCliente.Items.Insert(0, New ListItem("Seleccione", "-1")) + + DdlUsoCFDICliente.Items.Clear() + DdlUsoCFDICliente.Items.Insert(0, New ListItem("Seleccione", "-1")) + UpAgregarCliente.Update() End Sub @@ -36398,7 +36415,7 @@ Partial Class Ventas PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS End If End If - CvePrecioLista = CvePrecioListaPS + Me.CvePrecioLista = CvePrecioListaPS End If @@ -36740,5 +36757,20 @@ Partial Class Ventas End If End Sub + + Protected Sub DdlPrecioLista_SelectedIndexChanged(sender As Object, e As EventArgs) + If DivPrecioLista.Visible AndAlso DdlPrecioLista.SelectedValue.ToEntero() > 0 Then + Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero()).FiltroPrimero("") + + Dim ObjPrecioSugerido = CalculaPrecioSugerido(drPS("CvePS").ToString().ToEntero(), drPS("CveClasificacion").ToString().ToEntero(), CvePrecioListaSugerido:=DdlPrecioLista.SelectedValue.ToEntero()) + + If ObjPrecioSugerido.PrecioSugerido > 0 Then + TxtPrecio.Text = ObjPrecioSugerido.PrecioSugerido.ToString("#,###.####") + Else + Alert("No se encontro un precio para este producto en la lista de precios seleccionada") + End If + + End If + End Sub End Class