-actualizacion
This commit is contained in:
@@ -625,9 +625,13 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then
|
||||
FormaPaqueteria = DtDatos.Rows(0)("FormaPaqueteria").ToString.ToEntero
|
||||
Dim FormaPaq As Integer = FormaPaqueteria
|
||||
RbSinEntrega.Checked = False
|
||||
RbEntregaInterna.Checked = False
|
||||
RbEntregaExterna.Checked = False
|
||||
Select Case FormaPaq
|
||||
Case 1
|
||||
RbSinEntrega.Checked = True
|
||||
LnkPaqueteriaDetalle.Visible = False
|
||||
Case 2
|
||||
RbEntregaInterna.Checked = True
|
||||
LnkPaqueteriaDetalle.Visible = True
|
||||
@@ -2647,12 +2651,12 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
'Paqueterias guias
|
||||
If RbEntregaInterna.Checked AndAlso Not ErrorMovInv Then
|
||||
Dim CveEstatus As Integer = DdlEstatus.SelectedValue.ToEntero()
|
||||
Dim Fecha As String = TxtFechaPaqInterna.Text
|
||||
Dim FechaEstimada As String = If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text)
|
||||
Dim NoCajas As Integer = TxtNoCajas.Text.ToEntero()
|
||||
Dim Observaciones As String = TxtObservacionesPaqInterna.Text
|
||||
If RbEntregaInterna.Checked AndAlso Not ErrorMovInv Then
|
||||
Dim CveEstatus As Integer = 0 ' DdlEstatus.SelectedValue.ToEntero()
|
||||
Dim Fecha As String = "-1" 'TxtFechaPaqInterna.Text
|
||||
Dim FechaEstimada As String = "-1" 'If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text)
|
||||
Dim NoCajas As Integer = 0 'TxtNoCajas.Text.ToEntero()
|
||||
Dim Observaciones As String = "" 'TxtObservacionesPaqInterna.Text
|
||||
Dim CvePaqueteria As Integer = GlobalDTPaqueterias(UsuarioActual.CveEmpresa, 0).FiltroPrimeroValor("CvePaqueteria", "").ToEntero
|
||||
|
||||
If CveSubProyecto > 0 Then
|
||||
@@ -2661,7 +2665,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
If CvePaqueteriaGuia > 0 Then
|
||||
|
||||
If CveVentaSurtir > 0 OrElse CveSubProyecto > 0 Then
|
||||
If ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimiento, -1) Then
|
||||
If ObjGeneral.AddPaqueteriasGuiasDetalles(CvePaqueteriaGuia, CveVentaSurtir, -1, CveMovimientoSalida, -1) Then
|
||||
''manda correo
|
||||
MandaCorreoEntrega(CveVentaSurtir)
|
||||
Else
|
||||
@@ -2678,7 +2682,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Else
|
||||
Alert("Hace falta indicar un Sub Proyecto", TipoMensaje.MsgAdvertencia)
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
ElseIf RbSinEntrega.Checked AndAlso Not ErrorMovInv Then
|
||||
MandaCorreoEntrega(CveVentaSurtir)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ErrorMovInv = True
|
||||
@@ -3117,12 +3123,12 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End If
|
||||
|
||||
'Paqueterias Guias
|
||||
If RbEntregaInterna.Checked AndAlso Not ErrorMovInv Then
|
||||
Dim CveEstatus As Integer = DdlEstatus.SelectedValue.ToEntero()
|
||||
Dim Fecha As String = TxtFechaPaqInterna.Text
|
||||
Dim FechaEstimada As String = If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text)
|
||||
Dim NoCajas As Integer = TxtNoCajas.Text.ToEntero()
|
||||
Dim Observaciones As String = TxtObservacionesPaqInterna.Text
|
||||
If RbEntregaInterna.Checked AndAlso Not ErrorMovInv Then
|
||||
Dim CveEstatus As Integer = 0 ' DdlEstatus.SelectedValue.ToEntero()
|
||||
Dim Fecha As String = "-1" 'TxtFechaPaqInterna.Text
|
||||
Dim FechaEstimada As String = "-1" 'If(TxtFechaEstimada.Text = "", "-1", TxtFechaEstimada.Text)
|
||||
Dim NoCajas As Integer = 0 'TxtNoCajas.Text.ToEntero()
|
||||
Dim Observaciones As String = "" 'TxtObservacionesPaqInterna.Text
|
||||
Dim CvePaqueteria As Integer = GlobalDTPaqueterias(UsuarioActual.CveEmpresa, 0).FiltroPrimeroValor("CvePaqueteria", "").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)
|
||||
@@ -3174,6 +3180,10 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
|
||||
Private Sub MandaCorreoEntrega(tCveVenta As Integer)
|
||||
EnviarCorreoEntrega(tCveVenta, UsuarioActual)
|
||||
End Sub
|
||||
|
||||
Private Sub EnviarCorreoEntrega(tCveVenta As Integer, UsuarioActual As Usuario)
|
||||
Dim Correo As New ClsSisMail()
|
||||
Dim SerieFolio As String = ""
|
||||
Dim Asunto As String = String.Format("{0} Envio de pedido: {1}", UsuarioActual.Empresa.NombreCorto, SerieFolio)
|
||||
@@ -3181,44 +3191,49 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Dim Destinatario As String = ""
|
||||
Dim MensajeEnviado = False
|
||||
Dim tCvecliente As Integer
|
||||
Dim bytes() As Byte = Nothing
|
||||
Using 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("ClienteNombre"), dr("SerieFolio")))
|
||||
Cuerpo.AppendLine("<br><br>Dudas y aclaraciones con su coordinador empresarial.")
|
||||
|
||||
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 dtDetalle As New DataTable
|
||||
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
||||
dtDetalle = ObjVentas.DtResultados
|
||||
End If
|
||||
|
||||
Dim RepParams As New List(Of ReportParameter)
|
||||
RepParams.Add(New ReportParameter("Cliente", ClienteNombre))
|
||||
RepParams.Add(New ReportParameter("FolioVenta", FolioVenta))
|
||||
RepParams.Add(New ReportParameter("Pedido", Pedido))
|
||||
RepParams.Add(New ReportParameter("OrdenCompra", OrdenCompra))
|
||||
bytes = StreamPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/GuiaEntregaMostrador.rdlc", dtDetalle, RepParams, "Notificacion de Envio", "PDF", RDSName:="DsInventarios")
|
||||
End If
|
||||
End Using
|
||||
|
||||
|
||||
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("ClienteNombre"), 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())
|
||||
|
||||
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
Dim itemMail As New ClsSisMail.ArchivoMail()
|
||||
|
||||
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = bytes, .NombreArchivo = "Notificacion de Envio"})
|
||||
|
||||
MensajeEnviado = Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Destinatario, Asunto, Cuerpo.ToString(), Destinatario, Archivos:=LSRutasMail)
|
||||
End Sub
|
||||
|
||||
Private Sub Limpia()
|
||||
|
||||
'DATOS DE LA VENTA
|
||||
@@ -3638,9 +3653,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
|
||||
Protected Sub EntregaRadioGroup_Click(sender As Object, e As EventArgs)
|
||||
If RbEntregaExterna.Checked Then
|
||||
RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')")
|
||||
RegistraScript($"AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveVenta={CveVentaSurtir}',800,547,'N')")
|
||||
ElseIf RbEntregaInterna.Checked Then
|
||||
RegistraScript("$('#ModalPaqueteriaInterna').modal('show')")
|
||||
'RegistraScript("$('#ModalPaqueteriaInterna').modal('show')")
|
||||
'RegistraScript($"AbrirVentana('/General/PopUpPaqueteriasGuiasInternas.aspx?CveVenta={CveVentaSurtir}&CveSubProyecto={CveSubProyecto}',800,547,'N')")
|
||||
'CveVentaSurtir
|
||||
ElseIf RbSinEntrega.Checked Then
|
||||
@@ -3658,9 +3673,9 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
End Sub
|
||||
Protected Sub PaqueteriaDetalle_Click(sender As Object, e As EventArgs)
|
||||
If RbEntregaExterna.Checked Then
|
||||
RegistraScript("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx',800,547,'N')")
|
||||
RegistraScript($"AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveVenta={CveVentaSurtir}',800,547,'N')")
|
||||
ElseIf RbEntregaInterna.Checked Then
|
||||
RegistraScript("$('#ModalPaqueteriaInterna').modal('show')")
|
||||
'RegistraScript("$('#ModalPaqueteriaInterna').modal('show')")
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<asp:GridView ID="GvPaqueteriasGuias" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CvePaqueteriaGuia,Folio,FechaIng,Nombre,Contacto,Estatus,CobranzaCorreo,CorreoEntregaAlmacen,CorreoEntregaCompras,Correo,CorreoAdicionalNotificaciones"
|
||||
DataKeyNames="CvePaqueteriaGuia,Folio,SerieFolio,FechaIng,Nombre,Contacto,Estatus,CobranzaCorreo,CorreoEntregaAlmacen,CorreoEntregaCompras,Correo,CorreoAdicionalNotificaciones,CveVenta,PedidoContrato,OrdenCompra,NombreComercial"
|
||||
EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true"
|
||||
|
||||
@@ -44,19 +44,28 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas
|
||||
TieneError = true;
|
||||
}else
|
||||
{
|
||||
string CobranzaCorreo = row.DataKey("CobranzaCorreo");
|
||||
string CorreoEntregaAlmacen = row.DataKey("CorreoEntregaAlmacen");
|
||||
string CorreoEntregaCompras = row.DataKey("CorreoEntregaCompras");
|
||||
string CorreoVendedor = row.DataKey("Correo");
|
||||
string CorreoAdicionalNotificacionesVendedor = row.DataKey("CorreoAdicionalNotificaciones");
|
||||
try
|
||||
{
|
||||
MandarNotificacionCorreo(row);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TieneError = true;
|
||||
ModExtensiones.GuardaLog(ex.Message);
|
||||
}
|
||||
//string CobranzaCorreo = row.DataKey("CobranzaCorreo");
|
||||
//string CorreoEntregaAlmacen = row.DataKey("CorreoEntregaAlmacen");
|
||||
//string CorreoEntregaCompras = row.DataKey("CorreoEntregaCompras");
|
||||
//string CorreoVendedor = row.DataKey("Correo");
|
||||
//string CorreoAdicionalNotificacionesVendedor = row.DataKey("CorreoAdicionalNotificaciones");
|
||||
|
||||
string CorreosCC = string.Format("{0};{1};{2};{3}", CorreoVendedor, CorreoAdicionalNotificacionesVendedor, CobranzaCorreo, CorreoEntregaCompras);
|
||||
string LogCorreo = string.Format("{0} -- {1} --- {2}", "Tipo de entrega", CorreoEntregaAlmacen, CorreosCC);
|
||||
LogCorreo.GuardaLog();
|
||||
//string CorreosCC = string.Format("{0};{1};{2};{3}", CorreoVendedor, CorreoAdicionalNotificacionesVendedor, CobranzaCorreo, CorreoEntregaCompras);
|
||||
//string LogCorreo = string.Format("{0} -- {1} --- {2}", "Tipo de entrega", CorreoEntregaAlmacen, CorreosCC);
|
||||
//LogCorreo.GuardaLog();
|
||||
|
||||
ClsSisMail MailCls = new ClsSisMail();
|
||||
MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoVendedor, "Se enviara la compra a su dirección", "Pendiente", CorreosCC);
|
||||
MailCls = null;
|
||||
//ClsSisMail MailCls = new ClsSisMail();
|
||||
//MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoVendedor, "Se enviara la compra a su dirección", "Pendiente", CorreosCC);
|
||||
//MailCls = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,5 +108,68 @@ public partial class Inventarios_EntregasPorRealizar : ClsPaginas
|
||||
DdlUsuario.DataBind();
|
||||
DdlUsuario.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
}
|
||||
|
||||
|
||||
protected void LnkImprimir_Click(object sender, EventArgs e)
|
||||
{
|
||||
List<ReportParameter> RepParams = new List<ReportParameter>();
|
||||
string Usuario = DdlUsuario.SelectedValue.ToEntero() > 0 ? DdlUsuario.SelectedItem.Text : "Todos";
|
||||
RepParams.Add(new ReportParameter("Fecha", DateTime.Today.ToString()));
|
||||
RepParams.Add(new ReportParameter("AsignadoA", Usuario));
|
||||
RepParams.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
|
||||
|
||||
ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/EntregasPorRealizar.rdlc", DtPaqueteriasGuias, RepParams, "Entregas por realizar", "PDF",RDSName:"DsInventarios");
|
||||
}
|
||||
|
||||
private byte[] DocumentoEntregaInterna(GridViewRow row)
|
||||
{
|
||||
string ClienteNombre = row.DataKey("NombreComercial");
|
||||
string FolioVenta = row.DataKey("SerieFolio");
|
||||
string Pedido = row.DataKey("PedidoContrato");
|
||||
string OrdenCompra = row.DataKey("OrdenCompra");
|
||||
int CveVenta = row.DataKey("CveVenta").ToEntero();
|
||||
|
||||
DataTable DtDetalle = new DataTable();
|
||||
ClsVentas ObjVentas = new ClsVentas();
|
||||
if (ObjVentas.GetVentaDetalle(CveVenta))
|
||||
{
|
||||
DtDetalle = ObjVentas.DtResultados;
|
||||
}
|
||||
ObjVentas.Dispose();
|
||||
|
||||
List<ReportParameter> RepParams = new List<ReportParameter>();
|
||||
RepParams.Add(new ReportParameter("Cliente", ClienteNombre));
|
||||
RepParams.Add(new ReportParameter("FolioVenta", FolioVenta));
|
||||
RepParams.Add(new ReportParameter("Pedido", Pedido));
|
||||
RepParams.Add(new ReportParameter("OrdenCompra", OrdenCompra));
|
||||
return StreamPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/GuiaInternaAsignada.rdlc", DtDetalle, RepParams, "Notificacion de Envio", "PDF", RDSName: "DsInventarios");
|
||||
}
|
||||
|
||||
private void MandarNotificacionCorreo(GridViewRow row)
|
||||
{
|
||||
string CobranzaCorreo = row.DataKey("CobranzaCorreo");
|
||||
string CorreoEntregaAlmacen = row.DataKey("CorreoEntregaAlmacen");
|
||||
string CorreoEntregaCompras = row.DataKey("CorreoEntregaCompras");
|
||||
string CorreoVendedor = row.DataKey("Correo");
|
||||
string CorreoAdicionalNotificacionesVendedor = row.DataKey("CorreoAdicionalNotificaciones");
|
||||
|
||||
string Para = string.Format("{0};{1};{2};{3}", CorreoVendedor, CorreoAdicionalNotificacionesVendedor, CobranzaCorreo, CorreoEntregaCompras);
|
||||
string LogCorreo = string.Format("{0} -- {1} --- {2}", "Tipo de entrega", CorreoEntregaAlmacen, Para);
|
||||
LogCorreo.GuardaLog();
|
||||
|
||||
byte[] ArchivoBinario = DocumentoEntregaInterna(row);
|
||||
|
||||
ClsSisMail MailCls = new ClsSisMail();
|
||||
List<ClsSisMail.ArchivoMail> LSRutasMail = new List<ClsSisMail.ArchivoMail>();
|
||||
ClsSisMail.ArchivoMail itemMail = new ClsSisMail.ArchivoMail();
|
||||
|
||||
{
|
||||
var withBlock = itemMail;
|
||||
itemMail.ArchivoBinario = ArchivoBinario;
|
||||
itemMail.NombreArchivo = "Notificacion de Envio";
|
||||
}
|
||||
|
||||
LSRutasMail.Add(itemMail);
|
||||
MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, Para, "Entrega en camino", "Pendiente", Para, LSRutasMail);
|
||||
MailCls = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user