Consignaciones Lote Fecha de caducidad, rep Recuperacion por Periodo

This commit is contained in:
Oscar Irigoyen
2022-09-19 10:12:23 -07:00
parent 10628c9e19
commit c4034624ef
5 changed files with 189 additions and 45 deletions

View File

@@ -1135,9 +1135,16 @@ Partial Class Compras_Compras
End Set
End Property
Public Property FechaCompraOriginal As Date
Get
Return ViewState("FechaCompraOriginal").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaCompraOriginal") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -2537,6 +2544,8 @@ Partial Class Compras_Compras
TxtFolio.Text = dr("Folio").ToString
TxtFolioSecundario.Text = dr("FolioSecundario").ToString
TxtFecha.Text = dr("Fecha").ToString.ToDate.ToShortDateString
FechaCompraOriginal = dr("Fecha").ToString.ToDate
TxtDescripcion.Text = dr("Descripcion").ToString
CvePrePoliza = dr("CvePrePoliza").ToString.ToEntero
EstatusAlmacen = dr("EstatusAlmacen").ToString.ToEntero
@@ -19966,39 +19975,74 @@ Partial Class Compras_Compras
Protected Sub LnkActualziarFechadecompra_Click(sender As Object, e As EventArgs)
Dim ObjCompra As New ClsCompras
Dim ProcesoError As Boolean = True
If FechaCompraOriginal <> TxtFecha.Text.ToDate Then
Dim ObjCompra As New ClsCompras
ObjCompra.IniciaTransacSQL()
Dim ObjEventos As New ClsOIEventos(ObjCompra.IniciaTransacSQL())
If ObjEventos.AddEventoBitacora($"Cambio de Fecha de compra de { FechaCompraOriginal.ToString("dd/MM/yyyy")} a {TxtFecha.Text}", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompra:=CveCompra) Then
ProcesoError = False
Else
ProcesoError = True
End If
If ProcesoError = False And ObjCompra.UpdateFechaCompra(CveCompra, TxtFecha.Text.ToDate, UsuarioActual.CveEmpresa) Then
ProcesoError = False
Else
ProcesoError = True
End If
If Not ProcesoError Then
ObjCompra.Commit()
FechaCompraOriginal = TxtFecha.Text.ToDate
Alert("Fecha Actualizada Correctamente.")
Else
ObjCompra.RollBack()
End If
ObjCompra.Dispose()
If Not ProcesoError Then
CargaEventoBitacora()
UPEventoBitacora.Update()
End If
If ObjCompra.UpdateFechaCompra(CveCompra, TxtFecha.Text.ToDate, UsuarioActual.CveEmpresa) Then
Alert("Fecha Actualizada Correctamente")
End If
ObjCompra.Dispose()
End Sub
Private Function ValidaSeleccionAnticipo() As Boolean
Dim Respuesta As Boolean
Dim Respuesta As Boolean = True
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
If GVAnticipos.Rows.Count > 0 Then
'If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
' If GVAnticipos.Rows.Count > 0 Then
For Each GVRow As GridViewRow In GVAnticipos.Rows
If GVRow.FCCheckBox("Chk").Checked AndAlso GVRow.FCTextBox("TxtAnticipo").Text.ToDecimal > 0 Then
Respuesta = True
Exit For
Else
Respuesta = False
End If
Next
' For Each GVRow As GridViewRow In GVAnticipos.Rows
' If GVRow.FCCheckBox("Chk").Checked AndAlso GVRow.FCTextBox("TxtAnticipo").Text.ToDecimal > 0 Then
' Respuesta = True
' Exit For
' Else
' Respuesta = False
' End If
' Next
Else
Respuesta = True
End If
' Else
' Respuesta = True
' End If
Else
Respuesta = True
End If
'Else
' Respuesta = True
'End If
Return Respuesta

View File

@@ -69,7 +69,7 @@
<ajax:ValidatorCalloutExtender ID="VCERemisiones" runat="server" HighlightCssClass="vco" TargetControlID="RFVRemisiones" Width="350px"></ajax:ValidatorCalloutExtender>
</li>
<li runat="server" id="LiAlmacen" visible="false">Almacén:
<asp:DropDownList ID="DdlAlmacenFiltro" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="150px"></asp:DropDownList>
<asp:DropDownList ID="DdlAlmacenFiltro" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="150px" ></asp:DropDownList>
</li>
</ul>
</div>
@@ -508,8 +508,32 @@
</asp:TemplateField>
<asp:BoundField HeaderText="Sección Alm" ReadOnly="true" DataField="SeccionAlmacen" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Serie" ReadOnly="true" DataField="Serie" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Lote" ReadOnly="true" DataField="Lote" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Caducidad" ReadOnly="true" DataField="FechaCaducidad" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" >
<ItemTemplate>
<asp:TextBox ID="TxtLote" Width="85px" class="form-control input-sm" Text='<%# Eval("Lote") %>' runat="server" Visible="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" >
<ItemTemplate>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtCaducidad" CssClass="form-control input-sm ADSMaskDate" Text='<%# Eval("FechaCaducidad") %>' Style="width: 80px" runat="server" Visible="false"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="LnkCaducidad" class="btn default" Visible="false"> <i class="fa fa-calendar"></i> </asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEECaducidad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CECaducidad" TargetControlID="TxtCaducidad" PopupButtonID="LnkCaducidad" PopupPosition="BottomLeft" Enabled="True" Format="dd/MM/yyyy"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVCaducidad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caducidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECaducidad" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaducidad"></ajax:ValidatorCalloutExtender>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:Label ID="LbTotal" runat="server" />

View File

@@ -72,6 +72,19 @@ Partial Class Inventarios_Consignaciones
End If
End Sub
Private Property ValidaLoteCaducidad As Boolean
Get
If ViewState("ValidaLoteCaducidad") Is Nothing Then
ViewState("ValidaLoteCaducidad") = False
End If
Return CType(ViewState("ValidaLoteCaducidad"), Boolean)
End Get
Set(value As Boolean)
ViewState("ValidaLoteCaducidad") = value
End Set
End Property
#Region "Inicializa Valores"
@@ -364,6 +377,32 @@ Partial Class Inventarios_Consignaciones
CargaDatos(DdlRemisiones.SelectedValue.ToEntero)
End Sub
Private Sub CargaDatos(CveConsignacionTemp As Integer)
If DdlConcepto.SelectedValue.ToEntero.Contiene(12, 8) Then
Dim CveSubProyectoValidaCaducidad As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenFiltro.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToEntero
'RMF condición temporal
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyectoValidaCaducidad.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
ValidaLoteCaducidad = True
'activa lote
ThLote.Visible = True
ThCaducidad.Visible = True
Else
ValidaLoteCaducidad = False
'activa lote
ThLote.Visible = False
ThCaducidad.Visible = False
End If
End If
Dim ObjInventario As New ClsInventarios
If ObjInventario.ConsignacionesDetalle(CveConsignacionTemp, DdlAlmacenFiltro.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
@@ -538,6 +577,24 @@ Partial Class Inventarios_Consignaciones
e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", String.Format("RecalculaEdit({0},this,{1});", e.Row.FCTextBox("TxtCantidad").ClientID, e.Row.FCLabel("LbTotal").ClientID))
End If
If (ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
End If
If CBool(e.Row.DBCampo("AplicaLote")) Then
e.Row.FCTextBox("TxtLote").Visible = True
Else
e.Row.FCTextBox("TxtLote").Visible = False
End If
End If
End If
End Sub
@@ -940,8 +997,14 @@ Partial Class Inventarios_Consignaciones
Exit For
End If
Dim Lote As String = "-1"
Dim FechaCaducidad As Date = MinFecha
If Gvr.FCTextBox("TxtLote").Text.Trim <> "" Then Lote = Gvr.FCTextBox("TxtLote").Text.Trim
If Gvr.FCTextBox("TxtCaducidad").Text.ToDate > MinFecha Then FechaCaducidad = Gvr.FCTextBox("TxtCaducidad").Text.ToDate
'AGREGAMOS MOVTOS DETALLE
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("Serie").ToString, Gvr.DataKey("Lote").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, Gvr.DataKey("Serie").ToString, Lote, FechaCaducidad:=FechaCaducidad) Then
ErrorMovInv = True
TextoError = "Ocurrió un Error al guardar los movimientos"
Exit For
@@ -1126,20 +1189,26 @@ Partial Class Inventarios_Consignaciones
FolioSalida = ObjInventario.Folio
End If
If CveMovimientoSalida > 0 Then
If MovtoNew Then
CveMovtosSalida.Add(CveMovimientoSalida)
FoliosSalida.Add(FolioSalida)
MovtoNew = False
End If
Else
TextoError = "No se pudo generar el movimiento de salida correctamente"
ErrorMovInv = True
Exit For
If CveMovimientoSalida > 0 Then
If MovtoNew Then
CveMovtosSalida.Add(CveMovimientoSalida)
FoliosSalida.Add(FolioSalida)
MovtoNew = False
End If
Else
TextoError = "No se pudo generar el movimiento de salida correctamente"
ErrorMovInv = True
Exit For
End If
Dim Lote As String = "-1"
Dim FechaCaducidad As Date = MinFecha
If Gvr.FCTextBox("TxtLote").Text.Trim <> "" Then Lote = Gvr.FCTextBox("TxtLote").Text.Trim
If Gvr.FCTextBox("TxtCaducidad").Text.ToDate > MinFecha Then FechaCaducidad = Gvr.FCTextBox("TxtCaducidad").Text.ToDate
'AGREGAMOS MOVTOS DETALLE
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, "", "") Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, -1, "", Lote, FechaCaducidad:=FechaCaducidad) Then
ErrorMovInv = True
TextoError = "Ocurrió un Error al guardar los movimientos detalle de la salida"
Exit For
@@ -1744,4 +1813,6 @@ Partial Class Inventarios_Consignaciones
End Class

View File

@@ -956,8 +956,9 @@ Partial Class Inventarios_ResguardoMaterial
If Gvr.FCTextBox("TxtCantidad").Text.ToDouble > 0 Then
Dim Lote As String = "-1"
Dim FechaCaducidad As Date = MinFecha
If Gvr.datakey("Lote") <> "" Then Lote = Gvr.datakey("Lote")
If Gvr.datakey("FechaCaducidad").todate > MinFecha Then FechaCaducidad = Gvr.datakey("FechaCaducidad").todate
If Gvr.FCTextBox("TxtLote").Text.Trim <> "" Then Lote = Gvr.FCTextBox("TxtLote").Text.Trim
'If Gvr.datakey("FechaCaducidad").todate > MinFecha Then FechaCaducidad = Gvr.datakey("FechaCaducidad").todate
If Gvr.FCTextBox("TxtCaducidad").Text.ToDate > MinFecha Then FechaCaducidad = Gvr.FCTextBox("TxtCaducidad").Text.ToDate
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Gvr.FCTextBox("TxtCantidad").Text.ToDouble, Gvr.DataKey("CveUM").ToString.ToEntero, Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("PU").ToString.ToDecimal, -1, CveSeccionAlmacen:=Gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=Gvr.DataKey("Serie").ToString, Lote:=Lote, FechaCaducidad:=FechaCaducidad, Observaciones:=Gvr.DataKey("Observaciones").ToString, CveMovimientoDetalleEntrada:=Gvr.DataKey("CveMovimientoDetalle").toentero) Then
MensajeError = "Ocurrió un error al guardar los detalles del movimiento de salida. Por favor vuelva a intentar."
@@ -968,6 +969,8 @@ Partial Class Inventarios_ResguardoMaterial
DiccionarioLote.Add(ObjInventario.CveMovimientoDetalle, Gvr.FCTextBox("TxtLote").Text)
DiccionarioCaducidad.Add(ObjInventario.CveMovimientoDetalle, Gvr.FCTextBox("TxtCaducidad").Text.todate)
End If
End If
Cont += 1
Next

View File

@@ -16,22 +16,24 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-file-pdf-o"></i> PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton>
</li>
<li>
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
</li>
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkVerGrafica" OnClick="LnkVerGrafica_Click" runat="server">Ver Grafica</asp:LinkButton>
<asp:LinkButton ID="LnkVerGrafica" OnClick="LnkVerGrafica_Click" runat="server"><i class='fa fa-signal' ></i> Ver Grafica</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
<li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
@@ -212,7 +214,7 @@
<ContentTemplate>
<asp:RadioButtonList runat="server" ID="RblTipoCambio" OnSelectedIndexChanged="RblTipoCambio_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem>
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Compra" Value="2"></asp:ListItem>
<asp:ListItem Text="Dólares en Tipo Cambio de Pago" Value="2"></asp:ListItem>
<asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem>
</asp:RadioButtonList>
<div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false">