Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -120,6 +120,83 @@ Public Class ClsClaseBase
|
||||
SqlAdapter.SelectCommand.Parameters.Add(name, tipo).Value = valor
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function runQuerystr(Query As String, Optional Listaparametros As List(Of parametroQuery) = Nothing, Optional msgError As String = "", Optional mostrarError As Boolean = True) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
Try
|
||||
If SqlConexion.State = ConnectionState.Open Then
|
||||
SqlAdapter.SelectCommand.Parameters.Clear()
|
||||
SqlAdapter.SelectCommand.CommandText = Query
|
||||
SqlAdapter.SelectCommand.CommandType = CommandType.Text
|
||||
Data = New DataTable()
|
||||
If Not IsNothing(Listaparametros) Then
|
||||
For Each pr As parametroQuery In Listaparametros
|
||||
If Not IsNothing(pr.SqlDataType) Then
|
||||
If Not IsNothing(pr.ParameterDirection) Then
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection
|
||||
Else
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = If(Not IsNothing(pr.SqlValue), pr.SqlValue, DBNull.Value)
|
||||
End If
|
||||
Else
|
||||
SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
SqlAdapter.Fill(Data)
|
||||
retorno = True
|
||||
Else
|
||||
Dim InfoAdicional As String = "Se intenta realizar una conexion con una conexion cerrada"
|
||||
InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}"
|
||||
GuardaLog(InfoAdicional)
|
||||
End If
|
||||
Catch sqEx As SqlException
|
||||
retorno = False
|
||||
setOnError(msgError, sqEx)
|
||||
Catch ex As Exception
|
||||
retorno = False
|
||||
setOnError(msgError, ex)
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
Public Function ExecQuery(Query As String, Optional Listaparametros As List(Of parametroQuery) = Nothing, Optional msgError As String = "", Optional mostrarError As Boolean = True) As Integer
|
||||
Dim retorno As Integer = -1
|
||||
Try
|
||||
If SqlConexion.State = ConnectionState.Open Then
|
||||
SqlAdapter.SelectCommand.Parameters.Clear()
|
||||
SqlAdapter.SelectCommand.CommandText = Query
|
||||
SqlAdapter.SelectCommand.CommandType = CommandType.Text
|
||||
If Not IsNothing(Listaparametros) Then
|
||||
For Each pr As parametroQuery In Listaparametros
|
||||
If Not IsNothing(pr.SqlDataType) Then
|
||||
If Not IsNothing(pr.ParameterDirection) Then
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection
|
||||
Else
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = If(Not IsNothing(pr.SqlValue), pr.SqlValue, DBNull.Value)
|
||||
End If
|
||||
Else
|
||||
SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
retorno = SqlAdapter.SelectCommand.ExecuteNonQuery()
|
||||
Else
|
||||
Dim InfoAdicional As String = "Se intenta realizar una conexion con una conexion cerrada"
|
||||
InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}"
|
||||
GuardaLog(InfoAdicional)
|
||||
End If
|
||||
Catch sqEx As SqlException
|
||||
retorno = -1
|
||||
setOnError(msgError, sqEx)
|
||||
Catch ex As Exception
|
||||
retorno = -1
|
||||
setOnError(msgError, ex)
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
|
||||
Protected Function RunQuery(msgOnError As String) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
|
||||
@@ -203,3 +280,19 @@ Public Class ClsClaseBase
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class parametroQuery
|
||||
Public Sub New(parameterName As String, sqlValue As Object, Optional sqlDataType As SqlDbType = Nothing, Optional parameterDirection As ParameterDirection = Nothing)
|
||||
Me.ParameterName = parameterName
|
||||
Me.SqlDataType = sqlDataType
|
||||
Me.ParameterDirection = parameterDirection
|
||||
Me.SqlValue = sqlValue
|
||||
|
||||
End Sub
|
||||
|
||||
Public Property ParameterName As String
|
||||
Public Property SqlDataType As SqlDbType
|
||||
Public Property ParameterDirection As ParameterDirection
|
||||
Public Property SqlValue As Object
|
||||
|
||||
End Class
|
||||
@@ -2524,7 +2524,7 @@ Public Class ClsOC
|
||||
End Function
|
||||
#End Region
|
||||
#Region "REP SOLICITUDES ANTICIPO"
|
||||
Public Function GetRepSolicitudAnticipos(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, CveEventoEstatus As Integer) As Boolean
|
||||
Public Function GetRepSolicitudAnticipos(CveEmpresa As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, CveEventoEstatus As Integer, Optional CveUsuario As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_RepSolicitudAnticipoGet")
|
||||
|
||||
@@ -2534,6 +2534,8 @@ Public Class ClsOC
|
||||
.Add("@FechaI", SqlDbType.DateTime).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
|
||||
.Add("@CveEventoEstatus", SqlDbType.Int).Value = CveEventoEstatus
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -4860,6 +4860,7 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/RH/SolicitudViaticos.aspx".ToUpper(), 663)
|
||||
PaginaDict.Add("/RH/ReporteViaticos.aspx".ToUpper(), 664)
|
||||
PaginaDict.Add("/RH/MiPerfil.aspx".ToUpper(), -1) ' se dejará libre el módulo para que cualquier que tenga cvepersonal, pueda acceder
|
||||
PaginaDict.Add("/RH/CatChecadores.aspx".ToUpper(), 694)
|
||||
#End Region
|
||||
#Region "Sistema"
|
||||
'Cargo las páginas que deben tener restricción
|
||||
@@ -6753,7 +6754,7 @@ Public Class ClsPaginas
|
||||
End If
|
||||
|
||||
'ECONOLLANTAS - AGREGAR QR DE DESCARGA
|
||||
If UsuarioActual.CveEmpresa = 141 Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) Then
|
||||
Dim QRDescarga As String = ""
|
||||
|
||||
Dim cfdi As New RVCFDI33.GeneraCFDI()
|
||||
|
||||
@@ -6879,6 +6879,81 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Checador"
|
||||
Public Function GetChecadores(CveChecador As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_RH_ChecadorGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveChecador", SqlDbType.Int).Value = CveChecador
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el listado de checadores", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddChecadores(Checador As String, CveSubProyecto As Integer, IPLocal As String, Puerto As String, CveUsuario As Integer, Optional CveModelo As Integer = 1, Optional Estatus As Integer = 1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_RH_ChecadorAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@Checador", SqlDbType.NVarChar).Value = Checador
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal
|
||||
.Add("@Puerto", SqlDbType.NVarChar).Value = Puerto
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveModelo", SqlDbType.Int).Value = CveModelo
|
||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateChecadores(CveChecador As Integer, Checador As String, CveSubProyecto As Integer, IPLocal As String, Puerto As String, Optional CveModelo As Integer = 1, Optional Estatus As Boolean = True) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_RH_ChecadorUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveChecador", SqlDbType.Int).Value = CveChecador
|
||||
.Add("@Checador", SqlDbType.NVarChar).Value = Checador
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal
|
||||
.Add("@Puerto", SqlDbType.NVarChar).Value = Puerto
|
||||
.Add("@CveModelo", SqlDbType.Int).Value = CveModelo
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveChecadores(CveChecador As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_RH_ChecadorDelete")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveChecador", SqlDbType.Int).Value = CveChecador
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
'Public msgsError As New StringBuilder()
|
||||
'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "")
|
||||
|
||||
@@ -632,6 +632,7 @@
|
||||
<div class="btn btn-default btn-circle btn-xs " data-toggle="tooltip" data-placement="top" title="Cambiar sucursal"><i class="fa fa-arrow-circle-down" style="color: green" aria-hidden="true"></i></div>
|
||||
<asp:LinkButton ID="ImgSubProyecto" CssClass="btn btn-default btn-circle btn-xs " data-toggle="tooltip" data-placement="top" ToolTip="Aplicar SubProyecto a productos" runat="server" Style="display: none;"><i class="fa fa-arrow-circle-down" style="color:green" aria-hidden="true"></i></asp:LinkButton>
|
||||
</span>
|
||||
|
||||
</th>
|
||||
<th style="width: 80px">Tipo de Gasto
|
||||
|
||||
@@ -675,6 +676,7 @@
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</th>
|
||||
@@ -4284,8 +4286,19 @@
|
||||
<%--<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVSubProyecto" ControlToValidate="DdlSubProyecto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor seleccione uno." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCORVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>--%>
|
||||
<label runat="server" id="LblSubProyecto" for="<%= DdlSubProyecto.ClientID.ToString()%>">SubProyecto:</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div runat="server" id="DVCultivosCuadro" visible ="false" class="form-group form-md-line-input input-iconright" >
|
||||
|
||||
<asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;"
|
||||
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar">
|
||||
</asp:DropDownList>
|
||||
<label runat="server" id="Label9" for="<%= DdlCultivosCuadro.ClientID.ToString()%>">Cultivo:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -1319,6 +1319,15 @@ Partial Class Compras_Compras
|
||||
DdlPersonal.DataBind()
|
||||
DdlPersonalReembolso.DataBind()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
|
||||
DVCultivosCuadro.Visible = True
|
||||
DdlSubProyecto.AutoPostBack = True
|
||||
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
|
||||
DdlCultivosCuadro.DataBind()
|
||||
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
End If
|
||||
|
||||
|
||||
'Carga Proveedor
|
||||
If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
|
||||
@@ -17655,6 +17664,15 @@ Partial Class Compras_Compras
|
||||
If Modalidad <> "U" Or Not CveFactura > 0 Then
|
||||
DdlPSChange()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
|
||||
|
||||
DdlCultivosCuadro.Items.Clear()
|
||||
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($" CveSubProyecto = {DdlSubProyecto.SelectedValue}")
|
||||
DdlCultivosCuadro.DataBind()
|
||||
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Sub DdlPSChange()
|
||||
If CveProveedor > 0 Then
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
<label class="col-md-4">Código.Barras</label>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox runat="server" ID="TxtCodigoBarras" ></asp:TextBox>
|
||||
<asp:TextBox runat="server" ID="TxtCodigoBarras"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;" runat="server" id="divSerie" visible="false">
|
||||
@@ -240,7 +240,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCESerie" runat="server" HighlightCssClass="vco" TargetControlID="RFVSerie" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;" runat="server" id="divLote" visible="false">
|
||||
<label class="col-md-4">Lote</label>
|
||||
<div class="col-md-8">
|
||||
@@ -259,12 +259,22 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:Button ID="BtnGuardar" runat="server" ValidationGroup="GrpIngresar" Text="Ingresar" class="btn btn-primary" Enabled="false" />
|
||||
<div class="row" style="margin-top: 5px" runat="server" id="divSeccion" visible="false">
|
||||
<label class="col-md-4">Sección Almacén:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList runat="server" ID="DdlSeccionAlmacen" CssClass="select2me" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" Width="100%">
|
||||
<%--<asp:ListItem Selected="True" Value="-1">Seleccione</asp:ListItem>--%>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator runat="server" ID="RfvSeccionAlmacen" ControlToValidate="DdlSeccionAlmacen" Enabled="false" ValidationGroup="GrpIngresar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Seccion Almacen''</b> es necesario, por favor ingrése una." Display="Dynamic" InitialValue="-1"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceSeccionAlmacen" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacen" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 5px;">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:Button ID="BtnGuardar" runat="server" ValidationGroup="GrpIngresar" Text="Ingresar" class="btn btn-primary" Enabled="false" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@ Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Inherits ClsPaginas
|
||||
Inherits ClsPaginas
|
||||
#Region "Propiedades"
|
||||
Public Property DtEquivalencias() As DataTable
|
||||
Get
|
||||
@@ -39,9 +39,18 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Set(value As DataTable)
|
||||
ViewState("DtVentas") = value
|
||||
End Set
|
||||
End Property
|
||||
End Property
|
||||
Private Property CveAlmacenes As String
|
||||
Get
|
||||
Return ViewState("CveAlmacenes").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("CveAlmacenes") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
If Request("CveInventarioFisico") IsNot Nothing AndAlso Request("CveInventarioFisico").ToString.ToEntero > 0 Then
|
||||
@@ -51,10 +60,10 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#Region " USUARIOS "
|
||||
Private Sub CargaUsuarios()
|
||||
ddlUsuario.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1", "Nombre")
|
||||
@@ -82,9 +91,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
|
||||
UPAgregarPro.Update()
|
||||
UPPInventario.Update()
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Private Sub CargaDatos(CveInventarioFisico As Integer, CveEmpresa As Integer, Optional CveUsuario As Integer = -1)
|
||||
|
||||
@@ -135,13 +144,16 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
Dim dt As DataTable = ObjInventario.DtResultados
|
||||
Dim str As New StringBuilder
|
||||
Dim CveAlmacenesStr As New StringBuilder
|
||||
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||
|
||||
For Each dr As DataRow In dt.Rows
|
||||
str.AppendFormat("{0},", dr("almacen"))
|
||||
CveAlmacenesStr.AppendFormat("{0},", dr("CveAlmacen"))
|
||||
Next
|
||||
End If
|
||||
LblAlmacenes.Text = str.ToString
|
||||
CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length - 1)
|
||||
End If
|
||||
|
||||
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
|
||||
@@ -246,11 +258,11 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
RegistraScript("OrdenarGV();")
|
||||
End If
|
||||
UPPInventario.Update()
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " AGREGAR "
|
||||
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
|
||||
Dim Valido As Boolean = False
|
||||
@@ -260,8 +272,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Dim CodigoBarras As String = If(TxtCodigoBarras.Text.Trim <> "", TxtCodigoBarras.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes
|
||||
Dim Serie As String = TxtCodigoSerie.Text.Trim
|
||||
Dim Lote As String = If(TxtLote.Text.Length > 0, TxtLote.Text, "-1")
|
||||
Dim FechaCaducidad As String=MinFecha.ToString
|
||||
Dim FechaCaducidad As String = MinFecha.ToString
|
||||
Dim CveSeccionAlmacen As Integer = -1
|
||||
Dim SeccionAlmacen As String = ""
|
||||
|
||||
Dim Cantidad = TxtCantidadProducto.Text.ToDouble
|
||||
|
||||
@@ -279,11 +292,13 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Dim AplicaCaducidad As Boolean = dr("AplicaCaducidad") = "1"
|
||||
Dim AplicaLote As Boolean = dr("AplicaLote") = "1"
|
||||
Dim AplicaSerie As Boolean = dr("AplicaSerie") = "1"
|
||||
Dim AplicaSeccion As Boolean = dr("AplicaSeccion") = "1"
|
||||
|
||||
'divSeccionAlmacen.Visible = AplicaSeccion
|
||||
divLote.Visible = AplicaLote
|
||||
divFechaCaducidad.Visible = AplicaCaducidad
|
||||
divSerie.Visible = AplicaSerie
|
||||
|
||||
UPAgregarPro.Update()
|
||||
|
||||
If AplicaSerie And Serie = "" Then
|
||||
@@ -294,7 +309,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
RFVSerie.ValidationGroup = " "
|
||||
Exit Sub
|
||||
End If
|
||||
If AplicaLote And Lote = "" Then
|
||||
If AplicaLote And (Lote = "" Or Lote = "-1") Then
|
||||
RFVLote.Enabled = True
|
||||
RFVLote.Visible = True
|
||||
RFVLote.SetFocusOnError = True
|
||||
@@ -313,13 +328,46 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
End If
|
||||
FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
|
||||
End If
|
||||
|
||||
If AplicaSeccion Then
|
||||
Dim ObjInv As New ClsInventarios
|
||||
Dim SeccionesAlmacenDelProducto As New DataTable
|
||||
If ObjInv.GetProductosServiciosAlmacenSeccion(CveProducto, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
SeccionesAlmacenDelProducto = ObjInv.DtResultados.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
|
||||
End If
|
||||
'Dim SeccionesAlmacenDelProducto As DataTable = (UsuarioActual.CveEmpresa, -1, CveProducto) '.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
|
||||
'Alert(SeccionesAlmacenDelProducto.Rows.Count.ToString)
|
||||
If SeccionesAlmacenDelProducto.Rows.Count = 1 Then
|
||||
CveSeccionAlmacen = SeccionesAlmacenDelProducto.FiltroPrimeroValor("CveSeccionAlmacen")
|
||||
Else
|
||||
divSeccion.Visible = AplicaSeccion
|
||||
If DdlSeccionAlmacen.Items.Count = 0 Then
|
||||
DdlSeccionAlmacen.DataSource = SeccionesAlmacenDelProducto
|
||||
DdlSeccionAlmacen.DataBind()
|
||||
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
|
||||
If DdlSeccionAlmacen.SelectedValue = "-1" Then
|
||||
RfvSeccionAlmacen.Enabled = True
|
||||
RfvSeccionAlmacen.Visible = True
|
||||
RfvSeccionAlmacen.SetFocusOnError = True
|
||||
RfvSeccionAlmacen.Validate()
|
||||
RfvSeccionAlmacen.ValidationGroup = " "
|
||||
Exit Sub
|
||||
End If
|
||||
CveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
SeccionAlmacen = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("SeccionAlmacen", String.Format("CveSeccionAlmacen = {0}", CveSeccionAlmacen))
|
||||
End If
|
||||
|
||||
RFVSerie.ValidationGroup = "GrpIngresar"
|
||||
RFVSerie.Enabled = False
|
||||
RFVLote.ValidationGroup = "GrpIngresar"
|
||||
RFVLote.Enabled = False
|
||||
RFVCaducidad.ValidationGroup = "GrpIngresar"
|
||||
RFVCaducidad.Enabled = False
|
||||
RfvSeccionAlmacen.ValidationGroup = "GrpIngresar"
|
||||
RfvSeccionAlmacen.Enabled = False
|
||||
|
||||
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
|
||||
If Serie <> "" And (Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then
|
||||
@@ -331,7 +379,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Using Inventarios As New ClsInventarios
|
||||
|
||||
If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(AplicaSerie, 1, Cantidad), Serie, UsuarioActual.CveUsuario,
|
||||
CveSeccionAlmacen:=-1, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
|
||||
CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
|
||||
|
||||
GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0
|
||||
GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> ""
|
||||
@@ -344,7 +392,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PSCodigo").ToString
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = ""
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = SeccionAlmacen
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote
|
||||
GvIFDUltimoRegistrado.Rows(0).Cells(7).Text = FechaCaducidad
|
||||
@@ -371,6 +419,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
divLote.Visible = False
|
||||
divFechaCaducidad.Visible = False
|
||||
divSerie.Visible = False
|
||||
divSeccion.Visible = False
|
||||
RegistraScript("playsonidito('beep-07.wav')")
|
||||
Else
|
||||
TxtCodigoSerie.Text = ""
|
||||
@@ -386,6 +435,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
divLote.Visible = False
|
||||
divFechaCaducidad.Visible = False
|
||||
divSerie.Visible = False
|
||||
divSeccion.Visible = False
|
||||
TxtLote.Text = ""
|
||||
TxtFechaCaducidad.Text = ""
|
||||
Alert("No se encontró el producto, favor de escribirlo correctamente.", TipoMensaje.MsgError)
|
||||
@@ -395,9 +445,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
DivBuscador.Visible = False
|
||||
UPPInventario.Update()
|
||||
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " ELIMINAR "
|
||||
Protected Sub gvInventarioFisicoDetalle_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvIFD.RowDeleting
|
||||
If ddlUsuario.SelectedValue = UsuarioActual.CveUsuario.ToString OrElse UsuarioActual.TienePermisoProceso(283) Then
|
||||
@@ -425,9 +475,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
Alert("No se puede eliminar un producto registrado por otro usuario.", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " FINALIZAR "
|
||||
Protected Sub btnFin_Click(sender As Object, e As EventArgs) Handles btnFin.Click
|
||||
If btnFin.Text.Contains("Iniciar") Then
|
||||
@@ -475,9 +525,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
|
||||
|
||||
UPAgregarPro.Update()
|
||||
UPPInventario.Update()
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " VER AVANCE "
|
||||
Protected Sub LBAvance_Click(sender As Object, e As EventArgs)
|
||||
Response.Redirect($"~/Inventarios/RepAnomalias.aspx?CveInventarioFisico={CveInventarioFisico}&EsAvance=1")
|
||||
|
||||
@@ -198,6 +198,7 @@
|
||||
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen"/>
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
|
||||
@@ -232,6 +233,7 @@
|
||||
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen"/>
|
||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
|
||||
|
||||
@@ -194,6 +194,9 @@ Partial Class Inventarios_RepAnomalias
|
||||
e.Row.Cells(8).Text = "0"
|
||||
End If
|
||||
|
||||
If e.Row.Cells(7).Text = MinFecha Then
|
||||
e.Row.Cells(7).Text = ""
|
||||
End If
|
||||
e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
|
||||
|
||||
End If
|
||||
@@ -273,9 +276,10 @@ Partial Class Inventarios_RepAnomalias
|
||||
#End Region
|
||||
|
||||
Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable)
|
||||
Gv.Columns(4).Visible = resultado.MAX("Serie") <> ""
|
||||
Gv.Columns(5).Visible = resultado.MAX("Lote") <> ""
|
||||
Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
Gv.Columns(4).Visible = resultado.MAX("CveSeccionAlmacen").ToEntero > 0
|
||||
Gv.Columns(5).Visible = resultado.MAX("Serie") <> ""
|
||||
Gv.Columns(6).Visible = resultado.MAX("Lote") <> ""
|
||||
Gv.Columns(7).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -3,6 +3,26 @@
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.dSala {
|
||||
width: 90px;
|
||||
}
|
||||
|
||||
.dlab {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.dSala input {
|
||||
width: 80px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
.dlab input {
|
||||
width: 40px;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
<script>$('body').removeClass('rhumanosbody').addClass('rhumanosbody')</script>
|
||||
@@ -51,7 +71,7 @@
|
||||
<asp:UpdatePanel ID="upDatosPA_N" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-offset-1">
|
||||
<div class="col-md-2 col-md-offset-1">
|
||||
<div class="dashboard-stat blue">
|
||||
<div class="visual"><i class="fa fa-sort-numeric-desc"></i></div>
|
||||
<div class="details">
|
||||
@@ -59,35 +79,55 @@
|
||||
<asp:Literal ID="LtlTotal" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="desc">
|
||||
Total Aguinaldo
|
||||
Total aguinaldo
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-md-offset-1">
|
||||
<div class="col-md-2 col-md-offset-1">
|
||||
<div class="dashboard-stat green">
|
||||
<div class="visual"><i class="fa fa-line-chart"></i></div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<asp:Literal ID="LtlAutorizado" runat="server"></asp:Literal></div>
|
||||
<asp:Literal ID="LtlAutorizado" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="desc">
|
||||
Autorizado
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-md-offset-1">
|
||||
<div class="col-md-2 col-md-offset-1">
|
||||
<div class="dashboard-stat green">
|
||||
<div class="visual"><i class="fa fa-line-chart"></i></div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<asp:Literal ID="LtldiasEjercicio" runat="server"></asp:Literal></div>
|
||||
<asp:Literal ID="LtldiasEjercicio" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="desc">
|
||||
Días ejercicio
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-md-offset-1">
|
||||
<div class="dashboard-stat green">
|
||||
<div class="visual"><i class="fa fa-line-chart"></i></div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<asp:Literal ID="LtlUma" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="desc">
|
||||
UMA
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div style="text-align: right">
|
||||
<asp:Button ID="BtnRecalcular" CssClass="btn btn-primary" OnClick="BtnRecalcular_Click" runat="server" Text="Recalcular" />
|
||||
|
||||
</div>
|
||||
<asp:GridView ID="GVCalcularAguinaldo" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall GVCalcularUtilidades" AutoGenerateColumns="False"
|
||||
DataKeyNames="Nombre,CvePersonal" OnRowDataBound="GVCalcularAguinaldo_RowDataBound">
|
||||
@@ -97,37 +137,31 @@
|
||||
<asp:Label ID="lblnombreCompleto" runat="server" Text='<%# Eval("Nombre")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Días Laborados">
|
||||
<asp:TemplateField HeaderText="Salario diario">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldiasLaborados" runat="server" Text='<%# Eval("DiasLaborados")%>'> </asp:Label>
|
||||
<asp:TextBox ID="TxtsueldoDiario" runat="server" Text='<%# Eval("SalarioDiario", "${0:N2}")%>'> </asp:TextBox>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" CssClass="dSala" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Días Aguinaldo">
|
||||
<asp:TemplateField HeaderText="Días laborados">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldiasAguinaldo" runat="server" Text='<%# Eval("NumDiasAguinaldo")%>'> </asp:Label>
|
||||
<asp:TextBox ID="TxtdiasLaborados" runat="server" Text='<%# Eval("DiasLaborados")%>'> </asp:TextBox>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" CssClass="dlab" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Salario Diario">
|
||||
<asp:TemplateField HeaderText="Días aguinaldo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblsueldoDiario" runat="server" Text='<%# Eval("SalarioDiario", "${0:N2}")%>'> </asp:Label>
|
||||
<asp:TextBox ID="TxtdiasAguinaldo" runat="server" Text='<%# Eval("NumDiasAguinaldo")%>'> </asp:TextBox>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
<ItemStyle HorizontalAlign="Right" CssClass="dlab" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aguinaldo Completo">
|
||||
<asp:TemplateField HeaderText="Aguinaldo completo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblsueldoAguinaldoCompleto" runat="server" Text='<%# Eval("AguinaldoCompleto", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aguinaldo">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAguinaldo" runat="server" Text='<%# Eval("Aguinaldo", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aguinaldo Gravado">
|
||||
<asp:TemplateField HeaderText="Aguinaldo gravado">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAguinaldoGravado" runat="server" Text='<%# Eval("AguinaldoGravado", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
@@ -135,7 +169,13 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Impuesto">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAguinaldo" runat="server" Text='<%# Eval("ISR", "${0:N2}")%>'> </asp:Label>
|
||||
<asp:Label ID="lblISRAguinaldo" runat="server" Text='<%# Eval("ISR", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Aguinaldo por pagar">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAguinaldo" runat="server" Text='<%# Eval("Aguinaldo", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
@@ -143,6 +183,7 @@
|
||||
<ItemTemplate>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<%-- <asp:TemplateField HeaderText="Gravadas">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbluGravadas" runat="server" Text='<%# Eval("ISR", "${0:N2}")%>'> </asp:Label>
|
||||
@@ -174,7 +215,7 @@
|
||||
<h4 class="modal-title">Autorizar</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<label class="col-md-4 ">Tipo Período:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlTipoPeriodoB" runat="server" CssClass="select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoPeriodoB_SelectedIndexChanged"
|
||||
@@ -182,15 +223,15 @@
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-4 ">Período:</label>
|
||||
<div class="col-md-8">
|
||||
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Style="width: 100% !important;" >
|
||||
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me" DataTextField="NominaEstatus" DataValueField="CvePeriodo" Style="width: 100% !important;">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
@@ -42,6 +45,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
|
||||
DdlTipoPeriodo.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
LtlUma.Text = "86.88";
|
||||
|
||||
}
|
||||
|
||||
@@ -58,13 +62,14 @@ public partial class Nomina_Aguinaldo : ClsPaginas
|
||||
DTAguinaldos = objnom.DtResultados;
|
||||
GVCalcularAguinaldo.DataSource = DTAguinaldos;
|
||||
LtlTotal.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo"));
|
||||
LtlAutorizado.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo","CveNomina>0"));
|
||||
|
||||
LtlAutorizado.Text = string.Format("{0:N2}", DTAguinaldos.SUM("Aguinaldo", "CveNomina>0"));
|
||||
|
||||
LtldiasEjercicio.Text = string.Format("{0}/12/31", ejercicio).ToDate().DayOfYear.ToString();
|
||||
}
|
||||
|
||||
GVCalcularAguinaldo.DataBind();
|
||||
LnkAutorizarModal.Visible = true;
|
||||
BtnRecalcular_Click(sender, null);
|
||||
upDatosPA_N.Update();
|
||||
}
|
||||
private void CargaPeriodos()
|
||||
@@ -149,7 +154,7 @@ public partial class Nomina_Aguinaldo : ClsPaginas
|
||||
{
|
||||
continuar = false;
|
||||
Alert("debe agregar un concepto para el calculo del aguinaldo", ModExtensiones.TipoMensaje.ToastAdventencia);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (continuar)
|
||||
{
|
||||
@@ -169,9 +174,9 @@ public partial class Nomina_Aguinaldo : ClsPaginas
|
||||
ImporteGravado = row["AguinaldoGravado"].ToString().ToDecimal();
|
||||
ImporteExento = Importe - ImporteGravado;
|
||||
ImporteValor = row["DiasLaborados"].ToString().ToDecimal();
|
||||
|
||||
|
||||
if (CvePersonal > 0 && Importe>0 && row["CveNomina"].ToString().ToEntero()==0)
|
||||
|
||||
if (CvePersonal > 0 && Importe > 0 && row["CveNomina"].ToString().ToEntero() == 0)
|
||||
{
|
||||
if (objNomina.GetNom_Nominas(-1, CvePersonal, CvePeriodoSeleccionado, -1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
@@ -261,4 +266,466 @@ public partial class Nomina_Aguinaldo : ClsPaginas
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void BtnRecalcular_Click(object sender, EventArgs e)
|
||||
{
|
||||
decimal uma = 86.88m;
|
||||
decimal aguiexentogral = uma * 30;
|
||||
decimal salariodiario = 0;
|
||||
decimal diasanio = 366;
|
||||
decimal diaslaborados = 0;
|
||||
decimal diasaguinaldo = 0;
|
||||
decimal diasaguipago = 0;
|
||||
decimal salariomensual = 0;
|
||||
decimal aguinaldo = 0;
|
||||
decimal aguinaldoexcento = 0;
|
||||
decimal aguinaldogravado = 0;
|
||||
decimal diasmes = 30.5m;
|
||||
decimal FraccionI = 0;
|
||||
decimal FraccionII_1 = 0;
|
||||
decimal FraccionII_2 = 0;
|
||||
decimal FraccionIII_1 = 0;
|
||||
decimal FraccionIII_2 = 0;
|
||||
decimal FraccionV = 0;
|
||||
decimal FraccionIV = 0;
|
||||
|
||||
decimal Aguinaldoapagar = 0;
|
||||
decimal AguinaldoapagarTotal = 0;
|
||||
StringBuilder str = new StringBuilder();
|
||||
using (ClsClaseBaseD objbase = new ClsClaseBaseD())
|
||||
{
|
||||
|
||||
foreach (GridViewRow gvrow in GVCalcularAguinaldo.Rows)
|
||||
{
|
||||
salariodiario = gvrow.FCTextBox("TxtsueldoDiario").Text.ToDecimal();
|
||||
diaslaborados = gvrow.FCTextBox("TxtdiasLaborados").Text.ToDecimal();
|
||||
diasaguinaldo = gvrow.FCTextBox("TxtdiasAguinaldo").Text.ToDecimal();
|
||||
if (salariodiario > 0)
|
||||
{
|
||||
|
||||
diasaguipago = (diaslaborados / diasanio) * diasaguinaldo;
|
||||
salariomensual = salariodiario * 30;
|
||||
aguinaldo = diasaguipago * salariodiario;
|
||||
aguinaldoexcento = (aguiexentogral > aguinaldo ? aguinaldo : aguiexentogral);
|
||||
aguinaldogravado = aguinaldo - aguinaldoexcento;
|
||||
if (aguinaldogravado > 0) {
|
||||
FraccionI = (aguinaldogravado / diasanio) * diasmes;
|
||||
FraccionII_1 = salariomensual + FraccionI;
|
||||
str.Clear();
|
||||
str.AppendFormat("SELECT dbo.Fnc_NomValues(40, 0, 00, -1, {0}, {1}, {1}) isrFraccionII_2,", FraccionII_1, diasmes);
|
||||
str.AppendFormat(" dbo.Fnc_NomValues(40, 0, 00, -1, {0}, {1}, {1}) isrFraccionIII_1", salariomensual, diasmes);
|
||||
if (objbase.runQuerystr(str.ToString()))
|
||||
{
|
||||
DataRow drow = objbase.DtResultados.Rows[0];
|
||||
FraccionII_2 = drow["isrFraccionII_2"].ToString().ToDecimal();
|
||||
FraccionIII_1 = drow["isrFraccionIII_1"].ToString().ToDecimal();
|
||||
}
|
||||
else { break; }
|
||||
|
||||
FraccionIII_2 = FraccionII_2 - FraccionIII_1;
|
||||
FraccionV = FraccionIII_2 / FraccionI;
|
||||
FraccionIV = aguinaldogravado * FraccionV;
|
||||
Aguinaldoapagar = aguinaldo - FraccionIV;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
FraccionIV = 0;
|
||||
Aguinaldoapagar = aguinaldo - FraccionIV;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
aguinaldo = 0;
|
||||
Aguinaldoapagar = 0;
|
||||
aguinaldogravado = 0;
|
||||
FraccionIV = 0;
|
||||
}
|
||||
AguinaldoapagarTotal += Aguinaldoapagar;
|
||||
gvrow.FCLabel("lblsueldoAguinaldoCompleto").Text = string.Format("${0:N2}", aguinaldo);
|
||||
gvrow.FCLabel("lblAguinaldo").Text = string.Format("${0:N2}", Aguinaldoapagar);
|
||||
gvrow.FCLabel("lblAguinaldoGravado").Text = string.Format("${0:N2}", aguinaldogravado);
|
||||
gvrow.FCLabel("lblISRAguinaldo").Text = string.Format("${0:N2}", FraccionIV);
|
||||
}
|
||||
|
||||
}
|
||||
LtlTotal.Text =string.Format("${0:N2}", AguinaldoapagarTotal);
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
|
||||
lblAguinaldo
|
||||
lblAguinaldoGravado
|
||||
lblISRAguinaldo
|
||||
|
||||
salario diario
|
||||
dias año
|
||||
Dias laborados
|
||||
dias Aguinaldo
|
||||
dias aguinaldo(PAGO)
|
||||
UMA
|
||||
Salario mensual
|
||||
Aguinaldo
|
||||
Aguinaldo excento
|
||||
Aguinaldo gravado
|
||||
|
||||
dias mes
|
||||
FraccionI
|
||||
FraccionII
|
||||
FraccionII
|
||||
FraccionIII
|
||||
FraccionIII
|
||||
FraccionV
|
||||
FraccionIV
|
||||
|
||||
Aguinaldoapagar
|
||||
|
||||
|
||||
|
||||
|
||||
*
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
class ClsClaseBaseD : IDisposable
|
||||
{
|
||||
protected SqlConnection SqlConexion;
|
||||
protected SqlDataAdapter SqlAdapter;
|
||||
protected DataTable datos;
|
||||
protected DataSet DTSet;
|
||||
public DataTable DtResultados
|
||||
{
|
||||
get
|
||||
{
|
||||
return datos;
|
||||
}
|
||||
}
|
||||
public DataSet DTSetResultados
|
||||
{
|
||||
get
|
||||
{
|
||||
return DTSet;
|
||||
}
|
||||
}
|
||||
protected bool disposedValue = false;
|
||||
protected bool EsTransaccion = false;
|
||||
public string MyCurrentError;
|
||||
// REGISTRAR CONEXIÓN
|
||||
private int CveConexion = 0;
|
||||
|
||||
public ClsClaseBaseD(ClsClaseBaseD adsObj = null)
|
||||
{
|
||||
if (adsObj != null && adsObj.SqlAdapter != null && adsObj.SqlAdapter.SelectCommand != null && adsObj.SqlAdapter.SelectCommand.Transaction != null)
|
||||
{
|
||||
SqlConexion = adsObj.SqlConexion;
|
||||
SqlAdapter = adsObj.SqlAdapter;
|
||||
EsTransaccion = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SqlConexion = new SqlConnection();
|
||||
SqlConexion.ConnectionString = ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString;
|
||||
try
|
||||
{
|
||||
SqlConexion.Open();
|
||||
SqlAdapter = new SqlDataAdapter("", SqlConexion);
|
||||
ConexionAdd();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.OnError("Ocurrió un error al intentar conectarse a la base de datos.", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SqlDataAdapter(string StrSQL, CommandType TipoComando = CommandType.StoredProcedure)
|
||||
{
|
||||
if (SqlConexion.State == ConnectionState.Open)
|
||||
{
|
||||
SqlAdapter.SelectCommand.Parameters.Clear();
|
||||
SqlAdapter.SelectCommand.CommandText = StrSQL;
|
||||
SqlAdapter.SelectCommand.CommandType = TipoComando;
|
||||
datos = new DataTable();
|
||||
DTSet = new DataSet();
|
||||
}
|
||||
}
|
||||
protected void DataAdapter(string StrSQL, CommandType TipoComando = CommandType.Text)
|
||||
{
|
||||
|
||||
// if (SqlAdapter.SelectCommand == null)
|
||||
// {
|
||||
// if ((sqlCommand != null))
|
||||
// {
|
||||
// SqlAdapter.SelectCommand = sqlCommand;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// SqlAdapter.SelectCommand = new SqlCommand();
|
||||
// }
|
||||
// SqlAdapter.SelectCommand.Connection = SqlConexion;
|
||||
// }
|
||||
|
||||
if (SqlConexion.State == ConnectionState.Open)
|
||||
{
|
||||
SqlAdapter.SelectCommand.Parameters.Clear();
|
||||
SqlAdapter.SelectCommand.CommandText = StrSQL;
|
||||
SqlAdapter.SelectCommand.CommandType = TipoComando;
|
||||
datos = new DataTable();
|
||||
DTSet = new DataSet();
|
||||
}
|
||||
}
|
||||
|
||||
private void ConexionAdd()
|
||||
{
|
||||
if (ConfigurationManager.AppSettings["RegistraConexion"] != null && ConfigurationManager.AppSettings["RegistraConexion"].ToString() == "1")
|
||||
{
|
||||
try
|
||||
{
|
||||
SqlDataAdapter("PA_Sis_RegistrarConexion");
|
||||
{
|
||||
var withBlock = SqlAdapter.SelectCommand.Parameters;
|
||||
withBlock.Add("@Clase", SqlDbType.VarChar).Value = this.GetType().Name;
|
||||
withBlock.Add("@Modulo", SqlDbType.VarChar).Value = string.Format("{0}?{1}", HttpContext.Current.Request.Url.AbsolutePath.ToString(), HttpContext.Current.Request.QueryString.ToString());
|
||||
withBlock.Add("@IDConexion", SqlDbType.Int).Direction = ParameterDirection.Output;
|
||||
}
|
||||
SqlAdapter.Fill(datos);
|
||||
CveConexion = SqlAdapter.SelectCommand.Parameters["@IDConexion"].Value.ToString().ToEntero();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ConexionClose()
|
||||
{
|
||||
if (CveConexion > 0 && ConfigurationManager.AppSettings["RegistraConexion"] != null && ConfigurationManager.AppSettings["RegistraConexion"].ToString() == "1")
|
||||
{
|
||||
SqlDataAdapter(string.Format("UPDATE Sis_Conexiones SET FechaCierre = GETDATE() WHERE CveConexion = {0}", CveConexion), CommandType.Text);
|
||||
|
||||
try
|
||||
{
|
||||
SqlAdapter.Fill(datos);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.OnError("Ocurrió un error registrar la conexión.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo());
|
||||
}
|
||||
CveConexion = 0;
|
||||
}
|
||||
}
|
||||
protected void addParameters(string name, SqlDbType tipo, object valor)
|
||||
{
|
||||
if (SqlConexion.State == ConnectionState.Open)
|
||||
SqlAdapter.SelectCommand.Parameters.Add(name, tipo).Value = valor;
|
||||
}
|
||||
|
||||
public bool runQuerystr(string Query, List<parametroQuery> Listaparametros = null, string msgError = "", bool mostrarError = true)
|
||||
{
|
||||
bool retorno = false;
|
||||
try
|
||||
{
|
||||
if (SqlConexion.State == ConnectionState.Open)
|
||||
{
|
||||
SqlAdapter.SelectCommand.Parameters.Clear();
|
||||
SqlAdapter.SelectCommand.CommandText = Query;
|
||||
SqlAdapter.SelectCommand.CommandType = CommandType.Text;
|
||||
datos = new DataTable();
|
||||
if (Listaparametros!= null)
|
||||
{
|
||||
foreach (parametroQuery pr in Listaparametros)
|
||||
{
|
||||
if (pr.SqlDataType != null)
|
||||
{
|
||||
if (pr.ParameterDirection != null)
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
|
||||
else
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value;
|
||||
}
|
||||
else
|
||||
SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue);
|
||||
}
|
||||
}
|
||||
|
||||
SqlAdapter.Fill(datos);
|
||||
retorno = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
string InfoAdicional = "Se intenta realizar una conexion con una conexion cerrada";
|
||||
InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}";
|
||||
ModExtensiones.GuardaLog(InfoAdicional);
|
||||
}
|
||||
}
|
||||
catch (SqlException sqEx)
|
||||
{
|
||||
retorno = false;
|
||||
setOnError(msgError, sqEx);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retorno = false;
|
||||
setOnError(msgError, ex);
|
||||
}
|
||||
return retorno;
|
||||
}
|
||||
public int ExecQuery(string Query, List<parametroQuery> Listaparametros = null, string msgError = "", bool mostrarError = true)
|
||||
{
|
||||
int retorno = -1;
|
||||
try
|
||||
{
|
||||
if (SqlConexion.State == ConnectionState.Open)
|
||||
{
|
||||
SqlAdapter.SelectCommand.Parameters.Clear();
|
||||
SqlAdapter.SelectCommand.CommandText = Query;
|
||||
SqlAdapter.SelectCommand.CommandType = CommandType.Text;
|
||||
if (Listaparametros!= null)
|
||||
{
|
||||
foreach (parametroQuery pr in Listaparametros)
|
||||
{
|
||||
if ( pr.SqlDataType != null)
|
||||
{
|
||||
if ( pr.ParameterDirection != null)
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Direction = pr.ParameterDirection;
|
||||
else
|
||||
SqlAdapter.SelectCommand.Parameters.Add(pr.ParameterName, pr.SqlDataType).Value = pr.SqlValue != null ? pr.SqlValue : DBNull.Value;
|
||||
}
|
||||
else
|
||||
SqlAdapter.SelectCommand.Parameters.AddWithValue(pr.ParameterName, pr.SqlValue);
|
||||
}
|
||||
}
|
||||
|
||||
retorno = SqlAdapter.SelectCommand.ExecuteNonQuery();
|
||||
}
|
||||
else
|
||||
{
|
||||
string InfoAdicional = "Se intenta realizar una conexion con una conexion cerrada";
|
||||
InfoAdicional = $"{InfoAdicional}{Environment.NewLine}{msgError}{Environment.NewLine}";
|
||||
this.GuardaLog(InfoAdicional);
|
||||
}
|
||||
}
|
||||
catch (SqlException sqEx)
|
||||
{
|
||||
retorno = -1;
|
||||
setOnError(msgError, sqEx);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retorno = -1;
|
||||
setOnError(msgError, ex);
|
||||
}
|
||||
return retorno;
|
||||
}
|
||||
|
||||
|
||||
protected bool RunQuery(string msgOnError)
|
||||
{
|
||||
bool retorno = false;
|
||||
|
||||
try
|
||||
{
|
||||
SqlAdapter.Fill(datos);
|
||||
retorno = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retorno = false;
|
||||
|
||||
setOnError(msgOnError, ex);
|
||||
}
|
||||
return retorno;
|
||||
}
|
||||
protected bool RunQueryDS(string msgOnError)
|
||||
{
|
||||
bool retorno = false;
|
||||
|
||||
try
|
||||
{
|
||||
SqlAdapter.Fill(DTSet);
|
||||
retorno = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retorno = false;
|
||||
|
||||
setOnError(msgOnError, ex);
|
||||
}
|
||||
return retorno;
|
||||
}
|
||||
public void setOnError(string Mensaje, Exception Exeption)
|
||||
{
|
||||
string InfoAdicional = "";
|
||||
if (SqlAdapter != null && SqlAdapter.SelectCommand != null && SqlAdapter.SelectCommand.Parameters != null)
|
||||
InfoAdicional = SqlAdapter.SelectCommand.Parameters.ParametrosInfo();
|
||||
MyCurrentError = string.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString(), "\r\n", InfoAdicional);
|
||||
this.OnError(Mensaje, Exeption, InfoAdicional);
|
||||
}
|
||||
public void IniciaTransacSQL()
|
||||
{
|
||||
SqlAdapter.SelectCommand.Transaction = SqlConexion.BeginTransaction();
|
||||
EsTransaccion = true;
|
||||
}
|
||||
|
||||
public void Commit()
|
||||
{
|
||||
SqlAdapter.SelectCommand.Transaction.Commit();
|
||||
SqlConexion.Close();
|
||||
}
|
||||
|
||||
public void RollBack()
|
||||
{
|
||||
SqlAdapter.SelectCommand.Transaction.Rollback();
|
||||
SqlConexion.Close();
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
ConexionClose();
|
||||
if ((SqlConexion != null))
|
||||
{
|
||||
if (SqlConexion.State == ConnectionState.Open)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ((SqlAdapter != null))
|
||||
SqlAdapter.Dispose();
|
||||
|
||||
SqlConexion.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.OnError("Ocurrió un error al intentar cerrar la base de datos.", ex);
|
||||
}
|
||||
}
|
||||
SqlConexion.Dispose();
|
||||
}
|
||||
|
||||
if (datos != null)
|
||||
datos.Dispose();
|
||||
if (SqlAdapter != null)
|
||||
SqlAdapter.Dispose();
|
||||
|
||||
if (DTSet != null)
|
||||
DTSet.Dispose();
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
public class parametroQuery
|
||||
{
|
||||
public parametroQuery(string parameterName, object sqlValue, SqlDbType sqlDataType = default(SqlDbType), ParameterDirection parameterDirection = default(ParameterDirection))
|
||||
{
|
||||
this.ParameterName = parameterName;
|
||||
this.SqlDataType = sqlDataType;
|
||||
this.ParameterDirection = parameterDirection;
|
||||
this.SqlValue = sqlValue;
|
||||
}
|
||||
|
||||
public string ParameterName { get; set; }
|
||||
public SqlDbType SqlDataType { get; set; }
|
||||
public ParameterDirection ParameterDirection { get; set; }
|
||||
public object SqlValue { get; set; }
|
||||
}
|
||||
|
||||
@@ -69,14 +69,14 @@ Partial Class OC_CatEstatus
|
||||
CargaDatos()
|
||||
CargaEstatus()
|
||||
CargaProyectos()
|
||||
CargaUsuarios()
|
||||
|
||||
'SOLO MUESTRA SUBPROYECTO
|
||||
If UsuarioActual.Empresa.GralSoloProyecto Then
|
||||
'TdProyecto.Visible = False
|
||||
'TdSubProyectoTitulo.Visible = False
|
||||
|
||||
DivProyecto.Visible = False
|
||||
CargaUsuarios()
|
||||
|
||||
'SOLO MUESTRA SUBPROYECTO
|
||||
|
||||
'TdProyecto.Visible = False
|
||||
'TdSubProyectoTitulo.Visible = False
|
||||
|
||||
DivProyecto.Visible = False
|
||||
LblSubproyecto.Visible = False
|
||||
|
||||
|
||||
@@ -84,9 +84,9 @@ Partial Class OC_CatEstatus
|
||||
CboSubProyecto.DataBind()
|
||||
CboSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
CboSubProyecto_SelectedIndexChanged(CboSubProyecto, EventArgs.Empty)
|
||||
End If
|
||||
|
||||
CboSubProyecto_SelectedIndexChanged(CboSubProyecto, EventArgs.Empty)
|
||||
|
||||
|
||||
chkMostrarLimites.Attributes.Add("onchange", "javascript:chkMostrarLimitesCambio();")
|
||||
MaintainScrollPositionOnPostBack = True
|
||||
|
||||
@@ -614,7 +614,7 @@ Partial Class OC_CatEstatus
|
||||
|
||||
'Insertar el nuevo registro
|
||||
Else
|
||||
If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, CveSubProyecto, Row.DataKey("CveUsuario").ToString.ToEntero, True) Then
|
||||
If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, CveSubProyecto, Row.DataKey("CveUsuario").ToString.ToEntero, True, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||
HuboErrores = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -699,6 +699,7 @@ Partial Class OC_CatEstatus
|
||||
|
||||
If Not HuboErrores Then
|
||||
objEstatusOC.Commit()
|
||||
GlobalDTSubProyectosUsuarios(-1, -1, UsuarioActual.CveEmpresa) = Nothing
|
||||
Alert("Se guardaron los Cambios exitosamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
objEstatusOC.RollBack()
|
||||
|
||||
@@ -811,6 +811,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCORFVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<div runat="server" id="DVCultivosCuadro" visible ="false">
|
||||
Cultivo:
|
||||
<asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;"
|
||||
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar">
|
||||
</asp:DropDownList>
|
||||
@@ -941,9 +942,7 @@
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# String.Format("{0}<br/>{1}{2}", Eval("Proyecto"), Eval("SubProyecto"), If(Eval("CveCultivoCuadroDetalle").ToString <> "" And Eval("CveCultivoCuadroDetalle").ToString <> "0" And Eval("CveCultivoCuadroDetalle").ToString <> "-1", String.Format("<br/>{0}", Eval("Cuadro")), "")) %>'></asp:Literal>
|
||||
|
||||
|
||||
|
||||
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
|
||||
|
||||
@@ -801,6 +801,9 @@ Partial Class OC
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
|
||||
DVCultivosCuadro.Visible = True
|
||||
DdlSubProyecto.AutoPostBack = True
|
||||
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
|
||||
DdlCultivosCuadro.DataBind()
|
||||
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
End If
|
||||
@@ -3562,7 +3565,9 @@ Partial Class OC
|
||||
|
||||
If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then
|
||||
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
|
||||
e.Row.FCLiteral("LtlSubProyecto").Text = e.Row.DBCampo("SubProyecto")
|
||||
Dim Str As String = e.Row.DBCampo("SubProyecto")
|
||||
If e.Row.DBCampo("Cuadro") <> "" Then Str = String.Format("{0}<br/>{1}", Str, e.Row.DBCampo("Cuadro"))
|
||||
e.Row.FCLiteral("LtlSubProyecto").Text = Str
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida" />
|
||||
<%--<a href="javascript:;" class="expand"></a>--%>
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
@@ -81,6 +81,19 @@
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
<label class="col-md-1 " runat="server" style="margin-top: 5px; font-size:12px;">Usuario Registró:</label>
|
||||
<div class="col-md-2" runat="server">
|
||||
<asp:DropDownList ID="DdlUsuarios" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveUsuario" DataTextField="Nombre" ValidationGroup="GrpGuardar" CssClass="select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<asp:Label runat="server" ID="lblSubProyecto" class="col-md-1 " style="margin-top: 5px; font-size:12px;">Subproyecto:</asp:Label>
|
||||
<div class="col-md-2" runat="server">
|
||||
<asp:DropDownList ID="DdlSubProyecto" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpGuardar" CssClass="select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -73,10 +73,23 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
|
||||
txtFechaI.Text = DateTime.Now.AddMonths(-1).FirstDayOfMonth().ToShortDateString();
|
||||
txtFechaF.Text = DateTime.Now.ToShortDateString();
|
||||
CveProveedor = -1;
|
||||
CargaSubProyectos();
|
||||
CargaProveedor();
|
||||
CargaUsuarios();
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
private void CargaSubProyectos()
|
||||
{
|
||||
CargarCentrosDeCosto(null,DdlSubProyecto,null,lblSubProyecto);
|
||||
}
|
||||
|
||||
private void CargaUsuarios()
|
||||
{
|
||||
DdlUsuarios.DataSource = get_GlobalDTUsuarios(CveEmpresa:UsuarioActual.CveEmpresa);
|
||||
DdlUsuarios.DataBind();
|
||||
}
|
||||
|
||||
protected void CargaProveedor()
|
||||
{
|
||||
DdlProveedores.setEsWebService(true);
|
||||
@@ -93,7 +106,7 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
|
||||
FechaI = (txtFechaI.Text.ToString() != "" ? txtFechaI.Text.ToDateTime() : MinFecha);
|
||||
FechaF = (txtFechaF.Text.ToString() != "" ? txtFechaF.Text.ToDateTime() : DateTime.Now);
|
||||
|
||||
if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero()))
|
||||
if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero(),DdlUsuarios.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero()))
|
||||
{
|
||||
DtDatos = ObjOC.DtResultados;
|
||||
GvSolicitudes.DataSource = DtDatos;
|
||||
|
||||
101
RH/CatChecadores.aspx
Normal file
101
RH/CatChecadores.aspx
Normal file
@@ -0,0 +1,101 @@
|
||||
<%@ Page Title="RH - Catálogo de Checadores" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatChecadores.aspx.cs" Inherits="RH_CatChecadores" %>
|
||||
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Checadores
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregarChecador" OnClick="BtnAgregarChecador_Click" data-toggle="tooltip" data-placement="left" title="Agregar un Checador" Text="<i class='fa fa-plus'></i>Agregar Checador"></asp:LinkButton>
|
||||
</li>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveChecador,Checador,CveModelo,CveSubProyecto,SubProyecto,CveUsuario,Estatus,FechaIng,IPLocal,Puerto" EmptyDataText="No se encontraron Tipo Gasto" ToolTip="Listado de Tipo Gasto " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Checador" DataField="Checador" />
|
||||
<asp:BoundField HeaderText="SubProyecto" DataField="SubProyecto" />
|
||||
<asp:BoundField HeaderText="IP Local" DataField="IPLocal" />
|
||||
<asp:BoundField HeaderText="Puerto" DataField="Puerto" />
|
||||
<asp:BoundField HeaderText="Usuario" DataField="Usuario" />
|
||||
<asp:BoundField HeaderText="Estatus" DataField="Estatus" />
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaIng" DataFormatString="{0:d}" />
|
||||
<asp:TemplateField ItemStyle-Width="13%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" Visible="true" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Editar' class='fa fa-pencil' title='Editar' ></i>" />
|
||||
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Reasignar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="DivAgregarTiposD" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Checadores</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtChecador" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtChecador" runat="server" ControlToValidate="TxtChecador" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Checador''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
|
||||
<label for="TxtChecador">Checador:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="DdlSubProyecto">Subproyecto:</label>
|
||||
<asp:DropDownList ID="DdlSubProyecto" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpGuardar" CssClass="select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlSubProyecto" runat="server" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sub Proyecto''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCODdlSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtIPLocal" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ID="RfvTxtIPLocal" runat="server"
|
||||
ValidationExpression="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"
|
||||
ControlToValidate="TxtIPLocal" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''IP Local''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD" />
|
||||
<label for="TxtChecador">IP Local:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPuerto" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ID="RfvTxtPuerto" runat="server" ValidationExpression="\d*" ControlToValidate="TxtPuerto" CssClass="help-block errorimput"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Puerto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD" />
|
||||
<label for="TxtPuerto">Puerto:</label>
|
||||
<i></i>
|
||||
</div>
|
||||
<div id="divChkEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label for="ChkEstatus">Estatus:</label>
|
||||
<asp:CheckBox runat="server" ID="ChkEstatus" CssClass="make-switchsd" data-size="small" Text=" " />
|
||||
</div>
|
||||
</div>
|
||||
</br>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnChecadorAgregar" OnClick="BtnChecadorAgregar_Click" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTiposD" />
|
||||
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
115
RH/CatChecadores.aspx.cs
Normal file
115
RH/CatChecadores.aspx.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using System.Data;
|
||||
|
||||
public partial class RH_CatChecadores : ClsPaginas
|
||||
{
|
||||
private int CveChecador
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveChecador"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveChecador"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
CargaSubProyectos();
|
||||
}
|
||||
}
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
ClsRH ObjRH = new ClsRH();
|
||||
if (ObjRH.GetChecadores(-1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvDatos.DataSource = ObjRH.DtResultados;
|
||||
}
|
||||
ObjRH.Dispose();
|
||||
GvDatos.DataBind();
|
||||
}
|
||||
|
||||
private void CargaSubProyectos()
|
||||
{
|
||||
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa);
|
||||
DdlSubProyecto.DataBind();
|
||||
}
|
||||
|
||||
protected void BtnAgregarChecador_Click(object sender, EventArgs e)
|
||||
{
|
||||
TxtChecador.Text = "";
|
||||
DdlSubProyecto.SelectedValue = "-1";
|
||||
TxtIPLocal.Text = "";
|
||||
TxtPuerto.Text = "";
|
||||
BtnChecadorAgregar.Text = "Agregar";
|
||||
divChkEstatus.Visible = false;
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||
}
|
||||
|
||||
protected void BtnChecadorAgregar_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsRH ObjRH = new ClsRH();
|
||||
if (BtnChecadorAgregar.Text == "Agregar")
|
||||
{
|
||||
if (ObjRH.AddChecadores(TxtChecador.Text, DdlSubProyecto.SelectedValue.ToEntero(), TxtIPLocal.Text, TxtPuerto.Text, UsuarioActual.CveUsuario))
|
||||
{
|
||||
Alert("Checador agregado correctamente");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjRH.UpdateChecadores(CveChecador,TxtChecador.Text,DdlSubProyecto.SelectedValue.ToEntero(),TxtIPLocal.Text,TxtPuerto.Text,Estatus: ChkEstatus.Checked))
|
||||
{
|
||||
Alert("Checador actualizado correctamente");
|
||||
}
|
||||
}
|
||||
ObjRH.Dispose();
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
|
||||
}
|
||||
|
||||
protected void LnkEditar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
|
||||
CveChecador = GvRow.DataKey("CveChecador").ToEntero();
|
||||
TxtChecador.Text = GvRow.DataKey("Checador");
|
||||
DdlSubProyecto.SelectedValue = GvRow.DataKey("CveSubProyecto");
|
||||
TxtIPLocal.Text = GvRow.DataKey("IPLocal");
|
||||
TxtPuerto.Text = GvRow.DataKey("Puerto");
|
||||
BtnChecadorAgregar.Text = "Actualizar";
|
||||
ChkEstatus.Checked = GvRow.DataKey("Estatus") == "Activo";
|
||||
divChkEstatus.Visible = true;
|
||||
UpModalTiposD.Update();
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
|
||||
}
|
||||
|
||||
protected void LnkEliminar_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
|
||||
ClsRH ObjRH = new ClsRH();
|
||||
if (ObjRH.RemoveChecadores(GvRow.DataKey("CveChecador").ToEntero()))
|
||||
{
|
||||
Alert("Checador eliminado correctamente");
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
}
|
||||
ObjRH.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1257,7 +1257,7 @@ Partial Class ProductosyServicios
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso ChkAplicaParaVenta.Checked Then
|
||||
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, True)
|
||||
End If
|
||||
|
||||
@@ -1323,7 +1323,7 @@ Partial Class ProductosyServicios
|
||||
Next
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso ChkAplicaParaVenta.Checked Then
|
||||
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, False)
|
||||
End If
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server"
|
||||
DataKeyNames="Nombre,FolioPago,SerieFolio,CveVenta,CveIE,CveCliente,Transaccion,CveVendedor,CveSubProyecto,Vendedor,SubProyecto,CveCategoria,CveMoneda,Costo,CostoDolares,Comision,PorcentajeComision,TieneCategoriaValida,CodigoPS"
|
||||
DataKeyNames="Nombre,FolioPago,SerieFolio,CveVenta,CveIE,CveCliente,Transaccion,CveVendedor,CveSubProyecto,Vendedor,SubProyecto,CveCategoria,CveMoneda,Costo,CostoDolares,Comision,PorcentajeComision,TieneCategoriaValida,CodigoPS,PorcentajePrecioPublico,DiasPago"
|
||||
EmptyDataText="No se han encontrado datos con los filtros especificados." data-sort="true" GridLines="None"
|
||||
CssClass="table table-hover table-striped Widthall ScrollAD " Width="100%" AutoGenerateColumns="False"
|
||||
OnRowDataBound="GvDatos_RowDataBound" OnPreRender="GvDatos_PreRender">
|
||||
|
||||
@@ -113,28 +113,24 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
|
||||
{
|
||||
e.Row.CssClass = "SubTotales2";
|
||||
//e.Row.Cells[0].Text = e.Row.DBCampo("Vendedor").ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").Visible = true;
|
||||
//if (e.Row.DBCampo("CveCategoria").ToEntero() < 1 && e.Row.DBCampo("Comision").ToDouble() == 0)
|
||||
//{
|
||||
// //if (UsuarioActual.TienePermisoProceso(201))
|
||||
// //{
|
||||
// // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
// // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
// //}
|
||||
// //else
|
||||
// //{
|
||||
// e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
// e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales.";
|
||||
// //}
|
||||
//}else if (e.Row.DBCampo("CveCategoria").ToEntero() > 0 )
|
||||
//{
|
||||
// e.Row.Cells[21].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria",$"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
|
||||
// e.Row.Cells[22].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}.";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").Visible = true;
|
||||
if (!Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").ToolTip = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
|
||||
}
|
||||
else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() > 0)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
|
||||
}
|
||||
else if (Convert.ToBoolean(e.Row.DataKey("TieneCategoriaValida")) && e.Row.DataKey("Comision").ToDouble() == 0)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
|
||||
}
|
||||
else if (e.Row.DataKey("Comision").ToDouble() > 0)
|
||||
{
|
||||
e.Row.FCLinkButton("LnkInfo").ToolTip = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales. La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { e.Row.DataKey("CveCategoria").ToString()}")}. El producto es: <b>{e.Row.DataKey("CodigoPS").ToString()}</b>. % Precio Publico: {e.Row.DataKey("PorcentajePrecioPublico").ToString()}. Dias Pago: {e.Row.DataKey("DiasPago").ToString()}.";
|
||||
@@ -357,19 +353,19 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas
|
||||
}
|
||||
|
||||
|
||||
protected void LnkInfo_Click(object sender, EventArgs e)
|
||||
protected void LnkInfo_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
|
||||
if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
|
||||
if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
|
||||
{
|
||||
LblInfo.Text = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales.<br/> La categoria del producto es: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}</b>. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
|
||||
}
|
||||
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0)
|
||||
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0)
|
||||
{
|
||||
LblInfo.Text = $"El producto obtuvo la comision porque se encuentra en la categoria: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")}</b> y esta dentro de los rangos de precio publico y dias validos. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
|
||||
}
|
||||
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
|
||||
else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0)
|
||||
{
|
||||
LblInfo.Text = $"El producto se encuentra en la categoria: <b>{get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")}</b> que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos. <br/> % Precio Publico: <b>{gvRow.DataKey("PorcentajePrecioPublico").ToString()}</b> <br/> Dias Pago: <b>{gvRow.DataKey("DiasPago").ToString()}</b>";
|
||||
}
|
||||
|
||||
@@ -3926,7 +3926,7 @@ Partial Class Ventas
|
||||
LblAlertRefacInv.Visible = True
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev", "Rem", "DPe", "RNC", "Pd2") AndAlso Not CveEstatus.Contiene(4, 5, 12, 13, 20) Then
|
||||
If UsuarioActual.TienePermisoProceso(159) Then
|
||||
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
|
||||
If TienePermiso <> "" Then
|
||||
@@ -6697,6 +6697,7 @@ Partial Class Ventas
|
||||
TmpDT.Rows(e.RowIndex)("ImporteIVA") = (TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales)
|
||||
TmpDT.Rows(e.RowIndex)("ImporteIEPS") = (TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
|
||||
TmpDT.Rows(e.RowIndex)("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
|
||||
TmpDT.Rows(e.RowIndex)("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
|
||||
TmpDT.Rows(e.RowIndex)("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
|
||||
TmpDT.Rows(e.RowIndex)("PorcentajeRetIVA") = ClienteRetIVA
|
||||
TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR
|
||||
@@ -16309,6 +16310,7 @@ Partial Class Ventas
|
||||
Row("IVA") = Row("PorcentajeIVA")
|
||||
Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales)
|
||||
Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
|
||||
Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
|
||||
Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
|
||||
Row("PorcentajeRetIVA") = ClienteRetIVA
|
||||
Row("PorcentajeRetISR") = ClienteRetISR
|
||||
@@ -20879,8 +20881,16 @@ Partial Class Ventas
|
||||
RegistraScript("$('#ModalCancelarDocumento').modal();")
|
||||
UpCancelarDocumento.Update()
|
||||
sb.Clear()
|
||||
ElseIf DdlTipoComprobante.SelectedValue.Contiene("Pd2") Then
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.UpdateEstatusVenta(CveVenta, 22, UsuarioActual.CveEmpresa) Then
|
||||
Dim redirectString As String = String.Format("document.location.href=""/Ventas/Ventas.aspx?CveVenta={0}""", CveVenta)
|
||||
Alert("Pedido cancelado.", JSBtnAceptar:=redirectString)
|
||||
', "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
Else
|
||||
CancelarDocumento()
|
||||
CancelarDocumento()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -25785,7 +25795,8 @@ Partial Class Ventas
|
||||
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(),
|
||||
Row("PU").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
|
||||
Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(),
|
||||
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString()) Then
|
||||
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString(),
|
||||
PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal) Then
|
||||
MensajeError = "Ocurrió un error al guardar las partidas de la cotización"
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
|
||||
Reference in New Issue
Block a user