From 92f1028e03d3efbb2ba4ccab0a257d24c847b49e Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 18 Oct 2024 10:43:41 -0700 Subject: [PATCH] =?UTF-8?q?--=20mejora=20en=20registros=20de=20remisiones?= =?UTF-8?q?=20con=20importes=20en=20d=C3=B3lares?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Transportes/RepContratoDetalle.aspx.vb | 111 ------------------------- Transportes/RepContratos.aspx.vb | 4 + 2 files changed, 4 insertions(+), 111 deletions(-) diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb index d68a4a5cc..eb28e17b0 100644 --- a/Transportes/RepContratoDetalle.aspx.vb +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -454,9 +454,6 @@ Partial Class RepContratoDetalle Private Function UpdateRemision(ByRef transaccionSql As SqlTransaction, CveSubProyectoNew As Integer, CveMonedaNew As Integer, TotalNew As Decimal, DescripcionNew As String) As Boolean Dim Respuesta As Boolean = False - - - Dim TmpDT As DataTable = New DataTable Dim OcurrioError As Boolean = False Dim ObjVentas As New ClsVentas(transaccionSql) @@ -489,104 +486,11 @@ Partial Class RepContratoDetalle Return False End If - - - - - - 'ObjVentas.IniciaTransacSQL() - Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL()) - 'Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL()) - 'Dim ObjCGame As New ClsCGame(ObjVentas.IniciaTransacSQL()) - Dim Moneda As Integer = DdlMoneda.SelectedValue.ToEntero() - 'Dim TipoCambio As Decimal = GlobalTipoCambio(FechaVenta).ToDecimal - 'Dim CveClienteSucursal As Integer = -1 - Dim TC As Decimal = If(CveMonedaNew = 2, GlobalTipoCambio(FechaVenta).ToDecimal, 1) Try - ''CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS - 'If DdlMoneda.SelectedValue.ToEntero() <> 2 AndAlso ChkConvertirDolares.Checked Then - - ' For Each Row As DataRow In TmpDT.Rows - ' Row("PU") = Math.Round(Row("PU").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, 6) - ' Row("Total") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales) - ' Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales) - ' Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales) - ' Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales) - ' Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales) - ' Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales) - ' Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString().ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales) - ' Next - - ' Dim ImpuestosLocales As Double = 0 - ' For Each gvr As GridViewRow In GvImpuestosLocales2.Rows - ' If gvr.RowType = DataControlRowType.DataRow Then - ' gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal).FormatoNumero - ' ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales) - ' End If - ' Next - - ' TxtSubTotal.Text = TmpDT.SUM("Total").FormatoNumero - ' LblDescuentos.Text = TmpDT.SUM("Descuento").FormatoNumero - ' LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal / TxtTipoCambioDlls.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero - ' TxtIVA.Text = TmpDT.SUM("ImporteIVA").FormatoNumero - ' TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").FormatoNumero - ' TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").FormatoNumero - ' TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").FormatoNumero - ' TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero - - ' TipoCambio = TxtTipoCambioDlls.Text.Trim.ToDecimal - ' Moneda = 2 - 'End If - - ''CONVERTIR REMISION - TIPO MONEDA -PESO A DOLARES - 'If DdlMoneda.SelectedValue.ToEntero() <> 1 AndAlso ChkConvertirDoctoPesos.Checked Then - ' Dim Importe As Decimal - - - ' For Each Row As DataRow In TmpDT.Rows - ' Row("PU") = Math.Round(Row("PU").ToString().ToDecimal * TCC, 6) - ' Row("Total") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales) - ' Row("TotalImporte") = Math.Round(Row("Cantidad").ToString().ToDecimal * Row("PU").ToString().ToDecimal, NumeroDecimales) - ' Row("Descuento") = Math.Round(Row("Descuento").ToString().ToDecimal * TCC, NumeroDecimales) - ' Importe = Row("Total").ToString().ToDecimal - Row("Descuento").ToString().ToDecimal - ' Row("ImporteIEPS") = Math.Round(Importe * Row("PorcentajeIEPS").ToString().ToDecimal, NumeroDecimales) - ' Row("ImporteIVA") = Math.Round(Importe * Row("PorcentajeIVA").ToString().ToDecimal, NumeroDecimales) - ' Row("ImporteRetIVA") = Math.Round(Importe * Row("PorcentajeRetIVA").ToString().ToDecimal, NumeroDecimales) - ' Row("ImporteRetISR") = Math.Round(Importe * Row("PorcentajeRetISR").ToString().ToDecimal, NumeroDecimales) - ' Next - - ' Dim ImpuestosLocales As Double = 0 - ' For Each gvr As GridViewRow In GvImpuestosLocales2.Rows - ' If gvr.RowType = DataControlRowType.DataRow Then - ' gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal).FormatoNumero - ' ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales) - ' End If - ' Next - - ' TxtSubTotal.Text = TmpDT.SUM("Total").FormatoNumero - ' LblDescuentos.Text = TmpDT.SUM("Descuento").FormatoNumero - ' LblAmortizacion.Text = Math.Round(LblAmortizacion.Text.Trim.ToDecimal * TxtTipoCambio.Text.Trim.ToDecimal, NumeroDecimales).FormatoNumero - ' TxtIVA.Text = TmpDT.SUM("ImporteIVA").FormatoNumero - ' TxtRetIVA.Text = TmpDT.SUM("ImporteRetIVA").FormatoNumero - ' TxtRetISR.Text = TmpDT.SUM("ImporteRetISR").FormatoNumero - ' TxtIEPS.Text = TmpDT.SUM("ImporteIEPS").FormatoNumero - ' TxtTotal.Text = (TxtSubTotal.Text.ToDecimal - LblDescuentos.Text.ToDecimal - LblAmortizacion.Text.ToDecimal + TxtIVA.Text.ToDecimal + TxtIEPS.Text.ToDecimal - TxtRetIVA.Text.ToDecimal - TxtRetISR.Text.ToDecimal - ImpuestosLocales).ToDecimal.FormatoNumero - - - ' TipoCambio = 1 - ' Moneda = 1 - 'End If - - 'Dim FechaParaSurtir As DateTime = MinFecha - 'If TxtFechaOS.Text.Replace(",", "").ToDateTime() > MinFecha Then - ' FechaParaSurtir = TxtFechaOS.Text.Replace(",", "").ToDateTime() - 'End If - - If Not ObjVentas.UpdateVentas(SubTotalNew, 0, IVANew, 0, TotalNew, CveMonedaNew, TC, FechaVenta, DescripcionNew, UsuarioActual.CveEmpresa, CveVentaRemision, Vigencia:=FechaVenta, CondicionesPago:=-1, @@ -598,8 +502,6 @@ Partial Class RepContratoDetalle OcurrioError = True End If - - 'Cargo de nueva cuenta el detalle de Ventas (Conceptos) If Not OcurrioError Then Dim index As Integer = 0 @@ -615,11 +517,7 @@ Partial Class RepContratoDetalle Next End If - - If Not OcurrioError Then - - ' Dim ObjPrePoliza As New ClsContabilidad(transaccionSql) Dim DTPrePoliza As New DataTable If ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) Then @@ -632,7 +530,6 @@ Partial Class RepContratoDetalle OcurrioError = True End If - For Each dRow As DataRow In DTPrePoliza.Rows If Not ObjConta.UpdatePrePolizasDetalle(dRow("CvePrePolizaDetalle").ToString.ToEntero, dRow("Concepto").ToString, dRow("CveSubProyecto").ToString.ToEntero, -1, Boolean.Parse(dRow("TipoMovto").ToString), ImporteMN:=(TotalNew * TC), Importe:=TotalNew, TipoCambio:=TC) Then @@ -640,11 +537,8 @@ Partial Class RepContratoDetalle Exit For End If Next - - End If - If ObjConta.ValidacionesPrePoliza(-1, UsuarioActual, Opcion:=2, CveVenta:=CveVentaRemision) Then If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre = 2 Then @@ -653,8 +547,6 @@ Partial Class RepContratoDetalle End If End If End If - - Catch ex As Exception OcurrioError = True OnError("Ocurrió un error al actualizar la remisión", ex) @@ -667,9 +559,6 @@ Partial Class RepContratoDetalle ' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, JSBtnAceptar:="BtnRefrescarPagina();") Return True End If - - - End Function Protected Sub EliminarContrato(sender As Object, e As EventArgs) diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index 4d52760c6..aabc0d25a 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -325,9 +325,13 @@ Partial Class ListadoContratos If ObjFactura IsNot Nothing AndAlso ProcesoOK Then + ObjFactura.CveMoneda = CveMoneda ObjFactura.CveContrato = CveContrato ObjFactura.Observaciones = ObsPartida ObjFactura.CveFormaPago33 = 20 ' por definir + If CveMoneda > 1 Then + ObjFactura.TipoCambio = GlobalTipoCambio(DateTime.Now).ToDecimal + End If Dim TmpDTMat As New DataTable TmpDTMat.Columns.Add("Consec", GetType(Integer))