cambios de extensiones .SUM de double a decimal
This commit is contained in:
@@ -5361,6 +5361,11 @@ Partial Class Compras_Compras
|
||||
Next
|
||||
|
||||
''insertar en prepólizas
|
||||
Dim tImporte As Decimal
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoAlmacen, UsuarioActual.CveEmpresa) Then
|
||||
tImporte = ObjInventario.DtResultados.SUM("Total")
|
||||
End If
|
||||
ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 68, ObjInventario.Folio.ToString, ObjInventario.Folio.ToString, CveMovimientoAlmacen:=CveMovimientoInventario)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
@@ -18018,11 +18023,11 @@ Partial Class Compras_Compras
|
||||
Continue For
|
||||
End If
|
||||
CveMovimientoInventario = DtInv.MAX("CveMovimiento", $"CveCompraDetalle = {Row2("CveCompraDetalle")}").ToEntero
|
||||
ImporteMovimiento = DtInv.SUM(If(DdlMoneda.SelectedValue = "1", "Total", "TotalExtranjero"), $"CveCompraDetalle = {Row2("CveCompraDetalle")}").ToDecimal
|
||||
ImporteMovimiento = DtInv.SUM(If(DdlMoneda.SelectedValue = "1", "Total", "TotalExtranjero"), $"CveCompraDetalle = {Row2("CveCompraDetalle")}")
|
||||
ImporteMovimiento = If(ImporteMovimiento > Row2("Total").ToString.ToDecimal, Row2("Total").ToString.ToDecimal, ImporteMovimiento) * Multiplicador
|
||||
|
||||
'VALIDA QUE CUANDO SEA DOLARES TENGA PUEXTRANJERO EN EL MOVTO DE ALMACEN
|
||||
If DdlMoneda.SelectedValue = "2" And ImporteMovimiento = 0 And DtInv.SUM("Total", $"CveCompraDetalle = {Row2("CveCompraDetalle")}").ToDecimal > 0 Then
|
||||
If DdlMoneda.SelectedValue = "2" And ImporteMovimiento = 0 And DtInv.SUM("Total", $"CveCompraDetalle = {Row2("CveCompraDetalle")}") > 0 Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -3447,7 +3447,7 @@ Partial Class PopUpVerFactura
|
||||
If CveTipoAlmacenRelacionado.Contiene(24, 25) Then
|
||||
If ObjInventarios.GetMovimientosDetalle(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) Then
|
||||
Dim DtUsados As DataTable = ObjInventarios.DtResultados.Copy()
|
||||
CantidadUsados = DtUsados.SUM("Cantidad").ToDecimal()
|
||||
CantidadUsados = DtUsados.SUM("Cantidad")
|
||||
Dim IndexInicialUsados As Integer = DtMovimientos.Rows.Count + 1
|
||||
|
||||
For Each Dr As DataRow In DtUsados.Rows
|
||||
@@ -3474,7 +3474,7 @@ Partial Class PopUpVerFactura
|
||||
|
||||
If ObjInventarios.GetMovimientosTransitorios(CveAlmacenRecepcion, -1, CveAlmacenTransitorioRecepcion, -1, FolioBusquedaTrasitorio, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
|
||||
DtMovimientos = ObjInventarios.DtResultados.FiltraParametros(String.Format("CveTipoAlmacenDestino <> 4 AND CvePS > 0"))
|
||||
CantidadProductos = DtMovimientos.SUM("Cantidad").ToDecimal()
|
||||
CantidadProductos = DtMovimientos.SUM("Cantidad")
|
||||
|
||||
If Not DtMovimientos.Columns.Contains("No") Then
|
||||
DtMovimientos.Columns.Add("No", GetType(Integer))
|
||||
@@ -3490,7 +3490,7 @@ Partial Class PopUpVerFactura
|
||||
Else
|
||||
If ObjInventarios.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa, Resumen:=Resumen) Then
|
||||
DtMovimientos = ObjInventarios.DtResultados.Copy()
|
||||
CantidadProductos = DtMovimientos.SUM("Cantidad").ToDecimal()
|
||||
CantidadProductos = DtMovimientos.SUM("Cantidad")
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveMovimientoRelacionado > 0 Then
|
||||
If ObjInventarios.GetMovimientos(CveMovimientoRelacionado, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
Dim CveAlmacenRelacionado As Integer = ObjInventarios.CveAlmacen
|
||||
@@ -3500,7 +3500,7 @@ Partial Class PopUpVerFactura
|
||||
If CveTipoAlmacenRelacionado.Contiene(24, 25) Then
|
||||
If ObjInventarios.GetMovimientosDetalle(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) Then
|
||||
Dim DtUsados As DataTable = ObjInventarios.DtResultados.Copy()
|
||||
CantidadUsados = DtUsados.SUM("Cantidad").ToDecimal()
|
||||
CantidadUsados = DtUsados.SUM("Cantidad")
|
||||
Dim IndexInicialUsados As Integer = DtMovimientos.Rows.Count + 1
|
||||
|
||||
For Each Dr As DataRow In DtUsados.Rows
|
||||
@@ -3686,7 +3686,7 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("RFCProveedor", If(CveCompra > 0, dr("RFC").ToString, "")))
|
||||
params.Add(New ReportParameter("TelefonoProveedor", If(CveCompra > 0, dr("Telefono").ToString, "")))
|
||||
params.Add(New ReportParameter("ContactoProveedor", If(CveCompra > 0, dr("ContactoNombre").ToString, "")))
|
||||
params.Add(New ReportParameter("ImporteLetra", String.Format("({0})", DtMovimientos.SUM("Total").ToString.ToDouble.Texto2Letras(CveMoneda).ToUpper)))
|
||||
params.Add(New ReportParameter("ImporteLetra", String.Format("({0})", DtMovimientos.SUM("Total").ToString.ToDecimal.Texto2Letras(CveMoneda).ToUpper)))
|
||||
params.Add(New ReportParameter("SubTotal", If(CveCompra > 0, (dr("SubTotal").ToString.ToDouble).FormatoNumero, "")))
|
||||
params.Add(New ReportParameter("Descuentos", If(CveCompra > 0, (dr("Descuentos").ToString.ToDouble).FormatoNumero(2), "")))
|
||||
params.Add(New ReportParameter("IVA", If(CveCompra > 0, (dr("IVA").ToString.ToDouble).FormatoNumero, "")))
|
||||
@@ -3745,7 +3745,7 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("Descuentos", If(CveCompra > 0, (dr("Descuentos").ToString.ToDouble).FormatoNumero(2), "")))
|
||||
params.Add(New ReportParameter("IVA", If(CveCompra > 0, dr("IVA").ToString.FormatoNumero(2), "")))
|
||||
params.Add(New ReportParameter("Total", If(CveCompra > 0, dr("Total").ToString.FormatoNumero(2), "")))
|
||||
params.Add(New ReportParameter("TotalLetra", If(CveCompra > 0, String.Format("({0})", dr("Total").ToString.ToDouble.Texto2Letras(dr("CveMoneda").ToString.ToEntero).ToUpper), "")))
|
||||
params.Add(New ReportParameter("TotalLetra", If(CveCompra > 0, String.Format("({0})", dr("Total").ToString.ToDecimal.Texto2Letras(dr("CveMoneda").ToString.ToEntero).ToUpper), "")))
|
||||
|
||||
params.Add(New ReportParameter("Observaciones", If(CveCompra > 0, dr("Observaciones").ToString, "")))
|
||||
params.Add(New ReportParameter("Capturo", If(CveCompra > 0, dr("NombreCapturo").ToString, "")))
|
||||
@@ -4550,7 +4550,7 @@ Partial Class PopUpVerFactura
|
||||
'ObjInventarios.Dispose()
|
||||
Dim UrlParametros As Hashtable = Parametros(Decripta((Request("P").ToString)))
|
||||
If ObjInventarios.GetMovimientosDetalle(UrlParametros("CVEMOVIMIENTO").ToString.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
Dim TotalFinal As Double = ObjInventarios.DtResultados.SUM("Total") * 1.16
|
||||
Dim TotalFinal As Decimal = ObjInventarios.DtResultados.SUM("Total") * 1.16D
|
||||
Dim dr As DataRow = ObjInventarios.DtResultados.Rows(0)
|
||||
'params.Add(New ReportParameter("IVA", dr("IVA").ToString))
|
||||
params.Add(New ReportParameter("TotalLetra", String.Format("({0})", TotalFinal.Texto2Letras().ToUpper)))
|
||||
@@ -4612,7 +4612,7 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("Descuentos", (dr("Descuentos").ToString.ToDouble).FormatoNumero(2)))
|
||||
params.Add(New ReportParameter("IVA", dr("IVA").ToString.FormatoNumero(2)))
|
||||
params.Add(New ReportParameter("Total", dr("Total").ToString.FormatoNumero(2)))
|
||||
params.Add(New ReportParameter("TotalLetra", String.Format("({0})", dr("Total").ToString.ToDouble.Texto2Letras(dr("CveMoneda").ToString.ToEntero).ToUpper)))
|
||||
params.Add(New ReportParameter("TotalLetra", String.Format("({0})", dr("Total").ToString.ToDecimal.Texto2Letras(dr("CveMoneda").ToString.ToEntero).ToUpper)))
|
||||
|
||||
params.Add(New ReportParameter("Observaciones", dr("Observaciones").ToString))
|
||||
params.Add(New ReportParameter("Capturo", dr("NombreCapturo").ToString))
|
||||
@@ -6011,7 +6011,7 @@ Partial Class PopUpVerFactura
|
||||
|
||||
If CveTipoTransaccion = 1 Then
|
||||
Dim Folio As String = ObjIE.Folio
|
||||
Dim Importe As Double = ObjIE.Importe
|
||||
Dim Importe As Decimal = ObjIE.Importe
|
||||
Dim Observacion As String = ObjIE.Observaciones
|
||||
Dim ImporteLetra As String = String.Format("--- {0} ---", Importe.Texto2Letras(ObjIE.CveMoneda))
|
||||
Dim Beneficiario As String = ObjIE.PagueseA
|
||||
@@ -6106,7 +6106,7 @@ Partial Class PopUpVerFactura
|
||||
|
||||
Dim Folio, Observacion, UsuarioRegistro, TextoImporte, PagueseA, Ruta, Banco, NumCuenta, AbonoCuenta, SubProyecto, NotificarA, RefCrediproveedor As String
|
||||
Dim FechaExpedicion As Date = NowADS()
|
||||
Dim Importe As Double
|
||||
Dim Importe As Decimal
|
||||
Dim FormatoCheque As String = ""
|
||||
|
||||
Dim CveProveedor, CvePersonal, CveCuentaDeposito As Integer
|
||||
@@ -6219,7 +6219,7 @@ Partial Class PopUpVerFactura
|
||||
Dim Folio As String = "", Observacion As String = "", UsuarioRegistro As String = "", TextoImporte As String = "", PagueseA As String = ""
|
||||
Dim Ruta As String = UsuarioActual.Empresa.Ruta
|
||||
Dim FechaExpedicion As Date = NowADS()
|
||||
Dim Importe As Double
|
||||
Dim Importe As Decimal
|
||||
Dim FormatoCheque As String = ""
|
||||
|
||||
DtDetalle = Nothing
|
||||
@@ -6449,9 +6449,9 @@ Partial Class PopUpVerFactura
|
||||
|
||||
Reporte.Dictionary.Variables("DomicilioExpedicion").Value = Venta.SubProyecto.Direccion
|
||||
|
||||
Dim SubtTotal As Double = (Venta.DtDetalle.SUM("PU") * Venta.DtDetalle.SUM("Cantidad")) '* 0.16 lleva el IVA?
|
||||
Dim IVA As Double = SubtTotal * 0.16 'lleva IVA?
|
||||
Dim Total As Double = SubtTotal + IVA
|
||||
Dim SubtTotal As Decimal = (Venta.DtDetalle.SUM("PU") * Venta.DtDetalle.SUM("Cantidad")) '* 0.16 lleva el IVA?
|
||||
Dim IVA As Decimal = SubtTotal * 0.16D 'lleva IVA?
|
||||
Dim Total As Decimal = SubtTotal + IVA
|
||||
|
||||
'Reporte.Dictionary.Variables("Importe").Value =
|
||||
Reporte.Dictionary.Variables("ImporteLetra").Value = Total.Texto2Letras()
|
||||
|
||||
@@ -1457,8 +1457,8 @@ Partial Class Compras_eFacturas
|
||||
Dim FechaF As String = txtFechaF.Text
|
||||
If txtFechaI.Text = "" Then FechaI = "-1"
|
||||
If txtFechaF.Text = "" Then FechaF = "-1"
|
||||
Dim Folio = If(TxtFolio.Text.Trim.Length > 0, String.Format("%{0}%", TxtFolio.Text.Trim.ToUpper), "-1")
|
||||
Dim Proveedor = If(TxtProveedor.Text.Trim.Length > 0, String.Format("%{0}%", TxtProveedor.Text.Trim.ToUpper.Replace(" ", "%")), "-1")
|
||||
Dim Folio As String = If(TxtFolio.Text.Trim.Length > 0, String.Format("%{0}%", TxtFolio.Text.Trim.ToUpper), "-1")
|
||||
Dim Proveedor As String = If(TxtProveedor.Text.Trim.Length > 0, String.Format("%{0}%", TxtProveedor.Text.Trim.ToUpper.Replace(" ", "%")), "-1")
|
||||
Dim dt As DataTable = Nothing
|
||||
|
||||
If ObjDatos.GetFacturas(-1, Folio, txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim.ToDate, "-1", Proveedor, DdlValidado.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlClasificacionProv.SelectedValue.ToEntero, DdlCveTipoProveedor.SelectedValue.ToEntero, DdlTipoComprobante.SelectedValue.ToString, UsuarioActual.CveEmpresa) Then
|
||||
@@ -1663,7 +1663,7 @@ Partial Class Compras_eFacturas
|
||||
swTiempo.AppendFormat("BorrarInicio: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds)
|
||||
swmili = sw.ElapsedMilliseconds
|
||||
sw.Start()
|
||||
For Each filePath In ListXML
|
||||
For Each filePath As String In ListXML
|
||||
Try
|
||||
File.Delete(filePath)
|
||||
Catch ex As Exception
|
||||
@@ -2468,7 +2468,7 @@ Partial Class Compras_eFacturas
|
||||
parametros.Add(New ReportParameter("EmiNombre", EmiNombre))
|
||||
parametros.Add(New ReportParameter("EmiRFC", EmiRFC))
|
||||
parametros.Add(New ReportParameter("NoSerieCertificado", NoSerieCertificado))
|
||||
parametros.Add(New ReportParameter("TotalLetra", Total.ToDouble().Texto2Letras(CveMoneda:=If(Moneda = "MXN", 1, If(Moneda = "USD", 2, 3)))))
|
||||
parametros.Add(New ReportParameter("TotalLetra", Total.ToDecimal.Texto2Letras(CveMoneda:=If(Moneda = "MXN", 1, If(Moneda = "USD", 2, 3)))))
|
||||
parametros.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||
|
||||
'params.Add(New ReportParameter("DTConceptos", DTConceptos))
|
||||
@@ -3800,15 +3800,12 @@ Partial Class Compras_eFacturas
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
Dim TieneError = False
|
||||
Dim TieneError As Boolean = False
|
||||
Dim ObjCompra As New ClsCompras
|
||||
ObjCompra.IniciaTransacSQL()
|
||||
|
||||
|
||||
For Each Gv As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
|
||||
|
||||
|
||||
|
||||
If Gv.DataKey("CveCompra").ToEntero > 0 And Gv.DataKey("CveIE").ToEntero > 0 Then
|
||||
|
||||
If Not ObjCompra.AddComplementoPago(Gv.DataKey("CveIE").ToEntero, Gv.DataKey("CveCompra").ToEntero, Gv.DataKey("ImpPagado").ToDecimal, Gv.DataKey("CvePrePolizaDetalle").ToEntero, CveFacturaPago) > 0 Then
|
||||
@@ -3850,22 +3847,17 @@ Partial Class Compras_eFacturas
|
||||
Dim objEventos As New ClsOIEventos(ObjCompra.IniciaTransacSQL)
|
||||
|
||||
If ViculacionConPUE Then
|
||||
|
||||
|
||||
For Each CveCompraVinculada In ListaComprasPUE
|
||||
For Each CveCompraVinculada As Integer In ListaComprasPUE
|
||||
objEventos.AddEventoBitacora($"Complemento { ComplementoConPUE } vinculado manualmente (Compra PUE) ", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompraVinculada)
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
|
||||
For Each Gv As GridViewRow In GVPDocumentosRelacionadosPagos.Rows
|
||||
If Boolean.Parse(Gv.DataKey("Manual").ToString) Then
|
||||
objEventos.AddEventoBitacora($"Complemento { LblSerieFolioPago.Text} vinculado manualmente a compra {Gv.DataKey("SerieFolio").ToString} y Pago { Gv.DataKey("FolioPago").ToString }", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=Gv.DataKey("CveCompra").ToString.ToEntero)
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
'If HdnCveIE.Value.ToEntero > 0 Then
|
||||
|
||||
' For Each dRow As DataRow In DT_ComprasSinIE.Rows
|
||||
@@ -3991,12 +3983,9 @@ Partial Class Compras_eFacturas
|
||||
Dim Vinculados As Integer = 0
|
||||
Dim TodoVinculado As Boolean = False
|
||||
|
||||
Dim Diferencia As Boolean = If(Math.Abs(DTGVPagosVinculacion.SUM("ImpPagado") - DTGVPagosVinculacion.SUM("ImportePago")).ToDecimal > 0.1D, True, False)
|
||||
Dim Diferencia As Boolean = If(Math.Abs(DTGVPagosVinculacion.SUM("ImpPagado") - DTGVPagosVinculacion.SUM("ImportePago")) > 0.1D, True, False)
|
||||
Dim VinculacionManual As Boolean = If(DTGVPagosVinculacion.FiltraParametros("Manual = 1").Rows.Count > 0, True, False)
|
||||
|
||||
|
||||
|
||||
|
||||
Dim PermisoVinculacionDiferencia As Boolean = UsuarioActual.TienePermisoProceso(286)
|
||||
Dim PermisoVinculacionManual As Boolean = UsuarioActual.TienePermisoProceso(286)
|
||||
|
||||
@@ -4111,10 +4100,8 @@ Partial Class Compras_eFacturas
|
||||
LiteralVincular.Text = "-"
|
||||
End If
|
||||
e.Row.Cells(6).Controls.Add(LiteralVincular)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
e.Row.Cells(4).Text = "<i class='fa fa-check-circle' aria-hidden='true'></i>"
|
||||
e.Row.ToolTip = "Factura recibida sin registrar"
|
||||
@@ -4129,11 +4116,8 @@ Partial Class Compras_eFacturas
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Public Sub ImprimirPDFXML(NombreArchivo As String, rutaxml As String)
|
||||
Dim objxml As XmlSatCFDI = XmlSatCFDI.readXML(rutaxml)
|
||||
|
||||
@@ -6851,7 +6835,7 @@ Public Class Compra2
|
||||
End If
|
||||
|
||||
Dim Msg As String = ""
|
||||
Dim SubtotalTemp As Decimal = TmpDT.SUMD("Total") + Math.Round(TmpDT.SUM("Descuento") + Math.Round(TmpDT.SUM("Amortizacion")), 2).ToDecimal
|
||||
Dim SubtotalTemp As Decimal = TmpDT.SUMD("Total") + Math.Round(TmpDT.SUM("Descuento") + Math.Round(TmpDT.SUM("Amortizacion")), 2)
|
||||
Dim DescuentosTemp As Decimal = TmpDT.SUMD("Descuento")
|
||||
Dim Subtotal2Temp As Decimal = TmpDT.SUMD("Total")
|
||||
Dim IVATemp As Decimal = TmpDT.SUMD("IVA")
|
||||
|
||||
Reference in New Issue
Block a user