-- mejora, en la sugerencia, en el caso de retenciones
This commit is contained in:
@@ -2184,12 +2184,10 @@ Partial Class Compras_Compras
|
||||
ObjSAT.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Return RFC
|
||||
End Function
|
||||
|
||||
Private Sub CargaRetIVAConcepto(Optional Cambio As Boolean = False)
|
||||
Private Sub CargaRetIVAConcepto(Optional Cambio As Boolean = False, Optional DIOTCveTipoOperacion As Integer = -1)
|
||||
|
||||
If TrRetIVA.Visible Then
|
||||
TdRetIVAConcepto.Visible = True
|
||||
@@ -2198,32 +2196,66 @@ Partial Class Compras_Compras
|
||||
If Cambio Then
|
||||
DdlRetIVAConcepto.Items.Clear()
|
||||
|
||||
If RFCProv.Length = 13 Then
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1"))
|
||||
DdlRetIVAConcepto.Items.Insert(1, New ListItem("Fletes P.F.", "2"))
|
||||
If RFCProv.Length = 13 Then ' personal moral
|
||||
If DIOTCveTipoOperacion = 1 Then '03 - Prestación de Servicios Profesionales
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1"))
|
||||
End If
|
||||
|
||||
If DIOTCveTipoOperacion = 2 Then ' 06 - Arrendamiento de inmuebles
|
||||
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
|
||||
End If
|
||||
|
||||
If DIOTCveTipoOperacion = 3 Then ' 85 - Otros
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1"))
|
||||
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Fletes P.F.", "2"))
|
||||
End If
|
||||
|
||||
ElseIf RFCProv.Length = 12 Then
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Fletes P.M.", "3"))
|
||||
If DIOTCveTipoOperacion = 1 Then '03 - Prestación de Servicios Profesionales
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1"))
|
||||
End If
|
||||
|
||||
If DIOTCveTipoOperacion = 2 Then ' 06 - Arrendamiento de inmuebles
|
||||
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
|
||||
End If
|
||||
|
||||
If DIOTCveTipoOperacion = 3 Then ' 85 - Otros
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Honorarios/Serv. Prof.", "1"))
|
||||
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
|
||||
DdlRetIVAConcepto.Items.Insert(0, New ListItem("Fletes P.F.", "2"))
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
|
||||
''If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then
|
||||
DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5"))
|
||||
''End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
UpPS.Update()
|
||||
|
||||
End Sub
|
||||
Private Sub CargaRetISRConcepto(Optional Cambio As Boolean = False)
|
||||
Private Sub CargaRetISRConcepto(Optional Cambio As Boolean = False, Optional DIOTCveTipoOperacion As Integer = -1)
|
||||
If TrRetISR.Visible Then
|
||||
TdRetISRConcepto.Visible = True
|
||||
End If
|
||||
If Cambio Then
|
||||
DdlRetISRConcepto.Items.Clear()
|
||||
DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1"))
|
||||
DdlRetISRConcepto.Items.Insert(1, New ListItem("Arrendamiento", "2"))
|
||||
DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3"))
|
||||
|
||||
If DIOTCveTipoOperacion = 1 Then '03 - Prestación de Servicios Profesionales
|
||||
DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1"))
|
||||
DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3"))
|
||||
End If
|
||||
|
||||
If DIOTCveTipoOperacion = 2 Then ' 06 - Arrendamiento de inmuebles
|
||||
DdlRetISRConcepto.Items.Insert(0, New ListItem("Arrendamiento", "2"))
|
||||
DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3"))
|
||||
End If
|
||||
|
||||
If DIOTCveTipoOperacion = 3 Then ' 85 - Otros
|
||||
DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1"))
|
||||
DdlRetISRConcepto.Items.Insert(1, New ListItem("Arrendamiento", "2"))
|
||||
DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3"))
|
||||
End If
|
||||
|
||||
End If
|
||||
UpPS.Update()
|
||||
@@ -3411,56 +3443,53 @@ Partial Class Compras_Compras
|
||||
HdnCveProveedor.Value = ObjProveedor.CveProveedor.ToString
|
||||
TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
|
||||
RFCProv = ObjProveedor.RFC
|
||||
CargaRetIVAConcepto(True)
|
||||
CargaRetISRConcepto(True)
|
||||
CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
|
||||
CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
|
||||
|
||||
If ObjProveedor.DIOTCveTipoOperacion = 1 Then '03 - Prestación de Servicios Profesionales
|
||||
DdlRetIVAConcepto.SelectedValueExist("1")
|
||||
DdlRetISRConcepto.SelectedValueExist("1") ' honorarios
|
||||
ElseIf ObjProveedor.DIOTCveTipoOperacion = 2 Then ' 06 - Arrendamiento de inmuebles
|
||||
DdlRetIVAConcepto.SelectedValueExist("4")
|
||||
DdlRetISRConcepto.SelectedValueExist("2") ' arrendamiento
|
||||
ElseIf ObjProveedor.DIOTCveTipoOperacion = 3 Then ' 85 - Otros
|
||||
DdlRetIVAConcepto.SelectedValueExist("2") ' flete pf
|
||||
DdlRetIVAConcepto.SelectedValueExist("3") ' fletes pm
|
||||
DdlRetISRConcepto.SelectedValueExist("1") ' honorarios
|
||||
ElseIf ObjProveedor.DIOTCveTipoOperacion = 0 Then
|
||||
'If ObjProveedor.DIOTCveTipoOperacion = 1 Then '03 - Prestación de Servicios Profesionales
|
||||
' DdlRetIVAConcepto.SelectedValueExist("1")
|
||||
' DdlRetISRConcepto.SelectedValueExist("1") ' honorarios
|
||||
'ElseIf ObjProveedor.DIOTCveTipoOperacion = 2 Then ' 06 - Arrendamiento de inmuebles
|
||||
' DdlRetIVAConcepto.SelectedValueExist("4")
|
||||
' DdlRetISRConcepto.SelectedValueExist("2") ' arrendamiento
|
||||
'ElseIf ObjProveedor.DIOTCveTipoOperacion = 3 Then ' 85 - Otros
|
||||
' DdlRetIVAConcepto.SelectedValueExist("2") ' flete pf
|
||||
' DdlRetIVAConcepto.SelectedValueExist("3") ' fletes pm
|
||||
' DdlRetISRConcepto.SelectedValueExist("1") ' honorarios
|
||||
' 'ElseIf ObjProveedor.DIOTCveTipoOperacion = 0 Then
|
||||
|
||||
'End If
|
||||
|
||||
If CveFactura > 0 Then
|
||||
If CveFactura > 0 Then
|
||||
|
||||
If RetIVAOriginal > 0 Then
|
||||
Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal
|
||||
|
||||
If (CalRetIVAPor).RoundAD(6) = 0.106667 Then
|
||||
DdlRetIVAConcepto.SelectedValueExist("1") '10.66 servicios profecionales
|
||||
End If
|
||||
|
||||
If (CalRetIVAPor).RoundAD(2) = 0.04 Then '4 Fletes
|
||||
|
||||
If RFCProv.Length = 13 Then
|
||||
DdlRetIVAConcepto.SelectedValueExist("2")
|
||||
Else
|
||||
DdlRetIVAConcepto.SelectedValueExist("3")
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
If RetIVAOriginal > 0 Then
|
||||
Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal
|
||||
|
||||
If (CalRetIVAPor).RoundSQL(6) = 0.106667 OrElse (CalRetIVAPor).RoundSQL(6) = 0.053333 Then
|
||||
DdlRetIVAConcepto.SelectedValueExist("1") '10.66 servicios profecionales
|
||||
End If
|
||||
|
||||
If RetISROriginal > 0 Then
|
||||
If (CalRetIVAPor).RoundSQL(2) = 0.04 Then '4 Fletes
|
||||
|
||||
Dim CalRetISRPor As Decimal = (RetISROriginal * 1 / SubTotal2Original).RoundAD(5).ToDecimal
|
||||
|
||||
If (CalRetISRPor).RoundAD(1) = 0.1 Then '10 Sercviios profecionales
|
||||
DdlRetISRConcepto.SelectedValueExist("1")
|
||||
If RFCProv.Length = 13 Then
|
||||
DdlRetIVAConcepto.SelectedValueExist("2")
|
||||
Else
|
||||
DdlRetIVAConcepto.SelectedValueExist("3")
|
||||
End If
|
||||
End If
|
||||
|
||||
If (CalRetISRPor).RoundAD(4) = 0.0125 Then '1.25 Recico regimen simplificado confianza
|
||||
DdlRetISRConcepto.SelectedValueExist("3")
|
||||
End If
|
||||
End If
|
||||
|
||||
If RetISROriginal > 0 Then
|
||||
|
||||
Dim CalRetISRPor As Decimal = (RetISROriginal * 1 / SubTotal2Original).RoundAD(5).ToDecimal
|
||||
|
||||
If (CalRetISRPor).RoundSQL(1) = 0.1 Then '10 Servicios profesionales
|
||||
DdlRetISRConcepto.SelectedValueExist("1")
|
||||
End If
|
||||
|
||||
If (CalRetISRPor).RoundSQL(4) = 0.0125 Then '1.25 Recico regimen simplificado confianza
|
||||
DdlRetISRConcepto.SelectedValueExist("3")
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -6780,19 +6809,20 @@ Partial Class Compras_Compras
|
||||
importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora
|
||||
'no es necesario, ya se está interpretandoe l usado como producto
|
||||
'If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora
|
||||
|
||||
Dim Valor As Decimal = 0
|
||||
For Each RowAcum As DataRow In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").Rows
|
||||
Dim TotalTamanio = TmpDT.FiltroPrimeroValor("Total", $"CvePS={RowAcum("CvePSCargo")}").ToDecimal()
|
||||
If TotalTamanio > 0 Then
|
||||
Valor += TotalTamanio
|
||||
End If
|
||||
Next
|
||||
' Dim Valor As Decimal = 0
|
||||
' For Each RowAcum As DataRow In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").Rows
|
||||
' Dim TotalTamanio = TmpDT.FiltroPrimeroValor("Total", $"CvePS={RowAcum("CvePSCargo")}").ToDecimal()
|
||||
' If TotalTamanio > 0 Then
|
||||
' Valor += TotalTamanio
|
||||
' End If
|
||||
' Next
|
||||
|
||||
importeMovimiento += Valor
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
End If
|
||||
' importeMovimiento += Valor
|
||||
' importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
'End If
|
||||
|
||||
Dim ConceptoContabilizacionNC = 225
|
||||
Dim CveMovimientoDevolucion As Integer = -1
|
||||
|
||||
Reference in New Issue
Block a user