Correcciones en almacenes virtuales
This commit is contained in:
@@ -350,6 +350,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivVirtualAdvertencia" visible="false" runat="server" class="col-md-12" style="vertical-align: middle;" align="center">
|
||||
<div style="z-index: 5; position: relative;">
|
||||
<div clientidmode="Static" runat="server" class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
|
||||
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
|
||||
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong>
|
||||
<asp:Literal Text="La mercancía sera trasladada al almacén virtual" runat="server" ID="Literal1"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -942,6 +942,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
DivCodigoSeriePS.Visible = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 140 Then
|
||||
DivVirtualAdvertencia.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
@@ -2209,6 +2212,53 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Next
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
'VIRTUAL
|
||||
Dim DtTamanios As New DataTable("DtTamanios")
|
||||
DtTamanios.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
||||
DtTamanios.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
||||
DtTamanios.Columns.Add(New DataColumn("PU", GetType(Decimal)))
|
||||
DtTamanios.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
|
||||
|
||||
If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
|
||||
For Each GvRow As GridViewRow In GvInv.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
For Each Tam As DataRow In ObjAcum.DtResultados.Rows
|
||||
If Tam("CveTamaño").ToString() = GvRow.DataKey("CveTamaño") Then
|
||||
Dim Row As DataRow = DtTamanios.NewRow()
|
||||
|
||||
Row("CvePS") = Tam("CvePSCargo").ToString().ToEntero()
|
||||
Row("Cantidad") = GvRow.FCTextBox("TbCantidadF").Text.ToDecimal()
|
||||
Row("PU") = GvRow.DataKey("PU").ToDecimal()
|
||||
Row("CveUM") = GvRow.DataKey("CveUM").ToEntero()
|
||||
|
||||
DtTamanios.Rows.Add(Row)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If DtTamanios IsNot Nothing AndAlso DtTamanios.Rows.Count > 0 Then
|
||||
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacen.SelectedValue}").ToEntero()
|
||||
|
||||
Dim CveAlmacenVirutal As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirutal, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim)
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtTamanios.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
'DEVENGAR AC
|
||||
|
||||
@@ -1933,7 +1933,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
|
||||
' COMIENZA: VIRTUAL
|
||||
If TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.CveEmpresa = 140 AndAlso TipoMovimiento = 1 Then
|
||||
If TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.CveEmpresa = 140 Then
|
||||
|
||||
Dim DtTamanios As New DataTable("DtTamanios")
|
||||
DtTamanios.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
||||
@@ -1960,26 +1960,31 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Next
|
||||
End If
|
||||
|
||||
Dim CveAlmacenVirutal As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
|
||||
If DtTamanios IsNot Nothing AndAlso DtTamanios.Rows.Count > 0 AndAlso CveAlmacenVirutal > 0 Then
|
||||
If DtTamanios IsNot Nothing AndAlso DtTamanios.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 Then
|
||||
Dim CveConceptoMovimientoVirtual = If(TipoMovimiento = 1, 3, 18) 'CHECA SI ES ENTRADA O DEVOLUCION
|
||||
|
||||
CveAlmacenVirutal = ObjInventario.AddMovimiento(CveAlmacenVirutal, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text)
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text)
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtTamanios.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadEntrada As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
For Each RowUsado As DataRow In DtTamanios.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadEntrada As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadEntrada, CveUM, CvePS, PU, -1) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveAlmacenVirutal, CantidadEntrada, CveUM, CvePS, PU, -1) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
@@ -2460,7 +2465,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
|
||||
'VIRTUAL
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
Msg.AppendFormat("<br/> Movimiento de Salida del Almacen Virtal: Folio : ")
|
||||
Msg.AppendFormat("<br/> Movimiento de Salida del Almacen Virtal: ")
|
||||
Msg.AppendFormat("<b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoVirtual, FolioVirtual)
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user