From 951814f050360a3f5788f4720273b49532891f66 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 9 Dec 2023 09:09:26 -0700 Subject: [PATCH] -- quitar combo de cuentas IdCta --- Compras/Proveedores.aspx | 329 +-------------------- Compras/Proveedores.aspx.vb | 562 +++++++++++++----------------------- 2 files changed, 208 insertions(+), 683 deletions(-) diff --git a/Compras/Proveedores.aspx b/Compras/Proveedores.aspx index 7d885cd86..debc9c3d0 100644 --- a/Compras/Proveedores.aspx +++ b/Compras/Proveedores.aspx @@ -887,334 +887,7 @@
- - - - - - - - - - - -
-
-
-
- - Cuentas Contables Proveedores -
-
-
-
-
-
- - -
-
-
- - - - - - - - - - - - - - -
Proveedores: - - - - - - -
Extranjera: - - - -
- - - - -
-
-
-
- - -
-
-
- - Cuentas Contables Anticipos -
-
-
-
-
-
- - -
-
-
- - - - - - - - - - - - - - -
Anticipos: - - - - - -
Extranjera: - - - -
- - - - -
-
-
- -
- - - -
-
-
- - Cuentas Contables Deudores -
-
-
-
-
-
- - -
-
-
- - - - - - - - - - - - - - -
Deudores: - - - - - -
Extranjera: - - - -
- - - - -
-
-
-
-
-
-
- - Cuentas Contables Otros - -
-
-
-
-
- -
- - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Ret. IVA: - - - -
Ret. IVA Acreditable: - - - -
Fondo de Garantia: - - - -
Ret. ISR x Acreditar: - - - -
Ret. ISR Acreditable: - - - -
-
-
-
-
+ diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 6b144f494..d4b2ccf60 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -4,7 +4,6 @@ Option Strict On Imports System.Data Imports Extensiones Imports System.Xml -'Imports msExcel = Microsoft.Office.Interop.Excel Imports Microsoft.Reporting.WebForms Imports System.IO Imports System.Globalization @@ -606,7 +605,6 @@ Partial Class Compras_Proveedores If UsuarioActual.Empresa.CvePlataforma = 2 Then DivFiscal.Visible = False - TrFondoGarantia.Visible = False 'divportalusuarios.Visible = False End If @@ -803,9 +801,6 @@ Partial Class Compras_Proveedores End If End If - - DdlCtaContProveedores.Attributes.Add("onclick", "CargaCuentas(1);") - Catch ex As Exception Alert(String.Format("No se pudo cargar la información ({0})", ex.Message), TipoMensaje.MsgAdvertencia) Return 0 @@ -915,59 +910,6 @@ Partial Class Compras_Proveedores divCuentasContp.Visible = True End If - 'Contable - If UsuarioActual.Empresa.UsaContabilidad Then - DdlCtaContAcreedores.AutoPostBack = True - DdlCtaContProveedores.AutoPostBack = True - DdlCtaContAnticipos.AutoPostBack = True - DdlCtaContFondoGarantia.AutoPostBack = True - DdlCtaContRetIVA.AutoPostBack = True - DdlCtaContRetIVAAcreditable.AutoPostBack = True - DdlCtaContRetISR.AutoPostBack = True - DdlCtaContComplementaria.AutoPostBack = True - DdlCtaContExtranjera.AutoPostBack = True - DdlCtaContDeudor.AutoPostBack = True - DdlCtaContDeudorExtranjera.AutoPostBack = True - DdlCtaContDeudorComplementaria.AutoPostBack = True - DdlCtaContDocsXPagar.AutoPostBack = True - DdlCtaContDocsXPagarExtranjera.AutoPostBack = True - DdlCtaContDocsXPagarComplementaria.AutoPostBack = True - DdlCtaContRetISRAcreditable.AutoPostBack = True - - 'Proveedores - Dim drr As DataRow = ObjProveedor.DtResultados.Rows(0) - 'If drr("IdCtaContProveedores").ToString <> "" Then DdlCtaContProveedores.Items.Add(New ListItem(drr("CtaContProveedores").ToString, drr("IdCtaContProveedores").ToString)) : DdlCtaContProveedores.SelectedValueExist(drr("IdCtaContProveedores").ToString) - 'If drr("IdCtaContExtranjera").ToString <> "" Then DdlCtaContExtranjera.Items.Add(New ListItem(drr("CtaContExtranjera").ToString, drr("IdCtaContExtranjera").ToString)) : DdlCtaContExtranjera.SelectedValue = drr("IdCtaContExtranjera").ToString - 'If drr("IdCtaContComplementaria").ToString <> "" Then DdlCtaContComplementaria.Items.Add(New ListItem(drr("CtaContComplementaria").ToString, drr("IdCtaContComplementaria").ToString)) : DdlCtaContComplementaria.SelectedValue = drr("IdCtaContComplementaria").ToString - - 'If drr("IdCtaContAnticipos").ToString <> "" Then DdlCtaContAnticipos.Items.Add(New ListItem(drr("CtaContAnticipos").ToString, drr("IdCtaContAnticipos").ToString)) : DdlCtaContAnticipos.SelectedValueExist(drr("IdCtaContAnticipos").ToString) - 'If drr("IdCtaContAnticiposExtranjera").ToString <> "" Then DdlCtaContAnticiposExtranjera.Items.Add(New ListItem(drr("CtaContAnticiposExtranjera").ToString, drr("IdCtaContAnticiposExtranjera").ToString)) : DdlCtaContAnticiposExtranjera.SelectedValue = drr("IdCtaContAnticiposExtranjera").ToString - 'If drr("IdCtaContAnticiposComplementaria").ToString <> "" Then DdlCtaContAnticiposComplementaria.Items.Add(New ListItem(drr("CtaContAnticiposComplementaria").ToString, drr("IdCtaContAnticiposComplementaria").ToString)) : DdlCtaContAnticiposComplementaria.SelectedValue = drr("IdCtaContAnticiposComplementaria").ToString - - DdlCtaContProveedores.Attributes.Add("onclick", "CargaCuentas(1);") - DdlCtaContAcreedores.Attributes.Add("onclick", "CargaCuentas(6);") - DdlCtaContAnticipos.Attributes.Add("onclick", "CargaCuentas(2);") - DdlCtaContFondoGarantia.Attributes.Add("onclick", "CargaCuentas(3);") - DdlCtaContRetIVA.Attributes.Add("onclick", "CargaCuentas(4);") - DdlCtaContRetISR.Attributes.Add("onclick", "CargaCuentas(5);") - DdlCtaContComplementaria.Attributes.Add("onclick", "CargaCuentas(7);") - DdlCtaContExtranjera.Attributes.Add("onclick", "CargaCuentas(8);") - DdlCtaContAcreedoresExtranjera.Attributes.Add("onclick", "CargaCuentas(9);") - DdlCtaContAcreedoresComplementaria.Attributes.Add("onclick", "CargaCuentas(10);") - DdlCtaContAnticiposExtranjera.Attributes.Add("onclick", "CargaCuentas(11);") - DdlCtaContAnticiposComplementaria.Attributes.Add("onclick", "CargaCuentas(12);") - DdlCtaContDeudor.Attributes.Add("onclick", "CargaCuentas(13);") - DdlCtaContDeudorExtranjera.Attributes.Add("onclick", "CargaCuentas(14);") - DdlCtaContDeudorComplementaria.Attributes.Add("onclick", "CargaCuentas(15);") - DdlCtaContDocsXPagar.Attributes.Add("onclick", "CargaCuentas(16);") - DdlCtaContDocsXPagarExtranjera.Attributes.Add("onclick", "CargaCuentas(17);") - DdlCtaContDocsXPagarComplementaria.Attributes.Add("onclick", "CargaCuentas(18);") - DdlCtaContRetISRAcreditable.Attributes.Add("onclick", "CargaCuentas(19);") - DdlCtaContRetIVAAcreditable.Attributes.Add("onclick", "CargaCuentas(20);") - - - End If - 'CxP TxtLimiteCredito.Text = ObjProveedor.LimiteCredito.ToString.FormatoNumero TxtPlazoCobranza.Text = ObjProveedor.PlazoPago.ToString @@ -1385,96 +1327,6 @@ Partial Class Compras_Proveedores End Sub - Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click - - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - - - If DtCuentasContables Is Nothing Then - - End If - - Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) - - Select Case HdnCuenta.Value - Case "1" - CargaCuentasDDL(DdlCtaContProveedores, If(DdlCveTipoProveedor.SelectedValue = "2", 202, 201)) - Case "2" - CargaCuentasDDL(DdlCtaContAnticipos, 204) - Case "3" - CargaCuentasDDL(DdlCtaContFondoGarantia, 231) - Case "4" - CargaCuentasDDL(DdlCtaContRetIVA, 206) - Case "5" - CargaCuentasDDL(DdlCtaContRetISR, 206) - Case "6" - CargaCuentasDDL(DdlCtaContAcreedores, 202) - Case "7" - CargaCuentasDDL(DdlCtaContComplementaria, 201) - Case "8" - CargaCuentasDDL(DdlCtaContExtranjera, 201) - Case "9" - CargaCuentasDDL(DdlCtaContAcreedoresExtranjera, 202) - Case "10" - CargaCuentasDDL(DdlCtaContAcreedoresComplementaria, 202) - Case "11" - CargaCuentasDDL(DdlCtaContAnticiposExtranjera, 204) - Case "12" - CargaCuentasDDL(DdlCtaContAnticiposComplementaria, 204) - Case "13" - CargaCuentasDDL(DdlCtaContDeudor, 205) - Case "14" - CargaCuentasDDL(DdlCtaContDeudorExtranjera, 205) - Case "15" - CargaCuentasDDL(DdlCtaContDeudorComplementaria, 205) - Case "16" - CargaCuentasDDL(DdlCtaContDocsXPagar, 203) - Case "17" - CargaCuentasDDL(DdlCtaContDocsXPagarExtranjera, 203) - Case "18" - CargaCuentasDDL(DdlCtaContDocsXPagarComplementaria, 203) - Case "19" - CargaCuentasDDL(DdlCtaContRetISRAcreditable, 206) - Case "20" - CargaCuentasDDL(DdlCtaContRetIVAAcreditable, 206) - End Select - End If - End Sub - - Private Sub CargaCuentasDDL(Ddl As DropDownList, CveFuncionalidad As Integer) - - 'CARGA LO YA SELECCIONADO - Dim CveSeleccionado As Integer = -1 - Dim Seleccionado As String = "" - Seleccionado = Ddl.SelectedItem.Text - CveSeleccionado = Ddl.SelectedValue.ToEntero - - 'VA POR EL CATALOGO DE CUENTAS - If Ddl.Attributes("onclick") <> "" Then - CargaCuentasContables(If(UsuarioActual.Empresa.Funcionalidad(CveFuncionalidad).ToEntero > 0, UsuarioActual.Empresa.Funcionalidad(CveFuncionalidad).ToEntero, 1)) - End If - - 'RECARGA EL DDL - Ddl.Items.Clear() - Ddl.DataSource = DtCuentasContables - Ddl.Items.Insert(0, New ListItem("Seleccione", "0")) - Ddl.DataBind() - - 'SELECCIONA EL YA SELECCIONADO - SI NO EXISTE EN EL DATASOURCE LO INSERTA - If DtCuentasContables.FiltraParametros($"Id = {CveSeleccionado}").Rows.Count > 0 Then - Ddl.SelectedValue = CveSeleccionado.ToString - ElseIf CveSeleccionado > 0 Then - Ddl.Items.Insert(1, New ListItem(Seleccionado, CveSeleccionado.ToString)) - Ddl.SelectedValue = CveSeleccionado.ToString - End If - - 'LIMPIA EVENTOS Y PONE CLASE - Ddl.AutoPostBack = False - Ddl.Attributes.Remove("onclick") - Ddl.CssClass &= " select2me" - - End Sub - #Region "LL E N A R - C O M B O S" Private Sub CargaResponsable() 'DdlCveUsuarioResponsable.DataSource = GlobalDTUsuarioResponsable.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa, DistinctColumns:={"CveUsuario", "Nombre"}) @@ -3884,272 +3736,272 @@ Partial Class Compras_Proveedores #End Region #Region "CUENTAS CONTABLES" - Private Sub ActivarRegistroAutomatico() + 'Private Sub ActivarRegistroAutomatico() - If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC) Then - Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) + ' If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaContabilidad Or UsuarioActual.Empresa.UsaAC) Then + ' Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) - '' 17/03/2017 FUNCIONALIDADES 249,250,251 - '' - Dim ClaveFuncionalidad As Integer = UsuarioActual.Empresa.Funcionalidad(201).ToEntero - If DdlCveTipoProveedor.SelectedValue = "2" Then ClaveFuncionalidad = UsuarioActual.Empresa.Funcionalidad(202).ToEntero - If DdlCtaContProveedores.SelectedValue.ToEntero <= 0 And ClaveFuncionalidad > 0 Then - DdlCtaContProveedores.Width = 175 - BtnActivaRegistroProveedores.Visible = True + ' '' 17/03/2017 FUNCIONALIDADES 249,250,251 + ' '' + ' Dim ClaveFuncionalidad As Integer = UsuarioActual.Empresa.Funcionalidad(201).ToEntero + ' If DdlCveTipoProveedor.SelectedValue = "2" Then ClaveFuncionalidad = UsuarioActual.Empresa.Funcionalidad(202).ToEntero + ' If DdlCtaContProveedores.SelectedValue.ToEntero <= 0 And ClaveFuncionalidad > 0 Then + ' DdlCtaContProveedores.Width = 175 + ' BtnActivaRegistroProveedores.Visible = True - '' Agrega Cuenta de la funcionalidad 249 - If UsuarioActual.Empresa.Funcionalidad(249).ToEntero > 0 Then + ' '' Agrega Cuenta de la funcionalidad 249 + ' If UsuarioActual.Empresa.Funcionalidad(249).ToEntero > 0 Then - If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(249).ToEntero, "-1", 1) Then - DdlCtaContProveedores.DataSource = ObjContabilidad.DtResultados - DdlCtaContProveedores.DataBind() - End If - End If + ' If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(249).ToEntero, "-1", 1) Then + ' DdlCtaContProveedores.DataSource = ObjContabilidad.DtResultados + ' DdlCtaContProveedores.DataBind() + ' End If + ' End If - End If + ' End If - If DdlCtaContExtranjera.SelectedValue.ToEntero <= 0 Then + ' If DdlCtaContExtranjera.SelectedValue.ToEntero <= 0 Then - '' Agrega Cuenta de la funcionalidad 250 - If UsuarioActual.Empresa.Funcionalidad(250).ToEntero > 0 Then + ' '' Agrega Cuenta de la funcionalidad 250 + ' If UsuarioActual.Empresa.Funcionalidad(250).ToEntero > 0 Then - If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(250).ToEntero, "-1", 1) Then - DdlCtaContExtranjera.DataSource = ObjContabilidad.DtResultados - DdlCtaContExtranjera.DataBind() - End If - End If + ' If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(250).ToEntero, "-1", 1) Then + ' DdlCtaContExtranjera.DataSource = ObjContabilidad.DtResultados + ' DdlCtaContExtranjera.DataBind() + ' End If + ' End If - End If + ' End If - If DdlCtaContComplementaria.SelectedValue.ToEntero <= 0 Then + ' If DdlCtaContComplementaria.SelectedValue.ToEntero <= 0 Then - '' Agrega Cuenta de la funcionalidad 251 - If UsuarioActual.Empresa.Funcionalidad(251).ToEntero > 0 Then + ' '' Agrega Cuenta de la funcionalidad 251 + ' If UsuarioActual.Empresa.Funcionalidad(251).ToEntero > 0 Then - If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(251).ToEntero, "-1", 1) Then - DdlCtaContComplementaria.DataSource = ObjContabilidad.DtResultados - DdlCtaContComplementaria.DataBind() - End If - End If + ' If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(251).ToEntero, "-1", 1) Then + ' DdlCtaContComplementaria.DataSource = ObjContabilidad.DtResultados + ' DdlCtaContComplementaria.DataBind() + ' End If + ' End If - End If + ' End If - '' 17/03/2017 FUNCIONALIDADES 252,253, 254 - 'Acreedores - If DdlCtaContAcreedores.SelectedValue.ToEntero <= 0 And UsuarioActual.Empresa.Funcionalidad(202).ToEntero > 0 Then - DdlCtaContAcreedores.Width = 175 - BtnActivaRegistroAcreedores.Visible = True + ' '' 17/03/2017 FUNCIONALIDADES 252,253, 254 + ' 'Acreedores + ' If DdlCtaContAcreedores.SelectedValue.ToEntero <= 0 And UsuarioActual.Empresa.Funcionalidad(202).ToEntero > 0 Then + ' DdlCtaContAcreedores.Width = 175 + ' BtnActivaRegistroAcreedores.Visible = True - '' Agrega Cuenta de la funcionalidad 252 - If UsuarioActual.Empresa.Funcionalidad(252).ToEntero > 0 Then + ' '' Agrega Cuenta de la funcionalidad 252 + ' If UsuarioActual.Empresa.Funcionalidad(252).ToEntero > 0 Then - If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(252).ToEntero, "-1", 1) Then - DdlCtaContAcreedores.DataSource = ObjContabilidad.DtResultados - DdlCtaContAcreedores.DataBind() - End If - End If - End If + ' If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(252).ToEntero, "-1", 1) Then + ' DdlCtaContAcreedores.DataSource = ObjContabilidad.DtResultados + ' DdlCtaContAcreedores.DataBind() + ' End If + ' End If + ' End If - '' Agrega Cuenta de la funcionalidad 253 - If DdlCtaContAcreedoresExtranjera.SelectedValue.ToEntero <= 0 Then - If UsuarioActual.Empresa.Funcionalidad(253).ToEntero > 0 Then + ' '' Agrega Cuenta de la funcionalidad 253 + ' If DdlCtaContAcreedoresExtranjera.SelectedValue.ToEntero <= 0 Then + ' If UsuarioActual.Empresa.Funcionalidad(253).ToEntero > 0 Then - If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(253).ToEntero, "-1", 1) Then + ' If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(253).ToEntero, "-1", 1) Then - DdlCtaContAcreedoresExtranjera.DataSource = ObjContabilidad.DtResultados - DdlCtaContAcreedoresExtranjera.DataBind() - End If - End If - End If + ' DdlCtaContAcreedoresExtranjera.DataSource = ObjContabilidad.DtResultados + ' DdlCtaContAcreedoresExtranjera.DataBind() + ' End If + ' End If + ' End If - '' Agrega Cuenta de la funcionalidad 254 - If DdlCtaContAcreedoresComplementaria.SelectedValue.ToEntero <= 0 Then - If UsuarioActual.Empresa.Funcionalidad(254).ToEntero > 0 Then + ' '' Agrega Cuenta de la funcionalidad 254 + ' If DdlCtaContAcreedoresComplementaria.SelectedValue.ToEntero <= 0 Then + ' If UsuarioActual.Empresa.Funcionalidad(254).ToEntero > 0 Then - If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(254).ToEntero, "-1", 1) Then - DdlCtaContAcreedoresComplementaria.DataSource = ObjContabilidad.DtResultados - DdlCtaContAcreedoresComplementaria.DataBind() - End If - End If - End If + ' If ObjContabilidad.GetCuentas(UsuarioActual.Empresa.Funcionalidad(254).ToEntero, "-1", 1) Then + ' DdlCtaContAcreedoresComplementaria.DataSource = ObjContabilidad.DtResultados + ' DdlCtaContAcreedoresComplementaria.DataBind() + ' End If + ' End If + ' End If - 'Documentos X Pagar - If DdlCtaContDocsXPagar.SelectedValue.ToEntero <= 0 And UsuarioActual.Empresa.Funcionalidad(203).ToEntero > 0 Then - DdlCtaContDocsXPagar.Width = 175 - BtnActivaRegistroDocsXPagar.Visible = True - End If + ' 'Documentos X Pagar + ' If DdlCtaContDocsXPagar.SelectedValue.ToEntero <= 0 And UsuarioActual.Empresa.Funcionalidad(203).ToEntero > 0 Then + ' DdlCtaContDocsXPagar.Width = 175 + ' BtnActivaRegistroDocsXPagar.Visible = True + ' End If - 'Anticipos - If DdlCtaContAnticipos.SelectedValue.ToEntero <= 0 And UsuarioActual.Empresa.Funcionalidad(204).ToEntero > 0 Then - DdlCtaContAnticipos.Width = 175 - BtnActivaRegistroAnticipos.Visible = True - End If + ' 'Anticipos + ' If DdlCtaContAnticipos.SelectedValue.ToEntero <= 0 And UsuarioActual.Empresa.Funcionalidad(204).ToEntero > 0 Then + ' DdlCtaContAnticipos.Width = 175 + ' BtnActivaRegistroAnticipos.Visible = True + ' End If - 'Deudores - If DdlCtaContDeudor.SelectedValue.ToEntero <= 0 And UsuarioActual.Empresa.Funcionalidad(205).ToEntero > 0 Then - DdlCtaContDeudor.Width = 175 - BtnActivaRegistroDeudores.Visible = True - End If - End If - End Sub + ' 'Deudores + ' If DdlCtaContDeudor.SelectedValue.ToEntero <= 0 And UsuarioActual.Empresa.Funcionalidad(205).ToEntero > 0 Then + ' DdlCtaContDeudor.Width = 175 + ' BtnActivaRegistroDeudores.Visible = True + ' End If + ' End If + 'End Sub - Private Sub BtnActivaRegistroProveedores_Click(sender As Object, e As EventArgs) Handles BtnActivaRegistroProveedores.Click - 'Dim IdCuentaContable As Integer = -1 - 'Dim CtaCodigo As String - 'Dim TieneError = False + 'Private Sub BtnActivaRegistroProveedores_Click(sender As Object, e As EventArgs) Handles BtnActivaRegistroProveedores.Click + ' 'Dim IdCuentaContable As Integer = -1 + ' 'Dim CtaCodigo As String + ' 'Dim TieneError = False - 'Dim ObjContaAC As New ClsContPAQi(UsuarioActual.Empresa) - 'Dim ObjProveedores As New ClsCompProveedores() - 'ObjContaAC.IniciaTransacSQL() - 'ObjProveedores.IniciaTransacSQL() + ' 'Dim ObjContaAC As New ClsContPAQi(UsuarioActual.Empresa) + ' 'Dim ObjProveedores As New ClsCompProveedores() + ' 'ObjContaAC.IniciaTransacSQL() + ' 'ObjProveedores.IniciaTransacSQL() - 'IdCuentaContable = ObjContaAC.AddSiguienteCuentaHijo(UsuarioActual.Empresa.Funcionalidad(109).ToEntero, TxtRazonSocial.Text.Trim) - 'ObjContaAC.GetCuentas(IdCuentaContable, "-1", -1) + ' 'IdCuentaContable = ObjContaAC.AddSiguienteCuentaHijo(UsuarioActual.Empresa.Funcionalidad(109).ToEntero, TxtRazonSocial.Text.Trim) + ' 'ObjContaAC.GetCuentas(IdCuentaContable, "-1", -1) - 'Dim dt = ObjContaAC.DtResultados - 'Dim row As DataRow = dt.Rows(dt.Rows.Count - 1) - 'CtaCodigo = CStr(row("CtaCodigo")) + ' 'Dim dt = ObjContaAC.DtResultados + ' 'Dim row As DataRow = dt.Rows(dt.Rows.Count - 1) + ' 'CtaCodigo = CStr(row("CtaCodigo")) - 'If IdCuentaContable > 0 Then - ' If Not ObjProveedores.VincularCuentasContables(IdCuentaContable, CtaCodigo, -1, "-1", -1, "-1", -1, "-1", -1, "-1", CveProveedor) Then - ' TieneError = True - ' End If - 'Else - ' TieneError = True - 'End If + ' 'If IdCuentaContable > 0 Then + ' ' If Not ObjProveedores.VincularCuentasContables(IdCuentaContable, CtaCodigo, -1, "-1", -1, "-1", -1, "-1", -1, "-1", CveProveedor) Then + ' ' TieneError = True + ' ' End If + ' 'Else + ' ' TieneError = True + ' 'End If - 'If Not TieneError Then - ' Alert(String.Format("Se registo la Cuenta Contable: {0}", CtaCodigo, TipoMensaje.MsgInformacion)) - ' DdlCtaContProveedores.Items.Add(New ListItem(CtaCodigo, IdCuentaContable.ToString)) : DdlCtaContProveedores.SelectedValueExist(IdCuentaContable.ToString) - ' BtnActivaRegistroProveedores.Visible = False - ' DdlCtaContProveedores.Width = 206 - ' ObjProveedores.Commit() - ' ObjContaAC.Commit() - 'Else - ' Alert("error", TipoMensaje.MsgError) - ' ObjProveedores.RollBack() - ' ObjContaAC.RollBack() - 'End If + ' 'If Not TieneError Then + ' ' Alert(String.Format("Se registo la Cuenta Contable: {0}", CtaCodigo, TipoMensaje.MsgInformacion)) + ' ' DdlCtaContProveedores.Items.Add(New ListItem(CtaCodigo, IdCuentaContable.ToString)) : DdlCtaContProveedores.SelectedValueExist(IdCuentaContable.ToString) + ' ' BtnActivaRegistroProveedores.Visible = False + ' ' DdlCtaContProveedores.Width = 206 + ' ' ObjProveedores.Commit() + ' ' ObjContaAC.Commit() + ' 'Else + ' ' Alert("error", TipoMensaje.MsgError) + ' ' ObjProveedores.RollBack() + ' ' ObjContaAC.RollBack() + ' 'End If - 'ObjContaAC.Dispose() - 'ObjProveedores.Dispose() - 'UPPContable.Update() + ' 'ObjContaAC.Dispose() + ' 'ObjProveedores.Dispose() + ' 'UPPContable.Update() - End Sub + 'End Sub - Protected Sub BtnAgregaCuentaContable(ByVal sender As Object, ByVal e As EventArgs) - Dim CuentaContable As String = DirectCast(sender, Button).CommandArgument.ToString - Dim Button As Button = DirectCast(sender, Button) - Select Case CuentaContable - Case "Proveedores" - AgregarCuentaContable(Button, DdlCtaContProveedores) - Case "Acreedores" - AgregarCuentaContable(Button, DdlCtaContAcreedores) - Case "DocsXPagar" - AgregarCuentaContable(Button, DdlCtaContDocsXPagar) - Case "Anticipos" - AgregarCuentaContable(Button, DdlCtaContAnticipos) - Case "Deudores" - AgregarCuentaContable(Button, DdlCtaContDeudor) - End Select + 'Protected Sub BtnAgregaCuentaContable(ByVal sender As Object, ByVal e As EventArgs) + ' Dim CuentaContable As String = DirectCast(sender, Button).CommandArgument.ToString + ' Dim Button As Button = DirectCast(sender, Button) + ' Select Case CuentaContable + ' Case "Proveedores" + ' AgregarCuentaContable(Button, DdlCtaContProveedores) + ' Case "Acreedores" + ' AgregarCuentaContable(Button, DdlCtaContAcreedores) + ' Case "DocsXPagar" + ' AgregarCuentaContable(Button, DdlCtaContDocsXPagar) + ' Case "Anticipos" + ' AgregarCuentaContable(Button, DdlCtaContAnticipos) + ' Case "Deudores" + ' AgregarCuentaContable(Button, DdlCtaContDeudor) + ' End Select - End Sub + 'End Sub - Private Sub AgregarCuentaContable(btn As Button, ddl As DropDownList) + 'Private Sub AgregarCuentaContable(btn As Button, ddl As DropDownList) - If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad = True Then - Dim IdCuentaContable As Integer = -1 - Dim CtaCodigo As String = "" - Dim TieneError As Boolean = False - Dim CveConceptoContable As Integer = -1 - Dim Codigo As String = "" + ' If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad = True Then + ' Dim IdCuentaContable As Integer = -1 + ' Dim CtaCodigo As String = "" + ' Dim TieneError As Boolean = False + ' Dim CveConceptoContable As Integer = -1 + ' Dim Codigo As String = "" - Dim ObjContaAC As New ClsContPAQi(UsuarioActual.Empresa) - Dim ObjProveedores As New ClsCompProveedores() + ' Dim ObjContaAC As New ClsContPAQi(UsuarioActual.Empresa) + ' Dim ObjProveedores As New ClsCompProveedores() - ObjContaAC.IniciaTransacSQL() - ObjProveedores.IniciaTransacSQL() + ' ObjContaAC.IniciaTransacSQL() + ' ObjProveedores.IniciaTransacSQL() - Dim CuentaPadre As Integer = -1 + ' Dim CuentaPadre As Integer = -1 - Dim TipoCuenta As String = "D" + ' Dim TipoCuenta As String = "D" - Select Case btn.CommandArgument.ToString - Case "Proveedores" - CuentaPadre = If(DdlCveTipoProveedor.SelectedValue = "2", UsuarioActual.Empresa.Funcionalidad(202).ToEntero, UsuarioActual.Empresa.Funcionalidad(201).ToEntero) + ' Select Case btn.CommandArgument.ToString + ' Case "Proveedores" + ' CuentaPadre = If(DdlCveTipoProveedor.SelectedValue = "2", UsuarioActual.Empresa.Funcionalidad(202).ToEntero, UsuarioActual.Empresa.Funcionalidad(201).ToEntero) - If DdlCveTipoProveedor.SelectedValue.ToEntero.Contiene(1, 3) Then - CveConceptoContable = 5 - Else - CveConceptoContable = 305 - End If + ' If DdlCveTipoProveedor.SelectedValue.ToEntero.Contiene(1, 3) Then + ' CveConceptoContable = 5 + ' Else + ' CveConceptoContable = 305 + ' End If - Case "Acreedores" - CuentaPadre = UsuarioActual.Empresa.Funcionalidad(202).ToEntero - CveConceptoContable = 305 - Case "DocsXPagar" - CuentaPadre = UsuarioActual.Empresa.Funcionalidad(203).ToEntero - CveConceptoContable = 50 - Case "Anticipos" - CuentaPadre = UsuarioActual.Empresa.Funcionalidad(204).ToEntero - TipoCuenta = "A" - CveConceptoContable = 10 - Case "Deudores" - CuentaPadre = UsuarioActual.Empresa.Funcionalidad(205).ToEntero - CveConceptoContable = 10 + ' Case "Acreedores" + ' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(202).ToEntero + ' CveConceptoContable = 305 + ' Case "DocsXPagar" + ' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(203).ToEntero + ' CveConceptoContable = 50 + ' Case "Anticipos" + ' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(204).ToEntero + ' TipoCuenta = "A" + ' CveConceptoContable = 10 + ' Case "Deudores" + ' CuentaPadre = UsuarioActual.Empresa.Funcionalidad(205).ToEntero + ' CveConceptoContable = 10 - End Select + ' End Select - 'SI EL NOMBRE DEL PROVEEDOR ES MAYOR DE 50 LO CORTAMOS - Dim NombreCuenta As String = If(TxtRazonSocial.Text.Trim.Length > 50, TxtRazonSocial.Text.Trim.Substring(0, 50), TxtRazonSocial.Text.Trim) + ' 'SI EL NOMBRE DEL PROVEEDOR ES MAYOR DE 50 LO CORTAMOS + ' Dim NombreCuenta As String = If(TxtRazonSocial.Text.Trim.Length > 50, TxtRazonSocial.Text.Trim.Substring(0, 50), TxtRazonSocial.Text.Trim) - IdCuentaContable = ObjContaAC.AddSiguienteCuentaHijo(CuentaPadre, NombreCuenta, "D", 2) - If IdCuentaContable > 0 Then + ' IdCuentaContable = ObjContaAC.AddSiguienteCuentaHijo(CuentaPadre, NombreCuenta, "D", 2) + ' If IdCuentaContable > 0 Then - ObjContaAC.GetCuentas(IdCuentaContable, "-1", -1) - Dim dt As DataTable = ObjContaAC.DtResultados + ' ObjContaAC.GetCuentas(IdCuentaContable, "-1", -1) + ' Dim dt As DataTable = ObjContaAC.DtResultados - If dt.Rows.Count = 1 Then + ' If dt.Rows.Count = 1 Then - Dim row As DataRow = dt.Rows(0) - CtaCodigo = CStr(row("CtaCodigo")) - Codigo = CStr(row("Codigo")) - Else - TieneError = True - End If + ' Dim row As DataRow = dt.Rows(0) + ' CtaCodigo = CStr(row("CtaCodigo")) + ' Codigo = CStr(row("Codigo")) + ' Else + ' TieneError = True + ' End If - Else - TieneError = True - End If - 'If Not AltaCuentaContabilidadSIG(Codigo, NombreCuenta, IdCuentaContable, CveConceptoContable, ObjProveedores.IniciaTransacSQL, IdCompaqPadre:=CuentaPadre, CveProveedorCuenta:=CveProveedor) Then - ' TieneError = True - 'End If + ' Else + ' TieneError = True + ' End If + ' 'If Not AltaCuentaContabilidadSIG(Codigo, NombreCuenta, IdCuentaContable, CveConceptoContable, ObjProveedores.IniciaTransacSQL, IdCompaqPadre:=CuentaPadre, CveProveedorCuenta:=CveProveedor) Then + ' ' TieneError = True + ' 'End If - If Not TieneError Then - Alert(String.Format("Se registo la Cuenta Contable: {0}", CtaCodigo, TipoMensaje.MsgInformacion)) - ddl.Items.Add(New ListItem(CtaCodigo, IdCuentaContable.ToString)) : ddl.SelectedValueExist(IdCuentaContable.ToString) - btn.Visible = False - ddl.Width = 206 - ObjProveedores.Commit() - ObjContaAC.Commit() - Else - Alert("error", TipoMensaje.MsgError) - ObjProveedores.RollBack() - ObjContaAC.RollBack() - End If + ' If Not TieneError Then + ' Alert(String.Format("Se registo la Cuenta Contable: {0}", CtaCodigo, TipoMensaje.MsgInformacion)) + ' ddl.Items.Add(New ListItem(CtaCodigo, IdCuentaContable.ToString)) : ddl.SelectedValueExist(IdCuentaContable.ToString) + ' btn.Visible = False + ' ddl.Width = 206 + ' ObjProveedores.Commit() + ' ObjContaAC.Commit() + ' Else + ' Alert("error", TipoMensaje.MsgError) + ' ObjProveedores.RollBack() + ' ObjContaAC.RollBack() + ' End If - ObjContaAC.Dispose() - ObjProveedores.Dispose() + ' ObjContaAC.Dispose() + ' ObjProveedores.Dispose() - End If + ' End If - UPPContable.Update() - End Sub + ' UPPContable.Update() + 'End Sub #End Region Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click