AF Pendientes, entradaSalida

This commit is contained in:
rakcsle
2022-03-26 15:40:59 -07:00
parent f273cac4e4
commit 0589b1d7b0
7 changed files with 1167 additions and 116 deletions

View File

@@ -1701,6 +1701,25 @@
<label for="<%= TdTotal.ClientID.ToString()%>">Total</label>
<asp:Literal ID="TdTotal" runat="server" Visible="false"></asp:Literal>
</div>
<div runat="server" id="DVCultivosCuadro" class="form-group form-md-line-input input-iconright" visible="false">
<asp:DropDownList ID="DdlModalCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;"
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpProduccion">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModalCultivosCuadro" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlModalCultivosCuadro"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El Cuadro <b>''Cuadro''</b> es necesario, por favor ingréselo." ValidationGroup="GrpProduccion">
</asp:RequiredFieldValidator>
<label runat="server" for="<%= DdlModalCultivosCuadro.ClientID.ToString()%>">Cultivo:</label>
<i></i>
</div>
</div>
<div class="modal-footer">
<asp:LinkButton ID="LkAgregarDetalle" runat="server" CssClass="btn btn-primary" Text="Agregar"></asp:LinkButton>

View File

@@ -511,6 +511,7 @@ Partial Class Inventarios_EntradasSalidas
dt.Columns.Add("Observaciones")
dt.Columns.Add("CountMovimientoEntradaDetalle")
dt.Columns.Add("TotalExtranjero", Type.GetType("System.Double"))
dt.Columns.Add("CveCultivoCuadroDetalle", Type.GetType("System.Int32"))
CargaGVM(dt)
@@ -569,6 +570,10 @@ Partial Class Inventarios_EntradasSalidas
End If
If IfNull(Request("CI"), -1).ToString.ToEntero > 0 And UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)")
End If
DdlAlmacenInventarioFisico.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
DdlAlmacenCambioVigencias.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (9,11)")
@@ -1328,7 +1333,7 @@ Partial Class Inventarios_EntradasSalidas
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)
TxtnLote.Text.Trim, TxtnFechaCaducidad.Text.ToDate, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text, CveCultivoCuadroDetalle:=DdlModalCultivosCuadro.SelectedValue.Toentero)
LimpiarAgregar()
txtCantidad.Text = ""
@@ -1339,6 +1344,8 @@ Partial Class Inventarios_EntradasSalidas
TxtnFechaCaducidad.Text = ""
HdnCodigoAF.Value = "-1"
HdnCveActivoFijo.Value = "-1"
DdlModalCultivosCuadro.SelectedValueExist(-1)
RegistraScript("CodigoAF = "";")
If Not UsuarioActual.Empresa.Funcionalidad(105).ToString = "1" Then
@@ -1352,7 +1359,8 @@ Partial Class Inventarios_EntradasSalidas
End Sub
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)
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, Optional CveCultivoCuadroDetalle As Integer = -1)
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
@@ -1445,6 +1453,8 @@ Partial Class Inventarios_EntradasSalidas
registro.Item("FechaCaducidad") = FechaCaducidad
registro.Item("Observaciones") = Observaciones
registro.Item("AplicaCaducidad") = RowPS("AplicaCaducidad").ToString
registro.Item("CveCultivoCuadroDetalle") = CveCultivoCuadroDetalle
DtMovimientos.Rows.Add(registro)
If CargarGV Then
@@ -1536,13 +1546,13 @@ Partial Class Inventarios_EntradasSalidas
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("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
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, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) 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("Serie").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, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
Mensaje = "Error al Agregar los nuevos movimientos"
ErrorMovInv = True : Exit For
End If
@@ -1552,7 +1562,7 @@ Partial Class Inventarios_EntradasSalidas
End If
End If
Else
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
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, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
Mensaje = "Error al Agregar los nuevos movimientos"
ErrorMovInv = True : Exit For
End If
@@ -1669,7 +1679,7 @@ Partial Class Inventarios_EntradasSalidas
Dim FechaCaducidadVal As Date = If(Dr("AplicaCaducidad").ToString = "True", Dr("FechaCaducidad").ToString.ToDate, MinFecha)
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:=FechaCaducidadVal) >= 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:=FechaCaducidadVal, CveUsuarioModifico:=UsuarioActual.CveUsuario) 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:=FechaCaducidadVal, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
@@ -1687,7 +1697,7 @@ Partial Class Inventarios_EntradasSalidas
Else
If UsuarioActual.TienePermisoProceso(114) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, 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
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, 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, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
@@ -1721,7 +1731,7 @@ Partial Class Inventarios_EntradasSalidas
ImporteConcepto = Dr("PU").ToString.ToDecimal
End If
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
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, CveCultivoCuadroDetalle:=Dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then
Mensaje = "Error al guardar los movimientos"
ErrorMovInv = True
Exit For
@@ -1956,7 +1966,7 @@ Partial Class Inventarios_EntradasSalidas
If Not ErrorAC And Not ErrorMovInv Then
Dim Msg As New StringBuilder
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b><a href='/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}'>{0}</a></b>", ObjInventario.Folio, ObjInventario.CveMovimiento)
Msg.AppendFormat("<br/>El Movimiento se registro con el Folio: <b><a href='/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}'>{0}</a></b>", ObjInventario.Folio, CveMovimiento)
Msg.AppendFormat("<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
If RetornoVirtual IsNot Nothing Then
@@ -3326,6 +3336,24 @@ Partial Class Inventarios_EntradasSalidas
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
End If
If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
TrSubProyectoActivoFijo.Visible = True
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto, "Seleccione Uno")
DVCultivosCuadro.Visible = True
CargaCultivos()
End If
End Sub
Private Sub CargaCultivos()
DdlModalCultivosCuadro.Items.Clear()
DdlModalCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
DdlModalCultivosCuadro.DataBind()
DdlModalCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End Sub
#End Region
@@ -5029,6 +5057,18 @@ Partial Class Inventarios_EntradasSalidas
'#End Region
Protected Sub LkAgregar_Click() Handles LnkAgregarProducto.Click
If EsConsumoInterno And UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
If DdlSubProyecto.SelectedValue.ToEntero <= 0 Then
Alert("Debe seleccionar un Centro de Constos.", TipoMensaje.MsgAdvertencia)
Exit Sub
Else
CargaCultivos()
End If
End If
limpiarModalDetalle()
UpAgregar.Update()
RegistraScript("$('#ModalAgregar').modal()")
@@ -5039,7 +5079,7 @@ Partial Class Inventarios_EntradasSalidas
Dim ObjInventario As New ClsInventarios
If Not ObjInventario.UpdateMovimientoDetalle(txtCantidad.Text.ToDouble, DdlUnidad.SelectedValue.ToEntero, DdlProducto2.SelectedValue.ToEntero, txtPrecio.Text.ToDouble, CveAFEdit,
CveMovimientoDetalleEdit, DdlSeccionAlmacen.SelectedValue.ToEntero, TxtnSerie.Text, TxtObservacionesdetalle.Text,
CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
CveUsuarioModifico:=UsuarioActual.CveUsuario, CveCultivoCuadroDetalle:=DdlModalCultivosCuadro.SelectedValue.ToEntero) Then
Alert("Error al Actualizar los movimientos")
Else
Alert("Movimiento actualizado correctamente")
@@ -5067,6 +5107,7 @@ Partial Class Inventarios_EntradasSalidas
TxtObservacionesdetalle.Text = ""
DdlSeccionAlmacen.ClearSelection()
LkAgregarDetalle.Text = "Agregar"
DdlModalCultivosCuadro.SelectedValueExist(-1)
If DdlMonedaTC.SelectedValue.ToEntero = 2 Then
VisualizaPUExtranjero(UsuarioActual.TienePermisoProceso(201))
Else

View File

@@ -661,7 +661,9 @@ Partial Class Inventarios_ResguardoMaterial
End If
CargaResguardos()
If UsuarioActual.CveEmpresa = 140 Then
@@ -686,6 +688,9 @@ Partial Class Inventarios_ResguardoMaterial
End If
CargaResguardos()
UpGridLiberacion.Update()
UpGenerales.Update()