This commit is contained in:
rakcsle
2022-02-18 12:34:05 -07:00
31 changed files with 1897 additions and 494 deletions

View File

@@ -0,0 +1,259 @@
<%@ Page Title="Indicador diario detalle" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepIndicadorDiarioDetalle.aspx.vb" Inherits="Acumuladores_RepIndicadorDiarioDetalle" %>
<%@ 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">
<style>
.select2 .select2-selection__rendered {
line-height: 1;
color: #111;
}
.select2 .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 20px;
user-select: none;
-webkit-user-select: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
margin-top: 10px;
}
.select2-selection__rendered {
margin-top: 0px;
height: 25px;
}
.select2-selection {
margin-top: 0px;
height: 31px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: none;
outline: 0;
}
#chartdiv {
width: 100%;
height: 500px;
}
</style>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
<%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-fit-height btnopaco" />
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Generar</asp:LinkButton>
</li>
<li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink>
</li>
<li>
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
</li>
<li>
<asp:LinkButton ID="ImgImprimir" runat="server" Enabled="true"> <i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Productos Servicios
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="titlefiltros caption">
<div class="row">
<label class="col-md-1">Tipo: </label>
<div class="col-md-2">
</div>
<div class="col-md-1 truncate">
Fecha Inicio:
</div>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1 truncate">
Fecha Fin:
</div>
<div class="col-md-1">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 ">Grupo:</label>
<div class="col-md-2">
</div>
</div>
</div>
</div>
<div class="portlet-body" style="display: none">
<div class="row">
<label runat="server" id="LblProyecto" class="col-md-1 truncate">Proyecto:</label>
<div runat="server" id="DivProyecto" class="col-md-2">
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" Width="99%" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados" ToolTip="Listado de Ventas"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None" DataKeyNames="TipoDocumento,SerieFolio">
<Columns>
<asp:HyperLinkField HeaderText="Serie Folio" DataTextField="SerieFolio" Target="_blank" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="~/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Suc. Ejec." DataField="SubProyectoEjecucion" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" Visible="false" />
<asp:BoundField HeaderText="Suc. Cob." DataField="SubProyectoCobranza" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" Visible="false" />
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Código" DataField="CodigoProducto" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto/Servicio" DataField="PS" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Observación" DataField="Observaciones" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" Visible="false" />
<asp:BoundField HeaderText="PU" DataField="PU" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="SubTotal" DataField="SubTotal" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Desc" DataField="Descuento" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="IVA" DataField="IVA" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:###,###,###,###.##}" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="RFC" DataField="RFC" ItemStyle-Width="5%" Visible="false" />
<asp:BoundField HeaderText="Método de Pago" DataField="MetodoPago" ItemStyle-Width="5%" Visible="false" />
<asp:BoundField HeaderText="Forma de Pago" DataField="FormaPago" ItemStyle-Width="5%" Visible="false" />
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
<script>
function CargaGraficaBarras(data) {
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "light",
"dataProvider": data,
"startDuration": 2,
"valueAxes": [{
"position": "left",
"title": "Ventas"
}],
"graphs": [{
"balloonText": "[[category]]: <b>[[value]]</b> [[Moneda]]",
"colorField": "Color",
"fillAlphas": 1,
"lineAlpha": 0.1,
"type": "column",
"valueField": "Valor"
}],
"depth3D": 20,
"angle": 30,
"chartCursor": {
"categoryBalloonEnabled": false,
"cursorAlpha": 0,
"zoomable": false
},
"categoryField": "Texto",
"categoryAxis": {
"gridPosition": "start",
"labelRotation": 90
},
"export": {
"enabled": true
}
});
}
function CargaGraficaPastel(data) {
var chart = AmCharts.makeChart("chartdiv", {
"type": "pie",
"theme": "light",
"dataProvider":
data,
"valueField": "Valor",
"titleField": "Texto",
"outlineAlpha": 0.4,
"depth3D": 0,
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]% [[Moneda]])</span>",
"angle": 0,
"export": {
"enabled": true
}
});
}
</script>
</asp:Content>

View File

@@ -0,0 +1,67 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.IO
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports System.IO.Compression
Partial Class Acumuladores_RepIndicadorDiarioDetalle
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaParametrosDetalle()
End If
End Sub
#Region " CARGA DATOS INICIALES "
Private Sub CargaParametrosDetalle()
Dim Opcion As Integer = If(Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToEntero() > 0, Request("Opcion").ToEntero(), -1)
Dim CveSubProyecto As Integer = If(Request("CveSubProyecto") IsNot Nothing AndAlso Request("CveSubProyecto").ToEntero() > 0, Request("CveSubProyecto").ToEntero(), -1)
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
UPDatos.Update()
End Sub
Private Sub CargaDatos()
Dim ObjAcum As New ClsAcumuladores()
Dim FechaI, FechaF As Date
FechaI = txtFechaI.Text.ToDate
FechaF = txtFechaF.Text.ToDate
If ObjAcum.GetRepIndicadorDiarioDetalle(FechaI, FechaF, 1, -1, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjAcum.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjAcum.Dispose()
GvDatos.DataBind()
End Sub
#End Region
End Class

View File

@@ -1135,7 +1135,7 @@ Public Class ClsAcumuladores
End Function
Public Function GetRepIndicadorDiario(FechaInicio As Date, FechaFin As Date, CveSubProeycto As Integer, CveEmpresa As Integer) As Boolean
Public Function GetRepIndicadorDiario(FechaInicio As Date, FechaFin As Date, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -1144,7 +1144,35 @@ Public Class ClsAcumuladores
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProeycto
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar los datos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetRepIndicadorDiarioDetalle(FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_RepIndicadorDiarioDetalleGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With

View File

@@ -4012,7 +4012,7 @@ Public Class ClsGenerales
End Function
Public Function GetInvEntregaAlmacenRutaRep(CveSubProyecto As Integer, CveEmpresa As Integer, Estatus As Integer, FechaInicio As Date, FechaFin As Date, CveChofer As Integer, Optional CveTimbre As Integer = -1) As Boolean
Public Function GetInvEntregaAlmacenRutaRep(CveSubProyecto As Integer, CveEmpresa As Integer, Estatus As Integer, FechaInicio As Date, FechaFin As Date, CveChofer As Integer, CveUsuario As Integer, Optional CveTimbre As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -4027,7 +4027,7 @@ Public Class ClsGenerales
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveChofer", SqlDbType.Int).Value = CveChofer
.Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try

View File

@@ -2298,7 +2298,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetInventarioFisico(CveInventarioFisico As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Estado As Integer) As Boolean
Public Function GetInventarioFisico(CveInventarioFisico As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Estado As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_InventarioFisicoGet")
With SqlAdapter.SelectCommand.Parameters
@@ -2306,6 +2306,7 @@ Public Class ClsInventarios
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Estado", SqlDbType.Int).Value = Estado
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -2036,7 +2036,7 @@ Public Class ClsPaginas
End Set
End Property
'Variables para Ventas
Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Boolean = True, Optional VendedorTipo As Integer = 1) As DataTable
Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional VendedorTipo As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTVendedores-{0}", CveEmpresa)
'sino existe, recarga los datos
@@ -2047,10 +2047,15 @@ Public Class ClsPaginas
End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0} AND CveEstatus = {1} AND VendedorTipo = {2}", CveEmpresa, If(Estatus, 1, 0), VendedorTipo), "", DataViewRowState.CurrentRows)
Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If VendedorTipo >= 0 Then StrSQL.AppendFormat(" AND VendedorTipo = {0} ", VendedorTipo)
If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstatus = {0} ", If(Estatus = 1, True, False))
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTVendedores = Dv.ToTable
Dv.Dispose()
Else
GlobalDTVendedores = DirectCast(Application(AppNombre), DataTable)
End If
@@ -5633,7 +5638,8 @@ Public Class ClsPaginas
PaginaDict.Add("/Acumuladores/CatTiposUso.aspx".ToUpper(), 1034)
PaginaDict.Add("/Acumuladores/CatFoliosGarantia.aspx".ToUpper(), 1035)
PaginaDict.Add("/Acumuladores/CatGarantiasMeses.aspx".ToUpper(), 1036)
PaginaDict.Add("/Acumuladores/RepIndicadorDiario.aspx".ToUpper(), 2055)
PaginaDict.Add("/Acumuladores/RepIndicadorDiario.aspx".ToUpper(), 730)
PaginaDict.Add("/Acumuladores/RepIndicadorDiarioDetalle.aspx".ToUpper(), 730)
PaginaDict.Add("/Acumuladores/RepEntradasUsadosClientes.aspx".ToUpper(), 543)
PaginaDict.Add("/Acumuladores/EntradasUsadosResumenRep.aspx".ToUpper(), 1032)
@@ -7075,7 +7081,7 @@ Public Class ClsPaginas
'Si no tiene CBB, SE GENERA
If Not ImagenCBB.Exists AndAlso Vta.CveCliente.ToEntero > 0 Then
Dim CBB As New ClbNegBICFDv3_2.ClsNegCBBGenerar()
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total.ToString.ToDecimal, Vta.FolioFiscal, RutaCBB)
CBB.GenerarCBB(UsuarioActual.Empresa.RFC, RFCReceptor, Vta.Total, Vta.FolioFiscal, RutaCBB)
End If
'ImgCBB = String.Format("{0}://{1}:{2}/Empresas/{3}/CBB/{4}.jpg", Request.Url.Scheme.Replace("https", "http"), Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, Vta.SerieFolio)

View File

@@ -2527,7 +2527,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString()
.Add("@xmlRegistros", SqlDbType.Xml).Value = If(xmlProductos Is Nothing, DBNull.Value, DirectCast(xmlProductos.ToString(), Object))
End With
Try
SqlAdapter.Fill(Data)
@@ -2549,7 +2549,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
SqlDataAdapter("PA_RH_ChecadorAsistenciaAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString()
.Add("@xmlRegistros", SqlDbType.Xml).Value = If(xmlProductos Is Nothing, DBNull.Value, DirectCast(xmlProductos.ToString(), Object))
End With
Try
SqlAdapter.Fill(Data)
@@ -7181,6 +7181,25 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
Public Function UpPersonalAsistenciasMasiva(CveEmpresa As Integer, CveUsuario As Integer, xmlProductos As String) As Boolean
Dim Retorno As Boolean = False
Data = New DataTable
SqlDataAdapter("PA_RH_PersonalAsistenciasMasivaUP")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@xmlRegistros", SqlDbType.Xml).Value = If(String.IsNullOrEmpty(xmlProductos), DBNull.Value, DirectCast(xmlProductos.ToString(), Object))
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al guardar la asistencia masiva", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al guardar la asistencia masiva.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpPersonalSupervisorMasiva(CveEmpresa As Integer, CveUsuario As Integer, registros As List(Of RequestUpSupervisorMasiva)) As Boolean
Dim Retorno As Boolean = False
Dim xmlProductos As System.Xml.Linq.XDocument = Nothing
@@ -7192,7 +7211,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@xmlRegistros", SqlDbType.Xml).Value = xmlProductos.ToString()
.Add("@xmlRegistros", SqlDbType.Xml).Value = If(xmlProductos Is Nothing, DBNull.Value, DirectCast(xmlProductos.ToString(), Object))
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -155,8 +155,7 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<asp:UpdatePanel ID="UpTabs" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer runat="server" ID="T">
@@ -219,11 +218,8 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="row">
<br />
<div class="row">
<div class="col-md-5 form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConceptoCompras" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control marginFixRow" Width="96%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtConceptoCompras" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoCompras"
@@ -245,11 +241,9 @@
<asp:Button Text="Generar Proveedores" runat="server" ID="BtnGeneraCompras" Visible="false" OnClick="BtnGeneraCompras_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarCompras" />
<asp:HiddenField ID="HdnProveedorCvePrePoliza" runat="server" />
<asp:Button ID="BtnProveedoresRemove" runat="server" Text="Eliminar" Visible="false" OnClick="BtnProveedoresRemove_Click" class="btn btn-primary" /></div>
</div>
</div>
<br />
<asp:GridView ID="GvCompras" Width="99%" runat="server" AutoGenerateColumns="False"
<asp:GridView ID="GvProveedores" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveCompra,CveProveedor,TipoCambio, Fluctuacion,SerieFolio, CveConceptoContable,FluctuacionTotal,PerdidaGanancia,IdCtaContComplementaria,CveIE"
EmptyDataText="No se Encontraron compras pendientes de pagar." ToolTip="Listado de Compras"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
@@ -266,6 +260,108 @@
<%--<asp:Label ID="LblTotalCompras" runat="server" Text=""></asp:Label>--%>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabComprasAnt" HeaderText="Proveedores Ant">
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server" Visible="False">
<ContentTemplate>
<div id="Div1" visible="true" class="row" runat="server">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading">PÉRDIDA</h4>
<div class="widget-thumb-wrap">
<i class="widget-thumb-icon bg-red fa fa-money"></i>
<div class="widget-thumb-body">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="Literal1" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading">GANANCIA</h4>
<div class="widget-thumb-wrap">
<i class="widget-thumb-icon bg-green fa fa-money"></i>
<div class="widget-thumb-body">
<div class="row">
<div class="col-md-6">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="Literal2" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading">
<asp:Label ID="Label3" runat="server" Text=""></asp:Label></h4>
<div class="widget-thumb-wrap">
<i id="I1" runat="server" class=""></i>
<div class="widget-thumb-body">
<div class="row">
<div class="col-md-6">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="Literal3" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="row">
<div class="col-md-5 form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConceptoComprasAnt" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control marginFixRow" Width="96%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtConceptoComprasAnt" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoComprasAnt"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarComprasAnt"></asp:RequiredFieldValidator>
<label for="<%= TxtConceptoComprasAnt.ClientID.ToString()%>">Concepto:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyectoComprasAnt" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
</asp:DropDownList>
<label for="<%= DdlSubProyectoComprasAnt.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblSubProyectoComprasAnt"></asp:Label></label>
<asp:RequiredFieldValidator ID="RFVDdlSubProyectoComprasAnt" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubProyectoComprasAnt" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarComprasAnt"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="col-md-2" style="text-align: right!important">
<asp:Button Text="Generar Proveedores Ant" runat="server" ID="BtnGeneraComprasAnt" Visible="false" OnClick="BtnGeneraComprasAnt_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarComprasAnt" />
<asp:HiddenField ID="HdnProveedorAntCvePrePoliza" runat="server" />
<asp:Button ID="BtnProveedoresAntRemove" runat="server" Text="Eliminar" Visible="false" OnClick="BtnProveedoresAntRemove_Click" class="btn btn-primary" /></div>
</div>
<br />
<asp:GridView ID="GvProveedoresAnt" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveCompra,CveProveedor,TipoCambio, Fluctuacion,SerieFolio, CveConceptoContable,FluctuacionTotal,PerdidaGanancia,IdCtaContComplementaria,CveIE"
EmptyDataText="No se Encontraron compras pendientes de pagar." ToolTip="Listado de Compras"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:HyperLinkField HeaderText="Proveedor" DataTextField="NombreComercial" Target="_blank" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataNavigateUrlFields="CveProveedor" />
<asp:HyperLinkField HeaderText="# Facturas" DataTextField="SerieFolio" Target="_blank" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" DataNavigateUrlFields="CveCompra"/>
<asp:BoundField DataField="TipoDocto" HeaderText="Tipo" />
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo USD" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fluctuación Pesos" DataField="FluctuacionTotal" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Perdida o Ganancia" DataField="PerdidaGanancia" ItemStyle-Width="100" />
</Columns>
</asp:GridView>
<%--<asp:Label ID="LblTotalCompras" runat="server" Text=""></asp:Label>--%>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabVentas" HeaderText="Clientes">
<ContentTemplate>
<asp:UpdatePanel ID="UpIndicadoresVentas" UpdateMode="Conditional" runat="server" Visible="false">
@@ -349,7 +445,7 @@
<i></i>
</div>
<div class="col-md-6" style="text-align: right!important">
<div class="col-md-3" style="text-align: right!important">
<asp:Button Text="Generar Ventas" runat="server" ID="BtnGeneraVentas" Visible="false" OnClick="BtnGeneraVentas_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarVentas" />
<asp:HiddenField ID="HdnClienteCvePrePoliza" runat="server" />
<asp:Button ID="BtnClientesRemove" runat="server" Text="Eliminar" Visible="false" OnClick="BtnClientesRemove_Click" class="btn btn-primary" /></div>
@@ -360,7 +456,7 @@
<asp:GridView ID="GvVentas" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="TipoCambio,Fluctuacion,CveVenta,SerieFolio,CveIE,IdCtaContComplementaria,TipoDocto" EmptyDataText="No se Encontraron Cuentas Bancarias."
ToolTip="Listado de Cuentas Bancarias" CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
ToolTip="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:HyperLinkField DataTextField="Nombre" HeaderText="Cliente" Target="_blank" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" DataNavigateUrlFields="CveCliente" />
<asp:HyperLinkField DataTextField="SerieFolio" HeaderText="SerieFolio" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" />
@@ -376,109 +472,122 @@
<asp:Label ID="LblTotalVentas" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabCuentasBancarias" HeaderText="Cuentas Bancarias">
<ContentTemplate>
<br />
<div class="row">
<div class="col-md-5 form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConceptoBancos" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control " Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtConceptoBancos" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoBancos"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarBancos"></asp:RequiredFieldValidator>
<label for="<%= TxtConceptoBancos.ClientID.ToString()%>">Concepto:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubproyectoBancos" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
</asp:DropDownList>
<label for="<%= DdlSubproyectoBancos.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblSubProyectoBancos"></asp:Label>
</label>
<asp:RequiredFieldValidator ID="RFVDdlSubproyectoBancos" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubproyectoBancos" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarBancos"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:Button Text="Generar Bancos" runat="server" ID="BtnGeneraBancos" OnClick="BtnGeneraBancos_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarBancos" />
</div>
</div>
<br />
<asp:GridView ID="GvCuentas" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="IdCtaAfectable,IdCtaContable,IdCtaContableComplementaria,TipoCambio,Fluctuacion,
Banco,NumCuenta,CveCuentaComplementaria,Saldo"
EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="50">
<ItemTemplate>
<asp:CheckBox ID="ChkGenerarBancos" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Banco" DataField="Banco" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="# Cuenta" DataField="NumCuenta" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="T.C. último ajuste" DataField="TipoCambio" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
<asp:Label ID="LblTotalBancos" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabDeudores" HeaderText="Deudores">
<ajax:TabPanel runat="server" ID="TabVentasAnt" HeaderText="Clientes Ant">
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server" Visible="false">
<ContentTemplate>
<div id="Div2" visible="true" class="row" runat="server">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading">PÉRDIDA</h4>
<div class="widget-thumb-wrap">
<i class="widget-thumb-icon bg-red fa fa-money"></i>
<div class="widget-thumb-body">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="Literal4" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading">GANANCIA</h4>
<div class="widget-thumb-wrap">
<i class="widget-thumb-icon bg-green fa fa-money"></i>
<div class="widget-thumb-body">
<div class="row">
<div class="col-md-6">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="Literal5" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="widget-thumb text-uppercase bordered">
<h4 class="widget-thumb-heading">
<asp:Label ID="Label5" runat="server" Text=""></asp:Label></h4>
<div class="widget-thumb-wrap">
<i id="I2" runat="server" class=""></i>
<div class="widget-thumb-body">
<div class="row">
<div class="col-md-6">
<span class="widget-thumb-subtitle">MXN</span>
<span class="widget-thumb-body-stat">
<asp:Literal ID="Literal6" Text="" runat="server" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="row">
<div class="col-md-5 form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConceptoDeudores" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control " Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtConceptoDeudores" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoDeudores"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarDeudores"></asp:RequiredFieldValidator>
<label for="<%= TxtConceptoDeudores.ClientID.ToString()%>">Concepto:</label>
<asp:TextBox ID="TxtConceptoVentasAnt" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control " Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoVentasAnt"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarVentasAnt"></asp:RequiredFieldValidator>
<label for="<%= TxtConceptoVentasAnt.ClientID.ToString()%>">Concepto:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyectoDeudores" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
<asp:DropDownList ID="DdlsubProyectoVentasAnt" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
</asp:DropDownList>
<label for="<%= DdlSubProyectoDeudores.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblSubProyectoDeudores"></asp:Label>
<label for="<%= DdlsubProyectoVentasAnt.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblSubProyectoVentasAnt"></asp:Label>
</label>
<asp:RequiredFieldValidator ID="RFVRFVDdlSubProyectoDeudores" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubProyectoDeudores" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarDeudores"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlsubProyectoVentasAnt" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarVentasAnt"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:Button Text="Generar Deudores" runat="server" ID="BtnGeneraDedudores" OnClick="BtnGeneraDedudores_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarDeudores" />
</div>
</div>
<div class="col-md-3" style="text-align: right!important">
<asp:Button Text="Generar Clientes Anticipos" runat="server" ID="BtnClientesAnticipos" Visible="false" OnClick="BtnClientesAnticipos_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarVentasAnt" />
<asp:HiddenField ID="HdnClienteAntCvePrePoliza" runat="server" />
<asp:Button ID="BtnClientesAntRemove" runat="server" Text="Eliminar" Visible="false" OnClick="BtnClientesAntRemove_Click" class="btn btn-primary" /></div>
<br />
</div>
<br />
<asp:GridView ID="GvDeudores" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="IdCtaAfectable,TipoCambio,Fluctuacion,RazonSocial,CveIE"
EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<asp:GridView ID="GvClientesAnt" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="TipoCambio,Fluctuacion,CveVenta,SerieFolio,CveIE,IdCtaContComplementaria,TipoDocto" EmptyDataText="No se Encontraron Cuentas Bancarias."
ToolTip="" CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Deudor" DataField="RazonSocial" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField HeaderText="Folio" DataTextField="Folio" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:HyperLinkField DataTextField="Nombre" HeaderText="Cliente" Target="_blank" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" DataNavigateUrlFields="CveCliente" />
<asp:HyperLinkField DataTextField="SerieFolio" HeaderText="SerieFolio" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataNavigateUrlFields="CveVenta" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="TipoDocto" HeaderText="Tipo" />
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="T.C. último ajuste" DataField="TipoCambio" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Diferencia" HeaderText="Diferencia TC" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N4}" />
<asp:BoundField DataField="FluctuacionPesos" HeaderText="Fluctuacion Pesos" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PerdidaGanancia" HeaderText="Acción" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
<asp:Label ID="LblTotalDeudores" runat="server" Text=""></asp:Label>
<asp:Label ID="LblTotalVentasAnt" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabAcreedores" HeaderText="Compras Acreedores">
<ContentTemplate>
<br />
<div class="row">
<div class="col-md-5 form-group form-md-line-input input-iconright">
@@ -525,6 +634,106 @@
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabAcreedoresAnticipos" HeaderText="Acreedores Ant">
<ContentTemplate>
<div class="row">
<div class="col-md-5 form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConceptoAcreedoresAnt" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control " Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVConceptoAcreedoresAnt" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoAcreedoresAnt"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarAcreedoresAnt"></asp:RequiredFieldValidator>
<label for="<%= TxtConceptoAcreedoresAnt.ClientID.ToString()%>">Concepto:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyectoAcreeedoresAnt" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
</asp:DropDownList>
<label for="<%= DdlSubProyectoAcreeedoresAnt.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblSubProyectoAcreedoresAnt"></asp:Label>
</label>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubProyectoAcreeedoresAnt" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarAcreedoresAnt"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="col-md-3" style="text-align: right!important">
<asp:Button Text="Generar Acreedores Ant" runat="server" ID="BtnGeneraAcreedoresAnt" Visible="false" OnClick="BtnGeneraAcreedoresAnt_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarAcreedoresAnt" />
<asp:HiddenField ID="HdnAcreedorAntCvePrePoliza" runat="server" />
<asp:Button ID="BtnAcreedoresAntRemove" runat="server" Text="Eliminar" Visible="false" OnClick="BtnAcreedoresAntRemove_Click" class="btn btn-primary" />
</div>
</div>
<br />
<asp:GridView ID="GvAcreedoresAnt" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveCompra,CveProveedor,TipoCambio,Fluctuacion,SerieFolio,IdCtaContComplementaria,CveIE"
EmptyDataText="No se Encontraron compras pendientes de pagar." ToolTip="Listado de Compras"
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:HyperLinkField HeaderText="Proveedor" DataTextField="NombreComercial" Target="_blank" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Compras/Proveedores.aspx?CveProveedor={0}" DataNavigateUrlFields="CveProveedor" />
<asp:HyperLinkField HeaderText="# Facturas" DataTextField="SerieFolio" Target="_blank" DataNavigateUrlFormatString="/Compras/Compras.aspx?CveCompra={0}" DataNavigateUrlFields="CveCompra"/>
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo USD" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fluctuación Pesos" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="PerdidaGanancia" HeaderText="Acción" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
<asp:Label ID="LblTotalAcreedoresAnt" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabCuentasBancarias" HeaderText="Bancos">
<ContentTemplate>
<br />
<div class="row">
<div class="col-md-5 form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConceptoBancos" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control " Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtConceptoBancos" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoBancos"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarBancos"></asp:RequiredFieldValidator>
<label for="<%= TxtConceptoBancos.ClientID.ToString()%>">Concepto:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubproyectoBancos" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
</asp:DropDownList>
<label for="<%= DdlSubproyectoBancos.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblSubProyectoBancos"></asp:Label>
</label>
<asp:RequiredFieldValidator ID="RFVDdlSubproyectoBancos" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubproyectoBancos" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarBancos"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:Button Text="Generar Bancos" runat="server" ID="BtnGeneraBancos" OnClick="BtnGeneraBancos_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarBancos" />
</div>
</div>
<br />
<asp:GridView ID="GvCuentas" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="IdCtaAfectable,IdCtaContable,IdCtaContableComplementaria,TipoCambio,Fluctuacion,
Banco,NumCuenta,CveCuentaComplementaria,Saldo"
EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip=""
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="50">
<ItemTemplate>
<asp:CheckBox ID="ChkGenerarBancos" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Banco" DataField="Banco" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="# Cuenta" DataField="NumCuenta" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="T.C. último ajuste" DataField="TipoCambio" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
<asp:Label ID="LblTotalBancos" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabFilial" HeaderText="Filial">
<ContentTemplate>
@@ -561,7 +770,7 @@
<asp:GridView ID="GvFiliales" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="IdCtaAfectable,TipoCambio,Fluctuacion,RazonSocial,CveIE,Folio"
EmptyDataText="No se Encontraron Cuentas Bancarias." ToolTip="Listado de Cuentas Bancarias"
EmptyDataText="No se Encontraron" ToolTip=""
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Acreedor" DataField="RazonSocial" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
@@ -575,6 +784,54 @@
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel runat="server" ID="TabDeudores" HeaderText="Deudores">
<ContentTemplate>
<div class="row">
<div class="col-md-5 form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConceptoDeudores" Style="text-transform: uppercase;" runat="server" MaxLength="100" CssClass="form-control " Width="90%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVTxtConceptoDeudores" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtConceptoDeudores"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarDeudores"></asp:RequiredFieldValidator>
<label for="<%= TxtConceptoDeudores.ClientID.ToString()%>">Concepto:</label>
<i></i>
</div>
<div class="col-md-2 form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlSubProyectoDeudores" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me js-referencia-programmatic marginFixRow" Width="90%">
</asp:DropDownList>
<label for="<%= DdlSubProyectoDeudores.ClientID.ToString()%>">
<asp:Label runat="server" ID="LblSubProyectoDeudores"></asp:Label>
</label>
<asp:RequiredFieldValidator ID="RFVRFVDdlSubProyectoDeudores" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlSubProyectoDeudores" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardarDeudores"></asp:RequiredFieldValidator>
<i></i>
</div>
<div class="col-md-6" style="text-align: right!important">
<asp:Button Text="Generar Deudores" runat="server" ID="BtnGeneraDedudores" OnClick="BtnGeneraDedudores_Click" Style="margin-left: 30px;" class="btn btn-primary" ValidationGroup="GrpGuardarDeudores" />
</div>
</div>
<br />
<asp:GridView ID="GvDeudores" Width="99%" runat="server" AutoGenerateColumns="False"
DataKeyNames="IdCtaAfectable,TipoCambio,Fluctuacion,RazonSocial,CveIE"
EmptyDataText="No se Encontraron" ToolTip=""
CssClass="table table-hover table-striped ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Deudor" DataField="RazonSocial" ItemStyle-Width="250" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField HeaderText="Folio" DataTextField="Folio" DataNavigateUrlFields="CveIE" DataNavigateUrlFormatString="/Bancos/IE.aspx?CveIE={0}" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Importe" DataField="Importe" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="TipoCambio" HeaderText="TipoCambio" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Saldo" DataField="Saldo" ItemStyle-Width="100" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="T.C. último ajuste" DataField="TipoCambio" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fluctuación" DataField="Fluctuacion" DataFormatString="{0:N2}" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
<asp:Label ID="LblTotalDeudores" runat="server" Text=""></asp:Label>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>

View File

@@ -28,11 +28,14 @@ Partial Class Bancos_FluctuacionCambiaria
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaFechas()
CargarCentrosDeCosto(Nothing, DdlSubProyectoCompras, Nothing, LblSubProyectoCompras, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoComprasAnt, Nothing, LblSubProyectoComprasAnt, "")
CargarCentrosDeCosto(Nothing, DdlsubProyectoVentas, Nothing, LblSubProyectoVentas, "")
CargarCentrosDeCosto(Nothing, DdlsubProyectoVentasAnt, Nothing, LblSubProyectoVentasAnt, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreedores, Nothing, LblSubProyectoAcreedores, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreeedoresAnt, Nothing, LblSubProyectoAcreedoresAnt, "")
CargarCentrosDeCosto(Nothing, DdlSubproyectoBancos, Nothing, LblSubProyectoBancos, "")
CargarCentrosDeCosto(Nothing, DdlsubProyectoVentas, Nothing, LblSubProyectoVentas, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoCompras, Nothing, LblSubProyectoCompras, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoFiliales, Nothing, LblSubProyectoFiliales, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoAcreedores, Nothing, LblSubProyectoAcreedores, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoFiliales, Nothing, LblSubProyectoFiliales, "")
CargarCentrosDeCosto(Nothing, DdlSubProyectoDeudores, Nothing, LblSubProyectoDeudores, "")
CargaUltimaFluctuacion()
@@ -62,14 +65,18 @@ Partial Class Bancos_FluctuacionCambiaria
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaTipoCambio()
If T.ActiveTabIndex = 0 Then CargaDatosCompra()
If T.ActiveTabIndex = 1 Then CargaDatosVentas()
If T.ActiveTabIndex = 2 Then CargaDatosCuentas()
If T.ActiveTabIndex = 3 Then CargaDatosDeudores()
If T.ActiveTabIndex = 4 Then CargaDatosAcreedores()
If T.ActiveTabIndex = 5 Then CargaDatosFiliales()
If T.ActiveTabIndex = 0 Then CargaDatosProveedores()
If T.ActiveTabIndex = 1 Then CargaDatosProveedoresAnticipos()
If T.ActiveTabIndex = 2 Then CargaDatosClientes()
If T.ActiveTabIndex = 3 Then CargaDatosClientesAnticipos()
If T.ActiveTabIndex = 4 Then CargaDatosAcreedores()
If T.ActiveTabIndex = 5 Then CargaDatosAcreedoresAnticipos()
If T.ActiveTabIndex = 6 Then CargaDatosCuentas()
If T.ActiveTabIndex = 7 Then CargaDatosFiliales()
If T.ActiveTabIndex = 8 Then CargaDatosDeudores()
UpTabs.Update()
End Sub
@@ -84,21 +91,8 @@ Partial Class Bancos_FluctuacionCambiaria
ObjGenerales.Dispose()
End Sub
Private Sub CargaUltimaFluctuacion()
'Dim Obj As New ClsBancos
'If Obj.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' Dim dt As DataTable = Obj.DtResultados.FiltraParametros("TipoFluctuacion = 1", "Fecha DESC")
' If dt.Rows.Count > 0 Then
' LtlUltimaFluctuacion.Text = String.Format("Ultima Fluctuación : {0}", dt.Rows(0)("Fecha").ToString.ToDate.ToShortDateString)
' 'si la ultima fluctuacion es mayor o igual al fin de mes anterior, entonces pon la fecha actual
' If dt.Rows(0)("Fecha").ToString.ToDate >= Now.AddMonths(-1).LastDayOfMonth Then
' TxtFecha.Text = Now.ToShortDateString
' Else
' TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString()
' End If
' End If
'End If
'Obj.Dispose()
Private Sub CargaUltimaFluctuacion()
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now)
@@ -111,24 +105,23 @@ Partial Class Bancos_FluctuacionCambiaria
Else
DdlMes.SelectedValueExist(Now.AddMonths(-1).Month)
DdlAnio.SelectedValueExist(Now.AddMonths(-1).Year)
'TxtFecha.Text = Now.AddMonths(-1).LastDayOfMonth.ToShortDateString()
End If
End If
CargaTipoCambio()
End Sub
Private Sub CargaDatosCompra()
Dim ObjBancos As New ClsBancos
'LblTotalCompras.Text = "0.00"
Private Sub CargaDatosProveedores()
Dim ObjBancos As New ClsBancos
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 1, UsuarioActual.CveEmpresa) Then
GvCompras.DataSource = ObjBancos.DtResultados
GvProveedores.DataSource = ObjBancos.DtResultados
'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ")
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0 ")
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0 ")
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ")
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion")
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion").Abs
Dim Final As Double = GanaciaAux - PerdidaAux
HdnProveedorCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
@@ -138,6 +131,44 @@ Partial Class Bancos_FluctuacionCambiaria
IImagenResultado.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd")
LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero
LtIndicador_ValorPesosGanancia.Text = GanaciaAux.ToString.FormatoNumero
LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero
LblComprasPerdidaGanancia.Text = If(Final < 0, "Ganancia", "Pérdida")
LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
GvProveedores.DataSource = Nothing
Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
End If
ObjBancos.Dispose()
GvProveedores.DataBind()
UpIndicadores.Visible = True
If GvProveedores.Rows.Count > 0 Then
GvProveedores.Rows(GvProveedores.Rows.Count - 1).CssClass = "SubTotales2"
End If
End Sub
Private Sub CargaDatosProveedoresAnticipos()
Dim ObjBancos As New ClsBancos
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 2, UsuarioActual.CveEmpresa) Then
GvProveedoresAnt.DataSource = ObjBancos.DtResultados
'LblTotalCompras.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0 ")
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0 ")
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion").Abs
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion")
Dim Final As Double = GanaciaAux - PerdidaAux
HdnProveedorAntCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString
BtnProveedoresAntRemove.Visible = HdnProveedorAntCvePrePoliza.Value.ToEntero > 0
BtnGeneraComprasAnt.Visible = Not HdnProveedorAntCvePrePoliza.Value.ToEntero > 0
IImagenResultado.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd")
LtIndicador_ExistenciaPerdida.Text = PerdidaAux.ToString.FormatoNumero
LtIndicador_ValorPesosGanancia.Text = GanaciaAux.ToString.FormatoNumero
LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero
@@ -145,28 +176,26 @@ Partial Class Bancos_FluctuacionCambiaria
LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
GvCompras.DataSource = Nothing
GvProveedoresAnt.DataSource = Nothing
Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
End If
ObjBancos.Dispose()
GvCompras.DataBind()
UpIndicadores.Visible = True
If GvCompras.Rows.Count > 0 Then
GvCompras.Rows(GvCompras.Rows.Count - 1).CssClass = "SubTotales2"
End If
GvProveedoresAnt.DataBind()
UpIndicadores.Visible = True
End Sub
Private Sub CargaDatosVentas()
Private Sub CargaDatosClientes()
Dim ObjBancos As New ClsBancos
LblTotalVentas.Text = "0.00"
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 2, UsuarioActual.CveEmpresa) Then
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 3, UsuarioActual.CveEmpresa) Then
GvVentas.DataSource = ObjBancos.DtResultados
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0")
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0")
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0")
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0")
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion < 0").Abs
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion > 0")
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion > 0").Abs
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion < 0").Abs
Dim Final As Double = GanaciaAux - PerdidaAux
HdnClienteCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
@@ -190,12 +219,84 @@ Partial Class Bancos_FluctuacionCambiaria
End If
ObjBancos.Dispose()
GvVentas.DataBind()
End Sub
Private Sub CargaDatosClientesAnticipos()
Dim ObjBancos As New ClsBancos
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 4, UsuarioActual.CveEmpresa) Then
GvClientesAnt.DataSource = ObjBancos.DtResultados
Dim Perdida As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion < 0")
Dim Ganancias As DataTable = ObjBancos.DtResultados.FiltraParametros("Fluctuacion > 0")
Dim PerdidaAux As Double = Perdida.SUM("Fluctuacion", "Fluctuacion < 0").Abs
Dim GanaciaAux As Double = Ganancias.SUM("Fluctuacion", "Fluctuacion > 0")
Dim Final As Double = GanaciaAux - PerdidaAux
HdnClienteAntCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString
BtnClientesAntRemove.Visible = HdnClienteAntCvePrePoliza.Value.ToEntero > 0
BtnClientesAnticipos.Visible = Not HdnClienteAntCvePrePoliza.Value.ToEntero > 0
'IImagenFinalVentas.Attributes("class") = If(Final > 0, "widget-thumb-icon bg-green-jungle fa fa-usd", "widget-thumb-icon bg-red fa fa-usd")
'LtIndicador_PerdidasVentas.Text = PerdidaAux.ToString.FormatoNumero
'LtIndicador_GanaciaVentas.Text = GanaciaAux.ToString.FormatoNumero
'LtIndicador_FinalVentas.Text = Final.ToString.FormatoNumero
'LblVentasPerdidaGanancia.Text = If(Final < 0, "Pérdida", "Ganancia")
LblTotalVentasAnt.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
UpIndicadoresVentas.Visible = True
Else
GvClientesAnt.DataSource = Nothing
Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
End If
ObjBancos.Dispose()
GvClientesAnt.DataBind()
End Sub
Private Sub CargaDatosAcreedores()
Dim ObjBancos As New ClsBancos
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 5, UsuarioActual.CveEmpresa) Then
HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString
HdnAcreedorCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
BtnAcreedoresRemove.Visible = HdnAcreedorCvePrePoliza.Value.ToEntero > 0
BtnGeneraAcreedores.Visible = Not HdnAcreedorCvePrePoliza.Value.ToEntero > 0
GvAcreedores.DataSource = ObjBancos.DtResultados
LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
GvAcreedoresAnt.DataSource = Nothing
Alert("Ocurrio un error al cargar los acreedores", TipoMensaje.MsgAdvertencia)
End If
ObjBancos.Dispose()
GvAcreedores.DataBind()
End Sub
Private Sub CargaDatosAcreedoresAnticipos()
Dim ObjBancos As New ClsBancos
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 6, UsuarioActual.CveEmpresa) Then
HdnAcreedorAntCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
BtnAcreedoresAntRemove.Visible = HdnAcreedorAntCvePrePoliza.Value.ToEntero > 0
BtnGeneraAcreedoresAnt.Visible = Not HdnAcreedorAntCvePrePoliza.Value.ToEntero > 0
GvAcreedoresAnt.DataSource = ObjBancos.DtResultados
LblTotalAcreedoresAnt.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
GvAcreedoresAnt.DataSource = Nothing
Alert("Ocurrio un error al cargar los acreedores", TipoMensaje.MsgAdvertencia)
End If
ObjBancos.Dispose()
GvAcreedoresAnt.DataBind()
End Sub
Private Sub CargaDatosCuentas()
Dim ObjBancos As New ClsBancos
LblTotalBancos.Text = "0.00"
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 4, UsuarioActual.CveEmpresa) Then
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 7, UsuarioActual.CveEmpresa) Then
Dim DtTemp As DataTable = ObjBancos.DtResultados.Copy
Dim TCCierreFluctuacion As Decimal = LtTipoCambioActual.Text.ToDecimal
Dim TotAcumulado As Decimal = 0
@@ -237,7 +338,7 @@ Partial Class Bancos_FluctuacionCambiaria
End If
ObjBancos.Dispose()
GvCuentas.DataBind()
End Sub
End Sub
Private Sub CargaDatosDeudores()
Dim ObjBancos As New ClsBancos
@@ -253,24 +354,6 @@ Partial Class Bancos_FluctuacionCambiaria
GvDeudores.DataBind()
End Sub
Private Sub CargaDatosAcreedores()
Dim ObjBancos As New ClsBancos
LblTotalAcreedores.Text = "0.00"
If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 6, UsuarioActual.CveEmpresa) Then
GvAcreedores.DataSource = ObjBancos.DtResultados
LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
HdnAcreedorCvePrePoliza.Value = ObjBancos.DtResultados.MAX("CvePrePoliza").ToString
HdnCveFluctuacionBitacora.Value = ObjBancos.DtResultados.MAX("CveFluctuacionBitacora").ToString
BtnAcreedoresRemove.Visible = HdnAcreedorCvePrePoliza.Value.ToEntero > 0
BtnGeneraAcreedores.Visible = Not HdnAcreedorCvePrePoliza.Value.ToEntero > 0
Else
GvAcreedores.DataSource = Nothing
Alert("Ocurrio un error al cargar los acreedores", TipoMensaje.MsgAdvertencia)
End If
ObjBancos.Dispose()
GvAcreedores.DataBind()
End Sub
Private Sub CargaDatosFiliales()
Dim ObjBancos As New ClsBancos
@@ -315,7 +398,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotal.ToDecimal
If Total > 0 Then
If Total < 0 Then
CveConceptoContable = 64
idCta = IdCtaGanancia
TipoMovto = True
@@ -327,7 +410,7 @@ Partial Class Bancos_FluctuacionCambiaria
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras", CveConceptoContable, "Fluctuación Compras", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Proveedores Anticipos", CveConceptoContable, "Fluctuación Proveedores Anticipos", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoCompras.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
@@ -338,13 +421,13 @@ Partial Class Bancos_FluctuacionCambiaria
If Not ErrorRegistrar Then
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvCompras.Rows
For Each gvr As GridViewRow In GvProveedores.Rows
Total = gvr.DataKey("Fluctuacion").ToDecimal
'si es pérdida o ganancia
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString.ToEntero()
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
Exit For
End If
@@ -362,7 +445,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Not ErrorRegistrar Then
Conta.Commit()
BtnGeneraCompras.Visible = False
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
Alert("Error al generar la fluctuación", TipoMensaje.MsgError)
@@ -370,6 +453,86 @@ Partial Class Bancos_FluctuacionCambiaria
Conta.Dispose()
End Sub
Protected Sub BtnGeneraComprasAnt_Click(sender As Object, e As EventArgs)
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaC", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoComprasAnt.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0
Dim IdCtaComplementaria As Integer = 0
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotal.ToDecimal
If Total > 0 Then
CveConceptoContable = 64
idCta = IdCtaGanancia
TipoMovto = True
Else
CveConceptoContable = 65
idCta = idCtaPerdida
TipoMovto = False
End If
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Compras Anticipos", CveConceptoContable, "Fluctuación Proveedores Anticipos", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoComprasAnt.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveBitacora <= 0 Then
ErrorRegistrar = True
End If
If Not ErrorRegistrar Then
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvProveedoresAnt.Rows
Total = gvr.DataKey("Fluctuacion").ToDecimal
'si es pérdida o ganancia
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString.ToEntero()
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), gvr.DataKey("CveConceptoContable").ToEntero, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
Exit For
End If
If Not Conta.UpdateTCValuacion(-1, gvr.DataKey("CveCompra").ToEntero, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then
ErrorRegistrar = True
Exit For
End If
Next
Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 2, CveBitacora, UsuarioActual.CveEmpresa)
End If
If Not ErrorRegistrar Then
Conta.Commit()
BtnGeneraComprasAnt.Visible = False
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
Alert("Error al generar la fluctuación", TipoMensaje.MsgError)
End If
Conta.Dispose()
End Sub
#End Region
#Region "FLUCTUACION VENTAS"
@@ -397,7 +560,7 @@ Partial Class Bancos_FluctuacionCambiaria
''
Total = LblTotalVentas.Text.ToDecimal
If Total > 0 Then
If Total < 0 Then
CveConceptoContable = 64
CveCuenta = CveCuentaGanancia
TipoMovto = True
@@ -441,6 +604,103 @@ Partial Class Bancos_FluctuacionCambiaria
CveConconceptoCliente = 203
End If
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
Exit For
End If
If Not Conta.UpdateTCValuacion(gvr.DataKey("CveVenta").ToEntero, -1, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then
ErrorRegistrar = True
Exit For
End If
Next
If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 3, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
ErrorRegistrar = True
End If
If Not ErrorRegistrar Then
Conta.Commit()
BtnGeneraVentas.Visible = False
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
Alert("Error al generar la fluctuación", TipoMensaje.MsgError)
End If
Conta.Dispose()
End Sub
Protected Sub BtnClientesAnticipos_Click(sender As Object, e As EventArgs)
Dim Total As Decimal = 0
Dim idCta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0
Dim IdCtaComplementaria As Integer = 0
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
''
Total = LblTotalVentasAnt.Text.ToDecimal
If Total < 0 Then
CveConceptoContable = 64
CveCuenta = CveCuentaGanancia
TipoMovto = True
idCta = IdCtaGanancia
Else
CveConceptoContable = 65
CveCuenta = CveCuentaPerdida
idCta = idCtaPerdida
TipoMovto = False
End If
If Total = 0 Then
Alert("El Importe tiene que ser diferente a cero", TipoMensaje.MsgError)
Exit Sub
End If
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaV", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoVentasAnt.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Ventas", CveConceptoContable, "Fluctuación Ventas", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlsubProyectoVentasAnt.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 4, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveBitacora <= 0 Then
ErrorRegistrar = True
End If
Dim CveConconceptoCliente As Integer = 203
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvClientesAnt.Rows
Total = gvr.DataKey("Fluctuacion").ToDecimal
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
If (gvr.DataKey("CveIE").ToEntero > 0 AndAlso gvr.DataKey("CveVenta").ToEntero < 0) OrElse (gvr.DataKey("CveVenta").ToEntero > 0 AndAlso gvr.DataKey("TipoDocto") = "Ant") Then
CveConconceptoCliente = 226
Else
CveConconceptoCliente = 203
End If
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), CveConconceptoCliente, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
@@ -454,20 +714,178 @@ Partial Class Bancos_FluctuacionCambiaria
Next
If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 2, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
If Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 4, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
ErrorRegistrar = True
End If
If Not ErrorRegistrar Then
Conta.Commit()
BtnGeneraVentas.Visible = False
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
BtnClientesAnticipos.Visible = False
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
Alert("Error al generar la fluctuación", TipoMensaje.MsgError)
End If
Conta.Dispose()
End Sub
#End Region
#Region "FLUCTUACION ACREEDORES"
Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs)
RegistraFluctuacionAcreedores()
End Sub
Private Sub RegistraFluctuacionAcreedores(Optional Anticipos As Boolean = False)
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0
Dim CveCuentaComplementaria As Integer = 55206
Dim IdCtaComplementaria As Integer = 1081
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotalAcreedores.Text.ToDecimal
If Total < 0 Then
CveConceptoContable = 64
idCta = IdCtaGanancia
TipoMovto = True
Else
CveConceptoContable = 65
idCta = idCtaPerdida
TipoMovto = False
End If
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Acreedores", CveConceptoContable, "Fluctuación Acreedores", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoAcreedores.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 5, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveBitacora <= 0 Then
ErrorRegistrar = True
End If
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvAcreedores.Rows
Total = gvr.DataKey("Fluctuacion").ToDecimal
'si es pérdida o ganancia
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, True, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
Exit For
End If
If Not Conta.UpdateTCValuacion(-1, gvr.DataKey("CveCompra").ToEntero, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then
ErrorRegistrar = True
Exit For
End If
Next
Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 5, CveBitacora, UsuarioActual.CveEmpresa)
If Not ErrorRegistrar Then
Conta.Commit()
BtnGeneraAcreedores.Visible = False
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
Alert("Error al generar la fluctuación", TipoMensaje.MsgError)
End If
Conta.Dispose()
Banco.Dispose()
End Sub
Protected Sub BtnGeneraAcreedoresAnt_Click(sender As Object, e As EventArgs)
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedoresAnt.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0
Dim CveCuentaComplementaria As Integer = 55206
Dim IdCtaComplementaria As Integer = 1081
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotalAcreedoresAnt.Text.ToDecimal
If Total > 0 Then
CveConceptoContable = 64
idCta = IdCtaGanancia
TipoMovto = True
Else
CveConceptoContable = 65
idCta = idCtaPerdida
TipoMovto = False
End If
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Acreedores", CveConceptoContable, "Fluctuación Acreedores Anticipos ", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoAcreeedoresAnt.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 6, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveBitacora <= 0 Then
ErrorRegistrar = True
End If
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvAcreedoresAnt.Rows
Total = gvr.DataKey("Fluctuacion").ToDecimal
'si es pérdida o ganancia
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
Exit For
End If
If Not Conta.UpdateTCValuacion(-1, gvr.DataKey("CveCompra").ToEntero, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then
ErrorRegistrar = True
Exit For
End If
Next
Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 6, CveBitacora, UsuarioActual.CveEmpresa)
If Not ErrorRegistrar Then
Conta.Commit()
BtnGeneraAcreedoresAnt.Visible = False
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
Alert("Error al generar la fluctuación", TipoMensaje.MsgError)
End If
Conta.Dispose()
Banco.Dispose()
End Sub
#End Region
@@ -493,7 +911,6 @@ Partial Class Bancos_FluctuacionCambiaria
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaB", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoBancos.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveCuentaPerdida = 0 ' 55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
@@ -553,7 +970,7 @@ Partial Class Bancos_FluctuacionCambiaria
Conta.Commit()
ObjContPaq.Commit()
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver PrePóliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
CargaDatosCuentas()
Else
Conta.RollBack()
@@ -628,7 +1045,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Not ErrorRegistrar Then
Conta.Commit()
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
End If
@@ -721,7 +1138,7 @@ Partial Class Bancos_FluctuacionCambiaria
'Fin autoconta
Conta.Commit()
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
ObjContPaq.RollBack()
@@ -733,116 +1150,9 @@ Partial Class Bancos_FluctuacionCambiaria
#End Region
#Region "FLUCTUACION ACREEDORES"
Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs)
Dim Total As Decimal = 0
Dim Conta As New ClsContabilidad
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
Dim CvePrePoliza As Integer = Conta.AddPrePolizas("Banc/FluctuaA", 1, 0, 0, 1, FechaUltimoDiaMes, TxtConceptoAcreedores.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim idCta As Integer = 0
Dim CveCuentaPerdida, CveCuentaGanancia As Integer
Dim idCtaPerdida, IdCtaGanancia As Integer
Dim TipoMovto As Boolean = False
Dim CveConceptoContable As Integer = 0
Dim CveCuentaComplementaria As Integer = 55206
Dim IdCtaComplementaria As Integer = 1081
Dim ErrorRegistrar As Boolean = False
CveCuentaPerdida = 0 '55379
CveCuentaGanancia = 0 ' 55382
idCtaPerdida = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria '1227
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
Total = LblTotalAcreedores.Text.ToDecimal
If Total > 0 Then
CveConceptoContable = 64
idCta = IdCtaGanancia
TipoMovto = True
Else
CveConceptoContable = 65
idCta = idCtaPerdida
TipoMovto = False
End If
Dim TCUltimaFluctuacion As Decimal = GlobalTipoCambio(FechaUltimoDiaMes).ToDecimal()
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), "Fluctuación Acreedores", CveConceptoContable, "Fluctuación Acreedores", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveSubProyecto:=DdlSubProyectoAcreedores.SelectedValue.ToEntero) Then
ErrorRegistrar = True
End If
Dim CveBitacora As Integer = Banco.AddFluctuacionesBitacora(-1, FechaUltimoDiaMes, 6, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveBitacora <= 0 Then
ErrorRegistrar = True
End If
'saco las cuentas de pérdida y ganancia
For Each gvr As GridViewRow In GvAcreedores.Rows
Total = gvr.DataKey("Fluctuacion").ToDecimal
'si es pérdida o ganancia
IdCtaComplementaria = gvr.DataKey("IdCtaContComplementaria").ToString().ToEntero()
'movimiento de complementaria
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, False, Total, gvr.DataKey("SerieFolio"), 202, gvr.DataKey("SerieFolio"), Now, IdCtaComplementaria, 0, CveCompra:=gvr.DataKey("CveCompra").ToEntero, TipoCambio:=TC, TipoCambioPago:=gvr.DataKey("TipoCambio").ToDecimal, ImporteMX:=Total, ImporteME:=Total, CveIE:=gvr.DataKey("CveIE").ToEntero) Then
ErrorRegistrar = True
Exit For
End If
If Not Conta.UpdateTCValuacion(-1, gvr.DataKey("CveCompra").ToEntero, gvr.DataKey("CveIE").ToEntero, TCUltimaFluctuacion, UsuarioActual.CveEmpresa) Then
ErrorRegistrar = True
Exit For
End If
Next
Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 6, CveBitacora, UsuarioActual.CveEmpresa)
If Not ErrorRegistrar Then
Conta.Commit()
BtnGeneraAcreedores.Visible = False
Alert(String.Format("La Fluctuación se ha generado <br/> <a href='/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}'>Ver Póliza</a>", CvePrePoliza), TipoMensaje.MsgInformacion)
Else
Conta.RollBack()
Alert("Error al generar la fluctuación", TipoMensaje.MsgError)
End If
Conta.Dispose()
Banco.Dispose()
End Sub
#End Region
#Region "GRIDVIEWS"
Protected Sub GvCompras_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompras.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble
'e.Row.FCLabel("LbTipoCambioActual").Text = TipoCambioActual.ToString
'e.Row.FCLabel("LbTipoCambio").Text = If(TipoCambio > 0, TipoCambio.ToString, "No hay TipoCambio")
'e.Row.FCLabel("LbFluctuacion").Text = If(TipoCambio > 0, ((TipoCambio - TipoCambioActual) * e.Row.DBCampo("Saldo").ToString.ToDouble).ToString.FormatoNumero, "No aplica")
'If e.Row.FCLabel("LbFluctuacion").Text = "No aplica" Then
' e.Row.BackColor = Drawing.Color.LightSalmon
'ElseIf e.Row.FCLabel("LbFluctuacion").Text.ToDouble < 0 Then
' e.Row.BackColor = Drawing.Color.LightGoldenrodYellow
'End If
'e.Row.FCHyperLink("HLProveedor").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor").ToString.ToEntero)
'If Not e.Row.DBCampo("IdCtaContProveedores").ToString.ToEntero > 0 Then
' e.Row.FCHyperLink("HLProveedor").ForeColor = Drawing.Color.Red
'End If
'If e.Row.DBCampo("Fluctuacion").ToString.ToDouble < 0 Then
' e.Row.BackColor = Drawing.Color.LightGoldenrodYellow
'End If
'If e.Row.DBCampo("SinTipoCambio").ToString.ToEntero > 0 Then
' e.Row.BackColor = Drawing.Color.LightSalmon
'End If
End If
End Sub
Protected Sub GvCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCuentas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble
@@ -885,6 +1195,7 @@ Partial Class Bancos_FluctuacionCambiaria
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnProveedorCvePrePoliza.Value.ToEntero, 1, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnProveedoresRemove.visible = False
Alert("Flucturación eliminada.")
Else
Banco.RollBack()
@@ -893,12 +1204,41 @@ Partial Class Bancos_FluctuacionCambiaria
End Sub
Protected Sub BtnProveedoresAntRemove_Click(sender As Object, e As EventArgs)
Dim Banco As New ClsBancos
Banco.IniciaTransacSQL()
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnProveedorAntCvePrePoliza.Value.ToEntero, 2, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnProveedoresAntRemove.Visible = False
Alert("Flucturación eliminada.")
Else
Banco.RollBack()
End If
Banco.Dispose()
End Sub
Protected Sub BtnClientesRemove_Click(sender As Object, e As EventArgs)
Dim Banco As New ClsBancos
Banco.IniciaTransacSQL()
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteCvePrePoliza.Value.ToEntero, 2, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteCvePrePoliza.Value.ToEntero, 3, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnClientesRemove.Visible = False
Alert("Flucturación eliminada.")
Else
Banco.RollBack()
End If
Banco.Dispose()
End Sub
Protected Sub BtnClientesAntRemove_Click(sender As Object, e As EventArgs)
Dim Banco As New ClsBancos
Banco.IniciaTransacSQL()
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnClienteAntCvePrePoliza.Value.ToEntero, 4, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnClientesAntRemove.Visible = False
Alert("Flucturación eliminada.")
Else
Banco.RollBack()
@@ -910,12 +1250,30 @@ Partial Class Bancos_FluctuacionCambiaria
Dim Banco As New ClsBancos
Banco.IniciaTransacSQL()
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorCvePrePoliza.Value.ToEntero, 6, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorCvePrePoliza.Value.ToEntero, 5, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnAcreedoresRemove.Visible = False
Alert("Flucturación eliminada.")
Else
Banco.RollBack()
End If
Banco.Dispose()
End Sub
Protected Sub BtnAcreedoresAntRemove_Click(sender As Object, e As EventArgs)
Dim Banco As New ClsBancos
Banco.IniciaTransacSQL()
If Banco.FluctuacionesBitacoraPrePolizaRemove(HdnAcreedorAntCvePrePoliza.Value.ToEntero, 6, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
Banco.Commit()
BtnAcreedoresAntRemove.Visible = False
Alert("Flucturación eliminada.")
Else
Banco.RollBack()
End If
Banco.Dispose()
End Sub
End Class

View File

@@ -728,10 +728,6 @@ Partial Class Bancos_PopIEVentas
TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal
CveSubProyectoVenta = dr("CveSubProyecto").ToString.ToEntero
If UsuarioActual.CveEmpresa = 140 Then 'codigo temporal. RMF permite cargar el corte
CveCorte = dr("CveCorte").ToString.ToEntero
End If
LblMetodoPAgo.Text = $"{dr("ClaveMetodoPagoSATStr").ToString() }"
'Configuración de Modalidad Update
@@ -745,8 +741,6 @@ Partial Class Bancos_PopIEVentas
End If
End If
MovimientoPagar = New IEMovimiento
MovimientoPagar.SubTotal = dr("SubTotal").ToString.ToDecimal
MovimientoPagar.IVA = dr("IVA").ToString.ToDecimal
@@ -788,6 +782,10 @@ Partial Class Bancos_PopIEVentas
CargaCorteCaja()
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'toma como proridad el que viene de
CveCorte = dr("CveCorte").ToString.ToEntero
End If
If RFCCliente.ToUpper <> "XAXX010101000" Then
Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=RFCCliente.ToUpper).FiltroPrimeroValor("CveProveedor").ToEntero

Binary file not shown.

View File

@@ -2194,7 +2194,7 @@ Partial Class Compras_Compras
DdlRetISRConcepto.Items.Clear()
DdlRetISRConcepto.Items.Insert(0, New ListItem("Honorarios", "1"))
DdlRetISRConcepto.Items.Insert(1, New ListItem("Arrendamiento", "2"))
If UsuarioActual.CveEmpresa = 119 Then
If UsuarioActual.CveEmpresa.Contiene(119, 7, 11, 12, 122, 145) Then
DdlRetISRConcepto.Items.Insert(1, New ListItem("Resico", "3"))
End If
End If
@@ -6917,7 +6917,7 @@ Partial Class Compras_Compras
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TotalRealDevolucion, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMovimiento * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TotalRealDevolucion, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=TotalRealDevolucion * tipoCambioActual, ImporteME:=If(tipoCambioActual = 1, 0, TotalRealDevolucion), TipoCambio:=tipoCambioActual, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
Else

View File

@@ -231,11 +231,7 @@
<label class="col-md-1">Contabilizada:</label>
<div class="col-md-2">
<asp:HyperLink ID="HplContabilizada" runat="server" Target="_blank">Si</asp:HyperLink>
</div>
<label class="col-md-1">Folio:</label>
<div class="col-md-1">
<asp:Label ID="LblFolio" Font-Bold="true" Font-Size="Large" runat="server"></asp:Label>
</div>
</div>
</div>
<div class="row" visible="false" runat="server" id="DivTipoGasto">
@@ -713,7 +709,7 @@
<asp:Button ID="BtnIEGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" CssClass="btn btn-primary" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" class="btn btn-danger" />
<%--<asp:Button ID="BtnContabilizar" runat="server" Text="Contabilizar" CssClass="btn btn-primary green" Visible="false" />--%>
<asp:Button ID="BtnContabilizar" runat="server" Text="Contabilizar" CssClass="btn btn-primary green" Visible="false" />
</ContentTemplate>
</asp:UpdatePanel>
</td>

View File

@@ -531,14 +531,13 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
If UsuarioActual.CveEmpresa = 119 Then
' BtnContabilizar.Visible = True
If dr("FolioPoliza").ToString = "" Then
BtnContabilizar.Visible = True
End If
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
If dr("FolioPoliza").ToString.ToEntero > 0 Then
divContabilizada.Visible = True
LblFolio.Text = dr("FolioPoliza").ToString
Folio = dr("FolioPoliza").ToString
End If
@@ -2611,29 +2610,29 @@ Partial Class ContabilidadC_RegPrePolizaS
End Function
#End Region
'Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click
Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click
' Contabilizar()
Contabilizar()
'End Sub
End Sub
'Private Sub Contabilizar()
Private Sub Contabilizar()
' Dim ObjConta As New ClsContabilidad
Dim ObjConta As New ClsContabilidad
' If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero
' ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False)
' End If
If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero
ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False)
End If
' If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then
' Alert(String.Format("Prepóliza contabilizada. <br/><br/>Folio:<a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
' Else
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then
Alert(String.Format("Prepóliza contabilizada. <br/><br/>Folio:<a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
Else
' Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
' End If
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
End If
' ObjConta.Dispose()
'End Sub
ObjConta.Dispose()
End Sub
#Region "Paquete Egresos"
@@ -2795,16 +2794,9 @@ Partial Class ContabilidadC_RegPrePolizaS
LnkComplementoPago.Visible = True
End If
If UsuarioActual.CveEmpresa = 119 Then
' BtnContabilizar.Visible = True
End If
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
If dr("FolioPoliza").ToString.ToEntero > 0 Then
divContabilizada.Visible = True
LblFolio.Text = dr("FolioPoliza").ToString
Folio = dr("FolioPoliza").ToString
End If

View File

@@ -72,7 +72,7 @@ Partial Class Contabilidad2_CatContaEjercicios
Dim ObjConta As New ClsContabilidad
Dim errorString As String = ""
If LbAgregar.Text = "Agregar" Then
If Not ObjConta.AddContaEjercicio(DateTime.Today, UsuarioActual.CvePersonal, UsuarioActual.CveEmpresa, Ejercicio:=TxtEjercicio.Text,
If Not ObjConta.AddContaEjercicio(DateTime.Today, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Ejercicio:=TxtEjercicio.Text,
PeriodoActual:=DdlPeriodoActual.SelectedValue.ToEntero, Estatus:=ChkEstatus.Checked) Then
errorString = "Error al agregar"
End If

View File

@@ -15,6 +15,18 @@
.spanfoliofiscal {
white-space: nowrap;
}
th.Modulo5{
color:#fff;
background-color:darksalmon;
}
th.Modulo6{
color:#fff;
background-color:#67809f;
}
th.Modulo7{
color:#fff;
background-color:purple;
}
th:not(.Modulo5) + th.Modulo5,
th:not(.Modulo6) + th.Modulo6,
th:not(.Modulo7) + th.Modulo7{

View File

@@ -1345,7 +1345,7 @@ Partial Class Inventarios_EntradasSalidas
tCveSubProyecto = drA2("CveSubProyecto").ToString.ToEntero
End If
If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
If UsuarioActual.CveEmpresa = 119 AndAlso Not tCveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
FechaCaducidadVal = MinFecha
FechaCaducidad = MinFecha
Lote = ""
@@ -2116,8 +2116,6 @@ Partial Class Inventarios_EntradasSalidas
filtro = IIf(UsuarioActual.CveEmpresa.Contiene(72, 1, 80), "CveConcepto NOT IN (4,5,10)", filtro).ToString
Else
filtro = String.Format("{0} AND CveTipoAlmacen = {1}", IIf(UsuarioActual.CveEmpresa.Contiene(72, 1, 80, 4, 7, 11, 12, 135), "CveConcepto NOT IN (4,5,10)", filtro).ToString, CveTipoAlmacen)
End If
@@ -2160,6 +2158,14 @@ Partial Class Inventarios_EntradasSalidas
DdlConcepto.Items.Insert(If(DdlConcepto.Items.Count >= 1, 1, 0), New ListItem(" Salida por Ajuste ", "34"))
End If
' RECEPCION USADOS
If CveTipoAlmacen = 22 Then
If DdlConcepto.Items.FindByValue("3") Is Nothing Then
DdlConcepto.Items.Insert(If(DdlConcepto.Items.Count >= 2, 2, DdlConcepto.Items.Count), New ListItem("Salida Almacen ", "3"))
End If
End If
'[IPP]: PARCHE PARA JAM
If UsuarioActual.CveEmpresa = 119 And CveTipoAlmacen.Contiene(4, 8, 16) Then
If DdlConcepto.Items.FindByValue("2") Is Nothing Then
@@ -2212,20 +2218,14 @@ Partial Class Inventarios_EntradasSalidas
DdlConcepto.Items.Remove(DdlConcepto.Items.FindByValue("35"))
End If
End If
If UsuarioActual.CveUsuario.Contiene(2185, 100) Then
DdlConcepto.Items.Add(New ListItem("Entrada por Ajuste", "32"))
DdlConcepto.Items.Add(New ListItem("Salida por Ajuste", "34"))
End If
DdlConcepto.SelectedValue = "-1"
ddlConcepto_SelectedIndexChanged(DdlConcepto, EventArgs.Empty)
@@ -4475,7 +4475,7 @@ Partial Class Inventarios_EntradasSalidas
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenInventarioFisico.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero
If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
AplicaLote = False
AplicaCaducidad = False
End If
@@ -4517,7 +4517,7 @@ Partial Class Inventarios_EntradasSalidas
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenInventarioFisico.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero
If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
If UsuarioActual.CveEmpresa = 119 AndAlso Not CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
AplicaLote = False
AplicaCaducidad = False
End If

View File

@@ -345,8 +345,16 @@
<div class="portlet light xspadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Ventas por surtir</span>
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Ventas por surtir</span>
<code style="font-family: Menlo,Monaco,Consolas,'Courier New',monospace; font-size: 10px">
<asp:Literal Text="" runat="server" ID="LtActualizado" />
</code>
&nbsp
</div>
<div class="actions">
<div class="btn-group">
@@ -355,10 +363,7 @@
<div class="tools">
<asp:Panel runat="server" DefaultButton="BtnConsultarPendientes">
<code>
<asp:Literal Text="" runat="server" ID="LtActualizado" />
</code>
&nbsp
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GVPendientes.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 70px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GVPendientes.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
&nbsp

View File

@@ -670,7 +670,7 @@ Partial Class Inventarios_EntregaAlmacen
If UsuarioActual.CveEmpresa = 119 Then
Dim CveSubProyectoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
If CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
If CveSubProyectoAlmacen.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
ValidaLoteCaducidad = True
Else
ValidaLoteCaducidad = False

View File

@@ -104,7 +104,7 @@ Partial Class Inventarios_InventarioFisico
Dim Inventario As New ClsInventarios
Dim dt As New DataTable
If Inventario.GetInventarioFisico(-1, CveEmpresa, DdlFiltroSubProyecto.SelectedValue.ToEntero, DdlEstado.SelectedValue.ToEntero) Then
If Inventario.GetInventarioFisico(-1, CveEmpresa, DdlFiltroSubProyecto.SelectedValue.ToEntero, DdlEstado.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
dt = Inventario.DtResultados
End If
Inventario.Dispose()

View File

@@ -559,7 +559,7 @@ Partial Class Inventarios_RecepcionAlmacen
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.selectedvalue.toentero).FiltroPrimeroValor("CveSubProyecto").ToEntero
'RMF condición temporal
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
ValidaLoteCaducidad = True
Else
ValidaLoteCaducidad = False

View File

@@ -99,7 +99,7 @@
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVDatos" runat="server"
DataKeyNames="CveEntregaAlmacen,Estatus,CveCliente,CveDireccionOrigen,CveDireccionDestino,CveCamion,CveChofer,FechaEntrega,CveAlmacen,Tipo,AplicaCP,RFCReceptor,RFCEmisor,CveTimbre,CvePAC,FolioFiscal,TimbreTipoDocto,CveMovimiento,FechaLlegada,CveCamionRemolque1,CveCamionRemolque2,Distancia,ConfigCartaPorte,SerieFolio,DireccionOrigen,Direccion"
DataKeyNames="CveSubProyecto, CveEntregaAlmacen,Estatus,CveCliente,CveDireccionOrigen,CveDireccionDestino,CveCamion,CveChofer,FechaEntrega,CveAlmacen,Tipo,AplicaCP,RFCReceptor,RFCEmisor,CveTimbre,CvePAC,FolioFiscal,TimbreTipoDocto,CveMovimiento,FechaLlegada,CveCamionRemolque1,CveCamionRemolque2,Distancia,ConfigCartaPorte,SerieFolio,DireccionOrigen,Direccion"
AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros con los filtros especificados" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" GridLines="None"
EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GVDatos_RowDataBound">
<Columns>

View File

@@ -512,9 +512,12 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
string RFCReceptor = GvRow.DataKey("RFCReceptor").ToString();
string RFCEmisor = GvRow.DataKey("RFCEmisor").ToString();
int CvePACCancelacion = GvRow.DataKey("CvePAC").ToEntero();
int CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero();
int CveEntregaAlmacen = GvRow.DataKey("CveEntregaAlmacen").ToEntero();
Timbrado ObjCancelacion = new Timbrado();
ClsGenerales ObjGenerales = new ClsGenerales();
ObjGenerales.IniciaTransacSQL ();
if (EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptor))
{
@@ -528,22 +531,27 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, DateTime.Now, CvePACCancelacion, ObjCancelacion.CancelacionAcuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
Alert("El complemento se cancelo correctamente.");
//regenero el tmbre
CveTimbre = ObjGenerales.AddGralTimbre("Tra", CveSubProyecto, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen : CveEntregaAlmacen, AplicaCP: true);
ProcesoOK = true;
}
}
else
{
Alert("Se presento un error al cancelar el Folio Fiscal", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
}
ObjGenerales.Dispose();
if (ProcesoOK)
{
CargaDatos();
ObjGenerales.Commit();
Alert("El complemento se cancelo correctamente.");
}
else
{
ObjGenerales.RollBack();
Alert("Se presento un error al cancelar el Folio Fiscal", ModExtensiones.TipoMensaje.MsgAdvertencia);
}
ObjGenerales.Dispose();
}
@@ -622,11 +630,11 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
LnkTimbrar.Visible = true;
}
if (e.Row.DataKey("TimbreTipoDocto") == "Man")
{
e.Row.FCLinkButton("LnkEditarDirOrigen").Visible = true;
e.Row.FCLinkButton("LnkEditarDirDestino").Visible = true;
}
//if (e.Row.DataKey("TimbreTipoDocto") == "Man")
//{
// e.Row.FCLinkButton("LnkEditarDirOrigen").Visible = true;
// e.Row.FCLinkButton("LnkEditarDirDestino").Visible = true;
//}
if (e.Row.DataKey("Estatus").ToEntero() == 1)
{

View File

@@ -1126,7 +1126,7 @@ Partial Class Inventarios_ResguardoMaterial
Private Sub DdlAlmacenDestinoLiberacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAlmacenDestinoLiberacion.SelectedIndexChanged
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenDestinoLiberacion.selectedvalue.toentero).FiltroPrimeroValor("CveSubProyecto").ToEntero
'RMF condición temporal
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
ValidaLoteCaducidad = True
Else
ValidaLoteCaducidad = False

View File

@@ -593,14 +593,14 @@ Partial Class Inventarios_TraspasoAlmacen
'codigo provisional.
Dim CveSubP As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
If DrPS("AplicaCaducidad").ToString = "True" AndAlso CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
If DrPS("AplicaCaducidad").ToString = "True" AndAlso CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
If Not ChkSugiereFechaCaducidad.Checked AndAlso (TxtnFechaCaducidad.Text = "" OrElse TxtnLote.Text = "") Then
Alert("Falta Especificar lote/Fecha del producto", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If DrPS("AplicaCaducidad").ToString = "True" AndAlso ChkSugiereFechaCaducidad.Checked And CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
If DrPS("AplicaCaducidad").ToString = "True" AndAlso ChkSugiereFechaCaducidad.Checked And CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetExistenciasCaducidad(CveProducto, DdlAlmacenOrigen.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue) Then
@@ -637,7 +637,7 @@ Partial Class Inventarios_TraspasoAlmacen
tLote = If(TxtnLote.Visible, TxtnLote.Text, "-1")
tCaducidad = If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha)
If Not CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
If Not CveSubP.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
tLote = "-1"
tCaducidad = MinFecha
End If
@@ -2163,7 +2163,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim tSerie As String = gvr.FCTextBox("TxtSerie").Text 'gvr.DataKey("Serie").ToString
Dim tFechaCaducidad As Date = gvr.DataKey("FechaCaducidad").ToDate
If CveSubProyectoRecibe.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347)) Then
If CveSubProyectoRecibe.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
tLote = gvr.FCTextBox("TxtLote").Text
tFechaCaducidad = gvr.FCTextBox("TxtCaducidad").Text.ToDate
End If

View File

@@ -4,6 +4,10 @@
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.GvAsistenciaDiv .ADScroller-header {
overflow: visible;
}
.fa-ad-pdf.fa::before {
background: #999;
content: "\f1c1";
@@ -119,9 +123,11 @@
table.GvConceptos td {
white-space: nowrap;
}
.Gvbitacora tr td:nth-child(1){
.Gvbitacora tr td:nth-child(1) {
white-space: nowrap;
}
.GvConceptos td, .Gvbitacora td {
font-size: 11px;
padding-top: 2px;
@@ -196,7 +202,7 @@
<asp:LinkButton ID="LnkTimbrarTodos" Visible="false" OnClick="LnkTimbrarTodos_Click" runat="server"><i class="fa fa-bell"></i> Timbrar todos</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkRegistrarProvision" Visible="false" OnClick="LnkRegistrarProvision_Click" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea registrar provisión?" data-btn-ok-label="si" ><i class="fa fa-thumbs-up" aria-hidden="true" ></i>Registrar provisión</asp:LinkButton>
<asp:LinkButton ID="LnkRegistrarProvision" Visible="false" OnClick="LnkRegistrarProvision_Click" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea registrar provisión?" data-btn-ok-label="si"><i class="fa fa-thumbs-up" aria-hidden="true" ></i>Registrar provisión</asp:LinkButton>
</li>
<li>
<asp:HyperLink ID="LnkProvisionNomina" Visible="false" runat="server"><i class="fa fa-eye"></i>Ver provisión</asp:HyperLink>
@@ -711,7 +717,7 @@
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:Button ID="BtnImprimirsobrereciboSimula" OnClick="BtnImprimirsobrereciboSimula_Click" UseSubmitBehavior="false" runat="server" Text="Imprimir" CssClass="btn btn-primary hidden" />
<asp:Button ID="BtnImprimirsobrerecibo" OnClick="BtnImprimirsobrerecibo_Click" UseSubmitBehavior="false" runat="server" Text="Imprimir" CssClass="btn btn-primary hidden" />
@@ -734,6 +740,11 @@
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
</div>
<div class="actions">
<div class="btn-group">
<asp:LinkButton ID="LnkRecalcular" OnClick="LnkRecalcular_Click" CssClass="btn yellow-gold" runat="server">Recalcular</asp:LinkButton>
</div>
</div>
</div>
<div class="portlet-body " style="padding: 0px;">
<div class="row">
@@ -859,7 +870,7 @@
<li>
<asp:LinkButton ID="LnkCalculoHorasExtras" OnClick="LnkCalculoHorasExtras_Click" Text="<i class='icon-bulb'></i> Calculo horas extras" runat="server"></asp:LinkButton>
</li>
<%-- <li>
<%-- <li>
<asp:LinkButton ID="LnkCalculoSubsidio" OnClick="LnkCalculoSubsidio_Click" Text="<i class='icon-bulb'></i> Calculo Subsidio" runat="server"></asp:LinkButton>
</li>
<li>
@@ -945,7 +956,7 @@
<Columns>
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng","{0:dd-MM-yyyy}") %>'/>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng","{0:dd-MM-yyyy}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Descripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
@@ -1318,29 +1329,29 @@
CssClass="table table-striped table-advance table-hover Widthall ScrollAD GvVacaciones" data-sort="true" data-height="300" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False" OnRowDataBound="GvVacaciones_RowDataBound">
<Columns>
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Fecha ingreso" />
<asp:BoundField DataField="Ejercicio" HeaderText="Ejercicio" />
<asp:TemplateField HeaderText="Periodo">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("FechaInicio", "{0:dd/MM/yyyy}")%>'> </asp:Label>-
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Fecha ingreso" />
<asp:BoundField DataField="Ejercicio" HeaderText="Ejercicio" />
<asp:TemplateField HeaderText="Periodo">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("FechaInicio", "{0:dd/MM/yyyy}")%>'> </asp:Label>-
<asp:Label runat="server" Text='<%# Eval("FechaFin", "{0:dd/MM/yyyy}")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaPago" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Fecha pago" />
<asp:BoundField DataField="diasinhabiles" HeaderText="Días feriados" />
<asp:BoundField DataField="TipoPago" HeaderText="Tipo pago" />
<asp:BoundField DataField="DiasextraAutorizado" HeaderText="Días extra" />
<asp:BoundField DataField="diasPago" HeaderText="Días pago" />
<asp:TemplateField HeaderText="Aplica prima">
<ItemTemplate>
<asp:Label runat="server" Text='<%# ((Eval("AplicaPrima").ToString() == "1" || Eval("AplicaPrima").ToString().ToUpper() == "TRUE") ? "Sí": "No") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cobro IMSS">
<ItemTemplate>
<asp:Label runat="server" Text='<%# ((Eval("CobrarIMSS").ToString() == "1" || Eval("CobrarIMSS").ToString().ToUpper() == "TRUE") ? "Sí": "No") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FechaPago" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Fecha pago" />
<asp:BoundField DataField="diasinhabiles" HeaderText="Días feriados" />
<asp:BoundField DataField="TipoPago" HeaderText="Tipo pago" />
<asp:BoundField DataField="DiasextraAutorizado" HeaderText="Días extra" />
<asp:BoundField DataField="diasPago" HeaderText="Días pago" />
<asp:TemplateField HeaderText="Aplica prima">
<ItemTemplate>
<asp:Label runat="server" Text='<%# ((Eval("AplicaPrima").ToString() == "1" || Eval("AplicaPrima").ToString().ToUpper() == "TRUE") ? "Sí": "No") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cobro IMSS">
<ItemTemplate>
<asp:Label runat="server" Text='<%# ((Eval("CobrarIMSS").ToString() == "1" || Eval("CobrarIMSS").ToString().ToUpper() == "TRUE") ? "Sí": "No") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField Visible="true" DataField="Periodo" HeaderText="Periodo" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField Visible="true" DataField="Dias" HeaderText="Días" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField Visible="true" DataField="FechaPago" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Fecha pago" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center" />
@@ -1766,6 +1777,207 @@
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabAsistenciasr" runat="server" HeaderText="Asistencia">
<ContentTemplate>
<div class="portlet light xspadding bordered " id="pnlasistencia">
<div class="portlet-title">
<div class="caption ">
<i class="icon-pin font-yellow-gold"></i>
<span class="caption-subject font-yellow-gold bold uppercase">Registros de asistencias</span>
</div>
<div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
<a href="javascript:;" class="fullscreen" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body GvAsistenciaDiv" style="padding: 0px;">
<table class="table table-striped table-hover Widthall" id="GvAsistenciaHeader">
<tr class="Titulos">
<th style="width: 120px">
<asp:LinkButton ID="LbFechaAsistencia" runat="server" CausesValidation="false" Text="Fecha" CommandArgument="" OnClick="LbOrden_Click"></asp:LinkButton>
</th>
<th style="width: 180px">
<asp:LinkButton ID="LbClienteAsistencia" runat="server" CausesValidation="false" Text="Cliente" CommandArgument="Cliente1;1" OnClick="LbOrden_Click">
<asp:Literal ID="ImgCliente1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th style="width: 110px">
<asp:LinkButton ID="LbProyectoAsistencia" runat="server" CausesValidation="false" Text="Proyecto" CommandArgument="Proyecto1;1" OnClick="LbOrden_Click">
<asp:Literal ID="ImgProyecto1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th style="width: 110px">
<asp:LinkButton ID="LbSubProyectoAsistencia" runat="server" CausesValidation="false" Text="Sub Proyecto" CommandArgument="SubProyecto1;1" OnClick="LbOrden_Click">
<asp:Literal ID="ImgSubProyecto1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th style="width: 70px;">
<asp:LinkButton ID="LbTipoAsistencia" runat="server" CausesValidation="false" Text="Asistencia" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton>
</th>
<th style="width: 50px;">
<asp:LinkButton ID="LbPorPagoAsistencia" runat="server" CausesValidation="false" Text="% Pago" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton>
</th>
<th style="width: 56px;">
<asp:LinkButton ID="LbHorasDoblesAsistencia" runat="server" CausesValidation="false" Text="Hrs Dob." CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton>
</th>
<th style="width: 56px;">
<asp:LinkButton ID="LbHorasTriplesAsistencia" runat="server" CausesValidation="false" Text="Hrs Trip." CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton>
</th>
<th style="width: 110px;">
<asp:LinkButton ID="LbMotivosHorasExtrasAsistencia" runat="server" CausesValidation="false" Text="Motivos H. Extras" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton>
</th>
<th style="width: 30px;">
<asp:LinkButton ID="LbObservacionesAsistencia" runat="server" CausesValidation="false" Text="Obs." CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton>
</th>
<th style="text-align: center;" width="8px">Comandos</th>
</tr>
<tr>
<td>
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="min-width: 100px; max-width: 200px;">
<asp:TextBox ID="TxtFechaAsistencia" runat="server" CausesValidation="true" CssClass="form-control input-sm"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAsistencia" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaAsistencia" runat="server" TargetControlID="TxtFechaAsistencia" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarioAsistencia" TargetControlID="TxtFechaAsistencia" PopupButtonID="ImgCalendarioAsistencia" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaAsistencia" runat="server" ControlToValidate="TxtFechaAsistencia" Display="None" ErrorMessage="El campo <b>''Fecha Asistencia''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GuardaAsistencia"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaAsistencia" runat="server" ControlToValidate="TxtFechaAsistencia" Display="None" ErrorMessage="El campo <b>''Fecha Asistencia''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GuardaAsistencia"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaAsistencia1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaAsistencia" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaAsistencia2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaAsistencia" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<ADS:Dropdownlost CssClassDdl="form-control input-sm select2me" ID="DdlClienteAsistenciaA" Width="100%" data-metodo="getcliente" runat="server" DataTextField="Nombre" DataValueField="CveCliente" UsaWebService="true" CssStyle="width: 100%;"></ADS:Dropdownlost>
</td>
<td>
<asp:DropDownList Width="100%" ID="DdlProyectoAsistenciaA" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;" ValidationGroup="GrpGuardarAsistencia">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:DropDownList Width="100%" ID="DdlSubProyectoAsistenciasA" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 80px !important;" ValidationGroup="GrpGuardarAsistencia">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:DropDownList Width="100%" ID="DdlTipoAsistenciasB" runat="server" DataTextField="Tipo" DataValueField="CveAsistenciasInasistencias" CssClass="table-group-action-input form-control input-inline input-small input-sm" Style="width: 70px !important;" ValidationGroup="GrpGuardarAsistencia"
AutoPostBack="true" OnSelectedIndexChanged="DdlTipoAsistencias_SelectedIndexChanged">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox CssClass="form-control input-sm" ID="TextBox1" runat="server" MaxLength="3" Text="100" Width="44px"></asp:TextBox></td>
<td>
<asp:TextBox CssClass="form-control input-sm" ID="TextBox2" runat="server" MaxLength="3" Text="0" Width="50px"></asp:TextBox></td>
<td>
<asp:TextBox CssClass="form-control input-sm" ID="TextBox3" runat="server" MaxLength="3" Text="0" Width="50px"></asp:TextBox></td>
<td>
<asp:DropDownList Width="100%" ID="DropDownList2" runat="server" AppendDataBoundItems="true" DataTextField="MotivoHoraExtra" DataValueField="CveMotivoHoraExtra" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 110px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox CssClass="form-control input-sm" ID="TextBox4" runat="server" Width="84px" MaxLength="150"></asp:TextBox></td>
<td>
<asp:LinkButton ID="LbGuardarAsistencia" OnClick="LbGuardarAsistencia_Click" runat="server" CausesValidation="true" CssClass=" btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarAsistencia" />
</td>
</tr>
</table>
<asp:GridView ID="GVAsistencia" runat="server" AutoGenerateColumns="false" DataKeyNames="CvePersonal,CveAsistencia" ShowHeader="false"
data-heighterror="550" OnRowDataBound="GVAsistencia_RowDataBound"
EmptyDataText="No se encontraron registros de Asistencias con los filtros seleccionados" ToolTip="Listado de Asistencias" data-rows="0"
CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-tableheader="#GvAsistenciaHeader" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Cliente</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCliente" runat="server" Text='<%# Eval("Cliente") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Proyecto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlProyecto" runat="server" Text='<%# Eval("Proyecto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Sub Proyecto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Asistencia</HeaderTemplate>
<ItemTemplate>
<asp:DropDownList ID="DdlTipoAsistencias" runat="server" TabIndex="2" DataTextField="Tipo" DataValueField="CveAsistenciasInasistencias" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 70px !important;"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>% Pago</HeaderTemplate>
<ItemTemplate>
<asp:TextBox CssClass="form-control" ID="TxtPorPago" TabIndex="1" runat="server" MaxLength="3" Text="100" Width="44px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Hrs Dob.</HeaderTemplate>
<ItemTemplate>
<asp:TextBox CssClass="form-control" ID="TxtHorasDobles" TabIndex="1" runat="server" MaxLength="3" Text="0" Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Hrs Trip.</HeaderTemplate>
<ItemTemplate>
<asp:TextBox CssClass="form-control" ID="TxtHorasTriples" TabIndex="1" runat="server" MaxLength="3" Text="0" Width="50px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Motivo H. Extras</HeaderTemplate>
<ItemTemplate>
<asp:DropDownList ID="DdlMotivoHoraExtra" runat="server" TabIndex="2" AppendDataBoundItems="true" DataTextField="MotivoHoraExtra" DataValueField="CveMotivoHoraExtra" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 110px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Obs.</HeaderTemplate>
<ItemTemplate>
<asp:TextBox CssClass="form-control" ID="TxtObservaciones" TabIndex="3" runat="server" Width="84px" MaxLength="150"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" Visible="false">
<ItemTemplate>
<%--<asp:LinkButton ID="LnkEliminarAsistencia" OnClick="LnkEliminarAsistencia_Click" runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la asistencia?" data-btn-ok-label="si" />--%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
<div class="text-right">
<asp:Button ID="BtnGuardarAsistenciaCambios" OnClick="BtnGuardarAsistenciaCambios_Click" runat="server" Text="Guardar Cambios" class="btn btn-success pull-right" /><br />
</div>
<br />
<br />
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</div>
<div class="modal-footer">
@@ -1852,7 +2064,7 @@
</div>
<div id="ModalNominaPendiente" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog modal-lg" runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
<ContentTemplate>
@@ -1868,7 +2080,7 @@
<asp:GridView ID="GVNominaPendiente" runat="server" CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall GvNominas"
<asp:GridView ID="GVNominaPendiente" runat="server" CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall GvNominas"
Style="text-align: center;" GridLines="None" data-rows="2" data-heighterror="500" ShowHeaderWhenEmpty="true" ShowHeader="true" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField HeaderText="Código">
@@ -1881,16 +2093,16 @@
<asp:Label runat="server" Text='<%# Eval("NombreCompleto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Periodo" ItemStyle-CssClass="text-left">
<asp:TemplateField HeaderText="Periodo" ItemStyle-CssClass="text-left">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("PeriodoTexto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo" ItemStyle-CssClass="text-left">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("PeriodoTipe")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tipo" ItemStyle-CssClass="text-left">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("PeriodoTipe")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
@@ -1936,7 +2148,7 @@
<asp:Label runat="server" Text='<%# Eval("CodigoNombreCompleto")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Asignar a Concepto :" >
<asp:TemplateField HeaderText="Asignar a Concepto :">
<ItemTemplate>
<asp:DropDownList ID="DdlCconceptosContables" CssClass="form-control input-sm select2me select2me" runat="server" AppendDataBoundItems="true" DataTextField="ConceptoContable" DataValueField="CveConceptoContable"></asp:DropDownList>
</ItemTemplate>
@@ -2463,7 +2675,7 @@
</div>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TTVigSubEmpAnual" runat="server" HeaderText="Subsidio Anual" >
<ajax:TabPanel ID="TTVigSubEmpAnual" runat="server" HeaderText="Subsidio Anual">
<ContentTemplate>
<asp:GridView ID="GVVigSubEmpAnual" runat="server" CssClass="table table-striped table-hover mysmallbtn Widthall GvNominas" GridLines="None"></asp:GridView>
</ContentTemplate>
@@ -2810,7 +3022,7 @@
</div>
<div class="actions">
<div class="btn-group">
<a onclick="$('#C_BtnImprimirsobrereciboSimula').click()" class="btn yellow-gold">Imprimir</a>
<a onclick="$('#C_BtnImprimirsobrereciboSimula').click()" class="btn yellow-gold">Imprimir</a>
</div>
<div class="btn-group">
</div>
@@ -3540,7 +3752,7 @@
<div id="DModalProrrateo" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpModalProrrateo" class="modal-dialog" style="width:900px;" tabindex="-1" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UpModalProrrateo" class="modal-dialog" style="width: 900px;" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content rowpadding">
<div class="modal-header">
@@ -3550,7 +3762,7 @@
<h4 class="modal-title" runat="server" style="text-align: left">Prorrateo</h4>
</div>
<div class="modal-body">
<div class="portlet light bordered xspadding" id="portletprorrateo">
@@ -3559,13 +3771,13 @@
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Agregar prorrateo</span>
</div>
<div class="tools">
<a href="javascript:;" class="expand" data-original-title="" title=""></a>
<a href="javascript:;" class="expand" data-original-title="" title=""></a>
</div>
</div>
<div class="portlet-body" style="display:none">
<div class="form-group form-md-line-input input-iconright">
<div class="portlet-body" style="display: none">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPRPersonal" DataTextField="CodigoNombreCompleto" DataValueField="CvePersonal" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
@@ -3593,7 +3805,7 @@
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control " ID="TxtPorcentaje" runat="server" Text="0"></asp:TextBox>
<asp:TextBox CssClass="form-control " ID="TxtPorcentaje" runat="server" Text="0"></asp:TextBox>
<asp:Label runat="server" AssociatedControlID="TxtPorcentaje" Text="Porcentaje"></asp:Label>
</div>
<div class="text-right">
@@ -3676,7 +3888,7 @@
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<div id="ModalCancelarDocumento" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpCancelarDocumento" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
@@ -3696,7 +3908,7 @@
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVMotivoCancelacion" runat="server" CssClass="help-block errorimput" Display="Dynamic" InitialValue="-1" ControlToValidate="DdlMotivoCancelacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalCancelarDocumento"></asp:RequiredFieldValidator>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel ID="UpFooterCancelarRemision" runat="server" UpdateMode="Conditional">

View File

@@ -460,8 +460,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
int CvePrePolizaProrrateo = drow["CvePrePolizaProrrateo"].ToString().ToEntero();
FechaInicioPeriodo = (DateTime)dtPeriodo.Rows[0]["FechaInicio"];
FechaFinPeriodo = (DateTime)dtPeriodo.Rows[0]["FechaFin"];
FechaInicioPeriodo = drow["FechaInicio"].ToString().ToDateTime();
FechaFinPeriodo = drow["FechaFin"].ToString().ToDateTime();
//LnkConceptoEmpleado.Visible = (Estatus == 1);
LnkRegistrarProvision.Visible = (Estatus >= 2);//&& (CvePrePolizaProvision <= 0 || UsuarioActual.CveUsuario == 100);
@@ -1811,6 +1811,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
LblEmpleado.Text = Nombre;
LblEmpleado.NavigateUrl = string.Format("/RH/Personal.aspx?CvePersonal={0}", SRCvePersonal);
TabPersonal.ActiveTabIndex = 0;
DdlTipoAsistenciasB.DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa);
DdlTipoAsistenciasB.DataBind();
cargaasistenciaSR();
mostrarConceptos();
CargaVacaciones();
pnlAddupMovto.Visible = false;
@@ -1818,6 +1821,179 @@ public partial class Nomina_Nomina2 : ClsPaginas
CargaPersonalIncapacidad();
RegistraScript("$('#ModalConceptos').modal();");
}
#region Asistencias
protected void LnkRecalcular_Click(object sender, EventArgs e)
{
cargaDatos();
cargaBitacora();
cargasobrericiboconceptos();
UpModalConceptos.Update();
}
protected void cargaasistenciaSR(string orden = "")
{
using (ClsRH objpersonal = new ClsRH())
{
if (objpersonal.GetAsistencias(SRCvePersonal, -1, -1, -1, -1,-1, FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.CveEmpresa))
{ GVAsistencia.DataSource = objpersonal.DtResultados.FiltraParametros("Fecha IS NOT NULL"); }
else{
GVAsistencia.DataSource = null;
}
}
GVAsistencia.DataBind();
}
protected void LbOrden_Click(object sender, EventArgs e)
{
string Orden = "";
string Campo = "";
int gvi = 0;
Literal Literal = null/* TODO Change to default(_) if this is not a reference type */;
const string OrdenInicial = "";
string[] Arg = new string[3];
Arg = ((LinkButton)sender).CommandArgument.Split(';');
Campo = Arg[0];
gvi = Arg[1].ToEntero();
Literal = (Literal)((LinkButton)sender).NamingContainer.FindControl("Img" + Campo.Replace(",", "_"));
Campo = Campo.Substring(0, Campo.Length - 1);
if (ViewState[string.Format("O{0}", Campo, gvi)] != null && ViewState[string.Format("O{0}", Campo, gvi)].ToString() == string.Format("{0} DESC", Campo))
{
ViewState[string.Format("O{0}", Campo)] = string.Format("{0} ASC", Campo);
Literal.Text = string.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>");
}
else
{
ViewState[string.Format("O{0}", Campo, gvi)] = string.Format("{0} DESC", Campo);
Literal.Text = string.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>");
}
Orden = OrdenInicial + ViewState[string.Format("O{0}", Campo, gvi)].ToString();
ViewState["Orden"] = Orden;
cargaasistenciaSR(Orden);
}
protected void DdlTipoAsistencias_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddl = (DropDownList)sender;
GridViewRow gvrow = (GridViewRow)ddl.NamingContainer;
if (ddl.SelectedItem.Text == "Retardo")
gvrow.FCTextBox("TxtPorPago").Text = "87.5";
}
protected void LbGuardarAsistencia_Click(object sender, EventArgs e)
{
bool continuar = false;
using (ClsRH ObjPersonal = new ClsRH())
{
if (ObjPersonal.AddAsistencia(SRCvePersonal, -2, -2, TxtFechaAsistencia.Text.Trim().ToDate(),
DdlTipoAsistenciasB.SelectedValue.ToEntero(), TxtPorPago.Text.Trim().ToDouble(), TxtHorasDobles.Text.Trim().ToDouble(),
TxtHorasTriples.Text.Trim().ToDouble(), DdlMotivoHoraExtra.SelectedValue.ToEntero(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
Alert("La Asistencia se guardó correctamente.", TipoMensaje.MsgInformacion);
continuar = true;
}
}
if (continuar)
{
cargaasistenciaSR();
LnkRecalcular_Click(null, null);
}
}
protected void BtnGuardarAsistenciaCambios_Click(object sender, EventArgs e)
{
bool continuar = false;
using (ClsRH ObjPersonal = new ClsRH())
{
ObjPersonal.IniciaTransacSQL();
bool OcurrioError = false;
foreach (GridViewRow Row in GVAsistencia.Rows)
{
if (!ObjPersonal.AddAsistencia(SRCvePersonal, -2,-2, Row.FCLiteral("LtlFecha").Text.Trim().ToDate(),
Row.FCDropDownList("DdlTipoAsistencias").SelectedValue.ToEntero(),
Row.FCTextBox("TxtPorPago").Text.Trim().ToDouble(),
Row.FCTextBox("TxtHorasDobles").Text.Trim().ToDouble(), Row.FCTextBox("TxtHorasTriples").Text.Trim().ToDouble(),
Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue.ToEntero(), Row.FCTextBox("TxtObservaciones").Text.Trim(),
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
OcurrioError = true;
break;
}
}
if (OcurrioError)
{
ObjPersonal.RollBack();
Alert("Ocurrió un error al guardar las Asistencias.", TipoMensaje.MsgError);
}
else
{
ObjPersonal.Commit();
continuar = true;
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion);
}
}
if (continuar)
{
cargaasistenciaSR();
LnkRecalcular_Click(null, null);
}
}
protected void GVAsistencia_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[1].HorizontalAlign = HorizontalAlign.Left;
e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Left;
e.Row.Cells[3].HorizontalAlign = HorizontalAlign.Left;
//if ((e.Row.DBCampo("Fecha")))
e.Row.FCLiteral("LtlFecha").Text = e.Row.DBCampo("Fecha").ToDate().ToShortDateString();
if (e.Row.FCLiteral("LtlCliente").Text != "N/A")
e.Row.FCLiteral("LtlCliente").Text = "<a class=\"Texto\" href=\"/Ventas/Clientes.aspx?CveCliente=" + e.Row.DBCampo("CveCliente") + "\">" + e.Row.DBCampo("Cliente") + "</a>";
e.Row.FCTextBox("TxtPorPago").Text = e.Row.DBCampo("PorcentajePago");
e.Row.FCTextBox("TxtHorasDobles").Text = e.Row.DBCampo("HorasDobles");
e.Row.FCTextBox("TxtHorasTriples").Text = e.Row.DBCampo("HorasTriples");
// Carga Tipos de Asistencia
e.Row.FCDropDownList("DdlTipoAsistencias").DataSource = GlobalDTAsistenciasInasistencias.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa);
e.Row.FCDropDownList("DdlTipoAsistencias").DataBind();
if (e.Row.DBCampo("CveAsistenciasInasistencias") != "-1")
e.Row.FCDropDownList("DdlTipoAsistencias").SelectedValue = e.Row.DBCampo("CveAsistenciasInasistencias");
// Carga Motivos Horas Extras
e.Row.FCDropDownList("DdlMotivoHoraExtra").DataSource = GlobalDTMotivosHorasExtras.FiltraParametros("CveEmpresa = " + UsuarioActual.CveEmpresa);
e.Row.FCDropDownList("DdlMotivoHoraExtra").DataBind();
if (e.Row.DBCampo("CveMotivoHoraExtra") != "-1")
e.Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue = e.Row.DBCampo("CveMotivoHoraExtra");
e.Row.FCTextBox("TxtObservaciones").Text = e.Row.DBCampo("Observacion");
if (e.Row.DBCampo("SeModifico") == "0")
{
e.Row.Cells[0].BackColor = System.Drawing.Color.LightBlue;
e.Row.Cells[1].BackColor = System.Drawing.Color.LightBlue;
e.Row.Cells[2].BackColor = System.Drawing.Color.LightBlue;
e.Row.Cells[3].BackColor = System.Drawing.Color.LightBlue;
}
else if (e.Row.DBCampo("SeModifico") == "1")
{
e.Row.Cells[0].ForeColor = System.Drawing.Color.Red;
e.Row.Cells[1].ForeColor = System.Drawing.Color.Red;
e.Row.Cells[2].ForeColor = System.Drawing.Color.Red;
e.Row.Cells[3].ForeColor = System.Drawing.Color.Red;
}
}
}
#endregion
#region "CalculosSistema"
private void showModalCalculo()
{
@@ -7780,4 +7956,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
UpModalProrrateo.Update();
}
}

View File

@@ -603,7 +603,7 @@ Partial Class OC_CatEstatus
'Guardado masivo cuando sea SubProyecto "Todos"
If CveSubProyecto = -2 Then
For Each dr As DataRow In GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).Rows
If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, dr("CveSubProyecto").ToString.ToEntero, Row.DataKey("CveUsuario").ToString.ToEntero, True) Then
If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, dr("CveSubProyecto").ToString.ToEntero, Row.DataKey("CveUsuario").ToString.ToEntero, True, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
HuboErrores = True
Exit For
End If
@@ -669,7 +669,7 @@ Partial Class OC_CatEstatus
'Guardado masivo cuando sea SubProyecto "Todos"
If CveSubProyecto = -2 Then
For Each dr As DataRow In GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).Rows
If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, dr("CveSubProyecto").ToString.ToEntero, Row.DataKey("CveUsuario").ToString.ToEntero, True) Then
If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, dr("CveSubProyecto").ToString.ToEntero, Row.DataKey("CveUsuario").ToString.ToEntero, True, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
HuboErrores = True
Exit For
End If
@@ -680,7 +680,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

View File

@@ -1927,46 +1927,46 @@
<table class="table table-striped table-hover Widthall" id="GvAsistenciaHeader">
<%--<thead>--%>
<tr class="Titulos">
<th width="120px">
<asp:LinkButton ID="LbFechaAsistencia" runat="server" CausesValidation="false" Text="Fecha" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="180px">
<th style="width:120px">
<asp:LinkButton ID="LbFechaAsistencia" runat="server" CausesValidation="false" Text="Fecha" CommandArgument="" OnClick="LbOrden_Click"></asp:LinkButton>
</th>
<th style="width:180px">
<asp:LinkButton ID="LbClienteAsistencia" runat="server" CausesValidation="false" Text="Cliente" CommandArgument="Cliente1;1" OnClick="LbOrden_Click">
<asp:Literal ID="ImgCliente1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="110px">
</asp:LinkButton>
</th>
<th style="width:110px">
<asp:LinkButton ID="LbProyectoAsistencia" runat="server" CausesValidation="false" Text="Proyecto" CommandArgument="Proyecto1;1" OnClick="LbOrden_Click">
<asp:Literal ID="ImgProyecto1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="110px">
<th style="width:110px">
<asp:LinkButton ID="LbSubProyectoAsistencia" runat="server" CausesValidation="false" Text="Sub Proyecto" CommandArgument="SubProyecto1;1" OnClick="LbOrden_Click">
<asp:Literal ID="ImgSubProyecto1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton></th>
<th width="70px">
<th style="width:70px;">
<asp:LinkButton ID="LbTipoAsistencia" runat="server" CausesValidation="false" Text="Asistencia" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="50px">
</asp:LinkButton>
</th>
<th style="width:50px;">
<asp:LinkButton ID="LbPorPagoAsistencia" runat="server" CausesValidation="false" Text="% Pago" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="56px">
</asp:LinkButton>
</th>
<th style="width:56px;">
<asp:LinkButton ID="LbHorasDoblesAsistencia" runat="server" CausesValidation="false" Text="Hrs Dob." CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="56px">
</asp:LinkButton>
</th>
<th style="width:56px;">
<asp:LinkButton ID="LbHorasTriplesAsistencia" runat="server" CausesValidation="false" Text="Hrs Trip." CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="110px">
</asp:LinkButton>
</th>
<th style="width:110px;">
<asp:LinkButton ID="LbMotivosHorasExtrasAsistencia" runat="server" CausesValidation="false" Text="Motivos H. Extras" CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
<th width="30px">
</asp:LinkButton>
</th>
<th style="width:30px;">
<asp:LinkButton ID="LbObservacionesAsistencia" runat="server" CausesValidation="false" Text="Obs." CommandArgument="" OnClick="LbOrden_Click">
</asp:LinkButton></th>
</asp:LinkButton>
</th>
<th style="text-align: center;" width="8px">Comandos</th>
</tr>
<%--</thead>--%>
@@ -1986,11 +1986,8 @@
<ajax:ValidatorCalloutExtender ID="VCOFechaAsistencia2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaAsistencia" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<ADS:Dropdownlost CssClassDdl="form-control input-sm select2me" ID="DdlClienteAsistenciaA" Width="100%" data-metodo="getcliente" runat="server" DataTextField="Nombre" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
<ADS:Dropdownlost CssClassDdl="form-control input-sm select2me" ID="DdlClienteAsistenciaA" Width="100%" data-metodo="getcliente" runat="server" DataTextField="Nombre" DataValueField="CveCliente" UsaWebService="true" CssStyle="width: 100%;"></ADS:Dropdownlost>
<%--<asp:DropDownList Width="100%" ID="DdlClienteAsistenciaA" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="CveCliente" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 180px !important;" ValidationGroup="GrpGuardarAsistencia">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>--%>
</td>
<td>
<asp:DropDownList Width="100%" ID="DdlProyectoAsistenciaA" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;" ValidationGroup="GrpGuardarAsistencia">
@@ -2022,7 +2019,8 @@
<td>
<asp:TextBox CssClass="form-control input-sm" ID="TxtObservaciones" runat="server" Width="84px" MaxLength="150"></asp:TextBox></td>
<td>
<asp:LinkButton ID="LbGuardarAsistencia" runat="server" CausesValidation="true" CssClass=" btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarAsistencia" /></td>
<asp:LinkButton ID="LbGuardarAsistencia" runat="server" CausesValidation="true" CssClass=" btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarAsistencia" />
</td>
</tr>
</table>
<asp:GridView ID="GVAsistencia" runat="server" AutoGenerateColumns="false" DataKeyNames="CvePersonal,CveAsistencia" ShowHeader="false"

View File

@@ -1375,32 +1375,33 @@ Partial Class RH_Personal
End Sub
Protected Sub CargaGvAsistencias(Optional Orden As String = "")
Dim objpersonal As New ClsRH
Dim CveCliente As Integer = DdlClienteAsistenciaC.SelectedValue.ToEntero()
If CveCliente <= 0 Then
CveCliente = -1
End If
If objpersonal.GetAsistencias(CvePersonal, CveCliente, -1, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero(), DdlTurno.SelectedValue.ToEntero(), -1, txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim.ToDate, UsuarioActual.CveEmpresa) Then
GVAsistencia.DataSource = objpersonal.DtResultados.FiltraParametros("Fecha IS NOT NULL")
Else
GVAsistencia.DataSource = Nothing
End If
objpersonal.Dispose()
Using objpersonal As New ClsRH
Dim CveCliente As Integer = DdlClienteAsistenciaC.SelectedValue.ToEntero()
If CveCliente <= 0 Then
CveCliente = -1
End If
If objpersonal.GetAsistencias(CvePersonal, CveCliente, -1, DdlSubProyectoAsistenciasC.SelectedValue.ToEntero(), DdlTurno.SelectedValue.ToEntero(), -1, txtFechaI.Text.Trim.ToDate, txtFechaF.Text.Trim.ToDate, UsuarioActual.CveEmpresa) Then
GVAsistencia.DataSource = objpersonal.DtResultados.FiltraParametros("Fecha IS NOT NULL")
Else
GVAsistencia.DataSource = Nothing
End If
End Using
GVAsistencia.DataBind()
UpDatos.Update()
End Sub
Protected Sub LbGuardarAsistencia_Click(sender As Object, e As System.EventArgs) Handles LbGuardarAsistencia.Click
Dim ObjPersonal As New ClsRH()
If ObjPersonal.AddAsistencia(CvePersonal, DdlClienteAsistenciaA.SelectedValue.ToEntero(), DdlSubProyectoAsistenciasA.SelectedValue.ToEntero(), TxtFechaAsistencia.Text.Trim.ToDate,
Using ObjPersonal As New ClsRH()
If ObjPersonal.AddAsistencia(CvePersonal, DdlClienteAsistenciaA.SelectedValue.ToEntero(), DdlSubProyectoAsistenciasA.SelectedValue.ToEntero(), TxtFechaAsistencia.Text.Trim.ToDate,
DdlTipoAsistencias.SelectedValue.ToEntero(), TxtPorPago.Text.Trim.ToDouble, TxtHorasDobles.Text.Trim.ToDouble,
TxtHorasTriples.Text.Trim.ToDouble, DdlMotivoHoraExtra.SelectedValue.ToEntero(), TxtObservaciones.Text.Trim,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
BtnConsultarAsistencia_Click(sender, e)
End If
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
BtnConsultarAsistencia_Click(sender, e)
End If
ObjPersonal.Dispose()
End Using
End Sub
Protected Sub GVAsistencia_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAsistencia.RowDataBound
@@ -1445,29 +1446,30 @@ Partial Class RH_Personal
End Sub
Protected Sub BtnGuardarAsistenciaCambios_Click(sender As Object, e As System.EventArgs) Handles BtnGuardarAsistenciaCambios.Click
Dim ObjPersonal As New ClsRH()
ObjPersonal.IniciaTransacSQL()
Dim OcurrioError As Boolean = False
Using ObjPersonal As New ClsRH()
For Each Row As GridViewRow In GVAsistencia.Rows
If Not ObjPersonal.AddAsistencia(Row.DataKey("CvePersonal").ToEntero(), DdlClienteAsistenciaC.SelectedValue.ToEntero(), DdlSubProyectoAsistenciasC.SelectedValue.ToEntero(), Row.FCLiteral("LtlFecha").Text.Trim.ToDate,
Row.FCDropDownList("DdlTipoAsistencias").SelectedValue.ToEntero(), Row.FCTextBox("TxtPorPago").Text.Trim.ToDouble, Row.FCTextBox("TxtHorasDobles").Text.Trim.ToDouble,
Row.FCTextBox("TxtHorasTriples").Text.Trim.ToDouble, Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue.ToEntero(), Row.FCTextBox("TxtObservaciones").Text.Trim,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
OcurrioError = True
Exit For
ObjPersonal.IniciaTransacSQL()
Dim OcurrioError As Boolean = False
For Each Row As GridViewRow In GVAsistencia.Rows
If Not ObjPersonal.AddAsistencia(Row.DataKey("CvePersonal").ToEntero(), DdlClienteAsistenciaC.SelectedValue.ToEntero(), DdlSubProyectoAsistenciasC.SelectedValue.ToEntero(), Row.FCLiteral("LtlFecha").Text.Trim.ToDate,
Row.FCDropDownList("DdlTipoAsistencias").SelectedValue.ToEntero(), Row.FCTextBox("TxtPorPago").Text.Trim.ToDouble, Row.FCTextBox("TxtHorasDobles").Text.Trim.ToDouble,
Row.FCTextBox("TxtHorasTriples").Text.Trim.ToDouble, Row.FCDropDownList("DdlMotivoHoraExtra").SelectedValue.ToEntero(), Row.FCTextBox("TxtObservaciones").Text.Trim,
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
OcurrioError = True
Exit For
End If
Next
If OcurrioError Then
ObjPersonal.RollBack()
Alert("Ocurrió un error al guardar las Asistencias.", TipoMensaje.MsgError)
Else
ObjPersonal.Commit()
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
Next
If OcurrioError Then
ObjPersonal.RollBack()
Alert("Ocurrió un error al guardar las Asistencias.", TipoMensaje.MsgError)
Else
ObjPersonal.Commit()
Alert("Las Asistencias se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjPersonal.Dispose()
End Using
BtnConsultarAsistencia_Click(sender, e)
End Sub

View File

@@ -410,6 +410,12 @@