-- 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"> <td runat="server" id="tdT5" visible="false">
<asp:Label Text="" ID="LbIVAOriginal" runat="server" /> <asp:Label Text="" ID="LbIVAOriginal" runat="server" />
</td> </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" 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>--%> <%--<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>--%>
<%--<td align="left" runat="server" id="TdIVA" visible="false"> <%--<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"> <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 ------------------ '------------------ INICIA VALIDACIONES ------------------
'If UsuarioActual.CveEmpresa.Contiene(13, 83) Then If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
Dim AnioFactura As Integer = TxtFecha.Text.ToDate.Year
Dim Fecha28Dic As Date = New Date(2024, 12, 28)
' Dim AnioFactura As Integer = TxtFecha.Text.ToDate.Year If NowADS() >= Fecha28Dic AndAlso TxtFecha.Text.ToDate.Year < 2025 Then
' Dim Fecha28Dic As Date = New Date(2024, 12, 28) Alert("A partir del 28 de diciembre de 2024 no se pueden registrar facturas de 2024.", TipoMensaje.MsgAdvertencia)
' If NowADS() >= Fecha28Dic AndAlso TxtFecha.Text.ToDate.Year < 2025 Then Exit Sub
' Alert("A partir del 28 de diciembre de 2024 no se pueden registrar facturas de 2024.", TipoMensaje.MsgAdvertencia) End If
' Exit Sub End If
' End If
'End If
If Not ValidaPresupuesto(2) Then If Not ValidaPresupuesto(2) Then
Exit Sub Exit Sub
@@ -15491,17 +15489,17 @@ Partial Class Compras_Compras
For Each gvr As GridViewRow In GvOC1.Rows For Each gvr As GridViewRow In GvOC1.Rows
If gvr.DataKey("IVAPorcentaje").ToDecimal > 0 Then 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 Else
ImporteOCSinIVA = ImporteOCSinIVA + (gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal) ImporteOCSinIVA = ImporteOCSinIVA + (gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal)
End If End If
Next Next
AjusteProntoPagoPorcentajeIVA = TmpDT.MAX("IVAPorcentaje").ToDecimal AjusteProntoPagoPorcentajeIVA = TmpDT.MAX("IVAPorcentaje").ToDecimal
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA) AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA) AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA)
If Math.Abs(AjusteProntoPagoConIVA) < 1 Then AjusteProntoPagoConIVA = 0 Else ImporteRNC += AjusteProntoPagoConIVA 'If Math.Abs(AjusteProntoPagoConIVA) < 1 Then AjusteProntoPagoConIVA = 0 Else ImporteRNC += AjusteProntoPagoConIVA
If Math.Abs(AjusteProntoPagoSinIVA) < 1 Then AjusteProntoPagoSinIVA = 0 'If Math.Abs(AjusteProntoPagoSinIVA) < 1 Then AjusteProntoPagoSinIVA = 0
If ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA) Then If ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA) Then
Vinculacion() Vinculacion()
@@ -17315,7 +17313,7 @@ Partial Class Compras_Compras
Dim DiferenciaPermitida As Decimal = 0.6D Dim DiferenciaPermitida As Decimal = 0.6D
If Math.Abs(DifTotales) > DiferenciaPermitida Then 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 EsValido = False
ElseIf DifTotales <> 0 Then ElseIf DifTotales <> 0 Then
TxtSubTotal2.Text = (TxtSubTotal2.Text.ToDecimal + DifTotales).ToString TxtSubTotal2.Text = (TxtSubTotal2.Text.ToDecimal + DifTotales).ToString
@@ -20958,67 +20956,67 @@ Partial Class Compras_Compras
End Sub End Sub
#End Region #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 ' TrRetIVA.Visible = True
TdRetIVAConcepto.Visible = True ' TdRetIVAConcepto.Visible = True
TotalOriginal = TxtTotal.Text.ToDecimal ' TotalOriginal = TxtTotal.Text.ToDecimal
For Each dRow As DataRow In TmpDT.Rows ' For Each dRow As DataRow In TmpDT.Rows
If dRow("CvePS").ToString.ToEntero <= 0 Then ' If dRow("CvePS").ToString.ToEntero <= 0 Then
Alert("Debe de asignar producto a todas las partidas", TipoMensaje.MsgAdvertencia) ' Alert("Debe de asignar producto a todas las partidas", TipoMensaje.MsgAdvertencia)
Exit Sub ' Exit Sub
End If ' End If
Next ' 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 InternalIVA As Decimal = 0D
Dim InternalRETIVA As Decimal = 0D ' Dim InternalRETIVA As Decimal = 0D
'InternalIVA = dRow("Cantidad").ToString.ToDecimal * dRow("PU").ToString.ToDecimal * 0.1D ' 'InternalIVA = dRow("Cantidad").ToString.ToDecimal * dRow("PU").ToString.ToDecimal * 0.1D
InternalRETIVA = dRow("Cantidad").ToString.ToDecimal * dRow("PU").ToString.ToDecimal * 0.06D ' InternalRETIVA = dRow("Cantidad").ToString.ToDecimal * dRow("PU").ToString.ToDecimal * 0.06D
'dRow("IVA") = InternalIVA ' 'dRow("IVA") = InternalIVA
'dRow("IVAPorcentaje") = 0.1D ' 'dRow("IVAPorcentaje") = 0.1D
dRow("RetIVA") = InternalRETIVA ' dRow("RetIVA") = InternalRETIVA
' dRow("IVAPorcentaje") = 0.1D ' ' dRow("IVAPorcentaje") = 0.1D
End If ' End If
Next ' Next
End If ' End If
TmpDT.AcceptChanges() ' TmpDT.AcceptChanges()
GvPS.DataSource = TmpDT ' GvPS.DataSource = TmpDT
GvPS.DataBind() ' GvPS.DataBind()
DdlRetIVAConcepto.SelectedValueExist("5") ' DdlRetIVAConcepto.SelectedValueExist("5")
LblRetIVA.Text = "6.0%" ' LblRetIVA.Text = "6.0%"
RetencionIVA = TmpDT.SUMD("RetIVA") ' RetencionIVA = TmpDT.SUMD("RetIVA")
TxtRetIVA.Text = RetencionIVA.ToString("###,###,###.00") ' TxtRetIVA.Text = RetencionIVA.ToString("###,###,###.00")
'TrasladoIVA = TmpDT.SUMD("IVA") ' 'TrasladoIVA = TmpDT.SUMD("IVA")
'TxtIVA.Text = TrasladoIVA.ToString("###,###,###.00") ' 'TxtIVA.Text = TrasladoIVA.ToString("###,###,###.00")
'Total = Total - RetencionIVA ' 'Total = Total - RetencionIVA
TxtTotal.Text = (TxtTotal.Text.ToDecimal - RetencionIVA).ToString("###,###,###.00") ' TxtTotal.Text = (TxtTotal.Text.ToDecimal - RetencionIVA).ToString("###,###,###.00")
UpPS.Update() ' UpPS.Update()
'ValidacionesTotalesXml() ' 'ValidacionesTotalesXml()
ValidaTotalesGuardar() ' ValidaTotalesGuardar()
End Sub 'End Sub
Public Sub LblProveedor_OnClick(sender As Object, e As EventArgs) Handles LblProveedor.Click Public Sub LblProveedor_OnClick(sender As Object, e As EventArgs) Handles LblProveedor.Click
If CveTipoConcepto = 2 Then If CveTipoConcepto = 2 Then