Correccion al agregar

This commit is contained in:
2020-05-29 11:51:43 -07:00
parent 2da4a206f1
commit ff2fe64f0c

View File

@@ -435,7 +435,7 @@ Partial Class Inventarios_EntradasSalidas
dt.Columns.Add("CostoIndirecto", Type.GetType("System.Double"))
dt.Columns.Add("CodigoAF")
dt.Columns.Add("CveAF")
dt.Columns.Add("SerieLote", Type.GetType("System.String"))
dt.Columns.Add("Serie", Type.GetType("System.String"))
dt.Columns.Add("Lote", Type.GetType("System.String"))
dt.Columns.Add("FechaCaducidad", Type.GetType("System.DateTime"))
@@ -1146,6 +1146,9 @@ Partial Class Inventarios_EntradasSalidas
'Protected Sub btnAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
' AgregarPS()
'End Sub
Protected Sub LkAgregarDetalle_Click(sender As Object, e As EventArgs) Handles LkAgregarDetalle.Click
AgregarPS()
End Sub
Protected Sub BtnSerieAddNew_Click(sender As Object, e As EventArgs)
AgregarPS()
End Sub
@@ -1244,7 +1247,7 @@ Partial Class Inventarios_EntradasSalidas
registro.Item("CodigoAF") = CodigoAF
registro.Item("Codigo") = Codigo
registro.Item("CveAF") = CveAF
registro.Item("SerieLote") = If(SerieLote <> "", SerieLote, "")
registro.Item("Serie") = If(SerieLote <> "", SerieLote, "")
registro.Item("Lote") = If(Lote <> "", Lote, "")
registro.Item("FechaCaducidad") = FechaCaducidad
registro.Item("Observaciones") = Observaciones
@@ -1323,7 +1326,7 @@ Partial Class Inventarios_EntradasSalidas
End If
ElseIf Dr("Estatus").ToString = "U" Then
If Not ObjInventario.UpdateMovimientoDetalle(Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, Dr("CveMovimientoDetalle").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("SerieLote").ToString, Dr("Observaciones").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.UpdateMovimientoDetalle(Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, Dr("CveMovimientoDetalle").ToString.ToEntero, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("Serie").ToString, Dr("Observaciones").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al Actualizar los movimientos"
ErrorMovInv = True : Exit For
End If
@@ -1334,14 +1337,14 @@ Partial Class Inventarios_EntradasSalidas
Else
If GlobalDTInvConceptos.FiltraParametros(String.Format("CveConcepto = {0}", DdlConcepto.SelectedValue.ToEntero)).Rows.Count > 0 AndAlso GlobalDTInvConceptos.FiltraParametros(String.Format("CveConcepto = {0}", DdlConcepto.SelectedValue.ToEntero)).Rows(0)("Origen").ToString.ToEntero < 0 Then
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=If(Dr("Serie").ToString = "", "-1", Dr("SerieLote").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString)) >= Dr("Cantidad").ToString.ToDouble Then
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=If(Dr("Serie").ToString = "", "-1", Dr("Serie").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString)) >= Dr("Cantidad").ToString.ToDouble Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al Agregar los nuevos movimientos"
ErrorMovInv = True : Exit For
End If
Else
If UsuarioActual.TienePermisoProceso(114) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("SerieLote").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al Agregar los nuevos movimientos"
ErrorMovInv = True : Exit For
End If
@@ -1458,7 +1461,7 @@ Partial Class Inventarios_EntradasSalidas
Dim Cont As Integer = 0
If DdlConcepto.SelectedValue.Contiene({"3", "11", "13", "21", "30", "31"}) Then
For Each Dr As DataRow In DtMovimientos.Rows
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=If(Dr("Serie").ToString = "", "-1", Dr("SerieLote").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString), FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) >= Dr("Cantidad").ToString.ToDouble Then
If ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=String.Format("{0} {1}", TxtFecha.Text.ToDate.ToString("yyyy/MM/dd"), TxtHoraInicio.PostedTime), Serie:=If(Dr("Serie").ToString = "", "-1", Dr("Serie").ToString), Lote:=If(Dr("Lote").ToString = "", "-1", Dr("Lote").ToString), FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) >= Dr("Cantidad").ToString.ToDouble Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, Observaciones:=Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
Mensaje = "Error al guardar los movimientos"
@@ -2391,7 +2394,7 @@ Partial Class Inventarios_EntradasSalidas
DdlUnidad.SelectedValue = GvRow.DataKey("CveUM")
CveAFEdit = GvRow.DataKey("CveAF").ToEntero
txtPrecio.Text = GvRow.DataKey("PU").ToDouble.FormatoNumero
TxtnSerie.Text = GvRow.DataKey("SerieLote")
TxtnSerie.Text = GvRow.DataKey("Serie")
TxtObservacionesdetalle.Text = GvRow.DataKey("Observaciones")
DdlSeccionAlmacen.SelectedValueExist(GvRow.DataKey("CveSeccionAlmacen"))
LkAgregarDetalle.Text = "Actualizar"