From 5b981eb685fe758f012c89418de748d926306b67 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 26 Aug 2022 18:30:03 -0700 Subject: [PATCH 1/3] =?UTF-8?q?Cambios=20en=20formato=20de=20pagar=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Clientes.aspx.vb | 991 ++++++++++++++++++++-------------------- 1 file changed, 508 insertions(+), 483 deletions(-) diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index c126a59cd..7a7a9a74b 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -12,9 +12,9 @@ Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq Partial Class Clientes - Inherits ClsPaginas - - 'Configuración + Inherits ClsPaginas + + 'Configuración #Region "P R O P I E D A D E S" Private Const NumeroDecimales As Integer = 2 Private CveVentaDeduccion As Integer @@ -499,10 +499,10 @@ Partial Class Clientes Set(value As String) ViewState("linkDescargaPagare") = value End Set - End Property - + End Property + #End Region - + #Region "Documentacion" Private Property DTDocumentacion As DataTable Get @@ -613,21 +613,21 @@ Partial Class Clientes Set(value As String) ViewState("AdjuntoDocumentacion") = value End Set - End Property - 'Private ReadOnly Property CvePersonal As Integer - ' Get - ' If ViewState("CvePersonal") Is Nothing Then - ' Return -1 - ' Else - ' Return ViewState("CvePersonal").ToString().Toentero() - ' End If - ' End Get - 'End Property - + End Property + 'Private ReadOnly Property CvePersonal As Integer + ' Get + ' If ViewState("CvePersonal") Is Nothing Then + ' Return -1 + ' Else + ' Return ViewState("CvePersonal").ToString().Toentero() + ' End If + ' End Get + 'End Property + #End Region - - - + + + #Region " A C U M U L A D O R E S" Property CveVentaNota As Integer Get @@ -667,10 +667,10 @@ Partial Class Clientes Set(value As String) ViewState("SerieNotaAcumulador") = value End Set - End Property - + End Property + #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -751,10 +751,10 @@ Partial Class Clientes If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then divRegimen.Visible = True - End If - - If UsuarioActual.CveEmpresa.Contiene(1) Or UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - DivRepresentanteLegal.Visible = True + End If + + If UsuarioActual.CveEmpresa.Contiene(1) Or UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + DivRepresentanteLegal.Visible = True End If If Request("CveCliente") IsNot Nothing AndAlso IsNumeric(Request("CveCliente")) AndAlso Request("CveCliente").ToEntero() > 0 Then @@ -924,10 +924,10 @@ Partial Class Clientes ChkPermiso5.Enabled = False ChkPermiso6.Enabled = False - End Sub - + End Sub + #Region " PERMISOS PAGINAS " - + Private Sub MostrarTxtDireccionesClienteEnvio() If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then @@ -964,18 +964,18 @@ Partial Class Clientes If Not ChkEsDistribuidor.Checked Then BtnGuardar.Visible = PermiteEditar() End If - End Sub - - + End Sub + + #End Region - - + + #Region "C A R G A S" - - - - - + + + + + Private Sub CreaDtPago() DtPagos = New DataTable DtPagos.Columns.Add("CveTipoMovimiento", GetType(String)) @@ -1093,13 +1093,13 @@ Partial Class Clientes End Sub - Private Sub CargaSubProyectosSuscursales() - - - CargarCentrosDeCosto(Nothing, DdlSubProyectoClienteSucursal, Nothing, LblSubProyectoClienteSucursal) - - - + Private Sub CargaSubProyectosSuscursales() + + + CargarCentrosDeCosto(Nothing, DdlSubProyectoClienteSucursal, Nothing, LblSubProyectoClienteSucursal) + + + End Sub @@ -1169,9 +1169,9 @@ Partial Class Clientes Select Case HdnCuenta.Value Case "1" - CargaDdlCuentasContables(DdlCtaContableClientes, 1)'UsuarioActual.Empresa.Funcionalidad(246).Toentero() + CargaDdlCuentasContables(DdlCtaContableClientes, 1)'UsuarioActual.Empresa.Funcionalidad(246).Toentero() Case "2" - CargaDdlCuentasContables(DdlCtaContableAnticipos, 1)' UsuarioActual.Empresa.Funcionalidad(237).Toentero() + CargaDdlCuentasContables(DdlCtaContableAnticipos, 1)' UsuarioActual.Empresa.Funcionalidad(237).Toentero() Case "3" CargaDdlCuentasContables(DdlCtaContableRetIVA, -1) Case "4" @@ -1179,11 +1179,11 @@ Partial Class Clientes Case "5" CargaDdlCuentasContables(DdlCtaContableFondoGarantia, -1) Case "6" - CargaDdlCuentasContables(DdlCtaContableCompClientes, 1)'UsuarioActual.Empresa.Funcionalidad(248).Toentero() + CargaDdlCuentasContables(DdlCtaContableCompClientes, 1)'UsuarioActual.Empresa.Funcionalidad(248).Toentero() Case "7" CargaDdlCuentasContables(DdlCtaContableCompAnticipos, -1) Case "8" - CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, 1)'UsuarioActual.Empresa.Funcionalidad(247).Toentero() + CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, 1)'UsuarioActual.Empresa.Funcionalidad(247).Toentero() Case "9" CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, 1) 'UsuarioActual.Empresa.Funcionalidad(542).Toentero() End Select @@ -1460,14 +1460,14 @@ Partial Class Clientes ' CargaDocs() CargaCombos() CargaDocumentacionCliente() - CargaSubProyectosSuscursales() - 'CargaMetodosPago33() - 'CargaFormaPago33() - 'CargaComboCFDI() - 'CargarPagosNoBancarios() - - - + CargaSubProyectosSuscursales() + 'CargaMetodosPago33() + 'CargaFormaPago33() + 'CargaComboCFDI() + 'CargarPagosNoBancarios() + + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then LnkPorcentajeMarcas.Visible = True LnkPorcentajePrecios.Visible = True @@ -1874,11 +1874,11 @@ Partial Class Clientes End If - RdTipoPersona.SelectedValue = If(ObjClientes.TipoPersona, "1", "0") - RdTipoPersona_SelectedIndexChanged(Nothing, Nothing) - - TxtRepresentanteLegal.Text = ObjClientes.RepresentanteLegal - + RdTipoPersona.SelectedValue = If(ObjClientes.TipoPersona, "1", "0") + RdTipoPersona_SelectedIndexChanged(Nothing, Nothing) + + TxtRepresentanteLegal.Text = ObjClientes.RepresentanteLegal + End If UpActivacionPortal.Update() UpModalPersonaFisica.Update() @@ -2079,31 +2079,31 @@ Partial Class Clientes DdlSucursalFormaPago33.DataSource = GlobalDTVtaFormaPago DdlSucursalFormaPago33.DataBind() End Sub - Private Sub CargaComboCFDI() - Dim RegimenFiscalCliente = DdlRegimenFiscal.SelectedValue.ToString() - If Not UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then - RegimenFiscalCliente = "-1" - End If + Private Sub CargaComboCFDI() + Dim RegimenFiscalCliente = DdlRegimenFiscal.SelectedValue.ToString() + If Not UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then + RegimenFiscalCliente = "-1" + End If DdlUsoCFDI.Items.Clear() - If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then - Dim EsPersonaMoral As Boolean = (RdTipoPersona.SelectedValue = "1") - DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente) - Else - DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente) - End If - + If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then + Dim EsPersonaMoral As Boolean = (RdTipoPersona.SelectedValue = "1") + DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente) + Else + DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente) + End If + DdlUsoCFDI.DataBind() DdlUsoCFDI.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlSucursalUsoCFDI.Items.Clear() DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente) DdlSucursalUsoCFDI.DataBind() - End Sub + End Sub #End Region - + #Region "V E R M Á S" - + Protected Sub BtnVerMasVentas_Click(sender As Object, e As EventArgs) If BtnVerMasVentas.Text = "Ver Más" Then CargaHistorial(-1) @@ -2133,12 +2133,12 @@ Partial Class Clientes CargaBancos(51) BtnVerMasBancos.Text = "Ver Más" End If - End Sub - + End Sub + #End Region - + #Region "B A N C O S" - 'CuentasxCobrar Activas (Pagos Recibidos) + 'CuentasxCobrar Activas (Pagos Recibidos) Private Sub CargaBancos(Optional SelectTop As Integer = 51, Optional CveClienteSucursal As Integer = -1) Dim ObjMovtos As New ClsMovimientos() 'CxC Activas @@ -2201,9 +2201,9 @@ Partial Class Clientes TxtParaMail.Text = TxtCobranzaCorreo.Text UpSendMail.Update() RegistraScript("$('#ModalDivMail').modal('show');") - End Sub + End Sub #End Region - + #Region "B T N ´ S" Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click Dim ObjClientes As New ClsClientes() @@ -2487,34 +2487,34 @@ Partial Class Clientes If UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then - If TxtRFC.Text.ToUpper.Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlRegimenFiscal.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 TxtRFC.Text.ToUpper.Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlUsoCFDI.SelectedValue <> "23" Then - - Alert("El Regimen fiscal del cliente debe ser 'S01 - Sin efectos fiscales' cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) - Exit Sub - - End If - - - End If - - 'CargaSucursal() - 'If UsuarioActual.TienePermisoProceso(170) AndAlso TxtCodigo.Text.Trim = "" Then - ' Alert("Es necesario ingresar un Código", TipoMensaje.MsgAdvertencia) - ' Exit Sub - 'End If - - 'Dim rowcodigo As DataTable = GlobalDTCliente.FiltraParametros(String.Format("Codigo='{0}' AND CveEmpresa={1} ", TxtCodigo.Text.Trim, UsuarioActual.CveEmpresa)) - 'If (Not IsNothing(rowcodigo)) AndAlso (rowcodigo.Rows.Count > 0) AndAlso (rowcodigo.Rows(0)("CveCliente").ToString().Toentero() <> CveCliente) Then - ' Alert(String.Format("ya existe un Cliente Con este Codigo '{0}'", TxtCodigo.Text.Trim), TipoMensaje.MsgAdvertencia) - ' Exit Sub - 'End If + If TxtRFC.Text.ToUpper.Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlRegimenFiscal.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 TxtRFC.Text.ToUpper.Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlUsoCFDI.SelectedValue <> "23" Then + + Alert("El Regimen fiscal del cliente debe ser 'S01 - Sin efectos fiscales' cuando se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia) + Exit Sub + + End If + + + End If + + 'CargaSucursal() + 'If UsuarioActual.TienePermisoProceso(170) AndAlso TxtCodigo.Text.Trim = "" Then + ' Alert("Es necesario ingresar un Código", TipoMensaje.MsgAdvertencia) + ' Exit Sub + 'End If + + 'Dim rowcodigo As DataTable = GlobalDTCliente.FiltraParametros(String.Format("Codigo='{0}' AND CveEmpresa={1} ", TxtCodigo.Text.Trim, UsuarioActual.CveEmpresa)) + 'If (Not IsNothing(rowcodigo)) AndAlso (rowcodigo.Rows.Count > 0) AndAlso (rowcodigo.Rows(0)("CveCliente").ToString().Toentero() <> CveCliente) Then + ' Alert(String.Format("ya existe un Cliente Con este Codigo '{0}'", TxtCodigo.Text.Trim), TipoMensaje.MsgAdvertencia) + ' Exit Sub + 'End If Dim ObjClientes As New ClsClientes() Dim objDoc As New ClsEdocumentacion(ObjClientes.IniciaTransacSQL()) Dim MsgCuentaContable As String = "" @@ -2545,85 +2545,85 @@ Partial Class Clientes Dim errorContPaq As Boolean = False Dim IdContPaqi As Integer = 0 - Dim CodigoPersona As Integer = 0 - - + Dim CodigoPersona As Integer = 0 + + #Region "comentado" - 'If UsuarioActual.Empresa.Funcionalidad(522).ToString() = "1" Then - - ' Dim ObjContPaqi As New ClsContPAQi(UsuarioActual.Empresa) - - ' If ObjContPaqi.GetPersona(TxtRFC.Text) Then - - ' If ObjContPaqi.DtResultados.Rows.Count > 0 Then - - ' IdContPaqi = ObjContPaqi.DtResultados.Rows(0)("Id").ToString().Toentero() - ' CodigoPersona = ObjContPaqi.DtResultados.Rows(0)("Codigo").ToString().Toentero() - - ' Dim Cont_EsProveedor As Integer = If(Boolean.Parse(ObjContPaqi.DtResultados.Rows(0)("EsProveedor").ToString()), 1, 0) - ' Dim Cont_Nombre As String = ObjContPaqi.DtResultados(0)("Nombre").ToString() - ' Dim Cont_RFC As String = ObjContPaqi.DtResultados(0)("RFC").ToString() - - ' If ObjContPaqi.UpdatePersona(IdContPaqi, Cont_Nombre, Cont_RFC, 1, Cont_EsProveedor) Then - ' errorContPaq = False - ' Else - ' errorContPaq = True - ' End If - - ' Else - ' If ObjContPaqi.AddPersona(TxtNombre.Text.Trim, TxtRFC.Text.Trim, 1, 0) Then - - ' IdContPaqi = ObjContPaqi.DtResultados.Rows(0)("IdContPaqiPersona").ToString().Toentero() - ' CodigoPersona = ObjContPaqi.DtResultados.Rows(0)("Codigo").ToString().Toentero() - ' errorContPaq = False - ' Else - ' errorContPaq = True - ' End If - ' End If - ' End If - - - ' If Not errorContPaq Then - ' Dim IdContPaqiCliente As Integer - - ' If ObjContPaqi.GetCliente(-1, CodigoPersona) Then - - ' If ObjContPaqi.DtResultados.Rows.Count > 0 Then - - ' IdContPaqiCliente = ObjContPaqi.DtResultados.Rows(0)("IdContPaqiClient").ToString().Toentero() - - ' If ObjContPaqi.UpdateCliente(IdContPaqiCliente, CodigoPersona, CodigoPersona, "", "") Then - ' errorContPaq = False - ' Else - ' errorContPaq = True - ' End If - ' Else - ' If ObjContPaqi.AddCliente(CodigoPersona, CodigoPersona, "", "") Then - ' errorContPaq = False - ' Else - ' errorContPaq = True - ' End If - ' End If - ' Else - ' errorContPaq = True - ' End If - ' End If - - - ' If Not errorContPaq Then - ' ObjContPaqi.Commit() - ' ObjContPaqi.Dispose() - ' Else - ' ObjContPaqi.RollBack() - ' ObjContPaqi.Dispose() - ' Alert("Se presento un error al guardar en ContPAQi", TipoMensaje.MsgError) - ' Exit Sub - ' End If - - - 'End If + 'If UsuarioActual.Empresa.Funcionalidad(522).ToString() = "1" Then + + ' Dim ObjContPaqi As New ClsContPAQi(UsuarioActual.Empresa) + + ' If ObjContPaqi.GetPersona(TxtRFC.Text) Then + + ' If ObjContPaqi.DtResultados.Rows.Count > 0 Then + + ' IdContPaqi = ObjContPaqi.DtResultados.Rows(0)("Id").ToString().Toentero() + ' CodigoPersona = ObjContPaqi.DtResultados.Rows(0)("Codigo").ToString().Toentero() + + ' Dim Cont_EsProveedor As Integer = If(Boolean.Parse(ObjContPaqi.DtResultados.Rows(0)("EsProveedor").ToString()), 1, 0) + ' Dim Cont_Nombre As String = ObjContPaqi.DtResultados(0)("Nombre").ToString() + ' Dim Cont_RFC As String = ObjContPaqi.DtResultados(0)("RFC").ToString() + + ' If ObjContPaqi.UpdatePersona(IdContPaqi, Cont_Nombre, Cont_RFC, 1, Cont_EsProveedor) Then + ' errorContPaq = False + ' Else + ' errorContPaq = True + ' End If + + ' Else + ' If ObjContPaqi.AddPersona(TxtNombre.Text.Trim, TxtRFC.Text.Trim, 1, 0) Then + + ' IdContPaqi = ObjContPaqi.DtResultados.Rows(0)("IdContPaqiPersona").ToString().Toentero() + ' CodigoPersona = ObjContPaqi.DtResultados.Rows(0)("Codigo").ToString().Toentero() + ' errorContPaq = False + ' Else + ' errorContPaq = True + ' End If + ' End If + ' End If + + + ' If Not errorContPaq Then + ' Dim IdContPaqiCliente As Integer + + ' If ObjContPaqi.GetCliente(-1, CodigoPersona) Then + + ' If ObjContPaqi.DtResultados.Rows.Count > 0 Then + + ' IdContPaqiCliente = ObjContPaqi.DtResultados.Rows(0)("IdContPaqiClient").ToString().Toentero() + + ' If ObjContPaqi.UpdateCliente(IdContPaqiCliente, CodigoPersona, CodigoPersona, "", "") Then + ' errorContPaq = False + ' Else + ' errorContPaq = True + ' End If + ' Else + ' If ObjContPaqi.AddCliente(CodigoPersona, CodigoPersona, "", "") Then + ' errorContPaq = False + ' Else + ' errorContPaq = True + ' End If + ' End If + ' Else + ' errorContPaq = True + ' End If + ' End If + + + ' If Not errorContPaq Then + ' ObjContPaqi.Commit() + ' ObjContPaqi.Dispose() + ' Else + ' ObjContPaqi.RollBack() + ' ObjContPaqi.Dispose() + ' Alert("Se presento un error al guardar en ContPAQi", TipoMensaje.MsgError) + ' Exit Sub + ' End If + + + 'End If #End Region - + Dim LT As String = If(HDLT.Value.ToDouble <> 0, HDLT.Value, "0") Dim LG As String = If(HDLG.Value.ToDouble <> 0, HDLG.Value, "0") @@ -2874,11 +2874,11 @@ Partial Class Clientes ObjClientes.Dispose() objDoc.Dispose() RecargaGlobal() - End Sub - + End Sub + #End Region - - + + #Region "G L O B L A L" Private Sub RecargaGlobal() 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT) @@ -2892,10 +2892,10 @@ Partial Class Clientes ' Application("GlobalDTCliente") = Objclientes.DtResultados 'End If 'Objclientes.Dispose() - End Sub + End Sub #End Region - - + + #Region "G R I D V I E W S" Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -3056,11 +3056,11 @@ Partial Class Clientes End If End If - End Sub + End Sub #End Region - + #Region "R H" - + Private Sub CargaPersonalAsignado() Dim ObjPersonal As New ClsRH If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, CveCliente, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then @@ -3133,9 +3133,9 @@ Partial Class Clientes End If End If - End Sub + End Sub #End Region - + #Region "S U C U R S A L E S" Private Sub LbAgregarSucursal_Click(sender As Object, e As EventArgs) Handles LbAgregarSucursal.Click ChkEstatusSucursal.Checked = True @@ -3267,7 +3267,7 @@ Partial Class Clientes UpModalDivMapa.Update() - End Sub + End Sub #Region "G V S U C U R S A L E S" Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVSucursales.RowDataBound @@ -3389,9 +3389,9 @@ Partial Class Clientes Else CargaGrid("", 0) End If - End Sub + End Sub #End Region - + #Region "G V U S U A R I O S P O R T A L" Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand If e.CommandName = "RestablecerContraseña" Then @@ -3543,9 +3543,9 @@ Partial Class Clientes CargaGrid("", 1) End If - End Sub + End Sub #End Region - + #Region "O R D E N A M I E N T O" Private Sub CargaGrid(Orden As String, gvi As Integer) If gvi = 0 Then @@ -3577,12 +3577,12 @@ Partial Class Clientes UPPUsuarios.Update() End If - End Sub + End Sub #End Region - - + + #End Region - + #Region "U S U A R I O S" Protected Sub LbSolicitudPortal_Click(sender As Object, e As EventArgs) Handles LbEnviarActivacionPortal.Click Dim ObjUsuario As New ClsSisUsuarios @@ -3764,9 +3764,9 @@ Partial Class Clientes ChkPermiso5.Checked = False ChkPermiso6.Checked = False ChkPermiso7.Checked = False - End Sub + End Sub #End Region - + #Region "E V E N T O - B I T A C O R A" Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -3913,17 +3913,17 @@ Partial Class Clientes IdCtaContableRetISR = IdCuentaContable End Select - If CveCliente > 0 Then - Dim ObjClientes As New ClsClientes - If Not ObjClientes.VincularCuentasContables(IdCtaContableClientes, IdCtaContableAnticipos, IdCtaContableRetIVA, IdCtaContableRetISR, CveCliente) Then - TieneError = True - End If - - ObjClientes.Dispose() - End If - - - + If CveCliente > 0 Then + Dim ObjClientes As New ClsClientes + If Not ObjClientes.VincularCuentasContables(IdCtaContableClientes, IdCtaContableAnticipos, IdCtaContableRetIVA, IdCtaContableRetISR, CveCliente) Then + TieneError = True + End If + + ObjClientes.Dispose() + End If + + + Else TieneError = True End If @@ -3975,11 +3975,11 @@ Partial Class Clientes BtnActivaRegistroISR.Visible = True End If - End Sub + End Sub #End Region - + #Region " I M P R I M I R P D F" - + Protected Sub ChkAntIXCNC_CheckedChanged(sender As Object, e As EventArgs) DdlTipoDocto.ClearSelection() If ChkAntIXCNC.Checked Then @@ -4216,20 +4216,20 @@ Partial Class Clientes
Gracias por la atención brindada al presente.
Reciba un cordial saludo.

- ESTE CORREO SE GENERO EN FORMA AUTOMATICA.", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa) - - If UsuarioActual.CveEmpresa = 140 Then + ESTE CORREO SE GENERO EN FORMA AUTOMATICA.", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa) + + If UsuarioActual.CveEmpresa = 140 Then Cuerpo = String.Format("Estimado cliente {0}, se anexa su estado de cuenta con adeudo actual en {1}.

Quedamos a sus ordenes para cualquier duda o aclaración: con su asesor comercial, al teléfono celular del área de Crédito y Cobranza 6624 52 99 64 o a los correos:

- credito@bdhbaterias.com
+ credito@bdhbaterias.com
cobranza@bdhbaterias.com

Gracias por la atención brindada al presente.
Reciba un cordial saludo.

- ESTE CORREO SE GENERO EN FORMA AUTOMATICA, FAVOR DE NO RESPONDERLO.", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa) + ESTE CORREO SE GENERO EN FORMA AUTOMATICA, FAVOR DE NO RESPONDERLO.", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa) End If Dim Hilo As New System.Threading.Thread(Sub() MandaCorreoEstadoCuenta(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Me.CveCliente, File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera en {UsuarioActual.Empresa.Empresa}", Cuerpo, GuardarBitacora:=True)) Hilo.Start() @@ -4315,9 +4315,9 @@ Partial Class Clientes End Using End If - End Sub + End Sub #End Region - + #Region "E N V I O C O R R E O" Private Sub EnviaCorreo(Liga As String, LigaActivar As String) @@ -4385,11 +4385,11 @@ Partial Class Clientes a.GuardaLog() Dim Mail As New ClsSisMail() Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body) - End Sub + End Sub #End Region - + #Region " COTIZACIONES " - + Protected Sub BtnVerMasCot_Click(sender As Object, e As EventArgs) If BtnVerMasCot.Text = "Ver Más" Then CargaCotizaciones(-1) @@ -4459,11 +4459,11 @@ Partial Class Clientes HLFacturar.HRef = $"/Ventas/Ventas.aspx?CveCotizacion={e.Row.DBCampo("CveVenta")}" End If End If - End Sub + End Sub #End Region - + #Region "D I R E C C I O N E N V I O " - + Private Sub CargaCombosDirecionesClientesSAT() CargaDirClientePais() CargaDirClienteEstado() @@ -4577,32 +4577,32 @@ Partial Class Clientes CargaDirClienteEstado() DdlDirClienteEstado.SelectedValueExist(GvRow.DataKey("CveEstado")) CargaDirClienteMunicipio() - DdlDirClienteMunicipio.SelectedValueExist(GvRow.DataKey("CveMunicipio")) - - + DdlDirClienteMunicipio.SelectedValueExist(GvRow.DataKey("CveMunicipio")) + + CargaDirClienteLocalidad() - DdlDirClienteLocalidad.SelectedValueExist(GvRow.DataKey("CveLocalidad")) - - - CargaDirClienteColonia() + DdlDirClienteLocalidad.SelectedValueExist(GvRow.DataKey("CveLocalidad")) + + + CargaDirClienteColonia() DdlDirClienteColonia.SelectedValueExist(GvRow.DataKey("CveColonia")) - ChkEstatus.Checked = If(GvRow.DataKey("Estatus").ToString() = "True", True, False) - - If GvRow.DataKey("CveClienteSucursal").ToEntero() > 0 Then - DdlClienteSucursalEnvio.SelectedValueExist(GvRow.DataKey("CveClienteSucursal")) - Else + ChkEstatus.Checked = If(GvRow.DataKey("Estatus").ToString() = "True", True, False) + + If GvRow.DataKey("CveClienteSucursal").ToEntero() > 0 Then + DdlClienteSucursalEnvio.SelectedValueExist(GvRow.DataKey("CveClienteSucursal")) + Else DdlClienteSucursalEnvio.SelectedValueExist("-1") - End If - - - Dim CveSubProyectoClienteSucursal As Integer = GvRow.DataKey("CveSubProyecto").ToEntero - - DdlSubProyectoClienteSucursal.SelectedValueExist("-1") - If CveSubProyectoClienteSucursal > 0 Then - DdlSubProyectoClienteSucursal.SelectedValueExist(CveSubProyectoClienteSucursal) - End If - + End If + + + Dim CveSubProyectoClienteSucursal As Integer = GvRow.DataKey("CveSubProyecto").ToEntero + + DdlSubProyectoClienteSucursal.SelectedValueExist("-1") + If CveSubProyectoClienteSucursal > 0 Then + DdlSubProyectoClienteSucursal.SelectedValueExist(CveSubProyectoClienteSucursal) + End If + UpAddDireccion.Update() RegistraScript("$('#divAddDireccionEnvio').modal();") End Sub @@ -4648,7 +4648,7 @@ Partial Class Clientes TxtEnvioTel.Text = "" DdlClienteSucursalEnvio.SelectedValue = "-1" - CargaCombosDirecionesClientesSAT() + CargaCombosDirecionesClientesSAT() DdlSubProyectoClienteSucursal.SelectedValueExist("-1") 'DdlDirClientePais.SelectedValueExist(-1) @@ -4678,12 +4678,12 @@ Partial Class Clientes End If CargaDireccionesEnvio() - End Sub - + End Sub + #End Region - + #Region " IMPORTAR SALDOS " - + Private Sub HLImportarSaldos_Click(sender As Object, e As EventArgs) Handles HLImportarSaldos.Click CargaClientesImportarSaldos() RegistraScript(String.Format("$('#{0}').modal();", "DivImportarSaldos")) @@ -4787,9 +4787,9 @@ Partial Class Clientes e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("ChkSaldo(this,{0},{1});", e.Row.FCTextBox("TxtImporte").ClientID, e.Row.DBCampo("Saldo"))) e.Row.FCTextBox("TxtImporte").Attributes.Add("onKeyUp", String.Format("CambiaSaldo({0},this,{1});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo"))) End If - End Sub + End Sub #End Region - + #Region "Cuentas/Equipos" Public Sub BtnAgregarCtaEquipo_Click(sender As Object, e As EventArgs) HdnModalidad.Value = "I" @@ -5377,9 +5377,9 @@ Partial Class Clientes End If Return Retorno - End Function + End Function #End Region - + #Region "GPS" Protected Sub btnCargaArrayDisp_Click(sender As Object, e As EventArgs) Handles btnCargaArrayDisp.Click If hdnArrayDispositivo.Value.Length > 0 Then @@ -5520,10 +5520,10 @@ Partial Class Clientes UpMoverDispositivo.Update() RegistraScript($"CargaModalMoverDispositivo({GvRow.DataKey("CveDispositivo")});") - End Sub - + End Sub + #End Region - + #Region "Sucursales" Public Sub CreaDTSucursales() @@ -5757,14 +5757,14 @@ Partial Class Clientes End If End If End If - End Sub - + End Sub + #End Region - + #Region "G P S" - - - + + + Private Sub EnviaCorreoGPS(Liga As String, LigaActivar As String) Try @@ -5835,16 +5835,16 @@ Partial Class Clientes End If ObjClientes.Dispose() - End Sub - - + End Sub + + #End Region - + #Region "C O N T R A T O S" - - - - + + + + Private Sub CargaDatosContrato() If CveCliente <= 0 Then Exit Sub @@ -5889,10 +5889,10 @@ Partial Class Clientes e.Row.CssClass = "Totales white" End If End If - End Sub - + End Sub + #End Region - + #Region "M E T O D O S " Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipo.SelectedIndexChanged If DTHistorialVentas IsNot Nothing AndAlso RblTipo.SelectedValue <> "-1" Then @@ -6302,13 +6302,13 @@ Partial Class Clientes End If - End Sub - + End Sub + #End Region - + #Region "IMPRIMIR GVHistorial" - - + + Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs) Dim retorno As Byte() = Nothing Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) @@ -6391,18 +6391,18 @@ Partial Class Clientes ObjClientes.Dispose() Return retorno - End Function - - + End Function + + #End Region - + #Region "C O B R A N Z A" Public Sub Visitas_Click(sender As Object, e As EventArgs) RegistraScript(String.Format("$('#{0}').modal();", "DivVisitas")) - End Sub - + End Sub + #End Region - + #Region "Usuarios" Protected Sub GvUsuarios_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvUsuarios.RowDeleting Dim CveUsuario As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveUsuario").ToEntero() @@ -6437,12 +6437,12 @@ Partial Class Clientes e.Row.Cells(5).Visible = False End If End If - End Sub + End Sub #End Region - - + + #Region "C U E N T A S - B A N C A R I A S" - + Private Sub CargaCuentasBancarias(Optional RecargaGlobal As Boolean = False) If CveCliente <= 0 Then Exit Sub @@ -6615,8 +6615,8 @@ Partial Class Clientes TxtNumeroCuenta2.Text = "" TxtConvenioCIE2.Text = "" TxtReferencia2.Text = "" - End Sub - + End Sub + #Region "GRIDVIEW - CUENTAS BANCARIAS" Protected Sub GvBancosCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -6672,10 +6672,10 @@ Partial Class Clientes GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, -1, True) = Nothing End If - End Sub - + End Sub + #End Region - + Private Sub CargaPSGridCuentasBancos() If CveCliente > 0 Then GvBancosCuentas.DataSource = DTCuentasBancos @@ -6733,9 +6733,9 @@ Partial Class Clientes divestatus.Visible = True UpAddBancos.Update() RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddCuentasBancarias")) - End Sub + End Sub #End Region - + #Region "C L I E N T E S P A G O S R E A L I Z A D O S I M P R I M I R P D F/Excel" Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkPagosClientesBancosExcel.Click GenerarPDF("Excel") @@ -6761,11 +6761,11 @@ Partial Class Clientes ImprimirPDF("Empresas\Grales\Formatos\RepClientesPagosBancos.rdlc", DTCobrosRealizados, params, "RepClientesPagosBancos_" & Now.ToString("yyyyMMddhhmmss"), Formato:=Formato) - End Sub + End Sub #End Region - + #Region "VENTAS" - + Public Function imprimirFacturaVenta(CveVenta As Integer) As Byte() Dim ObjVentas As New ClsVentas Dim Vta As Modelos.Factura = Nothing @@ -6996,10 +6996,10 @@ Partial Class Clientes ObjVentas.Dispose() Return PdfFactura(Vta) - End Function - + End Function + #End Region - + #Region "COMERCIO EXTERIOR" Public Sub CargaCombosComercioExterior() @@ -7123,12 +7123,12 @@ Partial Class Clientes End Sub Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs) CargaColonia() - End Sub - + End Sub + #End Region - + #Region "D O C U M E N T A C I O N " - + Private Sub CargaDocumentacionCliente() Dim objRH As New ClsEdocumentacion() @@ -7423,9 +7423,9 @@ Partial Class Clientes Dim stringDescargaDocumento As String = "" - If GvRow.DataKey("Documentacion") = "Pagaré" AndAlso UsuarioActual.CveEmpresa = 140 Then - - + If GvRow.DataKey("Documentacion") = "Pagaré" AndAlso UsuarioActual.CveEmpresa = 140 Then + + stringDescargaDocumento = UsuarioActual.Empresa.Ruta & "Formatos\Pagaré.docx" linkDescargaPagare = stringDescargaDocumento TxtDireccionAval.Text = "" @@ -7462,64 +7462,89 @@ Partial Class Clientes Protected Sub ImprimirPagare(sender As Object, e As EventArgs) Handles BtnAgregarPagare.Click Dim memoryStreamDoc As New System.IO.MemoryStream - Dim objGemBoxDocument As New clsGemBoxDocument(linkDescargaPagare) - Dim Tags As New List(Of TagsDocumentos) - Dim ObjClientes As New ClsClientes - Dim monto As String = "" - Dim razonSocial As String = "" - Dim direccion As String = "" - Dim ciudad As String = "" - Dim Telefono As String = "" - Dim mesArray = New String() {"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"} - Dim hoy As DateTime = DateTime.Now - Dim fechaConFormato As String = String.Format("{0} de {1} del {2}", hoy.Day, mesArray(hoy.Month), hoy.Year) - - If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then - monto = ObjClientes.DtResultados.FiltroPrimeroValor("LimiteCredito").ToDouble.ToString("N") - razonSocial = ObjClientes.DtResultados.FiltroPrimeroValor("NombreComercial") - direccion = ObjClientes.DtResultados.FiltroPrimeroValor("Direccion") - ciudad = ObjClientes.DtResultados.FiltroPrimeroValor("Ciudad") - Telefono = ObjClientes.DtResultados.FiltroPrimeroValor("Telefono") - End If - - Tags.Add(New TagsDocumentos("{Monto}", monto)) - Tags.Add(New TagsDocumentos("{Fecha}", fechaConFormato)) - Tags.Add(New TagsDocumentos("{FechaConFormato}", fechaConFormato)) - Tags.Add(New TagsDocumentos("{CantidadLetra}", monto.ToDouble.Texto2Letras(1))) - Tags.Add(New TagsDocumentos("{RazonSocial}", razonSocial)) - Tags.Add(New TagsDocumentos("{Direccion}", direccion)) - Tags.Add(New TagsDocumentos("{Ciudad}", ciudad)) - Tags.Add(New TagsDocumentos("{Telefono}", Telefono)) - Tags.Add(New TagsDocumentos("{RazonSocialAval}", TxtAval.Text)) - Tags.Add(New TagsDocumentos("{DireccionAval}", TxtDireccionAval.Text)) - Tags.Add(New TagsDocumentos("{CiudadAval}", TxtCiudadAval.Text)) - Tags.Add(New TagsDocumentos("{TelefonoAval}", TxtTelefonoAval.Text)) - Tags.Add(New TagsDocumentos("{RepresentanteLegal}", TxtRepresentanteLegal.Text)) - - - - If Not ObjClientes.AddClientePagare(CveCliente, UsuarioActual.CveEmpresa, TxtAval.Text, TxtDireccionAval.Text) Then - Alert("no se pudo registrar el pagare") + If Not File.Exists(linkDescargaPagare) Then + Alert("No existe el formato", TipoMensaje.MsgAdvertencia) Exit Sub End If + Dim objGemBoxDocument As New clsGemBoxDocument(linkDescargaPagare) + Dim Tags As New List(Of TagsDocumentos) + + Dim ObjClientes As New ClsClientes + Dim TieneError As Boolean = False + + Try + Dim monto As String = "" + Dim razonSocial As String = "" + Dim direccion As String = "" + Dim colonia As String = "" + Dim noInt As String = "" + Dim noExt As String = "" + Dim ciudad As String = "" + Dim estado As String = "" + Dim Telefono As String = "" + Dim mesArray = New String() {"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"} + Dim hoy As DateTime = DateTime.Now + Dim fechaConFormato As String = String.Format("{0} de {1} del {2}", hoy.Day, mesArray(hoy.Month), hoy.Year) + + If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then + monto = ObjClientes.DtResultados.FiltroPrimeroValor("LimiteCredito").ToDouble.ToString("N") + razonSocial = ObjClientes.DtResultados.FiltroPrimeroValor("NombreComercial") + direccion = ObjClientes.DtResultados.FiltroPrimeroValor("Direccion") + colonia = ObjClientes.DtResultados.FiltroPrimeroValor("Colonia") + noInt = ObjClientes.DtResultados.FiltroPrimeroValor("NoInt") + noExt = ObjClientes.DtResultados.FiltroPrimeroValor("NoExt") + ciudad = ObjClientes.DtResultados.FiltroPrimeroValor("Ciudad") + estado = ObjClientes.DtResultados.FiltroPrimeroValor("Estado") + Telefono = ObjClientes.DtResultados.FiltroPrimeroValor("Telefono") + End If + + Tags.Add(New TagsDocumentos("{Monto}", monto)) + Tags.Add(New TagsDocumentos("{Fecha}", fechaConFormato)) + Tags.Add(New TagsDocumentos("{FechaConFormato}", fechaConFormato)) + Tags.Add(New TagsDocumentos("{CantidadLetra}", monto.ToDouble.Texto2Letras(1))) + Tags.Add(New TagsDocumentos("{RazonSocial}", razonSocial)) + Tags.Add(New TagsDocumentos("{Direccion}", String.Format("{0} #{1} {2}, COL.{3}", direccion, noInt, noExt, colonia).ToUpper())) + Tags.Add(New TagsDocumentos("{Ciudad}", String.Format("{0}, {1}", ciudad, estado).ToUpper())) + Tags.Add(New TagsDocumentos("{Telefono}", Telefono)) + Tags.Add(New TagsDocumentos("{RazonSocialAval}", TxtAval.Text)) + Tags.Add(New TagsDocumentos("{DireccionAval}", TxtDireccionAval.Text)) + Tags.Add(New TagsDocumentos("{CiudadAval}", TxtCiudadAval.Text)) + Tags.Add(New TagsDocumentos("{TelefonoAval}", TxtTelefonoAval.Text)) + Tags.Add(New TagsDocumentos("{RepresentanteLegal}", TxtRepresentanteLegal.Text)) + + If Not ObjClientes.AddClientePagare(CveCliente, UsuarioActual.CveEmpresa, TxtAval.Text, TxtDireccionAval.Text) Then + Alert("no se pudo registrar el pagare") + TieneError = True + End If + + If Not TieneError Then + Alert("Pagaré registrado con exito") + End If + Catch ex As Exception + OnError("Ocurrió un error al registrar el pagare", ex) + End Try + ObjClientes.Dispose() + 'objGemBoxDocument.AgregarImagen(RutaLogo, 61.0, 53.0) RegistraScript("$('#ModalDivPagare').modal('hide')") - Alert("Pagaré registrado con exito") - objGemBoxDocument.SustituirTags(Tags) - objGemBoxDocument.GuardarStream() - Dim memoryStream As New System.IO.MemoryStream(objGemBoxDocument.GetBytesDocumento()) - objGemBoxDocument.Dispose() - ObjClientes.Dispose() - Response.Clear() - Response.ContentType = "application/text" - Response.AddHeader("content-disposition", "attachment;filename=pagare.docx") - Response.Buffer = True - memoryStream.WriteTo(Response.OutputStream) - Response.End() - memoryStream.Dispose() + If Not TieneError Then + objGemBoxDocument.SustituirTags(Tags) + objGemBoxDocument.GuardarStream() + Dim memoryStream As New System.IO.MemoryStream(objGemBoxDocument.GetBytesDocumento()) + objGemBoxDocument.Dispose() + + Response.Clear() + Response.ContentType = "application/text" + Response.AddHeader("content-disposition", "attachment;filename=pagare.docx") + Response.Buffer = True + memoryStream.WriteTo(Response.OutputStream) + Response.End() + memoryStream.Dispose() + End If + End Sub @@ -7626,19 +7651,19 @@ Partial Class Clientes End If End Sub - Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs) - - + Public Sub DownLoadFormato_ClickDocumentacion(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim Adjunto As String = GvRow.DataKey("Adjunto") Dim stringDescargaDocumento As String = "" - Dim asdasd = GvRow.DataKey("Documentacion") - - If GvRow.DataKey("Documentacion").ToUpper = "Pagaré".ToUpper AndAlso UsuarioActual.CveEmpresa = 140 Then - - + Dim asdasd = GvRow.DataKey("Documentacion") + + If GvRow.DataKey("Documentacion").ToUpper = "Pagaré".ToUpper AndAlso UsuarioActual.CveEmpresa = 140 Then + + stringDescargaDocumento = UsuarioActual.Empresa.Ruta & "Formatos\Pagaré.docx" linkDescargaPagare = stringDescargaDocumento TxtDireccionAval.Text = "" @@ -7648,30 +7673,30 @@ Partial Class Clientes RegistraScript("$('#ModalDivPagare').modal('show')") - Else - - - Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero() - Dim DocumentacionFormato As String = CveDocumentacion & "_" & GvRow.DataKey("DocumentacionFormato") - + Else + + + Dim CveDocumentacion As Integer = GvRow.DataKey("CveDocumentacion").ToString().ToEntero() + Dim DocumentacionFormato As String = CveDocumentacion & "_" & GvRow.DataKey("DocumentacionFormato") + DescarFormato(DocumentacionFormato) - End If - - - - - - + End If + + + + + + End Sub Public Sub DescarFormato(documento As String) Dim PathRoot As String = Server.MapPath("/") Dim PathSource As String Dim pathDesti As String - Dim fname As String = "" - - - + Dim fname As String = "" + + + PathSource = UsuarioActual.Empresa.Ruta & "Formatos\" & documento pathDesti = PathRoot & "Temp\" & CveCliente & documento @@ -7720,20 +7745,20 @@ Partial Class Clientes End If - End Sub - - - + End Sub + + + Private Sub RegistraDescargaJavaScript(baseUrl As String) RegistraScript("Download('" & baseUrl & "')") - End Sub - + End Sub + #End Region - + #Region "D O C U M E N T O S V E N T A S" - + Private Sub CargaDocumentosVenta(tCveCliente As Integer) Dim objInv As New ClsEdocumentacion @@ -7904,11 +7929,11 @@ Partial Class Clientes objRH.Dispose() - End Sub - - + End Sub + + #End Region - + #Region "PERSONA FISICA" Protected Sub LnkPersonaFisica_Click(sender As Object, e As EventArgs) RegistraScript("$('#DivModalPersonaFisica').modal();") @@ -7933,9 +7958,9 @@ Partial Class Clientes ObjCliente.Dispose() UpDatos.Update() - End Sub + End Sub #End Region - + #Region "USUARIOS PLATAFORMA CLIENTE - 6 " Protected Sub CargaUsuariosPortalCliente() Dim objUsuario As ClsSisUsuarios = New ClsSisUsuarios @@ -7944,19 +7969,19 @@ Partial Class Clientes GvUsuarios.DataBind() End If objUsuario.Dispose() - End Sub + End Sub #End Region - + #Region " DEVOLVER DINERO ANT/NC " Private Sub InicializaDevolverDinero() If UsuarioActual.TienePermisoProceso(247) Then GVAnticipos.Columns(6).Visible = True End If - End Sub + End Sub #End Region - + #Region "MODAL GRAFICA/PEDIDOS" - + Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs) If CargaDatatables() Then RegistraScript("$('#DivModalGrafica').modal('show')") @@ -8293,13 +8318,13 @@ Partial Class Clientes RegistraScript($"CargaGraficaCompratamientoSaldoMensual({Dt5.ToJson},{Dt6.ToJson.Replace($"{Chr(34)}True{Chr(34)}", "true").Replace($"{Chr(34)}False{Chr(34)}", "false")})", "55") UPModalProd.Update() - End Sub - - + End Sub + + #End Region - + #Region "TAB - COMPORTAMIENTO DE VENTAS" - + Private Sub CargaGrupo() DdlGrupo.Items.Insert(0, New ListItem("Categoria", "3")) DdlGrupo.Items.Insert(1, New ListItem("Clasificacion", "4")) @@ -8483,12 +8508,12 @@ Partial Class Clientes ObjVentas.Dispose() GvComportamientoVenta.DataBind() UpDatosComportamientoVenta.Update() - End Sub - + End Sub + #End Region - + #Region "DISPOSITIVOS" - + Protected Sub LnkMoverDispositivo_Click(sender As Object, e As EventArgs) Dim CveDispositivo As Integer = HdnCveDispositivoMover.Value.ToEntero() Dim CveCliente As Integer = DdlClienteDispositivo.SelectedValue.ToEntero() @@ -8526,10 +8551,10 @@ Partial Class Clientes CargaEventoBitacora() NombreDispositivo = "" RegistraScript("$('#DivMoverDispositivo').modal('hide');") - End Sub - + End Sub + #End Region - + #Region "CRM" Protected Sub CargaDatosCRM() Dim ObjCRM = New ClsCRM() @@ -8629,9 +8654,9 @@ Partial Class Clientes Alert("Se Unificó correctamente al Cliente con la Empresa CRM.") End If End If - End Sub + End Sub #End Region - + #Region "PORCENTAJE PRECIO DE MARCAS" Private Sub LnkPorcentajeMarcas_Click(sender As Object, e As EventArgs) Handles LnkPorcentajeMarcas.Click RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajeMarcas")) @@ -8855,9 +8880,9 @@ Partial Class Clientes ObjPS.Dispose() - End Sub + End Sub #End Region - + #Region "PORCENTAJE PRECIO DE PRODUCTOS" Private Sub LnkPorcentajePrecios_Click(sender As Object, e As EventArgs) Handles LnkPorcentajePrecios.Click RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajePrecios")) @@ -9093,12 +9118,12 @@ Partial Class Clientes Protected Sub BtnCambiaPorcentaje_Click(sender As Object, e As EventArgs) DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero(), DdlProducto2) - End Sub + End Sub #End Region - + #Region " A C U M U L A D O R E S" - - + + Protected Sub LnkFacturaUsadosCargos_Click(sender As Object, e As EventArgs) 'CveVentaNota = 0 @@ -9270,8 +9295,8 @@ Partial Class Clientes e.Row.FCCheckBox("ChkBonificacion").Visible = False End If - If e.Row.DBCampo("ImporteBonificacion").ToDecimal() = 0 Then - e.Row.FCCheckBox("ChkBonificacion").Visible = False + If e.Row.DBCampo("ImporteBonificacion").ToDecimal() = 0 Then + e.Row.FCCheckBox("ChkBonificacion").Visible = False End If End If @@ -9741,11 +9766,11 @@ Partial Class Clientes ' ObjFactura.Timbre = PreParaTimbre(ObjFactura) - End Sub - - + End Sub + + #End Region - + #Region "C L I E N T E S G R I D S I M P R I M I R P D F/Excel" Private Sub LnkCotizacionesPDF_Click(sender As Object, e As EventArgs) Handles LnkCotizacionesPDF.Click ImprimeGridsProveedores("PDF", DtCotizaciones, "RepClientesCotizaciones") @@ -9820,7 +9845,7 @@ Partial Class Clientes End If Acum.Dispose() - End Sub + End Sub #End Region Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs) If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then @@ -10249,39 +10274,39 @@ Partial Class Clientes Alert("Los cambios se guardaron satisfactoriamente.") End Using - End Sub - - Protected Sub RdTipoPersona_SelectedIndexChanged(sender As Object, e As EventArgs) - - DVRegimenSociedad.Visible = False - DivRazonSocial2.Attributes.Add("class", "col-md-12") - - If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then - DivRazonSocial2.Attributes.Add("class", "col-md-8") - DVRegimenSociedad.Visible = True - TxtNombreComercial.Enabled = False - Else - TxtNombreComercial.Enabled = True - End If - ' DdlRegimenFiscal.SelectedIndex = -1 - - 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 = " & DdlRegimenFiscal.SelectedValue) - If Val = "" Then 'sino encuentra valor, lo limpia - DdlRegimenFiscal.Items.Clear() - DdlRegimenFiscal.SelectedValue = Nothing - End If - End If - - DdlRegimenFiscal.DataSource = dt - DdlRegimenFiscal.DataBind() - DdlRegimenFiscal.SelectedValueExist(Val) - UpDatos.Update() - End Sub - + End Sub + + Protected Sub RdTipoPersona_SelectedIndexChanged(sender As Object, e As EventArgs) + + DVRegimenSociedad.Visible = False + DivRazonSocial2.Attributes.Add("class", "col-md-12") + + If RdTipoPersona.SelectedValue.ToEntero = 1 And UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then + DivRazonSocial2.Attributes.Add("class", "col-md-8") + DVRegimenSociedad.Visible = True + TxtNombreComercial.Enabled = False + Else + TxtNombreComercial.Enabled = True + End If + ' DdlRegimenFiscal.SelectedIndex = -1 + + 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 = " & DdlRegimenFiscal.SelectedValue) + If Val = "" Then 'sino encuentra valor, lo limpia + DdlRegimenFiscal.Items.Clear() + DdlRegimenFiscal.SelectedValue = Nothing + End If + End If + + DdlRegimenFiscal.DataSource = dt + DdlRegimenFiscal.DataBind() + DdlRegimenFiscal.SelectedValueExist(Val) + UpDatos.Update() + End Sub + End Class From 4fafd9d3e696f26ae23eef95995dde350a62db88 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 26 Aug 2022 18:32:03 -0700 Subject: [PATCH 2/3] Correcion de PU en 0 al aplicar devolicion de almacen --- Inventarios/EntregaAlmacen.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index f14e37152..47477ca47 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2493,7 +2493,7 @@ Partial Class Inventarios_EntregaAlmacen If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then 'CveSeccionAlmacen = DtExistencias.FiltroPrimeroValor("CveSeccionAlmacen", $"ISNULL(CveTipoAlmacenDevolucion,0) <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToEntero - PU = DtExistencias.FiltroPrimeroValor("PU", $"CveTipoAlmacenDevolucion <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal + PU = DtExistencias.FiltroPrimeroValor("PU", $"ISNULL(CveTipoAlmacenDevolucion,-1) <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal End If If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), CveVentaDetalleRemision:=Dr("CveVentaDetalleRemision").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then From 18ed7e7f5473f9495f4fde1bfaa33ee49f4b8852 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 26 Aug 2022 18:33:11 -0700 Subject: [PATCH 3/3] Error de compilacion --- Bancos/PagoDeudor.aspx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index c4e0bac4f..611b02810 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -365,7 +365,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas { MsgError = "No se pudo insertar concepto de bancos complementaria"; } - s + // BANCOS if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, TxtImportePrestamo.Text.ToDecimal(), Ref, CveConceptoContableBanco, Conc, IDCtaContableBancosPrestamo, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: TxtImportePrestamo.Text.ToDecimal(), ImporteME: TxtImportePrestamo.Text.ToDecimal(), TipoCambio: tipoCambio, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) {