This commit is contained in:
2022-10-11 18:59:53 -07:00
4 changed files with 54 additions and 8 deletions

View File

@@ -4747,7 +4747,9 @@ Public Class ClsContabilidad
Public Function UpdateCuenta(CveCuenta As Integer, Nombre As String, Tipo As String, CtaMayor As Integer, CveMoneda As Integer, Optional DigAgrupador As Integer = -1,
Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "", Optional CveConceptoAdmin As Integer = -1, Optional CveProveedor As Integer = -1,
Optional CveCliente As Integer = -1, Optional CveClasificacion As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1,
Optional CveBancoCuenta As Integer = -1, Optional CveAlmacen As Integer = -1, Optional Afectable As Integer = -1, Optional Codigo As String = "-1") As Boolean
Optional CveBancoCuenta As Integer = -1, Optional CveAlmacen As Integer = -1, Optional Afectable As Integer = -1, Optional Codigo As String = "-1",
Optional CvePadre As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta_UpdateCuentas")
@@ -4770,6 +4772,8 @@ Public Class ClsContabilidad
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@Afectable", SqlDbType.Int).Value = Afectable
.Add("@Codigo", SqlDbType.VarChar).Value = Codigo
.Add("@CvePadre", SqlDbType.Int).Value = CvePadre
End With

View File

@@ -47,6 +47,11 @@
font-size: 9px !important;
content: "\f040";
}
#select2-C_DdlCuentaContable-results{
max-width:300px!important
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
@@ -110,6 +115,9 @@
<div class="catcuentas left">Subcuenta de</div>
<div class="catcuentas right">
<asp:TextBox ID="Tsubcuenta" runat="server" Enabled="False" Width="140px" ClientIDMode="Static"></asp:TextBox>
<asp:DropDownList ID="DdlCuentaContable" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="false" DataTextField="CtaCodigo" style="max-width:160px"
DataValueField="Id" Width="160px" Visible="false">
</asp:DropDownList>
<br />
<asp:Label ID="LblSubCuenta" runat="server" Text="" Font-Italic="True" Font-Size="7pt" ClientIDMode="Static"></asp:Label>
</div>

View File

@@ -186,6 +186,10 @@ Partial Class Contabilidad2_CatCuentas
End Function
Protected Sub agregar_Click(sender As Object, e As EventArgs) Handles ArbolCuentas.addclick
LimpiarCampos()
Tsubcuenta.Visible = True
DdlCuentaContable.Visible = False
Dim dt As New DataTable
'IDSelected = HdnID.Value.ToEntero() "ul" + itempadre.Cve;
@@ -243,6 +247,11 @@ Partial Class Contabilidad2_CatCuentas
Protected Sub editar_Click(sender As Object, e As EventArgs) Handles ArbolCuentas.editclick
LimpiarCampos()
limpiavalorescontables()
CargaCuentasContables()
Tsubcuenta.Visible = False
DdlCuentaContable.Visible = True
Dim dt As DataTable
Dim obj As ADServerControl.DragableItem = DirectCast(sender, ADServerControl.DragableItem)
IDSelected = obj.Cve
@@ -301,6 +310,7 @@ Partial Class Contabilidad2_CatCuentas
If dt.Rows.Count > 0 Then
Dim drt As DataRow = dt.Rows(0)
Tsubcuenta.Text = drt("Codigo").ToString
DdlCuentaContable.SelectedValueExist(drt("CveCuenta").ToString)
LblSubCuenta.Text = drt("Nombre").ToString
End If
@@ -313,6 +323,25 @@ Partial Class Contabilidad2_CatCuentas
End Sub
Private Sub CargaCuentasContables()
DdlCuentaContable.ClearSelection()
DdlCuentaContable.Items.Clear()
DdlCuentaContable.SelectedValue = Nothing
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
DdlCuentaContable.DataSource = ObjConta.DtResultados
End If
ObjConta.Dispose()
DdlCuentaContable.DataBind()
DdlCuentaContable.Items.Insert(0, New ListItem("-", "-1"))
DdlCuentaContable.SelectedValueExist("-1")
End Sub
Protected Sub Guardar_Click(sender As Object, e As EventArgs) Handles Guardar.Click
If Tnombre.Text.Trim = "" Then Alert("Ingrese nombre de la cuenta", TipoMensaje.MsgError) : Exit Sub
@@ -328,11 +357,13 @@ Partial Class Contabilidad2_CatCuentas
Dim CveBancoCuenta As Integer = ddlBancos.SelectedValue.ToEntero
Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero()
If DdlAgrupadorSAT.SelectedValue.ToEntero > 0 Then
If ObjConta.UpdateCuenta(IDSelected.ToEntero, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, DdlMoneda.SelectedValue.ToEntero,
TxtDigAgrup.Text.ToString.ToEntero, DdlAgrupadorSAT.SelectedValue.ToEntero, TxtNomIngles.Text.ToString, CveConceptoAdmin:=CveConceptoAdmin,
CveProveedor:=CveProveedor, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeImpuesto,
CveBancoCuenta:=CveBancoCuenta, CveAlmacen:=CveAlmacen, Codigo:=TxtCuenta.Text.Replace("-", "")) Then
CveBancoCuenta:=CveBancoCuenta, CveAlmacen:=CveAlmacen, Codigo:=TxtCuenta.Text.Replace("-", ""), CvePadre:=DdlCuentaContable.SelectedValue.ToEntero) Then
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Dim ObjContaEmpresa As New ClsContPAQi(UsuarioActual.Empresa)
@@ -592,6 +623,9 @@ Partial Class Contabilidad2_CatCuentas
nuevacuenta.Visible = False
TxtCuenta.Enabled = False
'Tcuenta.Enabled = False
DdlCuentaContable.SelectedValueExist(-1)
DdlCuentaContable.Visible = False
Tsubcuenta.Visible = True
BtnEliminar.Visible = False
End Sub

View File

@@ -1021,7 +1021,7 @@ Partial Class General_SaldosIniciales
Dim CodigoRegimenFiscal As String = Row("Regimen Fiscal").ToString
Dim Clasificacion As String = Row("Clasificación Proveedor").ToString
Dim ProveedorClasificacion As String = Row("Clasificación Proveedor").ToString
Dim Moneda As String = Row("Moneda Preferente").ToString
Dim DIOTTipoTercero As String = Row("Tipo Tercero").ToString.Trim.ToUpper
Dim DIOTipoOperacion As String = Row("Tipo Operación").ToString
@@ -1103,10 +1103,10 @@ Partial Class General_SaldosIniciales
End If
If Clasificacion.Trim.Length > 0 Then
CveProveedorClasificacion = DTClasificaciones.FiltroPrimeroValor("CveClasificacion", $"Clasificacion = '{Clasificacion}'").ToString.ToEntero
If ProveedorClasificacion.Trim.Length > 0 Then
CveProveedorClasificacion = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedorClasificacion", $"ProveedorClasificacion = '{ProveedorClasificacion}'").ToString.ToEntero
If Not CveProveedorClasificacion > 0 Then
sbErrores.AppendLine($"Proveedor {RazonSocial} Clasificación {Clasificacion} invalida.<br>")
sbErrores.AppendLine($"Proveedor {RazonSocial} Proveedor Clasificacion {ProveedorClasificacion} invalida.<br>")
ErrorProv = True
End If
End If
@@ -2022,10 +2022,10 @@ Partial Class General_SaldosIniciales
For Each Row As DataRow In dt.Rows
Dim Cuenta As String = Row("Cuenta").ToString.Trim
Dim Cuenta As String = Row("Cuenta").ToString.Trim.Replace("-", "")
If Cuenta <> "" Then
NombreCuenta = Row("NombreCuenta").ToString.Trim
CuentaPadre = Row("CuentaPadre").ToString.Trim
CuentaPadre = Row("CuentaPadre").ToString.Trim.Replace("-", "")
Dim TipoCuenta As String = Row("TipoCuenta").ToString.Trim
Dim AgrupadorSAT As String = Row("AgrupadorSAT").ToString.Trim