-- MEJORA VINCULACIÓN oc e189

This commit is contained in:
2025-01-10 06:38:21 -07:00
parent 00ec64c862
commit 93317e7cf2
2 changed files with 55 additions and 57 deletions

View File

@@ -1125,11 +1125,11 @@
<td runat="server" id="tdT5" visible="false">
<asp:Label Text="" ID="LbIVAOriginal" runat="server" />
</td>
<td runat="server" id="tdIVA6" visible="false" class="label label-sm label-success" style="color: white!important">
<%-- <td runat="server" id="tdIVA6" visible="false" class="label label-sm label-success" style="color: white!important">
<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click" Style="color: white!important">Deglose 6%</asp:LinkButton>
<%--<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click"><i class="fa fa-usd" aria-hidden="true"></i></asp:LinkButton>--%>
</td>
<%--<asp:LinkButton runat="server" ID="LnkActivaIva6" Text="" ToolTip="Ret IVA Servicios" OnClick="LnkActivaIva6_Click"><i class="fa fa-usd" aria-hidden="true"></i></asp:LinkButton>
</td>--%>
<%--<td align="left" runat="server" id="TdIVA" visible="false">
<asp:DropDownList ID="DdlIVA" AutoPostBack="true" OnSelectedIndexChanged="DdlIVA_SelectedIndexChanged" CssClass="select2me" Style="width: 100%; display: inline-block;" runat="server" Visible="false">

View File

@@ -4313,16 +4313,14 @@ Partial Class Compras_Compras
'------------------ INICIA VALIDACIONES ------------------
'If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
' Dim AnioFactura As Integer = TxtFecha.Text.ToDate.Year
' Dim Fecha28Dic As Date = New Date(2024, 12, 28)
' If NowADS() >= Fecha28Dic AndAlso TxtFecha.Text.ToDate.Year < 2025 Then
' Alert("A partir del 28 de diciembre de 2024 no se pueden registrar facturas de 2024.", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
'End If
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
Dim AnioFactura As Integer = TxtFecha.Text.ToDate.Year
Dim Fecha28Dic As Date = New Date(2024, 12, 28)
If NowADS() >= Fecha28Dic AndAlso TxtFecha.Text.ToDate.Year < 2025 Then
Alert("A partir del 28 de diciembre de 2024 no se pueden registrar facturas de 2024.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If Not ValidaPresupuesto(2) Then
Exit Sub
@@ -15491,17 +15489,17 @@ Partial Class Compras_Compras
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)
ImporteOCConIVA = ImporteOCConIVA + (gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal)
Else
ImporteOCSinIVA = ImporteOCSinIVA + (gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal)
ImporteOCSinIVA = ImporteOCSinIVA + (gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal)
End If
Next
AjusteProntoPagoPorcentajeIVA = TmpDT.MAX("IVAPorcentaje").ToDecimal
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA)
If Math.Abs(AjusteProntoPagoConIVA) < 1 Then AjusteProntoPagoConIVA = 0 Else ImporteRNC += AjusteProntoPagoConIVA
If Math.Abs(AjusteProntoPagoSinIVA) < 1 Then AjusteProntoPagoSinIVA = 0
'If Math.Abs(AjusteProntoPagoConIVA) < 1 Then AjusteProntoPagoConIVA = 0 Else ImporteRNC += AjusteProntoPagoConIVA
'If Math.Abs(AjusteProntoPagoSinIVA) < 1 Then AjusteProntoPagoSinIVA = 0
If ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA) Then
Vinculacion()
@@ -17315,7 +17313,7 @@ Partial Class Compras_Compras
Dim DiferenciaPermitida As Decimal = 0.6D
If Math.Abs(DifTotales) > DiferenciaPermitida Then
Alert(String.Format("Los importes de los conceptos (Productos/Servicios) no cuadran con el total. Por favor verifique y vuelva a intentar.[{0}]", Math.Abs(DifTotales) - DiferenciaPermitida), TipoMensaje.MsgAdvertencia)
Alert(String.Format("Los importes de los conceptos (Productos/Servicios) no cuadran con el total. Por favor verifique y vuelva a intentar.[{0}]-[{1}-{2}]", Math.Abs(DifTotales) - DiferenciaPermitida, TxtTotal.Text.ToDecimal, TempTotal), TipoMensaje.MsgAdvertencia)
EsValido = False
ElseIf DifTotales <> 0 Then
TxtSubTotal2.Text = (TxtSubTotal2.Text.ToDecimal + DifTotales).ToString
@@ -20958,67 +20956,67 @@ Partial Class Compras_Compras
End Sub
#End Region
Protected Sub LnkActivaIva6_Click(sender As Object, e As EventArgs)
'Protected Sub LnkActivaIva6_Click(sender As Object, e As EventArgs)
TrRetIVA.Visible = True
TdRetIVAConcepto.Visible = True
TotalOriginal = TxtTotal.Text.ToDecimal
' TrRetIVA.Visible = True
' TdRetIVAConcepto.Visible = True
' TotalOriginal = TxtTotal.Text.ToDecimal
For Each dRow As DataRow In TmpDT.Rows
If dRow("CvePS").ToString.ToEntero <= 0 Then
Alert("Debe de asignar producto a todas las partidas", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Next
' For Each dRow As DataRow In TmpDT.Rows
' If dRow("CvePS").ToString.ToEntero <= 0 Then
' Alert("Debe de asignar producto a todas las partidas", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
' Next
If RetencionIVA = 0 And IVAOriginal > 0 Then
' If RetencionIVA = 0 And IVAOriginal > 0 Then
For Each dRow As DataRow In TmpDT.Rows
' For Each dRow As DataRow In TmpDT.Rows
If dRow("CveTipoPS").ToString.ToEntero = 1 Then
' If dRow("CveTipoPS").ToString.ToEntero = 1 Then
'Dim InternalIVA As Decimal = 0D
Dim InternalRETIVA As Decimal = 0D
' 'Dim InternalIVA As Decimal = 0D
' Dim InternalRETIVA As Decimal = 0D
'InternalIVA = dRow("Cantidad").ToString.ToDecimal * dRow("PU").ToString.ToDecimal * 0.1D
InternalRETIVA = dRow("Cantidad").ToString.ToDecimal * dRow("PU").ToString.ToDecimal * 0.06D
' 'InternalIVA = dRow("Cantidad").ToString.ToDecimal * dRow("PU").ToString.ToDecimal * 0.1D
' InternalRETIVA = dRow("Cantidad").ToString.ToDecimal * dRow("PU").ToString.ToDecimal * 0.06D
'dRow("IVA") = InternalIVA
'dRow("IVAPorcentaje") = 0.1D
dRow("RetIVA") = InternalRETIVA
' dRow("IVAPorcentaje") = 0.1D
' 'dRow("IVA") = InternalIVA
' 'dRow("IVAPorcentaje") = 0.1D
' dRow("RetIVA") = InternalRETIVA
' ' dRow("IVAPorcentaje") = 0.1D
End If
' End If
Next
End If
' Next
' End If
TmpDT.AcceptChanges()
' TmpDT.AcceptChanges()
GvPS.DataSource = TmpDT
GvPS.DataBind()
' GvPS.DataSource = TmpDT
' GvPS.DataBind()
DdlRetIVAConcepto.SelectedValueExist("5")
' DdlRetIVAConcepto.SelectedValueExist("5")
LblRetIVA.Text = "6.0%"
' LblRetIVA.Text = "6.0%"
RetencionIVA = TmpDT.SUMD("RetIVA")
TxtRetIVA.Text = RetencionIVA.ToString("###,###,###.00")
' RetencionIVA = TmpDT.SUMD("RetIVA")
' TxtRetIVA.Text = RetencionIVA.ToString("###,###,###.00")
'TrasladoIVA = TmpDT.SUMD("IVA")
'TxtIVA.Text = TrasladoIVA.ToString("###,###,###.00")
' 'TrasladoIVA = TmpDT.SUMD("IVA")
' 'TxtIVA.Text = TrasladoIVA.ToString("###,###,###.00")
'Total = Total - RetencionIVA
TxtTotal.Text = (TxtTotal.Text.ToDecimal - RetencionIVA).ToString("###,###,###.00")
' 'Total = Total - RetencionIVA
' TxtTotal.Text = (TxtTotal.Text.ToDecimal - RetencionIVA).ToString("###,###,###.00")
UpPS.Update()
' UpPS.Update()
'ValidacionesTotalesXml()
ValidaTotalesGuardar()
' 'ValidacionesTotalesXml()
' ValidaTotalesGuardar()
End Sub
'End Sub
Public Sub LblProveedor_OnClick(sender As Object, e As EventArgs) Handles LblProveedor.Click
If CveTipoConcepto = 2 Then