Nueva funcionalidad de existencias en inventario
This commit is contained in:
@@ -1817,7 +1817,7 @@ Public Class ClsInventarios
|
||||
CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1,
|
||||
Optional FechaMovto As String = "-1", Optional SerieLote As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1,
|
||||
Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, Optional Lote As String = "-1", Optional Batch As String = "-1",
|
||||
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Boolean
|
||||
Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1, Optional Caducidad As Date = MinFecha) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Inv_ExistenciasGet")
|
||||
|
||||
@@ -1839,6 +1839,7 @@ Public Class ClsInventarios
|
||||
.Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir
|
||||
.Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados
|
||||
.Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes
|
||||
.Add("@Caducidad", SqlDbType.Date).Value = Caducidad
|
||||
.Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output
|
||||
End With
|
||||
Try
|
||||
@@ -4922,6 +4923,28 @@ Public Class ClsInventarios
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#Region "SUGERENCIAS SALIDA DE ALMACEN"
|
||||
|
||||
Public Function GetSugerenciasSalidaAlmacen(CveVenta As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Inv_SugerenciasSalidasGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
|
||||
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las sugerencias para la salida de almacen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " IDisposable Support "
|
||||
' IDisposable
|
||||
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
Almacén:
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<asp:DropDownList ID="DdlAlmacen" runat="server" DataTextField="Almacen" AppendDataBoundItems="true" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="320px"></asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlAlmacen" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlAlmacen_SelectedIndexChanged" DataTextField="Almacen" AppendDataBoundItems="true" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="320px"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVAlmacen" runat="server" ControlToValidate="DdlAlmacen" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEAlmacen" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacen" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
@@ -418,7 +418,7 @@
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:GridView ID="GvInv" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowFooter="True" ShowHeader="true" ShowHeaderWhenEmpty="True"
|
||||
DataKeyNames="EntregaDirecta,Consec,CodigoBarras,CvePS,CveUM,PU,CantidadC,CantidadF,UM,PS,CveCompraDetalle,CveOrdenCompraDetalle,PUExtranjero,AplicaSerieLote,CveClasificacion,Codigo,CveVentaDetalle,CostoIndirecto,CveTamaño" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
|
||||
DataKeyNames="EntregaDirecta,Consec,CodigoBarras,CvePS,CveUM,PU,CantidadC,CantidadF,UM,PS,CveCompraDetalle,CveOrdenCompraDetalle,PUExtranjero,AplicaSerieLote,CveClasificacion,Codigo,CveVentaDetalle,CostoIndirecto,CveTamaño,Lote" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
|
||||
<HeaderStyle Height="58px" />
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
@@ -445,11 +445,30 @@
|
||||
<asp:BoundField HeaderText="C.I." DataField="CostoIndirecto" DataFormatString="{0:###.####}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="7.5%" />
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true">
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLote" CssClass="form-control" runat="server" Visible="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
|
||||
<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" Style="width: 118px" 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="BottomRight" 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 HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacen" OnClick="LnkSeccionAlmacen_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
|
||||
@@ -463,6 +482,13 @@
|
||||
<asp:Label ID="LbTotal" Text="" runat="server"></asp:Label>
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Dividir" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtDividir" Width="30px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:Button runat="server" ID="BtnDividir" Text="Dividir" OnClick="Dividir" Style="display: none;" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
@@ -568,7 +594,7 @@
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
|
||||
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidadMovimiento" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -685,13 +711,13 @@
|
||||
<asp:TextBox ID="TxtCantidadSeccion" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvCantidadSeccion" runat="server" ControlToValidate="TxtCantidadSeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VcoCantidadSeccion" runat="server" HighlightCssClass="vco" TargetControlID="RfvCantidadSeccion"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RangeValidator ID="RVTxtCantidad" runat="server" ControlToValidate="TxtCantidadSeccion" MinimumValue="0" MaximumValue="1" Type="Double" Text="<b><span style='text-decoration: underline'>ERROR:</span></b><br />No cuenta con la cantidad suficiente." ValidationGroup="VgmSeccion" />
|
||||
<asp:RangeValidator ID="RVTxtCantidad" runat="server" ControlToValidate="TxtCantidadSeccion" MinimumValue="0" MaximumValue="1" Type="Double" Text="<b><span style='text-decoration: underline'>ERROR:</span></b><br />No cuenta con la cantidad suficiente." ValidationGroup="VgmSeccion" />
|
||||
<label for="<%= TxtCantidadSeccion.ClientID.ToString()%>">Cantidad:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="Seccion" DataValueField="CveSeccion">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RfvSeccionAlmacen" runat="server" ControlToValidate="DdlSeccionAlmacen" InitialValue="-1" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección Almacen''</b> es necesario, por favor ingréselo." ValidationGroup="VgmSeccion"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VcoSeccionAlmacen" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacen"></ajax:ValidatorCalloutExtender>
|
||||
@@ -705,8 +731,8 @@
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvSeccionAlmacen" runat="server" GridLines="None" ShowHeaderWhenEmpty="true"
|
||||
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true"
|
||||
<asp:GridView ID="GvSeccionAlmacen" runat="server" GridLines="None" ShowHeaderWhenEmpty="true"
|
||||
CssClass="table table-hover table-striped ScrollAD mysmallbtn" Width="100%" data-sort="true"
|
||||
AutoGenerateColumns="False" EmptyDataText="No se han agregado datos"
|
||||
DataKeyNames="Consec">
|
||||
<Columns>
|
||||
@@ -1135,7 +1161,28 @@
|
||||
$("#DivCantidadEspecial").show(200);
|
||||
}
|
||||
|
||||
function Dividir(t) {
|
||||
$get("HdnCantidadMovimiento").value = $get(t).value;
|
||||
}
|
||||
|
||||
function LimitaCantidad(C, textbox, button) {
|
||||
|
||||
// var contenedor = $(textbox).parent().find("#" + buttonIdDiv);
|
||||
|
||||
if (ToDouble(textbox.value) >= C) {
|
||||
textbox.value = "";
|
||||
}
|
||||
|
||||
if (parseFloat(textbox.value) > 0) {
|
||||
$get(button).style.display = "";
|
||||
//$(contenedor).show();
|
||||
}
|
||||
else {
|
||||
$get(button).style.display = "none";
|
||||
//$(contenedor).hide();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
@@ -476,7 +476,22 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
|
||||
|
||||
UpGenerales.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
If DdlAlmacen.SelectedValue <> "-1" Then
|
||||
For Each Gvr As GridViewRow In GvInv.Rows
|
||||
If Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue = "-1" Then
|
||||
Dim Dr As DataRow = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero($"CveAlmacen = {DdlAlmacen.SelectedValue}")
|
||||
If Dr IsNot Nothing Then
|
||||
Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValueExist(Dr("CveSeccion"))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
UPInv.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ConfiguraTipoRecepcion()
|
||||
DdlTipo.Items.Insert(0, New ListItem("Compra", "1"))
|
||||
|
||||
@@ -1095,9 +1110,29 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
TmDT.Columns.Add("CostoIndirectoExtranjero", GetType(Double))
|
||||
TmDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmDT.Columns.Add("CantidadSurtidaPantalla", GetType(Double))
|
||||
TmDT.Columns.Add("AplicaSeccion", GetType(Boolean))
|
||||
TmDT.Columns.Add("AplicaSerie", GetType(Boolean))
|
||||
TmDT.Columns.Add("AplicaLote", GetType(Boolean))
|
||||
TmDT.Columns.Add("AplicaCaducidad", GetType(Boolean))
|
||||
If Not TmDT.Columns.Contains("CostoIndirecto") Then
|
||||
TmDT.Columns.Add("CostoIndirecto", GetType(Double))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("Lote") Then
|
||||
TmDT.Columns.Add("Lote", GetType(String))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("CveSeccion") Then
|
||||
TmDT.Columns.Add("CveSeccion", GetType(Integer))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("Caducidad") Then
|
||||
TmDT.Columns.Add("Caducidad", GetType(Date))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("Seleccionado") Then
|
||||
TmDT.Columns.Add("Seleccionado", GetType(Boolean))
|
||||
End If
|
||||
If Not TmDT.Columns.Contains("CantidadSeleccionada") Then
|
||||
TmDT.Columns.Add("CantidadSeleccionada", GetType(Double))
|
||||
End If
|
||||
|
||||
|
||||
GvInv.Columns(2).Visible = False
|
||||
GvInv.Columns(3).Visible = False
|
||||
@@ -1116,6 +1151,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If Dr(VariableCampo).ToString.ToDecimal <> Dr("CantidadC").ToString.ToDecimal Then
|
||||
GvInv.Columns(3).Visible = True
|
||||
End If
|
||||
Dr("Caducidad") = Now
|
||||
Next
|
||||
|
||||
DtInv = TmDT '.FiltraParametros("CantidadF > 0")
|
||||
@@ -1129,34 +1165,53 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If UsuarioActual.CveEmpresa = 119 Then
|
||||
DtInv = DtInv.FiltraParametros("", "PS")
|
||||
End If
|
||||
|
||||
For Each item As DataRow In DtInv.Rows
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, item("CvePS").ToString.ToEntero).FiltroPrimero("")
|
||||
If Dr IsNot Nothing Then
|
||||
item("AplicaSeccion") = CBool(Dr("AplicaSeccion"))
|
||||
If CBool(Dr("AplicaSeccion")) Then GvInv.Columns(10).Visible = True
|
||||
item("AplicaSerie") = CBool(Dr("AplicaSerie"))
|
||||
item("AplicaLote") = CBool(Dr("AplicaLote"))
|
||||
If CBool(Dr("AplicaLote")) Then GvInv.Columns(11).Visible = True
|
||||
item("AplicaCaducidad") = CBool(Dr("AplicaCaducidad"))
|
||||
If CBool(Dr("AplicaCaducidad")) Then GvInv.Columns(12).Visible = True
|
||||
If CBool(Dr("AplicaSeccion")) Or CBool(Dr("AplicaLote")) Or CBool(Dr("AplicaCaducidad")) Or CBool(Dr("AplicaSerie")) Then
|
||||
GvInv.Columns(15).Visible = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
GvInv.DataSource = DtInv
|
||||
GvInv.DataBind()
|
||||
UPInv.Update()
|
||||
End Sub
|
||||
Protected Sub GVINV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInv.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("CveMetodoInventario").ToString.Contiene("5", "6") Then
|
||||
|
||||
If e.Row.DBCampo("CveMetodoInventario").ToString = "5" Then
|
||||
e.Row.FCButton("BtnSerieLote").Visible = True
|
||||
e.Row.FCButton("BtnSerieLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°{5}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PU"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec"))
|
||||
|
||||
e.Row.FCTextBox("TbCantidadF").Enabled = False
|
||||
e.Row.FCCheckBox("cbInv").Enabled = False
|
||||
Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DataKey("Consec"))).Rows.Count
|
||||
e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString
|
||||
ElseIf e.Row.DBCampo("CveMetodoInventario").ToString = "6" Then
|
||||
e.Row.FCButton("BtnLote").Visible = True
|
||||
e.Row.FCButton("BtnLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°{5}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PU"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec"))
|
||||
|
||||
e.Row.FCTextBox("TbCantidadF").Enabled = False
|
||||
e.Row.FCCheckBox("cbInv").Enabled = False
|
||||
Dim Contador = DtDatosLoteDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DataKey("Consec"))).Rows.Count
|
||||
e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString
|
||||
End If
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
'If e.Row.DBCampo("CveMetodoInventario").ToString.Contiene("5", "6") Then
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaSerie")) Then
|
||||
|
||||
'If e.Row.DBCampo("CveMetodoInventario").ToString = "5" Then
|
||||
e.Row.FCButton("BtnSerieLote").Visible = True
|
||||
e.Row.FCButton("BtnSerieLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°{5}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PU"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec"))
|
||||
|
||||
e.Row.FCTextBox("TbCantidadF").Enabled = False
|
||||
e.Row.FCCheckBox("cbInv").Enabled = False
|
||||
Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DataKey("Consec"))).Rows.Count
|
||||
e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString
|
||||
'ElseIf e.Row.DBCampo("CveMetodoInventario").ToString = "6" Then
|
||||
' e.Row.FCButton("BtnLote").Visible = True
|
||||
' e.Row.FCButton("BtnLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°{5}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PU"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec"))
|
||||
|
||||
' e.Row.FCTextBox("TbCantidadF").Enabled = False
|
||||
' e.Row.FCCheckBox("cbInv").Enabled = False
|
||||
' Dim Contador = DtDatosLoteDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DataKey("Consec"))).Rows.Count
|
||||
' e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString
|
||||
'End If
|
||||
|
||||
Else
|
||||
e.Row.FCButton("BtnSerieLote").Visible = False
|
||||
e.Row.FCButton("BtnLote").Visible = False
|
||||
@@ -1171,8 +1226,33 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
e.Row.FCTextBox("TbCantidadF").Text = e.Row.DBCampo("CantidadF").FormatoNumero
|
||||
e.Row.FCTextBox("TbCantidadF").Enabled = False
|
||||
End If
|
||||
End If
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaSeccion")) Then
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True
|
||||
Else
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
|
||||
End If
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
e.Row.FCTextBox("TxtCaducidad").Text = Now.ToShortDateString
|
||||
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
|
||||
|
||||
e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID))
|
||||
e.Row.FCButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString
|
||||
e.Row.FCTextBox("TxtDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("CantidadF"), e.Row.FCButton("BtnDividir").ClientID))
|
||||
|
||||
|
||||
'FUNCIONALIDAD PISTOLA DE CODIGOS
|
||||
If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" And Not UsuarioActual.TienePermisoProceso(174) Then
|
||||
@@ -1183,15 +1263,15 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
e.Row.FCTextBox("TbCantidadF").Visible = False
|
||||
e.Row.Cells(3).Text = "0"
|
||||
e.Row.FCCheckBox("cbInv").Visible = False
|
||||
End If
|
||||
|
||||
'TotalGV += e.Row.DBCampo("PU").ToString.ToDecimal * e.Row.DBCampo("CantidadF").ToString.ToDecimal
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(147) = "1" Then
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
||||
End If
|
||||
|
||||
'TotalGV += e.Row.DBCampo("PU").ToString.ToDecimal * e.Row.DBCampo("CantidadF").ToString.ToDecimal
|
||||
|
||||
'If UsuarioActual.Empresa.Funcionalidad(147) = "1" Then
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa)
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
'End If
|
||||
|
||||
e.Row.FCLabel("LbTotal").Text = ((e.Row.DBCampo("PU").ToDecimal + e.Row.DBCampo("CostoIndirecto").ToDecimal) * e.Row.DBCampo("CantidadF").ToDecimal).FormatoNumero
|
||||
|
||||
@@ -1361,20 +1441,20 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
'RegistraScript("document.getElementById(""TxtSerieLote"").focus();")
|
||||
RegistraScript("$('#DivSerie').modal();", "ModalLote")
|
||||
|
||||
Dim AplicaCaducidad = False
|
||||
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0) IsNot Nothing Then
|
||||
AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
|
||||
End If
|
||||
'Dim AplicaCaducidad = False
|
||||
'If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0) IsNot Nothing Then
|
||||
' AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
|
||||
'End If
|
||||
|
||||
If AplicaCaducidad Then
|
||||
GvSerie.Columns(1).Visible = True
|
||||
TdCaducidad1.Visible = True
|
||||
TdCaducidad2.Visible = True
|
||||
Else
|
||||
GvSerie.Columns(1).Visible = False
|
||||
TdCaducidad1.Visible = False
|
||||
TdCaducidad2.Visible = False
|
||||
End If
|
||||
'If AplicaCaducidad Then
|
||||
' GvSerie.Columns(1).Visible = True
|
||||
' TdCaducidad1.Visible = True
|
||||
' TdCaducidad2.Visible = True
|
||||
'Else
|
||||
' GvSerie.Columns(1).Visible = False
|
||||
' TdCaducidad1.Visible = False
|
||||
' TdCaducidad2.Visible = False
|
||||
'End If
|
||||
|
||||
GvSerie.DataSource = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerieLote), "Consec DESC")
|
||||
GvSerie.DataBind()
|
||||
@@ -1507,10 +1587,10 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim AplicaCaducidad = False
|
||||
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0) IsNot Nothing Then
|
||||
AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
|
||||
End If
|
||||
'Dim AplicaCaducidad = False
|
||||
'If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0) IsNot Nothing Then
|
||||
' AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerieLote).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
|
||||
'End If
|
||||
|
||||
Row("ConsecId") = CveConsecSerieLote
|
||||
Row("Consec") = DtDatosDetalle.Rows.Count + 1
|
||||
@@ -1518,7 +1598,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Row("CveUM") = CveUMSerieLote
|
||||
Row("PU") = PUSerieLote
|
||||
Row("Serie") = Serie
|
||||
Row("FechaCaducidad") = If(AplicaCaducidad, TxtFechaCaducidad.Text, MinFecha.ToShortDateString)
|
||||
Row("FechaCaducidad") = MinFecha.ToShortDateString
|
||||
|
||||
DtDatosDetalle.Rows.Add(Row)
|
||||
Next
|
||||
@@ -2092,7 +2172,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
PU = Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - (PU))
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), SerieLote:=Dr("Serie").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), SerieLote:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -2107,7 +2187,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -2122,7 +2202,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - tTotal)) / gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
End If
|
||||
End If
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, gvr.FCTextBox("TbCantidadF").Text.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, gvr.FCTextBox("TbCantidadF").Text.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -2856,20 +2936,20 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
DtDetalleLote = DtDatosLoteDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec").ToEntero))
|
||||
If DtDetalle.Rows.Count > 0 Then
|
||||
For Each Dr As DataRow In DtDetalle.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), SerieLote:=Dr("Serie").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), SerieLote:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
ElseIf DtDetalleLote.Rows.Count > 0 Then
|
||||
For Each Dr As DataRow In DtDetalleLote.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, gvr.FCTextBox("TbCantidadF").Text.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, gvr.FCTextBox("TbCantidadF").Text.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -3735,4 +3815,92 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "DIVIDIR"
|
||||
|
||||
Protected Sub Dividir(sender As Object, e As EventArgs)
|
||||
Dim index2 As Integer = 0
|
||||
|
||||
For Each Row As DataRow In DtInv.Rows
|
||||
Row("Seleccionado") = GvInv.Rows(index2).FCCheckBox("cbInv").Checked
|
||||
If GvInv.Rows(index2).FCTextBox("TbCantidadF").Text <> "" Then
|
||||
Row("CantidadSeleccionada") = GvInv.Rows(index2).FCTextBox("TbCantidadF").Text
|
||||
End If
|
||||
If GvInv.Rows(index2).FCTextBox("TxtLote").Text <> "" Then
|
||||
Row("Lote") = GvInv.Rows(index2).FCTextBox("TxtLote").Text
|
||||
End If
|
||||
If GvInv.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue <> "-1" Then
|
||||
Row("CveSeccion") = GvInv.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero
|
||||
End If
|
||||
If GvInv.Rows(index2).FCTextBox("TxtCaducidad").Text <> "" Then
|
||||
Row("Caducidad") = GvInv.Rows(index2).FCTextBox("TxtCaducidad").Text.ToDate
|
||||
End If
|
||||
index2 += 1
|
||||
Next
|
||||
DtInv.AcceptChanges()
|
||||
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, Button)).NamingContainer, GridViewRow)
|
||||
Dim Index As Integer = gvRow.RowIndex
|
||||
Dim Cantidad As String = HdnCantidadMovimiento.Value
|
||||
Dim dr1 As DataRow = DtInv.Rows(Index)
|
||||
Dim dr As DataRow = DtInv.NewRow
|
||||
dr.ItemArray = dr1.ItemArray
|
||||
dr1("CantidadC") = (dr1("CantidadC").ToString.ToDouble - Cantidad.ToDouble)
|
||||
Dim CantidadFOriginal As Double = dr1("CantidadF").ToString.ToDouble
|
||||
dr1("CantidadF") = (dr1("CantidadF").ToString.ToDouble - Cantidad.ToDouble)
|
||||
Dim CantidadSOriginal As Double = dr1("CantidadS").ToString.ToDouble
|
||||
dr1("CantidadS") = (CantidadSOriginal * dr1("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
Dim CantidadSeleccionadaOriginal As Double = dr1("CantidadSeleccionada").ToString.ToDouble
|
||||
dr1("CantidadSeleccionada") = If(CantidadSeleccionadaOriginal > dr1("CantidadF").ToString.ToDouble, dr1("CantidadF").ToString.ToDouble, CantidadSeleccionadaOriginal)
|
||||
CantidadSeleccionadaOriginal = CantidadSeleccionadaOriginal - dr1("CantidadF").ToString.ToDouble
|
||||
|
||||
Dim CostoIndirectoOriginal As Double = dr1("CostoIndirecto").ToString.ToDouble
|
||||
dr1("CostoIndirecto") = (CostoIndirectoOriginal * dr1("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
Dim CostoIndirectoExtranjeroOriginal As Double = dr1("CostoIndirectoExtranjero").ToString.ToDouble
|
||||
dr1("CostoIndirectoExtranjero") = (CostoIndirectoExtranjeroOriginal * dr1("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
|
||||
DtInv.AcceptChanges()
|
||||
|
||||
dr("CantidadC") = Cantidad.ToDouble
|
||||
dr("CantidadF") = Cantidad.ToDouble
|
||||
dr("CantidadS") = (CantidadSOriginal * dr("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
dr("CantidadSeleccionada") = If(CantidadSeleccionadaOriginal > 0, CantidadSeleccionadaOriginal, 0)
|
||||
dr("Seleccionado") = If(CantidadSeleccionadaOriginal > 0, True, False)
|
||||
dr("CostoIndirecto") = (CostoIndirectoOriginal * dr("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
dr("CostoIndirectoExtranjero") = (CostoIndirectoExtranjeroOriginal * dr("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
DtInv.Rows.InsertAt(dr, Index)
|
||||
DtInv.AcceptChanges()
|
||||
|
||||
index2 = 1
|
||||
For Each Row As DataRow In DtInv.Rows
|
||||
Row("Consec") = index2
|
||||
index2 += 1
|
||||
Next
|
||||
DtInv.AcceptChanges()
|
||||
|
||||
CargaGVInv()
|
||||
|
||||
index2 = 0
|
||||
For Each Row As DataRow In DtInv.Rows
|
||||
GvInv.Rows(index2).FCCheckBox("cbInv").Checked = CBool(Row("Seleccionado"))
|
||||
If Row("CantidadSeleccionada").ToString <> "" Then
|
||||
GvInv.Rows(index2).FCTextBox("TbCantidadF").Text = Row("CantidadSeleccionada").ToString
|
||||
End If
|
||||
If Row("Lote").ToString <> "" Then
|
||||
GvInv.Rows(index2).FCTextBox("TxtLote").Text = Row("Lote").ToString
|
||||
End If
|
||||
If Row("CveSeccion").ToString <> "" Then
|
||||
GvInv.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue = Row("CveSeccion").ToString
|
||||
End If
|
||||
If Row("Caducidad").ToString <> "" Then
|
||||
GvInv.Rows(index2).FCTextBox("TxtCaducidad").Text = Row("Caducidad").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
index2 += 1
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -416,6 +416,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="btn-group pull-right">
|
||||
<asp:Button ID="BtnVerSugerencias" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnVerSugerencias_Click" runat="server" Text="Ver Secciones" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--GV DATOS--%>
|
||||
<asp:GridView ID="GvDatos" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowFooter="True" ShowHeader="true" ShowHeaderWhenEmpty="True"
|
||||
DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,AplicaSerieLote,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveVentaDetalle,CveTamaño" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD gvInventario mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
|
||||
@@ -484,11 +492,46 @@
|
||||
<asp:LinkButton data-toggle="tooltip" title="Sección Almacen" ID="LnkSeccionAlmacen" OnClick="LnkSeccionAlmacen_Click" CssClass="btn btn-circle btn-xs green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="7.5%" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtLote" CssClass="form-control" runat="server" Visible="false"></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Caducidad" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" Visible="false">
|
||||
<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" Style="width: 118px" 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="BottomRight" 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 HeaderText="Dividir" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox runat="server" ID="TxtDividir" Width="30px"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtDividir" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<asp:Button runat="server" ID="BtnDividir" Text="Dividir" OnClick="Dividir" Style="display: none;" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<asp:HiddenField runat="server" ClientIDMode="Static" ID="HdnCantidadMovimiento" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -879,6 +922,35 @@
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div id="ModalVerSugerencias" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel ID="UpVerSugerencias" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Sugerencias</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:GridView ID="GvSugerencias" runat="server" EmptyDataText="No se encontraron registros." AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" CssClass="table table-striped table-hover Widthall ScrollAD" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField HeaderText="Producto/Servicio" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left"/>
|
||||
<asp:BoundField HeaderText="Sección Almacen" DataField="Seccion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Caducidad" DataField="Caducidad" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnAplicarSugerencias" OnClick="BtnAplicarSugerencias_Click" runat="server" ClientIDMode="Static" Text="Aplicar" CssClass="btn btn-primary" />
|
||||
<button id="CancelarVerSugerencias" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
|
||||
@@ -931,6 +1003,29 @@
|
||||
$('#TxtCantidadEspecialDiv').focus()
|
||||
}
|
||||
|
||||
function Dividir(t) {
|
||||
$get("HdnCantidadMovimiento").value = $get(t).value;
|
||||
}
|
||||
|
||||
function LimitaCantidad(C, textbox, button) {
|
||||
|
||||
// var contenedor = $(textbox).parent().find("#" + buttonIdDiv);
|
||||
|
||||
if (ToDouble(textbox.value) >= C) {
|
||||
textbox.value = "";
|
||||
}
|
||||
|
||||
if (parseFloat(textbox.value) > 0) {
|
||||
$get(button).style.display = "";
|
||||
//$(contenedor).show();
|
||||
}
|
||||
else {
|
||||
$get(button).style.display = "none";
|
||||
//$(contenedor).hide();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -34,6 +34,14 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
ViewState("DtDatosDetalle") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtDatosSugerencias As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtDatosSugerencias"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatosSugerencias") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtDatosDetalleLote As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtDatosDetalleLote"), DataTable)
|
||||
@@ -287,6 +295,9 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
CveVendedor = -1
|
||||
CveCliente = -1
|
||||
CveSubProyecto = -1
|
||||
|
||||
DtDatosSugerencias = New DataTable
|
||||
|
||||
Dim StrAlmacenes As String = "CveTipoAlmacen IN (1,2)"
|
||||
|
||||
If (UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1") Then
|
||||
@@ -621,6 +632,30 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen)
|
||||
End If
|
||||
|
||||
DtDatos.Columns.Add("AplicaSeccion", GetType(Boolean))
|
||||
DtDatos.Columns.Add("AplicaSerie", GetType(Boolean))
|
||||
DtDatos.Columns.Add("AplicaLote", GetType(Boolean))
|
||||
DtDatos.Columns.Add("AplicaCaducidad", GetType(Boolean))
|
||||
If Not DtDatos.Columns.Contains("Lote") Then
|
||||
DtDatos.Columns.Add("Lote", GetType(String))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("CveSeccion") Then
|
||||
DtDatos.Columns.Add("CveSeccion", GetType(Integer))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("Caducidad") Then
|
||||
DtDatos.Columns.Add("Caducidad", GetType(Date))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("Seleccionado") Then
|
||||
DtDatos.Columns.Add("Seleccionado", GetType(Boolean))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("CantidadSeleccionada") Then
|
||||
DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double))
|
||||
End If
|
||||
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
Dr("Caducidad") = Now
|
||||
Next
|
||||
|
||||
'TxtFecha.Text = If(EsDevolucionVenta = 1, Now.ToShortDateString, DtDatos.Rows(0)("Fecha").ToString)
|
||||
End If
|
||||
|
||||
@@ -775,6 +810,23 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Private Sub CargaGvDatos()
|
||||
|
||||
If DtDatos IsNot Nothing Then
|
||||
|
||||
For Each item As DataRow In DtDatos.Rows
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, item("CvePS").ToString.ToEntero).FiltroPrimero("")
|
||||
If Dr IsNot Nothing Then
|
||||
item("AplicaSeccion") = CBool(Dr("AplicaSeccion"))
|
||||
If CBool(Dr("AplicaSeccion")) Then GvDatos.Columns(9).Visible = True
|
||||
item("AplicaSerie") = CBool(Dr("AplicaSerie"))
|
||||
item("AplicaLote") = CBool(Dr("AplicaLote"))
|
||||
If CBool(Dr("AplicaLote")) Then GvDatos.Columns(10).Visible = True
|
||||
item("AplicaCaducidad") = CBool(Dr("AplicaCaducidad"))
|
||||
If CBool(Dr("AplicaCaducidad")) Then GvDatos.Columns(11).Visible = True
|
||||
If CBool(Dr("AplicaSeccion")) Or CBool(Dr("AplicaLote")) Or CBool(Dr("AplicaCaducidad")) Or CBool(Dr("AplicaSerie")) Then
|
||||
GvDatos.Columns(12).Visible = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
GvDatos.DataSource = DtDatos
|
||||
End If
|
||||
|
||||
@@ -802,7 +854,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
If e.Row.DBCampo("Inv_CveMetodoInventario").Contiene("5", "6") Then
|
||||
If CBool(e.Row.DBCampo("AplicaSerie")) Then
|
||||
e.Row.FCButton("BtnSerieLote").Visible = True
|
||||
e.Row.FCButton("BtnSerieLote").Text = If(e.Row.DBCampo("Inv_CveMetodoInventario").ToString = "5", "SerieLote", "Lote-Batch")
|
||||
e.Row.FCButton("BtnSerieLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°{5}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec"), e.Row.DBCampo("Inv_CveMetodoInventario"))
|
||||
@@ -829,6 +881,32 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
End If
|
||||
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaSeccion")) Then
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True
|
||||
Else
|
||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
|
||||
End If
|
||||
|
||||
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||
e.Row.FCTextBox("TxtCaducidad").Text = Now.ToShortDateString
|
||||
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
|
||||
|
||||
e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID))
|
||||
e.Row.FCButton("BtnDividir").CommandArgument = e.Row.RowIndex.ToString
|
||||
e.Row.FCTextBox("TxtDividir").Attributes.Add("onkeyup", String.Format("LimitaCantidad({0},this,'{1}');", e.Row.DBCampo("CantidadF"), e.Row.FCButton("BtnDividir").ClientID))
|
||||
|
||||
|
||||
'FUNCIONALIDAD PISTOLA DE CODIGOS
|
||||
If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then
|
||||
'NO BLOQUEA PARA ROL AD
|
||||
@@ -1562,6 +1640,9 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
For Each gvr As GridViewRow In GvDatos.Rows
|
||||
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
||||
DtDatos.Rows(Index)("CantidadGV") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||
DtDatos.Rows(Index)("CveSeccion") = gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero
|
||||
DtDatos.Rows(Index)("Caducidad") = gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
||||
DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text
|
||||
End If
|
||||
Index += 1
|
||||
Next
|
||||
@@ -1610,10 +1691,10 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
StrXML.Append("<conceptos>")
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
If Dr("CantidadGV").ToString.ToDecimal > 0 Then
|
||||
If Dr("Inv_CveMetodoInventario").ToString = "5" Then
|
||||
If CBool(Dr("AplicaSeccion")) Then
|
||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" Serie=""{3}"" ></concepto>", Dr1("CvePS"), Dr1("CveUM"), 1, Dr1("SerieLote"))
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" Serie=""{3}"" Lote=""{4}"" CveSeccion=""{5}"" Caducidad=""{6}"" ></concepto>", Dr1("CvePS"), Dr1("CveUM"), 1, Dr1("SerieLote"), If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1), If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha))
|
||||
Next
|
||||
ElseIf Dr("Inv_CveMetodoInventario").ToString = "6" Then
|
||||
DtDetalle = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
@@ -1621,7 +1702,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" Serie=""{3}"" ></concepto>", Dr1("CvePS"), Dr1("CveUM"), DtDatosDetalleLote.SUM("Cantidad", $"Lote = '{Dr1("Lote").ToString}' AND Batch = '{Dr1("Batch").ToString}'"), Dr1("Lote"))
|
||||
Next
|
||||
Else
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" Serie=""{3}"" ></concepto>", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), "-1")
|
||||
StrXML.AppendFormat("<concepto CvePS=""{0}"" CveUM=""{1}"" Cantidad= ""{2}"" Serie=""{3}"" Lote=""{4}"" CveSeccion=""{5}"" Caducidad=""{6}"" ></concepto>", Dr("CvePS"), Dr("CveUM"), Dr("CantidadGV"), "-1", If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1), If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -1668,11 +1749,11 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
If Dr("CantidadGV").ToString.ToDecimal > 0 Then
|
||||
|
||||
If Dr("Inv_CveMetodoInventario").ToString = "5" Then
|
||||
If CBool(Dr("AplicaSeccion")) Then
|
||||
|
||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=Dr1("SerieLote").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1) Then
|
||||
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=Dr1("SerieLote").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
For Each Dr2 As DataRow In ObjInventario.DtResultados.FiltraParametros("CveAlmacen > 0 AND ExistenciaFinal > 0").Rows
|
||||
|
||||
'BUSCA SI EXISTE YA UN TRASPASO DEL ALMACEN DE APARTADO
|
||||
@@ -1701,7 +1782,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
CantidadPendiente = 1
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, SerieLote:=Dr1("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, SerieLote:=Dr1("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -1720,7 +1801,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
DtDetalle = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1) Then
|
||||
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
|
||||
CantidadSaldo = Dr("CantidadGV").ToString.ToDecimal
|
||||
|
||||
@@ -1751,7 +1832,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
CantidadPendiente = If(Dr1("Cantidad").ToString.ToDecimal > CantidadSaldo, CantidadSaldo, Dr1("Cantidad").ToString.ToDecimal)
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -1769,7 +1850,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
Else
|
||||
|
||||
If ObjInventario.GetExistenciasProducto(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1) Then
|
||||
If ObjInventario.GetExistenciasProducto(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
|
||||
CantidadSaldo = Dr("CantidadGV").ToString.ToDecimal
|
||||
|
||||
@@ -1801,7 +1882,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
CantidadPendiente = If(Dr1("ExistenciaFinal").ToString.ToDecimal > CantidadSaldo, CantidadSaldo, Dr1("ExistenciaFinal").ToString.ToDecimal)
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -1844,7 +1925,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, SerieLote:=Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -1942,7 +2023,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
End If
|
||||
|
||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, SerieLote:=Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -1972,7 +2053,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, SerieLote:=Dr1("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, SerieLote:=Dr1("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -1984,7 +2065,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'").ToString.ToDecimal
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, Batch:=Dr1("Batch").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -1995,7 +2076,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
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, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("Caducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -2806,7 +2887,92 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "DIVIDIR"
|
||||
|
||||
Protected Sub Dividir(sender As Object, e As EventArgs)
|
||||
Dim index2 As Integer = 0
|
||||
|
||||
For Each Row As DataRow In DtDatos.Rows
|
||||
Row("Seleccionado") = GvDatos.Rows(index2).FCCheckBox("cbInv").Checked
|
||||
If GvDatos.Rows(index2).FCTextBox("TbCantidadF").Text <> "" Then
|
||||
Row("CantidadSeleccionada") = GvDatos.Rows(index2).FCTextBox("TbCantidadF").Text
|
||||
End If
|
||||
If GvDatos.Rows(index2).FCTextBox("TxtLote").Text <> "" Then
|
||||
Row("Lote") = GvDatos.Rows(index2).FCTextBox("TxtLote").Text
|
||||
End If
|
||||
If GvDatos.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue <> "-1" Then
|
||||
Row("CveSeccion") = GvDatos.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero
|
||||
End If
|
||||
If GvDatos.Rows(index2).FCTextBox("TxtCaducidad").Text <> "" Then
|
||||
Row("Caducidad") = GvDatos.Rows(index2).FCTextBox("TxtCaducidad").Text.ToDate
|
||||
End If
|
||||
index2 += 1
|
||||
Next
|
||||
DtDatos.AcceptChanges()
|
||||
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, Button)).NamingContainer, GridViewRow)
|
||||
Dim Index As Integer = gvRow.RowIndex
|
||||
Dim Cantidad As String = HdnCantidadMovimiento.Value
|
||||
Dim dr1 As DataRow = DtDatos.Rows(Index)
|
||||
Dim dr As DataRow = DtDatos.NewRow
|
||||
dr.ItemArray = dr1.ItemArray
|
||||
dr1("CantidadC") = (dr1("CantidadC").ToString.ToDouble - Cantidad.ToDouble)
|
||||
Dim CantidadFOriginal As Double = dr1("CantidadF").ToString.ToDouble
|
||||
dr1("CantidadF") = (dr1("CantidadF").ToString.ToDouble - Cantidad.ToDouble)
|
||||
Dim CantidadSOriginal As Double = dr1("CantidadS").ToString.ToDouble
|
||||
dr1("CantidadS") = (CantidadSOriginal * dr1("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
Dim CantidadSeleccionadaOriginal As Double = dr1("CantidadSeleccionada").ToString.ToDouble
|
||||
dr1("CantidadSeleccionada") = If(CantidadSeleccionadaOriginal > dr1("CantidadF").ToString.ToDouble, dr1("CantidadF").ToString.ToDouble, CantidadSeleccionadaOriginal)
|
||||
CantidadSeleccionadaOriginal = CantidadSeleccionadaOriginal - dr1("CantidadF").ToString.ToDouble
|
||||
|
||||
'Dim CostoIndirectoOriginal As Double = dr1("CostoIndirecto").ToString.ToDouble
|
||||
'dr1("CostoIndirecto") = (CostoIndirectoOriginal * dr1("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
'Dim CostoIndirectoExtranjeroOriginal As Double = dr1("CostoIndirectoExtranjero").ToString.ToDouble
|
||||
'dr1("CostoIndirectoExtranjero") = (CostoIndirectoExtranjeroOriginal * dr1("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
|
||||
DtDatos.AcceptChanges()
|
||||
|
||||
dr("CantidadC") = Cantidad.ToDouble
|
||||
dr("CantidadF") = Cantidad.ToDouble
|
||||
dr("CantidadS") = (CantidadSOriginal * dr("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
dr("CantidadSeleccionada") = If(CantidadSeleccionadaOriginal > 0, CantidadSeleccionadaOriginal, 0)
|
||||
dr("Seleccionado") = If(CantidadSeleccionadaOriginal > 0, True, False)
|
||||
'dr("CostoIndirecto") = (CostoIndirectoOriginal * dr("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
'dr("CostoIndirectoExtranjero") = (CostoIndirectoExtranjeroOriginal * dr("CantidadF").ToString.ToDouble) / CantidadFOriginal
|
||||
DtDatos.Rows.InsertAt(dr, Index)
|
||||
DtDatos.AcceptChanges()
|
||||
|
||||
index2 = 1
|
||||
For Each Row As DataRow In DtDatos.Rows
|
||||
Row("Consec") = index2
|
||||
index2 += 1
|
||||
Next
|
||||
DtDatos.AcceptChanges()
|
||||
|
||||
CargaGvDatos()
|
||||
|
||||
index2 = 0
|
||||
For Each Row As DataRow In DtDatos.Rows
|
||||
GvDatos.Rows(index2).FCCheckBox("cbInv").Checked = CBool(Row("Seleccionado"))
|
||||
If Row("CantidadSeleccionada").ToString <> "" Then
|
||||
GvDatos.Rows(index2).FCTextBox("TbCantidadF").Text = Row("CantidadSeleccionada").ToString
|
||||
End If
|
||||
If Row("Lote").ToString <> "" Then
|
||||
GvDatos.Rows(index2).FCTextBox("TxtLote").Text = Row("Lote").ToString
|
||||
End If
|
||||
If Row("CveSeccion").ToString <> "" Then
|
||||
GvDatos.Rows(index2).FCDropDownList("DdlSeccionAlmacen").SelectedValue = Row("CveSeccion").ToString
|
||||
End If
|
||||
If Row("Caducidad").ToString <> "" Then
|
||||
GvDatos.Rows(index2).FCTextBox("TxtCaducidad").Text = Row("Caducidad").ToString.ToDate.ToShortDateString
|
||||
End If
|
||||
index2 += 1
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " GUIAS - SABE QUE ES PORQUE NO VEO QUE SE UTILIZE EN ALGUNA PARTE - EN MIRAS DE ELIMINAR - IPP 24 AGOSTO 2017 "
|
||||
Private Sub BtnNumeroGuia_Click(sender As Object, e As EventArgs) Handles BtnNumeroGuia.Click
|
||||
@@ -2844,6 +3010,86 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "SUGERENCIAS"
|
||||
|
||||
Protected Sub BtnVerSugerencias_Click(sender As Object, e As EventArgs)
|
||||
If Not CveVentaSurtir > 0 Then
|
||||
Alert("Tiene que seleccionar la venta a surtir", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If Not DdlAlmacen.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que seleccionar el almacen", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
If ObjInv.GetSugerenciasSalidaAlmacen(CveVentaSurtir, DdlAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||
GvSugerencias.DataSource = ObjInv.DtResultados
|
||||
|
||||
|
||||
DtDatosSugerencias = ObjInv.DtResultados
|
||||
|
||||
DtDatos.Columns.Add("Consec", GetType(Integer))
|
||||
DtDatos.Columns.Add("CantidadGV", GetType(Double))
|
||||
DtDatos.Columns.Add("CantidadTraspaso", GetType(Double))
|
||||
DtDatos.Columns.Add("AplicaSeccion", GetType(Boolean))
|
||||
DtDatos.Columns.Add("AplicaSerie", GetType(Boolean))
|
||||
DtDatos.Columns.Add("AplicaLote", GetType(Boolean))
|
||||
DtDatos.Columns.Add("AplicaCaducidad", GetType(Boolean))
|
||||
If Not DtDatos.Columns.Contains("Lote") Then
|
||||
DtDatos.Columns.Add("Lote", GetType(String))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("CveSeccion") Then
|
||||
DtDatos.Columns.Add("CveSeccion", GetType(Integer))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("Caducidad") Then
|
||||
DtDatos.Columns.Add("Caducidad", GetType(Date))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("Seleccionado") Then
|
||||
DtDatos.Columns.Add("Seleccionado", GetType(Boolean))
|
||||
End If
|
||||
If Not DtDatos.Columns.Contains("CantidadSeleccionada") Then
|
||||
DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double))
|
||||
End If
|
||||
|
||||
Dim Index = 1
|
||||
For Each Dr As DataRow In DtDatosSugerencias.Rows
|
||||
Dr("Consec") = Index
|
||||
Dr("Caducidad") = Now
|
||||
Index += 1
|
||||
Next
|
||||
|
||||
DtDatosSugerencias.AcceptChanges()
|
||||
|
||||
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
GvSugerencias.DataBind()
|
||||
|
||||
UpVerSugerencias.Update()
|
||||
|
||||
RegistraScript("$('#ModalVerSugerencias').modal()")
|
||||
End Sub
|
||||
Protected Sub BtnAplicarSugerencias_Click(sender As Object, e As EventArgs)
|
||||
|
||||
DtDatos = Nothing
|
||||
DtDatos = New DataTable
|
||||
DtDatos = DtDatosSugerencias
|
||||
|
||||
DtDatosDetalle = Nothing
|
||||
CreaDtDetalle()
|
||||
|
||||
DtDatosDetalleLote = Nothing
|
||||
CreaDtDetalleLote()
|
||||
|
||||
CargaGvDatos()
|
||||
|
||||
RegistraScript("$('#ModalVerSugerencias').modal('hide')")
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user