diff --git a/AC/RepSituacionFinanciera.aspx.vb b/AC/RepSituacionFinanciera.aspx.vb index 9a029a39f..36109f21b 100644 --- a/AC/RepSituacionFinanciera.aspx.vb +++ b/AC/RepSituacionFinanciera.aspx.vb @@ -1,655 +1,656 @@ -Option Explicit On -Option Strict On - -Imports System.Data -Imports Extensiones -Imports Microsoft.Reporting.WebForms -Partial Class AC_SituacionFinanciera - Inherits ClsPaginas - -#Region "PROPIEDADES" - Private Property DtDatos As DataTable - Get - DtDatos = DirectCast(ViewState("DtDatos"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtDatos") = value - End Set - End Property - Private Property DtCuentasOrden As DataTable - Get - DtCuentasOrden = DirectCast(ViewState("DtCuentasOrden"), DataTable) - End Get - - Set(ByVal value As DataTable) - ViewState("DtCuentasOrden") = value - End Set - End Property - Private Property TotalActivoActual As Double - Get - TotalActivoActual = ViewState("TotalActivoActual").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalActivoActual") = value - End Set - End Property - Private Property TotalActivoAnterior As Double - Get - TotalActivoAnterior = ViewState("TotalActivoAnterior").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalActivoAnterior") = value - End Set - End Property - Private Property TotalPasivoActual As Double - Get - TotalPasivoActual = ViewState("TotalPasivoActual").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPasivoActual") = value - End Set - End Property - Private Property TotalPasivoAnterior As Double - Get - TotalPasivoAnterior = ViewState("TotalPasivoAnterior").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPasivoAnterior") = value - End Set - End Property - Private Property TotalPatrimonioActual As Double - Get - TotalPatrimonioActual = ViewState("TotalPatrimonioActual").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPatrimonioActual") = value - End Set - End Property - Private Property TotalPatrimonioAnterior As Double - Get - TotalPatrimonioAnterior = ViewState("TotalPatrimonioAnterior").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPatrimonioAnterior") = value - End Set - End Property - Private Property TotalPasivoPatrimonioActual As Double - Get - TotalPasivoPatrimonioActual = ViewState("TotalPasivoPatrimonioActual").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPasivoPatrimonioActual") = value - End Set - End Property - Private Property TotalPasivoPatrimonioAnterior As Double - Get - TotalPasivoPatrimonioAnterior = ViewState("TotalPasivoPatrimonioAnterior").ToString.ToDouble - End Get - Set(value As Double) - ViewState("TotalPasivoPatrimonioAnterior") = value - End Set - End Property - Private Property FechaInicioActual As Date - Get - FechaInicioActual = ViewState("FechaInicioActual").ToString.ToDate - End Get - Set(value As Date) - ViewState("FechaInicioActual") = value - End Set - End Property - Private Property FechaFinActual As Date - Get - FechaFinActual = ViewState("FechaFinActual").ToString.ToDate - End Get - Set(value As Date) - ViewState("FechaFinActual") = value - End Set - End Property - Private Property FechaInicioAnterior As Date - Get - FechaInicioAnterior = ViewState("FechaInicioAnterior").ToString.ToDate - End Get - Set(value As Date) - ViewState("FechaInicioAnterior") = value - End Set - End Property - Private Property FechaFinAnterior As Date - Get - FechaFinAnterior = ViewState("FechaFinAnterior").ToString.ToDate - End Get - Set(value As Date) - ViewState("FechaFinAnterior") = value - End Set - End Property - Private Property TipoReporte As Integer - Get - TipoReporte = ViewState("TipoReporte").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("TipoReporte") = value - End Set - End Property -#End Region - - Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load - If Not Page.IsPostBack Then - - If UsuarioActual.Empresa.UsaAC Then - TipoReporte = -1 - Else - TipoReporte = 1 - tdTipoReporte.Visible = True - LtTitulo.Text = "Balance General" - End If - - - TotalActivoActual = 0 - TotalActivoAnterior = 0 - TotalPasivoActual = 0 - TotalPasivoAnterior = 0 - TotalPatrimonioActual = 0 - TotalPatrimonioAnterior = 0 - TotalPasivoPatrimonioActual = 0 - TotalPasivoPatrimonioAnterior = 0 - - 'TxtFechaInicio.Text = DateSerial(Year(Date.Now), 1, 1).ToShortDateString - 'TxtFechaFin.Text = Date.Now.ToShortDateString - - CargaEjercicios() - - CargaDatos() - - - End If - End Sub - - Private Sub CargaEjercicios() - Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa) - If ClsConta.GetEjercicios() Then - DdlEjercicio.DataSource = ClsConta.DtResultados - Else - DdlEjercicio.DataSource = Nothing - End If - ClsConta.Dispose() - DdlEjercicio.DataBind() - - DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString) - DdlPeriodo.SelectedValue = Now.Month.ToString - End Sub - - Private Sub CargaDatos() - Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - - Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) - Dim FechaF = FechaI.ToDate.LastDayOfMonth.ToShortDateString - TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero) - - GvActivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue - GvActivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString - - GvPasivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue - GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString - - Dim IdCuentaAhorroDesahorro = 9999 - - If UsuarioActual.CveEmpresa = 48 Then - IdCuentaAhorroDesahorro = 87 - End If - If UsuarioActual.CveEmpresa = 120 Then - IdCuentaAhorroDesahorro = 646 - End If - - If ObjConta.GetBalanceGeneral("01/01/1000".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, TipoReporte, UsuarioActual.Empresa.UsaAC, IdCuentaAhorroDesahorro) Then - DtDatos = ObjConta.DtResultados - - CargaGrids() - SumaTotales() - Else - DtDatos = Nothing - Alert("Ocurrio un error al cargar los datos del estado de situación financiera", TipoMensaje.MsgError) - End If - - ObjConta.Dispose() - End Sub - Private Sub CargaGrids() - - If Not ChkNivel.Checked Then - DtDatos = DtDatos.FiltraParametros("Level < 2") - End If - Dim CuentaAhorroDesahorro As Integer = 87 - - Select Case UsuarioActual.CveEmpresa - Case 120 - CuentaAhorroDesahorro = 646 - Case Else - CuentaAhorroDesahorro = 87 - End Select - - 'Defino Variables para el Orden - Dim Orden1, Orden2, Orden3, Orden4, Orden5, Orden6, Orden7 As String - If UsuarioActual.CveEmpresa = 48 Then Orden1 = "00011%" Else Orden1 = "011%" - If UsuarioActual.CveEmpresa = 48 Then Orden2 = "00012%" Else Orden2 = "012%" - If UsuarioActual.CveEmpresa = 48 Then Orden3 = "00021%" Else Orden3 = "021%" - If UsuarioActual.CveEmpresa = 48 Then Orden4 = "00022%" Else Orden4 = "022%" - If UsuarioActual.CveEmpresa = 48 Then Orden5 = "00031%" Else If UsuarioActual.CveEmpresa = 120 Then Orden5 = "0321%" Else Orden5 = "031%" - If UsuarioActual.CveEmpresa = 48 Then Orden6 = "00032%" Else Orden6 = "032%" - If UsuarioActual.CveEmpresa = 48 Then Orden7 = "00033%" Else Orden7 = "033%" - - 'ACTIVO - Dim DtActivoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden1}' ") - - Dim DtActivoNoCirculante As DataTable - - If UsuarioActual.CveEmpresa = 48 Then - DtActivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden2}' ") - Else - DtActivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden2}' ") - End If - - Dim Row As DataRow = DtActivoCirculante.NewRow - - If DtActivoCirculante.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = DtActivoCirculante.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtActivoCirculante.Rows(0)("ImporteAnterior").ToString - Row.Item("CtaMayor") = -1 - DtActivoCirculante.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL ACTIVO CIRCULANTE" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtActivoCirculante.Rows.Add(Row) - - - Row = DtActivoNoCirculante.NewRow - If DtActivoNoCirculante.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL ACTIVO NO CIRCULANTE" - - If UsuarioActual.CveEmpresa = 48 Then - Row.Item("ImporteActual") = DtActivoNoCirculante.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtActivoNoCirculante.Rows(0)("ImporteAnterior").ToString - ElseIf UsuarioActual.CveEmpresa = 120 Then - Row.Item("ImporteActual") = DtActivoNoCirculante.SUM("ImporteActual", " Sup ='ACTIVO NO CIRCULANTE' ") - Row.Item("ImporteAnterior") = DtActivoNoCirculante.SUM("ImporteAnterior", " Sup ='ACTIVO NO CIRCULANTE' ") - Else - Row.Item("ImporteActual") = DtActivoNoCirculante.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtActivoNoCirculante.Rows(0)("ImporteAnterior").ToString - End If - - - Row.Item("CtaMayor") = -1 - DtActivoNoCirculante.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL ACTIVO NO CIRCULANTE" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtActivoNoCirculante.Rows.Add(Row) - - GvActivo.DataSource = DtActivoCirculante - GvActivo.DataBind() - GvActivoNoCirculante.DataSource = DtActivoNoCirculante - GvActivoNoCirculante.DataBind() - UpActivo.Update() - - - 'PASIVO - Dim DtPasivoCirculante = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden3}' ") - Dim DtPasivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden4}' ") - - Row = DtPasivoCirculante.NewRow - If DtPasivoCirculante.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL PASIVO CIRCULANTE" - Row.Item("ImporteActual") = DtPasivoCirculante.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtPasivoCirculante.Rows(0)("ImporteAnterior").ToString - Row.Item("CtaMayor") = -1 - DtPasivoCirculante.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL PASIVO CIRCULANTE" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtPasivoCirculante.Rows.Add(Row) - - Row = DtPasivoNoCirculante.NewRow - If DtPasivoNoCirculante.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL PASIVO NO CIRCULANTE" - Row.Item("ImporteActual") = DtPasivoNoCirculante.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtPasivoNoCirculante.Rows(0)("ImporteAnterior").ToString - Row.Item("CtaMayor") = -1 - DtPasivoNoCirculante.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL PASIVO NO CIRCULANTE" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtPasivoNoCirculante.Rows.Add(Row) - - - GvPasivo.DataSource = DtPasivoCirculante - GvPasivo.DataBind() - GvPasivoNoCirculante.DataSource = DtPasivoNoCirculante - GvPasivoNoCirculante.DataBind() - UpPasivo.Update() - - - 'PATRIMONIO - Dim DtPatrimonioContribuido = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden5}' ") - Dim DtPatrimonioGenerado = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden6}' ") - Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden7}' ") - - Row = DtPatrimonioContribuido.NewRow - If DtPatrimonioContribuido.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL PATRIMONIO CONTRIBUIDO" - Row.Item("ImporteActual") = DtPatrimonioContribuido.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtPatrimonioContribuido.Rows(0)("ImporteAnterior").ToString - Row.Item("CtaMayor") = -1 - DtPatrimonioContribuido.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL PATRIMONIO CONTRIBUIDO" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtPatrimonioContribuido.Rows.Add(Row) - - Row = DtPatrimonioGenerado.NewRow - If DtPatrimonioGenerado.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL PATRIMONIO GENERADO" - 'El id = 87 es el id de la cuenta "RESULTADOS DEL EJERCICIO:(AHORRO/DESAHORRO)" - If DtPatrimonioGenerado.FiltraParametros($"Id = {CuentaAhorroDesahorro}").Rows.Count > 0 Then - Row.Item("ImporteActual") = (DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero($"Id = {CuentaAhorroDesahorro}")("ImporteActual").ToString.ToDouble).ToString - Row.Item("ImporteAnterior") = (DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero($"Id = {CuentaAhorroDesahorro}")("ImporteAnterior").ToString.ToDouble).ToString - Else - Row.Item("ImporteActual") = DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString - End If - Row.Item("CtaMayor") = -1 - DtPatrimonioGenerado.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL PATRIMONIO GENERADO" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtPatrimonioGenerado.Rows.Add(Row) - - Row = DtPatrimonioActualizacion.NewRow - If DtPatrimonioActualizacion.Rows.Count > 0 Then - Row.Item("Nombre") = "   TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION" - Row.Item("ImporteActual") = DtPatrimonioActualizacion.Rows(0)("ImporteActual").ToString - Row.Item("ImporteAnterior") = DtPatrimonioActualizacion.Rows(0)("ImporteAnterior").ToString - Row.Item("CtaMayor") = -1 - DtPatrimonioActualizacion.Rows.RemoveAt(0) - Else - Row.Item("Nombre") = "   TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION" - Row.Item("ImporteActual") = "0.00" - Row.Item("ImporteAnterior") = "0.00" - Row.Item("CtaMayor") = -1 - End If - DtPatrimonioActualizacion.Rows.Add(Row) - - - GvPatrimonio.DataSource = DtPatrimonioContribuido - GvPatrimonio.DataBind() - GvPatrimonioGenerado.DataSource = DtPatrimonioGenerado - GvPatrimonioGenerado.DataBind() - GvPatrimonioActualizacion.DataSource = DtPatrimonioActualizacion - GvPatrimonioActualizacion.DataBind() - UpPatrimonio.Update() - End Sub - Private Sub SumaTotales() - TotalPasivoPatrimonioActual = TotalPasivoActual + TotalPatrimonioActual - TotalPasivoPatrimonioAnterior = TotalPasivoAnterior + TotalPatrimonioAnterior - - 'Llena Lb´s Totales - LbTotalActivoActual.Text = TotalActivoActual.ToString.FormatoNumero - LbTotalActivoAnterior.Text = TotalActivoAnterior.ToString.FormatoNumero - - LbTotalPasivoActual.Text = TotalPasivoActual.ToString.FormatoNumero - LbTotalPasivoAnterior.Text = TotalPasivoAnterior.ToString.FormatoNumero - - LbTotalPatrimonioActual.Text = TotalPatrimonioActual.ToString.FormatoNumero - LbTotalPatrimonioAnterior.Text = TotalPatrimonioAnterior.ToString.FormatoNumero - - LbTotalPasivoPatrimonioActual.Text = TotalPasivoPatrimonioActual.ToString.FormatoNumero - LbTotalPasivoPatrimonioAnterior.Text = TotalPasivoPatrimonioAnterior.ToString.FormatoNumero - - - Dim Descuadre = False - 'COLOREA ROJO SI NO CUADRAN TOTALES - If TotalActivoActual <> TotalPasivoPatrimonioActual Then - LbTotalActivoActual.ForeColor = Drawing.Color.Red - LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Red - Descuadre = True - Else - LbTotalActivoActual.ForeColor = Drawing.Color.Black - LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Black - End If - - If TotalActivoAnterior <> TotalPasivoPatrimonioAnterior Then - LbTotalActivoAnterior.ForeColor = Drawing.Color.Red - LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Red - Descuadre = True - Else - LbTotalActivoAnterior.ForeColor = Drawing.Color.Black - LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Black - End If - - If Descuadre Then - LbDescuadre.Text = "Las sumas de los totales están descuadradas." - Else - LbDescuadre.Text = "" - End If - - - End Sub - - Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click - 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) - 'Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) - 'Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy") - - 'If ObjConta.GetSituacionFinanciera("01/01/2000".ToDate, FechaF.ToDate, DdlTipoReporte.SelectedValue.ToEntero) Then - ' DtDatos = ObjConta.DtResultados - ' 'If ChkFirma.Checked = True Then - - ' ' Dim Row As DataRow = DtDatos.NewRow - ' ' Row.Item("Nombre") = String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de contabilidad", "") - ' ' Row.Item("Sup") = String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", "") - ' ' Row.Item("ImporteActual") = "0" - ' ' Row.Item("ImporteAnterior") = "0" - ' ' Row.Item("Tipo") = "Firma" - ' ' DtDatos.Rows.Add(Row) - ' 'End If - 'End If - 'ObjConta.Dispose() - - If Not IsNothing(DtDatos) Then - ImprimirReporte() - Else - Alert("No se econtró información para el reporte.", TipoMensaje.MsgAdvertencia) - End If - - End Sub - - - Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) - TotalActivoActual = 0 - TotalActivoAnterior = 0 - TotalPasivoActual = 0 - TotalPasivoAnterior = 0 - TotalPatrimonioActual = 0 - TotalPatrimonioAnterior = 0 - TotalPasivoPatrimonioActual = 0 - TotalPasivoPatrimonioAnterior = 0 - - CargaDatos() - End Sub - - -#Region "GV´S ROW DATA BOUND" - - Protected Sub GvActivo_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalActivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalActivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble - e.Row.FCLabel("LbNombre").Font.Italic = True - e.Row.FCLabel("LbNombre").Font.Bold = True - e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") - Else - e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte) - End If - - If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red - End If - If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - - If e.Row.DBCampo("Level").ToString = "2" Then - e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) - ElseIf e.Row.DBCampo("Level").ToString = "1" Then - e.Row.FCLabel("LbNombre").Font.Bold = True - End If - - End If - End Sub - - Protected Sub GvPasivo_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - - 'Totales - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalPasivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalPasivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble - e.Row.FCLabel("LbNombre").Font.Italic = True - e.Row.FCLabel("LbNombre").Font.Bold = True - e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") - 'Cuentas - Else - e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString) - End If - - - 'Colorea NEGATIVOS - If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red - End If - If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - - If e.Row.DBCampo("Level").ToString = "2" Then - e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) - ElseIf e.Row.DBCampo("Level").ToString = "1" Then - e.Row.FCLabel("LbNombre").Font.Bold = True - End If - - End If - End Sub - - Protected Sub GvPatrimonio_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then - TotalPatrimonioActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble - TotalPatrimonioAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble - e.Row.FCLabel("LbNombre").Font.Italic = True - e.Row.FCLabel("LbNombre").Font.Bold = True - e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") - 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray - 'e.Row.ControlStyle.ForeColor = Drawing.Color.White - 'e.Row.ControlStyle.Font.Bold = True - Else - e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString) - e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString) - End If - - If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red - End If - If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then - e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red - End If - - If e.Row.DBCampo("Level").ToString = "2" Then - e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) - ElseIf e.Row.DBCampo("Level").ToString = "1" Then - e.Row.FCLabel("LbNombre").Font.Bold = True - End If - - End If - End Sub - -#End Region - - Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click - If Not IsNothing(DtDatos) Then - ImprimirReporte("Excel") - Else - Alert("No se econtró información para el reporte.", TipoMensaje.MsgAdvertencia) - End If - End Sub - - - Private Sub ImprimirReporte(Optional Formato As String = "PDF") - Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) - Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy") - 'nombre del archivo a generar - Dim fileName As String = "EdoSituacionFinanciera" - 'ubicacion del rdlc - Dim reportpath As String = "AC/Reportes/RepSituacionFinanciera.rdlc" - - DtCuentasOrden = New DataTable - If Not DtCuentasOrden.Columns.Contains("Concepto") Then DtCuentasOrden.Columns.Add("Concepto", GetType(String)) - If Not DtCuentasOrden.Columns.Contains("Importe") Then DtCuentasOrden.Columns.Add("Importe", GetType(String)) - If Not DtCuentasOrden.Columns.Contains("Nivel") Then DtCuentasOrden.Columns.Add("Nivel", GetType(String)) - - Dim Dr = DtCuentasOrden.NewRow - Dr("Concepto") = "PRUEBA" - Dr("Importe") = "15236.85" - Dr("Nivel") = "1" - DtCuentasOrden.Rows.Add(Dr) - - Dim DDdr = DtCuentasOrden.NewRow - DDdr("Concepto") = "PRUEBA 2" - DDdr("Importe") = "15236.85" - DDdr("Nivel") = "2" - DtCuentasOrden.Rows.Add(DDdr) - - 'parametros a enviar al reporte - Dim lrds As New List(Of ReportDataSource) - Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = If(ChkNivel.Checked, DtDatos, DtDatos.FiltraParametros("Level < 2"))} - lrds.Add(rds) - - Dim rds1 As New ReportDataSource With {.Name = "DataSet2", .Value = If(DtCuentasOrden IsNot Nothing, DtCuentasOrden, New DataTable)} ' sino esta creado el objeto, lo creamos, para que no truene el reporte - lrds.Add(rds1) - - Dim params As New List(Of ReportParameter) - 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))) - ElseIf (ChkFirma.Checked) Then - params.Add(New ReportParameter("pFirma1", String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf))) - params.Add(New ReportParameter("pFirma2", String.Format("ING. Soraida Mesinas Reyes{0} Director General", vbCrLf))) - Else - params.Add(New ReportParameter("pFirma1", "")) - params.Add(New ReportParameter("pFirma2", "")) - End If - params.Add(New ReportParameter("pFechaFin", FechaF)) - ImprimirPDF(reportpath, lrds, params, fileName, Formato) - End Sub -End Class +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms +Partial Class AC_SituacionFinanciera + Inherits ClsPaginas + +#Region "PROPIEDADES" + Private Property DtDatos As DataTable + Get + DtDatos = DirectCast(ViewState("DtDatos"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + Private Property DtCuentasOrden As DataTable + Get + DtCuentasOrden = DirectCast(ViewState("DtCuentasOrden"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtCuentasOrden") = value + End Set + End Property + Private Property TotalActivoActual As Double + Get + TotalActivoActual = ViewState("TotalActivoActual").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalActivoActual") = value + End Set + End Property + Private Property TotalActivoAnterior As Double + Get + TotalActivoAnterior = ViewState("TotalActivoAnterior").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalActivoAnterior") = value + End Set + End Property + Private Property TotalPasivoActual As Double + Get + TotalPasivoActual = ViewState("TotalPasivoActual").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPasivoActual") = value + End Set + End Property + Private Property TotalPasivoAnterior As Double + Get + TotalPasivoAnterior = ViewState("TotalPasivoAnterior").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPasivoAnterior") = value + End Set + End Property + Private Property TotalPatrimonioActual As Double + Get + TotalPatrimonioActual = ViewState("TotalPatrimonioActual").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPatrimonioActual") = value + End Set + End Property + Private Property TotalPatrimonioAnterior As Double + Get + TotalPatrimonioAnterior = ViewState("TotalPatrimonioAnterior").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPatrimonioAnterior") = value + End Set + End Property + Private Property TotalPasivoPatrimonioActual As Double + Get + TotalPasivoPatrimonioActual = ViewState("TotalPasivoPatrimonioActual").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPasivoPatrimonioActual") = value + End Set + End Property + Private Property TotalPasivoPatrimonioAnterior As Double + Get + TotalPasivoPatrimonioAnterior = ViewState("TotalPasivoPatrimonioAnterior").ToString.ToDouble + End Get + Set(value As Double) + ViewState("TotalPasivoPatrimonioAnterior") = value + End Set + End Property + Private Property FechaInicioActual As Date + Get + FechaInicioActual = ViewState("FechaInicioActual").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaInicioActual") = value + End Set + End Property + Private Property FechaFinActual As Date + Get + FechaFinActual = ViewState("FechaFinActual").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaFinActual") = value + End Set + End Property + Private Property FechaInicioAnterior As Date + Get + FechaInicioAnterior = ViewState("FechaInicioAnterior").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaInicioAnterior") = value + End Set + End Property + Private Property FechaFinAnterior As Date + Get + FechaFinAnterior = ViewState("FechaFinAnterior").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaFinAnterior") = value + End Set + End Property + Private Property TipoReporte As Integer + Get + TipoReporte = ViewState("TipoReporte").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("TipoReporte") = value + End Set + End Property +#End Region + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + If UsuarioActual.Empresa.UsaAC Then + TipoReporte = -1 + Else + TipoReporte = 1 + tdTipoReporte.Visible = True + LtTitulo.Text = "Balance General" + End If + + + TotalActivoActual = 0 + TotalActivoAnterior = 0 + TotalPasivoActual = 0 + TotalPasivoAnterior = 0 + TotalPatrimonioActual = 0 + TotalPatrimonioAnterior = 0 + TotalPasivoPatrimonioActual = 0 + TotalPasivoPatrimonioAnterior = 0 + + 'TxtFechaInicio.Text = DateSerial(Year(Date.Now), 1, 1).ToShortDateString + 'TxtFechaFin.Text = Date.Now.ToShortDateString + + CargaEjercicios() + + CargaDatos() + + + End If + End Sub + + Private Sub CargaEjercicios() + Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa) + If ClsConta.GetEjercicios() Then + DdlEjercicio.DataSource = ClsConta.DtResultados + Else + DdlEjercicio.DataSource = Nothing + End If + ClsConta.Dispose() + DdlEjercicio.DataBind() + + DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString) + DdlPeriodo.SelectedValue = Now.Month.ToString + End Sub + + Private Sub CargaDatos() + Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) + + Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) + Dim FechaF = FechaI.ToDate.LastDayOfMonth.ToShortDateString + TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero) + + GvActivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue + GvActivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString + + GvPasivo.Columns(1).HeaderText = DdlEjercicio.SelectedValue + GvPasivo.Columns(2).HeaderText = (DdlEjercicio.SelectedValue.ToEntero - 1).ToString + + Dim IdCuentaAhorroDesahorro = 9999 + + If UsuarioActual.CveEmpresa = 48 Then + IdCuentaAhorroDesahorro = 87 + End If + If UsuarioActual.CveEmpresa = 120 Then + IdCuentaAhorroDesahorro = 646 + End If + + If ObjConta.GetBalanceGeneral("01/01/1000".ToDate, FechaF.ToDate, UsuarioActual.CveEmpresa, TipoReporte, UsuarioActual.Empresa.UsaAC, IdCuentaAhorroDesahorro) Then + DtDatos = ObjConta.DtResultados + + CargaGrids() + SumaTotales() + Else + DtDatos = Nothing + Alert("Ocurrio un error al cargar los datos del estado de situación financiera", TipoMensaje.MsgError) + End If + + ObjConta.Dispose() + End Sub + Private Sub CargaGrids() + + If Not ChkNivel.Checked Then + DtDatos = DtDatos.FiltraParametros("Level < 2") + End If + Dim CuentaAhorroDesahorro As Integer = 87 + + Select Case UsuarioActual.CveEmpresa + Case 120 + CuentaAhorroDesahorro = 646 + Case Else + CuentaAhorroDesahorro = 87 + End Select + + 'Defino Variables para el Orden + Dim Orden1, Orden2, Orden3, Orden4, Orden5, Orden6, Orden7 As String + If UsuarioActual.CveEmpresa = 48 Then Orden1 = "00011%" Else Orden1 = "011%" + If UsuarioActual.CveEmpresa = 48 Then Orden2 = "00012%" Else Orden2 = "012%" + If UsuarioActual.CveEmpresa = 48 Then Orden3 = "00021%" Else Orden3 = "021%" + If UsuarioActual.CveEmpresa = 48 Then Orden4 = "00022%" Else Orden4 = "022%" + If UsuarioActual.CveEmpresa = 48 Then Orden5 = "00031%" Else If UsuarioActual.CveEmpresa = 120 Then Orden5 = "0321%" Else Orden5 = "031%" + If UsuarioActual.CveEmpresa = 48 Then Orden6 = "00032%" Else Orden6 = "032%" + If UsuarioActual.CveEmpresa = 48 Then Orden7 = "00033%" Else Orden7 = "033%" + + 'ACTIVO + Dim DtActivoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden1}' ") + + Dim DtActivoNoCirculante As DataTable + + If UsuarioActual.CveEmpresa = 48 Then + DtActivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden2}' ") + Else + DtActivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('A','B','C') AND Orden LIKE '{Orden2}' ") + End If + + Dim Row As DataRow = DtActivoCirculante.NewRow + + If DtActivoCirculante.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL ACTIVO CIRCULANTE" + Row.Item("ImporteActual") = DtActivoCirculante.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtActivoCirculante.Rows(0)("ImporteAnterior").ToString + Row.Item("CtaMayor") = -1 + DtActivoCirculante.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL ACTIVO CIRCULANTE" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtActivoCirculante.Rows.Add(Row) + + + Row = DtActivoNoCirculante.NewRow + If DtActivoNoCirculante.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL ACTIVO NO CIRCULANTE" + + If UsuarioActual.CveEmpresa = 48 Then + Row.Item("ImporteActual") = DtActivoNoCirculante.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtActivoNoCirculante.Rows(0)("ImporteAnterior").ToString + ElseIf UsuarioActual.CveEmpresa = 120 Then + Row.Item("ImporteActual") = DtActivoNoCirculante.SUM("ImporteActual", " Sup ='ACTIVO NO CIRCULANTE' ") + Row.Item("ImporteAnterior") = DtActivoNoCirculante.SUM("ImporteAnterior", " Sup ='ACTIVO NO CIRCULANTE' ") + Else + Row.Item("ImporteActual") = DtActivoNoCirculante.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtActivoNoCirculante.Rows(0)("ImporteAnterior").ToString + End If + + + Row.Item("CtaMayor") = -1 + DtActivoNoCirculante.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL ACTIVO NO CIRCULANTE" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtActivoNoCirculante.Rows.Add(Row) + + GvActivo.DataSource = DtActivoCirculante + GvActivo.DataBind() + GvActivoNoCirculante.DataSource = DtActivoNoCirculante + GvActivoNoCirculante.DataBind() + UpActivo.Update() + + + 'PASIVO + Dim DtPasivoCirculante = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden3}' ") + Dim DtPasivoNoCirculante = DtDatos.FiltraParametros($"Tipo in ('D') AND Orden LIKE '{Orden4}' ") + + Row = DtPasivoCirculante.NewRow + If DtPasivoCirculante.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL PASIVO CIRCULANTE" + Row.Item("ImporteActual") = DtPasivoCirculante.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtPasivoCirculante.Rows(0)("ImporteAnterior").ToString + Row.Item("CtaMayor") = -1 + DtPasivoCirculante.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL PASIVO CIRCULANTE" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtPasivoCirculante.Rows.Add(Row) + + Row = DtPasivoNoCirculante.NewRow + If DtPasivoNoCirculante.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL PASIVO NO CIRCULANTE" + Row.Item("ImporteActual") = DtPasivoNoCirculante.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtPasivoNoCirculante.Rows(0)("ImporteAnterior").ToString + Row.Item("CtaMayor") = -1 + DtPasivoNoCirculante.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL PASIVO NO CIRCULANTE" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtPasivoNoCirculante.Rows.Add(Row) + + + GvPasivo.DataSource = DtPasivoCirculante + GvPasivo.DataBind() + GvPasivoNoCirculante.DataSource = DtPasivoNoCirculante + GvPasivoNoCirculante.DataBind() + UpPasivo.Update() + + + 'PATRIMONIO + Dim DtPatrimonioContribuido = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden5}' ") + Dim DtPatrimonioGenerado = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden6}' ") + Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros($"Tipo in ('F') AND Orden LIKE '{Orden7}' ") + + Row = DtPatrimonioContribuido.NewRow + If DtPatrimonioContribuido.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL PATRIMONIO CONTRIBUIDO" + Row.Item("ImporteActual") = DtPatrimonioContribuido.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtPatrimonioContribuido.Rows(0)("ImporteAnterior").ToString + Row.Item("CtaMayor") = -1 + DtPatrimonioContribuido.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL PATRIMONIO CONTRIBUIDO" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtPatrimonioContribuido.Rows.Add(Row) + + Row = DtPatrimonioGenerado.NewRow + If DtPatrimonioGenerado.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL PATRIMONIO GENERADO" + 'El id = 87 es el id de la cuenta "RESULTADOS DEL EJERCICIO:(AHORRO/DESAHORRO)" + If DtPatrimonioGenerado.FiltraParametros($"Id = {CuentaAhorroDesahorro}").Rows.Count > 0 Then + Row.Item("ImporteActual") = (DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero($"Id = {CuentaAhorroDesahorro}")("ImporteActual").ToString.ToDouble).ToString + Row.Item("ImporteAnterior") = (DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString.ToDouble + DtPatrimonioGenerado.FiltroPrimero($"Id = {CuentaAhorroDesahorro}")("ImporteAnterior").ToString.ToDouble).ToString + Else + Row.Item("ImporteActual") = DtPatrimonioGenerado.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtPatrimonioGenerado.Rows(0)("ImporteAnterior").ToString + End If + Row.Item("CtaMayor") = -1 + DtPatrimonioGenerado.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL PATRIMONIO GENERADO" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtPatrimonioGenerado.Rows.Add(Row) + + Row = DtPatrimonioActualizacion.NewRow + If DtPatrimonioActualizacion.Rows.Count > 0 Then + Row.Item("Nombre") = "   TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION" + Row.Item("ImporteActual") = DtPatrimonioActualizacion.Rows(0)("ImporteActual").ToString + Row.Item("ImporteAnterior") = DtPatrimonioActualizacion.Rows(0)("ImporteAnterior").ToString + Row.Item("CtaMayor") = -1 + DtPatrimonioActualizacion.Rows.RemoveAt(0) + Else + Row.Item("Nombre") = "   TOTAL EXCESO O INSUFICIENCIA EN LA ACTUALIZACION" + Row.Item("ImporteActual") = "0.00" + Row.Item("ImporteAnterior") = "0.00" + Row.Item("CtaMayor") = -1 + End If + DtPatrimonioActualizacion.Rows.Add(Row) + + + GvPatrimonio.DataSource = DtPatrimonioContribuido + GvPatrimonio.DataBind() + GvPatrimonioGenerado.DataSource = DtPatrimonioGenerado + GvPatrimonioGenerado.DataBind() + GvPatrimonioActualizacion.DataSource = DtPatrimonioActualizacion + GvPatrimonioActualizacion.DataBind() + UpPatrimonio.Update() + End Sub + Private Sub SumaTotales() + TotalPasivoPatrimonioActual = TotalPasivoActual + TotalPatrimonioActual + TotalPasivoPatrimonioAnterior = TotalPasivoAnterior + TotalPatrimonioAnterior + + 'Llena Lb´s Totales + LbTotalActivoActual.Text = TotalActivoActual.ToString.FormatoNumero + LbTotalActivoAnterior.Text = TotalActivoAnterior.ToString.FormatoNumero + + LbTotalPasivoActual.Text = TotalPasivoActual.ToString.FormatoNumero + LbTotalPasivoAnterior.Text = TotalPasivoAnterior.ToString.FormatoNumero + + LbTotalPatrimonioActual.Text = TotalPatrimonioActual.ToString.FormatoNumero + LbTotalPatrimonioAnterior.Text = TotalPatrimonioAnterior.ToString.FormatoNumero + + LbTotalPasivoPatrimonioActual.Text = TotalPasivoPatrimonioActual.ToString.FormatoNumero + LbTotalPasivoPatrimonioAnterior.Text = TotalPasivoPatrimonioAnterior.ToString.FormatoNumero + + + Dim Descuadre = False + 'COLOREA ROJO SI NO CUADRAN TOTALES + If TotalActivoActual <> TotalPasivoPatrimonioActual Then + LbTotalActivoActual.ForeColor = Drawing.Color.Red + LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Red + Descuadre = True + Else + LbTotalActivoActual.ForeColor = Drawing.Color.Black + LbTotalPasivoPatrimonioActual.ForeColor = Drawing.Color.Black + End If + + If TotalActivoAnterior <> TotalPasivoPatrimonioAnterior Then + LbTotalActivoAnterior.ForeColor = Drawing.Color.Red + LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Red + Descuadre = True + Else + LbTotalActivoAnterior.ForeColor = Drawing.Color.Black + LbTotalPasivoPatrimonioAnterior.ForeColor = Drawing.Color.Black + End If + + If Descuadre Then + LbDescuadre.Text = "Las sumas de los totales están descuadradas." + Else + LbDescuadre.Text = "" + End If + + + End Sub + + Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click + 'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) + 'Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) + 'Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy") + + 'If ObjConta.GetSituacionFinanciera("01/01/2000".ToDate, FechaF.ToDate, DdlTipoReporte.SelectedValue.ToEntero) Then + ' DtDatos = ObjConta.DtResultados + ' 'If ChkFirma.Checked = True Then + + ' ' Dim Row As DataRow = DtDatos.NewRow + ' ' Row.Item("Nombre") = String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de contabilidad", "") + ' ' Row.Item("Sup") = String.Format("Lic. Juan Fortino Leon Robinson{0} Director General", "") + ' ' Row.Item("ImporteActual") = "0" + ' ' Row.Item("ImporteAnterior") = "0" + ' ' Row.Item("Tipo") = "Firma" + ' ' DtDatos.Rows.Add(Row) + ' 'End If + 'End If + 'ObjConta.Dispose() + + If Not IsNothing(DtDatos) Then + ImprimirReporte() + Else + Alert("No se econtró información para el reporte.", TipoMensaje.MsgAdvertencia) + End If + + End Sub + + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + TotalActivoActual = 0 + TotalActivoAnterior = 0 + TotalPasivoActual = 0 + TotalPasivoAnterior = 0 + TotalPatrimonioActual = 0 + TotalPatrimonioAnterior = 0 + TotalPasivoPatrimonioActual = 0 + TotalPasivoPatrimonioAnterior = 0 + + CargaDatos() + End Sub + + +#Region "GV´S ROW DATA BOUND" + + Protected Sub GvActivo_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then + TotalActivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble + TotalActivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble + e.Row.FCLabel("LbNombre").Font.Italic = True + e.Row.FCLabel("LbNombre").Font.Bold = True + e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") + Else + e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString, TipoReporte) + e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}&TP={2}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString, TipoReporte) + End If + + If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red + End If + If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red + End If + + If e.Row.DBCampo("Level").ToString = "2" Then + e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) + ElseIf e.Row.DBCampo("Level").ToString = "1" Then + e.Row.FCLabel("LbNombre").Font.Bold = True + End If + + End If + End Sub + + Protected Sub GvPasivo_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + + 'Totales + If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then + TotalPasivoActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble + TotalPasivoAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble + e.Row.FCLabel("LbNombre").Font.Italic = True + e.Row.FCLabel("LbNombre").Font.Bold = True + e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") + 'Cuentas + Else + e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString) + e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString) + End If + + + 'Colorea NEGATIVOS + If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red + End If + If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red + End If + + If e.Row.DBCampo("Level").ToString = "2" Then + e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) + ElseIf e.Row.DBCampo("Level").ToString = "1" Then + e.Row.FCLabel("LbNombre").Font.Bold = True + End If + + End If + End Sub + + Protected Sub GvPatrimonio_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("CtaMayor").ToString.ToEntero < 0 Then + TotalPatrimonioActual += e.Row.DBCampo("ImporteActual").ToString.ToDouble + TotalPatrimonioAnterior += e.Row.DBCampo("ImporteAnterior").ToString.ToDouble + e.Row.FCLabel("LbNombre").Font.Italic = True + e.Row.FCLabel("LbNombre").Font.Bold = True + e.Row.Attributes.Add("style", "border-top: thick solid; border-top-width: thin;") + 'e.Row.ControlStyle.BackColor = Drawing.Color.LightGray + 'e.Row.ControlStyle.ForeColor = Drawing.Color.White + 'e.Row.ControlStyle.Font.Bold = True + Else + e.Row.FCHyperLink("HLActual").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFActual").ToDate.ToShortDateString) + e.Row.FCHyperLink("HLAnterior").NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FF={1}", e.Row.DBCampo("Id"), e.Row.DBCampo("FechaFAnterior").ToDate.ToShortDateString) + End If + + If e.Row.DBCampo("ImporteActual").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLActual").ForeColor = Drawing.Color.Red + End If + If e.Row.DBCampo("ImporteAnterior").ToString.ToDouble < 0 Then + e.Row.FCHyperLink("HLAnterior").ForeColor = Drawing.Color.Red + End If + + If e.Row.DBCampo("Level").ToString = "2" Then + e.Row.FCLabel("LbNombre").Text = String.Format("   {0}", e.Row.DBCampo("Nombre").ToString) + ElseIf e.Row.DBCampo("Level").ToString = "1" Then + e.Row.FCLabel("LbNombre").Font.Bold = True + End If + + End If + End Sub + +#End Region + + Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + If Not IsNothing(DtDatos) Then + ImprimirReporte("Excel") + Else + Alert("No se econtró información para el reporte.", TipoMensaje.MsgAdvertencia) + End If + End Sub + + + Private Sub ImprimirReporte(Optional Formato As String = "PDF") + Dim FechaI = String.Format("01/{0}/{1}", DdlPeriodo.SelectedValue.PadLeft(2, CChar("0")), DdlEjercicio.SelectedValue) + Dim FechaF = DateAdd(DateInterval.Day, -1, DateAdd(DateInterval.Month, 1, CDate(FechaI))).ToString("dd/MM/yyyy") + 'nombre del archivo a generar + Dim fileName As String = "EdoSituacionFinanciera" + 'ubicacion del rdlc + Dim reportpath As String = "AC/Reportes/RepSituacionFinanciera.rdlc" + + DtCuentasOrden = New DataTable + If Not DtCuentasOrden.Columns.Contains("Concepto") Then DtCuentasOrden.Columns.Add("Concepto", GetType(String)) + If Not DtCuentasOrden.Columns.Contains("Importe") Then DtCuentasOrden.Columns.Add("Importe", GetType(String)) + If Not DtCuentasOrden.Columns.Contains("Nivel") Then DtCuentasOrden.Columns.Add("Nivel", GetType(String)) + + Dim Dr = DtCuentasOrden.NewRow + Dr("Concepto") = "PRUEBA" + Dr("Importe") = "15236.85" + Dr("Nivel") = "1" + DtCuentasOrden.Rows.Add(Dr) + + Dim DDdr = DtCuentasOrden.NewRow + DDdr("Concepto") = "PRUEBA 2" + DDdr("Importe") = "15236.85" + DDdr("Nivel") = "2" + DtCuentasOrden.Rows.Add(DDdr) + + 'parametros a enviar al reporte + Dim lrds As New List(Of ReportDataSource) + Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = If(ChkNivel.Checked, DtDatos, DtDatos.FiltraParametros("Level < 2"))} + lrds.Add(rds) + + Dim rds1 As New ReportDataSource With {.Name = "DataSet2", .Value = If(DtCuentasOrden IsNot Nothing, DtCuentasOrden, New DataTable)} ' sino esta creado el objeto, lo creamos, para que no truene el reporte + lrds.Add(rds1) + + Dim params As New List(Of ReportParameter) + 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))) + ElseIf (ChkFirma.Checked) Then + params.Add(New ReportParameter("pFirma1", String.Format("C.P. Izelda Angulo Peraza{0} Subdirector de Contabilidad", vbCrLf))) + params.Add(New ReportParameter("pFirma2", String.Format("ING. Soraida Mesinas Reyes{0} Director General", vbCrLf))) + Else + 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) + End Sub +End Class diff --git a/AC/Reportes/RepSituacionFinanciera.rdlc b/AC/Reportes/RepSituacionFinanciera.rdlc index 750d7f2cc..6665a3008 100644 --- a/AC/Reportes/RepSituacionFinanciera.rdlc +++ b/AC/Reportes/RepSituacionFinanciera.rdlc @@ -1,3086 +1,3098 @@ - - - 0 - - - - System.Data.DataSet - /* Local Connection */ - - 3560db3f-20af-4776-9f09-85925745c52f - - - - - - DataSet1 - /* Local Query */ - - - - Nombre - System.String - - - ImporteActual - System.Int16 - - - ImporteAnterior - System.Int16 - - - CtaMayor - System.Int16 - - - Orden - System.String - - - Tipo - System.String - - - Sup - System.String - - - Level - System.Int16 - - - TipoCuenta - System.Int16 - - - - DataSet1 - c:\users\caudillo\documents\visual studio 2013\Projects\WebApplication1\WebApplication1\DataSet1.xsd - ActivoCirculante - - - - - - - - - - - - - - - 6cm - - - 2.5cm - - - 2.20896cm - - - - - 0.6cm - - - - - true - true - - - - - ACTIVO CIRCULANTE - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - - - - - TOTAL ACTIVO CIRCULANTE - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - - - - Before - - - - DataSet1 - - - =Fields!Tipo.Value - In - - =CStr("A,B,C").Split(",") - - - - =Fields!Orden.Value - Like - - =IIf(Parameters!CveEmpresa.Value = 48, "00011*", "011*") - - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - 2.6512cm - 0.06568cm - 1.65cm - 10.70896cm - - - Verdana - 8pt - - - - - - - 6cm - - - 2.5cm - - - 2.20896cm - - - - - 0.6cm - - - - - true - true - - - - - ACTIVO NO CIRCULANTE - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - TOTAL ACTIVO NO CIRCULANTE - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum( Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - Before - - - - DataSet1 - - - =Fields!Tipo.Value - In - - =CStr("A,B,C").Split(",") - - - - =Fields!Orden.Value - Like - - =IIf(Parameters!CveEmpresa.Value = 48, "00012*", "012*") - - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - 4.74417cm - 0.06568cm - 1.65cm - 10.70896cm - 1 - - - Verdana - 8pt - - - - - - - 5.10007cm - - - 2.1825cm - - - 2.17523cm - - - - - 0.6cm - - - - - true - true - - - - - PASIVO CIRCULANTE - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - TOTAL PASIVO CIRCULANTE - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - Before - - - - DataSet1 - - - =Fields!Tipo.Value - Equal - - D - - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - =Fields!Orden.Value - Like - - =IIf(Parameters!CveEmpresa.Value = 48, "00021*", "021*") - - - - 2.6512cm - 10.88047cm - 1.65cm - 9.4578cm - 2 - - - Verdana - 8pt - - - - - - - 5.14411cm - - - 2.1825cm - - - 2.13119cm - - - - - 0.6cm - - - - - true - true - - - - - PASIVO NO CIRCULANTE - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - TOTAL PASIVO NO CIRCULANTE - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - Before - - - - DataSet1 - - - =Fields!Tipo.Value - Equal - - D - - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - =Fields!Orden.Value - Like - - =IIf(Parameters!CveEmpresa.Value = 48, "00022*", "022*") - - - - 4.74417cm - 10.88047cm - 1.65cm - 9.4578cm - 3 - - - Verdana - 8pt - - - - true - true - - - - - ACTIVO - - - - - - - Textbox28 - 1.84891cm - 0.27028cm - 0.6cm - 9.7954cm - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - PASIVO - - - - - - - Textbox28 - 1.91009cm - 10.88047cm - 0.6cm - 8.40286cm - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 5.18815cm - - - 2.13846cm - - - 2.13119cm - - - - - 0.6cm - - - - - true - true - - - - - CAPITAL CONTABLE - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - TOTAL CAPITAL - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - Before - - - - DataSet1 - - - =Fields!Tipo.Value - Equal - - F - - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - 8.30193cm - 10.88047cm - 1.65cm - 9.4578cm - 6 - - - Verdana - 8pt - - - - true - true - - - - - CAPITAL - - - - - - - Textbox28 - 7.52554cm - 10.92451cm - 0.6cm - 9.41376cm - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Total del Activo - - - - - - - Textbox45 - 11.31317cm - 0.27027cm - 0.6cm - 4.81646cm - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalActivoAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalActivoActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Total CAPITAL - - - - - - - Textbox45 - 10.22837cm - 10.88047cm - 0.6cm - 3.1816cm - 11 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalPatrimonioHAnterior.Value + Variables!TotalPatrimonioCAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalPatrimonioHActual.Value + Variables!TotalPatrimonioCActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Total Pasivo y Patrimonio - - - - - - - Textbox45 - 11.31317cm - 10.77464cm - 0.6cm - 4.55974cm - 14 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalpasivoYHaciendaAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalpasivoYHaciendaActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Total del Pasivo: - - - - - - - Textbox45 - 6.57056cm - 10.88047cm - 0.6cm - 3.1816cm - 17 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalPasivoAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Variables!TotalPasivoActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Iif(round(Math.Abs(Variables!TotalActivoAnterior.Value-Variables!TotalpasivoYHaciendaAnterior.Value),2) <.005 AND Round(Math.Abs(Variables!TotalActivoActual.Value-Variables!TotalpasivoYHaciendaActual.Value),2) <.005,"" ,"La suma de los totales estan descuadradas." & round(Math.Abs(Variables!TotalActivoAnterior.Value-Variables!TotalpasivoYHaciendaAnterior.Value),2)) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - External - = Parameters!pImg.Value - FitProportional - 0.03141cm - 0.31432cm - 1.5cm - 1.5cm - 21 - - - - - - true - true - - - - - =Parameters!pEmp.Value - - - - - - - Textbox1 - 0.03141cm - 3.40996cm - 0.81167cm - 12.91455cm - 22 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Estado de Situación Financiera al - - - - =Parameters!pFechaFin.Value - - - - - - - Textbox5 - 0.89924cm - 3.40996cm - 0.6cm - 12.91455cm - 23 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Fecha Impresión:" & vbcrlf & Format( Globals!ExecutionTime,"dd/MM/yyyy") - - - - - - - Textbox8 - 0.03141cm - 16.58113cm - 0.81167cm - 3.49249cm - 24 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 6cm - - - 2.5cm - - - 2.20896cm - - - - - 0.6cm - - - - - true - true - - - - - ACTIVO DIFERIDO - - - - - - - Textbox7 - - - 2pt - 2pt - 2pt - 2pt - - - 3 - - - - - - - - 0.45cm - - - - - true - - - - - =Fields!Nombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteActual.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ImporteAnterior.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - TOTAL ACTIVO DIFERIDO - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteActual.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Sum(Fields!ImporteAnterior.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - After - true - - - - - - Before - - - - DataSet1 - - - =Fields!CtaMayor.Value - NotEqual - - 3 - - - - 6.92554cm - 0.06568cm - 1.65cm - 10.70896cm - 25 - - =IIf(Parameters!CveEmpresa.Value = 48,True,False) - - - - Verdana - 8pt - - - - 5.1587in - - - - =Parameters!pFechaFin.Value - - - - - - - Textbox5 - 3.454cm - 0.6cm - 12.91455cm - - = (Globals.PageNumber=1) - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Fecha Impresión:" & vbcrlf & Format( Globals!ExecutionTime,"dd/MM/yyyy") - - - - - - - Textbox8 - 0.02088cm - 16.62517cm - 0.57912cm - 3.49249cm - 1 - - = (Globals.PageNumber=1) - - - - 2pt - 2pt - - - - - - - - - 3.73062cm - true - true - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox3 - 3.13062cm - 16.37931cm - 0.6cm - 3.95896cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!pFirma2.Value - - - - Textbox2 - 0.10583cm - 1.71666cm - 0.99688cm - 8.02269cm - 1 - - = Iif((Globals.PageNumber=Globals.TotalPages) and (Parameters!pFirma2.Value <> ""),false,true) - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!pFirma1.Value - - - - Textbox2 - 2.73374cm - 6.03938cm - 0.99688cm - 8.02269cm - 2 - - = Iif((Globals.PageNumber=Globals.TotalPages) and (Parameters!pFirma1.Value <> ""),false,true) - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - - Textbox2 - 0.10582cm - 10.37435cm - 0.99688cm - 8.02269cm - 3 - - =Microsoft.VisualBasic.Interaction.Iif((Globals!PageNumber = Globals!TotalPages) And (Parameters!pFirma1.Value <> ""), False, True) - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0.5cm - 0.5cm - 1cm - 1cm - 0.13cm - + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + + + + + TOTAL ACTIVO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + In + + =CStr("A,B,C").Split(",") + + + + =Fields!Orden.Value + Like + + =IIf(Parameters!CveEmpresa.Value = 48, "00011*", "011*") + + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + 2.6512cm + 0.06568cm + 1.65cm + 10.70896cm + + + Verdana + 8pt + + + + + + + 6cm + + + 2.5cm + + + 2.20896cm + + + + + 0.6cm + + + + + true + true + + + + + ACTIVO NO CIRCULANTE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL ACTIVO NO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + In + + =CStr("A,B,C").Split(",") + + + + =Fields!Orden.Value + Like + + =IIf(Parameters!CveEmpresa.Value = 48, "00012*", "012*") + + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + 4.74417cm + 0.06568cm + 1.65cm + 10.70896cm + 1 + + + Verdana + 8pt + + + + + + + 5.10007cm + + + 2.1825cm + + + 2.17523cm + + + + + 0.6cm + + + + + true + true + + + + + PASIVO CIRCULANTE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL PASIVO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + Equal + + D + + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + =Fields!Orden.Value + Like + + =IIf(Parameters!CveEmpresa.Value = 48, "00021*", "021*") + + + + 2.6512cm + 10.88047cm + 1.65cm + 9.4578cm + 2 + + + Verdana + 8pt + + + + + + + 5.14411cm + + + 2.1825cm + + + 2.13119cm + + + + + 0.6cm + + + + + true + true + + + + + PASIVO NO CIRCULANTE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL PASIVO NO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + Equal + + D + + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + =Fields!Orden.Value + Like + + =IIf(Parameters!CveEmpresa.Value = 48, "00022*", "022*") + + + + 4.74417cm + 10.88047cm + 1.65cm + 9.4578cm + 3 + + + Verdana + 8pt + + + + true + true + + + + + ACTIVO + + + + + + + Textbox28 + 1.84891cm + 0.27028cm + 0.6cm + 9.7954cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + PASIVO + + + + + + + Textbox28 + 1.91009cm + 10.88047cm + 0.6cm + 8.40286cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 5.18815cm + + + 2.13846cm + + + 2.13119cm + + + + + 0.6cm + + + + + true + true + + + + + CAPITAL CONTABLE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL CAPITAL + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + Equal + + F + + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + 8.30193cm + 10.88047cm + 1.65cm + 9.4578cm + 6 + + + Verdana + 8pt + + + + true + true + + + + + CAPITAL + + + + + + + Textbox28 + 7.52554cm + 10.92451cm + 0.6cm + 9.41376cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total del Activo + + + + + + + Textbox45 + 11.31317cm + 0.27027cm + 0.6cm + 4.81646cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalActivoAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalActivoActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total CAPITAL + + + + + + + Textbox45 + 10.22837cm + 10.88047cm + 0.6cm + 3.1816cm + 11 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPatrimonioHAnterior.Value + Variables!TotalPatrimonioCAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPatrimonioHActual.Value + Variables!TotalPatrimonioCActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total Pasivo y Patrimonio + + + + + + + Textbox45 + 11.31317cm + 10.77464cm + 0.6cm + 4.55974cm + 14 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalpasivoYHaciendaAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalpasivoYHaciendaActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total del Pasivo: + + + + + + + Textbox45 + 6.57056cm + 10.88047cm + 0.6cm + 3.1816cm + 17 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPasivoAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPasivoActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Iif(round(Math.Abs(Variables!TotalActivoAnterior.Value-Variables!TotalpasivoYHaciendaAnterior.Value),2) <.005 AND Round(Math.Abs(Variables!TotalActivoActual.Value-Variables!TotalpasivoYHaciendaActual.Value),2) <.005,"" ,"La suma de los totales estan descuadradas." & round(Math.Abs(Variables!TotalActivoAnterior.Value-Variables!TotalpasivoYHaciendaAnterior.Value),2)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + = Parameters!pImg.Value + FitProportional + 0.03141cm + 0.31432cm + 1.5cm + 1.5cm + 21 + + + + + + true + true + + + + + =Parameters!pEmp.Value + + + + + + + Textbox1 + 0.03141cm + 3.40996cm + 0.81167cm + 12.91455cm + 22 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Estado de Situación Financiera al + + + + =Parameters!pFechaFin.Value + + + + + + + Textbox5 + 0.89924cm + 3.40996cm + 0.6cm + 12.91455cm + 23 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Fecha Impresión:" & vbcrlf & Format( Globals!ExecutionTime,"dd/MM/yyyy") + + + + + + + Textbox8 + 0.03141cm + 16.58113cm + 0.81167cm + 3.49249cm + 24 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 6cm + + + 2.5cm + + + 2.20896cm + + + + + 0.6cm + + + + + true + true + + + + + ACTIVO DIFERIDO + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL ACTIVO DIFERIDO + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteActual.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(IIf(Fields!Level.Value < 2, Fields!ImporteAnterior.Value, 0)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!CtaMayor.Value + NotEqual + + 3 + + + + 6.92554cm + 0.06568cm + 1.65cm + 10.70896cm + 25 + + =IIf(Parameters!CveEmpresa.Value = 48,True,False) + + + + Verdana + 8pt + + + + 5.1587in + + + + =Parameters!pFechaFin.Value + + + + + + + Textbox5 + 3.454cm + 0.6cm + 12.91455cm + + = (Globals.PageNumber=1) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Fecha Impresión:" & vbcrlf & Format( Globals!ExecutionTime,"dd/MM/yyyy") + + + + + + + Textbox8 + 0.02088cm + 16.62517cm + 0.57912cm + 3.49249cm + 1 + + = (Globals.PageNumber=1) + + + + 2pt + 2pt + + + + + + + + + 3.73062cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 3.13062cm + 16.37931cm + 0.6cm + 3.95896cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!pFirma2.Value + + + + Textbox2 + 0.10583cm + 1.71666cm + 0.99688cm + 8.02269cm + 1 + + = Iif((Globals.PageNumber=Globals.TotalPages) and (Parameters!pFirma2.Value <> ""),false,true) + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!pFirma1.Value + + + + Textbox2 + 2.73374cm + 6.03938cm + 0.99688cm + 8.02269cm + 2 + + = Iif((Globals.PageNumber=Globals.TotalPages) and (Parameters!pFirma1.Value <> ""),false,true) + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + Textbox2 + 0.10582cm + 10.37435cm + 0.99688cm + 8.02269cm + 3 + + =Microsoft.VisualBasic.Interaction.Iif((Globals!PageNumber = Globals!TotalPages) And (Parameters!pFirma1.Value <> ""), False, True) + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0.5cm + 1cm + 1cm + 0.13cm + - 3.1764cm + 4.4023cm + 0.01325cm 0cm 20.90669cm 4 @@ -2107,6 +2108,7 @@ 0.127cm + 0cm 0cm 20.90669cm 5 diff --git a/Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc b/Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc new file mode 100644 index 000000000..0a0262614 --- /dev/null +++ b/Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc @@ -0,0 +1,969 @@ + + + + + + + + + + + + true + true + + + + + OC + + + + + + + Textbox28 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + 7.36287cm + + + 3.6966cm + + + 2.91394cm + + + 1.65333cm + + + 2.5cm + + + + + 0.46771cm + + + + + true + true + + + + + =Fields!RazonSocial.Value + + + + + + + RazonSocial + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Nombre.Value + + + + + + + Nombre + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteSol.Value + + + + + + + ImporteSol + + + 2pt + 2pt + 2pt + 2pt + es-MX + + + + + + + + true + true + + + + + =Fields!FolioMov.Value + + + + + + + FolioMov + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Importe.Value + + + + + + + Importe + + + 2pt + 2pt + 2pt + 2pt + + + true + + + + + + + + + + + 0.46771cm + + + true + true + + + + + Proveedor + + + + + + + Textbox6 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Usuario Solicitó + + + + + + + Textbox4 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Importe Solicitud + + + + + + + Textbox40 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.46771cm + + + true + true + + + + + Mov. Banc. + + + + + + + Textbox5 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + =IIf(Parameters!Estatus.Value = "3",False,True) + + + + + 0.46771cm + + + true + true + + + + + Importe + + + + + + + Textbox18 + + + Gray + 2pt + 2pt + 2pt + 2pt + + + + + + =IIf(Parameters!Estatus.Value = "3",False,True) + + + + + + + + + + 1.60042cm + + + true + true + + + + + =Fields!Folio.Value + + + + + + + Folio + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + DataSet1 + 0.82931cm + 0.06614cm + 0.93542cm + 19.72716cm + + + + + + true + true + + + + + =Parameters!AgrupadoPor.Value + HTML + + + + + + + Textbox1 + 0.07056cm + 0.06614cm + 0.58236cm + 19.58715cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + 0.79506in + + + + + + + Textbox1 + 2.43857cm + 0.6cm + 14.68354cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE SOLICITUDES DE ANTICIPO + + + + + + + + + + + + + + + + Textbox2 + 0.63528cm + 2.40329cm + 0.52945cm + 14.68354cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.06614cm + 2.22362cm + 2.33715cm + 2 + + + + + + + + + + + 1.61043cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.40041cm + 16.97887cm + 0.68085cm + 2.06587cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + IMPRESO EN SIG, Rep. Solicitudes Anticipo + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.40041cm + 0.06614cm + 0cm + 19.58715cm + 6 + + + + + + + + + + 29.7cm + 21cm + 0.5cm + 0.5cm + 1cm + 1cm + 0.13cm + - - - Reporte de Almacen Periodo - - -
  • - Ver En -
  • - - -
  • - Ver Grafica -
  • -
    -
    -
  • - Genera PDF -
  • -
  • - Genera Excel -
  • -
    - - - - - - - -
    -
    -
    - - "> - -
    -
    -
    -
    Fecha Corte:
    -
    -
    - - - - -
    - - -
    -
    Tipo Almacen:
    -
    - -
    -
    Modalidad:
    -
    - - - - - -
    - -
    -
    -
    -
    -
    -
    - - -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - -
    - - - - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAlmacenPeriodo.aspx.vb" Inherits="Inventarios_RepAlmacenPeriodo" %> + + + + + + + + Reporte de Almacen Periodo + + +
  • + Ver En +
  • + + +
  • + Ver Grafica +
  • +
    +
    +
  • + Genera PDF +
  • +
  • + Genera Excel +
  • +
    + + + + + + + +
    +
    +
    + + +
    +
    +
    +
    Fecha Corte:
    +
    +
    + + + + +
    + + +
    +
    Tipo Almacen:
    +
    + +
    +
    Modalidad:
    +
    + + + + + +
    +
    + +
    +
    Almacen:
    +
    + +
    +
    +
    +
    + +
    +
    +
    + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    + + + + + + - - - + + +
    + diff --git a/Inventarios/RepAlmacenPeriodo.aspx.vb b/Inventarios/RepAlmacenPeriodo.aspx.vb index c8ae610f4..f4c8efd47 100644 --- a/Inventarios/RepAlmacenPeriodo.aspx.vb +++ b/Inventarios/RepAlmacenPeriodo.aspx.vb @@ -39,18 +39,30 @@ Partial Class Inventarios_RepAlmacenPeriodo DdlTipoAlmacen.DataSource = GlobalDTTipoAlmacen(1) DdlTipoAlmacen.DataBind() DdlTipoAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + DdlAlmacen.DataBind() + DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlSucursal.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, CveEstatus:=1) + DdlSucursal.DataBind() + DdlSucursal.Items.Insert(0, New ListItem("Todas", "-1")) + End Sub Private Sub CargaDatos() Dim objInv As New ClsInventarios Dim FechaCorte As Date - FechaCorte = If(IsDate(TxtFechaCorte.Text.Trim()), TxtFechaCorte.Text.ToDate, MaxFecha) + FechaCorte = If(IsDate(TxtFechaCorte.Text.Trim()), TxtFechaCorte.Text.ToDate, MaxFecha) Dim TipoAlmacen As String = If(DdlTipoAlmacen.GetSelectedValuesM = "", "-1", DdlTipoAlmacen.GetSelectedValuesM) + Dim Almacenes As String = If(DdlAlmacen.GetSelectedValuesM = "", "-1", DdlAlmacen.GetSelectedValuesM) + Dim CveSubProyecto As Integer = DdlSucursal.SelectedValue.ToEntero() If RblTotal.Checked Then Ver = 1 If RblExistencia.Checked Then Ver = 2 - If objInv.GetRepAlmacenesPeriodo(FechaCorte, UsuarioActual.CveEmpresa, TipoAlmacen, DdlModalidadFiltro.SelectedValue.ToEntero, ChkInventariable.Checked, Ver) Then + If objInv.GetRepAlmacenesPeriodo(FechaCorte, UsuarioActual.CveEmpresa, TipoAlmacen, DdlModalidadFiltro.SelectedValue.ToEntero, ChkInventariable.Checked, Ver, + Almacenes:=Almacenes, CveSubProyecto:=CveSubProyecto, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then GVAlmacen.DataSource = objInv.DtResultados TmpDT = objInv.DtResultados End If diff --git a/LogMail.txt b/LogMail.txt index 9e13f1f3c..1040cc9c6 100644 --- a/LogMail.txt +++ b/LogMail.txt @@ -4,4 +4,4 @@ en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 05/09/2019:12:31 p. m. From:'signotificaciones@adssistemas.mx' - Para:';' - Asunto:'Envío de complemento de pago' - CCP: '' - Adjuntos: 2 - Ocurrió un error al mandar correo.System.InvalidOperationException: Se debe especificar un destinatario. en System.Net.Mail.SmtpClient.Send(MailMessage message) - en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 10/09/2019:12:16 p. m. From:'signotificaciones@adssistemas.mx' - Para:'DSDDS@hotmail.com' - Asunto:'SIG - La Orden Compra #26598 cambió de estatus.' - CCP: '' - Adjuntos: 0 10/09/2019:02:58 p. m. No se especifico a remitente - SIG - La Orden Compra #28107 cambió de estatus. 11/09/2019:11:56 a. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Solicitud Vacaciones ' - CCP: '' - Adjuntos: 0 11/09/2019:12:35 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'(Vacaciones:Permisos) Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:02 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Permiso para Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:03 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 20/09/2019:05:15 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29109' - CCP: '' - Adjuntos: 1 20/09/2019:05:36 p. m. No se especifico a remitente - Entrega de Factura HMO - 29110 20/09/2019:05:45 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29111' - CCP: '' - Adjuntos: 1 20/09/2019:05:47 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29112' - CCP: '' - Adjuntos: 1 23/09/2019:10:55 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'Solicitud de anticipo de Orden de Compra' - CCP: '' - Adjuntos: 0 23/09/2019:11:05 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 23/09/2019:11:34 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 25/09/2019:05:06 p. m. No se especifico a remitente - SIG - La Orden Compra #4860 cambió de estatus. 04/10/2019:12:09 p. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 83 17/10/2019:12:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1488 cambió de estatus.' - CCP: '' - Adjuntos: 0 17/10/2019:12:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1488 cambió de estatus.' - CCP: 'japmx95@gmail.com;;' - Adjuntos: 0 17/10/2019:12:10 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 17/10/2019:12:39 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 17/10/2019:07:07 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1489 cambió de estatus.' - CCP: '' - Adjuntos: 0 17/10/2019:07:07 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1489 cambió de estatus.' - CCP: 'japmx95@gmail.com;;' - Adjuntos: 0 17/10/2019:07:07 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 17/10/2019:07:11 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 17/10/2019:07:14 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Recepción de Material de OC ' - CCP: '' - Adjuntos: 0 21/10/2019:10:50 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 90 21/10/2019:10:53 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 91 21/10/2019:10:53 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 92 21/10/2019:10:59 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 93 21/10/2019:11:03 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 94 21/10/2019:07:01 p. m. No se especifico a remitente - SIG. Requisición #30796 Bitacora 21/10/2019:07:02 p. m. No se especifico a remitente - SIG. Requisición #30796 Bitacora 21/10/2019:07:18 p. m. No se especifico a remitente - SIG. Requisición #31573 Bitacora 21/10/2019:07:35 p. m. No se especifico a remitente - SIG - La Requisicion #31706 cambió de estatus. 21/10/2019:07:35 p. m. No se especifico a remitente - SIG - La Requisicion #31706 cambió de estatus. 21/10/2019:07:36 p. m. No se especifico a remitente - SIG - La Requisición #31706 cambió de estatus. 21/10/2019:07:36 p. m. No se especifico a remitente - SIG. Requisición #31706 Modificada 21/10/2019:07:37 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 21/10/2019:07:37 p. m. No se especifico a remitente - SIG - La Requisición #31706 se le ha asignado 21/10/2019:07:41 p. m. No se especifico a remitente - SIG - La Requisicion #31707 cambió de estatus. 21/10/2019:07:41 p. m. No se especifico a remitente - SIG - La Requisicion #31707 cambió de estatus. 21/10/2019:07:42 p. m. No se especifico a remitente - SIG. Requisición #31707 Bitacora 22/10/2019:09:25 a. m. No se especifico a remitente - SIG. Requisición #31697 Bitacora 22/10/2019:04:50 p. m. No se especifico a remitente - SIG - La Requisicion #31708 cambió de estatus. 22/10/2019:04:50 p. m. No se especifico a remitente - SIG - La Requisicion #31708 cambió de estatus. 22/10/2019:05:03 p. m. No se especifico a remitente - SIG. Requisición #31708 Modificada 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'arnoldopc@hotmail.com' - Asunto:'SIG - La Requisición #31816 cambió de estatus.' - CCP: '' - Adjuntos: 0 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'arnoldopc@hotmail.com' - Asunto:'SIG. Requisición #31816 Modificada' - CCP: '' - Adjuntos: 0 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'rene.molina@adsistemas.mx;' - Asunto:'SIG - Se Genero una Orden de Compra' - CCP: '' - Adjuntos: 1 29/10/2019:12:51 p. m. No se especifico a remitente - SIG - La Orden Compra #30034 cambió de estatus. 30/10/2019:10:09 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 30/10/2019:10:10 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Recepción de Material de OC ' - CCP: '' - Adjuntos: 0 04/11/2019:11:03 a. m. From:'signotificaciones@adssistemas.mx' - Para:'janeth_borchardt@hotmail.com;janethborchardt94@gmail.com' - Asunto:'Desactivación de cliente ACUACULTURA BIOTECNOLOGICA SA DE CV' - CCP: '' - Adjuntos: 0 04/11/2019:11:09 a. m. From:'signotificaciones@adssistemas.mx' - Para:'janeth_borchardt@hotmail.com;janeth_borchardt94@hotmail.com' - Asunto:'Activación de cliente ACUACULTURA BIOTECNOLOGICA SA DE CV' - CCP: '' - Adjuntos: 0 \ No newline at end of file + en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 10/09/2019:12:16 p. m. From:'signotificaciones@adssistemas.mx' - Para:'DSDDS@hotmail.com' - Asunto:'SIG - La Orden Compra #26598 cambió de estatus.' - CCP: '' - Adjuntos: 0 10/09/2019:02:58 p. m. No se especifico a remitente - SIG - La Orden Compra #28107 cambió de estatus. 11/09/2019:11:56 a. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Solicitud Vacaciones ' - CCP: '' - Adjuntos: 0 11/09/2019:12:35 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'(Vacaciones:Permisos) Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:02 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Permiso para Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:03 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 20/09/2019:05:15 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29109' - CCP: '' - Adjuntos: 1 20/09/2019:05:36 p. m. No se especifico a remitente - Entrega de Factura HMO - 29110 20/09/2019:05:45 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29111' - CCP: '' - Adjuntos: 1 20/09/2019:05:47 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29112' - CCP: '' - Adjuntos: 1 23/09/2019:10:55 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'Solicitud de anticipo de Orden de Compra' - CCP: '' - Adjuntos: 0 23/09/2019:11:05 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 23/09/2019:11:34 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 25/09/2019:05:06 p. m. No se especifico a remitente - SIG - La Orden Compra #4860 cambió de estatus. 04/10/2019:12:09 p. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 83 17/10/2019:12:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1488 cambió de estatus.' - CCP: '' - Adjuntos: 0 17/10/2019:12:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1488 cambió de estatus.' - CCP: 'japmx95@gmail.com;;' - Adjuntos: 0 17/10/2019:12:10 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 17/10/2019:12:39 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 17/10/2019:07:07 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1489 cambió de estatus.' - CCP: '' - Adjuntos: 0 17/10/2019:07:07 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'SIG - La Orden Compra #1489 cambió de estatus.' - CCP: 'japmx95@gmail.com;;' - Adjuntos: 0 17/10/2019:07:07 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 17/10/2019:07:11 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 17/10/2019:07:14 p. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Recepción de Material de OC ' - CCP: '' - Adjuntos: 0 21/10/2019:10:50 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 90 21/10/2019:10:53 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 91 21/10/2019:10:53 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 92 21/10/2019:10:59 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 93 21/10/2019:11:03 a. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 94 21/10/2019:07:01 p. m. No se especifico a remitente - SIG. Requisición #30796 Bitacora 21/10/2019:07:02 p. m. No se especifico a remitente - SIG. Requisición #30796 Bitacora 21/10/2019:07:18 p. m. No se especifico a remitente - SIG. Requisición #31573 Bitacora 21/10/2019:07:35 p. m. No se especifico a remitente - SIG - La Requisicion #31706 cambió de estatus. 21/10/2019:07:35 p. m. No se especifico a remitente - SIG - La Requisicion #31706 cambió de estatus. 21/10/2019:07:36 p. m. No se especifico a remitente - SIG - La Requisición #31706 cambió de estatus. 21/10/2019:07:36 p. m. No se especifico a remitente - SIG. Requisición #31706 Modificada 21/10/2019:07:37 p. m. No se especifico a remitente - SIG - Se Genero una Orden de Compra 21/10/2019:07:37 p. m. No se especifico a remitente - SIG - La Requisición #31706 se le ha asignado 21/10/2019:07:41 p. m. No se especifico a remitente - SIG - La Requisicion #31707 cambió de estatus. 21/10/2019:07:41 p. m. No se especifico a remitente - SIG - La Requisicion #31707 cambió de estatus. 21/10/2019:07:42 p. m. No se especifico a remitente - SIG. Requisición #31707 Bitacora 22/10/2019:09:25 a. m. No se especifico a remitente - SIG. Requisición #31697 Bitacora 22/10/2019:04:50 p. m. No se especifico a remitente - SIG - La Requisicion #31708 cambió de estatus. 22/10/2019:04:50 p. m. No se especifico a remitente - SIG - La Requisicion #31708 cambió de estatus. 22/10/2019:05:03 p. m. No se especifico a remitente - SIG. Requisición #31708 Modificada 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'arnoldopc@hotmail.com' - Asunto:'SIG - La Requisición #31816 cambió de estatus.' - CCP: '' - Adjuntos: 0 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'arnoldopc@hotmail.com' - Asunto:'SIG. Requisición #31816 Modificada' - CCP: '' - Adjuntos: 0 24/10/2019:01:46 p. m. From:'signotificaciones@adssistemas.mx' - Para:'rene.molina@adsistemas.mx;' - Asunto:'SIG - Se Genero una Orden de Compra' - CCP: '' - Adjuntos: 1 29/10/2019:12:51 p. m. No se especifico a remitente - SIG - La Orden Compra #30034 cambió de estatus. 30/10/2019:10:09 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 30/10/2019:10:10 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com;' - Asunto:'Recepción de Material de OC ' - CCP: '' - Adjuntos: 0 04/11/2019:11:03 a. m. From:'signotificaciones@adssistemas.mx' - Para:'janeth_borchardt@hotmail.com;janethborchardt94@gmail.com' - Asunto:'Desactivación de cliente ACUACULTURA BIOTECNOLOGICA SA DE CV' - CCP: '' - Adjuntos: 0 04/11/2019:11:09 a. m. From:'signotificaciones@adssistemas.mx' - Para:'janeth_borchardt@hotmail.com;janeth_borchardt94@hotmail.com' - Asunto:'Activación de cliente ACUACULTURA BIOTECNOLOGICA SA DE CV' - CCP: '' - Adjuntos: 0 06/11/2019:11:44 a. m. No se especifico a remitente - Entrega de Factura MATRIZ HM-1504 06/11/2019:11:53 a. m. No se especifico a remitente - Entrega de Factura MATRIZ HM-1505 06/11/2019:11:57 a. m. No se especifico a remitente - Entrega de Factura MATRIZ HM-1506 06/11/2019:06:05 p. m. No se especifico a remitente - SIG. Requisición #31835 Bitacora \ No newline at end of file diff --git a/LogTimbrado.txt b/LogTimbrado.txt index 4d2db01dc..b329362bb 100644 --- a/LogTimbrado.txt +++ b/LogTimbrado.txt @@ -16,3 +16,7 @@ .. PAC: 4 - Verificado : (6) 6 Certificado : (384) 390 Armado: (27) 417 Genera: (390) 807 Timbrado: (2271) 3078 Guardado: (219) 3297 Actualizado: (902) 4199 ..01/10/2019:12:27 a. m. .. PAC: 4 - Verificado : (0) 0 Certificado : (204) 204 Armado: (1) 205 Genera: (249) 454 Timbrado: (431) 885 ..01/10/2019:12:27 a. m. + + .. PAC: 2 - Verificado : (32764) 32764 Armado: (660) 33424 Guardado: (445) 33869 Timbrado: (156762) 190631 ..06/11/2019:09:39 a. m. + + .. PAC: 2 - Verificado : (2018) 2018 Armado: (96902) 98920 Guardado: (312) 99232 Timbrado: (1201) 100433 ..06/11/2019:09:41 a. m. diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 58e6b919a..d8d27c13c 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -2889,7 +2889,7 @@ Partial Class OC If ChkCotizacion.Checked AndAlso NoProveedoresCot > 0 AndAlso (NumCotizacionesGanadoras > 0 OrElse Not (NumCotizacionesGanadoras <= 0 AndAlso CveConfianzaProveedor = 1)) Then Dim CveProveedor = -1 - Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0, PorIVA = 0.0, Porcentaje = 0.0 + Dim TotalCot = 0.0, IVACot = 0D, RetIVA = 0.0, RetISR = 0.0, PorIVA = 0.0 Dim IdPoliza = -1 @@ -2900,11 +2900,10 @@ Partial Class OC CveProveedor = dr("CveProveedor").ToString.ToEntero - Porcentaje = DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) / DtDetalle.SUM("Total") - PorIVA = GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDouble - IVACot = (DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) * PorIVA).ToString.ToDecimal - RetIVA = TxtRetIVA.Text.ToDecimal * Porcentaje - RetISR = TxtRetISR.Text.ToDecimal * Porcentaje + PorIVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2) 'GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDouble + IVACot = IVA '(DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) * PorIVA).ToString.ToDecimal + RetIVA = TxtRetIVA.Text.ToDecimal + RetISR = TxtRetISR.Text.ToDecimal If objOrdenCompra.AddOrdenCompra("OC", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega, CveUsuario, CveEmpresaActual, 0, pCveProveedor:=CveProveedor, CveCliente:=Ddlcliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, @@ -2945,7 +2944,15 @@ Partial Class OC End If 'AGREGA DETALLES - If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then + If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, + dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), + dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, + CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, + IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, + RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, + CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, + RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, + IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble) Then HuboError = True Exit For End If @@ -2968,7 +2975,7 @@ Partial Class OC If objOrdenCompra.AddOrdenCompra("OC", -1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlMoneda.SelectedValue.ToEntero, CveEstatusInicialOC, TxtFechaEstimadaEntrega.Text, LugarEntrega, CveUsuario, CveEmpresaActual, 0, pCveProveedor:=DdlProveedores.SelectedValue.ToEntero, pCveProveedorSucursal:=DdlProveedorSucursal.SelectedValue.ToEntero, CveCliente:=Ddlcliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PrioridadObservacion:=txtobsprioridad.Text, PorcentajeIVA:=Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2), IVA:=IVA, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, IDPoliza:=IDPolizaPresupuestal, CveCotizacion:=CveCotizacion, FolioAdicional:=TxtFolioAdicional.Text, - EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=LtImporteIEAnticipo.Text.ToDouble, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, + EntregaDirecta:=If(ChkEntregaDirecta.Checked, 1, -1), CveDireccionEnvio:=If(DdlDireccionEnvio.Visible, DdlDireccionEnvio.SelectedValue.ToEntero, -1), IEPS:=TxtIEPS.Text.ToDecimal, CveIEAnticipo:=CveIEAnticipo, ImporteAnticipo:=LtImporteIEAnticipo.Text.ToDouble, UsoCFDI:=DdlUsoCFDI.SelectedValue.ToEntero, Promocion:=Promocion) Then diff --git a/OC/RepCotizacionesDetalle.aspx b/OC/RepCotizacionesDetalle.aspx index a5960e571..eeecd680b 100644 --- a/OC/RepCotizacionesDetalle.aspx +++ b/OC/RepCotizacionesDetalle.aspx @@ -1,374 +1,351 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCotizacionesDetalle.aspx.vb" Inherits="PopOCCotizacionesDetalle" %> - -<%--<%@ MasterType VirtualPath="~/Site.master" %>--%> - - - - - - - - - - - - - - - - - - - - - -
    Carga de Cotizaciones
    - -
    - -
    - -
    -
    - - <%--PROVEEDORES--%> -
    -
    - -
    -
    - Proveedores -
    -
    -
    -
    - -
    -
    - -
    - - - - - - - - - -
    - -
    - - -
    -
    - - -
    - - - - - -
    -
    - - - -
    - - -
    -
    - - <%--ARCHIVO--%> -
    - Archivo: - [HplArchivo] -   -
    - - Seleccionar Archivo - -
    - -
    - -
    -
    - - <%--DATOS DE COTIZACION--%> -
    - -
    - -
    -
    - Datos contización -
    -
    -
    -
    - -
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - -
    - -
    - -
    - - - - - - - - - - -
    -
    - -
    - -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%----%> -
    -
    -
    -
    - -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCotizacionesDetalle.aspx.vb" Inherits="PopOCCotizacionesDetalle" %> + +<%--<%@ MasterType VirtualPath="~/Site.master" %>--%> + + + + + + + + + + + + + + + + +
    Carga de Cotizaciones
    +
    +
    +
    + + +
    + +
    +
    + Proveedores +
    +
    +
    +
    + +
    +
    + +
    + + + + + + + + + +
    + +
    + + +
    +
    + + +
    + + + + + +
    +
    +
    +
    +
    +
    +
    + Archivo +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + Datos contización +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + +
    + +
    + + + + + + + + + + +
    +
    + +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + - + +
    diff --git a/OC/RepCotizacionesDetalle.aspx.vb b/OC/RepCotizacionesDetalle.aspx.vb index ba8f2d67d..e2829799f 100644 --- a/OC/RepCotizacionesDetalle.aspx.vb +++ b/OC/RepCotizacionesDetalle.aspx.vb @@ -2,13 +2,14 @@ Option Explicit On Imports System.Data +Imports System.Net Imports Extensiones Partial Class PopOCCotizacionesDetalle - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "Propiedades" - + Friend Property EsNuevo As Boolean Get EsNuevo = DirectCast(ViewState("EsNuevo"), Boolean) @@ -43,11 +44,20 @@ Partial Class PopOCCotizacionesDetalle Set(ByVal value As DataTable) ViewState("DtDetalle") = value End Set - End Property - + End Property + Private Property Adjunto As String + Get + Adjunto = ViewState("Adjunto").ToString + End Get + Set(value As String) + ViewState("Adjunto") = value + End Set + End Property + + #End Region - - + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then @@ -76,9 +86,9 @@ Partial Class PopOCCotizacionesDetalle BtnEliminar.Visible = True End If End If - End Sub - - + End Sub + + #Region " INICIALIZA VALORES - CARGA COMBOS " Protected Sub CargaProveedoresClasificaciones() CboClasificacionProveedor.DataSource = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa) @@ -97,11 +107,11 @@ Partial Class PopOCCotizacionesDetalle Protected Sub CargaMonedas() ddlMoneda.DataSource = GlobalDTMonedas() ddlMoneda.DataBind() - End Sub - + End Sub + #End Region - - + + #Region "C A R G A D A T O S " Private Sub CargaOCDetalle(pCveOrden As Integer) Dim objOC As New ClsOC @@ -129,11 +139,10 @@ Partial Class PopOCCotizacionesDetalle TxtFecha.Text = objCotizacion.Fecha.ToShortDateString ddlMoneda.SelectedValue = objCotizacion.CveMoneda.ToString TxtDiasCredito.Text = objCotizacion.DiasCredito.ToString - + Adjunto = objCotizacion.Adjunto If objCotizacion.Adjunto <> "" Then - HplArchivo.NavigateUrl = String.Format("/Empresas/{0}/Cotizaciones/{1}", UsuarioActual.CveEmpresa, objCotizacion.Adjunto) - HplArchivo.Text = String.Format("Descargar", IO.Path.GetExtension(objCotizacion.Adjunto).Replace("."c, "")) 'ImageUrl = String.Format("/Imagenes/{0}.png", IO.Path.GetExtension(Cot.NombreArchivo).Replace("."c, "")) - HplArchivo.Visible = True + 'HplArchivo.NavigateUrl = String.Format("/Empresas/{0}/Cotizaciones/{1}", UsuarioActual.CveEmpresa, objCotizacion.Adjunto) + LnkArchivo.Visible = True End If If objCotizacion.GetCotizacionesDetalle(pCveCotizacion) Then @@ -155,7 +164,7 @@ Partial Class PopOCCotizacionesDetalle TxtDiasCredito.Enabled = False TxtFecha.Enabled = False TxtFolio.Enabled = False - FUArchivo.Enabled = False + 'FUArchivo.Enabled = False If UsuarioActual.TienePermisoProceso(146) Then GvDC.Enabled = True @@ -164,61 +173,71 @@ Partial Class PopOCCotizacionesDetalle End If BtnGuardar.Enabled = False - End Sub + End Sub #End Region - - + + #Region " GUARDAR " Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Dim objCotizacion As New ClsOC objCotizacion.IniciaTransacSQL() - Dim TieneError = False - - + Dim TieneError = False + + Dim FileExtension As String = "" + Dim Filesgral As List(Of Archivo) = TxtArchivo.getfiles().Archivos + Dim Filename As String = "" + For Each fileItem As Archivo In Filesgral + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)) '.Replace(".", "") + Filename = fileItem.filename + Next + Try If EsNuevo Then - If objCotizacion.AddCotizacion(CveOrdenCompra, CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, IO.Path.GetExtension(FUArchivo.FileName), ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario) Then - If FUArchivo.HasFile Then - 'verificar que exista el directorio - If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) Then - System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) - End If - FUArchivo.SaveAs(String.Format("{0}/Empresas/{1}/Cotizaciones/{2}{3}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, objCotizacion.CveCotizacion, IO.Path.GetExtension(FUArchivo.FileName))) + If objCotizacion.AddCotizacion(CveOrdenCompra, CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, FileExtension, ddlMoneda.SelectedValue.ToEntero, + TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario) Then + + 'verificar que exista el directorio + If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) Then + System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) + End If + + If Filename <> "" Then + Filename.FilesMove(objCotizacion.CveCotizacion.ToString(), String.Format("Empresas\{0}\Cotizaciones", UsuarioActual.CveEmpresa)) End If + For Each dr As GridViewRow In GvDC.Rows - TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.DataKey("Cantidad").ToDouble, dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToDouble, If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1", dr.FCTextBox("txtFechaEntrega").Text), dr.FCTextBox("txtObservacion").Text.ToString, dr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero) + TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.DataKey("Cantidad").ToDouble, + dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToDouble, + If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1", + dr.FCTextBox("txtFechaEntrega").Text), dr.FCTextBox("txtObservacion").Text.ToString, dr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero) If TieneError = True Then Exit For Next End If Else - Dim NombreArchivo As String = "" - - If objCotizacion.UpdateCotizacion(CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, IO.Path.GetExtension(FUArchivo.FileName), ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario, CveCotizacion) Then - - If FUArchivo.HasFile Then - 'verificar que exista el directorio - If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) Then - System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) - End If - FUArchivo.SaveAs(String.Format("{0}/Empresas/{1}/Cotizaciones/{2}{3}", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa, CveCotizacion, IO.Path.GetExtension(FUArchivo.FileName))) - NombreArchivo = CveCotizacion & IO.Path.GetExtension(FUArchivo.FileName) + If objCotizacion.UpdateCotizacion(CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, FileExtension, ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario, CveCotizacion) Then + + 'verificar que exista el directorio + If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) Then + System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", AppDomain.CurrentDomain.BaseDirectory, UsuarioActual.CveEmpresa)) + End If + + If Filename <> "" Then + Filename.FilesMove(CveCotizacion.ToString(), String.Format("Empresas\{0}\Cotizaciones", UsuarioActual.CveEmpresa)) End If For Each dr As GridViewRow In GvDC.Rows If dr.DataKey("CveCotizacionDetalle").ToEntero > 0 Then TieneError = Not objCotizacion.UpdateCotizacionDetalle(dr.DataKey("CveCotizacionDetalle").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.FCTextBox("txtCantidadSurtir").Text.ToDouble, dr.FCTextBox("txtFechaEntrega").Text, dr.FCTextBox("txtObservacion").Text.ToString) Else - Dim strTemp = dr.DataKey("CveOrdenCompraDetalle").ToString If dr.FCTextBox("txtCantidadSurtir").Text.ToString.ToDouble > 0 Then If dr.FCTextBox("TxtPU").Text.ToDouble > 0 Then TieneError = Not objCotizacion.AddCotizacionDetalle(CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.DataKey("Cantidad").ToDouble, dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToString.ToDouble, If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1", dr.FCTextBox("txtFechaEntrega").Text), dr.FCTextBox("txtObservacion").Text.ToString, dr.DataKey("CveOrdenCompraDetalle").ToEntero) End If - End If If TieneError = True Then Exit For Next @@ -229,38 +248,25 @@ Partial Class PopOCCotizacionesDetalle End If Catch ex As Exception TieneError = True - objCotizacion.RollBack() OnError("Se presento un error al guardar la cotización", ex) - End Try - - If Not TieneError Then - objCotizacion.Commit() Alert(If(EsNuevo, "Cotización Guardada.", "Cotización Actualizada."), TipoMensaje.MsgInformacion) - Else - Try - objCotizacion.RollBack() - Catch ex As Exception - OnError("Error al intetar hace RollBack", ex) - End Try - - - - + Else + objCotizacion.RollBack() End If objCotizacion.Dispose() RegistraScript("Ir();") - End Sub + End Sub #End Region - - - - + + + + #Region " ELIMINAR " Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click Dim objCotizacion As New ClsOC @@ -274,10 +280,10 @@ Partial Class PopOCCotizacionesDetalle objCotizacion.Dispose() RegistraScript("Ir();") - End Sub + End Sub #End Region - - + + #Region " G V D " Protected Sub GvD_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDC.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -365,10 +371,30 @@ Partial Class PopOCCotizacionesDetalle 'e.Row.Attributes.Add("data-validadores", ValidadoresId) - Dim asdasdasd As String = "" - End If - End Sub + Dim asdasdasd As String = "" + End If + End Sub #End Region - - + + + Protected Sub LnkArchivo_Click(sender As Object, e As EventArgs) + If Not String.IsNullOrEmpty(Adjunto) Then + Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, "Cotizaciones\" & Adjunto) + Dim Archivo As New System.IO.FileInfo(filePath) + + If Archivo.Exists Then + HttpContext.Current.Response.Clear() + HttpContext.Current.Response.ClearContent() + HttpContext.Current.Response.ContentType = "application/octet-stream" + HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + System.IO.Path.GetFileName(filePath)) + HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) + HttpContext.Current.Response.TransmitFile(filePath) + HttpContext.Current.Response.Flush() + HttpContext.Current.Response.End() + + Archivo = Nothing + End If + End If + + End Sub End Class diff --git a/OC/RepSolicitudesAnticipo.aspx b/OC/RepSolicitudesAnticipo.aspx index acd8fd09e..7b3187682 100644 --- a/OC/RepSolicitudesAnticipo.aspx +++ b/OC/RepSolicitudesAnticipo.aspx @@ -10,14 +10,12 @@ -<%-- - -
  • - - Generar PDF -
  • -
    -
    --%> +
  • + Generar PDF +
  • +
  • + Exporta Excel +
  • diff --git a/OC/RepSolicitudesAnticipo.aspx.cs b/OC/RepSolicitudesAnticipo.aspx.cs index 69d5fd3fe..b8cc189ea 100644 --- a/OC/RepSolicitudesAnticipo.aspx.cs +++ b/OC/RepSolicitudesAnticipo.aspx.cs @@ -1,11 +1,13 @@ using System; using System.Collections.Generic; +using System.Data; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Extensiones; +using Microsoft.Reporting.WebForms; using static Extensiones.ModExtensiones; public partial class OC_RepSolicitudesAnticipo : ClsPaginas @@ -47,6 +49,11 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas ViewState["FechaF"] = value; } } + private DataTable DtDatos + { + get { return DtDatos = (DataTable)ViewState["DtDatos"]; } + set { ViewState["DtDatos"] = value; } + } #endregion protected void Page_Load(object sender, EventArgs e) @@ -82,7 +89,8 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero())) { - GvSolicitudes.DataSource = ObjOC.DtResultados; + DtDatos = ObjOC.DtResultados; + GvSolicitudes.DataSource = DtDatos; } ObjOC.Dispose(); @@ -106,4 +114,51 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas } CargaDatos(); } + + protected void LnkExcel_Click(object sender, EventArgs e) + { + GenerarPDF("EXCEL"); + } + + protected void LnkPdf_Click(object sender, EventArgs e) + { + GenerarPDF("PDF"); + } + + protected void GenerarPDF(String Opcion) + { + String FechaI; + if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = ""; } else { FechaI = $" Fecha Inicial: {txtFechaI.Text}"; } + String FechaF; + if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = ""; } else { FechaF = $" Fecha Final: {txtFechaF.Text}"; } + String Proveedor; + if (DdlProveedor.SelectedValue != "-1") { Proveedor = $" Proveedor: {DdlProveedor.SelectedItem.Text}"; } else { Proveedor = ""; } + String Estatus; + if (DdlEstatus.SelectedValue != "1") { Estatus = $" Estatus: {DdlEstatus.SelectedItem.Text}"; } else { Estatus = ""; } + + if (DtDatos.Rows.Count > 0) + { + 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("Estatus", DdlEstatus.SelectedValue)); + String Agrupadores = $"{Proveedor}{FechaI}{FechaF}{Estatus}"; + para.Add(new ReportParameter("AgrupadoPor", (Agrupadores == "" ? "": $"Agrupado Por: {Agrupadores}"))); + if (Imagen.Exists) + { + para.Add(new ReportParameter("LogoPath", logouri)); + } + else + { + para.Add(new ReportParameter("LogoPath", "")); + } + ImprimirPDF("Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc", DtDatos, para, "Reporte de Solicitudes de Anticipos", Opcion); + } + else + { + Alert("No hay datos consultados", ModExtensiones.TipoMensaje.MsgAdvertencia); + } + } } \ No newline at end of file diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 5797aae3b..115a6f2cf 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -373,16 +373,16 @@ Partial Class OS_OrdenesServicios End If UpDetalleOS.Update() End Sub - Protected Sub DdlCCEdit_SelectedIndexChanged(sender As Object, e As System.EventArgs) - Dim gvr As GridViewRow = DirectCast(DirectCast(sender, DropDownList).BindingContainer, GridViewRow) - Dim CveProyecto As String = DirectCast(sender, DropDownList).SelectedValue + 'Protected Sub DdlCCEdit_SelectedIndexChanged(sender As Object, e As System.EventArgs) + ' Dim gvr As GridViewRow = DirectCast(DirectCast(sender, DropDownList).BindingContainer, GridViewRow) + ' Dim CveProyecto As String = DirectCast(sender, DropDownList).SelectedValue - gvr.FCDropDownList("DDlSubProyecto").Items.Clear() - gvr.FCDropDownList("DDlSubProyecto").DataSource = GlobalDTSubProyectos(CveProyecto.ToEntero) - gvr.FCDropDownList("DDlSubProyecto").DataBind() - gvr.FCDropDownList("DDlSubProyecto").Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1")) + ' gvr.FCDropDownList("DDlSubProyecto").Items.Clear() + ' gvr.FCDropDownList("DDlSubProyecto").DataSource = GlobalDTSubProyectos(CveProyecto.ToEntero) + ' gvr.FCDropDownList("DDlSubProyecto").DataBind() + ' gvr.FCDropDownList("DDlSubProyecto").Items.Insert(0, New ListItem("Sin SubProyecto Asignado", "-1")) - End Sub + 'End Sub Protected Sub DdlFR_SelectedIndexChanged(sender As Object, e As EventArgs) Dim DdlFR_Gv As DropDownList = CType(sender, DropDownList) Dim index As Integer = CType(DdlFR_Gv.NamingContainer, GridViewRow).FCLiteral("LtlConsecutivo").Text.ToString.ToEntero @@ -1037,7 +1037,7 @@ Partial Class OS_OrdenesServicios Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero Dim Archivo As New System.IO.FileInfo(String.Format("{0}OS\Temp\{1}", UsuarioActual.Empresa.Ruta, Row("Archivo").ToString)) - CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePS, Cantidad, -1, -1, Observaciones, False, SeFacturara, False, CveCuentaEquipo, "-1", "-1", "-1", ComentarioTecnico, UsuarioActual.CveUsuario, Archivo:=Archivo.Name) + CveOsDetalle = ObjOrdenServicio.AddOrdenesServiciosDetalle(ObjOrdenServicio.CveOS, CvePS, Cantidad, -1, -1, Observaciones, False, True, False, CveCuentaEquipo, "-1", "-1", "-1", ComentarioTecnico, UsuarioActual.CveUsuario, Archivo:=Archivo.Name) If CveOsDetalle > 0 Then If Archivo.Name <> "-1" AndAlso Archivo.Exists Then @@ -1300,9 +1300,10 @@ Partial Class OS_OrdenesServicios Row.FCLinkButton("imgEstatus").CssClass = "btn btn-circle btn-sm green" Else Row.FCLinkButton("imgEstatus").Enabled = False - 'TmpDT.Rows(Row.RowIndex)("Estatus") = "False" - 'Row.FCLinkButton("imgEstatus").CssClass = "btn btn-circle btn-sm red" + TmpDT.Rows(Row.RowIndex)("Estatus") = "False" + Row.FCLinkButton("imgEstatus").CssClass = "btn btn-circle btn-sm red" End If + UpDetalleOS.Update() End Sub Private Sub BtnAddGvDetalle_Click(sender As Object, e As EventArgs) Handles BtnAddGvDetalle.Click Dim ObjOS As New ClsOS @@ -2265,9 +2266,16 @@ Partial Class OS_OrdenesServicios TieneError = True End If + 'SI OCURRIO UN ERROR EN LA EXISTENCIA RECARGAMOS EL GRID PARA COLOREAR LOS DETALLES CON ERROR + If ErrorExistencia Then + Alert("Ocurrió un error en la existencia", TipoMensaje.MsgError) + TieneError = True + End If + If Not TieneError Then Dim ObjOS As New ClsOS - For Each Row As DataRow In TmpDTMaterialesDetalle.Rows + Dim MaterialesDetalleNuevos As DataTable = TmpDTMaterialesDetalle.FiltraParametros("CveMaterial = -1") + For Each Row As DataRow In MaterialesDetalleNuevos.Rows Dim CveUM As Integer = Row("CveUM").ToString.ToEntero Dim CvePS As Integer = Row("CvePS").ToString.ToEntero Dim Cantidad As Integer = Row("Cantidad").ToString.ToEntero @@ -2287,13 +2295,6 @@ Partial Class OS_OrdenesServicios ObjOS.Dispose() End If - - 'SI OCURRIO UN ERROR EN LA EXISTENCIA RECARGAMOS EL GRID PARA COLOREAR LOS DETALLES CON ERROR - If ErrorExistencia Then - Alert("Ocurrió un error en la existencia", TipoMensaje.MsgError) - TieneError = True - End If - If Not TieneError Then ObjInventario.Commit() Alert($"El Traspaso se guardó correctamente con el folio #: {Folio}.", TipoMensaje.MsgInformacion, $"document.location.href=""/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}""") diff --git a/Sistemas/PopUpAddUsuario.aspx b/Sistemas/PopUpAddUsuario.aspx index 9d685feb4..631fef59b 100644 --- a/Sistemas/PopUpAddUsuario.aspx +++ b/Sistemas/PopUpAddUsuario.aspx @@ -495,7 +495,7 @@ if (this.checked) { total = total + 1; } - if (total == 5) { + if (total == 7) { alert("Ya tiene el maximo numero de comandos favoritos para asignar."); this.checked = false; return false; @@ -513,9 +513,22 @@ } for (let i = thantes; i < thclick; i++) { let th = $(''); - let input = $('') + let input = $('') th.append(input); + var total = 0; input.click(function () { + var total = 0; + $(".ChecaFavoritos > input").each(function () { + + if (this.checked) { + total = total + 1; + } + if (total == 7) { + alert("Ya tiene el maximo numero de comandos favoritos para asignar."); + this.checked = false; + return false; + } + }); $('#' + gv + ' tr td:nth-child(' + i + ') input[type="checkbox"]:not([disabled="disabled"])').prop("checked", input.is(":checked")) }); tr.append(th); diff --git a/Ventas/CatClasificaciones.aspx b/Ventas/CatClasificaciones.aspx index 9311cc807..d8fbfc59d 100644 --- a/Ventas/CatClasificaciones.aspx +++ b/Ventas/CatClasificaciones.aspx @@ -76,7 +76,7 @@
    + DataKeyNames="CveClasificacion, CveCategoria, Clasificacion, UsoClasificacion, CuentaGasto, CuentaCostos, CuentaIngresos, IdCuentaGasto, IdCuentaCostos, IdCuentaIngresos,RequiereSerieLote,CveSATPS,SATClaveProductoServicio, RequiereAFCompra, RequiereAFInsumo, RequierePersonal, Estatus,EsAcumulador,TopVentas,TopCompras,PrecioBaseCosto" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None"> @@ -210,41 +210,57 @@
    -
    - - +
    + +
    +
    +
    + + +
    + +
    + + + + + + +
    + + +
    + + +
    + + +
    + + +
    + + +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    -
    - - - - - - -
    +
    - -
    - - -
    - - -
    - - -
    - - -
    - - -
    -
    - - -
    diff --git a/Ventas/CatClasificaciones.aspx.vb b/Ventas/CatClasificaciones.aspx.vb index 518919900..0f1bd5b3e 100644 --- a/Ventas/CatClasificaciones.aspx.vb +++ b/Ventas/CatClasificaciones.aspx.vb @@ -178,11 +178,12 @@ Partial Class CatClasificaciones DdlCuentaCostos.SelectedValue.ToEntero, DdlCuentaCostos.SelectedItem.Text, DdlCuentaIngresos.SelectedValue.ToEntero, DdlCuentaIngresos.SelectedItem.Text, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, - RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked) Then + RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") TxtClasificacion.Text = "" + TxtPrecioBaseCosto.Text = "" DdlCuentaGasto.SelectedValueExist("0") DdlCuentaCostos.SelectedValueExist("0") DdlCuentaIngresos.SelectedValueExist("0") @@ -201,7 +202,7 @@ Partial Class CatClasificaciones If ObjClasificaciones.UpdateClasificacion(Clasificacion, "", DdlGasto.SelectedValue.ToEntero, DdlGasto.SelectedItem.Text, DdlCosto.SelectedValue.ToEntero, DdlCosto.SelectedItem.Text, DdlIngresos.SelectedValue.ToEntero, DdlIngresos.SelectedItem.Text, Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, - RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked) Then + RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones")) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) @@ -346,6 +347,7 @@ Partial Class CatClasificaciones Limpiador() TxtClasificacion.Text = "" + TxtPrecioBaseCosto.Text = "" DdlCategoria.SelectedIndex = 0 DdlSATPS.SelectedValue = "" DdlSATPS.SelectedText = "" @@ -371,6 +373,7 @@ Partial Class CatClasificaciones Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim CveClasificacion As String = GvRow.DataKey("CveClasificacion").ToString Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString + Dim PrecioBaseCosto As String = GvRow.DataKey("PrecioBaseCosto").ToString Dim CveCategoria As String = GvRow.DataKey("CveCategoria").ToString Dim CuentaGasto As String = GvRow.DataKey("CuentaGasto").ToString Dim CuentaCostos As String = GvRow.DataKey("CuentaCostos").ToString @@ -421,6 +424,7 @@ Partial Class CatClasificaciones TxtClasificacion.Text = Clasificacion + TxtPrecioBaseCosto.Text = PrecioBaseCosto.FormatoNumero(2) DdlCategoria.SelectedValueExist(CveCategoria) DdlUsoClasificacion.SelectedValue = UsoClasificacion HdnIDClasificacion.Value = CveClasificacion diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 88835c8aa..0434a039d 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -9409,7 +9409,7 @@ Partial Class Clientes Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie - Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 266060f25..55fb82ddc 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2729,7 +2729,16 @@
    -
    +
    +
    + + + + + +
    +
    +
    @@ -2793,22 +2802,22 @@
    -
    +
    - <%--
    +
    - +
    -
    --%> +
    @@ -2833,7 +2842,7 @@
    - + <%----% <%----%> @@ -2854,6 +2863,7 @@
    + <%----%> <%----%> @@ -2877,7 +2887,7 @@
    - + <%----%> <%----%> @@ -3115,15 +3125,27 @@ var Descuento = parseFloat($get("TxtPorDescP").value); $get("LblPrecioFinal").innerText = formato_numero(Monto - ((Monto * Descuento) / 100), 2, '.', ','); - $get("TxtPrecio").value = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); + $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); + $get("TxtDescuento").value = formato_numero(Total, 2, '.', ','); + $get("TxtDescP").value = formato_numero(0, 2, '.', ','); $get("HdnDescuento").value = Total; if (TipoDescuento == 2) { $get("LblDescuentos").innerText = formato_numero(Total, 2, '.', ','); } } - else if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) { + else { + $get("LblPrecioFinal").innerText = "0.00"; + $get("LblDescuento").innerText = "0.00"; + $get("HdnDescuento").value = "0.00"; + } + + } + + function CalculaDescuentoMonto() { + + if ($get("TxtDescP").value != "0" && $get("TxtDescP").value) { var Monto = 0; var TipoDescuento = $get("HdnTipoDescuento").value; @@ -3141,11 +3163,12 @@ } var Descuento = parseFloat($get("TxtDescP").value); - $get("TxtPorDescP").value = Descuento * 100 / Monto * 10 + $get("TxtPorDescP").value = formato_numero((Descuento * 100 / Monto), 2, '.', ','); $get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ','); - $get("TxtPrecio").value = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); + $get("LblTotalPS").innerText = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ','); var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); $get("LblDescuento").innerText = formato_numero(Total, 2, '.', ','); + $get("TxtDescuento").value = formato_numero(Total, 2, '.', ','); $get("HdnDescuento").value = Total; if (TipoDescuento == 2) { Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")); @@ -3156,7 +3179,6 @@ $get("LblDescuento").innerText = "0.00"; $get("HdnDescuento").value = "0.00"; } - } function BorraDescuentos() { diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index e9d5dff51..92388a1df 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1062,7 +1062,7 @@ Partial Class PV 'ImgCerrarIE.Attributes.Add("OnClick", "$('#DivIngresoEgreso').hide();") 'ImgCerrarEstadoCaja.Attributes.Add("OnClick", "$('#DivEstadoCaja').hide();") TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();") - TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuento();") + TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuentoMonto();") TxtFechaAjuste.Attributes.Add("onchange", "CalculaMesesUso();") CreaDTmpC() @@ -2771,6 +2771,9 @@ Partial Class PV Exit Sub End If + TxtDescuento.Text = FormatoNumero(0, 2) + TxtPrecio.Text = "" + If CvePSParametro > 0 Then Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("") @@ -2828,6 +2831,7 @@ Partial Class PV End If If PrecioSugerido > 0 Then TxtPrecio.Text = PrecioSugerido.FormatoNumero() + RegistraScript("$get('LblPrecio1').innerText = formato_numero(" + PrecioSugerido.ToString + ", 2, '.', ',');") End If @@ -3478,13 +3482,50 @@ Partial Class PV Return False End If - Dim CantidadUsados As Decimal = 0 + + 'Validacion de Recepción de Usados + Dim Vendido As Decimal = 0 + Dim Entregado As Decimal = 0 + Dim UltimoEntregado As Decimal = 0 + For Each Gvr As GridViewRow In GvRecepcionUsados.Rows If Gvr.RowType = DataControlRowType.DataRow Then - CantidadUsados = CantidadUsados + Gvr.FCTextBox("TxtCantidad").Text.ToEntero() + If Gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0 Then + Entregado += (Gvr.FCTextBox("TxtCantidad").Text.ToEntero * Gvr.DataKey("Cargo").ToDecimal) + UltimoEntregado = Gvr.DataKey("Cargo").ToDecimal + End If End If Next + If Entregado > 0 Then + 'Calcular Vendido + Dim DTTamanios As New DataTable + Dim ObjAcum As New ClsAcumuladores + If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then + DTTamanios = ObjAcum.DtResultados + End If + ObjAcum.Dispose() + Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") + + If DTTamanios.Rows.Count > 0 And DTTamanios IsNot Nothing And DrPS("CveTamaño").ToString.ToEntero > 0 Then + Vendido = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { DrPS("CveTamaño") }").ToDecimal + End If + + If Entregado > Vendido Then + If (Entregado - Vendido) >= UltimoEntregado Then + Alert("No puede entregar un cargo mayor a lo Vendido", TipoMensaje.MsgAdvertencia) + Return False + End If + End If + End If + + 'Dim CantidadUsados As Decimal = 0 + 'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows + ' If Gvr.RowType = DataControlRowType.DataRow Then + ' CantidadUsados = CantidadUsados + Gvr.FCTextBox("TxtCantidad").Text.ToEntero() + ' End If + 'Next + 'If CantidadUsados > TxtCantidad.Text.ToEntero() Then ' Alert("No puede tener una cantidad mayor a la de los cargos", TipoMensaje.MsgAdvertencia) ' Return False @@ -4294,7 +4335,7 @@ Partial Class PV Private Sub CargaCuentas() - DdlCuentaEfectivo.Items.Clear() + 'DdlCuentaEfectivo.Items.Clear() DdlCuentaTarjetaCredito.Items.Clear() DdlCuentaTarjetaDebito.Items.Clear() DdlCuentaCheque.Items.Clear() @@ -4351,6 +4392,11 @@ Partial Class PV If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub + If TxtCambio.Text.ToDecimal > 0 And TxtImporteEfectivo.Text.ToDecimal < TxtCambio.Text.ToDecimal Then + Alert("Debe haber un pago en efectivo y ser mayor que el cambio. Si no, ser pago exacto.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + If (DtPagos.SUM("Importe").ToString.ToDecimal + total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) Exit Sub @@ -4911,7 +4957,7 @@ Partial Class PV TmpDTAjustes.Columns.Add("CveUM", GetType(Integer)) TmpDTAjustes.Columns.Add("CveVentaDetalle", GetType(Integer)) TmpDTAjustes.Columns.Add("CveVenta", GetType(Integer)) - TmpDTAjustes.Columns.Add("PUFactura", GetType(Integer)) + TmpDTAjustes.Columns.Add("PUFactura", GetType(Double)) End Sub @@ -5085,17 +5131,21 @@ Partial Class PV End Sub Private Sub CalculaMesesUso() - Dim FechaI = TxtFechaAjuste.Text.ToDate.AddDays(1) - Dim FechaF = Now - 'Dim NumDiasAlMes As Double = (365 / 12) + Dim FechaI As Date = TxtFechaAjuste.Text.ToDate.AddDays(1) + Dim FechaF As Date = Now + Dim FechaT As Date = String.Format("{0}/{1}/{2}", FechaI.Day, FechaF.Month, FechaF.Year).ToDate 'armo la fecha con el día del mes actual - 'Dim DiasTranscurridos = DateDiff(DateInterval.Day, FechaI, FechaF) + Dim MesesTrascurridos As Integer = Math.Round(DateDiff(DateInterval.Day, FechaI, FechaT) / 30.4, 2).ToEntero 'saco los meses y lo redondeo - 'Dim MesesTranscurridos As Double = DiasTranscurridos / NumDiasAlMes + If FechaT > FechaF Then + 'todavía está en el mes actual. + MesesTrascurridos = MesesTrascurridos + Else + MesesTrascurridos = MesesTrascurridos + 1 + End If - 'Dim NoMesesTrascurridos = Math.Ceiling(MesesTranscurridos) + TxtMesesUso.Text = MesesTrascurridos.ToString - TxtMesesUso.Text = (DateDiff(DateInterval.Month, FechaI, FechaF) + 1).ToString() CalculaPorcentajeAjuste() End Sub @@ -5110,11 +5160,11 @@ Partial Class PV End If Contador += 1 Next - 'TxtPUFactura.Text = PUFactura.FormatoNumero(2) + TxtPUFactura.Text = PUFactura.FormatoNumero(2) End If If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then - 'TxtPUFactura.Text = "" + TxtPUFactura.Text = "" End If CalculaPorcentajeAjuste() @@ -5167,6 +5217,13 @@ Partial Class PV End If End If + 'el ajuste no puede ser mayor al precio de lo vendido de nuevo + If (TxtPrecio.Text.ToDouble - ((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior))) < 0 Then + TxtDescuentoAjuste.Text = TxtPrecio.Text + TxtImporteAjuste.Text = "0.00" + CargoAnterior = CargoActual + End If + TxtDescuentoAjuste.Text = ((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior)).FormatoNumero TxtDescuentoAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoActual - CargoAnterior).FormatoNumero}." End If @@ -5284,6 +5341,7 @@ Partial Class PV End If Dr("Descuento") = Math.Round((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior), NumeroDecimales) + If Dr("Descuento").ToString.ToDouble > TxtPrecio.Text.ToDouble Then Dr("Descuento") = TxtPrecio.Text.ToDouble Dim TotalCalculableImpuestos As Decimal = (Dr("Cantidad").ToString.ToDecimal * (Dr("PU").ToString.ToDecimal)) - Dr("Descuento").ToString.ToDecimal Dr("ImporteIVA") = Math.Round(Dr("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales) @@ -5689,7 +5747,7 @@ Partial Class PV params.Add(New ReportParameter("PorcentajeAjuste", TxtPorcentajeAjuste.Text.Trim)) 'Informacion Acumulador - params.Add(New ReportParameter("CodEnsamble", If(TxtCodEnsamble.Text.Length > 7, TxtCodEnsamble.Text.Trim.Substring(0, 7), ""))) + params.Add(New ReportParameter("CodEnsamble", TxtCodEnsamble.Text.Trim)) params.Add(New ReportParameter("CodLinea", TxtCodLinea.Text.Trim)) params.Add(New ReportParameter("CodInspeccion", TxtCodInspeccion.Text.Trim)) diff --git a/Ventas/RepComisionesJAM.aspx b/Ventas/RepComisionesJAM.aspx index 17dc09bc9..4bbf10fc2 100644 --- a/Ventas/RepComisionesJAM.aspx +++ b/Ventas/RepComisionesJAM.aspx @@ -131,7 +131,7 @@ <%-- 14 --%> <%-- 15 --%> - + <%-- 16 --%> <%-- 17 --%> diff --git a/Ventas/RepVentasUtilidad.aspx.vb b/Ventas/RepVentasUtilidad.aspx.vb index 230979595..1d7fc16cd 100644 --- a/Ventas/RepVentasUtilidad.aspx.vb +++ b/Ventas/RepVentasUtilidad.aspx.vb @@ -216,7 +216,9 @@ Partial Class Ventas_RepVentasUtilidad e.Row.CssClass = "Totales" End If - + If e.Row.DBCampo("CveVenta").ToEntero > 0 AndAlso Not CBool(e.Row.DBCampo("TienePago")) Then + e.Row.Cells(15).BackColor = Drawing.Color.LightPink + End If Dim Liga As String = String.Format("/Ventas/RepVentasUtilidadDetalle.aspx?CveVenta={0}&CveVendedor={1}&FechaI={2:d}&FechaF={3:d}&CveCliente={4}&Orden={5}&CveSubProyecto={6}&CvePS={7}&CveClasificacion={8}", diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 7b9a65473..1e1c3dc49 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -3344,7 +3344,7 @@ Partial Class Ventas Dim Cons As Integer = 1 For Each dr As DataRow In OS.DtResultados.FiltraParametros("SeFacturara = 1 ").Rows - AgregarProductoServicio(dr("Cantidad").ToString.ToDecimal, dr("CveUM").ToString.ToEntero, dr("UM").ToString, -1, "", dr("CvePS").ToString.ToEntero, "", dr("Obs").ToString, 0, 0, -1, "", + AgregarProductoServicio(dr("Cantidad").ToString.ToDecimal, dr("CveUM").ToString.ToEntero, dr("UM").ToString, -1, "", dr("CvePS").ToString.ToEntero, "", dr("Obs").ToString, dr("PU").ToString.ToDecimal, 0, -1, "", dr("CveSubProyecto").ToString.ToEntero, dr("SubProyecto").ToString) 'Dim drt As DataRow = TmpDT.NewRow @@ -4217,6 +4217,11 @@ Partial Class Ventas BtnPermisoEditarCotizacion.Visible = True End If + 'SOLO LA PUEDE EDITAR USUATIOACTUAL-VENDEDOR | NO DEBE ESTAR FACTURADA + If UsuarioActual.TienePermisoProceso(281) And TmpDT.SUM("CantidadFacturadaCot") = 0 Then 'And TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") + BtnPermisoEditarCotizacion.Visible = True + End If + 'ACTIVA BOTONERA | DEBE TENER CONCEPTOS PENDIENTES DE FACTURAR If TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True) @@ -4279,10 +4284,21 @@ Partial Class Ventas 'CargaDetalle If ObjVentas.GetVentaDetalle(CveVenta) Then - TmpDT = ObjVentas.DtResultados - TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) - TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) - 'TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal)) + + + For Each dr As DataRow In ObjVentas.DtResultados.Rows + AgregarProductoServicio(dr("Cantidad").ToString.ToDecimal, dr("CveUM").ToString.ToEntero, dr("UM").ToString, dr("CveClasificacion").ToString.ToEntero, dr("Clasificacion").ToString, + dr("CvePS").ToString.ToEntero, dr("PS").ToString, dr("Obs").ToString, dr("PU").ToString.ToDecimal, dr("Descuento").ToString.ToDecimal, + dr("CveProyecto").ToString.ToEntero, dr("Proyecto").ToString, dr("CveSubProyecto").ToString.ToEntero, dr("SubProyecto").ToString, + CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString.ToEntero, RegeneraIEPS:=False, SeActualiza:=True) + + + Next + + 'TmpDT = ObjVentas.DtResultados + 'TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) + 'TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) + ''TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal)) GvPS.DataSource = ObjVentas.DtResultados GvPS.DataBind() End If @@ -8338,7 +8354,7 @@ Partial Class Ventas Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie - Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT @@ -9576,24 +9592,24 @@ Partial Class Ventas TCFluctuacion = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal End If - If DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then - ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion - ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then - ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion - ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then - Importe251 = Dr("Importe").ToString.ToDecimal / TCFluctuacion - ImporteMN251 = Dr("Importe").ToString.ToDecimal - Else - ImporteMN251 = Dr("Importe").ToString.ToDecimal - End If + If DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then + ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion + ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then + ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion + ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then + Importe251 = Dr("Importe").ToString.ToDecimal / TCFluctuacion + ImporteMN251 = Dr("Importe").ToString.ToDecimal + Else + ImporteMN251 = Dr("Importe").ToString.ToDecimal + End If - Importe251 = (Importe251 * Multiplicador).RoundSQL + Importe251 = Importe251.RoundSQL - Importe91 = (Importe91 * ValorMultiplicador).RoundSQL - ImporteMN91 = (ImporteMN91 * Multiplicador).RoundSQL - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${Importe91.FormatoNumero(2)}" + Importe91 = (Importe91).RoundSQL + ImporteMN91 = (ImporteMN91 * Multiplicador).RoundSQL + If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${Importe91.FormatoNumero(2)}" - CveUltimaVenta = Dr("CveVenta").ToString.ToEntero + CveUltimaVenta = Dr("CveVenta").ToString.ToEntero Dim ImporteComplementarioIngreso As Decimal = 0 If UsaComplementariaClientes = True AndAlso tipoCambio > 1 Then @@ -10304,9 +10320,9 @@ Partial Class Ventas Exit For End If - If DrPago("CveTipoMovimiento").ToString.ToEntero = 8 Then '13 - DrPago("Importe") = DrPago("Importe").ToString.ToDecimal - TxtCambio.Text.ToDecimal - End If + 'If DrPago("CveTipoMovimiento").ToString.ToEntero = 8 Then '13 + ' DrPago("Importe") = DrPago("Importe").ToString.ToDecimal - TxtCambio.Text.ToDecimal + 'End If CveIEPago = ObjBancos.AddBancos_IE(DrPago("CveCuenta").ToString.ToEntero, DrPago("CveTipoMovimiento").ToString.ToEntero, Fecha, FolioIE.ToString, String.Format("PAGO: {0}", TxtFolio.Text), DrPago("Importe").ToString.ToDouble, DdlMoneda.SelectedValue.ToEntero, tipoCambio, DrPago("Observaciones").ToString, "", False, False, -1, ObjFactura.CvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=CveCorte, MesesSinIntereses:=DrPago("MesesSinIntereses").ToString.ToEntero) @@ -12907,6 +12923,16 @@ Partial Class Ventas DdlUnidadMedida.DataBind() DdlUnidadMedida.SelectedValueExist(drPS("CveUnidadMedida").ToString) + If drPS("CveTipoPS").ToString = "1" Then 'Si es servicio + If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then 'Si es Empresa llantera + TxtPrecio.Enabled = True + Else + TxtPrecio.Enabled = False + End If + Else + TxtPrecio.Enabled = True + End If + If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count = 0 Then DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString) CambiaMoneda() @@ -12963,7 +12989,16 @@ Partial Class Ventas End If + Dim PrecioBaseCosto As Decimal = 0 + Dim ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones() Then + PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal + End If + If PrecioSugerido > 0 Then + If PrecioBaseCosto > 0 Then + PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1) + End If TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere End If @@ -16464,10 +16499,15 @@ Partial Class Ventas If total <= 0 Then Alert("No se ha ingresado importe", TipoMensaje.MsgAdvertencia) : Exit Sub - 'If DtPagos.SUM("Importe").ToString.ToDecimal + total > TxtTotal.Text.ToDecimal Then - ' Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) - ' Exit Sub - 'End If + If TxtCambio.Text.ToDecimal > 0 And TxtImporteEfectivo.Text.ToDecimal < TxtCambio.Text.ToDecimal Then + Alert("Debe haber un pago en efectivo y ser mayor que el cambio. Si no, ser pago exacto.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If (DtPagos.SUM("Importe").ToString.ToDecimal + total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then + Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor rectifique.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If 'Pago en Efectivo If TxtImporteEfectivo.Text.ToDecimal > 0 Then @@ -16477,7 +16517,7 @@ Partial Class Ventas DrEfectivo("TipoMovimiento") = "Pago en Efectivo" DrEfectivo("CveCuenta") = DdlCuentaEfectivo.SelectedValue DrEfectivo("Cuenta") = DdlCuentaEfectivo.SelectedItem.Text - DrEfectivo("Importe") = TxtImporteEfectivo.Text + DrEfectivo("Importe") = TxtImporteEfectivo.Text.ToDecimal - TxtCambio.Text.ToDecimal DrEfectivo("Folio") = CargaFolioContado(DdlCuentaEfectivo.SelectedValue.ToEntero, 6) DrEfectivo("Observaciones") = "" DrEfectivo("Tipo") = "Caja Chica" @@ -16674,15 +16714,15 @@ Partial Class Ventas Private Function ValidaPagosContado() As Boolean Dim Retorno = False - If (UsuarioActual.CveEmpresa = 140) AndAlso (Not PermiteCredito) AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) Then + If (UsuarioActual.CveEmpresa = 140) AndAlso (Not PermiteCredito) AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) And TxtTotal.Text.ToDecimal > 0 Then Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia) Retorno = True End If - 'If DtPagos.SUM("Importe").ToString.ToDecimal > TxtTotal.Text.ToDecimal Then - ' Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) - ' Retorno = True - 'End If + If (DtPagos.SUM("Importe").ToString.ToDecimal + Total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then + Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia) + Retorno = True + End If Return Retorno End Function diff --git a/asmx/WSApp.asmx b/asmx/WSApp.asmx index 685e55e7f..0c92d6bd9 100644 --- a/asmx/WSApp.asmx +++ b/asmx/WSApp.asmx @@ -803,7 +803,7 @@ Public Class WSApp Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie - Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT diff --git a/asmx/WSSIGApp.asmx b/asmx/WSSIGApp.asmx index a9f62a494..febee922a 100644 --- a/asmx/WSSIGApp.asmx +++ b/asmx/WSSIGApp.asmx @@ -2142,7 +2142,7 @@ Public Class WSSIGApp Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", "")) Timbre.Comprobante.Folio = Obj.Folio.ToString Timbre.Comprobante.Serie = Obj.Serie - Timbre.Comprobante.Fecha = Obj.Fecha + Timbre.Comprobante.Fecha = Obj.FechaCP Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT diff --git a/asmx/WsTSoft.asmx b/asmx/WsTSoft.asmx index 2ef85eaa7..94e8b0ab4 100644 --- a/asmx/WsTSoft.asmx +++ b/asmx/WsTSoft.asmx @@ -1 +1,302 @@ -<%@ WebService Language="VB" CodeBehind="~/App_Code/WsTSoft.vb" Class="WsTSoft" %> +<%@ WebService Language="VB" Class="WsTSoft" %> +Imports System.Web +Imports System.Net.Http +Imports System.Web.Services +Imports System.Data +Imports System.Web.Services.Protocols +Imports System.Collections.Generic +Imports System.Linq +Imports Extensiones +Imports Newtonsoft.Json +Imports Newtonsoft.Json.Linq + +' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. +' _ + + + +Public Class WsTSoft + Inherits System.Web.Services.WebService + + + Public Function AddRemision(FolioRemision As String, NoEconomico As String, CveEstatus As Integer, GeoInicial As String, GeoCarga As String, GeoEntrega As String, Fecha As String) As String + Dim retorno As String = "" + Dim objTsoft As New ClsTSoft + objTsoft.IniciaTransacSQL() + Dim Continuar As Boolean = objTsoft.AddRemisiones(FolioRemision, NoEconomico, CveEstatus, GeoInicial, GeoCarga, GeoEntrega, Fecha) + Dim objRem As New addRemisionObj + If Continuar Then + objTsoft.Commit() + objRem.CveRemision = objTsoft.DtResultados.Rows(0)("CveRemision").ToString().ToEntero() + objRem.CurrentError = "" + Else + objTsoft.RollBack() + objRem.CveRemision = 0 + objRem.CurrentError = objTsoft.MyCurrentError + End If + objTsoft.Dispose() + retorno = JsonConvert.SerializeObject(objRem) + Return retorno.ToString + End Function + + + Public Function UpEstatusRemision(FolioRemision As String, CveEstatus As String) As String + Dim retorno As String = "" + Dim objTsoft As New ClsTSoft + Dim Continuar As Boolean = objTsoft.UpEstatusRemision(FolioRemision, CveEstatus) + Dim objRem As New upEstatusRemisionObj + If Continuar Then + objRem.SeActualizo = 1 + objRem.CurrentError = "" + Else + objRem.SeActualizo = 0 + objRem.CurrentError = objTsoft.MyCurrentError + End If + objTsoft.Dispose() + retorno = JsonConvert.SerializeObject(objRem) + Return retorno.ToString + End Function + + Public Function GetUltimaPosicion(DevID As String) As String + Dim retorno As String = "" + Dim ObjGPS As New ClsGPS + Dim Continuar As Boolean = ObjGPS.UltimaPosicionEquipoGetWS(DevID) + Dim ObjPos As New LatLng + If Continuar Then + ObjPos.Lat = ObjGPS.DtResultados.Rows("0")("Lat").ToString + ObjPos.Lng = ObjGPS.DtResultados.Rows("0")("Lng").ToString + Else + ObjPos.CurrentError = "No se pudo obtener la posición." + End If + ObjGPS.Dispose() + retorno = JsonConvert.SerializeObject(ObjPos) + Return retorno.ToString + End Function + + Public Function TerminoRemision(FolioRemision As String, NoEconomico As String) As String + Dim retorno As String = "" + Dim objTsoft As New ClsTSoft + Dim Continuar As Boolean = objTsoft.UpEstatusRemision(FolioRemision, 6) + Dim objRem As New upEstatusRemisionObj + If Continuar Then + objRem.SeActualizo = 1 + objRem.CurrentError = "" + Else + objRem.SeActualizo = 0 + objRem.CurrentError = objTsoft.MyCurrentError + End If + objTsoft.Dispose() + retorno = JsonConvert.SerializeObject(objRem) + Return retorno.ToString + End Function + + Public Function GetRemisionHistorial(FolioRemision As String, NoEconomico As String) As String + Dim retorno As String = "" + Dim objTsoft As New ClsTSoft + Dim Continuar As Boolean = objTsoft.GETRemisionesHistorial(FolioRemision, NoEconomico) + Dim objRem As New GetRemisionHistorialesObj + If Continuar Then + objRem.Historial = objTsoft.DtResultados.DataTableToObject(Of GetRemisionHistorialsObj) + objRem.CurrentError = "" + Else + objRem.Historial = New List(Of GetRemisionHistorialsObj) + objRem.CurrentError = objTsoft.MyCurrentError + End If + objTsoft.Dispose() + retorno = JsonConvert.SerializeObject(objRem) + Return retorno.ToString + End Function + + Public Function GetInfoEventos(FechaInicio As String, FechaFin As String) As String + Dim retorno As String = "[]" + + Dim objTsoft As New ClsTSoft + If objTsoft.GetInfoEventosPenske(FechaInicio.ToDateTime(), FechaFin.ToDateTime()) Then + If objTsoft.DtResultados.Rows.Count > 0 Then + 'CONSULTA DIRECCIONES + Dim Direcciones As JArray = ConsultarDirecciones(objTsoft.DtResultados) + For Each Dir As JObject In Direcciones + objTsoft.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString() + Next + + retorno = objTsoft.DtResultados.DataTableToJSONIPP() + Else + retorno = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.Mensaje = "No se encontraron resultados"}) + End If + Else + retorno = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.Mensaje = "Ocurrío un error al consultar los datos"}) + End If + objTsoft.Dispose() + + Return retorno.ToString + End Function + + Public Function TieneRemisionesActivas(NoEconomico As String) As String + Dim retorno As String = "" + Dim Continuar As Boolean = False + + Dim ObjTSoft As New ClsTSoft + Continuar = ObjTSoft.TieneRemisionesActivas(NoEconomico) + + Dim objRem As New MTieneRemisiones With + { + .TieneRemisiones = Continuar, + .CurrentError = ObjTSoft.MyCurrentError + } + ObjTSoft.Dispose() + retorno = JsonConvert.SerializeObject(objRem) + Return retorno + End Function + + + Public Function ConsultarDirecciones(Dt As DataTable) As JArray + Dim retorno As JArray = Nothing + Dim posicionesArray = New JArray(From Row As DataRow In Dt + Let index = Dt.Rows().IndexOf(Row) + Select New JObject( + New JProperty("indice", index), + New JProperty("cveTrama", -1), + New JProperty("lat", Row("Latitud").ToString.ToDouble), + New JProperty("lon", Row("Longitud").ToString.ToDouble) + )) + + Dim Base64array = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(posicionesArray.ToString())) + + Using wc As New HttpClient() + Try + Dim Url = New Uri($"{ClsPaginas.UrlDirecciones}nominatim/reverseMultiple.php") + Dim FormStuff = String.Format("formato=json&posiciones={0}", Base64array) + Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded") + Dim response = wc.PostAsync(Url, content).Result + Dim result = response.Content.ReadAsStringAsync().Result + retorno = JArray.Parse(result) + Catch ex As Exception + OnError("Ocurrió un error al obtener las direcciones", ex) + End Try + End Using + Return retorno + End Function + + Public Class addRemisionObj + Public CveRemision As Integer + Public CurrentError As String + End Class + + Public Class upEstatusRemisionObj + Public SeActualizo As Integer + Public CurrentError As String + End Class + + Public Class MTieneRemisiones + Public TieneRemisiones As Boolean + Public CurrentError As String + End Class + + Public Class LatLng + Public Lat As String + Public Lng As String + Public CurrentError As String + End Class + + Public Class GetRemisionHistorialsObj + Public Property Fecha As DateTime + Public Property FolioRemision As String + Public Property NoEconomico As String + Public Property Lat As String + Public Property Lon As String + Public Property Distancia As String + Public Property TrackingNumber As String + Public Property CveEstatus As Integer + End Class + + Public Class GetRemisionHistorialesObj + Public Historial As List(Of GetRemisionHistorialsObj) + Public CurrentError As String + End Class + + + Public Class ObjRemisiones + + Public Property cveRemisiones() As Integer + Get + Return m_cveRemisiones + End Get + Set + m_cveRemisiones = Value + End Set + End Property + Private m_cveRemisiones As Integer + Public Property folioRemision() As String + Get + Return m_folioRemision + End Get + Set + m_folioRemision = Value + End Set + End Property + Private m_folioRemision As String + Public Property cveDispositivo() As Integer + Get + Return m_cveDispositivo + End Get + Set + m_cveDispositivo = Value + End Set + End Property + Private m_cveDispositivo As Integer + Public Property iMEI() As String + Get + Return m_iMEI + End Get + Set + m_iMEI = Value + End Set + End Property + Private m_iMEI As String + Public Property cveEstatus() As Integer + Get + Return m_cveEstatus + End Get + Set + m_cveEstatus = Value + End Set + End Property + Private m_cveEstatus As Integer + Public Property geoInicio() As String + Get + Return m_geoInicio + End Get + Set + m_geoInicio = Value + End Set + End Property + Private m_geoInicio As String + Public Property geoFin() As String + Get + Return m_geoFin + End Get + Set + m_geoFin = Value + End Set + End Property + Private m_geoFin As String + Public Property lat() As String + Get + Return m_lat + End Get + Set + m_lat = Value + End Set + End Property + Private m_lat As String + Public Property lon() As String + Get + Return m_lon + End Get + Set + m_lon = Value + End Set + End Property + Private m_lon As String + End Class +End Class