- secciones en traspaso
This commit is contained in:
@@ -463,7 +463,7 @@
|
|||||||
|
|
||||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="Seccion" DataValueField="CveSeccion" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
|
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" CssClass="select2me" Style="width: 85% !important" runat="server" CausesValidation="true" Visible="false">
|
||||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
|
|||||||
@@ -714,6 +714,8 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
CveAlmacenTraspasoDestino = DtDatos.Rows(0)("CveAlmacenDestino").ToString.ToEntero
|
CveAlmacenTraspasoDestino = DtDatos.Rows(0)("CveAlmacenDestino").ToString.ToEntero
|
||||||
CveAlmacenTraspasoOrigen = DtDatos.Rows(0)("CveAlmacenOrigen").ToString.ToEntero
|
CveAlmacenTraspasoOrigen = DtDatos.Rows(0)("CveAlmacenOrigen").ToString.ToEntero
|
||||||
|
CveSubProyecto = DtDatos.Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||||
|
EsInterno = CBool(DtDatos.Rows(0)("EsInterno").ToString)
|
||||||
|
|
||||||
If DtDatos.SUM("CantidadS") <= 0 Then
|
If DtDatos.SUM("CantidadS") <= 0 Then
|
||||||
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario gvEscondeColumna"
|
GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario gvEscondeColumna"
|
||||||
@@ -748,6 +750,10 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
If Not DtDatos.Columns.Contains("CveSeccion") Then
|
If Not DtDatos.Columns.Contains("CveSeccion") Then
|
||||||
DtDatos.Columns.Add("CveSeccion", GetType(Integer))
|
DtDatos.Columns.Add("CveSeccion", GetType(Integer))
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not DtDatos.Columns.Contains("Lote") Then
|
||||||
|
DtDatos.Columns.Add("Lote", GetType(String))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not DtDatos.Columns.Contains("FechaCaducidad") Then
|
If Not DtDatos.Columns.Contains("FechaCaducidad") Then
|
||||||
@@ -2509,8 +2515,42 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
Dim ValidaSeccion As Boolean = False : Dim ValidaCaducidad As Boolean = False : Dim ValidaLote As Boolean = False
|
||||||
|
'VALIDA CANTIDAD DE SALIDA
|
||||||
|
Dim Cantidad As Decimal = 0.0D
|
||||||
|
For Each Gvr As GridViewRow In GvDatos.Rows
|
||||||
|
If CBool(Gvr.DataKey("AplicaSeccion")) AndAlso Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero <= 0 Then
|
||||||
|
ValidaSeccion = True
|
||||||
|
End If
|
||||||
|
If CBool(Gvr.DataKey("AplicaCaducidad")) AndAlso Gvr.FCTextBox("TxtCaducidad").Text.Trim = "" Then
|
||||||
|
ValidaCaducidad = True
|
||||||
|
End If
|
||||||
|
If CBool(Gvr.DataKey("AplicaLote")) AndAlso Gvr.FCTextBox("TxtLote").Text.Trim = "" Then
|
||||||
|
ValidaLote = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Gvr.FCCheckBox("cbInv").Checked AndAlso Gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
||||||
|
Cantidad = Gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
If ValidaSeccion Then
|
||||||
|
Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If ValidaCaducidad Then
|
||||||
|
Alert("La caducidad no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If ValidaLote Then
|
||||||
|
Alert("El lote de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
'VALIDA TRANSITORIO
|
'VALIDA TRANSITORIO
|
||||||
If ChkTransitorio.Checked Then
|
If ChkTransitorio.Checked Then
|
||||||
If TxtResponsable.Text.Trim = "" Then
|
If TxtResponsable.Text.Trim = "" Then
|
||||||
@@ -2545,6 +2585,9 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
For Each gvr As GridViewRow In GvDatos.Rows
|
For Each gvr As GridViewRow In GvDatos.Rows
|
||||||
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
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)("CantidadGV") = gvr.FCTextBox("TbCantidadF").Text.ToDecimal
|
||||||
|
DtDatos.Rows(Index)("CveSeccion") = gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero
|
||||||
|
DtDatos.Rows(Index)("FechaCaducidad") = gvr.FCTextBox("TxtCaducidad").Text.ToDate
|
||||||
|
DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text
|
||||||
End If
|
End If
|
||||||
Index += 1
|
Index += 1
|
||||||
Next
|
Next
|
||||||
@@ -2636,13 +2679,18 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
FolioSalida = ObjInventario.Folio
|
FolioSalida = ObjInventario.Folio
|
||||||
If CveMovimientoSalida > 0 Then
|
If CveMovimientoSalida > 0 Then
|
||||||
Dim CantidadPendiente As Decimal = 0
|
Dim CantidadPendiente As Decimal = 0
|
||||||
|
Dim CveSeccionAlmacen As Integer = -1
|
||||||
|
|
||||||
For Each Dr As DataRow In DtDatos.Rows
|
For Each Dr As DataRow In DtDatos.Rows
|
||||||
|
FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString <> "", Dr("FechaCaducidad").ToString.ToDate, MinFecha)
|
||||||
|
Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1")
|
||||||
|
CveSeccionAlmacen = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)
|
||||||
|
|
||||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
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")))
|
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
||||||
If DtDetalle.Rows.Count > 0 Then 'SI FUE POR SERIE
|
If DtDetalle.Rows.Count > 0 Then 'SI FUE POR SERIE
|
||||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
||||||
Exit For
|
Exit For
|
||||||
@@ -2650,14 +2698,14 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Next
|
Next
|
||||||
ElseIf DtDetalleLote.Rows.Count > 0 Then 'SI FUE POR LOTE BATCH
|
ElseIf DtDetalleLote.Rows.Count > 0 Then 'SI FUE POR LOTE BATCH
|
||||||
For Each Dr1 As DataRow In DtDetalleLote.Rows
|
For Each Dr1 As DataRow In DtDetalleLote.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr1("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, Lote:=Dr1("Lote").ToString, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr1("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:="", Lote:=Dr1("Lote").ToString, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Else 'NORMAL
|
Else 'NORMAL
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("CantidadGV").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, -1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("CantidadGV").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveContratoDetalle:=Dr("CveContratoDetalle").ToString.ToEntero) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
|
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
|
||||||
Exit For
|
Exit For
|
||||||
@@ -2682,8 +2730,15 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
FolioEntrada = ObjInventario.Folio
|
FolioEntrada = ObjInventario.Folio
|
||||||
If CveMovimientoEntrada > 0 Then
|
If CveMovimientoEntrada > 0 Then
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||||
|
Dim CveSeccionAlmacen As Integer = -1
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
If CBool(Dr("AplicaSeccion")) Then
|
||||||
|
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Almacen2, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
|
||||||
|
Else
|
||||||
|
CveSeccionAlmacen = -1
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||||
Exit For
|
Exit For
|
||||||
@@ -2713,13 +2768,16 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Dim FechaEstimada As String = If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text)
|
Dim FechaEstimada As String = If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text)
|
||||||
Dim NoCajas As Integer = TxtNoCajas.Text.ToEntero()
|
Dim NoCajas As Integer = TxtNoCajas.Text.ToEntero()
|
||||||
Dim Observaciones As String = TxtObservacionesPaqInterna.Text
|
Dim Observaciones As String = TxtObservacionesPaqInterna.Text
|
||||||
Dim CvePaqueteriaGuia As Integer = ObjGeneral.AddPaqueteriasGuias(-1, -1, CveEstatus, CveSubProyecto, Fecha, "-1", "-1", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EsEntregaInterna:=True)
|
Dim CvePaqueteria As Integer = GlobalDTPaqueterias().FiltroPrimeroValor("CvePaqueteria", String.Format("CveEmpresa={0} AND TipoPaqueteria = 0", UsuarioActual.CveEmpresa)).ToEntero
|
||||||
|
|
||||||
|
Dim CvePaqueteriaGuia As Integer = ObjGeneral.AddPaqueteriasGuias(CvePaqueteria, 9, CveEstatus, CveSubProyecto, Fecha, "-1", "-1", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EsEntregaInterna:=True)
|
||||||
|
|
||||||
If CvePaqueteriaGuia > 0 Then
|
If CvePaqueteriaGuia > 0 Then
|
||||||
|
|
||||||
If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then
|
If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then
|
||||||
ErrorMovInv = Not ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimiento, -1)
|
ErrorMovInv = Not ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimiento, -1)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ErrorMovInv Then
|
If ErrorMovInv Then
|
||||||
Alert("Error en el paqueteria guia detalle", TipoMensaje.MsgError)
|
Alert("Error en el paqueteria guia detalle", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user