seccion el codigo barras al ser consumo interno

This commit is contained in:
rrene
2020-07-25 15:18:25 -07:00
parent 5e6bd72c46
commit 716a35b16a
2 changed files with 49 additions and 11 deletions

View File

@@ -546,6 +546,14 @@
<asp:Button Text="" ID="BtnSeriePSAdd" OnClick="BtnSeriePSAdd_Click" Style="display: none" runat="server" /> <asp:Button Text="" ID="BtnSeriePSAdd" OnClick="BtnSeriePSAdd_Click" Style="display: none" runat="server" />
</asp:Panel> </asp:Panel>
</td> </td>
<td runat="server" visible="false" id="TdSeccionPSAdd">
<asp:Panel ID="Panel3" runat="server" DefaultButton="BtnSeccionPSAdd">
<asp:DropDownList ID="DdlSeccionPSAdd" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" Class="form-control input-sm select2me" Style="width: 95% !important" runat="server" CausesValidation="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:Button Text="" ID="BtnSeccionPSAdd" Style="display: none" runat="server" />
</asp:Panel>
</td>
</tr> </tr>
</table> </table>
</div> </div>

View File

@@ -1190,7 +1190,7 @@ Partial Class Inventarios_EntradasSalidas
End Sub End Sub
Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, SerieLote As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, FechaCaducidad As Date, CveSeccionAlmacen As Integer, SeccionAlmacen As String) Protected Sub AddNew(CvePS As Integer, PS As String, CveUM As Integer, UM As String, Cantidad As Double, PU As Double, Serie As String, CodigoAF As String, Codigo As String, CveAF As String, Observaciones As String, Lote As String, FechaCaducidad As Date, CveSeccionAlmacen As Integer, SeccionAlmacen As String)
If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub If DdlAlmacen.SelectedValue.ToEntero <= 0 Then Alert("Seleccione un almacen", TipoMensaje.MsgAdvertencia) : RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") : DdlProducto2.SelectedText = "" : Exit Sub
Dim Valido As Boolean = True Dim Valido As Boolean = True
@@ -1201,7 +1201,7 @@ Partial Class Inventarios_EntradasSalidas
Dim FechaCaducidadVal As Date = If(RowPS("AplicaCaducidad").ToString = "True", FechaCaducidad, MinFecha) Dim FechaCaducidadVal As Date = If(RowPS("AplicaCaducidad").ToString = "True", FechaCaducidad, MinFecha)
If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then If CveMetodoInventario = 5 And (String.IsNullOrEmpty(Serie.Trim()) OrElse Serie = "-1") Then
Valido = False Valido = False
Alert("El producto requiere Serie", TipoMensaje.MsgAdvertencia) Alert("El producto requiere Serie", TipoMensaje.MsgAdvertencia)
End If End If
@@ -1209,9 +1209,9 @@ Partial Class Inventarios_EntradasSalidas
'salida 'salida
If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen If Valido AndAlso DdlConcepto.SelectedValue.Contiene({"3", "5", "7", "8", "11", "12", "13", "15", "16", "17", "20", "21", "30", "31"}) Then ' salida de almacen
Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(SerieLote = "", "-1", SerieLote), If(Lote = "", "-1", Lote), FechaCaducidadVal) Dim Existencia As Double = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(Serie = "", "-1", Serie), If(Lote = "", "-1", Lote), FechaCaducidadVal)
' LbAgregar.ToolTip = Existencia.ToString ' LbAgregar.ToolTip = Existencia.ToString
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(SerieLote <> "", $" AND Serie = '{SerieLote}'", "")}") < 0 Then If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(Serie <> "", $" AND Serie = '{Serie}'", "")}") < 0 Then
If Existencia <= 0 Then If Existencia <= 0 Then
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia) Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
@@ -1230,12 +1230,12 @@ Partial Class Inventarios_EntradasSalidas
If Valido Then If Valido Then
Dim CveClasificacion As Integer Dim CveClasificacion As Integer
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("", "PS") 'Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).FiltroPrimero("", "PS")
If dr IsNot Nothing Then CveClasificacion = dr("CveClasificacion").ToString.ToEntero If RowPS IsNot Nothing Then CveClasificacion = RowPS("CveClasificacion").ToString.ToEntero
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS 'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
If SerieLote <> "" And (SerieLote.ToUpper = dr("Codigo").ToString.ToUpper Or SerieLote.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then If Serie <> "" And (Serie.ToUpper = RowPS("Codigo").ToString.ToUpper Or Serie.ToUpper = RowPS("CodigoBarras").ToString.ToUpper) Then
Alert($"La serie indicada <b>{SerieLote}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Alert($"La serie indicada <b>{Serie}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
@@ -1258,7 +1258,7 @@ Partial Class Inventarios_EntradasSalidas
registro.Item("CodigoAF") = CodigoAF registro.Item("CodigoAF") = CodigoAF
registro.Item("Codigo") = Codigo registro.Item("Codigo") = Codigo
registro.Item("CveAF") = CveAF registro.Item("CveAF") = CveAF
registro.Item("Serie") = If(SerieLote <> "", SerieLote, "") registro.Item("Serie") = If(Serie <> "", Serie, "")
registro.Item("Lote") = If(Lote <> "", Lote, "") registro.Item("Lote") = If(Lote <> "", Lote, "")
registro.Item("FechaCaducidad") = FechaCaducidad registro.Item("FechaCaducidad") = FechaCaducidad
registro.Item("Observaciones") = Observaciones registro.Item("Observaciones") = Observaciones
@@ -2938,6 +2938,7 @@ Partial Class Inventarios_EntradasSalidas
End If End If
TdSeriePS.Visible = False TdSeriePS.Visible = False
TdSeccionPSAdd.Visible = False
Dim Dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras= '{TxtCodigoPS.Text}'") Dim Dr = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero($"CodigoBarras= '{TxtCodigoPS.Text}'")
If Dr Is Nothing Then If Dr Is Nothing Then
@@ -2947,7 +2948,7 @@ Partial Class Inventarios_EntradasSalidas
Exit Sub Exit Sub
End If End If
If Dr("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then If Dr("AplicaSerie").ToString = "True" Then
TdSeriePSAdd.Visible = True TdSeriePSAdd.Visible = True
TxtSeriePS.Focus() TxtSeriePS.Focus()
CvePSSerieLote = Dr("CvePS").ToString.ToEntero CvePSSerieLote = Dr("CvePS").ToString.ToEntero
@@ -2956,8 +2957,32 @@ Partial Class Inventarios_EntradasSalidas
UMSerieLote = Dr("UnidadMedida").ToString UMSerieLote = Dr("UnidadMedida").ToString
Exit Sub Exit Sub
End If End If
Dim CveSeccionAlmacen As Integer = -1
Dim SeccionAlmacen As String = ""
AddNew(Dr("CvePS").ToString.ToEntero, Dr("PSCodigo").ToString, Dr("CveUM").ToString.ToEntero, Dr("UnidadMedida").ToString, 1, Dr("CostoPromedio").ToString.ToDouble, "", "", "", "", "", "", MinFecha, -1, "") If Dr("AplicaSeccion").ToString = "True" Then
If DdlAlmacen.SelectedValue.ToEntero <= 1 Then
Alert("No se ha especificado el almacen para especificar la sección", TipoMensaje.MsgError)
Exit Sub
End If
DdlSeccionPSAdd.Items.Clear()
Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, Dr("CvePS").ToString.ToEntero)
DdlSeccionPSAdd.DataSource = dtt
DdlSeccionPSAdd.DataBind()
If dtt.Rows.Count > 1 Then
DdlSeccionPSAdd.Items.Insert(0, New ListItem("Seleccione", "-1"))
' si solo hay un movimiento, debe de agregar, sino debe de esperar a que seleccionen
Exit Sub
DdlSeccionPSAdd.Focus()
TdSeccionPSAdd.Visible = True
Else
CveSeccionAlmacen = DdlSeccionPSAdd.SelectedValue.ToEntero
SeccionAlmacen = DdlSeccionPSAdd.SelectedItem.Text
End If
End If
AddNew(Dr("CvePS").ToString.ToEntero, Dr("PSCodigo").ToString, Dr("CveUM").ToString.ToEntero, Dr("UnidadMedida").ToString, 1, Dr("CostoPromedio").ToString.ToDouble, "", "", "", "", "", "", MinFecha, CveSeccionAlmacen, SeccionAlmacen)
TxtCodigoPS.Text = "" TxtCodigoPS.Text = ""
TxtCodigoPS.Focus() TxtCodigoPS.Focus()
@@ -2968,6 +2993,11 @@ Partial Class Inventarios_EntradasSalidas
If TxtSeriePS.Text.Trim = "" Then If TxtSeriePS.Text.Trim = "" Then
Exit Sub Exit Sub
End If End If
If TdSeccionPSAdd.Visible Then
If DdlSeccionAlmacen.SelectedValue.ToEntero <= 0 Then
Exit Sub
End If
End If
AddNew(CvePSSerieLote, PSSerieLote, CveUMSerieLote, UMSerieLote, 1, 0, TxtSeriePS.Text.Trim, "", "", "", "", "", MinFecha, -1, "") AddNew(CvePSSerieLote, PSSerieLote, CveUMSerieLote, UMSerieLote, 1, 0, TxtSeriePS.Text.Trim, "", "", "", "", "", MinFecha, -1, "")