diff --git a/.gitignore b/.gitignore index ced3b68c7..dc964f860 100644 --- a/.gitignore +++ b/.gitignore @@ -276,4 +276,5 @@ __pycache__/ /Front /PortalCliente/ePagos/ -vwd.webinfo \ No newline at end of file +vwd.webinfo +/Bin.rar diff --git a/AF/OrdenTrabajo.aspx b/AF/OrdenTrabajo.aspx index 955d449d4..2725753e6 100644 --- a/AF/OrdenTrabajo.aspx +++ b/AF/OrdenTrabajo.aspx @@ -55,223 +55,300 @@ -
-
-
-
- - +
+ +
+
+
+
+ + + +
+
+
+ <%--
+
+
+ + +
+ +
+ + + + +
+ + +
+ + + + +
+ +
+ + + + +
+ + +
+ + + + +
+ + + +
+ + +
+
-
-
- <%--
+ + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + +
-
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
-
- - - - +
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + - + + + + + + -
- - - - -
- -
- - - - - + + + + + + + + + + +
+ + -
- - -
- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -318,13 +395,15 @@
+ +
- + diff --git a/AF/OrdenTrabajo.aspx.vb b/AF/OrdenTrabajo.aspx.vb index d7c2d7326..7eb814f2b 100644 --- a/AF/OrdenTrabajo.aspx.vb +++ b/AF/OrdenTrabajo.aspx.vb @@ -36,6 +36,7 @@ Partial Class AF_OrdenTrabajo If Request("CveOrdenTrabajo") IsNot Nothing Then CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero + Tab.Visible = True End If CargaCombos() @@ -50,6 +51,15 @@ Partial Class AF_OrdenTrabajo #Region " CARGA COMBOS " Protected Sub CargaCombos() + + + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + + DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1) + DdlAF.DataBind() + + + Dim ObjAF As New ClsAF If ObjAF.GetTiposServicios(-1, -1, -1, UsuarioActual.CveEmpresa) Then @@ -58,10 +68,21 @@ Partial Class AF_OrdenTrabajo DdlTipoServicio.DataSource = Nothing End If + + If ObjAF.GetOrdenesTrabajoEstatus(UsuarioActual.CveEmpresa) Then + DdlOrdenesTrabajoEstatus.DataSource = ObjAF.DtResultados + Else + DdlOrdenesTrabajoEstatus.DataSource = Nothing + End If + + ObjAF.Dispose() DdlTipoServicio.DataBind() + DdlOrdenesTrabajoEstatus.DataBind() + DdlTipoServicio.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + DdlOrdenesTrabajoEstatus.SelectedValueExist(1) UpFiltro.Update() @@ -85,26 +106,13 @@ Partial Class AF_OrdenTrabajo Private Sub CargaDatos() - Dim ObjAF As New ClsAF - ObjAF.Dispose() - End Sub - Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound - - If e.Row.RowType = DataControlRowType.DataRow Then - - - - End If - - End Sub - #End Region Protected Sub LnkEliminarMetricaValor_Click(sender As Object, e As EventArgs) @@ -114,6 +122,34 @@ Partial Class AF_OrdenTrabajo Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) + If CveOrdenTrabajo <= 0 Then + + + Dim ObjAF As New ClsAF + ObjAF.IniciaTransacSQL() + Dim ErrorProceso As Boolean = False + + If Not ObjAF.AddOrdenesTrabajo(DdlTipoServicio.SelectedValue.ToEntero, DdlAF.SelectedValue.ToEntero, TxtServicio.Text.Trim, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, txtFechaI.Text.ToDate, MaxFecha, MaxFecha, DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + ErrorProceso = True + + + End If + + If Not ErrorProceso Then + ObjAF.Commit() + Alert($"Orden de trabajo guardada corectamente Folio {ObjAF.FolioOT}") + Else + ObjAF.RollBack() + End If + + + + ObjAF.Dispose() + + + Else + + End If @@ -282,4 +318,55 @@ Partial Class AF_OrdenTrabajo +#Region "FOLIOS" + + + Private Function CargaFolios() As Boolean + + Dim Respuesta As Boolean = False + + If DdlSubProyecto.SelectedValue.ToEntero() <= 0 Then + Alert("No se tienen asignadas sucursales", TipoMensaje.MsgError) + Return False + Exit Function + End If + + Dim ObjFolios As New ClsGralFolios() + + If ObjFolios.GetFolios("OT", UsuarioActual.CveEmpresa) Then + + Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyecto.SelectedValue)) + + If DT.Rows.Count > 0 Then + Respuesta = True + Else + + Alert("No tiene registrados Folios para " & DdlSubProyecto.SelectedItem.Text & " ", TipoMensaje.MsgAdvertencia) + End If + + DT.Dispose() + + End If + + ObjFolios.Dispose() + + + Return Respuesta + End Function + +#End Region + + + Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) + + If CargaFolios() Then + BtnGuardar.Enabled = True + Else + BtnGuardar.Enabled = False + End If + + UpGuardar.Update() + + + End Sub End Class diff --git a/AF/TipoOrdenTrabajo.aspx b/AF/TipoOrdenTrabajo.aspx index 907178821..f15bf08c9 100644 --- a/AF/TipoOrdenTrabajo.aspx +++ b/AF/TipoOrdenTrabajo.aspx @@ -28,7 +28,7 @@ } .table.dataTable { - margin-top: 0px !important; + margin-top: 0px !important; } .dataTables_scrollBody table th { @@ -81,36 +81,24 @@
-
- - - - -
- -
- - - - -
- -
+
-<%--
- - - - + +
+ + + -
--%> +
+ +
@@ -133,7 +121,7 @@
-
+
@@ -181,13 +169,14 @@ + OnRowDataBound="GvActividades_RowDataBound" + DataKeyNames="CveTipoServicioActividad,CveActividad,Duracion" GridLines="None"> - + @@ -217,19 +206,35 @@
-
+
- + + + + + + + + + + + + + + + + - + diff --git a/AF/TipoOrdenTrabajo.aspx.vb b/AF/TipoOrdenTrabajo.aspx.vb index f559d1da8..cebcd7af4 100644 --- a/AF/TipoOrdenTrabajo.aspx.vb +++ b/AF/TipoOrdenTrabajo.aspx.vb @@ -67,6 +67,9 @@ Partial Class AF_TipoOrdenTrabajo End Property + + + #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load @@ -77,57 +80,23 @@ Partial Class AF_TipoOrdenTrabajo CveTipoServicio = Request("CveTipoServicio").ToEntero End If + CargaCombos() + + If CveTipoServicio = -1 Then CrearTablas() + CargaActividades() + CargaCheckList() + Else + CargaDatos() End If - CargaCombos() + End If End Sub - Property IndexMaterial As Integer - Get - If ViewState("IndexMaterial") Is Nothing Then - Return -1 - Else - Return ViewState("IndexMaterial").ToString.ToEntero - End If - End Get - Set(value As Integer) - ViewState("IndexMaterial") = value - End Set - End Property - - - - Property IndexActividades As Integer - Get - If ViewState("IndexActividades") Is Nothing Then - Return -1 - Else - Return ViewState("IndexActividades").ToString.ToEntero - End If - End Get - Set(value As Integer) - ViewState("IndexActividades") = value - End Set - End Property - - Property IndexCheckList As Integer - Get - If ViewState("IndexCheckList") Is Nothing Then - Return -1 - Else - Return ViewState("IndexCheckList").ToString.ToEntero - End If - End Get - Set(value As Integer) - ViewState("IndexCheckList") = value - End Set - End Property - @@ -157,10 +126,6 @@ Partial Class AF_TipoOrdenTrabajo DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") - If CveTipoServicio <= 0 Then - CargaActividades() - - End If End Sub @@ -221,6 +186,25 @@ Partial Class AF_TipoOrdenTrabajo Private Sub CargaDatos() + Dim ErrorProceso As Boolean = False + + Dim ObjAf As New ClsAF + + If ObjAf.GetTiposServicios(CveTipoServicio, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + + + If ObjAf.DtResultados.Rows.Count > 0 Then + TxtTipoServicio.Text = ObjAf.DtResultados(0)("Nombre").ToString + DdlTipoMantenimiento.SelectedValueExist(ObjAf.DtResultados(0)("CveTipoMantenimiento").ToString) + End If + + + Else + ErrorProceso = True + End If + + ObjAf.Dispose() + CargaMateriales() CargaActividades() CargaCheckList() @@ -233,7 +217,9 @@ Partial Class AF_TipoOrdenTrabajo Dim ObjAF As New ClsAF - If ObjAF.GetTiposServiciosMaterial(-1, CveTipoServicio) Then + If ObjAF.GetTiposServiciosMaterial(-1, CveTipoServicio, UsuarioActual.CveEmpresa) Then + + DTMateriales = ObjAF.DtResultados GvMaterial.DataSource = DTMateriales Else @@ -256,20 +242,26 @@ Partial Class AF_TipoOrdenTrabajo Dim ObjAF As New ClsAF - If CveTipoServicio <= 0 Then + If CveTipoServicio > 0 Then - If ObjAF.GetActividades(-1, -1, -1, UsuarioActual.CveEmpresa) Then + If ObjAF.GetTiposServiciosActividades(-1, CveTipoServicio, -1) Then GvActividades.DataSource = ObjAF.DtResultados Else GvActividades.DataSource = Nothing End If + Else + If ObjAF.GetActividades(-1, -1, -1, UsuarioActual.CveEmpresa) Then + GvActividades.DataSource = ObjAF.DtResultados + Else + GvActividades.DataSource = Nothing + End If End If + ObjAF.Dispose() GvActividades.DataBind() - UpGvActividades.Update() End Sub @@ -278,17 +270,51 @@ Partial Class AF_TipoOrdenTrabajo Dim ObjAF As New ClsAF + If CveTipoServicio > 0 Then + + If ObjAF.GetCheckList(-1, CveTipoServicio, -1, UsuarioActual.CveEmpresa) Then + GvCheckList.DataSource = ObjAF.DtResultados + Else + GvCheckList.DataSource = Nothing + End If + + Else + If ObjAF.GetCheckListActividad(-1, -1, UsuarioActual.CveEmpresa) Then + GvCheckList.DataSource = ObjAF.DtResultados + Else + GvCheckList.DataSource = Nothing + End If + End If + + ObjAF.Dispose() - + GvCheckList.DataBind() + UpGvCheckList.Update() End Sub - Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) + + + + Protected Sub GvCheckList_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then + Dim Chk As CheckBox = e.Row.FCCheckBox("Chk") + If e.Row.DataKey("CveCheckListActividad").ToEntero = 0 Then + + e.Row.FCLiteral("LtlNROW").Text = e.Row.DataKey("CheckListActividadGrupo").ToString + Chk.Visible = False + e.Row.Attributes.Add("style", "background-color:#DDD") + + End If + + + If e.Row.DataKey("CveTipoServicio").ToEntero > 0 Then + Chk.Checked = True + End If End If @@ -572,36 +598,146 @@ Partial Class AF_TipoOrdenTrabajo 'validacion? + If CveTipoServicio = -1 Then + + If ObjAF.AddTiposServicios(TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - If ObjAF.AddTiposServicios(TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + CveTipoServicio = ObjAF.CveTipoServicio + + For Each GvRow As GridViewRow In GvMaterial.Rows + + If Not ObjAF.AddTiposServiciosMaterial(CveTipoServicio, GvRow.DataKey("Cantidad").ToDecimal, GvRow.DataKey("CveUM").ToEntero, GvRow.DataKey("CvePS").ToEntero, GvRow.DataKey("Tipo").ToEntero) Then + ErrorProceso = True + Exit For + End If + + Next + + For Each GvRow As GridViewRow In GvActividades.Rows + + Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") + Dim Horas As Decimal = GvRow.FCTextBox("TxtHoras").Text.ToDecimal + + If Chk.Checked Then + If Not ObjAF.AddTiposServiciosActividades(GvRow.DataKey("CveActividad").ToEntero, CveTipoServicio, Horas, "") Then + ErrorProceso = True + Exit For + End If + End If + Next - CveTipoServicio = ObjAF.CveTipoServicio + For Each GvRow As GridViewRow In GvCheckList.Rows - For Each GvRow As GridViewRow In GvMaterial.Rows + Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") + Dim CveCheckListActividad As Integer = GvRow.DataKey("CveCheckListActividad").ToEntero + + If Chk.Checked Then + If Not ObjAF.AddCheckList(CveTipoServicio, CveCheckListActividad) Then + ErrorProceso = True + Exit For + End If + End If + + + Next + + + End If + + Else + + If Not ObjAF.UpdateTiposServicios(CveTipoServicio, TxtTipoServicio.Text.Trim, DdlTipoMantenimiento.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ErrorProceso = True + End If + + + If Not ErrorProceso Then + + For Each GvRow As GridViewRow In GvActividades.Rows + + + Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") + Dim CveTipoServicioActividad As Integer = GvRow.DataKey("CveTipoServicioActividad").ToEntero + Dim CveActividad As Integer = GvRow.DataKey("CveActividad").ToEntero + + Dim Horas As Decimal = GvRow.FCTextBox("TxtHoras").Text.ToDecimal + + If Chk.Checked Then + + If CveTipoServicioActividad > 0 Then + If Not ObjAF.UpdateTiposServiciosActividades(CveTipoServicioActividad, CveActividad, Horas, "") Then + ErrorProceso = True + Exit For + End If + Else + If Not ObjAF.AddTiposServiciosActividades(CveActividad, CveTipoServicio, Horas, "") Then + ErrorProceso = True + Exit For + End If + End If + + Else + + If CveTipoServicioActividad > 0 Then + If Not ObjAF.DeleteTiposServiciosActividades(CveTipoServicioActividad, UsuarioActual.CveEmpresa) Then + ErrorProceso = True + Exit For + End If + End If + + End If + Next + + If Not ErrorProceso Then + + For Each GvRow As GridViewRow In GvCheckList.Rows + Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") + + + If Chk.Visible Then + + Dim CveTipoServicioTmp As Integer = GvRow.DataKey("CveTipoServicio").ToEntero + Dim CveCheckList As Integer = GvRow.DataKey("CveCheckList").ToEntero + Dim CveCheckListActividad As Integer = GvRow.DataKey("CveCheckListActividad").ToEntero + + If CveTipoServicioTmp > 0 Then + + If Not Chk.Checked Then + + If Not ObjAF.DeleteCheckList(CveCheckList) Then + ErrorProceso = True + Exit For + End If + End If + + Else + + If Chk.Checked Then + If Not ObjAF.AddCheckList(CveTipoServicio, CveCheckListActividad) Then + ErrorProceso = True + Exit For + End If + End If + + End If + + + + End If + + Next - If Not ObjAF.AddTiposServiciosMaterial(CveTipoServicio, GvRow.DataKey("Cantidad").ToDecimal, GvRow.DataKey("CveUM").ToEntero, GvRow.DataKey("CvePS").ToEntero, GvRow.DataKey("Tipo").ToEntero) Then - ErrorProceso = True - Exit For End If - Next - - For Each GvRow As GridViewRow In GvActividades.Rows - - Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") - Dim Horas As Decimal = GvRow.FCTextBox("").Text.ToDecimal - - - If ObjAF.AddTiposServiciosActividades(GvRow.DataKey("").ToEntero) Then - - Next - + End If End If + + If ErrorProceso Then ObjAF.RollBack() Else @@ -612,6 +748,77 @@ Partial Class AF_TipoOrdenTrabajo ObjAF.Dispose() + CargaDatos() + End Sub + + Protected Sub Chk_CheckedChanged(sender As Object, e As EventArgs) + + 'Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, CheckBox).BindingContainer, GridViewRow) + 'Dim Chk As CheckBox = GvRow.FCCheckBox("Chk") + + 'Dim CveTipoServicioActividad As Integer = GvRow.DataKey("CveTipoServicioActividad").ToEntero + 'Dim CveActividad As Integer = GvRow.DataKey("CveActividad").ToEntero + + 'Dim Horas As Decimal = GvRow.FCTextBox("TxtHoras").Text.ToDecimal + + 'Dim ObjAF As New ClsAF + + + 'If Chk.Checked Then + + ' If CveTipoServicioActividad > 0 Then + ' If ObjAF.UpdateTiposServiciosActividades(CveTipoServicioActividad, CveActividad, Horas, "") Then + + ' End If + ' Else + ' If ObjAF.AddTiposServiciosActividades(CveActividad, CveTipoServicio, Horas, "") Then + + ' End If + ' End If + + 'Else + + + ' If CveTipoServicioActividad > 0 Then + + ' If ObjAF.DeleteTiposServiciosActividades(CveTipoServicioActividad, UsuarioActual.CveEmpresa) Then + + ' End If + + ' End If + + 'End If + + + 'ObjAF.Dispose() + + + End Sub + + + + Protected Sub GvActividades_RowDataBound(sender As Object, e As GridViewRowEventArgs) + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim CveTipoServicioActividad As Integer = e.Row.DataKey("CveTipoServicioActividad").ToEntero + Dim TxtHoras As TextBox = e.Row.FCTextBox("TxtHoras") + Dim Chk As CheckBox = e.Row.FCCheckBox("Chk") + + If CveTipoServicioActividad > 0 Then + + Chk.Checked = True + TxtHoras.Text = e.Row.DataKey("Duracion") + + + + End If + + + + End If + + End Sub End Class diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index c66beb356..b9df20682 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -91,6 +91,8 @@ Public Class ClsAF Public Property CveDispositivo As Integer Public Property MedidaVehicular As Integer Public Property CveTipoServicio As Integer + Public Property CveOrdenTrabajo As Integer + Public Property FolioOT As Integer #End Region @@ -3480,6 +3482,7 @@ Public Class ClsAF #End Region #Region "TIPO SERVICIO" + Public Function GetTiposServicios(CveTipoServicio As Integer, CveTipoMantenimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -3572,7 +3575,7 @@ Public Class ClsAF Return Retorno End Function - Public Function GetTiposServiciosActividades(CveTipoServicioActividad As Integer, CveActividad As Integer) As Boolean + Public Function GetTiposServiciosActividades(CveTipoServicioActividad As Integer, CveTipoServicio As Integer, CveActividad As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_TiposServiciosActividadesGet") @@ -3580,6 +3583,7 @@ Public Class ClsAF With SqlAdapter.SelectCommand.Parameters .Add("@CveTipoServicioActividad", SqlDbType.Int).Value = CveTipoServicioActividad .Add("@CveActividad", SqlDbType.Int).Value = CveActividad + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio End With Try @@ -3592,14 +3596,15 @@ Public Class ClsAF Return Retorno End Function - Public Function AddTiposServiciosActividades(CveActividad As Integer, Duracion As Integer, Observaciones As String) As Boolean + Public Function AddTiposServiciosActividades(CveActividad As Integer, CveTipoServicio As Integer, Duracion As Decimal, Observaciones As String) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_TiposServiciosActividadesAdd") With SqlAdapter.SelectCommand.Parameters .Add("@CveActividad", SqlDbType.Int).Value = CveActividad - .Add("@Duracion", SqlDbType.Int).Value = Duracion + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@Duracion", SqlDbType.SmallMoney).Value = Duracion .Add("@Observaciones", SqlDbType.NVarChar).Value = Observaciones End With @@ -3613,7 +3618,7 @@ Public Class ClsAF Return Retorno End Function - Public Function UpdateTiposServiciosActividades(CveTipoServicioActividad As Integer, CveActividad As Integer, Duracion As Integer, Observaciones As String) As Boolean + Public Function UpdateTiposServiciosActividades(CveTipoServicioActividad As Integer, CveActividad As Integer, Duracion As Decimal, Observaciones As String) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_TiposServiciosActividadesUpdate") @@ -3621,7 +3626,7 @@ Public Class ClsAF With SqlAdapter.SelectCommand.Parameters .Add("@CveTipoServicioActividad", SqlDbType.Int).Value = CveTipoServicioActividad .Add("@CveActividad", SqlDbType.Int).Value = CveActividad - .Add("@Duracion", SqlDbType.Int).Value = Duracion + .Add("@Duracion", SqlDbType.SmallMoney).Value = Duracion .Add("@Observaciones", SqlDbType.NVarChar).Value = Observaciones End With @@ -3635,13 +3640,14 @@ Public Class ClsAF Return Retorno End Function - Public Function DeleteTiposServiciosActividades(CveTipoServicioActividad As Integer) As Boolean + Public Function DeleteTiposServiciosActividades(CveTipoServicioActividad As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_TiposServiciosActividadesDelete") With SqlAdapter.SelectCommand.Parameters .Add("@CveTipoServicioActividad", SqlDbType.Int).Value = CveTipoServicioActividad + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try @@ -3654,7 +3660,7 @@ Public Class ClsAF Return Retorno End Function - Public Function GetTiposServiciosMaterial(CveTipoServicioMaterial As Integer, CveTipoServicio As Integer) As Boolean + Public Function GetTiposServiciosMaterial(CveTipoServicioMaterial As Integer, CveTipoServicio As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_TiposServiciosMaterialGet") @@ -3662,6 +3668,7 @@ Public Class ClsAF With SqlAdapter.SelectCommand.Parameters .Add("@CveTipoServicioMaterial", SqlDbType.Int).Value = CveTipoServicioMaterial .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try @@ -4005,7 +4012,7 @@ Public Class ClsAF Return Retorno End Function - Public Function GetCheckListActividad(CveCheckListActividad As Integer, CveCheckListActividadGrupo As Integer) As Boolean + Public Function GetCheckListActividad(CveCheckListActividad As Integer, CveCheckListActividadGrupo As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_CheckListActividadGet") @@ -4013,6 +4020,7 @@ Public Class ClsAF With SqlAdapter.SelectCommand.Parameters .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad .Add("@CveCheckListActividadGrupo", SqlDbType.Int).Value = CveCheckListActividadGrupo + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try @@ -4085,7 +4093,7 @@ Public Class ClsAF Return Retorno End Function - Public Function GetCheckList(CveCheckList As Integer, CveTipoServicio As Integer, CveCheckListActividad As Integer) As Boolean + Public Function GetCheckList(CveCheckList As Integer, CveTipoServicio As Integer, CveCheckListActividad As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_AF_CheckListGet") @@ -4094,6 +4102,7 @@ Public Class ClsAF .Add("@CveCheckList", SqlDbType.Int).Value = CveCheckList .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio .Add("@CveCheckListActividad", SqlDbType.Int).Value = CveCheckListActividad + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try @@ -4166,6 +4175,112 @@ Public Class ClsAF Return Retorno End Function + + + + + + +#Region "O R D E N E S D E T R A B A J O" + + Public Function GetOrdenesTrabajoEstatus(CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_OrdenesTrabajoEstatusGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los estatus", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + + Public Function GetOrdenesTrabajo(CveOrdenTrabajo As Integer, CveTipoServicio As Integer, Folio As Integer, CveAF As Integer, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_OrdenesTrabajoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@Folio", SqlDbType.Int).Value = Folio + .Add("@CveAF", SqlDbType.Int).Value = CveAF + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@Prioridad", SqlDbType.Int).Value = Prioridad + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + '.Add("@FechaFinReal", SqlDbType.Date).Value = FechaFinReal + .Add("@CveEstatusOT", SqlDbType.Int).Value = CveEstatusOT + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar las ordenes de trabajo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + + + Public Function AddOrdenesTrabajo(CveTipoServicio As Integer, CveAF As Integer, Servicio As String, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_OrdenesTrabajoAdd") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + .Add("@CveAF", SqlDbType.Int).Value = CveAF + .Add("@Servicio", SqlDbType.VarChar).Value = Servicio + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@Prioridad", SqlDbType.Int).Value = Prioridad + .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@FechaFinReal", SqlDbType.Date).Value = FechaFinReal + .Add("@CveEstatusOT", SqlDbType.Int).Value = CveEstatusOT + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + .Add("@CveOrdenTrabajo", SqlDbType.Int).Direction = ParameterDirection.Output + .Add("@Folio", SqlDbType.Int).Direction = ParameterDirection.Output + + End With + + Try + SqlAdapter.Fill(Data) + + CveOrdenTrabajo = SqlAdapter.SelectCommand.Parameters("@CveOrdenTrabajo").Value.ToString.ToEntero + FolioOT = SqlAdapter.SelectCommand.Parameters("@Folio").Value.ToString.ToEntero + + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al agregar la orden de trabajo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + + + +#End Region + #End Region diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb index 388666a47..b92dc28d8 100644 --- a/App_Code/ClsCompProveedores.vb +++ b/App_Code/ClsCompProveedores.vb @@ -1646,12 +1646,14 @@ Public Class ClsCompProveedores Return Retorno End Function - Public Function GetTiposContratosDcumentos(CveEmpresa As Integer) As Boolean + Public Function GetTiposContratosDcumentos(CveEmpresa As Integer, Optional CveDocumentacion As Integer = -1, Optional CveTipoContrato As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Prov_SAT_CatTipoContratosDocumentosGet") With SqlAdapter.SelectCommand.Parameters + .Add("@CveDocumentacion", SqlDbType.Int).Value = CveDocumentacion + .Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With @@ -1756,7 +1758,7 @@ Public Class ClsCompProveedores End Function - Public Function GetContrato(CveContrato As Integer, CveSubProyecto As Integer, CveProveedor As Integer, CveTipoContrato As Integer, CveRepresentanteLegal As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean + Public Function GetContrato(CveContrato As Integer, CveSubProyecto As Integer, CveProveedor As Integer, CveTipoContrato As Integer, CveRepresentanteLegal As Integer, Estatus As Integer, CveEmpresa As Integer, FechaI As Date, FechaF As Date) As Boolean Dim Retorno As Boolean = False @@ -1771,6 +1773,10 @@ Public Class ClsCompProveedores .Add("@CveRepresentanteLegal", SqlDbType.Int).Value = CveRepresentanteLegal .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + + End With diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index f7c161809..7b066db54 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -3928,7 +3928,8 @@ Public Class ClsInventarios Return Retorno End Function - Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Integer, CveUM As Integer, CvePS As Integer, Precio As Double, Observaciones As String, CveContratoDetalle As Integer) As Boolean + Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Integer, CveUM As Integer, CvePS As Integer, Precio As Double, Observaciones As String, + CveContratoDetalle As Integer, Optional Serie As String = "-1") As Boolean Dim Retorno As Boolean = False Dim CveTraspasoSolicitud As Integer = 0 DataAdapter("PA_Inv_TraspasoSolicitudDetalleAdd") @@ -3941,6 +3942,7 @@ Public Class ClsInventarios .Add("@Precio", SqlDbType.Float).Value = Precio .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle + .Add("@Serie", SqlDbType.NVarChar).Value = Serie End With Try diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index d0154df01..35bf0d9b8 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4851,7 +4851,6 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/CatImpuestosLocales.aspx".ToUpper(), 394) PaginaDict.Add("/Ventas/ActualizarPrecios.aspx".ToUpper(), 397) PaginaDict.Add("/Ventas/ClientesAbonar.aspx".ToUpper(), 321) - PaginaDict.Add("/Ventas/Reportes.aspx".ToUpper(), 567) PaginaDict.Add("/Ventas/DiseñadorReportes.aspx".ToUpper(), 569) PaginaDict.Add("/Ventas/ReporteDetalle.aspx".ToUpper(), 576) PaginaDict.Add("/Ventas/PopUpBuscarPs.aspx".ToUpper(), 13) @@ -4912,7 +4911,7 @@ Public Class ClsPaginas PaginaDict.Add("/Ventas/RepVentasMensualesDetalle.aspx".ToUpper(), 721) PaginaDict.Add("/Ventas/MetasVendedores.aspx".ToUpper(), 722) PaginaDict.Add("/Ventas/CatMetasVendedores.aspx".ToUpper(), 723) - PaginaDict.Add("/Ventas/RepAuxiliarFacturas.aspx".ToUpper(), 704) + PaginaDict.Add("/Ventas/RepAuxiliarFacturas.aspx".ToUpper(), 567) #End Region @@ -6991,7 +6990,7 @@ Public Class ClsPaginas Dim rds5 As New ReportDataSource With {.Name = "DataSet5", .Value = If(Vta.DtNCVinculadas IsNot Nothing, Vta.DtNCVinculadas, New DataTable)} ' sino esta creado el objeto, lo creamos, para que no truene el reporte lrds.Add(rds5) - If UsuarioActual.CveEmpresa = 141 AndAlso (RutaFormato.Contains("Factura") Or RutaFormato.Contains("Cotizacion")) Then + If UsuarioActual.CveEmpresa.Contiene(141, 152) AndAlso (RutaFormato.Contains("Factura") Or RutaFormato.Contains("Cotizacion")) Then params.Add(New ReportParameter("Kilometraje", Vta.Kilometraje.ToString)) End If 'Imprime los parametros @@ -8138,7 +8137,7 @@ Public Class ClsPaginas Case 1 If DdlProyecto IsNot Nothing Then DdlProyecto.Visible = False If LthProyectoP IsNot Nothing Then LthProyectoP.Visible = False - If LblSubProyecto IsNot Nothing Then LblSubProyecto.Text = "Centro Costo" + If LblSubProyecto IsNot Nothing Then LblSubProyecto.Text = "Centro de costo" Case 2 If DdlProyecto IsNot Nothing Then DdlProyecto.Visible = False If LthProyectoP IsNot Nothing Then LthProyectoP.Visible = False diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 7e1ee24e2..bf13b3e27 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1956,14 +1956,14 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Return Retorno End Function - Public Function UpdateSalarioImss(CvePersonal As Integer, CveEmpresa As Integer, SDI As Double, SalarioDiarioSS As Double) As Boolean + Public Function UpdateSalariointegrado(CvePersonal As Integer, CveEmpresa As Integer, SDI As Double, SalarioDiario As Double) As Boolean Dim Retorno As Boolean = False - SqlDataAdapter("PA_RH_PersonalUpdateSalarioImss") + SqlDataAdapter("PA_RH_PersonalUpdateSalarioIntegrado") With SqlAdapter.SelectCommand.Parameters .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@SDI", SqlDbType.Money).Value = SDI - .Add("@SalarioDiarioSS", SqlDbType.Money).Value = SalarioDiarioSS + .Add("@SalarioDiario", SqlDbType.Money).Value = SalarioDiario End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 3e1fabf64..0ca3ae809 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1619,7 +1619,8 @@ Public Class ClsVentas End Function Public Function GetRepPSEcono(CveSubProyecto As Integer, CvePS As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional GPO As Integer = -1, - Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0) As Boolean + Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0, + Optional Clasificacion As String = "-1", Optional Linea As String = "-1", Optional Marca As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepPSEconoGet") @@ -1634,6 +1635,9 @@ Public Class ClsVentas .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio .Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico + .Add("@Clasificacion", SqlDbType.VarChar).Value = Clasificacion + .Add("@Linea", SqlDbType.VarChar).Value = Linea + .Add("@Marca", SqlDbType.VarChar).Value = Marca End With Try diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index c5fb9f873..b236d68a4 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -2053,7 +2053,166 @@ Namespace Extensiones style.Clear() End If + End Sub + + + Public Sub ExportToExcelGembox(GridView As GridView, NombreArchivoXLSx As String, Usuario As Usuario, FechaIMes As String, FechaFMes As String, Titulo As String, SubProyecto As String, Divisor As Integer, Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100, Optional DatoTituloExtra As String = "") + + Dim sw1 As New StringWriter() + Dim htw1 As New HtmlTextWriter(sw1) + GridView.RenderControl(htw1) + + Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault + + Dim htmlStream1 = New MemoryStream(options.Encoding.GetBytes(sw1.ToString())) + + htmlStream1.Position = 0 + Dim sr1 As New StreamReader(htmlStream1) + Dim myStr1 = sr1.ReadToEnd() + sr1.Dispose() + htmlStream1.Dispose() + sw1.Dispose() + + Dim HtmlCompleto As String = myStr1 + + HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "") + + Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto)) + + GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet) + + Dim excel As GemBox.Spreadsheet.ExcelFile + + excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream5, options) + + If Usuario IsNot Nothing Then + + Dim TotalRowHeader As Integer = 8 + Dim TotalRowFooter As Integer = 2 + + + Dim worksheet = excel.Worksheets(0) + worksheet.Rows.InsertEmpty(0, TotalRowHeader) + Dim celdasConTexto = worksheet.GetUsedCellRange(True) + celdasConTexto.Style.Font.Name = "Calibri Light" + + Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex) + RangoNombreEmpresa.Merged = True + RangoNombreEmpresa.Value = Usuario.Empresa.Empresa + RangoNombreEmpresa.Style.Font.Size = 18 * 20 + RangoNombreEmpresa.Style.Font.Name = "Calibri Light" + RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + + Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex) + RangoTitulo.Merged = True + RangoTitulo.Value = Titulo + RangoTitulo.Style.Font.Size = 20 * 20 + RangoTitulo.Style.Font.Name = "Calibri Light" + RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + + If FechaIMes.Trim.Length > 0 And FechaFMes.Trim.Length > 0 Then + Dim RangoFechas = worksheet.Cells.GetSubrangeAbsolute(4, celdasConTexto.FirstColumnIndex, 4, celdasConTexto.LastColumnIndex) + RangoFechas.Merged = True + RangoFechas.Value = $"Fechas: {FechaIMes} a {FechaFMes}" + RangoFechas.Style.Font.Size = 15 * 20 + RangoFechas.Style.Font.Name = "Calibri Light" + RangoFechas.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoFechas.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + End If + + + If SubProyecto.Length > 0 Then + Dim RangoSubProyecto = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex) + RangoSubProyecto.Merged = True + RangoSubProyecto.Value = SubProyecto + RangoSubProyecto.Style.Font.Size = 20 * 20 + RangoSubProyecto.Style.Font.Name = "Calibri Light" + RangoSubProyecto.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoSubProyecto.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + End If + + + If DatoTituloExtra.Length > 0 Then + Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(6, celdasConTexto.FirstColumnIndex, 6, celdasConTexto.LastColumnIndex) + RangoDatoTituloExtra.Merged = True + RangoDatoTituloExtra.Value = DatoTituloExtra + RangoDatoTituloExtra.Style.Font.Size = 20 * 20 + RangoDatoTituloExtra.Style.Font.Name = "Calibri Light" + RangoDatoTituloExtra.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + RangoDatoTituloExtra.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + End If + + + For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex + + worksheet.Rows(8).Cells(i).Style.Font.Size = 12 * 20 + worksheet.Rows(8).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + worksheet.Rows(8).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + worksheet.Rows(8).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) + worksheet.Rows(8).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) + + + + If i > 0 Then + Try + worksheet.Columns(i).AutoFit(1) + Catch ex As Exception + End Try + End If + + Next + + Dim IndexEndTable As Integer = GridView.Rows.Count + TotalRowHeader + TotalRowFooter + + worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió" + worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre + + worksheet.Rows(IndexEndTable).Cells(2).Value = "Fecha Impresión" + worksheet.Rows(IndexEndTable + 1).Cells(2).Value = DateTime.Now.ToString("dd/MM/yyyy") + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)) + + If Imagen.Exists Then + Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta) + Using sr As New StreamReader(Ruta) + Dim ms As New MemoryStream() + sr.BaseStream.CopyTo(ms) + worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel) + End Using + End If + + + For I = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex + + If I > 0 Then + + If Divisor = 1 Then + worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00" + Else + worksheet.Columns(I + 1).Style.NumberFormat = "#,##" + End If + + Try + worksheet.Columns(I).AutoFit(1) + Catch ex As Exception + End Try + + End If + Next + + End If + + excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx") + + End Sub + + Public Sub ExportToExcel(GridView As HtmlTable, NombreArchivoXLS As String) Dim sb As StringBuilder = New StringBuilder() diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index b5a36f751..0cfc4dcad 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -2598,7 +2598,7 @@ Partial Class Bancos_ProveedoresAbonar If Dep.DtResultados.Rows.Count > 0 Then - DdlCuentaDeposito.DataSource = Dep.DtResultados + DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros(" Estatus ='True'") DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) trCuentaDeposito.Visible = True diff --git a/Bancos/RepCortes.aspx b/Bancos/RepCortes.aspx index 887e726ba..e76a349bd 100644 --- a/Bancos/RepCortes.aspx +++ b/Bancos/RepCortes.aspx @@ -52,7 +52,7 @@ Personalizar - + @@ -72,7 +72,8 @@
- SubProyecto + + <%--SubProyecto--%>
@@ -160,7 +161,7 @@ - + @@ -187,7 +188,7 @@ - + @@ -196,7 +197,7 @@ - + @@ -298,7 +299,7 @@ Detalles del Corte - + @@ -306,15 +307,15 @@ - SerieFolio + Serie - Folio - + - + diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb index 6bd36841f..df363cc2c 100644 --- a/Bancos/RepCortes.aspx.vb +++ b/Bancos/RepCortes.aspx.vb @@ -61,9 +61,7 @@ Partial Class Bancos_RepCortes txtFechaVI.Text = Now.ToShortDateString txtFechaVF.Text = Now.ToShortDateString Me.Form.DefaultButton = BtnConsultar.UniqueID - DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) - DdlSubProyectos.DataBind() - DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1")) + CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto) End If End Sub diff --git a/Bancos/RepEgresosSinComprobante.aspx b/Bancos/RepEgresosSinComprobante.aspx index f410feabd..62858d31e 100644 --- a/Bancos/RepEgresosSinComprobante.aspx +++ b/Bancos/RepEgresosSinComprobante.aspx @@ -157,7 +157,7 @@ - + @@ -219,7 +219,7 @@ - diff --git a/Bancos/RepEgresosSinComprobante.aspx.vb b/Bancos/RepEgresosSinComprobante.aspx.vb index 9cbb22665..6b0c8d62e 100644 --- a/Bancos/RepEgresosSinComprobante.aspx.vb +++ b/Bancos/RepEgresosSinComprobante.aspx.vb @@ -248,7 +248,7 @@ Partial Class Bancos_RepEgresosSinComprobante End If If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOtIngresos, gr.DataKey("Saldo").ToDecimal, "", 78, "Saldo de ExC por Sistema", Now, -1, -1, gr.DataKey("CveIE").ToEntero, - ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=CveCuenta) Then + ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, CveCuenta:=CveCuenta) Then MsgError = "Ocurrio un error al saldar el movimiento" Exit For End If diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 5f8f19a96..62d1d7386 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2835,8 +2835,8 @@ Partial Class Compras_Compras GvAnticiposSel.DataBind() - '' VALIDA ELIMINAR COMPRA - If UsuarioActual.TienePermisoProceso(77) OrElse UsuarioActual.TienePermisoProceso(135) Then ' Eliminar compra + '' VALIDA ELIMINAR COMPRA, QUE NO TENGA PAGOS CONCILIADOS + If (UsuarioActual.TienePermisoProceso(77) OrElse UsuarioActual.TienePermisoProceso(135)) AndAlso dr("NumPagosConciliados").ToString.ToEntero = 0 Then ' Eliminar compra 'SIN VINCULACIÓN If UsuarioActual.TienePermisoProceso(135) Then @@ -10858,10 +10858,11 @@ Partial Class Compras_Compras If e.Row.DataKey("DifPSSat").ToEntero = 1 Then - '#e35b5a - e.Row.BackColor = Drawing.Color.FromArgb(1, 227, 91, 90) + + e.Row.BackColor = Drawing.ColorTranslator.FromHtml("#EFD569") 'Drawing.Color.FromArgb(1, 227, 91, 90)'#e35b5a e.Row.Attributes.Add("data-toggle", "tooltip") - e.Row.Attributes.Add("title", "El código del producto del SAT no es igual al código del producto registrado.") + e.Row.Attributes.Add("data-html", "true") + e.Row.Attributes.Add("title", String.Format("El código del producto del SAT no es igual al código del producto registrado.
Código XML:{0}
Código Sistema:{1} ", e.Row.DBCampo("ClaveProdServ"), e.Row.DBCampo("SATClavePS"))) End If End If diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 0f88f211d..9fd43424e 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -518,7 +518,7 @@ Partial Class PopUpVerFactura End If ObjVenta.Dispose() ObjPuntoVenta.Dispose() - Dim FechaCorte As String = $" Fecha Corte: {Fecha}" + Dim FechaCorte As String = $" Fecha fin: {Fecha}" Dim Usuario As String = $" Usuario: {Nombre}" If DtCortesVentas.Rows.Count > 0 Or DtCortesVentasResumen.Rows.Count > 0 Then Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) diff --git a/Contabilidad2/RepAnexoCatalogoAnual.aspx b/Contabilidad2/RepAnexoCatalogoAnual.aspx index 569e1ad17..4e64fa231 100644 --- a/Contabilidad2/RepAnexoCatalogoAnual.aspx +++ b/Contabilidad2/RepAnexoCatalogoAnual.aspx @@ -1,38 +1,70 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoAnual.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoAnual" %> - - - - - - - Anexo del Catálogo - Anual - - - - - - - - - - - - -
-
-
- -
-
-
    +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoAnual.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoAnual" %> + + + + + + + + + Anexo del Catálogo - Anual + + + + + + + + +
  • + Generar Excel +
  • + +
    + + + +
    + + + + +
    + + + + + + + +
    +
    +
    + +
    +
    +
    • Ejercicio Inicio: - -
    • -
    • Ejercicio Fin: - -
    • -
    • - + + +
    • +
    • Ejercicio Fin: + + +
    • +
    • + + @@ -47,145 +79,407 @@ - -
    • + +
    • SubProyecto: - -
    • + + +
    • Divisor: - - - - - -
    • -
    -
    -
    -
    -
    -
    -
    + + + + + + + +
+
+
+
+
+
+
+ + + + + + + + + + + +
+ + +
+
+
+ + +
Nombre
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + - - - + + + + diff --git a/Contabilidad2/RepAnexoCatalogoAnual.aspx.vb b/Contabilidad2/RepAnexoCatalogoAnual.aspx.vb index ec453de5d..300c3e6ff 100644 --- a/Contabilidad2/RepAnexoCatalogoAnual.aspx.vb +++ b/Contabilidad2/RepAnexoCatalogoAnual.aspx.vb @@ -22,12 +22,45 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual Set(value As Integer) ViewState("EsVertical") = value End Set - End Property + End Property + + + Private Property listacolores As List(Of String) + Get + Return DirectCast(ViewState("listacolores"), List(Of String)) + End Get + Set(value As List(Of String)) + ViewState("listacolores") = value + End Set + End Property + Private Property listaCamposanios As List(Of String()) + Get + Return DirectCast(ViewState("listaCamposanios"), List(Of String())) + End Get + Set(value As List(Of String())) + ViewState("listaCamposanios") = value + End Set + End Property + #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not IsPostBack Then - + If Not IsPostBack Then + + listacolores = New List(Of String) + listaCamposanios = New List(Of String()) + listacolores.Add("#FF0F00") + listacolores.Add("#FF6600") + listacolores.Add("#F8FF01") + listacolores.Add("#04D215") + listacolores.Add("#2A0CD0") + listacolores.Add("#8A0CCF") + listacolores.Add("#CD0D74") + listacolores.Add("#754DEB") + listacolores.Add("#DDDDDD") + listacolores.Add("#999999") + listacolores.Add("#000000") + listacolores.Add("#FF0F00") Dim EjercicioParametro, EjercicioParametroFinal, SubProyectoParametro, DivisorParametro, Periodo As Integer CveCuenta = IfNull(Request("CveCuenta"), "-1").ToString.ToEntero @@ -95,26 +128,27 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0) GvAnual.DataSource = Conta.DSResultados.Tables(1) - Dim Index = 1 - For Index = 1 To GvAnual.Columns.Count - 1 + Dim Index = 2 + For Index = 2 To GvAnual.Columns.Count - 1 GvAnual.Columns(Index).Visible = False Next Index - - Index = 1 + listaCamposanios.Clear() + Index = 2 For Each Dr As DataRow In DtHeaders.Rows GvAnual.Columns(Index).Visible = True - CType(GvAnual.Columns(Index), BoundField).DataField = $"Ejercicio{Dr("Ejercicio").ToString}" - GvAnual.Columns(Index).HeaderText = Dr("Ejercicio").ToString + CType(GvAnual.Columns(Index), BoundField).DataField = String.Format("Ejercicio{0}", Dr("Ejercicio")) + GvAnual.Columns(Index).HeaderText = Dr("Ejercicio").ToString + listaCamposanios.Add(New String() {String.Format("Ejercicio{0}", Dr("Ejercicio")), Dr("Ejercicio").ToString()}) If Not DdlEjercicio.SelectedValue = Dr("Ejercicio").ToString Then If EsVertical <> 1 Then GvAnual.Columns(Index + 1).Visible = True - CType(GvAnual.Columns(Index + 1), BoundField).DataField = $"Ejercicio{Dr("Ejercicio").ToString}VariacionImporte" + CType(GvAnual.Columns(Index + 1), BoundField).DataField = String.Format("Ejercicio{0}VariacionImporte", Dr("Ejercicio")) GvAnual.Columns(Index + 1).HeaderText = "$" End If GvAnual.Columns(Index + 2).Visible = True - CType(GvAnual.Columns(Index + 2), BoundField).DataField = $"Ejercicio{Dr("Ejercicio").ToString}{If(EsVertical = 1, "", "Variacion")}Porcentaje" + CType(GvAnual.Columns(Index + 2), BoundField).DataField = String.Format("Ejercicio{0}{1}Porcentaje", Dr("Ejercicio"), If(EsVertical = 1, "", "Variacion")) GvAnual.Columns(Index + 2).HeaderText = "%" End If @@ -133,26 +167,68 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual 'RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});") RegistraScript($"LimpiaCeros();") - Conta.Dispose() - End Sub - + Conta.Dispose() + + + + If GvAnual.Rows.Count > 0 Then + + LnkExportar.Visible = True + UpAcciones.Update() + + End If + + + + End Sub + #End Region - - + + #Region " GV ROW DATABOUND " Protected Sub GvAnual_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvAnual.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - + setgraficaCC(e) If e.Row.RowIndex = 0 Then e.Row.Style.Add("font-weight", "bold") End If - e.Row.Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em") + e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em") End If - End Sub + End Sub + + + Public Sub setgraficaCC(e As GridViewRowEventArgs) + Dim lista As New List(Of Object) + Dim colorindex As Integer = 0 + For Each campo As String() In listaCamposanios + lista.Add(New With {.Texto = campo(1), .Valor = e.Row.DBCampo(campo(0)).ToDecimal(), .Color = listacolores(colorindex)}) + colorindex = colorindex + 1 + If colorindex >= listacolores.Count Then + colorindex = 0 + End If + Next + e.Row.FCHyperLink("Hypgrafica").Attributes.Add("data-values", Newtonsoft.Json.JsonConvert.SerializeObject(lista)) + End Sub + + Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + + Dim SubProyecto As String = "" + + If DdlSubProyecto.SelectedValue.ToEntero > 0 Then + SubProyecto = DdlSubProyecto.SelectedItem.Text + End If + + GvAnual.ExportToExcelGembox("AnexoCatálogoAnual", UsuarioActual, $"01/01/{DdlEjercicio.SelectedValue}", $"31/12/{DdlEjercicio2.SelectedValue}", "Anexo del Catálogo - Anual", SubProyecto, DdlDivisor.SelectedValue.ToEntero, DatoTituloExtra:=$"Periodo {DdlPeriodo.SelectedItem.Text}") + + End Sub + + Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) + End Sub + #End Region - - - + + + End Class diff --git a/Contabilidad2/RepAnexoCatalogoCC.aspx b/Contabilidad2/RepAnexoCatalogoCC.aspx index 9546b56cf..3f633936e 100644 --- a/Contabilidad2/RepAnexoCatalogoCC.aspx +++ b/Contabilidad2/RepAnexoCatalogoCC.aspx @@ -1,41 +1,68 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoCC.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoCC" %> - - - - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoCC.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoCC" %> + + + + + + + + Anexo de Catálogo - Centro Costo - - - - - - - - - - - - - - -
-
-
- -
-
-
    + + + + + + + + +
  • + Generar Excel +
  • + +
    + + + +
    +
    + + + + + + + + +
    +
    +
    + +
    +
    +
    • Ejercicio: - -
    • -
    • - -
    • - -
    • - + + +
    • +
    • + + +
    • + +
    • + + @@ -50,182 +77,444 @@ - -
    • - + + +
    • Divisor: - - - - - -
    • -
    -
    -
    -
    -
    -
    -
    + + + + + + + +
+
+
+
+
+
+
+ + + + + +
+
+ + + + + + + +
+ + +
+
+
+ + +
Nombre
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + +
+
+ + + +
+ + + + + + + + + + - - - + + +
+ diff --git a/Contabilidad2/RepAnexoCatalogoCC.aspx.vb b/Contabilidad2/RepAnexoCatalogoCC.aspx.vb index bf8696979..2ea0fd95b 100644 --- a/Contabilidad2/RepAnexoCatalogoCC.aspx.vb +++ b/Contabilidad2/RepAnexoCatalogoCC.aspx.vb @@ -4,8 +4,8 @@ Option Strict On Imports System.Data Imports Extensiones Partial Class Contabilidad2_RepAnexoCatalogoCC - Inherits ClsPaginas - + Inherits ClsPaginas + #Region " PROPIEDADES " Public Property CveCuenta As Integer Get @@ -14,12 +14,44 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC Set(value As Integer) ViewState("CveCuenta") = value End Set - End Property + End Property + Private Property listacolores As List(Of String) + Get + Return DirectCast(ViewState("listacolores"), List(Of String)) + End Get + Set(value As List(Of String)) + ViewState("listacolores") = value + End Set + End Property + + Private Property listaCampos As List(Of String()) + Get + Return DirectCast(ViewState("listaCampos"), List(Of String())) + End Get + Set(value As List(Of String())) + ViewState("listaCampos") = value + End Set + End Property + #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not IsPostBack Then - + If Not IsPostBack Then + + listacolores = New List(Of String) + listaCampos = New List(Of String()) + listacolores.Add("#FF0F00") + listacolores.Add("#FF6600") + listacolores.Add("#F8FF01") + listacolores.Add("#04D215") + listacolores.Add("#2A0CD0") + listacolores.Add("#8A0CCF") + listacolores.Add("#CD0D74") + listacolores.Add("#754DEB") + listacolores.Add("#DDDDDD") + listacolores.Add("#999999") + listacolores.Add("#000000") + listacolores.Add("#FF0F00") 'Dim EjercicioParametro, SubProyectoParametro, DivisorParametro As Integer 'CveCuenta = IfNull(Request("C"), "-1").ToString.ToEntero 'EjercicioParametro = IfNull(Request("E"), "-1").ToString.ToEntero @@ -91,17 +123,19 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC Dim Index = 4 For Index = 4 To GvCC.Columns.Count - 1 GvCC.Columns(Index).Visible = False - Next Index + Next Index + listaCampos.Clear() Index = 4 For Each Dr As DataRow In DtHeaders.Rows GvCC.Columns(Index).Visible = True - CType(GvCC.Columns(Index), BoundField).DataField = $"SubProyecto{Dr("SubProyecto").ToString}" - GvCC.Columns(Index).HeaderText = Dr("SubProyecto").ToString + CType(GvCC.Columns(Index), BoundField).DataField = String.Format("SubProyecto{0}", Dr("SubProyecto")) + GvCC.Columns(Index).HeaderText = Dr("SubProyecto").ToString() + listaCampos.Add(New String() {String.Format("SubProyecto{0}", Dr("SubProyecto")), Dr("SubProyecto").ToString()}) GvCC.Columns(Index + 1).Visible = True - CType(GvCC.Columns(Index + 1), BoundField).DataField = $"SubProyecto{Dr("SubProyecto").ToString}Porcentaje" + CType(GvCC.Columns(Index + 1), BoundField).DataField = String.Format("SubProyecto{0}Porcentaje", Dr("SubProyecto")) GvCC.Columns(Index + 1).HeaderText = "%" Index += 2 @@ -112,15 +146,23 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC Else GvCC.DataSource = Nothing + End If + + + If GvCC.Rows.Count > 0 Then + + LnkExportar.Visible = True + UpAcciones.Update() + End If RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});") Conta.Dispose() - End Sub - + End Sub + #End Region - - + + #Region " GV ROW DATABOUND " Protected Sub GvCC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCC.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -128,13 +170,39 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC If e.Row.RowIndex = 0 Then e.Row.Style.Add("font-weight", "bold") End If - - e.Row.Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em") + setgraficaCC(e) + e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em") End If - End Sub + End Sub + + Public Sub setgraficaCC(e As GridViewRowEventArgs) + Dim lista As New List(Of Object) + Dim colorindex As Integer = 0 + For Each campo As String() In listaCampos + lista.Add(New With {.Texto = campo(1), .Valor = e.Row.DBCampo(campo(0)).ToDecimal(), .Color = listacolores(colorindex)}) + colorindex = colorindex + 1 + If colorindex >= listacolores.Count Then + colorindex = 0 + End If + Next + e.Row.FCHyperLink("Hypgrafica").Attributes.Add("data-values", Newtonsoft.Json.JsonConvert.SerializeObject(lista)) + End Sub #End Region - - + + Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + + Dim SubProyecto As String = "" + + If DdlSubProyecto.SelectedValue.ToEntero > 0 Then + SubProyecto = DdlSubProyecto.SelectedItem.Text + End If + + GvCC.ExportToExcelGembox("AnexoCatálogoMensual", UsuarioActual, $"01/01/{DdlEjercicio.SelectedValue}", $"31/12/{DdlEjercicio.SelectedValue}", "Anexo del Catálogo - Mensual", SubProyecto, DdlDivisor.SelectedValue.ToEntero, DatoTituloExtra:=$"Periodo {DdlPeriodo.SelectedItem.Text}") + + End Sub + + Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) + End Sub End Class diff --git a/Contabilidad2/RepAnexoCatalogoMensual.aspx b/Contabilidad2/RepAnexoCatalogoMensual.aspx index 8f3140105..9ac72ebfc 100644 --- a/Contabilidad2/RepAnexoCatalogoMensual.aspx +++ b/Contabilidad2/RepAnexoCatalogoMensual.aspx @@ -1,43 +1,70 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoMensual.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoMensual" %> - - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAnexoCatalogoMensual.aspx.vb" Inherits="Contabilidad2_RepAnexoCatalogoMensual" %> + + + + + - - + + .fa.fa-bar-chart { + width: 16px; + height: 14px; + } + + /*#C_GvMensual2 > tbody > tr:nth-child(1) > th:nth-child(1), #C_GvMensual2 > tbody > tr:nth-child(2) > td:nth-child(1) { + width: 500px !important; + }*/ + + + Anexo del Catálogo - Mensual - - - - - - - - - - - - - -
-
-
- -
-
-
    + + + + + + + + + +
  • + Generar Excel +
  • + +
    + + + +
    + + +
    + + + + + + + +
    +
    +
    + +
    +
    +
    • Ejercicio: - -
    • - -
    • - - + + +
    • + +
    • + + @@ -52,91 +79,352 @@ - -
    • + +
    • SubProyecto: - -
    • + + +
    • Divisor: - - - - - -
    • -
    -
    -
    -
    -
    -
    -
    - - + + + + + + + +
+
+
+
+
+
+
+ +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + +
+ + +
+
+
+ + +
Nombre
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
- +
- + + + + + + + + + + + + + + - - - + + + + diff --git a/Contabilidad2/RepAnexoCatalogoMensual.aspx.vb b/Contabilidad2/RepAnexoCatalogoMensual.aspx.vb index b54bb1fdc..30d1ab0c7 100644 --- a/Contabilidad2/RepAnexoCatalogoMensual.aspx.vb +++ b/Contabilidad2/RepAnexoCatalogoMensual.aspx.vb @@ -14,13 +14,44 @@ Partial Class Contabilidad2_RepAnexoCatalogoMensual Set(value As Integer) ViewState("CveCuenta") = value End Set - End Property - + End Property + + Private Property listacolores As List(Of String) + Get + Return DirectCast(ViewState("listacolores"), List(Of String)) + End Get + Set(value As List(Of String)) + ViewState("listacolores") = value + End Set + End Property + + Private Property listaCampos As List(Of String()) + Get + Return DirectCast(ViewState("listaCampos"), List(Of String())) + End Get + Set(value As List(Of String())) + ViewState("listaCampos") = value + End Set + End Property #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not IsPostBack Then - + If Not IsPostBack Then + + listacolores = New List(Of String) + listaCampos = New List(Of String()) + listacolores.Add("#FF0F00") + listacolores.Add("#FF6600") + listacolores.Add("#F8FF01") + listacolores.Add("#04D215") + listacolores.Add("#2A0CD0") + listacolores.Add("#8A0CCF") + listacolores.Add("#CD0D74") + listacolores.Add("#754DEB") + listacolores.Add("#DDDDDD") + listacolores.Add("#999999") + listacolores.Add("#000000") + listacolores.Add("#FF0F00") Dim EjercicioParametro, SubProyectoParametro, DivisorParametro, Periodo As Integer CveCuenta = IfNull(Request("CveCuenta"), "-1").ToString.ToEntero EjercicioParametro = IfNull(Request("Ejercicio"), "-1").ToString.ToEntero @@ -79,15 +110,23 @@ Partial Class Contabilidad2_RepAnexoCatalogoMensual GvMensual2.DataSource = Nothing End If GvMensual2.DataBind() - UpMensual.Update() + UpMensual.Update() + + If GvMensual2.Rows.Count > 0 Then + + LnkExportar.Visible = True + UpAcciones.Update() + + End If + RegistraScript($"LimpiaCeros();") Conta.Dispose() - End Sub - + End Sub + #End Region - - + + #Region " GV ROW DATABOUND " Protected Sub GvMensual1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMensual2.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -95,13 +134,44 @@ Partial Class Contabilidad2_RepAnexoCatalogoMensual If e.Row.RowIndex = 0 Then e.Row.Style.Add("font-weight", "bold") End If - - e.Row.Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em") + setgrafica(e) + e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em") End If - End Sub + End Sub + + Public Sub setgrafica(e As GridViewRowEventArgs) + + Dim lista As New List(Of Object) + lista.Add(New With {.Texto = "Enero", .Valor = e.Row.DBCampo("Enero").ToDecimal(), .Color = "#FF0F00"}) + lista.Add(New With {.Texto = "Febrero", .Valor = e.Row.DBCampo("Febrero").ToDecimal(), .Color = "#FF6600"}) + lista.Add(New With {.Texto = "Marzo", .Valor = e.Row.DBCampo("Marzo").ToDecimal(), .Color = "#F8FF01"}) + lista.Add(New With {.Texto = "Abril", .Valor = e.Row.DBCampo("Abril").ToDecimal(), .Color = "#04D215"}) + lista.Add(New With {.Texto = "Mayo", .Valor = e.Row.DBCampo("Mayo").ToDecimal(), .Color = "#2A0CD0"}) + lista.Add(New With {.Texto = "Junio", .Valor = e.Row.DBCampo("Junio").ToDecimal(), .Color = "#8A0CCF"}) + lista.Add(New With {.Texto = "Julio", .Valor = e.Row.DBCampo("Julio").ToDecimal(), .Color = "#CD0D74"}) + lista.Add(New With {.Texto = "Agosto", .Valor = e.Row.DBCampo("Agosto").ToDecimal(), .Color = "#754DEB"}) + lista.Add(New With {.Texto = "Septiembre", .Valor = e.Row.DBCampo("Septiembre").ToDecimal(), .Color = "#DDDDDD"}) + lista.Add(New With {.Texto = "Octubre", .Valor = e.Row.DBCampo("Octubre").ToDecimal(), .Color = "#999999"}) + lista.Add(New With {.Texto = "Noviembre", .Valor = e.Row.DBCampo("Noviembre").ToDecimal(), .Color = "#000000"}) + lista.Add(New With {.Texto = "Diciembre", .Valor = e.Row.DBCampo("Diciembre").ToDecimal(), .Color = "#FF0F00"}) + e.Row.FCHyperLink("Hypgrafica").Attributes.Add("data-values", Newtonsoft.Json.JsonConvert.SerializeObject(lista)) + End Sub #End Region - - + + Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + + Dim SubProyecto As String = "" + + If DdlSubProyecto.SelectedValue.ToEntero > 0 Then + SubProyecto = DdlSubProyecto.SelectedItem.Text + End If + + GvMensual2.ExportToExcelGembox("AnexoCatálogoMensual", UsuarioActual, $"01/01/{DdlEjercicio.SelectedValue}", $"31/12/{DdlEjercicio.SelectedValue}", "Anexo del Catálogo - Mensual", SubProyecto, DdlDivisor.SelectedValue.ToEntero, DatoTituloExtra:=$"Periodo {DdlPeriodo.SelectedItem.Text}") + + End Sub + + Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) + End Sub End Class diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx b/Contabilidad2/RepEstadoResultadosHorizontal.aspx index 55f95ed26..c4dbe86ac 100644 --- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx +++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx @@ -3,6 +3,18 @@ + + @@ -10,15 +22,13 @@ - -
  • +
  • Generar Excel
  • -
    - +
    @@ -29,19 +39,19 @@
      - +
      - + -
      +
    - -
    - + +
    + -
    - - +
    + +
    @@ -57,25 +67,26 @@ -
    +
    - - + +
    -
    - - -
    - - - - - -
    + +
    + + + + + + +
    @@ -84,10 +95,10 @@
    - - - - + + + + @@ -108,7 +119,7 @@ - + <%-- --%> @@ -116,13 +127,13 @@ - + <%-- --%> - +

    @@ -140,20 +151,20 @@
    - + - + - + @@ -185,7 +196,7 @@ - + @@ -197,11 +208,13 @@ - + <%----%> - + + + @@ -212,73 +225,73 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -294,7 +307,7 @@ <%----%> - + @@ -305,11 +318,12 @@
    - + <%----%> - + + @@ -320,85 +334,85 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - <%-- + <%-- --%> - <%-- --%> + <%-- --%> @@ -409,96 +423,97 @@ -

    - +
    + - + + - - +
    +
    - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -517,7 +532,7 @@ -
    +