diff --git a/AC/RepEstadoActividades.aspx.vb b/AC/RepEstadoActividades.aspx.vb index f26d16383..79d17e979 100644 --- a/AC/RepEstadoActividades.aspx.vb +++ b/AC/RepEstadoActividades.aspx.vb @@ -330,8 +330,8 @@ Partial Class AC_RepEstadoActividades params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri)) If (UsuarioActual.CveEmpresa = 48 And ChkFirma.Checked) Then - params.Add(New ReportParameter("pFirma1", String.Format("Lic. Damian A. Benitez Alcantar{0}Director Administrativo", vbCrLf))) - params.Add(New ReportParameter("pFirma2", String.Format("Ing. Soraida Mesinas Reyes{0}Director General", vbCrLf))) + params.Add(New ReportParameter("pFirma1", String.Format("Ing. Héctor Díaz Young{0}Dirección Administrativa", vbCrLf))) + params.Add(New ReportParameter("pFirma2", String.Format("M.E.R Carla Neudert Cordova{0}Dirección General", vbCrLf))) ElseIf (UsuarioActual.CveEmpresa = 120 And ChkFirma.Checked) Then params.Add(New ReportParameter("pFirma1", String.Format("C.P.NEFTALI PEÑA MIRANDA{0}Subdirector de Contabilidad", vbCrLf))) params.Add(New ReportParameter("pFirma2", String.Format("Dra. María Antonieta Laso López{0}Director General", vbCrLf))) diff --git a/AC/RepSituacionFinanciera.aspx.vb b/AC/RepSituacionFinanciera.aspx.vb index 57265aeff..75a53e925 100644 --- a/AC/RepSituacionFinanciera.aspx.vb +++ b/AC/RepSituacionFinanciera.aspx.vb @@ -639,9 +639,10 @@ Partial Class AC_SituacionFinanciera params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("CveEmpresa", UsuarioActual.CveEmpresa.ToString)) params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri)) + If (UsuarioActual.CveEmpresa = 48 And ChkFirma.Checked) Then - params.Add(New ReportParameter("pFirma1", String.Format("Lic. Damian A. Benitez Alcantar{0}Director Administrativo", vbCrLf))) - params.Add(New ReportParameter("pFirma2", String.Format("Ing. Soraida Mesinas Reyes{0}Director General", vbCrLf))) + params.Add(New ReportParameter("pFirma1", String.Format("Ing. Héctor Díaz Young{0}Dirección Administrativa", vbCrLf))) + params.Add(New ReportParameter("pFirma2", String.Format("M.E.R Carla Neudert Cordova{0}Dirección General", vbCrLf))) ElseIf (UsuarioActual.CveEmpresa = 120 And ChkFirma.Checked) Then params.Add(New ReportParameter("pFirma1", String.Format("C.P.NEFTALI PEÑA MIRANDA{0}Subdirector de Contabilidad", vbCrLf))) params.Add(New ReportParameter("pFirma2", String.Format("Dra. María Antonieta Laso López{0}Director General", vbCrLf))) @@ -652,6 +653,7 @@ Partial Class AC_SituacionFinanciera params.Add(New ReportParameter("pFirma1", "")) params.Add(New ReportParameter("pFirma2", "")) End If + params.Add(New ReportParameter("pFechaFin", FechaF)) params.Add(New ReportParameter("Level2", If(ChkNivel.Checked, "SI", "NO"))) ImprimirPDF(reportpath, lrds, params, fileName, Formato) diff --git a/AC/Reportes/RepEstadoActividades.rdlc b/AC/Reportes/RepEstadoActividades.rdlc index de0652b3b..931f42736 100644 --- a/AC/Reportes/RepEstadoActividades.rdlc +++ b/AC/Reportes/RepEstadoActividades.rdlc @@ -1008,18 +1008,7 @@ - C.P Vera Guadalupe Tarazon Moreno - - - - - - Director Administrativo + =Parameters!pFirma1.Value - - - - - Director Administrativo + =Parameters!pFirma1.Value + + + + + Reporte Entrega Almacen Ruta + + + + + + + + + + + + +
+
+
+ + +
+ +
+
+ Sucursal: +
+ + +
+ +
+ +
+ + +
+
+ + + + +
+ + + + + + +
+ + +
+
+ + + + +
+ + + + + + +
+ + +
+
+
+ +
+ +
+
+ + + +
+ " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+ + + + + + diff --git a/General/RepEntregaAlmacenRuta.aspx.cs b/General/RepEntregaAlmacenRuta.aspx.cs new file mode 100644 index 000000000..026ced309 --- /dev/null +++ b/General/RepEntregaAlmacenRuta.aspx.cs @@ -0,0 +1,435 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +using Extensiones; +using System.Data; +using Microsoft.Reporting.WebForms; +using System.IO; +using System.Text; + +public partial class General_RepEntregaAlmacenRuta : ClsPaginas +{ + #region PROPIEDADES + private DataTable DTDatos + { + get + { + return (DataTable)ViewState["DTDatos"]; + } + + set + { + ViewState["DTDatos"] = value; + } + } + + private int CveEntregaAlmacen + { + get + { + return ViewState["CveEntregaAlmacen"].ToString().ToEntero(); + } + + set + { + ViewState["CveEntregaAlmacen"] = value; + } + } + + private int CveVenta + { + get + { + return ViewState["CveVenta"].ToString().ToEntero(); + } + + set + { + ViewState["CveVenta"] = value; + } + } + + private int CveMovimiento + { + get + { + return ViewState["CveMovimiento"].ToString().ToEntero(); + } + + set + { + ViewState["CveMovimiento"] = value; + } + } + + private String SerieFolio + { + get + { + return ViewState["SerieFolio"].ToString(); + } + set + { + ViewState["SerieFolio"] = value; + } + } + + private String NombreCliente + { + get + { + return ViewState["NombreCliente"].ToString(); + } + set + { + ViewState["NombreCliente"] = value; + } + } + + private String Destinatario + { + get + { + return ViewState["Destinatario"].ToString(); + } + set + { + ViewState["Destinatario"] = value; + } + } + + private String Paqueteria + { + get + { + return ViewState["Paqueteria"].ToString(); + } + set + { + ViewState["Paqueteria"] = value; + } + } + private String Guia + { + get + { + return ViewState["Guia"].ToString(); + } + set + { + ViewState["Guia"] = value; + } + } + + private String Rastreo + { + get + { + return ViewState["Rastreo"].ToString(); + } + set + { + ViewState["Rastreo"] = value; + } + } + + + private DataTable DTMovimientos + { + get + { + return (DataTable)ViewState["DTMovimientos"]; + } + + set + { + ViewState["DTMovimientos"] = value; + } + } + + private int CvePaqueteriaGuiaReasignar + { + get + { + return ViewState["CvePaqueteriaGuiaReasignar"].ToString().ToEntero(); + } + + set + { + ViewState["CvePaqueteriaGuiaReasignar"] = value; + } + } + + private String Folio + { + get + { + return ViewState["Folio"].ToString(); + } + set + { + ViewState["Folio"] = value; + } + } + + #endregion + + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaEstatus(); + CargaCombosModalEntrega(); + InicializaFechas(); + CargaChoferes(); + UPFiltros.Update(); + CargarCentrosDeCosto(null, DdlSucursales, null, LblDdlSucursal); + CargaDatos(); + } + } + + #region CARGA DDL + protected void CargaCombosModalEntrega() + { + ClsInventarios ObjInventarios = new ClsInventarios(); + + if (ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) && ObjInventarios.DtResultados.Rows.Count > 0) + { + DdlModalCamion.DataSource = ObjInventarios.DtResultados; + } + + ObjInventarios.Dispose(); + DdlModalCamion.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlModalCamion.DataBind(); + + ClsAcarreos ObjAcar = new ClsAcarreos(); + + if (ObjAcar.GetChofer(-1, UsuarioActual.CveEmpresa, 1, -1)) + { + DdlModalChofer.DataSource = ObjAcar.DtResultados; + DdlModalChofer.DataBind(); + } + ObjAcar.Dispose(); + DdlModalChofer.Items.Insert(0, new ListItem("Seleccione", "-1")); + } + protected void CargaChoferes() + { + ClsAcarreos ObjAcar = new ClsAcarreos(); + + if (ObjAcar.GetChofer(-1, UsuarioActual.CveEmpresa, 1, -1)) + { + DdlChofer.DataSource = ObjAcar.DtResultados; + } + ObjAcar.Dispose(); + DdlChofer.DataBind(); + DdlChofer.Items.Insert(0, new ListItem("Todos", "-1")); + } + + + + + + protected void CargaEstatus() + { + + DdlEstatus.Items.Insert(0, new ListItem("Todos ", "-1")); + DdlEstatus.Items.Insert(1, new ListItem("Registrado", "0")); + DdlEstatus.Items.Insert(2, new ListItem("Timbrado", "1")); + DdlEstatus.Items.Insert(3, new ListItem("Cancelado ", "2")); + + } + + + + + + protected void InicializaFechas() + { + + TxtFechaI.Text = DateTime.Now.AddDays(-1).ToString("dd/MM/yyyy"); + TxtFechaF.Text = DateTime.Now.ToString("dd/MM/yyyy"); + + } + #endregion + + #region CARGA DATOS + protected void CargaDatos() + { + ClsGenerales ObjGeneral = new ClsGenerales(); + + if (ObjGeneral.GetInvEntregaAlmacenRutaRep(DdlSucursales.SelectedValue.ToEntero(),UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero(), TxtFechaI.Text.ToDate(), TxtFechaF.Text.ToDate(), DdlChofer.SelectedValue.ToEntero())) + { + DTDatos = ObjGeneral.DtResultados; + GVDatos.DataSource = DTDatos; + } + + ObjGeneral.Dispose(); + GVDatos.DataBind(); + UPDatos.Update(); + } + + + + + #endregion + + #region BOTONES + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + CargaDatos(); + } + + protected void imgEditar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + + CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero(); + + int CveCliente = GvRow.DataKey("CveCliente").ToEntero(); + int CveDireccionOrigen = GvRow.DataKey("CveDireccionOrigen").ToEntero(); + int CveAlmacen = GvRow.DataKey("CveAlmacen").ToEntero(); + + CargaModalCombosDirecciones(CveCliente, CveDireccionOrigen, CveAlmacen); + + DdlModalDireccionOrigen.SelectedValueExist(GvRow.DataKey("CveDireccionOrigen")); + DdlModalDireccionDestino.SelectedValueExist(GvRow.DataKey("CveDireccionDestino")); + + DdlModalCamion.SelectedValueExist(GvRow.DataKey("CveCamion")); + DdlModalChofer.SelectedValueExist(GvRow.DataKey("CveChofer")); + + TxtmodalFechaEntrega.Text = GvRow.DataKey("FechaEntrega").ToDate().ToString("dd/MM/yyyy"); + + + UpModalEditarentrega.Update(); + this.RegistraScript("$('#DivEditarEntrega').modal('show');"); + } + + + private void CargaModalCombosDirecciones(int CveCliente, int CveDireccionOrigen, int CveAlmacen ) + { + + DdlModalDireccionOrigen.Items.Clear(); + DdlModalDireccionDestino.Items.Clear(); + + DataTable DTDireccionesCliente = new DataTable(); + ClsClientes ObjClientes = new ClsClientes(); + if (ObjClientes.DireccionEnvioGet(-1, -1, -1)) + { + DTDireccionesCliente = ObjClientes.DtResultados ; + } + ObjClientes.Dispose(); + + DdlModalDireccionDestino.DataSource = DTDireccionesCliente.FiltraParametros($"CveCliente = {CveCliente}"); + DdlModalDireccionDestino.DataBind(); + DdlModalDireccionDestino.Items.Insert(0,new ListItem("Seleccione Una", "-1")); + + string Almacen = get_GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen: CveAlmacen).FiltroPrimeroValor("Almacen", $"CveAlmacen = {CveAlmacen}"); + if (CveDireccionOrigen > 0) + { + DdlModalDireccionOrigen.DataSource = DTDireccionesCliente.FiltraParametros($"CveDireccionEnvio = {CveDireccionOrigen}"); + DdlModalDireccionOrigen.DataBind(); + DdlModalDireccionOrigen.Items.Insert(0, new ListItem($"Almacen: {Almacen}", "-2")); + }else + { + DdlModalDireccionOrigen.Items.Insert(0, new ListItem($"Almacen: {Almacen}", "-2")); + } + + } + + + protected void LnkTimbrar_Click(object sender, EventArgs e) + { + + } + + protected void LnkCancelaTimbre_Click(object sender, EventArgs e) + { + + } + + + protected void BtnModalEditarentrega_Click(object sender, EventArgs e) + { + + bool ProcesoOK = true ; + + ClsGenerales ObjGral = new ClsGenerales(); + if(!ObjGral.UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen,DdlModalDireccionOrigen.SelectedValue.ToEntero(), DdlModalDireccionDestino.SelectedValue.ToEntero(), DdlModalChofer.SelectedValue.ToEntero(), DdlModalCamion.SelectedValue.ToEntero(), TxtmodalFechaEntrega.Text.ToDate(), UsuarioActual.CveEmpresa)) + { + ProcesoOK = false; + } + ObjGral.Dispose(); + + if (ProcesoOK) + { + this.RegistraScript("$('#DivEditarEntrega').modal('hide');"); + Alert("Entrega Actualizada correctamente."); + CargaDatos(); + } + + } + + protected void BtnEliminarGuia_Click(object sender, EventArgs e) + { + //EliminaGuia(); + //this.RegistraScript("$('#DivEditarGuia').modal('hide');"); + //CargaDatos(); + } + + protected void GVDatos_RowDataBound(object sender, GridViewRowEventArgs e) + { + if (e.Row.RowType == DataControlRowType.DataRow) + { + LinkButton LnkEditar = e.Row.FCLinkButton("LnkEditar"); + LinkButton LnkTimbrar = e.Row.FCLinkButton("LnkTimbrar"); + LinkButton LnkCancelaTimbre = e.Row.FCLinkButton("LnkCancelaTimbre"); + + LnkEditar.Visible = false; + LnkTimbrar.Visible = false; + LnkCancelaTimbre.Visible = false; + + if (e.Row.DataKey("Estatus").ToEntero() == 0) + { + LnkEditar.Visible = true; + LnkTimbrar.Visible = true; + } + + if (e.Row.DataKey("Estatus").ToEntero() == 1) + { + LnkCancelaTimbre.Visible = true; + } + + if (e.Row.DataKey("Estatus").ToEntero() == 2) + { + + } + + LnkCancelaTimbre.Visible = true; + + } + } + + + + + + + + #endregion + + + + + + + + + + +} \ No newline at end of file diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index bff609215..fda141f25 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -390,6 +390,7 @@ Partial Class General_SaldosIniciales End If End If + ElseIf RblFormato.SelectedValue = "7" Then If Not dt.Columns(0).ColumnName = "Código" Then Alert("El nombre de la primera columna debe ser 'Código'. Favor de corregirlo", TipoMensaje.MsgError) @@ -1726,7 +1727,7 @@ Partial Class General_SaldosIniciales Exit For End If - Dim SubP As String = Row("SubProyecto").ToString + Dim SubP As String = Row("SubProyecto").ToString.Trim If SubP <> "" OrElse SubP <> "-" Then DataTemp = SubProTemp.FiltraParametros(String.Format("SubProyecto = '{0}'", SubP)) CveSubProyecto = DataTemp.FiltroPrimeroValor("CveSubProyecto", "").ToEntero @@ -1771,6 +1772,7 @@ Partial Class General_SaldosIniciales Catch ex As Exception + Alert(ex.Message) ObjConta.RollBack() End Try diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 5d16c394f..7be0c4e2d 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -5064,7 +5064,7 @@ Partial Class Inventarios_EntradasSalidas If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then - CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(tOrigen > 0, 2, 3), 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="ES/GV") + CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(tOrigen > 0, 36, 37), 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="ES/GV") FolioVirtual = ObjInventario.Folio For Each RowUsado As DataRow In DtPSVirtual.Rows diff --git a/Inventarios/EntregaAlmacenRuta.aspx b/Inventarios/EntregaAlmacenRuta.aspx new file mode 100644 index 000000000..7a67dc8fb --- /dev/null +++ b/Inventarios/EntregaAlmacenRuta.aspx @@ -0,0 +1,326 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EntregaAlmacenRuta.aspx.cs" Inherits="Inventarios_EntregaAlmacenRuta" %> + + + + + + + + + Entrega Almacen Ruta + + + + + + + + + + + + +
+
+
+ + +
+
+
+
+
+ +
+ +
+
+ + + + +
+ + + + + + +
+ + +
+
+ + + + +
+ + + + + + +
+
+
+
+
+
+
+ + + + + + +
+ +
+ Chofer: +
+
+ + + +
+
+ Unidad: +
+
+ + + +
+ +
+ Fecha de Entrega: +
+ +
+
+ + + + + + + + +
+
+
+ Carta Porte: +
+
+ + +
+
+ +
+ +
+ Preselección de Entregas +
+ +
+ +
+ +
+ +
+ + + +
+ + + + + +
+
+ + ASIGNACIÓN DE ENTREGAS +
+
+ +
+
+
+ + +
+
+ + + + + + +   + + + + + +   + + + + <%----%> + + +   + + + + +   + + + + +   + + + + + + + + + +
+ +
+ + + +
+
+ + + + + + + +   + + + + + + <%----%> + + + + + + + + + + + +   + + + + <%----%> + + +   + + + + +   + + + + +   + + + + + + + + + + + +
+ +
+ + + + + +
+
+
+
+
+ + + + + diff --git a/Inventarios/EntregaAlmacenRuta.aspx.cs b/Inventarios/EntregaAlmacenRuta.aspx.cs new file mode 100644 index 000000000..188a225a0 --- /dev/null +++ b/Inventarios/EntregaAlmacenRuta.aspx.cs @@ -0,0 +1,420 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Data; +using Extensiones; +using Microsoft.Reporting.WebForms; +using System.Text; + +public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas +{ + + + DataTable DTGenrarDocumentos + { + get { + + if(ViewState["DTGenrarDocumentos"] == null){ + ViewState["DTGenrarDocumentos"] = new DataTable(); + } + return (DataTable)ViewState["DTGenrarDocumentos"]; + + } + set { + ViewState["DTGenrarDocumentos"] = (DataTable)value; + } + } + + DataTable DTDatosConsulta + { + get + { + + if (ViewState["DTDatosConsulta"] == null) + { + ViewState["DTDatosConsulta"] = new DataTable(); + } + return (DataTable)ViewState["DTDatosConsulta"]; + + } + set + { + ViewState["DTDatosConsulta"] = (DataTable)value; + } + } + + + bool SelecionEntrega + { + get + { + if (ViewState["SelecionEntrega"] == null) + { + ViewState["SelecionEntrega"] = false; + } + return (bool) ViewState["SelecionEntrega"]; + } + set + { + ViewState["SelecionEntrega"] = (bool)value; + } + } + + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + + + SelecionEntrega = true; + + CargaCombos(); + CargaDatos(); + + } + } + + protected void BtnAsignar_Click(object sender, EventArgs e) + { + + + + + if(DdlChofer.SelectedValue.ToEntero() <= 0) + { + Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia); + return; + } + + if(DdlUnidadCamion.SelectedValue.ToEntero() <= 0) + { + Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia); + return; + } + + + StringBuilder SBError = new StringBuilder(); + ActualizaOrdenDTGenrarDocumentos(); + + + + bool TieneError = false; + ClsGenerales ObjGeneral = new ClsGenerales(); + ObjGeneral.IniciaTransacSQL(); + + GridViewRowCollection Grid = GvGenerarDocumentos.Rows; + + + string Usuario = DdlChofer.SelectedItem.Text; + + + + + int CveDireccionOrigen = -1; + foreach (GridViewRow row in Grid) + { + //int CvePaqueteriasGuias = row.DataKey("CvePaqueteriaGuia").ToEntero(); + int Orden = row.DataKey("Orden").ToEntero(); + + //if (ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriasGuias, CvePersonal: -1, CveAsignacionEntrega: CveAsignacionEntrega, Orden: Orden)) + //{ + + int CveDireccionDestino = row.DataKey("CveDireccionEnvio").ToEntero(); + + if (CveDireccionDestino <= 0) + { + SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} el cliente {row.DataKey("Nombre")} no tiene una dirección de envio. "); + TieneError = true; + break; + } + int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), row.DataKey("CveMovimiento").ToEntero(), CveDireccionOrigen, CveDireccionDestino, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), "E",Orden); + CveDireccionOrigen = row.DataKey("CveDireccionEnvio").ToEntero(); + + if (CveEntregaAlmacen > 0) + { + DateTime MinFecha = new DateTime(1900, 01, 01); + int CveTimbre = ObjGeneral.AddGralTimbre("Tra", "-1", -1, "", MinFecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, -1, ChkEmitirCartaPorte.Checked, CveEntregaAlmacen, row.DataKey("CveSubProyectoOrigen").ToEntero()); + + if (CveTimbre <= 0) + { + SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar timbre. "); + + TieneError = true; + break; + } + } + else + { + SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega alamcen. "); + TieneError = true; + break; + } + + + } + + + + + + if (!TieneError) + { + + foreach (GridViewRow row in Grid) + { + try + { + //MandarNotificacionCorreo(row); + } + catch (Exception ex) + { + TieneError = true; + ModExtensiones.GuardaLog(ex.Message); + } + + + } + + if (!TieneError) + { + ObjGeneral.Commit(); + Alert("Entregas asignadas correctamente"); + + DdlChofer.SelectedValueExist("-1"); + DdlUnidadCamion.SelectedValueExist("-1"); + ChkEmitirCartaPorte.Checked = false; + + SelecionEntrega = false; + SeleccioanrGenrar(); + + CargaDatos(); + UpDatos.Update(); + } + else + { + ObjGeneral.RollBack(); + } + ObjGeneral.Dispose(); + }else + { + Alert(SBError.ToString(), ModExtensiones.TipoMensaje.MsgAdvertencia); + } + + } + private void CargaDatos() + { + ClsGenerales ObjGeneral = new ClsGenerales(); + if (ObjGeneral.GetInvEntregaAlmacenRuta(DdlSubProyecto.SelectedValue.ToEntero(), TxtFechaI.Text.ToDate(), TxtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa, 1)) + { + GvPaqueteriasGuias.DataSource = ObjGeneral.DtResultados; + DTDatosConsulta = ObjGeneral.DtResultados; + DTGenrarDocumentos = ObjGeneral.DtResultados.Clone(); + + } + ObjGeneral.Dispose(); + GvPaqueteriasGuias.DataBind(); + + UpDatos.Update(); + } + + + private void CargaCombos() + { + + ClsInventarios ObjInventarios = new ClsInventarios(); + + if(ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) && ObjInventarios.DtResultados.Rows.Count > 0){ + DdlUnidadCamion.DataSource = ObjInventarios.DtResultados; + } + ObjInventarios.Dispose(); + DdlUnidadCamion.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlUnidadCamion.DataBind(); + + TxtFechaI.Text = DateTime.Now.AddDays(-1).ToShortDateString(); + TxtFechaF.Text = DateTime.Now.ToShortDateString(); + + ClsAcarreos ObjAcar = new ClsAcarreos(); + + if(ObjAcar.GetChofer(-1, UsuarioActual.CveEmpresa, 1, -1) ){ + DdlChofer.DataSource = ObjAcar.DtResultados; + DdlChofer.DataBind(); + } + ObjAcar.Dispose(); + DdlChofer.Items.Insert(0, new ListItem("Seleccione", "-1")); + + TxtFechaEntrega.Text = DateTime.Now.ToShortDateString(); + + + CargarCentrosDeCosto(null, DdlSubProyecto, null, LblSubProyecto); + + + } + + + protected void LnkGenerarDocumentos_Click(object sender, EventArgs e) + { + SeleccioanrGenrar(); + } + + + private void SeleccioanrGenrar() { + + if (SelecionEntrega) + { + + DTGenrarDocumentos.Rows.Clear(); + + + + int CountRows = 0; + foreach (GridViewRow GvRow in GvPaqueteriasGuias.Rows) + { + + CheckBox ChkAsigna = GvRow.FCCheckBox("ChkAsigna"); + + if (ChkAsigna.Checked) + { + + int CveMovimiento = GvRow.DataKey("CveMovimiento").ToEntero(); + + DataRow dRow = DTGenrarDocumentos.NewRow(); + DataRow dRowOrigen = DTDatosConsulta.FiltraParametros($"CveMovimiento = {CveMovimiento}").Rows[0]; + + int IndexColun = 0; + foreach (DataColumn dColumn in DTDatosConsulta.Columns) + { + dRow[IndexColun] = dRowOrigen[IndexColun]; + IndexColun++; + } + + dRow["Num"] = CountRows + 1; + DTGenrarDocumentos.Rows.Add(dRow); + CountRows++; + } + } + + DTGenrarDocumentos.AcceptChanges(); + + + + + SelecionEntrega = false; + LnkGenerarDocumentos.Text = "Regresar a Preselección"; + LnkGenerarDocumentos.CssClass = "btn btn-default"; + + DVDatosEntrega1.Visible = true; + DVDatosEntrega2.Visible = true; + DVDatosEntrega3.Visible = true; + DVDatosEntrega4.Visible = true; + DVDatosEntrega5.Visible = true; + DVDatosEntrega6.Visible = true; + + DVDatosEntrega7.Attributes.Add("class", "col-md-1"); + + if (UsuarioActual.Empresa.Funcionalidad(161).ToEntero() == 1) + { + DvCartaPorte1.Visible = true; + DvCartaPorte2.Visible = true; + } + + + BtnConsultar.Visible = false; + + UpDatos.Update(); + UpFiltro.Update(); + + + if (CountRows > 0) + { + GvGenerarDocumentos.DataSource = DTGenrarDocumentos; + GvGenerarDocumentos.DataBind(); + + DVGvGenerarDocumentos.Visible = true; + BtnAsignar.Visible = true; + DVGvPaqueteriasGuias.Visible = false; + + RegistraScript("InitOrdenamientoGvGenerarDocumentos();"); + } + else + { + Alert("No hay entregas seleccionadas", ModExtensiones.TipoMensaje.MsgAdvertencia); + return; + } + } + else + { + + BtnConsultar.Visible = true; + SelecionEntrega = true; + LnkGenerarDocumentos.Text = "Preselección de Entregas"; + LnkGenerarDocumentos.CssClass = "btn btn-primary"; + DVDatosEntrega7.Attributes.Add("class", "col-md-9"); + + DVDatosEntrega1.Visible = false; + DVDatosEntrega2.Visible = false; + DVDatosEntrega3.Visible = false; + DVDatosEntrega4.Visible = false; + DVDatosEntrega5.Visible = false; + DVDatosEntrega6.Visible = false; + + if (UsuarioActual.Empresa.Funcionalidad(161).ToEntero() == 1) + { + DvCartaPorte1.Visible = false; + DvCartaPorte2.Visible = false; + } + + BtnAsignar.Visible = false; + DVGvGenerarDocumentos.Visible = false; + DVGvPaqueteriasGuias.Visible = true; + UpDatos.Update(); + UpFiltro.Update(); + + } + } + + + + + + private void ActualizaOrdenDTGenrarDocumentos() + { + string[] OrdenMovimientos = Request.Form.GetValues("OrdenMovimientos"); + + int NumOrden = 1; + foreach (string CveMovimiento in OrdenMovimientos) + { + foreach(DataRow dRow in DTGenrarDocumentos.Rows) + { + if (CveMovimiento.ToEntero() == dRow["CveMovimiento"].ToString().ToEntero() ) + { + dRow["Orden"] = NumOrden; + } + } + DTGenrarDocumentos.AcceptChanges(); + NumOrden++; + } + + + DataView DTview = new DataView(DTGenrarDocumentos); + + // Sort by State and ZipCode column in descending order + DTview.Sort = "Orden ASC"; + + GvGenerarDocumentos.DataSource = DTview; + GvGenerarDocumentos.DataBind(); + UpDatos.Update(); + + + + } + + protected void BtnConsultar_Click(object sender, EventArgs e) + { + CargaDatos(); + } +} \ No newline at end of file diff --git a/Inventarios/RepAnomalias.aspx b/Inventarios/RepAnomalias.aspx index 1d61b5461..734e7078f 100644 --- a/Inventarios/RepAnomalias.aspx +++ b/Inventarios/RepAnomalias.aspx @@ -130,18 +130,18 @@
Ver por:
-
+
- - + +
-
Vista de Resultados:
+
Vista de Resultados:
- - + +
@@ -234,203 +234,227 @@ -
- - -
-
- -
-
- Número de registros: -
-
- " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - <%----%> - - - - - -
-
-
- - - -
-
- -
-
- Número de registros: -
-
- " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - <%----%> - - - - - - -
-
- -
-
- Número de registros: -
-
- " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - <%----%> - - - - - - -
-
-
- -