-- mejora en GDiaz

This commit is contained in:
2024-12-09 09:26:52 -07:00
parent 2634106c3f
commit 139e58f8a1

View File

@@ -1656,36 +1656,6 @@ Partial Class Compras_Compras
DdlTipoComprobante_SelectedIndexChanged(Nothing, Nothing)
DdlTipoCompra.SelectedValueExist(15)
DdlTipoCompra_SelectedIndexChanged(Nothing, Nothing)
'For Each gvRow As GridViewRow In GvFacturaNC.Rows
' If gvRow.DataKey("CveCompra").ToEntero > 0 AndAlso gvRow.FCCheckBox("ChkFacturaNC").Checked Then
' Dim SerieFolioFacura As String = ObtenerUltimaParte(gvRow.DataKey("SerieFolio"))
' Dim seleccion As String = ""
' For Each item As ListItem In DdlRemisionNotaCredito.Items
' Dim serieFolioItem As String = ObtenerUltimaParte(item.Text)
' If SerieFolioFacura = serieFolioItem Then
' 'seleccion = item.Value
' AutoSelRNC = True
' DdlRemisionNotaCredito.SelectedValueExist(item.Value)
' Exit For
' End If
' Next
' If AutoSelRNC Then
' Exit For
' End If
' End If
'Next
If AutoSelRNC Then
'DdlRemisionNotaCredito_SelectedIndexChanged(Nothing, Nothing)
End If
HLAplicaNCFact.Visible = True
UpPS.Update()
UpEstatus.Update()
@@ -15189,8 +15159,6 @@ Partial Class Compras_Compras
UpGvOC1.Update()
TmpDT = TmpDT.FiltraParametros("", "PU")
'PROCESO DE ASIGNACION DE CANTIDAD DEPENDIENDO DEL NoIdentificacion DEL XML Y EL NumeroParte DEL PRODUCTO
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
For Each Gvr As GridViewRow In GvOC1.Rows
@@ -15446,17 +15414,13 @@ Partial Class Compras_Compras
Vinculacion()
ElseIf Math.Abs(LbSubTotalOC2.Text.ToDecimal - (LbSubTotalOC1.Text.ToDecimal - LbAnticiposOC2.Text.ToDecimal)) < DiferenciaPermitida Then
LbSubTotalDif.Visible = False
Vinculacion()
Else
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
If UsuarioActual.Empresa.Funcionalidad(574) = "1" Then
ImporteRNC = (SubTotalCompra - SubTotalGV).RoundSQL(2)
ImporteRNCProntoPago = (SubTotalCompra * PorcentajeProntoPago).RoundSQL(2)
Dim ImporteOCConIVA As Decimal = 0D
Dim ImporteOCSinIVA As Decimal = 0D
Dim ImporteCompraConIVA As Decimal = TmpDT.SUM("Total", " IVAPorcentaje > 0 ")
Dim ImporteCompraSinIVA As Decimal = TmpDT.SUM("Total", " IVAPorcentaje = 0 ")
@@ -15472,18 +15436,45 @@ Partial Class Compras_Compras
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA)
If ConfirmaVinculacionOCProntoPago(AjusteProntoPagoPorcentajeIVA) Then
If ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA) Then
Vinculacion()
End If
Else
Vinculacion()
End If
Else
If UsuarioActual.Empresa.Funcionalidad(574) = "1" Then
ImporteRNC = (SubTotalCompra - SubTotalGV).RoundSQL(2)
ImporteRNCProntoPago = (SubTotalCompra * PorcentajeProntoPago).RoundSQL(2)
Dim ImporteOCConIVA As Decimal = 0D
Dim ImporteOCSinIVA As Decimal = 0D
Dim ImporteCompraConIVA As Decimal = TmpDT.SUM("Total", " IVAPorcentaje > 0 ")
Dim ImporteCompraSinIVA As Decimal = TmpDT.SUM("Total", " IVAPorcentaje = 0 ")
For Each gvr As GridViewRow In GvOC1.Rows
If gvr.DataKey("IVAPorcentaje").ToDecimal > 0 Then
ImporteOCConIVA = ImporteOCConIVA + (gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal)
Else
ImporteOCSinIVA = ImporteOCSinIVA + (gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal)
End If
Next
AjusteProntoPagoPorcentajeIVA = TmpDT.MAX("IVAPorcentaje").ToDecimal
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA)
If ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA) Then
Vinculacion()
End If
Else
LbSubTotalDif.Visible = True
LbSubTotalDif.Text = (SubTotalCompra - SubTotalGV).FormatoNumero
Alert("Los SubTotales de la vinculación no coinciden. Rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia,,)
RegistraScript("CalculaTotalesOC();")
End If
End If
UpEstatus.Update()
@@ -15617,7 +15608,7 @@ Partial Class Compras_Compras
IndexTmpOriginal += 1
Next
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 AndAlso (AjusteProntoPagoConIVA > 0 Or AjusteProntoPagoSinIVA > 0) Then
If UsuarioActual.Empresa.Funcionalidad(574) = "1" AndAlso (AjusteProntoPagoConIVA > 0 Or AjusteProntoPagoSinIVA > 0) Then
Dim CvePS_RNC As Integer = UsuarioActual.Empresa.Funcionalidad(580).ToEntero
If CvePS_RNC = 0 Then
@@ -15637,9 +15628,6 @@ Partial Class Compras_Compras
Dim Clasificacion As String = PSRow("Clasificacion").ToString
Dim PS As String = PSRow("PS").ToString
Dim CveUM As Integer = PSRow("CveUnidadMedida").ToString.ToEntero
Dim DTConIVA As DataTable = TmpDT.FiltraParametros(" IVAPorcentaje > 0")
If DTConIVA.Rows.Count > 0 Then
@@ -15680,7 +15668,6 @@ Partial Class Compras_Compras
Tab.ActiveTabIndex = 0
UpTabs.Update()
ImgClasificacion.Visible = False
ImgSubProyecto.Visible = False
LbAgregar.Visible = False
@@ -16559,8 +16546,9 @@ Partial Class Compras_Compras
If DdlTipoCompra.Items.FindByValue("15") Is Nothing Then
DdlTipoCompra.Items.Add(New ListItem("Remision Nota De Crédito", "15"))
UpEstatus.Update()
'oculta el botón para aplicar el saldo, esto bloquea que no duplique el abono.
HLAplicaNCFact.Visible = False
End If
End If
Else
DivReembolso.Visible = True
@@ -17204,9 +17192,9 @@ Partial Class Compras_Compras
Dim NumNoDed As Integer = TmpDT.COUNT("CvePS", "NoDeducible = True ")
If NumNoDed > 0 Then GvPS.Columns(11).Visible = True 'visualiza columnas de nodeducibles
If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") And CveFactura <= 0 Then
InicializaAplicaNCFact()
End If
'If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") And CveFactura <= 0 Then
' InicializaAplicaNCFact()
'End If
End Sub
Private Sub OriginalesVisible(Accion As Boolean)
@@ -21824,12 +21812,11 @@ Partial Class Compras_Compras
End Set
End Property
Public Function ConfirmaVinculacionOCProntoPago(AjusteProntoPagoPorcentajeIVA As Decimal) As Boolean
Public Function ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA As Decimal) As Boolean
If VincularOcProntoPago Then
Return True
Else
Dim TmpImporteRNC As Decimal = If(AjusteProntoPagoPorcentajeIVA > 0, ImporteRNC + (ImporteRNC * AjusteProntoPagoPorcentajeIVA), ImporteRNC)
Dim TmpImporteRNCProntoPago As Decimal = If(AjusteProntoPagoPorcentajeIVA > 0, ImporteRNCProntoPago + (ImporteRNCProntoPago * AjusteProntoPagoPorcentajeIVA), ImporteRNCProntoPago)