diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx
index afdb7b36b..cd4a6e804 100644
--- a/Contabilidad2/CatCuentasAsignaciones.aspx
+++ b/Contabilidad2/CatCuentasAsignaciones.aspx
@@ -130,7 +130,7 @@
diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb
index a4b1ade3c..cc089bec4 100644
--- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb
+++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb
@@ -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