-- limpieza de código de mandar idcta de contpaq

This commit is contained in:
2023-08-09 19:00:12 -07:00
parent eb4abbe9a5
commit 4e13b96c3a
90 changed files with 1583 additions and 10362 deletions

View File

@@ -530,11 +530,6 @@ Partial Class Compras_ReembolsosComprobaciones
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones1", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveCajaChica > 0 Then
If ObjMov.GetRetCuenta(30, CveCajaChica) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
End If
End If
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporteVinculado.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
'AGREGO PREPOLIZA IE BANCOS
@@ -601,11 +596,6 @@ Partial Class Compras_ReembolsosComprobaciones
'SI ES CAJA CHICA REGISTRO IE CAJA CHICA
If CveCajaChica > 0 Then
If ObjMov.GetRetCuenta(30, CveCajaChica) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
End If
End If
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 8, TxtFechaDocumento.Text.Trim.ToDate, FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
@@ -629,11 +619,7 @@ Partial Class Compras_ReembolsosComprobaciones
'SI ES CAJA CHICA REGISTRO IE CAJA CHICA
If CveCajaChica > 0 Then
If ObjMov.GetRetCuenta(30, CveCajaChica) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
End If
End If
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 2).ToString
CveIECajaChica = ObjIE.AddBancos_IE(CveCajaChica, 2, If(ChkReembolsarSinBancos.Checked, TxtFechaPrePoliza.Text.ToDate, TxtFechaDocumento.Text.Trim.ToDate), FolioIENew, String.Format("Transferencia Cta: {0}", DdlCajaChica.SelectedItem), TxtImporte.Text.ToDecimal, CveMoneda, 0, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePolizaIERegistrado, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FueConciliado:=If(ChkReembolsarSinBancos.Checked Or CveCajaChica > 0, True, False))
'8
@@ -660,33 +646,7 @@ Partial Class Compras_ReembolsosComprobaciones
Dim IdCtaProveedor As Integer = 0
Dim IdCtaOtrosProductos As Integer = 0
Dim CvePrePolizaUnificar As Integer = 0
Dim SeUnifico = False
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
'Obtenemos la cuenta del Personal o Caja Chica
If CveCajaChica > 0 Then
If ObjMov.GetRetCuenta(30, CveCajaChica) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
End If
End If
Else
If ObjMov.GetRetCuenta(29, CvePersonal) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaPersonal = ObjMov.DtResultados.Rows(0)("IdCtaContPersonal").ToString.ToEntero
End If
End If
End If
'Obtenemos la cuenta del IdCtaOtrosProductos
If ObjMov.GetRetCuenta(132, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaOtrosProductos = ObjMov.DtResultados.Rows(0)("IdCtaOtrosProductos").ToString.ToEntero
End If
End If
End If
'inserto las compras que voy a pagar
For Each gvr As GridViewRow In GvCxP.Rows
@@ -724,7 +684,6 @@ Partial Class Compras_ReembolsosComprobaciones
CompraActual.UsuarioActual = UsuarioActual
CompraActual.CveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero
CompraActual.CompraNoDeducible = gvr.DataKey("NoDeducible").ToEntero
CompraActual.IdCtaContableProv = IdCtaProveedor
ImportePagar = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
ImporteOriginal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
@@ -763,11 +722,9 @@ Partial Class Compras_ReembolsosComprobaciones
End If
If MsgError = "" Then
If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePolizaPago, ObjMov) Then
MsgError = "Detalle"
End If
If Not ChkReembolsarSinBancos.Checked AndAlso (Not HdnCheque.Value.ToEntero > 0 Or Not UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso Not ChkMesSiguiente.Checked) Then
'Si es caja chica metemos el concepto 30, si es funcionario metemos 29
ImporteMovto += Pago.OtroGastoIngreso ' si ajuste, sedebe de aplicar en su contraparte
@@ -841,7 +798,7 @@ Partial Class Compras_ReembolsosComprobaciones
'Otros Ingresos
If ChkAjusteOI.Checked Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, UsuarioActual.Empresa.IdCuentaOtrosIngresos, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 0, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio) Then
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
End If
End If