This commit is contained in:
Rakcsle Supertramp
2020-04-20 22:43:42 -07:00
65 changed files with 15093 additions and 9220 deletions

View File

@@ -295,49 +295,58 @@ Partial Class Contabilidad2_CatCuentas
Dim PorcentajeImpuesto As Decimal = TxtPorcentaje.Text.ToDecimal() / 100
Dim CveBancoCuenta As Integer = ddlBancos.SelectedValue.ToEntero
Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero()
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) Then
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
If DdlAgrupadorSAT.SelectedValue.ToEntero > 0 Then
If UsuarioActual.Empresa.TipoContabilidad <> 1 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) Then
Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
If ObjConta2.GetCuentas(-1, "-1", -1) Then
Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero
Dim IdAgrupador As Integer
If UsuarioActual.Empresa.TipoContabilidad <> 1 Then
If ObjConta2.GetAgrupadoresSAT() Then
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
End If
If Id > 0 Then
If ObjConta2.UpdateCuenta(Id, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, DdlMoneda.SelectedValue.ToEntero, IdAgrupador, SubCuentaDe:=Tsubcuenta.Text.Trim) > 0 Then
Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
If ObjConta2.GetCuentas(-1, "-1", -1) Then
Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero
Dim IdAgrupador As Integer
If ObjConta2.GetAgrupadoresSAT() Then
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
End If
If Id > 0 Then
If ObjConta2.UpdateCuenta(Id, Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, DdlMoneda.SelectedValue.ToEntero, IdAgrupador, SubCuentaDe:=Tsubcuenta.Text.Trim) > 0 Then
End If
End If
End If
End If
End Using
End Using
End If
Dim customerRow As Data.DataRow
customerRow = DtDatos.Select(String.Format("CveCuenta = {0}", IDSelected))(0)
customerRow("Nombre") = Tnombre.Text
DtDatos.AcceptChanges()
CargaDatos()
ArbolCuentas.DataSource = DtDatos
Dim item As CheckBox = DirectCast(ArbolCuentas.FindControl(String.Format("chk{0}", IDSelected)), CheckBox)
item.Text = String.Format("{0} - {1}", customerRow("CuentaFormato").ToString, Tnombre.Text)
'updatos.Visible = False
'Guardar.Visible = False
LimpiarCampos()
'RegistraScript("$get('BtnCambiaAgrupadorSAT').click();")
updatos.Update()
Alert("La cuenta se guardo correctamente")
End If
Dim customerRow As Data.DataRow
customerRow = DtDatos.Select(String.Format("CveCuenta = {0}", IDSelected))(0)
customerRow("Nombre") = Tnombre.Text
DtDatos.AcceptChanges()
CargaDatos()
ArbolCuentas.DataSource = DtDatos
Dim item As CheckBox = DirectCast(ArbolCuentas.FindControl(String.Format("chk{0}", IDSelected)), CheckBox)
item.Text = String.Format("{0} - {1}", customerRow("CuentaFormato").ToString, Tnombre.Text)
'updatos.Visible = False
'Guardar.Visible = False
LimpiarCampos()
'RegistraScript("$get('BtnCambiaAgrupadorSAT').click();")
updatos.Update()
Alert("La cuenta se guardo correctamente")
Else
Alert("Es necesario agregar el campo 'Agrupador SAT'", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
End Sub
@@ -356,17 +365,14 @@ Partial Class Contabilidad2_CatCuentas
Dim CuentaEfectivo As Integer = 0
Dim Afectable As Integer = 1 'If(DcuentaMayor.SelectedValue <> 2, 0, 1) ' cuando sea tipo 2, va a ser afectable
Tcuenta.Text.Replace("-", "")
Dim idnew As Integer = 0
Dim idnew As Integer = ObjConta.AddCuenta(
IDSelected,
TxtCuenta.Text.Replace("-", ""),
Tnombre.Text,
DTcuenta.SelectedValue.ToString,
DcuentaMayor.SelectedValue.ToString.ToEntero,
DdlMoneda.SelectedValue.ToEntero,
TxtDigAgrup.Text.ToEntero,
DdlAgrupadorSAT.SelectedValue.ToEntero,
TxtNomIngles.Text.ToString)
If DdlAgrupadorSAT.SelectedValue.ToEntero > 0 Then
idnew = ObjConta.AddCuenta(IDSelected, TxtCuenta.Text.Replace("-", ""), Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero,
DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToEntero, DdlAgrupadorSAT.SelectedValue.ToEntero, TxtNomIngles.Text.ToString)
Else
Alert("Es necesario agregar el campo 'Agrupador SAT'", TipoMensaje.MsgError)
End If
If idnew > 0 Then