-
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
public partial class General_PopUpPaqueteriasGuias : ClsPaginas
|
||||
{
|
||||
@@ -255,7 +256,7 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
|
||||
protected void CargaPaqueterias()
|
||||
{
|
||||
DdlPaqueterias.Items.Clear();
|
||||
DdlPaqueterias.DataSource = GlobalDTPaqueterias;
|
||||
DdlPaqueterias.DataSource = get_GlobalDTPaqueterias(UsuarioActual.CveEmpresa);
|
||||
DdlPaqueterias.DataBind();
|
||||
DdlPaqueterias.Items.Insert(0, new ListItem("Seleccione ", "-1"));
|
||||
UPGuiasPorVincular.Update();
|
||||
@@ -729,6 +730,38 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
|
||||
}
|
||||
}
|
||||
|
||||
private byte[] DocumentoEntregaInterna()
|
||||
{
|
||||
ClsVentas ObjVentas = new ClsVentas();
|
||||
if (ObjVentas.GetVenta(this.CveVenta, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
string ClienteNombre = ObjVentas.DtResultados.Rows[0]["ClienteNombre"].ToString();
|
||||
string FolioVenta = ObjVentas.DtResultados.Rows[0]["SerieFolio"].ToString();
|
||||
string Pedido = ObjVentas.DtResultados.Rows[0]["PedidoContrato"].ToString();
|
||||
string OrdenCompra = ObjVentas.DtResultados.Rows[0]["OrdenCompra"].ToString();
|
||||
string Guia = TxtGuia.Text;
|
||||
string Rastreo = TxtRastreo.Text;
|
||||
string Paqueteria = DdlPaqueterias.SelectedItem.Text;
|
||||
DataTable DtDetalle = new DataTable();
|
||||
if (ObjVentas.GetVentaDetalle(CveVenta))
|
||||
{
|
||||
DtDetalle = ObjVentas.DtResultados;
|
||||
}
|
||||
|
||||
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));
|
||||
RepParams.Add(new ReportParameter("Guia", Guia));
|
||||
RepParams.Add(new ReportParameter("Rastreo", Rastreo));
|
||||
RepParams.Add(new ReportParameter("Paqueteria", Paqueteria));
|
||||
return StreamPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/GuiaExternaAsignada.rdlc", DtDetalle, RepParams, "Notificacion de Envio", "PDF", RDSName: "DsInventarios");
|
||||
}
|
||||
ObjVentas.Dispose();
|
||||
return null;
|
||||
}
|
||||
|
||||
private string getCorreoString()
|
||||
{
|
||||
ClsVentas ObjVentas = new ClsVentas();
|
||||
@@ -739,7 +772,13 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
|
||||
DataRow Vendedor = get_GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveVendedor = {0}",CveVendedor));
|
||||
DataRow Cliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveCliente = {0}",CveCliente));
|
||||
|
||||
string CorreosConcat = "{0};{1};{2};{3};{4}";
|
||||
string CobranzaCorreo = Cliente["CobranzaCorreo"].ToString();
|
||||
string CorreoEntregaAlmacen = Cliente["CorreoEntregaAlmacen"].ToString();
|
||||
string CorreoEntregaCompras = Cliente["CorreoEntregaCompras"].ToString();
|
||||
string CorreoVendedor = Vendedor["Correo"].ToString();
|
||||
string CorreoAdicionalNotificacionesVendedor = Vendedor["CorreoAdicionalNotificaciones"].ToString();
|
||||
|
||||
string CorreosConcat = String.Format("{0};{1};{2};{3};{4}", CobranzaCorreo, CorreoEntregaAlmacen, CorreoEntregaCompras, CorreoVendedor, CorreoAdicionalNotificacionesVendedor);
|
||||
return CorreosConcat;
|
||||
}
|
||||
ObjVentas.Dispose();
|
||||
@@ -750,8 +789,19 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
|
||||
{
|
||||
Correos.GuardaLog();
|
||||
|
||||
byte[] ArchivoBinario = DocumentoEntregaInterna();
|
||||
|
||||
ClsSisMail MailCls = new ClsSisMail();
|
||||
MailCls.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, "Se enviara la compra a su dirección", "Pendiente", Correos);
|
||||
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, Correos, "Se enviara la compra a su dirección", "Pendiente", Correos, LSRutasMail);
|
||||
MailCls = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -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
|
||||
@@ -3638,7 +3642,7 @@ 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($"AbrirVentana('/General/PopUpPaqueteriasGuiasInternas.aspx?CveVenta={CveVentaSurtir}&CveSubProyecto={CveSubProyecto}',800,547,'N')")
|
||||
@@ -3658,7 +3662,7 @@ 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')")
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user