-- mejora en cvefacturas mayores a 4años
This commit is contained in:
@@ -1790,7 +1790,7 @@ Partial Class Compras_Compras
|
||||
Private Function CargaFactura(CveFactura As Integer) As String
|
||||
Dim ObjeFacturas As New ClsCompras
|
||||
Dim RFC As String = ""
|
||||
If ObjeFacturas.GetFacturas(CveFactura, "-1", NowADS().AddYears(-4), NowADS(), "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) AndAlso ObjeFacturas.DtResultados.Rows.Count > 0 Then
|
||||
If ObjeFacturas.GetFacturas(CveFactura, "-1", NowADS().AddYears(-6), NowADS(), "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) AndAlso ObjeFacturas.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador
|
||||
ViewState("CveTipoProveedor") = dr("CveTipoProveedor").ToString.ToEntero
|
||||
@@ -3566,89 +3566,87 @@ Partial Class Compras_Compras
|
||||
'End If
|
||||
|
||||
If RetIVAOriginal > 0 Then
|
||||
Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal
|
||||
Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal
|
||||
|
||||
If (CalRetIVAPor).RoundSQL(5) = 0.10666 OrElse (CalRetIVAPor).RoundSQL(5) = 0.05333 Then
|
||||
DdlRetIVAConcepto.SelectedValueExist("1") '10.66 servicios profesionales
|
||||
End If
|
||||
If RetIVAFlete Then '4 Fletes
|
||||
If RFCProveedor.Length = 13 Then
|
||||
DdlRetIVAConcepto.SelectedValueExist("2")
|
||||
Else
|
||||
DdlRetIVAConcepto.SelectedValueExist("3")
|
||||
End If
|
||||
End If
|
||||
If (CalRetIVAPor).RoundSQL(5) = 0.10666 OrElse (CalRetIVAPor).RoundSQL(5) = 0.05333 Then
|
||||
DdlRetIVAConcepto.SelectedValueExist("1") '10.66 servicios profesionales
|
||||
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
|
||||
'permitido en un margen de 1% a 2%
|
||||
If RetISRResico OrElse (CalRetISRPor >= 0.01 AndAlso CalRetISRPor <= 0.02) Then '1.25 Recico regimen simplificado confianza
|
||||
DdlRetISRConcepto.SelectedValueExist("3")
|
||||
RetISRResico = True
|
||||
If RetIVAFlete Then '4 Fletes
|
||||
If RFCProveedor.Length = 13 Then
|
||||
DdlRetIVAConcepto.SelectedValueExist("2")
|
||||
Else
|
||||
DdlRetIVAConcepto.SelectedValueExist("3")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
|
||||
CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
|
||||
If RetISROriginal > 0 Then
|
||||
Dim CalRetISRPor As Decimal = (RetISROriginal * 1 / SubTotal2Original).RoundAD(5).ToDecimal
|
||||
|
||||
LbAgregar.Enabled = True
|
||||
UpPSS.Update()
|
||||
UpPS.Update()
|
||||
UpParametros.Update()
|
||||
UPCondicionesPago.Update()
|
||||
'si tiene el habiltiado el módulo de Contratos
|
||||
'checo si tiene estimaciones
|
||||
|
||||
'CargaDatosEstimaciones(ObjProveedor.CveProveedor)
|
||||
ImgBtnBuscarOC.OnClientClick = String.Format("AbrirVentana('/OC/PopUpBuscarReq.aspx?V=VOCCOMP&P={0}&T={1}&Masterimpoup=true',1000,600,'S'); return false;", ObjProveedor.CveProveedor, DdlTipoComprobante.SelectedValue)
|
||||
CargaAnticipos(ObjProveedor.CveProveedor) : UpAnticipos.Update()
|
||||
|
||||
'If UsuarioActual.Empresa.UsaAC Then
|
||||
' If (TxtRetIVA.Text.ToDouble > 0) Or (TxtRetISR.Text.ToDouble > 0) Then '
|
||||
' ImgBtnBuscarOC.Visible = False
|
||||
' TxtOC.Enabled = False
|
||||
' BtnGuardar.Visible = False
|
||||
' Alert("El proveedor no tiene registrada cuentas contables de retenciones. Debe asignar las cuentas en el registro del proveedor.", TipoMensaje.MsgAdvertencia)
|
||||
' DivRestriccionAdvertencia.Visible = True
|
||||
' LtRestriccionAdvertencia.Text = "El proveedor no tiene registrada cuentas contables de retenciones."
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If CveProveedor > 0 Then
|
||||
|
||||
Dim ObjSAT As New ClsSAT
|
||||
Dim RFCRequest As String = ObjProveedor.RFC
|
||||
If ObjSAT.GetListado69B(2, UsuarioActual.CveEmpresa, RFCRequest) Then
|
||||
If ObjSAT.DtResultados.Rows.Count > 0 Then
|
||||
Dim Estatus As String = ObjSAT.DtResultados.Rows(0)("Situacion").ToString
|
||||
BtnGuardar.Enabled = False
|
||||
UpParametros.Update()
|
||||
|
||||
Alert($"El RFC del proveedor se encuentra en estado <b>{Estatus}</b> en el Listado EFOS (69B) del SAT", TipoMensaje.MsgAdvertencia)
|
||||
System.Threading.Thread.Sleep(5)
|
||||
End If
|
||||
If (CalRetISRPor).RoundSQL(1) = 0.1 Then '10 Servicios profesionales
|
||||
DdlRetISRConcepto.SelectedValueExist("1")
|
||||
End If
|
||||
'permitido en un margen de 1% a 2%
|
||||
If RetISRResico OrElse (CalRetISRPor >= 0.01 AndAlso CalRetISRPor <= 0.02) Then '1.25 Recico regimen simplificado confianza
|
||||
DdlRetISRConcepto.SelectedValueExist("3")
|
||||
RetISRResico = True
|
||||
End If
|
||||
ObjSAT.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
|
||||
PorcentajeProntoPago = ObjProveedor.PorcentajeProntoPago
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
|
||||
CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
|
||||
|
||||
LbAgregar.Enabled = True
|
||||
UpPSS.Update()
|
||||
UpPS.Update()
|
||||
UpParametros.Update()
|
||||
UPCondicionesPago.Update()
|
||||
'si tiene el habiltiado el módulo de Contratos
|
||||
'checo si tiene estimaciones
|
||||
|
||||
'CargaDatosEstimaciones(ObjProveedor.CveProveedor)
|
||||
ImgBtnBuscarOC.OnClientClick = String.Format("AbrirVentana('/OC/PopUpBuscarReq.aspx?V=VOCCOMP&P={0}&T={1}&Masterimpoup=true',1000,600,'S'); return false;", ObjProveedor.CveProveedor, DdlTipoComprobante.SelectedValue)
|
||||
CargaAnticipos(ObjProveedor.CveProveedor) : UpAnticipos.Update()
|
||||
|
||||
'If UsuarioActual.Empresa.UsaAC Then
|
||||
' If (TxtRetIVA.Text.ToDouble > 0) Or (TxtRetISR.Text.ToDouble > 0) Then '
|
||||
' ImgBtnBuscarOC.Visible = False
|
||||
' TxtOC.Enabled = False
|
||||
' BtnGuardar.Visible = False
|
||||
' Alert("El proveedor no tiene registrada cuentas contables de retenciones. Debe asignar las cuentas en el registro del proveedor.", TipoMensaje.MsgAdvertencia)
|
||||
' DivRestriccionAdvertencia.Visible = True
|
||||
' LtRestriccionAdvertencia.Text = "El proveedor no tiene registrada cuentas contables de retenciones."
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If CveProveedor > 0 Then
|
||||
|
||||
Dim ObjSAT As New ClsSAT
|
||||
Dim RFCRequest As String = ObjProveedor.RFC
|
||||
If ObjSAT.GetListado69B(2, UsuarioActual.CveEmpresa, RFCRequest) Then
|
||||
If ObjSAT.DtResultados.Rows.Count > 0 Then
|
||||
Dim Estatus As String = ObjSAT.DtResultados.Rows(0)("Situacion").ToString
|
||||
BtnGuardar.Enabled = False
|
||||
UpParametros.Update()
|
||||
|
||||
Alert($"El RFC del proveedor se encuentra en estado <b>{Estatus}</b> en el Listado EFOS (69B) del SAT", TipoMensaje.MsgAdvertencia)
|
||||
System.Threading.Thread.Sleep(5)
|
||||
End If
|
||||
End If
|
||||
ObjSAT.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
|
||||
PorcentajeProntoPago = ObjProveedor.PorcentajeProntoPago
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Ocurrió un error al consultar el proveedor.", TipoMensaje.MsgError)
|
||||
Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(560) = "1" Then
|
||||
If ObjProveedor.GetProveedoresEvaluacionPediente(Me.CveProveedor, UsuarioActual.CveEmpresa) Then
|
||||
If ObjProveedor.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Reference in New Issue
Block a user