199 Entradas salidas actualziar detalle de replica(201), cat af filtro CveTipoAFGrupo
This commit is contained in:
@@ -203,6 +203,16 @@
|
||||
<asp:DropDownList ID="DdlAFPadres" runat="server" AppendDataBoundItems="true" DataTextField="CodigoDescripcion" DataValueField="CveActivoFijo" Class="table-group-action-input form-control input-inline input-sm select2me" Width="200px"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-1">Tipo Grupo:</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlAFTipoGrupo" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" Width="100%" runat="server" DataTextField="NombreCompleto" DataValueField="CvePersonal">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Mayores" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Menores" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ">
|
||||
|
||||
@@ -291,7 +291,8 @@ Partial Class AF_CatAF
|
||||
|
||||
Dim Cvecliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
|
||||
If ObjAF.GetActivosFijos(-1, UsuarioActual.CveEmpresa, Codigo, Descripcion, DdlTipoActivo.SelectedValue.ToEntero, DdlSubTipoActivo.SelectedValue.ToEntero, NoSerie, Año, CvePersonaResponsable, DdlProyecto.SelectedValue.ToEntero,
|
||||
DdlSubProyecto.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, strSQL1.ToString, CveCliente:=Cvecliente, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, BuscaPorAFPadre:=DdlAFPadres.SelectedValue.ToEntero) Then
|
||||
DdlSubProyecto.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, strSQL1.ToString, CveCliente:=Cvecliente, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, BuscaPorAFPadre:=DdlAFPadres.SelectedValue.ToEntero,
|
||||
CveTipoAFGrupo:=DdlAFTipoGrupo.SelectedValue.ToEntero) Then
|
||||
If ObjAF.DtResultados.Rows.Count > 0 Then
|
||||
DtActivosFijos = ObjAF.DtResultados
|
||||
'GvDatos.DataSource = ObjAF.DtResultados
|
||||
|
||||
@@ -296,7 +296,9 @@ Public Class ClsAF
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetActivosFijos(CveActivoFijo As Integer, CveEmpresa As Integer, Codigo As String, Descripcion As String, CveTipoActivoFijo As Integer, CveSubTipoActivoFijo As Integer, NoSerie As String, Año As Integer, CvePersonaResponsable As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEstadoActivoFijo As Integer, CaracteristicaValor As String, CveCliente As Integer, Optional BuscaGrupoEmpresa As Integer = -1, Optional BuscaPorAFPadre As Integer = -1, Optional CveGrupo As Integer = -1) As Boolean
|
||||
Public Function GetActivosFijos(CveActivoFijo As Integer, CveEmpresa As Integer, Codigo As String, Descripcion As String, CveTipoActivoFijo As Integer, CveSubTipoActivoFijo As Integer, NoSerie As String, Año As Integer, CvePersonaResponsable As Integer,
|
||||
CveProyecto As Integer, CveSubProyecto As Integer, CveEstadoActivoFijo As Integer, CaracteristicaValor As String, CveCliente As Integer, Optional BuscaGrupoEmpresa As Integer = -1, Optional BuscaPorAFPadre As Integer = -1,
|
||||
Optional CveGrupo As Integer = -1, Optional CveTipoAFGrupo As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_AF_ActivosFijosGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -317,6 +319,7 @@ Public Class ClsAF
|
||||
.Add("@BuscaGrupoEmpresa", SqlDbType.Int).Value = BuscaGrupoEmpresa
|
||||
.Add("@CveAFPadre", SqlDbType.Int).Value = BuscaPorAFPadre
|
||||
.Add("@CveGrupo", SqlDbType.Int).Value = CveGrupo
|
||||
.Add("@CveTipoAFGrupo", SqlDbType.Int).Value = CveTipoAFGrupo
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -6433,6 +6433,24 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetMovmientoDetalleReplicado(CveMovimientoDetalle As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Inv_MovmientoDetalleReplicadoGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveMovimientoDetalle", SqlDbType.Int).Value = CveMovimientoDetalle
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al replicar el movimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function GetVentasRemisionesInventario(Ventas As String, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
@@ -1914,6 +1914,7 @@ Partial Class Inventarios_EntradasSalidas
|
||||
ElseIf Dr("Estatus").ToString = "U" Then
|
||||
|
||||
If Not ObjInventario.UpdateMovimientoDetalle(Dr("Cantidad").ToString.ToDecimal, 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
|
||||
@@ -5506,21 +5507,59 @@ Partial Class Inventarios_EntradasSalidas
|
||||
|
||||
If CveMovimientoDetalleEdit > 0 Then
|
||||
|
||||
Dim ErrorMovInv As Boolean = False
|
||||
|
||||
Dim ObjInventario As New ClsInventarios
|
||||
If Not ObjInventario.UpdateMovimientoDetalle(txtCantidad.Text.ToDecimal, DdlUnidad.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero, txtPrecio.Text.ToDecimal, CveAFEdit,
|
||||
ObjInventario.IniciaTransacSQL()
|
||||
|
||||
If ObjInventario.UpdateMovimientoDetalle(txtCantidad.Text.ToDecimal, DdlUnidad.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero, txtPrecio.Text.ToDecimal, CveAFEdit,
|
||||
CveMovimientoDetalleEdit, DdlSeccionAlmacen.SelectedValue.ToEntero, TxtnSerie.Text, TxtObservacionesdetalle.Text,
|
||||
CveUsuarioModifico:=UsuarioActual.CveUsuario, CveCultivoCuadroDetalle:=DdlModalCultivosCuadro.SelectedValue.ToEntero,
|
||||
Lote:=TxtnLote.Text.Trim, FechaCaducidad:=TxtnFechaCaducidad.Text.ToDate) Then
|
||||
Alert("Error al Actualizar los movimientos")
|
||||
|
||||
|
||||
If UsuarioActual.CveEmpresa = 199 Then
|
||||
If ObjInventario.GetMovmientoDetalleReplicado(CveMovimientoDetalleEdit) Then
|
||||
|
||||
If ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Dim CveMovimientoDetalleReplicado As Integer = ObjInventario.DtResultados.Rows(0)("CveMovimientoDetalle").ToString.ToEntero
|
||||
|
||||
If Not ObjInventario.UpdateMovimientoDetalle(txtCantidad.Text.ToDecimal, -1, -1, txtPrecio.Text.ToDecimal, -1,
|
||||
CveMovimientoDetalleReplicado, -1, TxtnSerie.Text, TxtObservacionesdetalle.Text,
|
||||
CveUsuarioModifico:=UsuarioActual.CveUsuario, CveCultivoCuadroDetalle:=-1,
|
||||
Lote:=TxtnLote.Text.Trim, FechaCaducidad:=TxtnFechaCaducidad.Text.ToDate) Then
|
||||
Alert("Error al Actualizar los movimientos replicados relacionados.", TipoMensaje.MsgAdvertencia)
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
GvM.EditIndex = -1
|
||||
'cargar también los movimentos detalle
|
||||
Alert("Error al obtener los datos de los movimientos replicados relacionados.", TipoMensaje.MsgAdvertencia)
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Else
|
||||
Alert("Error al Actualizar los movimientos", TipoMensaje.MsgAdvertencia)
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
ObjInventario.Commit()
|
||||
'GvM.EditIndex = -1
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
DtMovimientos = ObjInventario.DtResultados
|
||||
CargaGVM(DtMovimientos)
|
||||
End If
|
||||
Alert("Movimiento actualizado correctamente")
|
||||
RegistraScript("$('#ModalAgregar').modal('hide')")
|
||||
Else
|
||||
ObjInventario.RollBack()
|
||||
End If
|
||||
|
||||
ObjInventario.Dispose()
|
||||
|
||||
Reference in New Issue
Block a user