-- cambios en secciones, en base su clasificacion del PS

This commit is contained in:
rrene
2020-07-31 16:53:08 -07:00
parent ded346da9b
commit 339d23a9e1
6 changed files with 155 additions and 108 deletions

View File

@@ -7,7 +7,8 @@ Imports System.IO
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports Stimulsoft.Base.Indicator
Partial Class Inventarios_EntregaAlmacen
Inherits ClsPaginas
@@ -886,13 +887,14 @@ Partial Class Inventarios_EntregaAlmacen
If CBool(e.Row.DBCampo("AplicaSeccion")) Then
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = True
If DdlAlmacen.SelectedValue.ToEntero > 0 Then
Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero)
e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt
e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
If dtt.Rows.Count > 1 Then
e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
dtt.Dispose()
CargaSeccionesAlmacen(e.Row.FCDropDownList("DdlSeccionAlmacen"), DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero, UsuarioActual.CveEmpresa, True)
'Dim dtt As DataTable = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, e.Row.DBCampo("CvePS").ToEntero)
'e.Row.FCDropDownList("DdlSeccionAlmacen").DataSource = dtt
'e.Row.FCDropDownList("DdlSeccionAlmacen").DataBind()
'If dtt.Rows.Count > 1 Then
' e.Row.FCDropDownList("DdlSeccionAlmacen").Items.Insert(0, New ListItem("Seleccione", "-1"))
'End If
'dtt.Dispose()
End If
Else
@@ -2009,6 +2011,7 @@ Partial Class Inventarios_EntregaAlmacen
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"), Serie:=Dr1("Serie").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
Dim CveSeccionAlmacen As Integer = 0
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
@@ -2038,8 +2041,14 @@ Partial Class Inventarios_EntregaAlmacen
CantidadPendiente = 1
If CBool(Dr("AplicaSeccion")) Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr2("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr2("CveAlmacen"), Dr("CvePS"), CveSeccionAlmacen)
Else
CveSeccionAlmacen = -1
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un Error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
@@ -2469,7 +2478,7 @@ Partial Class Inventarios_EntregaAlmacen
Dim CveMovimientoSalidaApartado = -1
Dim CveAlmacenApartado = -1
Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero)
Dim CveSeccionAlmacen As Integer = 0
For Each Dr As DataRow In DtTempApartados.Rows
If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString.ToEntero Then
@@ -2491,9 +2500,14 @@ Partial Class Inventarios_EntregaAlmacen
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For
End If
If CBool(Dr("AplicaSeccion")) Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigen, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", CveAlmacenOrigen, Dr("CvePS"), CveSeccionAlmacen)
Else
CveSeccionAlmacen = -1
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, 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, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, 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, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For
@@ -2520,8 +2534,15 @@ Partial Class Inventarios_EntregaAlmacen
Dr1("FolioEntrada") = FolioEntrada
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, 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, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If CBool(Dr("AplicaSeccion")) Then
CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS"), CveSeccionAlmacen)
Else
CveSeccionAlmacen = -1
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, 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, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.")
Exit For
@@ -3212,71 +3233,75 @@ Partial Class Inventarios_EntregaAlmacen
tCvecliente = dr("CveCliente").ToString.ToEntero
Dim drC As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=tCvecliente).FiltroPrimero("")
Destinatario += String.Format(";{0};{1}", drC("CorreoEntregaCompras"), drC("CorreoEntregaAlmacen"))
If drC IsNot Nothing Then
Dim ClienteNombre As String = dr("ClienteNombre").ToString()
Dim FolioVenta As String = dr("SerieFolio").ToString()
Dim Pedido As String = dr("PedidoContrato").ToString()
Dim OrdenCompra As String = dr("OrdenCompra").ToString()
Dim CveVenta As Integer = dr("CveVenta").ToString().ToEntero()
Dim TipoDocto As String = dr("TipoDocto").ToString()
Destinatario += String.Format(";{0};{1}", drC("CorreoEntregaCompras"), drC("CorreoEntregaAlmacen"))
Dim dtDetalle As New DataTable
If ObjVentas.GetVentaDetalle(CveVenta) Then
dtDetalle = ObjVentas.DtResultados
Dim ClienteNombre As String = dr("ClienteNombre").ToString()
Dim FolioVenta As String = dr("SerieFolio").ToString()
Dim Pedido As String = dr("PedidoContrato").ToString()
Dim OrdenCompra As String = dr("OrdenCompra").ToString()
Dim CveVenta As Integer = dr("CveVenta").ToString().ToEntero()
Dim TipoDocto As String = dr("TipoDocto").ToString()
Dim dtDetalle As New DataTable
If ObjVentas.GetVentaDetalle(CveVenta) Then
dtDetalle = ObjVentas.DtResultados
End If
Dim DetalleTable As String = ""
For Each dRow As DataRow In dtDetalle.Rows
Dim detalle As String = String.Format("<tr><td style='width:25%'>{0}</td><td style='width:25%'>{1}</td><td style='width:50%'>{2}</td></tr>", dRow("Codigo"), dRow("Cantidad"), dRow("PS"))
DetalleTable += detalle
Next
strBody.Append("<html>")
strBody.Append("<head>")
strBody.Append("<meta charset='UTF-8'>")
strBody.Append("</head>")
strBody.Append(" <body style='width:800px'>")
strBody.Append("<div>")
strBody.Append($"<img src='http://sig.adssistemas.mx/Empresas/{UsuarioActual.CveEmpresa}/Logo.png' style='width:200px'></img>")
strBody.Append("</div>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%'>")
strBody.Append($" Apreciable {ClienteNombre}, le confirmamos los")
strBody.Append(" productos surtidos y entregados en mostrador conforme a la")
strBody.Append($" {TipoDocto}:")
strBody.Append(" </p>")
strBody.Append($" <p style='width:100%;text-align:center;font-family:Segoe UI Semibold;font-size:12pt'>{FolioVenta} - Pedido {Pedido} - Orden de Compra {OrdenCompra}</P>")
strBody.Append(" <div style='width:100%;text-align:center'>")
strBody.Append(" <table style='width:100%;font-family:Segoe UI Semibold;font-size:12pt'>")
strBody.Append(DetalleTable)
strBody.Append(" ")
strBody.Append(" </table>")
strBody.Append(" </div>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%'>")
strBody.Append(" Se entregaron los productos conforme a las especificaciones de su pedido y verificamos que no se presentara alguno de los siguientes inconvenientes:")
strBody.Append(" </p>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%'>")
strBody.Append(" • Empaque violado.<br/>")
strBody.Append("• Daño físico en la caja.<br/>")
strBody.Append("• Producto incompleto o distinto al solicitado.<br/>")
strBody.Append("• Alguna otra situación que se considere que compromete la integridad de la mercancía.<br/>")
strBody.Append("")
strBody.Append(" </p>")
strBody.Append(" <br/>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%'>")
strBody.Append($" Aceptando a entera satisfacción a las {Today.Hour}:{Today.Minute} hrs del {Today.ToString}")
strBody.Append(" </p>")
strBody.Append(" <br/>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%'>")
strBody.Append(" Gracias por su compra <br/>")
'strBody.Append(" Compuproveedores")
strBody.Append(" </p>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%;text-align:center'>")
strBody.Append(" Sigue disfrutando de nuestros productos y servicios<br/>")
'strBody.Append(" <a href='https://www.compuproveedoresti.com/'>www.compuproveedores.com</a>")
strBody.Append("")
strBody.Append(" </p>")
strBody.Append(" </body>")
strBody.Append("</html>")
End If
Dim DetalleTable As String = ""
For Each dRow As DataRow In dtDetalle.Rows
Dim detalle As String = String.Format("<tr><td style='width:25%'>{0}</td><td style='width:25%'>{1}</td><td style='width:50%'>{2}</td></tr>", dRow("Codigo"), dRow("Cantidad"), dRow("PS"))
DetalleTable += detalle
Next
strBody.Append("<html>")
strBody.Append("<head>")
strBody.Append("<meta charset='UTF-8'>")
strBody.Append("</head>")
strBody.Append(" <body style='width:800px'>")
strBody.Append("<div>")
strBody.Append($"<img src='http://sig.adssistemas.mx/Empresas/{UsuarioActual.CveEmpresa}/Logo.png' style='width:200px'></img>")
strBody.Append("</div>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%'>")
strBody.Append($" Apreciable {ClienteNombre}, le confirmamos los")
strBody.Append(" productos surtidos y entregados en mostrador conforme a la")
strBody.Append($" {TipoDocto}:")
strBody.Append(" </p>")
strBody.Append($" <p style='width:100%;text-align:center;font-family:Segoe UI Semibold;font-size:12pt'>{FolioVenta} - Pedido {Pedido} - Orden de Compra {OrdenCompra}</P>")
strBody.Append(" <div style='width:100%;text-align:center'>")
strBody.Append(" <table style='width:100%;font-family:Segoe UI Semibold;font-size:12pt'>")
strBody.Append(DetalleTable)
strBody.Append(" ")
strBody.Append(" </table>")
strBody.Append(" </div>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%'>")
strBody.Append(" Se entregaron los productos conforme a las especificaciones de su pedido y verificamos que no se presentara alguno de los siguientes inconvenientes:")
strBody.Append(" </p>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%'>")
strBody.Append(" • Empaque violado.<br/>")
strBody.Append("• Daño físico en la caja.<br/>")
strBody.Append("• Producto incompleto o distinto al solicitado.<br/>")
strBody.Append("• Alguna otra situación que se considere que compromete la integridad de la mercancía.<br/>")
strBody.Append("")
strBody.Append(" </p>")
strBody.Append(" <br/>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%'>")
strBody.Append($" Aceptando a entera satisfacción a las {Today.Hour}:{Today.Minute} hrs del {Today.ToString}")
strBody.Append(" </p>")
strBody.Append(" <br/>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%'>")
strBody.Append(" Gracias por su compra <br/>")
'strBody.Append(" Compuproveedores")
strBody.Append(" </p>")
strBody.Append(" <p style='font-family:Segoe UI Semibold;font-size:12pt;width:100%;text-align:center'>")
strBody.Append(" Sigue disfrutando de nuestros productos y servicios<br/>")
'strBody.Append(" <a href='https://www.compuproveedoresti.com/'>www.compuproveedores.com</a>")
strBody.Append("")
strBody.Append(" </p>")
strBody.Append(" </body>")
strBody.Append("</html>")
End If
ObjVentas.Dispose()