-
This commit is contained in:
@@ -5,6 +5,7 @@ Imports System.Data
|
||||
Imports System.IO
|
||||
Imports System.Linq
|
||||
Imports CrystalDecisions.[Shared].Json
|
||||
Imports ExcelLibrary.BinaryFileFormat
|
||||
Imports Extensiones
|
||||
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
@@ -2423,12 +2424,17 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim FechaEstimada As String = If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text)
|
||||
Dim NoCajas As Integer = TxtNoCajas.Text.ToEntero()
|
||||
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 CvePaqueteriaGuia As Integer = ObjGeneral.AddPaqueteriasGuias(-1, 9, CveEstatus, CveSubProyecto, Fecha, "-1", "-1", NoCajas, 0.00, "-1", FechaEstimada, Observaciones, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, EsEntregaInterna:=True)
|
||||
|
||||
If CvePaqueteriaGuia > 0 Then
|
||||
|
||||
If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then
|
||||
ErrorMovInv = Not ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimiento, -1)
|
||||
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)
|
||||
@@ -2755,6 +2761,53 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub MandaCorreoEntrega(tCveVenta As Integer)
|
||||
Dim Correo As New ClsSisMail()
|
||||
Dim SerieFolio As String = ""
|
||||
Dim Asunto As String = String.Format("{0} Envio de pedido: {1}", UsuarioActual.Empresa.NombreCorto, SerieFolio)
|
||||
Dim Cuerpo As New StringBuilder()
|
||||
Dim Destinatario As String = ""
|
||||
Dim MensajeEnviado = False
|
||||
Dim tCvecliente As Integer
|
||||
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
|
||||
If (ObjVentas.GetVenta(tCveVenta, UsuarioActual.CveEmpresa)) Then
|
||||
Dim dr As DataRow = ObjVentas.DtResultados.FiltroPrimero("")
|
||||
Destinatario = String.Format("{0};{1}", dr("CorreoNotificacion"), dr("CorreoVendedorVenta"))
|
||||
|
||||
tCvecliente = dr("CveCliente").ToString.ToEntero
|
||||
|
||||
Dim drC As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=tCvecliente).FiltroPrimero("")
|
||||
Destinatario += String.Format("{0};{1}", drC("CorreoEntregaCompras"), drC("CorreoEntregaAlmacen"))
|
||||
|
||||
Cuerpo.AppendLine(String.Format("Estimado {0} le informamos que los productos de la factura {1} han sido enviados a entrega. <br><br>", dr("NombreCliente"), dr("SerieFolio")))
|
||||
Cuerpo.AppendLine("<br><br>Dudas y aclaraciones con su coordinador empresarial.")
|
||||
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
|
||||
' Dim ArchivoAdjunto As New ClsSisMail.ArchivoMail()
|
||||
|
||||
'Dim ListaAdjuntos As New List(ClsSisMail.ArchivoMail)
|
||||
|
||||
|
||||
'If (File.Exists(RutaArchivoAdjunto))Then
|
||||
' {
|
||||
' ArchivoAdjunto.ArchivoBinario = File.ReadAllBytes(RutaArchivoAdjunto);
|
||||
' ArchivoAdjunto.Ruta = RutaArchivoAdjunto;
|
||||
' ArchivoAdjunto.NombreArchivo = new FileInfo(RutaArchivoAdjunto).Name;
|
||||
' ListaAdjuntos.Add(ArchivoAdjunto);
|
||||
' }
|
||||
|
||||
|
||||
MensajeEnviado = Correo.SendMail(UsuarioActual.Empresa, Destinatario, Asunto, Cuerpo.ToString())
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub Limpia()
|
||||
|
||||
'DATOS DE LA VENTA
|
||||
@@ -3051,7 +3104,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If fi.Exists() Then
|
||||
linkDescarga = $"/Empresas/{UsuarioActual.CveEmpresa}/Documentacion/ventas/{fi.Name}"
|
||||
ImgDownLoad.Visible = True
|
||||
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black' ><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga)
|
||||
ImgDownLoad.Text = String.Format(" <a class='btn btn-circle btn-sm blue' href='{0}' target='_black'><i class='fa fa-download' title='Descargar documento'></i></a>", linkDescarga)
|
||||
|
||||
|
||||
End If
|
||||
|
||||
@@ -84,22 +84,6 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
End Property
|
||||
|
||||
|
||||
Private Property DtSeccionAlmacen As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtSeccionAlmacen"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtSeccionAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property IndexSeccionAlmacen As Integer
|
||||
Get
|
||||
Return CType(ViewState("IndexSeccionAlmacen"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("IndexSeccionAlmacen") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CantidadTotal As Decimal
|
||||
Get
|
||||
Return CType(ViewState("CantidadTotal"), Decimal)
|
||||
@@ -174,7 +158,6 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
GvM.DataBind()
|
||||
|
||||
CantidadTotal = 0
|
||||
IndexSeccionAlmacen = 0
|
||||
CvePS = 0
|
||||
TipoSeccionAlmacen = 0
|
||||
|
||||
@@ -379,7 +362,7 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " EISTENCIAS "
|
||||
#Region " EXISTENCIAS "
|
||||
Private Function GetExistencias(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional Serie As String = "-1") As Double
|
||||
Dim Inv As New ClsInventarios
|
||||
Dim Existencia As Double = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, CveEmpresa, CveAlmacen, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Serie)
|
||||
@@ -481,10 +464,10 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
|
||||
Protected Sub GvM_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {e.Row.RowIndex}").SUMD("CantidadSeccionAlmacen") > 0 Then
|
||||
e.Row.FCLinkButton("lnkRemove").Visible = False
|
||||
e.Row.FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen"
|
||||
End If
|
||||
'If DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {e.Row.RowIndex}").SUMD("CantidadSeccionAlmacen") > 0 Then
|
||||
' e.Row.FCLinkButton("lnkRemove").Visible = False
|
||||
' e.Row.FCLinkButton("lnkRemove").ToolTip = "Cuenta con sección almacen"
|
||||
'End If
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
@@ -502,7 +485,6 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
|
||||
DdlAlmacen.SelectedValueExist("-1")
|
||||
DdlAlmacenDestino.SelectedValueExist("-1")
|
||||
DtSeccionAlmacen.Rows.Clear()
|
||||
|
||||
TxtObservaciones.Text = ""
|
||||
TxtFecha.Text = Now.ToShortDateString
|
||||
@@ -595,8 +577,6 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
FechaLiberacion = TxtFechaLiberacion.Text
|
||||
BtnGuardarLiberacion.Visible = True
|
||||
|
||||
DtSeccionAlmacen.Rows.Clear()
|
||||
|
||||
UpGeneralesLibreacion.Update()
|
||||
Else
|
||||
Alert("Ocurrió un error al cargar los resguardos del personal. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
@@ -633,8 +613,6 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
LbFechaLiberacion.Text = ""
|
||||
FechaLiberacion = ""
|
||||
BtnGuardarLiberacion.Visible = False
|
||||
DtSeccionAlmacen.Rows.Clear()
|
||||
|
||||
DdlAlmacenDestinoLiberacion.SelectedValue = "-1"
|
||||
TxtObservacionesLiberacion.Text = ""
|
||||
|
||||
@@ -685,14 +663,6 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
Alert(TextoExistencia.ToString, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
Dim TotalCantidad As Double = DtMovimientos.SUMD("Cantidad")
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) = "1" Then
|
||||
If TotalCantidad <> DtSeccionAlmacen.FiltraParametros("TipoSeccionAlmacen = 1").SUMD("CantidadSeccionAlmacen") Then
|
||||
Alert("La seccion de almacen no ha sido agregada completamente.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Guardar(23)
|
||||
|
||||
End Sub
|
||||
@@ -724,13 +694,6 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) = "1" Then
|
||||
If TotalCantidad <> DtSeccionAlmacen.FiltraParametros("TipoSeccionAlmacen = 2").SUMD("CantidadSeccionAlmacen") Then
|
||||
Alert("La seccion de almacen no ha sido agregada completamente.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Guardar(24)
|
||||
|
||||
|
||||
|
||||
@@ -3260,13 +3260,6 @@
|
||||
<td>
|
||||
<asp:TextBox ID="TxtObsFact" runat="server" Rows="3" TextMode="MultiLine" Width="250px" MaxLength="800" CssClass="form-control input-sm"></asp:TextBox></td>
|
||||
</tr>
|
||||
<tr align="left" id="trCorreoNotif1" runat="server" visible="false">
|
||||
<td id="Td1" runat="server">Correo Notificaciones: </td>
|
||||
</tr>
|
||||
<tr align="left" id="trCorreoNotif2" runat="server" visible="false">
|
||||
<td>
|
||||
<asp:TextBox ID="TxtCorreoNotificaciones" runat="server" Width="100%" CssClass="form-control"></asp:TextBox></td>
|
||||
</tr>
|
||||
<tr id="TrOC" runat="server">
|
||||
<td>Orden de Compra:
|
||||
<asp:TextBox ID="TxtOrdenCompra" runat="server" Width="100%" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
@@ -3294,10 +3287,10 @@
|
||||
<td>Kilometraje
|
||||
<asp:TextBox ID="TxtKilometraje" runat="server" Width="250px" CssClass="form-control input-sm"></asp:TextBox></td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<tr align="left" id="trCorreoNotif1" runat="server" visible="false">
|
||||
<td id="Td1" runat="server">Correo Notificaciones: </td>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<tr align="left" id="trCorreoNotif2" runat="server" visible="false">
|
||||
<td>
|
||||
<asp:TextBox ID="TxtCorreoNotificaciones" runat="server" Width="100%" CssClass="form-control"></asp:TextBox></td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user