cambio de double a decimal

This commit is contained in:
2021-07-10 09:29:30 -07:00
parent 6ecda75175
commit 2f8461a657

View File

@@ -1247,9 +1247,9 @@ Partial Class Inventarios_EntradasSalidas
#Region " AGREGAR - GUARDAR "
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Double
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Decimal
Dim Inv As New ClsInventarios
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, CveSeccionAlmacen:=CveSeccionAlmacen, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
Dim Existencia As Decimal = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, CveSeccionAlmacen:=CveSeccionAlmacen, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
Inv.Dispose()
Return Existencia
End Function
@@ -1275,8 +1275,8 @@ Partial Class Inventarios_EntradasSalidas
Exit Sub
End If
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedText, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDouble,
txtPrecio.Text.ToDouble, TxtnSerie.Text.Replace(" ", String.Empty), LblCodigo.Text, HdnCodigoAF.Value, HdnCveActivoFijo.Value, TxtObservacionesdetalle.Text,
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedText, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDecimal,
txtPrecio.Text.ToDecimal, TxtnSerie.Text.Replace(" ", String.Empty), LblCodigo.Text, HdnCodigoAF.Value, HdnCveActivoFijo.Value, TxtObservacionesdetalle.Text,
TxtnLote.Text.Trim, TxtnFechaCaducidad.Text.ToDate, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text)
LimpiarAgregar()
@@ -1301,7 +1301,7 @@ Partial Class Inventarios_EntradasSalidas
End Sub
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, Serie As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, FechaCaducidad As Date, CveSeccionAlmacen As Integer, SeccionAlmacen As String, Optional CargarGV As Boolean = True)
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Decimal, PU As Decimal, Serie As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, FechaCaducidad As Date, CveSeccionAlmacen As Integer, SeccionAlmacen As String, Optional CargarGV As Boolean = True)
If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub
Dim Valido As Boolean = True
@@ -1340,7 +1340,7 @@ Partial Class Inventarios_EntradasSalidas
'salida
If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen
Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(Serie = "", "-1", Serie), If(Lote = "", "-1", Lote), FechaCaducidadVal)
Dim Existencia As Decimal = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(Serie = "", "-1", Serie), If(Lote = "", "-1", Lote), FechaCaducidadVal)
' LbAgregar.ToolTip = Existencia.ToString
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(Serie <> "", $" AND Serie = '{Serie}'", "")}") < 0 Then
If Existencia <= 0 Then
@@ -3199,7 +3199,7 @@ Partial Class Inventarios_EntradasSalidas
End If
AddNew(Dr("CvePS").ToString.ToEntero, Dr("PSCodigo").ToString, Dr("CveUM").ToString.ToEntero, Dr("UnidadMedida").ToString, 1, Dr("CostoPromedio").ToString.ToDouble, "", "", "", "", "", "", MinFecha, CveSeccionAlmacen, SeccionAlmacen)
AddNew(Dr("CvePS").ToString.ToEntero, Dr("PSCodigo").ToString, Dr("CveUM").ToString.ToEntero, Dr("UnidadMedida").ToString, 1, Dr("CostoPromedio").ToString.ToDecimal, "", "", "", "", "", "", MinFecha, CveSeccionAlmacen, SeccionAlmacen)
TxtCodigoPS.Text = ""
TxtCodigoPS.Focus()