EntradasSalidas carga nuevas columnas del excel, entrega almacen valida el sub proyecto al agregar una paquetería interna

This commit is contained in:
Antonio Gonzalez
2020-06-09 19:28:14 -07:00
parent e173c88cee
commit 79cadfdbb6
2 changed files with 55 additions and 22 deletions

View File

@@ -270,6 +270,15 @@ Partial Class Inventarios_EntradasSalidas
End Set
End Property
Public Property FechaCaducidadAux() As String
Get
Return ViewState("FechaCaducidadAux").ToString
End Get
Set(value As String)
ViewState("FechaCaducidadAux") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -343,6 +352,7 @@ Partial Class Inventarios_EntradasSalidas
If CveMovimiento > 0 Then
PermisoVerImportes()
End If
FechaCaducidadAux = MinFecha.ToString
End If
End Sub
@@ -1154,7 +1164,9 @@ Partial Class Inventarios_EntradasSalidas
Exit Sub
End If
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedText, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDouble, txtPrecio.Text.ToDouble, TxtnSerie.Text.Replace(" ", String.Empty), LblCodigo.Text, HdnCodigoAF.Value, HdnCveActivoFijo.Value, TxtObservacionesdetalle.Text, TxtnLote.Text.Trim, MinFecha, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text)
AddNew(DdlProducto2.SelectedValue.ToEntero, DdlProducto2.SelectedText, DdlUnidad.SelectedValue.ToEntero, DdlUnidad.SelectedItem.Text, txtCantidad.Text.ToDouble,
txtPrecio.Text.ToDouble, TxtnSerie.Text.Replace(" ", String.Empty), LblCodigo.Text, HdnCodigoAF.Value, HdnCveActivoFijo.Value, TxtObservacionesdetalle.Text,
TxtnLote.Text.Trim, FechaCaducidadAux.ToDate, DdlSeccionAlmacen.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedItem.Text)
LimpiarAgregar()
txtCantidad.Text = ""
@@ -3916,7 +3928,7 @@ Partial Class Inventarios_EntradasSalidas
End If
dt.TableName = "Datos"
Dim DTSeccionesAlmacen As DataTable = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1)
If Not ErrorArchivo Then
NumRow = 0
Dim RowNoEncontrados As String = ""
@@ -3928,12 +3940,21 @@ Partial Class Inventarios_EntradasSalidas
'Dim CodigoBarras As String = Row("Codigo Barras").ToString.Trim.ToUpper
Dim ProductoServicio As String = Row("Producto/Servicio").ToString.Trim.ToUpper
Dim PrecioUnitario As Decimal = Row("Precio Unitario").ToString.ToDecimal
Dim Serie As String = Row("Serie").ToString
Dim Lote As String = Row("Lote").ToString
Dim Caducidad As String = Row("Caducidad").ToString
Dim SeccionAlmacen As String = Row("SeccionAlmacen").ToString
Dim CvePS As Integer = 0
Dim CveUM As Integer = 0
NumRow = NumRow + 1
Dim CveSeccionAlmacen As Integer = -1
If SeccionAlmacen <> "" Then
CveSeccionAlmacen = DTSeccionesAlmacen.FiltroPrimeroValor("CveSeccion", String.Format("SeccionAlmacen = '{0}'", SeccionAlmacen)).ToEntero
End If
If Codigo <> "" Then
Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c)
If StrArray.Length > 0 Then
@@ -3974,10 +3995,16 @@ Partial Class Inventarios_EntradasSalidas
txtPrecio.Text = PrecioUnitario.ToString
ElProductoChange()
TxtnSerie.Text = Serie
TxtnLote.Text = Lote
DdlSeccionAlmacen.SelectedValue = CveSeccionAlmacen.ToString
FechaCaducidadAux = If(Caducidad = "", MinFecha.ToString, Caducidad)
AgregarPS()
txtPrecio.Text = ""
DdlUnidad.SelectedItem.Text = ""
TxtnSerie.Text = ""
TxtnLote.Text = ""
DdlSeccionAlmacen.SelectedValue = "-1"
NumAgregados = NumAgregados + 1
End If
@@ -4017,7 +4044,8 @@ Partial Class Inventarios_EntradasSalidas
Private Function GetPS(Opt As String, Valor As String) As String
Dim StrReturn As String = String.Empty
Dim CvePS As Integer = 0
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", Opt & " = '" & Valor & "'").ToString.ToEntero
Dim Condicion As String = String.Format("{0} = '{1}'", Opt, Valor)
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", Condicion).ToString.ToEntero
If CvePS > 0 Then
StrReturn = "True|" & CvePS.ToString
Else

View File

@@ -2423,24 +2423,29 @@ Partial Class Inventarios_EntregaAlmacen
Dim Observaciones As String = TxtObservacionesPaqInterna.Text
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, "", "", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EsEntregaInterna:=True)
If CvePaqueteriaGuia > 0 Then
If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then
If ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimiento, -1) Then
''manda correo
MandaCorreoEntrega(CveVentaSurtir)
Else
ErrorMovInv = True
End If
End If
If ErrorMovInv Then
Alert("Error en el paqueteria guia detalle", TipoMensaje.MsgError)
End If
Else
ErrorMovInv = True
Alert("Error en el paqueteria guia", TipoMensaje.MsgError)
If CveSubProyecto > 0 Then
Dim CvePaqueteriaGuia As Integer = ObjGeneral.AddPaqueteriasGuias(CvePaqueteria, 9, CveEstatus, CveSubProyecto, Fecha, "", "", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EsEntregaInterna:=True)
If CvePaqueteriaGuia > 0 Then
If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then
If ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimiento, -1) Then
''manda correo
MandaCorreoEntrega(CveVentaSurtir)
Else
ErrorMovInv = True
End If
End If
If ErrorMovInv Then
Alert("Error en el paqueteria guia detalle", TipoMensaje.MsgError)
End If
Else
ErrorMovInv = True
Alert("Error en el paqueteria guia", TipoMensaje.MsgError)
End If
Else
Alert("Hace falta indicar un Sub Proyecto", TipoMensaje.MsgAdvertencia)
ErrorMovInv = True
End If
End If