-- mejoras en agregar nueva asignación

This commit is contained in:
2021-09-17 08:02:30 -07:00
parent ff7fe2b307
commit d32c46ca17
2 changed files with 50 additions and 29 deletions

View File

@@ -130,7 +130,7 @@
<div class="col-md-1" style="width:50%;text-align:left">
<div class="form-group form-md-line-input input-iconright">
<asp:HiddenField ID="HdnCveCuentaAsignacion" runat="server" />
<asp:DropDownList ID="DdlCconceptosContables" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="ConceptoContable" DataValueField="CveConceptoContable" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList>
<asp:DropDownList ID="DdlCconceptosContables" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="ConceptoContable" DataValueField="CveConceptoContable" Width="240px" ValidationGroup="GrpModulo" AutoPostBack="true"></asp:DropDownList>
<label for="<%= DdlCconceptosContables.ClientID.ToString()%>">Concepto Contable: </label>
</div>
<div class="form-group form-md-line-input input-iconright">
@@ -148,7 +148,7 @@
</div>
<div class="form-group form-md-line-input input-iconright" id="divCliente" runat="server" visible="false">
<label for="<%= DdlClientes.ClientID.ToString()%>">Cliente: </label><br />
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="90%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="90%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div>
<div class="form-group form-md-line-input input-iconright" id="divBancos" runat="server" visible="false">
<asp:DropDownList ID="DdlCuentaBancaria" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList>
@@ -181,6 +181,10 @@
<asp:DropDownList ID="DdlActivoFijo" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="Descripcion" DataValueField="CveActivoFijo" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList>
<label for="<%= DdlActivoFijo.ClientID.ToString()%>">Activo Fijo: </label>
</div>
<div class="form-group form-md-line-input input-iconright" id="divSubProyectos" runat="server" visible="false">
<asp:DropDownList ID="DdlSubProyectos" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList>
<label for="<%= DdlSubProyectos.ClientID.ToString()%>">Sub Proyectos: </label>
</div>
</div>
</div>
</div>

View File

@@ -79,6 +79,8 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
DdlSubProyectos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
Dim ObjBancos As New ClsBancos
If ObjBancos.GetBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) Then
DdlCuentaBancaria.DataSource = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
@@ -94,6 +96,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
'DdlPersonal.DataBind()
DdlClasificacion.DataBind()
DdlAlmacen.DataBind()
DdlSubProyectos.DataBind()
DdlCuentaBancaria.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlConceptoNomina.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -112,6 +115,10 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
HdnCveCuentaAsignacion.Value = GvRow.DataKey("CveCuentaAsignacion").ToString
If Dr IsNot Nothing Then
DdlCconceptosContables.Enabled = False
DdlSubProyectos.Enabled = False
DdlClasificacion.Enabled = False
DdlPersonal.Enabled = False
CveConceptoAsignacion = GvRow.DataKey("CveCuentaAsignacion").ToEntero
DdlCconceptosContables.SelectedValueExist(GvRow.DataKey("CveConceptoContable"))
DdlCuenta.SelectedValueExist(GvRow.DataKey("CveCuenta"))
@@ -126,33 +133,37 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero
Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero
RecargaConcepto(CveConceptoContable)
DdlClientes.ddl.SelectedValueExist(CveCliente)
DdlPersonal.ddl.SelectedValueExist(CvePersonal)
LbAgregar.Text = "Actualizar"
UpModalModulos.Update()
RegistraScript("$('#ModalCat').modal();")
End If
End Sub
Private Sub RecargaConcepto(CveConceptoContable As Integer)
Dim Dr As DataRow = GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimero("")
If Dr IsNot Nothing Then
If Dr("AplicaCliente").ToString = "True" Then
divCliente.Visible = True
If CveCliente > 0 Then
DdlClientes.setEsWebService(False)
Dim ObjCliente As New ClsClientes
If ObjCliente.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
DdlClientes.ddl.DataSource = ObjCliente.DtResultados
End If
DdlClientes.ddl.DataBind()
DdlClientes.ddl.SelectedValue = CveCliente
End If
DdlClientes.setEsWebService(True)
End If
If Dr("AplicaProveedor").ToString = "True" Then
divProveedor.Visible = True
End If
If Dr("AplicaPersonal").ToString = "True" Then
divPersonal.Visible = True
If CvePersonal > 0 Then
DdlPersonal.setEsWebService(False)
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
DdlPersonal.ddl.DataSource = ObjPersonal.DtResultados
End If
DdlPersonal.ddl.DataBind()
DdlPersonal.ddl.SelectedValueExist(CvePersonal)
End If
DdlPersonal.setEsWebService(True)
End If
If Dr("AplicaImpuesto").ToString = "True" Then
@@ -172,23 +183,22 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
divAlmacen.Visible = True
End If
If Dr("AplicaSubProyecto").ToString = "True" Then
divSubProyectos.Visible = True
End If
If Dr("AplicaActivoFijo").ToString = "True" Then
divActivoFijo.Visible = True
DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
DdlActivoFijo.DataBind()
DdlActivoFijo.SelectedValueExist(GvRow.DataKey("CveActivoFijo"))
' DdlActivoFijo.SelectedValueExist(GvRow.DataKey("CveActivoFijo"))
End If
If Dr("AplicaNomina").ToString = "True" Then
divConceptoNomina.Visible = True
End If
LbAgregar.Text = "Actualizar"
UpModalModulos.Update()
RegistraScript("$('#ModalCat').modal();")
End If
End Sub
Protected Sub EliminarRow(sender As Object, e As EventArgs)
@@ -221,7 +231,10 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
Protected Sub BtnAgregarAsignacion_Click(sender As Object, e As EventArgs) Handles BtnAgregarAsignacion.Click
LimpiarDatos()
DdlCconceptosContables.Enabled = True
DdlSubProyectos.Enabled = True
DdlClasificacion.Enabled = True
DdlPersonal.Enabled = True
LbAgregar.Text = "Agregar"
UpModalModulos.Update()
RegistraScript("$('#ModalCat').modal();")
@@ -253,14 +266,14 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero,
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(),
CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero) Then
CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero) Then
ErrorString = "Error al agregar"
End If
ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then
If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero,
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(),
CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero) Then
CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero) Then
ErrorString = "Error al actualizar"
End If
End If
@@ -293,4 +306,8 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
CargaDatosSistema()
UpDatos.Update()
End Sub
Private Sub DdlCconceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCconceptosContables.SelectedIndexChanged
RecargaConcepto(DdlCconceptosContables.SelectedValue.ToEntero)
End Sub
End Class