From 93317e7cf27e58d09453219ff0cc34b72d717785 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 10 Jan 2025 06:38:21 -0700 Subject: [PATCH] =?UTF-8?q?--=20MEJORA=20VINCULACI=C3=93N=20oc=20e189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx | 6 +-- Compras/Compras.aspx.vb | 106 ++++++++++++++++++++-------------------- 2 files changed, 55 insertions(+), 57 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index fff9c865e..0f27f7a23 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -1125,11 +1125,11 @@ - + <%-- Deglose 6% - <%----%> - + <%-- + --%> <%-- diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index d7e1240dd..43dd8ba46 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -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