This commit is contained in:
rakcsle
2021-04-15 12:33:10 -07:00
36 changed files with 4404 additions and 1271 deletions

View File

@@ -88,7 +88,7 @@
<asp:TemplateField ItemStyle-Width="7%">
<ItemTemplate>
<%--<asp:Literal ID="LtlExistencia" runat="server" Text='<%# Eval("Existencia").ToString().Split("."c)(0) %>'></asp:Literal>--%>
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Existencia", "{0:#,###.###}") %>' Width="45px" style='text-align:right;' />
<asp:TextBox ID="TxtCantidad" runat="server" Text='<%# Eval("Existencia", "{0:####.###}") %>' Width="45px" style='text-align:right;' />
<asp:RangeValidator ID="RVR" Display="Dynamic" ControlToValidate="TxtCantidad" runat="server" MinimumValue="0" Type="Double" ErrorMessage="No cumple con la cantidad especificada"></asp:RangeValidator>
</ItemTemplate>
</asp:TemplateField>

View File

@@ -616,7 +616,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
'Mostrar Sección
GvD.Columns(11).Visible = ChkMostrarSeccion.Checked
GvD.Columns(12).Visible = ChkMostrarSeccion.Checked
CargaDatos()
UppD.Update()
End Sub

View File

@@ -516,7 +516,7 @@
</asp:TemplateField>
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
<ItemTemplate>
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Visible="false" Text='<%# Eval("Lote") %>' Enabled="false"></asp:TextBox>
<asp:TextBox ID="TxtLote" CssClass="form-control input-sm" runat="server" Visible="false" Text='<%# Eval("Lote") %>' Width="100px" Enabled="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">

View File

@@ -966,8 +966,8 @@ Partial Class Inventarios_EntregaAlmacen
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
e.Row.FCTextBox("TxtCaducidad").Visible = True
e.Row.FCLinkButton("LnkCaducidad").Visible = True
'e.Row.FCTextBox("TxtCaducidad").readonly = True
e.Row.FCTextBox("TxtCaducidad").enabled = True
e.Row.FCTextBox("TxtCaducidad").readonly = True
' e.Row.FCTextBox("TxtCaducidad").enabled = True
Else
e.Row.FCTextBox("TxtCaducidad").Visible = False
e.Row.FCLinkButton("LnkCaducidad").Visible = False
@@ -975,8 +975,8 @@ Partial Class Inventarios_EntregaAlmacen
If CBool(e.Row.DBCampo("AplicaLote")) Then
e.Row.FCTextBox("TxtLote").Visible = True
' e.Row.FCTextBox("TxtLote").readonly = True
e.Row.FCTextBox("TxtLote").enabled = True
e.Row.FCTextBox("TxtLote").readonly = True
'e.Row.FCTextBox("TxtLote").enabled = True
Else
e.Row.FCTextBox("TxtLote").Visible = False
End If
@@ -2463,18 +2463,21 @@ Partial Class Inventarios_EntregaAlmacen
For Each Dr As DataRow In DtDatos.Rows
CantidadPendiente = Dr("CantidadGV").ToString().ToDecimal - Dr("CantidadTraspaso").ToString().ToDecimal - CantidadEntradaSinCosto
If CantidadPendiente > 0 Then
Dim PU As Decimal = 0
'SI FUE POR SERIE
Dim PU As Decimal = 0
Dim CveSeccionAlmacen As Integer = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)
'SI FUE POR SERIE
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
If DtDetalle.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalle.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
PU = DtExistencias.FiltroPrimeroValor("PU", $"CveTipoAlmacenDevolucion <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
CveSeccionAlmacen = DtExistencias.FiltroPrimeroValor("CveSeccionAlmacen", $"ISNULL(CveTipoAlmacenDevolucion,0) <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToEntero
PU = DtExistencias.FiltroPrimeroValor("PU", $"CveTipoAlmacenDevolucion <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
Exit For
@@ -2483,10 +2486,11 @@ Partial Class Inventarios_EntregaAlmacen
ElseIf DtDetalleLote.Rows.Count > 0 Then
For Each Dr1 As DataRow In DtDetalleLote.Rows
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
CveSeccionAlmacen = DtExistencias.FiltroPrimeroValor("CveSeccionAlmacen", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToEntero
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
Exit For
@@ -2497,7 +2501,7 @@ Partial Class Inventarios_EntregaAlmacen
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()}").ToString().ToDecimal
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar.")
Exit For

View File

@@ -62,7 +62,7 @@
<asp:UpdatePanel ID="UpGvProductos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div style="height:650px; overflow-y: scroll;" >
<asp:GridView ID="GvProdcutos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS" CssClass="table table-striped table-advance table-hover" Style="text-align: center; float: right; width: 100%; font-size: medium;" GridLines="None">
<asp:GridView ID="GvProdcutos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS, PS" CssClass="table table-striped table-advance table-hover" Style="text-align: center; float: right; width: 100%; font-size: medium;" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
@@ -82,6 +82,18 @@
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpReconstruir" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div style="width: 100%; text-align: center;">
<div>
<br />
<asp:Button ID="BtnReconstruir" runat="server" Text="Guardar" CssClass="btn btn-primary" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

View File

@@ -58,7 +58,31 @@ Partial Class Inventario_ReconstruirCostos
End If
ObjPS.Dispose()
End Sub
Private Sub BtnReconstruir_Click(sender As Object, e As EventArgs) Handles BtnReconstruir.Click
Dim objInv As New ClsInventarios
Dim TieneError As Boolean = False
Dim Producto As String = ""
For Each Gvr As GridViewRow In GvProdcutos.Rows
If Gvr.FCCheckBox("ChkProducto").Checked Then
Dim CvePS As Integer = Gvr.DataKey("CvePS").ToEntero
If Not objInv.ReconstruirCostos(CvePS, UsuarioActual.CveEmpresa) Then
TieneError = True
Producto += String.Format("{0} <br/>", Gvr.DataKey("PS").ToString)
End If
End If
Next
If TieneError Then
Alert(String.Format("Error al reconstruir los costos en los siguientes productos: {0}", Producto), TipoMensaje.MsgError)
Else
Alert("Se realizo el cambio correctamente", TipoMensaje.MsgConfirmacion)
End If
objInv.Dispose()
End Sub
End Class