-- mejora en registros de remisiones con importes en dólares

This commit is contained in:
2024-10-18 10:43:41 -07:00
parent 254d822a05
commit 92f1028e03
2 changed files with 4 additions and 111 deletions

View File

@@ -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)

View File

@@ -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))