From 2366349859d620bfdf6c14d6c9ca5e948a5c912a Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 10 Jul 2023 15:25:50 -0700 Subject: [PATCH 1/7] --- UserControl/TareaNueva.ascx.cs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/UserControl/TareaNueva.ascx.cs b/UserControl/TareaNueva.ascx.cs index e0ef9f4c4..70ffe2daf 100644 --- a/UserControl/TareaNueva.ascx.cs +++ b/UserControl/TareaNueva.ascx.cs @@ -22,16 +22,21 @@ public partial class UserControl_TareaNueva : System.Web.UI.UserControl { System.Text.StringBuilder Str = new System.Text.StringBuilder(); if (CveUsuario != -1) { Str.AppendFormat("CveUsuario = {0}", CveUsuario); } - if (CveEmpresa != -1) { Str.AppendFormat(" {0} CveEmpresa = {1}", Str.Length > 0 ? "AND" : "", CveEmpresa); } + //if (CveEmpresa != -1) { Str.AppendFormat(" {0} CveEmpresa = {1}", Str.Length > 0 ? "AND" : "", CveEmpresa); } System.Data.DataTable dt = null; - if (CveUsuario != -1 || CveEmpresa != -1) + if (CveEmpresa != -1) { - System.Data.DataView Dv = new System.Data.DataView((System.Data.DataTable)Application["GlobalDTUsuarios"], Str.ToString(), "", System.Data.DataViewRowState.CurrentRows); - dt = Dv.ToTable(); - Dv.Dispose(); + + String AppNombre = $"GlobalDTUsuarios-{CveEmpresa}"; + if (CveUsuario != -1 ) + { + System.Data.DataView Dv = new System.Data.DataView((System.Data.DataTable)Application[AppNombre], Str.ToString(), "", System.Data.DataViewRowState.CurrentRows); + dt = Dv.ToTable(); + Dv.Dispose(); + } + else + { dt = (System.Data.DataTable)Application[AppNombre]; } } - else - { dt = (System.Data.DataTable)Application["GlobalDTUsuarios"]; } return dt; } @@ -58,14 +63,15 @@ public partial class UserControl_TareaNueva : System.Web.UI.UserControl txtCveEventoPadre.Text = "-1"; } string[] FiltroAD = { "CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol", "Correo", "Empresa", "CveRol", "CveSubProyecto" }; - GVUsuarios_TareaNueva.DataSource = get_GlobalDTUsuarios(-1,UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveEmpresa = {0} AND Estatus =1", UsuarioActual.CveEmpresa), "Rol ASC", FiltroAD); + GVUsuarios_TareaNueva.DataSource = get_GlobalDTUsuarios(-1,UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveEmpresa = {0} AND Estatus =1", UsuarioActual.CveEmpresa), "Nombre ASC", FiltroAD); DdlPara.DataSource = GVUsuarios_TareaNueva.DataSource; DdlPara.DataBind(); + DdlPara.Items.Insert(0, new ListItem("Seleccione un usuario", "-1")); DdlTema.DataSource = ClsPaginas.get_GlobalDTOIRevision(UsuarioActual.CveEmpresa).FiltraParametros(string.Format("CveUsuario = {0}", UsuarioActual.CveUsuario)); DdlTema.DataBind(); - DdlTema.Items.Insert(0, new ListItem("Seleccione", "-1")); + DdlTema.Items.Insert(0, new ListItem("Seleccione ", "-1")); GVUsuarios_TareaNueva.DataBind(); } } From 37cf5612348eaa58f05db1d785be23bd34127e11 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Tue, 11 Jul 2023 04:05:17 -0700 Subject: [PATCH 2/7] --- App_Code/ClsCGame.vb | 39 +++++++++++++++++++++++++++++++++- UserControl/TareaNueva.ascx.cs | 25 ++-------------------- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/App_Code/ClsCGame.vb b/App_Code/ClsCGame.vb index fa03b1f8e..1752e237e 100644 --- a/App_Code/ClsCGame.vb +++ b/App_Code/ClsCGame.vb @@ -1,4 +1,5 @@ -Imports System.Data +Imports System +Imports System.Data Imports System.Data.SqlClient Imports Extensiones @@ -3442,6 +3443,42 @@ Public Class ClsCGame Return Retorno End Function + Public Function REPInventarioDiarioPallets(fechaCalculo As DateTime, cveEmpresa As Int32, errorMostrarADS As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_CGame_REPInventarioDiarioPallets", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@FechaCalculo", SqlDbType.Date).Value = fechaCalculo + .Add("@ErrorMostrarADS", SqlDbType.VarChar).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(DTSet) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de inventario diario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + + + Public Function REPInventarioDiarioBins(fechaCalculo As DateTime, cveEmpresa As Int32, errorMostrarADS As String) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_CGame_REPInventarioDiarioBins", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@FechaCalculo", SqlDbType.Date).Value = fechaCalculo + .Add("@ErrorMostrarADS", SqlDbType.VarChar).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(DTSet) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte de inventario diario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function #End Region diff --git a/UserControl/TareaNueva.ascx.cs b/UserControl/TareaNueva.ascx.cs index 70ffe2daf..2983bfbee 100644 --- a/UserControl/TareaNueva.ascx.cs +++ b/UserControl/TareaNueva.ascx.cs @@ -17,28 +17,7 @@ public partial class UserControl_TareaNueva : System.Web.UI.UserControl public bool Ismodal { get { return ViewState["Ismodal"] != null ? (bool)ViewState["Ismodal"] : true; } set { ViewState["Ismodal"] = value; } } public string OnAddedTareaNueva { get { return ViewState["OnAddedTareaNueva"] != null ? ViewState["OnAddedTareaNueva"].ToString() : "OnAddedTareaNueva"; } set { ViewState["OnAddedTareaNueva"] = value; } } public const string iddivAgregarTema = "divModalAgregartema"; - - protected System.Data.DataTable get_GlobalDTUsuarios(int CveUsuario = -1, int CveEmpresa = -1) - { - System.Text.StringBuilder Str = new System.Text.StringBuilder(); - if (CveUsuario != -1) { Str.AppendFormat("CveUsuario = {0}", CveUsuario); } - //if (CveEmpresa != -1) { Str.AppendFormat(" {0} CveEmpresa = {1}", Str.Length > 0 ? "AND" : "", CveEmpresa); } - System.Data.DataTable dt = null; - if (CveEmpresa != -1) - { - - String AppNombre = $"GlobalDTUsuarios-{CveEmpresa}"; - if (CveUsuario != -1 ) - { - System.Data.DataView Dv = new System.Data.DataView((System.Data.DataTable)Application[AppNombre], Str.ToString(), "", System.Data.DataViewRowState.CurrentRows); - dt = Dv.ToTable(); - Dv.Dispose(); - } - else - { dt = (System.Data.DataTable)Application[AppNombre]; } - } - return dt; - } + protected void Page_Load(object sender, EventArgs e) { @@ -63,7 +42,7 @@ public partial class UserControl_TareaNueva : System.Web.UI.UserControl txtCveEventoPadre.Text = "-1"; } string[] FiltroAD = { "CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol", "Correo", "Empresa", "CveRol", "CveSubProyecto" }; - GVUsuarios_TareaNueva.DataSource = get_GlobalDTUsuarios(-1,UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveEmpresa = {0} AND Estatus =1", UsuarioActual.CveEmpresa), "Nombre ASC", FiltroAD); + GVUsuarios_TareaNueva.DataSource = ClsPaginas.get_GlobalDTUsuarios(-1,UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveEmpresa = {0} AND Estatus =1", UsuarioActual.CveEmpresa), "Nombre ASC", FiltroAD); DdlPara.DataSource = GVUsuarios_TareaNueva.DataSource; DdlPara.DataBind(); From 2484122f5baa6ed83059aa2d871b9ee4428e7e94 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Tue, 11 Jul 2023 08:03:09 -0700 Subject: [PATCH 3/7] =?UTF-8?q?Ajustes=20Generaci=C3=B3n=20pdf=20nomina=20?= =?UTF-8?q?version=20y=20usocfdi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 8dfcc177b..f030cdee9 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -6703,7 +6703,7 @@ Public Class ClsPaginas Dim RutaFormato As String = String.Format("{0}Formatos\Nomina.rdlc", RutaEmpresa) Dim RutaFormatoDefault As String = String.Format("Empresas\Grales\Formatos\Nomina.rdlc") Dim CFDIVersion As String = "" - Dim UsoCFDI As String = "" + Dim UsoCFDI As String = "ND" @@ -6752,7 +6752,22 @@ Public Class ClsPaginas If receptorNode IsNot Nothing Then UsoCFDI = ValorNodoXML(receptorNode, "usocfdi") - UsoCFDI = GlobalDTSATUsosCFDI(-1, "-1").FiltroPrimeroValor("UsoCFDIDescripcion", $" UsoCFDI = '{UsoCFDI}' ") + Dim UsoCFDIImprimir As String = GlobalDTSATUsosCFDI(-1, "-1").FiltroPrimeroValor("UsoCFDIDescripcion", $" UsoCFDI = '{UsoCFDI}' ") + + If UsoCFDIImprimir.Trim.Length > 0 Then + UsoCFDI = UsoCFDIImprimir + End If + + End If + + If UsoCFDI = "ND" Or UsoCFDI = "" Then + + If CFDIVersion = "4.0" Then + UsoCFDI = "CN01 - Nómina" + Else + UsoCFDI = "P01 - Por definir" + End If + End If From bff887d80838513b04e8b2282342e7f15ee30ed8 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Tue, 11 Jul 2023 08:30:39 -0700 Subject: [PATCH 4/7] inventarios --- App_Code/ClsCGame.vb | 6 ++--- Compras/PopUpVerFactura.aspx.vb | 44 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/App_Code/ClsCGame.vb b/App_Code/ClsCGame.vb index 1752e237e..1014e8fb0 100644 --- a/App_Code/ClsCGame.vb +++ b/App_Code/ClsCGame.vb @@ -3450,10 +3450,9 @@ Public Class ClsCGame With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa .Add("@FechaCalculo", SqlDbType.Date).Value = fechaCalculo - .Add("@ErrorMostrarADS", SqlDbType.VarChar).Direction = ParameterDirection.Output End With Try - SqlAdapter.Fill(DTSet) + SqlAdapter.Fill(Data) retorno = True Catch ex As Exception OnError("Ocurrió un error al obtener el reporte de inventario diario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) @@ -3469,10 +3468,9 @@ Public Class ClsCGame With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa .Add("@FechaCalculo", SqlDbType.Date).Value = fechaCalculo - .Add("@ErrorMostrarADS", SqlDbType.VarChar).Direction = ParameterDirection.Output End With Try - SqlAdapter.Fill(DTSet) + SqlAdapter.Fill(Data) retorno = True Catch ex As Exception OnError("Ocurrió un error al obtener el reporte de inventario diario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index be81921ca..0705365f3 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -229,6 +229,9 @@ Partial Class PopUpVerFactura If Request("onlyPrint").ToString() = "Recibo" Then ReciboAgropecuaria() End If + If Request("onlyPrint").ToString() = "CitrusInventarioDiario" Then + imprimirRepcitrusInventarioDiario("") + End If End If End If @@ -336,6 +339,47 @@ Partial Class PopUpVerFactura Response.End() End Sub + + Private Sub imprimirRepcitrusInventarioDiario(fecha As String) + Dim totalPallets As String = "" + Dim totalBachas As String = "" + Dim fechas As String = "" + Dim totalcajas As String = "" + + + Dim tablaReportePallets As New DataTable + Dim tablaReporteBins As New DataTable + + Using objnom As New ClsCGame + If objnom.REPInventarioDiarioPallets(DateTime.Now, UsuarioActual.CveEmpresa, "") And objnom.DtResultados.Rows.Count > 0 Then + tablaReportePallets = objnom.DtResultados + totalPallets = tablaReportePallets.SUM("Pallets", "GroupId =1").FormatoNumero(0) + totalBachas = tablaReportePallets.SUM("Bachas", "GroupId =1").FormatoNumero(0) + totalcajas = tablaReportePallets.SUM("CajasTotal", "GroupId =1").FormatoNumero(0) + End If + If objnom.REPInventarioDiarioBins(DateTime.Now, UsuarioActual.CveEmpresa, "") And objnom.DtResultados.Rows.Count > 0 Then + tablaReporteBins = objnom.DtResultados + End If + 'Remolque 1 12-TF-5E' }, { cveCamion: 2, placa: 'Remolque 2 15-TF-7f + End Using + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("totalPallets", totalPallets)) + params.Add(New ReportParameter("totalBachas", totalBachas)) + params.Add(New ReportParameter("totalcajas", totalcajas)) + params.Add(New ReportParameter("Fecha", fechas)) + + Dim lrds As New List(Of ReportDataSource) + Dim rds As New ReportDataSource With {.Name = "DataSetsPallets", .Value = tablaReportePallets} + lrds.Add(rds) + Dim rds2 As New ReportDataSource With {.Name = "DataSetBins", .Value = tablaReporteBins} + lrds.Add(rds2) + + '"D:\\ADSistemas\\Proyectos\\SIG\\SIGIT\\GPS\\PalletEtiqueta.rdlc" + Dim rutardlc = "Formatos\RepAgroInventarioDiario.rdlc" + ImprimirPDF(rutardlc, lrds, params, "Inventario") ', Content_Disposition:="Inline") + End Sub + + Private Sub imprimirManifiesto(cveEmbarqueManifiesto As Integer) Dim NoEmbarque As String = "" Dim Fecha As String = "" From b3f136a27e73c2c9c7490a26c1e0102213489c8e Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Tue, 11 Jul 2023 08:31:28 -0700 Subject: [PATCH 5/7] repinventarios --- Compras/PopUpVerFactura.aspx.vb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 0705365f3..97fa6005b 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -345,6 +345,7 @@ Partial Class PopUpVerFactura Dim totalBachas As String = "" Dim fechas As String = "" Dim totalcajas As String = "" + Dim TotalBins As String = "" Dim tablaReportePallets As New DataTable @@ -359,6 +360,7 @@ Partial Class PopUpVerFactura End If If objnom.REPInventarioDiarioBins(DateTime.Now, UsuarioActual.CveEmpresa, "") And objnom.DtResultados.Rows.Count > 0 Then tablaReporteBins = objnom.DtResultados + TotalBins = tablaReporteBins.SUM("Bins").FormatoNumero(0) End If 'Remolque 1 12-TF-5E' }, { cveCamion: 2, placa: 'Remolque 2 15-TF-7f End Using @@ -366,6 +368,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("totalPallets", totalPallets)) params.Add(New ReportParameter("totalBachas", totalBachas)) params.Add(New ReportParameter("totalcajas", totalcajas)) + params.Add(New ReportParameter("TotalBins", TotalBins)) params.Add(New ReportParameter("Fecha", fechas)) Dim lrds As New List(Of ReportDataSource) From 991ea5c1d1e45eeccaf480a7d66214d8935caf71 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 14 Jul 2023 16:45:02 -0700 Subject: [PATCH 6/7] Filtros de estatus para NC --- Ventas/RepVentas.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb index 0ae957414..65a96a42d 100644 --- a/Ventas/RepVentas.aspx.vb +++ b/Ventas/RepVentas.aspx.vb @@ -284,7 +284,7 @@ Partial Class Ventas_RepVentas Protected Sub DdlTipoComprobante_SelectedIndexChanged(sender As Object, e As EventArgs) DdlEstatus.Items.Clear() If DdlTipoComprobante.GetSelectedValuesM <> "" Then - DdlEstatus.DataSource = GlobalDTEstatusFactura.FiltraParametros(String.Format("TipoDocto IN ({0}) OR ('Cot' IN ({0}) AND CveEstatusFactura = 2)", DdlTipoComprobante.GetSelectedValuesM(True).Replace("Ant", "Ing"))) + DdlEstatus.DataSource = GlobalDTEstatusFactura.FiltraParametros(String.Format("TipoDocto IN ({0}) OR ('Cot' IN ({0}) AND CveEstatusFactura = 2)", DdlTipoComprobante.GetSelectedValuesM(True).Replace("Ant", "Ing").Replace("Egs", "Ing"))) Else DdlEstatus.DataSource = GlobalDTEstatusFactura End If From 2064bfd13cd56e89c46b43a693f667bb82d70e3f Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 14 Jul 2023 16:45:27 -0700 Subject: [PATCH 7/7] Mostrar impuestos locales en refacturacion --- Ventas/Ventas.aspx | 2 +- Ventas/Ventas.aspx.vb | 31 ++++++++++++------------------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 38d20fbab..205201a92 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1551,7 +1551,7 @@ SubTotal 2: - + <%-- --%> diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 61376ad6f..7a7c8b88a 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2939,6 +2939,7 @@ Partial Class Ventas End If ObjInv.Dispose() + End If 'regenrea el tipo de cambio CargaNuevaFactura(Nothing) @@ -3199,15 +3200,6 @@ Partial Class Ventas TxtRetIVA.Attributes.Add("onKeyUp", "FnSuma()") TxtRetISR.Attributes.Add("onKeyUp", "FnSuma()") - 'Permitir Edicion de Iva - If UsuarioActual.Empresa.Funcionalidad(509) = "1" Then - TxtIVA.Enabled = True - 'TxtTotal.Enabled = True - RegistraScript("SetDisabledTxtTotal(false);") - TxtSubTotal.Enabled = True - TxtSubTotal2.Enabled = True - End If - 'Cortes de Caja If UsuarioActual.TienePermisoProceso(160) Then CargaCorteCaja() @@ -6031,7 +6023,12 @@ Partial Class Ventas GvImpuestosLocales2.DataSource = ObjVentas.DtResultados GvImpuestosLocales2.DataBind() - GvImpuestosLocales2.Enabled = False + If (NuevaFactura = 1) Then + GvImpuestosLocales2.Enabled = True + Else + GvImpuestosLocales2.Enabled = False + End If + GvImpuestosLocales2.Visible = True End If End If @@ -24264,14 +24261,6 @@ Partial Class Ventas RegistraScript("SetDisabledTxtTotal(true);") If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True - If UsuarioActual.TienePermisoProceso(112) Then - TxtSubTotal.Enabled = True - TxtSubTotal2.Enabled = True - TxtIVA.Enabled = True - 'TxtTotal.Enabled = True - RegistraScript("SetDisabledTxtTotal(false);") - End If - TxtIVA.Text = IVA.FormatoNumero TxtRetIVA.Text = RetencionIVA.FormatoNumero LblDescuentos.Text = Descuentos.FormatoNumero @@ -29104,7 +29093,11 @@ Partial Class Ventas GvImpuestosLocales2.DataSource = ObjVentas.DtResultados GvImpuestosLocales2.DataBind() - GvImpuestosLocales2.Enabled = False + If (NuevaFactura = 1) Then + GvImpuestosLocales2.Enabled = True + Else + GvImpuestosLocales2.Enabled = False + End If GvImpuestosLocales2.Visible = True End If End If