-- actualización e reteciones
This commit is contained in:
@@ -2616,8 +2616,6 @@ Partial Class Compras_Compras
|
||||
|
||||
HFDiferenciaCompra.Value = TxtTotal.Text
|
||||
|
||||
|
||||
|
||||
TotalGeneral = dr("Total").ToString.ToDouble
|
||||
CveMoneda = dr("CveMoneda").ToString.ToEntero
|
||||
DdlValidadaSAT.SelectedValue = "Si"
|
||||
@@ -5998,7 +5996,7 @@ Partial Class Compras_Compras
|
||||
importeMovimiento = TxtTotal.Text.ToDecimal 'TmpDT.SUM("Total", String.Format("ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And CveClasificacion = {0} And CveSubProyecto = {1} And ISNULL(CveTipoGasto, 0) = {2} Then", Row2("CveClasificacion").ToString.ToEntero, Row2("CveSubProyecto").ToString.ToEntero, Row2("CveTipoGasto").ToString.ToEntero)).ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
'CLASIFICACION
|
||||
If Row2("CveClasificacion").ToString.ToEntero > 0 Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso Row2("CveClasificacion").ToString.ToEntero > 0 Then
|
||||
If ObjConta.GetRetCuenta(6, Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 AndAlso ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaGasto").ToString.ToEntero
|
||||
@@ -6133,7 +6131,7 @@ Partial Class Compras_Compras
|
||||
ConceptoContable = 288
|
||||
End If
|
||||
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
|
||||
End If
|
||||
@@ -6145,7 +6143,7 @@ Partial Class Compras_Compras
|
||||
IdCtaIva = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
|
||||
Dim ttConceptoContable As Integer = 14
|
||||
|
||||
If ObjConta.GetRetCuenta(ttConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaIva > 0 Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ttConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaIva > 0 Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaIva = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero
|
||||
End If
|
||||
@@ -6171,7 +6169,7 @@ Partial Class Compras_Compras
|
||||
If chkImportacion.Checked Then
|
||||
ConceptoContable = 287
|
||||
End If
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero
|
||||
End If
|
||||
@@ -6208,7 +6206,7 @@ Partial Class Compras_Compras
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
PorcentajeImpuesto = PorcentajeIVA
|
||||
IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero
|
||||
End If
|
||||
@@ -6221,7 +6219,7 @@ Partial Class Compras_Compras
|
||||
importeMovimiento = ImporteIEPSxAcreditar
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxAcreditar").ToString.ToEntero
|
||||
End If
|
||||
@@ -10376,162 +10374,21 @@ Partial Class Compras_Compras
|
||||
|
||||
End If
|
||||
|
||||
If Retorno AndAlso (CveRetIVAConceptoOriginal <> DdlRetIVAConcepto.SelectedValue.ToEntero OrElse CveRetISRConceptoOriginal <> DdlRetISRConcepto.SelectedValue.ToEntero) Then
|
||||
Dim tCveConceptoIVA, tCveConceptoISR As Integer
|
||||
|
||||
If Retorno AndAlso (CveRetIVAConceptoOriginal <> DdlRetIVAConcepto.SelectedValue.ToEntero Or CveRetISRConceptoOriginal <> DdlRetISRConcepto.SelectedValue.ToEntero) Then
|
||||
If ObjCompra.GetComprasPrepolizasRetIvaRetISRActualiza(CveCompra, CveRetIVAConceptoOriginal, CveRetISRConceptoOriginal) Then
|
||||
|
||||
Dim DTPRePolizaDesbloquedo As DataTable = ObjCompra.DtResultados.FiltraParametros("", "", {"CvePrePoliza", "Bloqueado"})
|
||||
Dim DTPRePolizaDes As DataTable = ObjCompra.DtResultados
|
||||
|
||||
If DTPRePolizaDesbloquedo IsNot Nothing Then
|
||||
|
||||
For Each dr1 As DataRow In DTPRePolizaDesbloquedo.Rows
|
||||
|
||||
If Boolean.Parse(dr1("Bloqueado").ToString) Then
|
||||
|
||||
If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
If Retorno Then
|
||||
|
||||
For Each dr2 As DataRow In DTPRePolizaDes.Rows
|
||||
|
||||
Dim CveConceptoContableOriginal As Integer = dr2("CveConceptoContable").ToString.ToEntero
|
||||
Dim CveConceptoContableNuvo As Integer = -1
|
||||
|
||||
If dr2("Tipo").ToString = "IVA" Then
|
||||
|
||||
Select Case DdlRetIVAConcepto.SelectedValue.ToEntero
|
||||
Case 1
|
||||
|
||||
If CveConceptoContableOriginal.Contiene(184, 186, 249, 286) Then
|
||||
CveConceptoContableNuvo = 15
|
||||
ElseIf CveConceptoContableOriginal.Contiene(183, 185, 248, 285) Then
|
||||
CveConceptoContableNuvo = 22
|
||||
End If
|
||||
|
||||
Exit Select
|
||||
Case 2
|
||||
|
||||
If CveConceptoContableOriginal.Contiene(22, 186, 249, 286) Then
|
||||
CveConceptoContableNuvo = 184
|
||||
ElseIf CveConceptoContableOriginal.Contiene(15, 185, 248, 285) Then
|
||||
CveConceptoContableNuvo = 183
|
||||
End If
|
||||
|
||||
Exit Select
|
||||
Case 3
|
||||
|
||||
If CveConceptoContableOriginal.Contiene(22, 184, 249, 286) Then
|
||||
CveConceptoContableNuvo = 186
|
||||
ElseIf CveConceptoContableOriginal.Contiene(15, 183, 248, 285) Then
|
||||
CveConceptoContableNuvo = 187
|
||||
End If
|
||||
|
||||
Exit Select
|
||||
Case 4
|
||||
|
||||
If CveConceptoContableOriginal.Contiene(22, 184, 186, 286) Then
|
||||
CveConceptoContableNuvo = 249
|
||||
ElseIf CveConceptoContableOriginal.Contiene(15, 183, 185, 285) Then
|
||||
CveConceptoContableNuvo = 248
|
||||
End If
|
||||
|
||||
Exit Select
|
||||
Case 5
|
||||
|
||||
If CveConceptoContableOriginal.Contiene(22, 184, 186, 249) Then
|
||||
CveConceptoContableNuvo = 286
|
||||
ElseIf CveConceptoContableOriginal.Contiene(15, 183, 185, 248) Then
|
||||
CveConceptoContableNuvo = 285
|
||||
End If
|
||||
|
||||
Exit Select
|
||||
End Select
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If dr2("Tipo").ToString = "ISR" Then
|
||||
Select Case DdlRetISRConcepto.SelectedValue.ToEntero
|
||||
Case 1
|
||||
|
||||
If CveConceptoContableOriginal.Contiene(244, 328) Then
|
||||
CveConceptoContableNuvo = 23
|
||||
ElseIf CveConceptoContableOriginal.Contiene(243, 327) Then
|
||||
CveConceptoContableNuvo = 16
|
||||
End If
|
||||
|
||||
Exit Select
|
||||
Case 2
|
||||
|
||||
If CveConceptoContableOriginal.Contiene(23, 328) Then
|
||||
CveConceptoContableNuvo = 244
|
||||
ElseIf CveConceptoContableOriginal.Contiene(16, 327) Then
|
||||
CveConceptoContableNuvo = 243
|
||||
End If
|
||||
|
||||
Exit Select
|
||||
Case 3
|
||||
|
||||
If CveConceptoContableOriginal.Contiene(23, 244) Then
|
||||
CveConceptoContableNuvo = 328
|
||||
ElseIf CveConceptoContableOriginal.Contiene(16, 243) Then
|
||||
CveConceptoContableNuvo = 327
|
||||
End If
|
||||
|
||||
Exit Select
|
||||
End Select
|
||||
End If
|
||||
|
||||
|
||||
If Not (CveConceptoContableNuvo > 0 AndAlso ObjCompra.UpdateComprasPrepolizasRetIvaRetISRActualiza(dr2("CvePrePolizaDetalle").ToString.ToEntero, CveConceptoContableNuvo)) Then
|
||||
Retorno = False
|
||||
If CveConceptoContableNuvo <= 0 Then
|
||||
Alert("Se presento un error al asiganar el nuevo concepto de retención", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
For Each dr1 As DataRow In DTPRePolizaDesbloquedo.Rows
|
||||
|
||||
If Boolean.Parse(dr1("Bloqueado").ToString) Then
|
||||
If Not ObjContabilidad.UpdatePrePolizasDetalleBloquear(CvePrePoliza, True) Then
|
||||
Retorno = False
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If Retorno Then
|
||||
|
||||
If CveRetIVAConceptoOriginal > 0 Then
|
||||
CveRetIVAConceptoOriginal = DdlRetIVAConcepto.SelectedValue.ToEntero
|
||||
End If
|
||||
|
||||
If CveRetISRConceptoOriginal > 0 Then
|
||||
CveRetISRConceptoOriginal = DdlRetISRConcepto.SelectedValue.ToEntero
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
Retorno = False
|
||||
End If
|
||||
If CveRetIVAConceptoOriginal <> DdlRetIVAConcepto.SelectedValue.ToEntero Then tCveConceptoIVA = DdlRetIVAConcepto.SelectedValue.ToEntero
|
||||
If CveRetISRConceptoOriginal <> DdlRetISRConcepto.SelectedValue.ToEntero Then tCveConceptoISR = DdlRetISRConcepto.SelectedValue.ToEntero
|
||||
|
||||
If ObjCompra.UpdateComprasRetencionesUpdate(tCveConceptoIVA, tCveConceptoISR, CveCompra) Then
|
||||
If tCveConceptoIVA > 0 Then CveRetIVAConceptoOriginal = tCveConceptoIVA
|
||||
If tCveConceptoISR > 0 Then CveRetISRConceptoOriginal = tCveConceptoISR
|
||||
Else
|
||||
|
||||
Retorno = False
|
||||
Alert("Se presento un error al asignar el nuevo concepto de retención", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user