From 541cad7d92560907f58e812aa2b61b0160d5597c Mon Sep 17 00:00:00 2001 From: rakcsle Date: Sat, 25 Jun 2022 09:46:23 -0700 Subject: [PATCH 01/11] Entrada usados resumen totales, Cierre cultivo, Empresas acutualizar certificados --- Acumuladores/EntradasUsadosResumenRep.aspx | 6 +- Acumuladores/EntradasUsadosResumenRep.aspx.vb | 27 + Agropecuaria/CierreCultivo.aspx | 35 +- Agropecuaria/CierreCultivo.aspx.vb | 134 ++++- App_Code/ClsContabilidad.vb | 4 + App_Code/ClsGenerales.vb | 36 +- App_Code/ClsPaginas.vb | 24 +- App_Code/ClsSisEmpresas.vb | 32 + Empresas/119/Formatos/ReciboDePago.rdlc | 310 +++++----- Empresas/140/Formatos/RepEntradasUsados.rdlc | 62 +- Empresas/Grales/Formatos/ReciboDePago.rdlc | 549 ++++++++++-------- Sistemas/Empresa.aspx | 30 +- Sistemas/Empresa.aspx.vb | 93 +++ vwd.webinfo | 6 + 14 files changed, 914 insertions(+), 434 deletions(-) diff --git a/Acumuladores/EntradasUsadosResumenRep.aspx b/Acumuladores/EntradasUsadosResumenRep.aspx index fd6a6e5f5..4a40e98ba 100644 --- a/Acumuladores/EntradasUsadosResumenRep.aspx +++ b/Acumuladores/EntradasUsadosResumenRep.aspx @@ -14,7 +14,7 @@
  • - +
  • @@ -81,7 +81,9 @@ + ShowFooter="False" DataKeyNames="CvePSCargo,CodigoPS,Inicial,E_Almacen,E_Pub,E_Traspaso,E_Compra,E_Otros,S_Almacen,S_Traspaso,S_Otros,Exist_Actual" + OnRowDataBound="GvAcum_RowDataBound" + > diff --git a/Acumuladores/EntradasUsadosResumenRep.aspx.vb b/Acumuladores/EntradasUsadosResumenRep.aspx.vb index fb134f4fb..30d650c56 100644 --- a/Acumuladores/EntradasUsadosResumenRep.aspx.vb +++ b/Acumuladores/EntradasUsadosResumenRep.aspx.vb @@ -53,14 +53,25 @@ Partial Class Acumuladores_RepEntradasUsados Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Dim ObjAcum As New ClsAcumuladores + BtnImprimir.Visible = False + If ObjAcum.EntradasUsadosGet(UsuarioActual.CveEmpresa, DdlAlmacenes.SelectedValue.ToEntero, txtFechaI.Text, txtFechaF.Text) Then GvAcum.DataSource = ObjAcum.DtResultados DatosEntradasUsados = ObjAcum.DtResultados + If DatosEntradasUsados IsNot Nothing AndAlso DatosEntradasUsados.Rows.Count > 0 Then + BtnImprimir.Visible = True + End If + End If + ObjAcum.Dispose() + GvAcum.DataBind() + UpAcciones.Update() + UpDatos.Update() + End Sub Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs) @@ -163,4 +174,20 @@ Partial Class Acumuladores_RepEntradasUsados End Sub + + Protected Sub GvAcum_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + If e.Row.RowType = DataControlRowType.DataRow Then + + If e.Row.DataKey("CvePSCargo").ToEntero <= 0 Then + + e.Row.CssClass = "Totales" + + End If + + + End If + + End Sub + End Class diff --git a/Agropecuaria/CierreCultivo.aspx b/Agropecuaria/CierreCultivo.aspx index 1766b5ce7..2f4819174 100644 --- a/Agropecuaria/CierreCultivo.aspx +++ b/Agropecuaria/CierreCultivo.aspx @@ -50,10 +50,7 @@
    -
    - - - + @@ -75,7 +72,8 @@
    + EmptyDataText="No se Encontraron datos" CssClass="table table-striped table-advance table-hover mysmallbtn " data-sort="true" Style="width: 100%" GridLines="None" + OnRowDataBound="GvDatos_RowDataBound" > @@ -102,21 +100,30 @@
    diff --git a/Agropecuaria/CierreCultivo.aspx.vb b/Agropecuaria/CierreCultivo.aspx.vb index cabf77d83..898524035 100644 --- a/Agropecuaria/CierreCultivo.aspx.vb +++ b/Agropecuaria/CierreCultivo.aspx.vb @@ -19,6 +19,20 @@ Partial Class Agrupecuaria_CierreCultivo End Property + Private Property DT_Datos_Cierre_Cuadros As DataTable + Get + + If ViewState("DT_Datos_Cierre_Cuadros") Is Nothing Then + ViewState("DT_Datos_Cierre_Cuadros") = New DataTable + End If + + Return DirectCast(ViewState("DT_Datos_Cierre_Cuadros"), DataTable) + + End Get + Set(ByVal value As DataTable) + ViewState("DT_Datos_Cierre_Cuadros") = value + End Set + End Property Private Sub Agrupecuaria_CierreCultivo_Load(sender As Object, e As EventArgs) Handles Me.Load @@ -55,20 +69,40 @@ Partial Class Agrupecuaria_CierreCultivo Exit Sub End If + + + If Not DdlSubProyectoCierreCultivo.SelectedValue.ToEntero > 0 Then + Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + + DT_Datos_Cierre = Nothing + DT_Datos_Cierre_Cuadros = Nothing + Dim ObjGral As New ClsGenerales - If ObjGral.GetCierreCultivos(DdlTemporada.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then - GvDatos.DataSource = ObjGral.DtResultados - DT_Datos_Cierre = ObjGral.DtResultados + 'se valida que se ejecute la consulta, que el resultado tenga dos tablas y que las dos tablas tengan por lo menos 1 registro + If ObjGral.GetCierreCultivos(DdlTemporada.SelectedValue.ToEntero, DdlSubProyectoCierreCultivo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) AndAlso ObjGral.DSResultados.Tables.Count = 2 AndAlso + ObjGral.DSResultados.Tables(0).Rows.Count > 0 AndAlso ObjGral.DSResultados.Tables(1).Rows.Count > 0 Then + + DT_Datos_Cierre = ObjGral.DSResultados.Tables(0).FiltraParametros("", "Gpo") + DT_Datos_Cierre_Cuadros = ObjGral.DSResultados.Tables(1) + + + GvDatos.DataSource = DT_Datos_Cierre + Else GvDatos.DataSource = Nothing DT_Datos_Cierre = Nothing + DT_Datos_Cierre_Cuadros = Nothing End If OcultarmostrarControles(DT_Datos_Cierre) ObjGral.Dispose() GvDatos.DataBind() + UpDatos.Update() @@ -81,10 +115,12 @@ Partial Class Agrupecuaria_CierreCultivo Protected Sub LnkAccionesCerrarCultivo_Click(sender As Object, e As EventArgs) - + TxtModalConcepto.Text = "" + TxtmodalFechaCierreCultivo.Text = "" + UpModalCerrarCultivo.Update() RegistraScript("$('#DivModalCerrarCultivo').modal('show');") - UpModalCerrarCultivo.Update() + End Sub @@ -108,17 +144,79 @@ Partial Class Agrupecuaria_CierreCultivo Dim ObjConta As New ClsContabilidad() ObjConta.IniciaTransacSQL() Dim CvePrePoliza As Integer = -1 + Dim FolioPoliza As Integer = -1 Dim ErrorProceso As Boolean = False Dim CveSubProyecto As Integer = DdlSubProyectoCierreCultivo.SelectedValue.ToEntero - Dim ImporteCierre As Decimal = DT_Datos_Cierre.SUMD("Importe") + Dim ImporteCierre As Decimal = DT_Datos_Cierre.SUMD("Importe", "CveClasificacion > 0") + Dim CveClasificacionTotalitaria As Integer = DT_Datos_Cierre.Rows(0)("CveClasificacion").ToString.ToEntero ' se usa la primera clasificacion - CvePrePoliza = ObjConta.AddPrePolizas("CierreCultivo/Cerrar", 1, ImporteCierre, ImporteCierre, 1, TxtmodalFechaCierreCultivo.Text.ToDate, $"Cierre Temporada {DdlTemporada.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa)) + + Dim ConceptoTotales As String = $"{DdlTemporada.SelectedItem.Text}-{DdlSubProyectoCierreCultivo.SelectedItem.Text}" + + CvePrePoliza = ObjConta.AddPrePolizas("CierreCultivo/Cerrar", 53, ImporteCierre, ImporteCierre, 1, TxtmodalFechaCierreCultivo.Text.ToDate, TxtModalConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) + 'FolioPoliza = ObjConta.FolioPoliza If CvePrePoliza > 0 Then + Dim Orden As Integer = 1 + + For Each dRow As DataRow In DT_Datos_Cierre.Rows + + Dim ImporteMovimiento As Decimal = dRow("Importe").ToString.ToDecimal + Dim CveClasificacion As Integer = dRow("CveClasificacion").ToString.ToEntero + Dim Clasificacion As String = dRow("Clasificacion").ToString + Dim TipoMovimiento As Boolean = True + + Dim CveConceptoClasificaiones As Integer = 336 + Dim CveConceptoNominas As Integer = 336 + + Dim CveConceptoTotal As Integer = 69 + + + If CveClasificacion > 0 Then + + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, ImporteMovimiento, Clasificacion, CveConceptoClasificaiones, Clasificacion, TxtmodalFechaCierreCultivo.Text.ToDate, -1, -1, -1, -1, ImporteMX:=ImporteMovimiento, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=0, TipoCambio:=1, CveSubProyecto:=CveSubProyecto, CveClasificacion:=CveClasificacion) Then + ErrorProceso = True + Exit For + End If + + Else + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, 0, ImporteCierre, ConceptoTotales, 69, ConceptoTotales, TxtmodalFechaCierreCultivo.Text.ToDate, -1, -1, -1, -1, -1, ImporteMX:=ImporteCierre, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=0, TipoCambio:=1, CveSubProyecto:=CveSubProyecto, CveClasificacion:=CveClasificacionTotalitaria) Then + ErrorProceso = True + Exit For + End If + + End If + + Orden = Orden + 1 + Next + + + If Not ErrorProceso Then + + Dim ObjGral As New ClsGenerales(ObjConta.IniciaTransacSQL) + + + For Each dRow As DataRow In DT_Datos_Cierre_Cuadros.Rows + If Not ObjGral.UpdateCierreCultivos(dRow("CveCultivoCuadro").ToString.ToEntero, CvePrePoliza, UsuarioActual.CveEmpresa) Then + ErrorProceso = True + Exit For + End If + Next + + + + End If + + + + 'ObjConta.UpdatePrePolizasOrdenamiento(CvePrePoliza, UsuarioActual.CveEmpresa) + Else ErrorProceso = True End If @@ -128,8 +226,9 @@ Partial Class Agrupecuaria_CierreCultivo ObjConta.RollBack() Else ObjConta.Commit() - + Alert($"Cultivo Cerrado correctamente Ver Pre Póliza") RegistraScript("$('#DivModalCerrarCultivo').modal('hide');") + CargaDatos() End If ObjConta.Dispose() @@ -137,4 +236,23 @@ Partial Class Agrupecuaria_CierreCultivo End Sub + + Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + If e.Row.RowType = DataControlRowType.DataRow Then + + + If e.Row.DataKey("CveClasificacion").ToEntero <= 0 Then + + e.Row.Font.Bold = True + + End If + + End If + + End Sub + + Protected Sub BtnModalCerrarCultivo_Click(sender As Object, e As EventArgs) + CierraCultivo() + End Sub End Class diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index d530802bc..e14cd2203 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -228,6 +228,8 @@ Public Class ClsContabilidad OnError("No se puede registrar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) ElseIf ex.Message.Contains("CK_Conta_PrePolizas_Concepto") Then OnError("Ocurrio un error al registrar la póliza, el concepto o descripción no puede ir vacio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ElseIf ex.Message.Contains("UK_CveEmpresa_CveTipoPoliza_AnioMes_FolioPoliza") Then + Alert("No se puede registrar la póliza, póliza duplicada, ya existe una póliza con los datos especificados.", TipoMensaje.MsgAdvertencia) Else OnError("Ocurrió un error al Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End If @@ -1647,6 +1649,8 @@ Public Class ClsContabilidad If ex.Message.Contains("50015;") Then OnError("No se puede actualizar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ElseIf ex.Message.Contains("UK_CveEmpresa_CveTipoPoliza_AnioMes_FolioPoliza") Then + Alert("No se puede actualizar la póliza, póliza duplicada, ya existe una póliza con los datos especificados.", TipoMensaje.MsgAdvertencia) Else OnError("Ocurrió un error al actualizar prepoliza del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End If diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 73df9a9aa..8d10ef979 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -15,6 +15,7 @@ Public Class ClsGenerales Private SqlCommand As SqlCommand Private SqlTransacc As SqlTransaction Private Data As DataTable + Private DSet As New DataSet Private disposedValue As Boolean = False 'REGISTRAR CONEXIONES ABIERTAS Private CveConexion As Integer = 0 @@ -50,6 +51,12 @@ Public Class ClsGenerales End Get End Property + Public ReadOnly Property DSResultados() As DataSet + Get + DSResultados = DSet + End Get + End Property + Public Property FolioInsertado As Integer Public Property SerieInsertada As String @@ -3623,18 +3630,40 @@ Public Class ClsGenerales End Function - Public Function GetCierreCultivos(CveTemporada As Integer, CveEmpresa As Integer) As Boolean + Public Function UpdateCierreCultivos(CveCultivoCuadro As Integer, CvePrePoliza As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False - DataAdapter("PA_Agro_CierreCultivosGet") + DataAdapter("PA_Agro_CierreCultivosUpdate") With SqlAdapter.SelectCommand.Parameters - .Add("@CveTemporada", SqlDbType.Int).Value = CveTemporada + .Add("@CveCultivoCuadro", SqlDbType.Int).Value = CveCultivoCuadro + .Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try SqlAdapter.Fill(Data) Retorno = True + Catch ex As Exception + OnError($"Ocurrió un error al actualizar la pre póliza del cuadro.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + Public Function GetCierreCultivos(CveTemporada As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Agro_CierreCultivosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTemporada", SqlDbType.Int).Value = CveTemporada + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(DSet) + Retorno = True Catch ex As Exception OnError($"Ocurrió un error al obtener los datos de cultivo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try @@ -3644,7 +3673,6 @@ Public Class ClsGenerales End Function - #End Region diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 7b7e0e607..b7cf23d3c 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -8901,32 +8901,39 @@ Public Class ClsPaginas DTConceptosPagoRelacionado.Columns.Add("TipoCambioDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("ObjetoImpDR", GetType(String)) + DTConceptosPagoRelacionado.Columns.Add("Tra001BaseDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra001ImpuestoDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra001TipoFactorDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra001TasaOCuotaDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra001ImporteDR", GetType(Decimal)) + + DTConceptosPagoRelacionado.Columns.Add("Tra002BaseDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra002ImpuestoDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra002TipoFactorDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra002TasaOCuotaDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra002ImporteDR", GetType(Decimal)) + DTConceptosPagoRelacionado.Columns.Add("Tra003BaseDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra003ImpuestoDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra003TipoFactorDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra003TasaOCuotaDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Tra003ImporteDR", GetType(Decimal)) + DTConceptosPagoRelacionado.Columns.Add("Ret001BaseDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret001ImpuestoDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret001TipoFactorDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret001TasaOCuotaDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret001ImporteDR", GetType(Decimal)) + DTConceptosPagoRelacionado.Columns.Add("Ret002BaseDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret002ImpuestoDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret002TipoFactorDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret002TasaOCuotaDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret002ImporteDR", GetType(Decimal)) + DTConceptosPagoRelacionado.Columns.Add("Ret003BaseDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret003ImpuestoDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret003TipoFactorDR", GetType(String)) DTConceptosPagoRelacionado.Columns.Add("Ret003TasaOCuotaDR", GetType(String)) @@ -8934,14 +8941,6 @@ Public Class ClsPaginas - '001 ISR - '002 IVA - '003 IEPS - 'Impuetos - 'Retenciones - - - Dim ObjBancos As New ClsBancos If ObjBancos.GetComplementoPagos(CveComplementoPago, CveIE, CveVenta, UsuarioActual.CveEmpresa) Then Serie = ObjBancos.DtResultados.FiltroPrimeroValor("Serie") @@ -9114,12 +9113,15 @@ Public Class ClsPaginas Dim NodosTraslados = Relacionado.SelectNodes($"{PagoVersion}:ImpuestosDR/{PagoVersion}:TrasladosDR/{PagoVersion}:TrasladoDR", namespaces) For Each NodoTraslados As XmlNode In NodosTraslados + Dim BaseDR As String = ValorXML(NodoTraslados, "BaseDR") Dim ImpuestoDR As String = ValorXML(NodoTraslados, "ImpuestoDR") ' ImpuestoDR Dim TipoFactor As String = ValorXML(NodoTraslados, "TipoFactorDR") Dim TasaOCuotaDR As String = ValorXML(NodoTraslados, "TasaOCuotaDR") Dim ImporteDR As Decimal = ValorXML(NodoTraslados, "ImporteDR").ToDecimal If ImpuestoDR = "001" Then + + DrRelacionado("Tra001BaseDR") = BaseDR DrRelacionado("Tra001ImpuestoDR") = ImpuestoDR DrRelacionado("Tra001TipoFactorDR") = TipoFactor DrRelacionado("Tra001TasaOCuotaDR") = TasaOCuotaDR @@ -9127,6 +9129,7 @@ Public Class ClsPaginas End If If ImpuestoDR = "002" Then + DrRelacionado("Tra002BaseDR") = BaseDR DrRelacionado("Tra002ImpuestoDR") = ImpuestoDR DrRelacionado("Tra002TipoFactorDR") = TipoFactor DrRelacionado("Tra002TasaOCuotaDR") = TasaOCuotaDR @@ -9134,6 +9137,7 @@ Public Class ClsPaginas End If If ImpuestoDR = "003" Then + DrRelacionado("Tra003BaseDR") = BaseDR DrRelacionado("Tra003ImpuestoDR") = ImpuestoDR DrRelacionado("Tra003TipoFactorDR") = TipoFactor DrRelacionado("Tra003TasaOCuotaDR") = TasaOCuotaDR @@ -9143,12 +9147,14 @@ Public Class ClsPaginas For Each NodoRetenciiones As XmlNode In Relacionado.SelectNodes($"{PagoVersion}:ImpuestosDR/{PagoVersion}:RetencionesDR/{PagoVersion}:RetencionDR", namespaces) + Dim BaseDR As String = ValorXML(NodoRetenciiones, "BaseDR") Dim ImpuestoDR As String = ValorXML(NodoRetenciiones, "ImpuestoDR") ' ImpuestoDR Dim TipoFactor As String = ValorXML(NodoRetenciiones, "TipoFactorDR") Dim TasaOCuotaDR As String = ValorXML(NodoRetenciiones, "TasaOCuotaDR") Dim ImporteDR As Decimal = ValorXML(NodoRetenciiones, "ImporteDR").ToDecimal If ImpuestoDR = "001" Then + DrRelacionado("Ret001BaseDR") = BaseDR DrRelacionado("Ret001ImpuestoDR") = ImpuestoDR DrRelacionado("Ret001TipoFactorDR") = TipoFactor DrRelacionado("Ret001TasaOCuotaDR") = TasaOCuotaDR @@ -9156,6 +9162,7 @@ Public Class ClsPaginas End If If ImpuestoDR = "002" Then + DrRelacionado("Ret002BaseDR") = BaseDR DrRelacionado("Ret002ImpuestoDR") = ImpuestoDR DrRelacionado("Ret002TipoFactorDR") = TipoFactor DrRelacionado("Ret002TasaOCuotaDR") = TasaOCuotaDR @@ -9163,6 +9170,7 @@ Public Class ClsPaginas End If If ImpuestoDR = "003" Then + DrRelacionado("Ret003BaseDR") = BaseDR DrRelacionado("Ret003ImpuestoDR") = ImpuestoDR DrRelacionado("Ret003TipoFactorDR") = TipoFactor DrRelacionado("Ret003TasaOCuotaDR") = TasaOCuotaDR diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb index 8d06d1397..852ef415a 100644 --- a/App_Code/ClsSisEmpresas.vb +++ b/App_Code/ClsSisEmpresas.vb @@ -630,6 +630,7 @@ Public Class ClsSisEmpresas Return Retorno End Function + Public Function UpdateEmpresa(Empresa As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Ciudad As String, Estado As String, RFC As String, CP As Integer, Telefono As String, Contacto As String, Mail As String, TipoFacturacion As String, BIUsuario As String, BIContraseña As String, ContraseñaKey As String, ArchivoKey As String, ArchivoCer As String, ArchivoPfx As String, Banner As String, Estatus As Boolean, FacturaProduccion As Boolean, MostrarRetIVA As Boolean, MostrarRetISR As Boolean, Regimen As String, EstatusFacturacion As Boolean, @@ -768,6 +769,37 @@ Public Class ClsSisEmpresas Return Retorno End Function + + + Public Function UpdateEmpresasCertificados(ArchivoKey As String, ArchivoCer As String, ArchivoPfx As String, CveEmpresa As Integer) As Boolean + + + Dim Retorno As Boolean = False + + DataAdapter("PA_Sis_EmpresasCertificadosUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@ArchivoKey", SqlDbType.VarChar).Value = ArchivoKey + .Add("@ArchivoCer", SqlDbType.VarChar).Value = ArchivoCer + .Add("@ArchivoPfx", SqlDbType.VarChar).Value = ArchivoPfx + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Alert("Ocurrió un error al actualizar los archivos de certificados", TipoMensaje.MsgAdvertencia) + Catch ex As Exception + OnError("Ocurrió un error al actualizar los archivos de certificados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + + Public Function UpdateEmpresaXWizard(Empresa As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Ciudad As String, Estado As String, RFC As String, CP As Integer, Telefono As String, Contacto As String, Mail As String, Regimen As String, SendMail As String, SendMailPassword As String, SendMailServer As String, SendMailPuerto As Integer, SendMailSSL As Boolean, Buzon_Mail As String, Buzon_Server As String, Buzon_Puerto As Integer, Buzon_SSL As Boolean, Buzon_USR As String, Buzon_PWD As String, CveEmpresa As Integer, diff --git a/Empresas/119/Formatos/ReciboDePago.rdlc b/Empresas/119/Formatos/ReciboDePago.rdlc index 8fc36e37c..135892adf 100644 --- a/Empresas/119/Formatos/ReciboDePago.rdlc +++ b/Empresas/119/Formatos/ReciboDePago.rdlc @@ -702,7 +702,7 @@ - 0.39427cm + 0.43188cm @@ -798,6 +798,7 @@ 2pt + true @@ -901,7 +902,6 @@ es-MX - true @@ -938,7 +938,6 @@ 2pt - true @@ -970,13 +969,13 @@ Textbox108 = IIF( - Fields!Tra001ImporteDR.Value > 0 - OR Fields!Tra002ImporteDR.Value > 0 - OR Fields!Tra003ImporteDR.Value > 0 - OR Fields!Ret001ImporteDR.Value > 0 - OR Fields!Ret002ImporteDR.Value > 0 - OR Fields!Ret003ImporteDR.Value > 0 - ,False,True) + Fields!Tra001BaseDR.Value > 0 + OR Fields!Tra002BaseDR.Value > 0 + OR Fields!Tra003BaseDR.Value > 0 + OR Fields!Ret001BaseDR.Value > 0 + OR Fields!Ret002BaseDR.Value > 0 + OR Fields!Ret003BaseDR.Value > 0 + ,False,true) @@ -1564,7 +1563,7 @@ ImpPagado = IIF( - Fields!Tra001ImporteDR.Value > 0 + Fields!Tra001BaseDR.Value > 0 ,False,True) @@ -1923,7 +1922,7 @@ ImpPagado = IIF( - Fields!Tra002ImporteDR.Value > 0 + Fields!Tra002BaseDR.Value > 0 ,False,True) @@ -2282,7 +2281,7 @@ ImpPagado = IIF( - Fields!Tra003ImporteDR.Value > 0 + Fields!Tra003BaseDR.Value > 0 ,False,True) @@ -2641,7 +2640,7 @@ ImpPagado = IIF( - Fields!Ret001ImporteDR.Value > 0 + Fields!Ret001BaseDR.Value > 0 ,False,True) @@ -3000,7 +2999,7 @@ ImpPagado = IIF( - Fields!Ret002ImporteDR.Value > 0 + Fields!Ret002BaseDR.Value > 0 ,False,True) @@ -3359,13 +3358,14 @@ ImpPagado = IIF( - Fields!Ret003ImporteDR.Value > 0 + Fields!Ret003BaseDR.Value > 0 ,False,True) + es-MX @@ -3394,7 +3394,7 @@ Textbox95 = IIF( - Fields!Ret003ImporteDR.Value > 0 + Fields!Ret003BaseDR.Value > 0 ,False,True) - 12.4607cm + 12.1432cm @@ -510,9 +515,10 @@ CodigoPS + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -533,6 +539,7 @@ 0 @@ -544,9 +551,10 @@ TipoAgrupador + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -567,6 +575,7 @@ =Fields!E_Almacen.Value @@ -579,9 +588,10 @@ E_Almacen + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -602,6 +612,7 @@ 0 @@ -614,9 +625,10 @@ Paqueteria1 + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -637,6 +649,7 @@ =Fields!E_Traspaso.Value @@ -649,9 +662,10 @@ E_Traspaso + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -672,6 +686,7 @@ =Fields!E_Compra.Value @@ -684,9 +699,10 @@ E_Compra + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -707,6 +723,7 @@ 0 @@ -719,9 +736,10 @@ Fecha + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -742,6 +760,7 @@ =Fields!S_Almacen.Value @@ -754,9 +773,10 @@ S_Almacen + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -777,6 +797,7 @@ =Fields!S_Traspaso.Value @@ -789,9 +810,10 @@ S_Traspaso + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -812,6 +834,7 @@ 0 @@ -823,9 +846,10 @@ Textbox16 + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -846,6 +870,7 @@ 0 @@ -857,9 +882,10 @@ Textbox42 + =IIF(Fields!CvePSCargo.Value > 0, "White","Silver") 2pt 2pt 2pt @@ -900,7 +926,7 @@ DataSet1 0.10583cm 0.08377cm - 1.2148cm + 0.95022cm 20.80089cm - 1.01804cm + 0.6cm true true - 0.12694cm + 0.12693cm 0.01325cm 0cm 20.90669cm @@ -1146,7 +1172,6 @@ FechaConFormato - 0.30333cm 0.6cm 8.45793cm 1 @@ -1183,7 +1208,6 @@ FechaConFormato - 0.30333cm 8.69316cm 0.6cm 8.00814cm @@ -1221,7 +1245,6 @@ PageNumber - 0.30333cm 16.84241cm 0.6cm 4.00442cm @@ -1294,7 +1317,6 @@ ReportParameter1 - image/png diff --git a/Empresas/Grales/Formatos/ReciboDePago.rdlc b/Empresas/Grales/Formatos/ReciboDePago.rdlc index ebf4b91ac..0a4d324a6 100644 --- a/Empresas/Grales/Formatos/ReciboDePago.rdlc +++ b/Empresas/Grales/Formatos/ReciboDePago.rdlc @@ -724,7 +724,7 @@ - 0.51379cm + 0.39484cm @@ -986,13 +986,13 @@ Textbox108 = IIF( - Fields!Tra001ImporteDR.Value > 0 - OR Fields!Tra002ImporteDR.Value > 0 - OR Fields!Tra003ImporteDR.Value > 0 - OR Fields!Ret001ImporteDR.Value > 0 - OR Fields!Ret002ImporteDR.Value > 0 - OR Fields!Ret003ImporteDR.Value > 0 - ,False,True) + Fields!Tra001BaseDR.Value > 0 + OR Fields!Tra002BaseDR.Value > 0 + OR Fields!Tra003BaseDR.Value > 0 + OR Fields!Ret001BaseDR.Value > 0 + OR Fields!Ret002BaseDR.Value > 0 + OR Fields!Ret003BaseDR.Value > 0 + ,False,True) + + + + + + + + Reg RSCO + + + + + + +
  • + +
  • +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Inventarios/RegRSCO.aspx.vb b/Inventarios/RegRSCO.aspx.vb new file mode 100644 index 000000000..c55676cf8 --- /dev/null +++ b/Inventarios/RegRSCO.aspx.vb @@ -0,0 +1,232 @@ +Imports Extensiones +Partial Class Inventarios_RegRSCO + Inherits ClsPaginas + + Private Property CveCompuestoVigencia As Integer + Get + + If ViewState("CveCompuestoVigencia") Is Nothing Then + Return -1 + Else + Return ViewState("CveCompuestoVigencia").ToString().ToEntero() + End If + End Get + Set(ByVal value As Integer) + ViewState("CveCompuestoVigencia") = value + End Set + End Property + + Private Sub Inventarios_RegRSCO_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaCombos() + + CargaDatos() + End If + End Sub + + + + + + + Public Sub CargaDatos() + + + Dim ObjInventarios As New ClsInventarios + + If ObjInventarios.GetCompuestosVigencia(-1, -1, MinFecha, MaxFecha, 1, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjInventarios.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjInventarios.Dispose() + GvDatos.DataBind() + UpDatos.Update() + + + End Sub + + Private Sub CargaCombos() + + + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Seleccione Uno" + DdlProveedores.SelectedValue = "-1" + + + Dim ObjPS As New ClsProductosServicios + + If ObjPS.GetCompuestosActivos(UsuarioActual.CveEmpresa) Then + DdlCompuesto.DataSource = ObjPS.DtResultados + Else + DdlCompuesto.DataSource = Nothing + End If + + ObjPS.Dispose() + DdlCompuesto.DataBind() + DdlCompuesto.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + + + + UpModalRSCO.Update() + + End Sub + + Private Sub LimpiarModalDivAgregarRSCO() + CveCompuestoVigencia = -1 + + BtnAgregarRSCO.Text = "Agregar" + + DdlProveedores.txtValue.Value = "-1" + DdlProveedores.txtText.Value = "" + + DdlCompuesto.SelectedValueExist(-1) + + TxtFechaVigencia.Text = "" + TxtRegistroRSCO.Text = "" + ChkFechaIndeterminada.Checked = False + + LtlTituloModal.Text = "Agregar RSCO" + + DivModalContinuarAgregando.Visible = True + ChkModalContinuarAgregando.Checked = True + + UpModalRSCO.Update() + End Sub + + Protected Sub LnkAgregarRSCO_Click(sender As Object, e As EventArgs) + + LimpiarModalDivAgregarRSCO() + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarRSCO")) + + End Sub + + Protected Sub LnkEditar_Click(sender As Object, e As EventArgs) + + BtnAgregarRSCO.Text = "Actualizar" + Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow) + + CveCompuestoVigencia = GvRow.DataKey("CveCompuestoVigencia").ToEntero() + + + + DdlProveedores.txtValue.Value = GvRow.DataKey("CveProveedor") + DdlProveedores.txtText.Value = GvRow.DataKey("NombreComercial") + + + DdlCompuesto.SelectedValueExist(GvRow.DataKey("CveCompuesto")) + TxtFechaVigencia.Text = GvRow.DataKey("FechaVigencia").ToDate.ToString("dd/MM/yyyy") + TxtRegistroRSCO.Text = GvRow.DataKey("RegistroRSCO") + ChkFechaIndeterminada.Checked = Boolean.Parse(GvRow.DataKey("VigenciaIndeterminada")) + + LtlTituloModal.Text = "Actualizar RSCO" + + DivModalContinuarAgregando.Visible = False + ChkModalContinuarAgregando.Checked = False + + + If ChkFechaIndeterminada.Checked Then + DvFechaVijencia.Visible = False + TxtFechaVigencia.Text = "01/01/1900" + Else + DvFechaVijencia.Visible = True + End If + + + + + UpModalRSCO.Update() + + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarRSCO")) + End Sub + + Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs) + + Dim ErrorAlElimiar As Boolean = False + + Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow) + + Dim CveCompuestoVigenciaEliminar = GvRow.DataKey("CveCompuestoVigencia").ToEntero() + + Using ObjInventarios As New ClsInventarios + + If (ObjInventarios.RemoveCompuestosVigencia(CveCompuestoVigenciaEliminar, UsuarioActual.CveEmpresa)) Then + + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarRSCO")) + Alert("RSCO Eliminado Correctamente.") + Else + ErrorAlElimiar = True + End If + End Using + + + If Not ErrorAlElimiar Then + GlobalDTInvCamiones(UsuarioActual.CveEmpresa) = Nothing + CargaDatos() + End If + + End Sub + + Protected Sub BtnAgregarRSCO_Click(sender As Object, e As EventArgs) + + Dim ErrorPrceso As Boolean = False + + + If DdlProveedores.SelectedValue.ToEntero <= 0 Then + Alert("Debe de seleccionar un proveedor.") + Exit Sub + End If + + Using ObjInventarios As New ClsInventarios + + If CveCompuestoVigencia <= 0 Then + If ObjInventarios.AddCompuestosVigencia(DdlCompuesto.SelectedValue.ToEntero, DdlProveedores.SelectedValue.ToEntero, TxtRegistroRSCO.Text, TxtFechaVigencia.Text.ToDate, ChkFechaIndeterminada.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + Alert("RSCO agregado correctamente") + Else + ErrorPrceso = True + End If + Else + If ObjInventarios.UpdateCompuestosVigencia(CveCompuestoVigencia, DdlCompuesto.SelectedValue.ToEntero, DdlProveedores.SelectedValue.ToEntero, TxtRegistroRSCO.Text, TxtFechaVigencia.Text.ToDate, ChkFechaIndeterminada.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + Alert("RSCO actualizado correctamente") + Else + ErrorPrceso = True + End If + End If + End Using + + + If Not ErrorPrceso Then + GlobalDTInvCamiones(UsuarioActual.CveEmpresa) = Nothing + CargaDatos() + + If Not ChkModalContinuarAgregando.Checked Then + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarRSCO")) + Else + LimpiarModalDivAgregarRSCO() + End If + + UpDatos.Update() + End If + + + + End Sub + + + + Protected Sub ChkFechaIndeterminada_CheckedChanged(sender As Object, e As EventArgs) + + If ChkFechaIndeterminada.Checked Then + DvFechaVijencia.Visible = False + TxtFechaVigencia.Text = "01/01/1900" + Else + DvFechaVijencia.Visible = True + TxtFechaVigencia.Text = "" + End If + + UpModalRSCO.Update() + + End Sub +End Class diff --git a/Inventarios/RepRSCO.aspx b/Inventarios/RepRSCO.aspx new file mode 100644 index 000000000..c7a13b4d0 --- /dev/null +++ b/Inventarios/RepRSCO.aspx @@ -0,0 +1,154 @@ +<%@ Page Title="Rep RSCO" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepRSCO.aspx.vb" Inherits="Inventarios_RepRSCO" EnableEventValidation="false" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + + Rep RSCO + + + + + + +
  • + +
  • +
    + + + +
    +
    + + + + + + + + +
    +
    +
    + + +
    +
    +
    +
    Proveedor:
    +
    + +
    +
    Compuesto:
    +
    + + +
    + +
    + Fecha Inicio: +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: + +
    +
    +
    + + + + +
    + + + + + + +
    + + + + +
    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + --%> + + + + + + + + + + + + + +
    + + + diff --git a/Inventarios/RepRSCO.aspx.vb b/Inventarios/RepRSCO.aspx.vb new file mode 100644 index 000000000..ddd0ca648 --- /dev/null +++ b/Inventarios/RepRSCO.aspx.vb @@ -0,0 +1,150 @@ +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class Inventarios_RepRSCO + Inherits ClsPaginas + + Private Property DTDatos As DataTable + Get + + If ViewState("DTDatos") Is Nothing Then + + ViewState("DTDatos") = New DataTable + End If + + Return DirectCast(ViewState("DTDatos"), DataTable) + + End Get + Set(ByVal value As DataTable) + ViewState("DTDatos") = value + End Set + End Property + + Private Sub Inventarios_RepRSCO_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CargaCombos() + + End If + End Sub + + + Public Sub CargaDatos() + + + Dim ObjInventarios As New ClsInventarios + + LnkDescargaExcel.Visible = False + + If ObjInventarios.RepCompuestosVigencia(DdlCompuesto.SelectedValue.ToEntero, DdlProveedores.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, 1, UsuarioActual.CveEmpresa) Then + + DTDatos = ObjInventarios.DtResultados + GvDatos.DataSource = DTDatos + If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then + LnkDescargaExcel.Visible = True + UpAcciones.Update() + End If + Else + GvDatos.DataSource = Nothing + End If + + ObjInventarios.Dispose() + GvDatos.DataBind() + UpDatos.Update() + + + End Sub + + Private Sub CargaCombos() + + + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Todos" + DdlProveedores.SelectedValue = "-1" + + + Dim ObjPS As New ClsProductosServicios + + If ObjPS.GetCompuestosActivos(UsuarioActual.CveEmpresa) Then + DdlCompuesto.DataSource = ObjPS.DtResultados + Else + DdlCompuesto.DataSource = Nothing + End If + + ObjPS.Dispose() + DdlCompuesto.DataBind() + DdlCompuesto.Items.Insert(0, New ListItem("Todos", "-1")) + + + txtFechaF.Text = Now.ToString("dd/MM/yyyy") + txtFechaI.Text = txtFechaF.Text.ToDate.AddMonths(-2).ToString("dd/MM/yyyy") + + + + End Sub + + + + + + + Protected Sub LnkDescargaExcel_Click(sender As Object, e As EventArgs) + ImprimirReporte("EXCEL") + End Sub + + + Private Sub ImprimirReporte(Optional Formato As String = "PDF") + + Dim ObjTareas As New ClsOIEventos + Dim params As New List(Of ReportParameter) + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + Dim FechaI, FechaF As String + FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) + FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) + + + params.Add(New ReportParameter("Filtros", FiltrosUsados())) + 'params.Add(New ReportParameter("GPO", DdlGrupo.SelectedItem.Text)) + params.Add(New ReportParameter("Titulo", "Reporte RSCO")) + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("FechaInicio", FechaI)) + params.Add(New ReportParameter("FechaFin", FechaF)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString)) + + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}")) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + + ImprimirPDF("Empresas\Grales\Formatos\RepRSCO.rdlc", DTDatos, params, "RepRSCO" & Now.ToString("yyyyMMddmmss"), Formato:=Formato) + + End Sub + + Private Function FiltrosUsados() As String + Dim Filtros As String = "" + + If DdlProveedores.SelectedValue.ToEntero > 0 Then + Filtros = $"Proveedor: {DdlProveedores.txtText.Value}, " + End If + + If DdlCompuesto.SelectedValue.ToEntero > 0 Then + Filtros = Filtros & $"Compuesto: {DdlProveedores.txtText.Value}, " + End If + + + Filtros = Filtros & $"Fecha Inicio: {txtFechaI.Text}, Fecha Fin: {txtFechaF.Text}" + + Return Filtros + + End Function + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub +End Class From d918a76ad371abe74766eba3de2822c50bda40dd Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 29 Jun 2022 09:26:52 -0700 Subject: [PATCH 04/11] Concepto de entrada ExA al generar la prepoliza --- App_Code/Modelos.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 37ac787cc..e60e23e27 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4305,7 +4305,7 @@ Namespace Modelos Dim TipoMovto68 As Boolean = True Dim TipoMovto69 As Boolean = False - If CveConcepto.Contiene(18) Then + If CveConcepto.Contiene(18, 9) Then TipoMovto68 = False TipoMovto69 = True End If From a929cb71396e915ed71056e5ae2d213f19268f76 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 29 Jun 2022 09:27:19 -0700 Subject: [PATCH 05/11] Cambio de nombre metodo BASF_POG40 --- Ashx/E119.ashx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx index 2c1abbc0b..782584b41 100644 --- a/Ashx/E119.ashx +++ b/Ashx/E119.ashx @@ -100,7 +100,7 @@ Public Class E119 : Implements IHttpHandler Try Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString()) 'OBTENER EXISTENCIAS - If Metodo = "ConsultaBASF_POG" Then + If Metodo = "BASF_POG40" Then context.Response.ContentType = "application/json" Dim Auth = ValidarSolicitud(context) From ee75258ef23edd15940e02d89b8600b3fcd13c80 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 29 Jun 2022 09:28:18 -0700 Subject: [PATCH 06/11] Optimizacion de carga de obj factura en ventas --- Ventas/Ventas.aspx.vb | 148 ++++++++++++++++++++++++------------------ 1 file changed, 84 insertions(+), 64 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 0bb525ab2..c2dbb51a0 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -9578,7 +9578,7 @@ Partial Class Ventas Try 'MANDA CORREO Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) - Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False) + Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST)) Hilo.Start() Catch ex As Exception @@ -15195,7 +15195,7 @@ Partial Class Ventas End Try If CveVenta > 0 Then - ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False) + ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False) End If LocalSerieFolio = ObjFactura.SerieFolio @@ -16433,7 +16433,7 @@ Partial Class Ventas Try 'MANDA CORREO Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port) - Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False) + Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(ChkEnviarFactura.Checked, Factura, UsuarioActual, strURLHOST)) Hilo.Start() Catch ex As Exception @@ -23693,7 +23693,7 @@ Partial Class Ventas End Function Public Sub EnviarPDFCancelacion(CveVenta As Integer) - Dim FacturaRef As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa) + Dim FacturaRef As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, CargaDTDetalle:=False, CargaDatosRelacionados:=False) If FacturaRef IsNot Nothing Then Dim ObjetoPDF As Byte() = DescargarPDF(Encripta(String.Format("OP=CAN&CVEVTA={0}", CveVenta))) @@ -26942,10 +26942,20 @@ Partial Class Ventas If CveVentaUsado > 0 Then DivSMU.Visible = True - Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa) - Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal() - HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() - LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) + 'Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) + Dim DtDetalleUsado As DataTable = Nothing + Using ObjVentas As New ClsVentas + If ObjVentas.GetVentaDetalle(CveVentaUsado) Then + DtDetalleUsado = ObjVentas.DtResultados.Copy() + End If + End Using + + If DtDetalleUsado IsNot Nothing Then + Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() + HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() + LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) + End If + Else If CargarSoloGarantias Then Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True") @@ -27062,17 +27072,27 @@ Partial Class Ventas If CveVentaUsado > 0 Then DivSMU.Visible = True - Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa) - Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal() + 'Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa) + Dim DtDetalleUsado As DataTable = Nothing + Using ObjVentas As New ClsVentas + If ObjVentas.GetVentaDetalle(CveVentaUsado) Then + DtDetalleUsado = ObjVentas.DtResultados.Copy() + End If + End Using - If SaldoMaximoUsados > 0 Then - HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() - LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) - Else - HdnSaldoMaximoUsados.Value = "0" - LtlSMU.Text = "0" + If DtDetalleUsado IsNot Nothing Then + Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() + + If SaldoMaximoUsados > 0 Then + HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() + LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) + Else + HdnSaldoMaximoUsados.Value = "0" + LtlSMU.Text = "0" + End If End If + Else If CargaSoloGarantias Then Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Total", "TipoRNC = 1") @@ -30196,59 +30216,59 @@ Partial Class Ventas UpParametros.Update() End Sub - Private Function AjustarTotalCotizacionFacturada(CveCotizacion As Integer, TotalAjustar As Decimal) As Boolean - Dim ErrorAjuste As Boolean = False + 'Private Function AjustarTotalCotizacionFacturada(CveCotizacion As Integer, TotalAjustar As Decimal) As Boolean + ' Dim ErrorAjuste As Boolean = False - Dim ObjCotizacion As New Modelos.Factura(UsuarioActual, CveCotizacion, UsuarioActual.CveEmpresa) + ' Dim ObjCotizacion As New Modelos.Factura(UsuarioActual, CveCotizacion, UsuarioActual.CveEmpresa) - If ObjCotizacion.CveMoneda = 1 Then - Dim TotalNuevoDocumento As Decimal = TotalAjustar + ' If ObjCotizacion.CveMoneda = 1 Then + ' Dim TotalNuevoDocumento As Decimal = TotalAjustar - Dim Diferencia As Decimal = (ObjCotizacion.Total - TotalNuevoDocumento) + ' Dim Diferencia As Decimal = (ObjCotizacion.Total - TotalNuevoDocumento) - If Diferencia <> 0 Then - 'AJUSTAR EN EL IVA - For Each RowNuevoDocumento As DataRow In TmpDT.Rows - Dim CveVentaDetalleCotizacion As Integer = RowNuevoDocumento("CveVentaDetalleCotizacion").ToString().ToEntero() + ' If Diferencia <> 0 Then + ' 'AJUSTAR EN EL IVA + ' For Each RowNuevoDocumento As DataRow In TmpDT.Rows + ' Dim CveVentaDetalleCotizacion As Integer = RowNuevoDocumento("CveVentaDetalleCotizacion").ToString().ToEntero() - Dim ImporteIVANuevoDocumento As Decimal = RowNuevoDocumento("ImporteIVA").ToString().ToDecimal() - Dim ImporteIEPSNuevoDocumento As Decimal = RowNuevoDocumento("ImporteIEPS").ToString().ToDecimal() + ' Dim ImporteIVANuevoDocumento As Decimal = RowNuevoDocumento("ImporteIVA").ToString().ToDecimal() + ' Dim ImporteIEPSNuevoDocumento As Decimal = RowNuevoDocumento("ImporteIEPS").ToString().ToDecimal() - If CveVentaDetalleCotizacion > 0 Then - 'AJUSTAR IVA - If ImporteIVANuevoDocumento > 0 Then - Dim ImporteIVACotizacion As Decimal = ObjCotizacion.DtDetalle.FiltroPrimeroValor("ImporteIVA", $"CveVentaDetalle={CveVentaDetalleCotizacion}").ToDecimal + ' If CveVentaDetalleCotizacion > 0 Then + ' 'AJUSTAR IVA + ' If ImporteIVANuevoDocumento > 0 Then + ' Dim ImporteIVACotizacion As Decimal = ObjCotizacion.DtDetalle.FiltroPrimeroValor("ImporteIVA", $"CveVentaDetalle={CveVentaDetalleCotizacion}").ToDecimal - If ImporteIVANuevoDocumento <> ImporteIVACotizacion Then - RowNuevoDocumento("ImporteIVA") = ImporteIVACotizacion - End If - End If + ' If ImporteIVANuevoDocumento <> ImporteIVACotizacion Then + ' RowNuevoDocumento("ImporteIVA") = ImporteIVACotizacion + ' End If + ' End If - 'AJUSTAR IEPS - If ImporteIEPSNuevoDocumento > 0 Then - Dim ImporteIEPSCotizacion As Decimal = ObjCotizacion.DtDetalle.FiltroPrimeroValor("ImporteIEPS", $"CveVentaDetalle={CveVentaDetalleCotizacion}").ToDecimal + ' 'AJUSTAR IEPS + ' If ImporteIEPSNuevoDocumento > 0 Then + ' Dim ImporteIEPSCotizacion As Decimal = ObjCotizacion.DtDetalle.FiltroPrimeroValor("ImporteIEPS", $"CveVentaDetalle={CveVentaDetalleCotizacion}").ToDecimal - If ImporteIEPSNuevoDocumento <> ImporteIEPSCotizacion Then - RowNuevoDocumento("ImporteIEPS") = ImporteIEPSCotizacion - End If - End If + ' If ImporteIEPSNuevoDocumento <> ImporteIEPSCotizacion Then + ' RowNuevoDocumento("ImporteIEPS") = ImporteIEPSCotizacion + ' End If + ' End If - End If - Next - End If + ' End If + ' Next + ' End If - CalculaTotalesVenta(RecalculaImpuestosLocales:=False) + ' CalculaTotalesVenta(RecalculaImpuestosLocales:=False) - If Math.Abs(ObjCotizacion.Total - TotalAjustar) > 0 OrElse Math.Abs(TxtTotal.Text.ToDecimal - TotalAjustar) > 0 Then - ErrorAjuste = True - End If + ' If Math.Abs(ObjCotizacion.Total - TotalAjustar) > 0 OrElse Math.Abs(TxtTotal.Text.ToDecimal - TotalAjustar) > 0 Then + ' ErrorAjuste = True + ' End If - End If - ObjCotizacion.Dispose() + ' End If + ' ObjCotizacion.Dispose() - Return Not ErrorAjuste - End Function + ' Return Not ErrorAjuste + 'End Function Private Class MVentaDetalleCotizacion Public Property CveVentaDetalle As Integer @@ -32135,7 +32155,7 @@ Partial Class Ventas Dim TerminarCiclo As Boolean = False For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows - Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim TotalRNC As Decimal = 0 For Each GvRow As GridViewRow In GvRemisionesNCDetalle.Rows @@ -32191,7 +32211,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvRemisionesNC.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() 'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO RemNC.Num3 = DdlVentaUsado.SelectedValue.ToEntero() @@ -32255,7 +32275,7 @@ Partial Class Ventas Dim TerminarCiclo As Boolean = False For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows - Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim TotalRNC As Decimal = 0 For Each GvRow As GridViewRow In GvRemisionesNCBonDetalle.Rows @@ -32311,7 +32331,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero() TotalRemNCAplicado += RemNC.TotalRemNCAplicado @@ -32436,7 +32456,7 @@ Partial Class Ventas Dim TerminarCiclo As Boolean = False For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows - Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim TotalRNC As Decimal = 0 For Each GvRow As GridViewRow In GvDescNCCargosDetalle.Rows @@ -32507,7 +32527,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvDescNCCargos.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() TotalRemNCAplicado += RemNC.TotalRemNCAplicado @@ -32591,7 +32611,7 @@ Partial Class Ventas Dim TerminarCiclo As Boolean = False For Each Dr As DataRow In TmpDTRNCBonificacionDetalleSeleccionadas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows - Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) Dim TotalRNC As Decimal = 0 For Each GvRow As GridViewRow In GvDescNCBonDetalle.Rows @@ -32647,7 +32667,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvDescNCBonificaciones.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero() TotalRemNCAplicado += RemNC.TotalRemNCAplicado @@ -32669,7 +32689,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvDescNCBonificaciones.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero() TotalRemNCAplicado += RemNC.TotalRemNCAplicado @@ -33915,7 +33935,7 @@ Partial Class Ventas For Each GvRow As GridViewRow In GvRNCDevoluciones.Rows If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.FCCheckBox("ChkAplicar").Checked Then - Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) + Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa, CargaDatosCliente:=False, CargaDatosRelacionados:=False) RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() TotalRemNCAplicado += RemNC.TotalRemNCAplicado From f28317c346df4aba995eacc3f38e281e24abe8f1 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 29 Jun 2022 10:07:33 -0700 Subject: [PATCH 07/11] Reportes Cambiar Cliente y proveedor a dropdown lost, Compras Editar Fecha de compra, reg prepolizas s agregar IE cuando ya esta creada la poliza --- App_Code/ClsCompras.vb | 19 +- App_Code/ClsContabilidad.vb | 4 +- App_Code/ClsGenerales.vb | 2 +- Compras/Compras.aspx | 66 ++++--- Compras/Compras.aspx.vb | 27 +++ Compras/RepPagado.aspx | 3 +- Compras/RepPagado.aspx.cs | 16 +- Compras/RepPagadoDetalle.aspx | 3 +- Compras/RepPagadoDetalle.aspx.cs | 9 +- Compras/RepPagadoPeriodo.aspx | 6 +- Compras/RepPagadoPeriodo.aspx.cs | 13 +- Compras/eFacturas.aspx | 67 ++++++- Compras/eFacturas.aspx.vb | 73 ++++++-- Contabilidad/RegPrePolizaS.aspx | 2 +- Contabilidad/RegPrePolizaS.aspx.vb | 60 ++++++- Empresas/Grales/Formatos/RepFacturas.rdlc | 190 +++++++++++++++----- General/SaldosIniciales.aspx.vb | 3 +- Inventarios/RepEntregaAlmacenRuta.aspx.cs | 37 +++- Ventas/RepProductosServiciosPeriodo.aspx | 6 +- Ventas/RepProductosServiciosPeriodo.aspx.cs | 24 +-- Ventas/RepRecuperacionPeriodo.aspx | 5 +- Ventas/RepRecuperacionPeriodo.aspx.cs | 9 +- Ventas/RepVentasPeriodo.aspx | 6 +- Ventas/RepVentasPeriodo.aspx.vb | 38 ++-- 24 files changed, 536 insertions(+), 152 deletions(-) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 5750cf281..5c4bd2ae9 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -3182,6 +3182,24 @@ Public Class ClsCompras Return Retorno End Function + + Public Function UpdateFechaCompra(CveCompra As Integer, Fecha As Date, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Comp_ComprasFechaUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCompra", SqlDbType.Int).Value = CveCompra + .Add("@Fecha", SqlDbType.Date).Value = Fecha + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar la fecha de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + Return Retorno + End Function + Public Function GetRepEvaluacionesProveedores(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, Evaluado As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_RepEvaluacionesProveedoresGet") @@ -3338,7 +3356,6 @@ Public Class ClsCompras End Function - End Class diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index e14cd2203..fb3ada64a 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -291,7 +291,7 @@ Public Class ClsContabilidad Public Function UpdatePrePolizasDetalle(CvePrePolizaDetalle As Integer, Concepto As String, CveSubProyecto As Integer, IdCtaContable As Integer, TipoMovto As Boolean, ImporteMN As Decimal, Optional CveTipoGasto As Integer = -1, Optional CveConceptoContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCompra As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveCliente As Integer = -1, Optional CveVenta As Integer = -1, - Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional CveCuenta As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1, Optional Importe As Decimal = -1) As Boolean + Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional CveCuenta As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1, Optional Importe As Decimal = -1, Optional CveIE As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -316,6 +316,8 @@ Public Class ClsContabilidad .Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta + .Add("@CveIE", SqlDbType.Int).Value = CveIE + End With Try diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 8d10ef979..90c5be8f7 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -4059,7 +4059,7 @@ Public Class ClsGenerales Dim Retorno As Boolean = False - DataAdapter("PA_Inv_EntregaAlmacenRutaRepGet") + DataAdapter("PA_Inv_EntregaAlmacenRutaRepGet2") With SqlAdapter.SelectCommand.Parameters diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 198291fb2..7339893cb 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -288,32 +288,50 @@
    -
    - Fecha Factura: -
    -
    + + + + + + + + + +
    Fecha Factura: + - - - - - - - - - - - - - + +
    + + + + + +
    Descripción:
    diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 1d54b6c32..3de4b8463 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1899,6 +1899,8 @@ Partial Class Compras_Compras ImgFecha.Enabled = UsuarioActual.TienePermisoProceso(216) CEFecha.Enabled = UsuarioActual.TienePermisoProceso(216) + + TxtSubTotal.Enabled = False TxtDescuento.Enabled = False TxtSubTotal2.Enabled = False @@ -2901,6 +2903,16 @@ Partial Class Compras_Compras ImgFecha.Enabled = False CEFecha.Enabled = False + + If UsuarioActual.TienePermisoProceso(342) Then + TxtFecha.Enabled = True + ImgFecha.Enabled = True + CEFecha.Enabled = True + LnkActualziarFechadecompra.Visible = True + End If + + + DdlProveedor.Enabled = False DdlProveedorSucursal.Enabled = False DdlEstatus.Enabled = False @@ -21142,6 +21154,21 @@ Partial Class Compras_Compras Private Sub ChkAliasFlexible_CheckedChanged(sender As Object, e As EventArgs) Handles ChkAliasFlexible.CheckedChanged TxtPSAlias.Enabled = ChkAliasFlexible.Checked End Sub + + Protected Sub LnkActualziarFechadecompra_Click(sender As Object, e As EventArgs) + + + Dim ObjCompra As New ClsCompras + + + If ObjCompra.UpdateFechaCompra(CveCompra, TxtFecha.Text.ToDate, UsuarioActual.CveEmpresa) Then + Alert("Fecha Actualizada Correctamente") + End If + + + ObjCompra.Dispose() + + End Sub End Class Public Class MMensajeDevolucion diff --git a/Compras/RepPagado.aspx b/Compras/RepPagado.aspx index b5dfcc606..621d4d3ec 100644 --- a/Compras/RepPagado.aspx +++ b/Compras/RepPagado.aspx @@ -61,8 +61,7 @@
    Proveedor:
    - - +
    Fecha Inicial:
    diff --git a/Compras/RepPagado.aspx.cs b/Compras/RepPagado.aspx.cs index b5dafa73c..5a0ea0a4f 100644 --- a/Compras/RepPagado.aspx.cs +++ b/Compras/RepPagado.aspx.cs @@ -42,9 +42,10 @@ public partial class Compras_RepPagado : ClsPaginas DdlMoneda.DataBind(); //Carga Proveedor - DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); - DdlProveedor.Items.Insert(0, new ListItem("Todos", "-1")); - DdlProveedor.DataBind(); + DdlProveedores.setEsWebService(true); + DdlProveedores.Attributes.Add("data-metodo", "getproveedores"); + DdlProveedores.SelectedText = "Todos"; + DdlProveedores.SelectedValue = "-1"; //Carga Usuarios DdlUsuario.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); @@ -163,7 +164,7 @@ public partial class Compras_RepPagado : ClsPaginas private void CargaDatos() { ClsCompras ObjComp = new ClsCompras(); - if (ObjComp.GetRepPagado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlProveedor.SelectedValue.ToEntero(), DdlProyecto.SelectedValue.ToEntero(), + if (ObjComp.GetRepPagado(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlProveedores.SelectedValue.ToEntero(), DdlProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedValue.ToEntero(), DdlUsuario.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero(), DdlResponsable.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, DdlBanco.SelectedValue.ToEntero(), DdlCuentaBancaria.SelectedValue.ToEntero(), DdlMoneda.SelectedValue.ToEntero(),TxtFechaICompra.Text.ToDate(),TxtFechaFCompra.Text.ToDate(),CveTipoProveedor: DdlTipoProveedor.SelectedValue.ToEntero(), @@ -229,8 +230,8 @@ public partial class Compras_RepPagado : ClsPaginas StrFiltro.AppendFormat(" SubProyecto: {0}", DdlSubProyecto.SelectedItem.Text); if (DdlGrupo.SelectedValue != "-1") StrFiltro.AppendFormat(" Grupo: {0}", DdlGrupo.SelectedItem.Text); - if (DdlProveedor.SelectedValue != "-1") - StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedor.SelectedItem.Text); + if (DdlProveedores.SelectedValue != "-1") + StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedores.txtText.Value); if (DdlUsuario.SelectedValue != "-1") StrFiltro.AppendFormat(" Registro: {0}", DdlUsuario.SelectedItem.Text); if (DdlResponsable.SelectedValue != "-1") @@ -251,12 +252,14 @@ public partial class Compras_RepPagado : ClsPaginas } System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)); + string logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa); List para = new List(); para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)); para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)); para.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString())); para.Add(new ReportParameter("Filtros", StrFiltro.ToString())); + if (Imagen.Exists) { para.Add(new ReportParameter("LogoPath", logouri)); @@ -265,6 +268,7 @@ public partial class Compras_RepPagado : ClsPaginas { para.Add(new ReportParameter("LogoPath", "")); } + ImprimirPDF(RutaPDF,DtPagado, para, "RepPagado" + DateTime.Now.ToString("yyyyMMddhhmmss"), Opcion); } diff --git a/Compras/RepPagadoDetalle.aspx b/Compras/RepPagadoDetalle.aspx index 4a831abc4..cea78df58 100644 --- a/Compras/RepPagadoDetalle.aspx +++ b/Compras/RepPagadoDetalle.aspx @@ -48,8 +48,7 @@
    Proveedor:
    - - +
    Fecha Inicial:
    diff --git a/Compras/RepPagadoDetalle.aspx.cs b/Compras/RepPagadoDetalle.aspx.cs index 326d99ed8..1ad46e4ff 100644 --- a/Compras/RepPagadoDetalle.aspx.cs +++ b/Compras/RepPagadoDetalle.aspx.cs @@ -47,9 +47,10 @@ public partial class Compras_RepPágadoDetalle : ClsPaginas DdlMoneda.DataBind(); //Carga Proveedor - DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); - DdlProveedor.Items.Insert(0, new ListItem("Todos", "-1")); - DdlProveedor.DataBind(); + DdlProveedores.setEsWebService(true); + DdlProveedores.Attributes.Add("data-metodo", "getproveedores"); + DdlProveedores.SelectedText = "Todos"; + DdlProveedores.SelectedValue = "-1"; //Carga Usuarios DdlUsuario.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); @@ -87,7 +88,9 @@ public partial class Compras_RepPágadoDetalle : ClsPaginas DdlGrupo.SelectedValueExist(Request["Grupo"] == null ? "-1" : Request["Grupo"].ToString()); DdlProyecto.SelectedValueExist(Request["CveProyecto"] == null ? "-1" : Request["CveProyecto"].ToString()); DdlSubProyecto.SelectedValueExist(Request["CveSubProyecto"] == null ? "-1" : Request["CveSubProyecto"].ToString()); + DdlProveedor.SelectedValueExist(Request["CveProveedor"] == null ? "-1" : Request["CveProveedor"].ToString()); + DdlUsuario.SelectedValueExist(Request["CveUsuario"] == null ? "-1" : Request["CveUsuario"].ToString()); DdlResponsable.SelectedValueExist(Request["CveResponsable"] == null ? "-1" : Request["CveResponsable"].ToString()); DdlBanco.SelectedValueExist(Request["CveBanco"] == null ? "-1" : Request["CveBanco"].ToString()); diff --git a/Compras/RepPagadoPeriodo.aspx b/Compras/RepPagadoPeriodo.aspx index 3cc0b24ea..1b9988cdc 100644 --- a/Compras/RepPagadoPeriodo.aspx +++ b/Compras/RepPagadoPeriodo.aspx @@ -64,8 +64,10 @@
    Proveedor:
    - - + <%-- + --%> + +
    Fecha Inicial:
    diff --git a/Compras/RepPagadoPeriodo.aspx.cs b/Compras/RepPagadoPeriodo.aspx.cs index c514e6827..89e3b951d 100644 --- a/Compras/RepPagadoPeriodo.aspx.cs +++ b/Compras/RepPagadoPeriodo.aspx.cs @@ -50,9 +50,10 @@ public partial class Compras_RepPagadoPeriodo : ClsPaginas DdlMoneda.DataBind(); //Carga Proveedor - DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa); - DdlProveedor.Items.Insert(0, new ListItem("Todos", "-1")); - DdlProveedor.DataBind(); + DdlProveedores.setEsWebService(true); + DdlProveedores.Attributes.Add("data-metodo", "getproveedores"); + DdlProveedores.SelectedText = "Todos"; + DdlProveedores.SelectedValue = "-1"; //Carga Usuarios DdlUsuario.DataSource = get_GlobalDTUsuarios(CveEmpresa: UsuarioActual.CveEmpresa); @@ -278,8 +279,8 @@ public partial class Compras_RepPagadoPeriodo : ClsPaginas StrFiltro.AppendFormat(" SubProyecto: {0}", DdlSubProyecto.SelectedItem.Text); if (DdlGrupo.SelectedValue != "-1") StrFiltro.AppendFormat(" Grupo: {0}", DdlGrupo.SelectedItem.Text); - if (DdlProveedor.SelectedValue != "-1") - StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedor.SelectedItem.Text); + if (DdlProveedores.SelectedValue != "-1") + StrFiltro.AppendFormat(" Proveedor: {0}", DdlProveedores.txtText.Value); if (DdlUsuario.SelectedValue != "-1") StrFiltro.AppendFormat(" Registro: {0}", DdlUsuario.SelectedItem.Text); if (DdlResponsable.SelectedValue != "-1") @@ -332,7 +333,7 @@ public partial class Compras_RepPagadoPeriodo : ClsPaginas { if (RblTipoCambio.SelectedValue.ToEntero() == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; } ClsCompras ObjCompras = new ClsCompras(); - if(ObjCompras.GetRepPagadoPeriodo(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlProveedor.SelectedValue.ToEntero(), DdlProyecto.SelectedValue.ToEntero(), + if(ObjCompras.GetRepPagadoPeriodo(txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), DdlProveedores.SelectedValue.ToEntero(), DdlProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedValue.ToEntero(), DdlUsuario.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero(), DdlResponsable.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, DdlBanco.SelectedValue.ToEntero(), DdlCuentaBancaria.SelectedValue.ToEntero(), DdlMoneda.SelectedValue.ToEntero(), TxtFechaICompra.Text.ToDate(), TxtFechaFCompra.Text.ToDate(), TipoCambio, TCEspecifico)){ diff --git a/Compras/eFacturas.aspx b/Compras/eFacturas.aspx index d0a48c42f..153b98772 100644 --- a/Compras/eFacturas.aspx +++ b/Compras/eFacturas.aspx @@ -69,9 +69,16 @@
  • Bitácora Facturas
  • -
  • +
  • Vinculación Masiva Complementos
  • + +
  • + Personalizar +
  • + + + @@ -196,6 +203,7 @@ + @@ -260,6 +268,14 @@ + + <%--Folio Fiscal 11--%> + + + + + + <%----%> @@ -372,6 +388,13 @@ + + <%-- Folio Fiscal 9 --%> + + + + + @@ -485,6 +508,12 @@ + + <%-- Folio Fiscal 9 --%> + + + + @@ -898,6 +927,36 @@
    + + + + + + +