This commit is contained in:
2023-02-18 14:08:26 -07:00
23 changed files with 290 additions and 1534 deletions

View File

@@ -244,7 +244,7 @@
</ajax:TabContainer>--%>
<div id="DivAgregarFolioGarantia" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<div class="modal-dialog" style="width: 500px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalFolioGarantia" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
@@ -253,63 +253,76 @@
<asp:Literal ID="LtlTituloModalFolioGarantia" runat="server">Agregar Folio Garantia</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtFolioGarantia" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtFolioGarantia" runat="server" ControlToValidate="TxtFolioGarantia" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFolioGarantia"></asp:RequiredFieldValidator>
<label for="<%= TxtFolioGarantia.ClientID.ToString()%>">Folio:</label>
<i></i>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtFolioGarantia" CssClass="form-control" runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtFolioGarantia" runat="server" ControlToValidate="TxtFolioGarantia" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFolioGarantia"></asp:RequiredFieldValidator>
<label for="<%= TxtFolioGarantia.ClientID.ToString()%>">Folio:</label>
<i></i>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" style="padding-top:0px!important">
<asp:Label runat="server" ID="lblSubProyecto" for="<%= DdlSubProyectos.ClientID.ToString()%>">SubProyecto:</asp:Label></br>
<asp:DropDownList ID="DdlSubProyectos" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveSubProyecto" DataTextField="SubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Width="100%" AutoPostBack="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVProducto2" InitialValue="-1" runat="server" ControlToValidate="DdlSubProyectos" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFolioGarantia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEProducto2" runat="server" HighlightCssClass="vco" TargetControlID="RFVProducto2" Width="300px"></ajax:ValidatorCalloutExtender>
<i></i>
</div>
</div>
</div>
<%--<br />--%>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="lblSubProyecto" for="<%= DdlSubProyectos.ClientID.ToString()%>">SubProyecto:</asp:Label></br>
<asp:DropDownList ID="DdlSubProyectos" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveSubProyecto" DataTextField="SubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Width="50%" AutoPostBack="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVProducto2" InitialValue="-1" runat="server" ControlToValidate="DdlSubProyectos" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFolioGarantia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEProducto2" runat="server" HighlightCssClass="vco" TargetControlID="RFVProducto2" Width="300px"></ajax:ValidatorCalloutExtender>
<i></i>
</div>
<%--<br />--%>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="LblTipoFolio" for="<%= DdlTipoFolioModal.ClientID.ToString()%>">Tipo Folio:</asp:Label></br>
<asp:DropDownList ID="DdlTipoFolioModal" runat="server" CssClass="form-control input-sm select2me" Width="50%" ValidationGroup="GrpGuardar">
<asp:ListItem Value="general" Selected="True">General</asp:ListItem>
<asp:ListItem Value="optima">Optima</asp:ListItem>
<asp:ListItem Value="motobateria">Motobateria</asp:ListItem>
</asp:DropDownList>
<i></i>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="LblArea" for="<%= DdlArea.ClientID.ToString()%>">Área:</asp:Label></br>
<asp:DropDownList ID="DdlArea" runat="server" CssClass="form-control input-sm select2me" Width="50%" ValidationGroup="GrpGuardar">
<asp:ListItem Value="1" Selected="True">Piso</asp:ListItem>
<asp:ListItem Value="2">Almacén</asp:ListItem>
</asp:DropDownList>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= DdlEstatusEditar.ClientID.ToString()%>" style="margin-bottom:0px">Estatus:</label></br>
<asp:DropDownList ID="DdlEstatusEditar" runat="server" CssClass="select2me" Width="100px" ValidationGroup="GrpGuardar">
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Activo" Value="1"></asp:ListItem>
<asp:ListItem Text="Inactivo" Value="0"></asp:ListItem>
<asp:ListItem Text="Enviado" Value="2"></asp:ListItem>
</asp:DropDownList>
<i></i>
</div>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="<%= DdlEstatusEditar.ClientID.ToString()%>">Estatus:</label>
<asp:DropDownList ID="DdlEstatusEditar" runat="server" CssClass="select2me" Width="100px" ValidationGroup="GrpGuardar">
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Activo" Value="1"></asp:ListItem>
<asp:ListItem Text="Inactivo" Value="0"></asp:ListItem>
<asp:ListItem Text="Enviado" Value="2"></asp:ListItem>
</asp:DropDownList>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="LblTipoFolio" for="<%= DdlTipoFolioModal.ClientID.ToString()%>">Tipo Folio:</asp:Label></br>
<asp:DropDownList ID="DdlTipoFolioModal" runat="server" CssClass="form-control input-sm select2me" Width="50%" ValidationGroup="GrpGuardar">
<asp:ListItem Value="general" Selected="True">General</asp:ListItem>
<asp:ListItem Value="optima">Optima</asp:ListItem>
<asp:ListItem Value="motobateria">Motobateria</asp:ListItem>
</asp:DropDownList>
<i></i>
</div>
<%--<br />--%>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtLimite" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvLimite" runat="server" ControlToValidate="TxtLimite" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFolioGarantia"></asp:RequiredFieldValidator>
<label for="<%= TxtLimite.ClientID.ToString()%>">Límite:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="LblArea" for="<%= DdlArea.ClientID.ToString()%>">Área:</asp:Label></br>
<asp:DropDownList ID="DdlArea" runat="server" CssClass="form-control input-sm select2me" Width="50%" ValidationGroup="GrpGuardar">
<asp:ListItem Value="1" Selected="True">Piso</asp:ListItem>
<asp:ListItem Value="2">Almacén</asp:ListItem>
</asp:DropDownList>
<i></i>
<%--<br />--%>
<div class="col-md-6">
</br>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtLimite" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvLimite" runat="server" ControlToValidate="TxtLimite" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Folio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFolioGarantia"></asp:RequiredFieldValidator>
<label for="<%= TxtLimite.ClientID.ToString()%>">Límite:</label>
<i></i>
</div>
</div>
</div>
<%-- <div class="form-group form-md-line-input input-iconright" style="width: 170px!important">
<asp:TextBox ID="TxtCargo" CssClass="form-control " Width="150px" runat="server" MaxLength="10" CausesValidation="true" Style="text-align: right!important; margin-right: 10px!important" OnKeyup="FormatoMoneda(this);"></asp:TextBox>

View File

@@ -1649,7 +1649,7 @@ Public Class ClsOC
FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuarioRegistro As Integer, CveUsuario As Integer,
CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1",
Optional CveActivoFijo As Integer = -1, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1,
Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean
Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveMoneda As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraRep")
@@ -1678,6 +1678,7 @@ Public Class ClsOC
.Add("@CveUsuarioAsignado", SqlDbType.Int).Value = CveUsuarioAsignado
.Add("@EntregaDirecta", SqlDbType.Int).Value = EntregaDirecta
.Add("@TopSelect", SqlDbType.Int).Value = TopSelect
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
End With

View File

@@ -101,33 +101,33 @@ Public Class ClsPaginas
#End Region
#Region "GlobalDTs"
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Public Shared Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
Else
Application("GlobalTipoCambio") = 0
HttpContext.Current.Application("GlobalTipoCambio") = 0
End If
ObjGral.Dispose()
End If
Return Application("GlobalTipoCambio").ToString.ToDouble
Return HttpContext.Current.Application("GlobalTipoCambio").ToString.ToDouble
End Get
Set(value As Double)
Application("GlobalTipoCambio") = value
HttpContext.Current.Application("GlobalTipoCambio") = value
End Set
End Property
Public ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As MTipoCambioFluctuacion
Public Shared ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As MTipoCambioFluctuacion
Get
If Application("GlobalTipoCambioUltimaFluctuacion") Is Nothing Then
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") Is Nothing Then
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambioUltimaFluctuacion(-1, Now) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Application("GlobalTipoCambioUltimaFluctuacion") = ObjGral.DtResultados.Copy()
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = ObjGral.DtResultados.Copy()
Else
Application("GlobalTipoCambioUltimaFluctuacion") = Nothing
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = Nothing
End If
ObjGral.Dispose()
End If
@@ -137,9 +137,9 @@ Public Class ClsPaginas
}
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
If Application("GlobalTipoCambioUltimaFluctuacion") IsNot Nothing Then
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") IsNot Nothing Then
Dim dr = DirectCast(Application("GlobalTipoCambioUltimaFluctuacion"), DataTable).FiltroPrimero(String.Format("Fecha < '{0}'", Fecha), Orderby:="Fecha DESC")
Dim dr = DirectCast(HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion"), DataTable).FiltroPrimero(String.Format("Fecha < '{0}'", Fecha), Orderby:="Fecha DESC")
If dr IsNot Nothing Then
fluctuacion.TCFluctuacion = dr("TCFluctuacion").ToString().ToDecimal()
fluctuacion.FechaFluctuacion = dr("FechaFluctuacion").ToString().ToDateTime()
@@ -423,25 +423,25 @@ Public Class ClsPaginas
Application(AppNombre) = value
End Set
End Property
Property GlobalDTGralEstados(ClaveSATPais As String, Optional CvePais As Integer = -1) As DataTable
Public Shared Property GlobalDTGralEstados(ClaveSATPais As String, Optional CvePais As Integer = -1) As DataTable
Get
Dim AppNombre As String = "GlobalDTGralEstados"
If Application(AppNombre) Is Nothing Then
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATEstado("-1") Then Application(AppNombre) = ObjGrales.DtResultados
If ObjGrales.GetSATEstado("-1") Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados
ObjGrales.Dispose()
End If
Dim Filtro As New StringBuilder
Filtro.Append(" 1 = 1 ")
If ClaveSATPais <> "-1" Then Filtro.AppendFormat(" AND ClaveSATPais = '{0}' ", ClaveSATPais)
If CvePais > 0 Then Filtro.AppendFormat(" AND CvePais = {0} ", CvePais)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Filtro.ToString, "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Filtro.ToString, "", DataViewRowState.CurrentRows)
GlobalDTGralEstados = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTGralEstados"
Application(AppNombre) = value
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTGralMunicipios(ClaveSATEstado As String, Optional CveEstado As Integer = -1) As DataTable
@@ -493,13 +493,13 @@ Public Class ClsPaginas
Application("GlobalDTLocalidad") = value
End Set
End Property
Property GlobalDTGralColonias(ClaveSATEstado As String, ClaveSATMunicipio As String, ClaveSATColonia As String,
Public Shared Property GlobalDTGralColonias(ClaveSATEstado As String, ClaveSATMunicipio As String, ClaveSATColonia As String,
Optional CveMunicipio As Integer = -1, Optional CodigoPostal As Integer = -1, Optional CveColonia As Integer = -1) As DataTable
Get
Dim AppNombre As String = "GlobalDTGralColonias"
If Application(AppNombre) Is Nothing Then
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATColonia("-1", "-1", "-1") Then Application(AppNombre) = ObjGrales.DtResultados
If ObjGrales.GetSATColonia("-1", "-1", "-1") Then HttpContext.Current.Application(AppNombre) = ObjGrales.DtResultados
ObjGrales.Dispose()
End If
Dim Filtro As New StringBuilder
@@ -510,14 +510,14 @@ Public Class ClsPaginas
If CveMunicipio > 0 Then Filtro.AppendFormat(" AND CveMunicipio = {0} ", CveMunicipio)
If CodigoPostal > 0 Then Filtro.AppendFormat(" AND CP = {0} ", CodigoPostal)
If CveColonia > 0 Then Filtro.AppendFormat(" AND CveColonia = {0} ", CveColonia)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Filtro.ToString, "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Filtro.ToString, "", DataViewRowState.CurrentRows)
GlobalDTGralColonias = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = "GlobalDTGralColonias"
Application(AppNombre) = value
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
#End Region
@@ -684,16 +684,22 @@ Public Class ClsPaginas
End Property
Property GlobalDTNomSatRegimenContratacion() As DataTable
Get
GlobalDTNomSatRegimenContratacion = DirectCast(Application("GlobalDTNomSatRegimenContratacion"), DataTable)
Dim AppNombre As String = "GlobalDTNomSatRegimenContratacion"
If Application(AppNombre) Is Nothing Then
Dim ObjNom As New ClsNominas
If ObjNom.GetRegimenContratacion Then Application(AppNombre) = ObjNom.DtResultados
ObjNom.Dispose()
End If
GlobalDTNomSatRegimenContratacion = DirectCast(Application(AppNombre), DataTable)
End Get
Set(ByVal value As DataTable)
Application("GlobalDTNomSatRegimenContratacion") = value
Dim AppNombre As String = "GlobalDTNomSatRegimenContratacion"
Application(AppNombre) = value
End Set
End Property
Property GlobalDTRegimenesFiscales(Optional TipoPersona As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTRegimenesFiscales")
'sino existe, recarga los datos
Dim AppNombre As String = "GlobalDTRegimenesFiscales"
If Application(AppNombre) Is Nothing Then
Dim ObjGral As New ClsSisEmpresas
If ObjGral.GetRegimenFiscal(-1) Then Application(AppNombre) = ObjGral.DtResultados
@@ -1536,19 +1542,19 @@ Public Class ClsPaginas
ObjPS.Dispose()
End Get
End Property
Public Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1,
Public Shared Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1,
Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1, Optional Codigo As String = "-1", Optional CodigoSATPS As String = "-1") As DataTable
Get
Dim AppNombre As String = $"GlobalDTPSSimplificado-{CveEmpresa}"
If CveEmpresa <> -1 Then
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
If ObjPS.GetPSSimplificado(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
End If
Dim Cons = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow))
Dim Cons = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow))
'Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
If PSCodigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!PSCodigo) = PSCodigo))
@@ -1564,12 +1570,12 @@ Public Class ClsPaginas
GlobalDTPSSimplificado = New DataTable
End Try
Else
GlobalDTPSSimplificado = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
GlobalDTPSSimplificado = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTPSSimplificado-{CveEmpresa}"
Application(AppNombre) = value
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTProductosServiciosAlias(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
@@ -1915,30 +1921,27 @@ Public Class ClsPaginas
'Fin Periodos
'Fin Ruta
'Cliente
Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional CveCliente As Integer = -1) As DataTable
Public Shared Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional CveCliente As Integer = -1) As DataTable
Get
Dim AppNombre As String = $"GlobalDTCliente-{CveEmpresa}"
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados.Copy()
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados.Copy()
ObjClientes.Dispose()
End If
If CveEmpresa <> -1 Then
Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus)
If CveCliente >= 0 Then StrSQL.AppendFormat(" AND CveCliente = {0} ", CveCliente)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCliente = Dv.ToTable
Dv.Dispose()
Else
GlobalDTCliente = DirectCast(Application(AppNombre), DataTable)
End If
Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("1 = 1")
If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus)
If CveCliente >= 0 Then StrSQL.AppendFormat(" AND CveCliente = {0} ", CveCliente)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCliente = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTCliente-{CveEmpresa}"
Application(AppNombre) = value
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable
@@ -2020,33 +2023,29 @@ Public Class ClsPaginas
Application("GlobalDTClientesCorporativo") = value
End Set
End Property
Property GlobalDTCompProveedores(CveEmpresa As Integer, Optional CveProveedor As Integer = -1, Optional RFC As String = "-1") As DataTable
Public Shared Property GlobalDTCompProveedores(CveEmpresa As Integer, Optional CveProveedor As Integer = -1, Optional RFC As String = "-1") As DataTable
Get
Dim AppNombre As String = $"GlobalDTCompProveedores-{CveEmpresa}"
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then Application(AppNombre) = ObjProveedores.DtResultados
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjProveedores.DtResultados
ObjProveedores.Dispose()
End If
If CveEmpresa <> -1 AndAlso Application(AppNombre) IsNot Nothing Then
If HttpContext.Current.Application(AppNombre) IsNot Nothing Then
Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
StrSQL.Append("1 = 1")
If CveProveedor >= 0 Then StrSQL.AppendFormat(" AND CveProveedor = {0} ", CveProveedor)
If RFC <> "-1" Then StrSQL.AppendFormat(" AND RFC = '{0}' ", RFC)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCompProveedores = Dv.ToTable
Dv.Dispose()
Else
GlobalDTCompProveedores = DirectCast(Application(AppNombre), DataTable)
GlobalDTCompProveedores = Nothing
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTCompProveedores-{CveEmpresa}"
Application(AppNombre) = value
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then Application(AppNombre) = ObjProveedores.DtResultados
'ObjProveedores.Dispose()
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
'EstatusFactura
@@ -2066,26 +2065,25 @@ Public Class ClsPaginas
Application("GlobalDTContratosSecciones") = value
End Set
End Property
Property GlobalDTContratos(CveEmpresa As Integer, Optional CveContrato As Integer = -1, Optional CveSubProyecto As Integer = -1) As DataTable
Public Shared Property GlobalDTContratos(CveEmpresa As Integer, Optional CveContrato As Integer = -1, Optional CveSubProyecto As Integer = -1) As DataTable
Get
Dim AppNombre As String = $"GlobalDTContratos-{CveEmpresa}"
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Using ObjContratos As New ClsContratos
If ObjContratos.GetContratos(-1, CveEmpresa) Then Application(AppNombre) = ObjContratos.DtResultados Else Application(AppNombre) = Nothing
If ObjContratos.GetContratos(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjContratos.DtResultados
End Using
End If
Dim StrSQL As New StringBuilder
StrSQL.Append(" 1 = 1 ")
If CveContrato >= 0 Then StrSQL.AppendFormat(" AND CveContrato = {0} ", CveContrato)
If CveSubProyecto >= 0 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0} ", CveSubProyecto)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTContratos = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTContratos-{CveEmpresa}"
Application(AppNombre) = value
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTContratosTipos(CveEmpresa As Integer) As DataTable
@@ -3413,20 +3411,19 @@ Public Class ClsPaginas
Application(AppNombre) = value
End Set
End Property
Property GlobalDTRHPersonal(CveEmpresa As Integer, Optional CvePersonal As Integer = -1) As DataTable
Public Shared Property GlobalDTRHPersonal(CveEmpresa As Integer, Optional CvePersonal As Integer = -1) As DataTable
Get
Dim AppNombre As String = $"GlobalDTRHPersonal-{CveEmpresa}"
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, CveEmpresa) Then Application(AppNombre) = ObjPersonal.DtResultados
If ObjPersonal.GetPersonal(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPersonal.DtResultados
ObjPersonal.Dispose()
End If
GlobalDTRHPersonal = DirectCast(Application(AppNombre), DataTable)
GlobalDTRHPersonal = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTRHPersonal-{CveEmpresa}"
Application(AppNombre) = value
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTDepartamentos(CveEmpresa As Integer) As DataTable
@@ -7968,10 +7965,10 @@ Public Class ClsPaginas
End If
If VentaActual.CveMoneda > 1 Then ImporteME = Pago.ImportePagoVenta
'movimiento de pago cliente
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, Pago.ImportePagoVenta, Pago.CveConceptoPago, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, Pago.ImportePagoVenta, Pago.CveConceptoPago, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableCliente, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
'movimiento de pago cliente Complementaria
If Not ErrorMovtos AndAlso VentaActual.CveMoneda > 1 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, (ImporteME * TCValuacionVenta - ImporteME).RoundSQL, CveConceptoContableComplementaria, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, (ImporteME * TCValuacionVenta - ImporteME).RoundSQL, CveConceptoContableComplementaria, VentaActual.SerieFolio, Concepto, VentaActual.IdCtaContableClienteComplementaria, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
End If
If Pago.AplicaTraslado Then
'si tiene iva y su proporcion
@@ -7979,10 +7976,10 @@ Public Class ClsPaginas
ImporteMovimiento = (PorcentajePago * VentaActual.IVA).RoundSQL
ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 13, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 13, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 61, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 61, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
End If
End If
'si tiene RET IVA y su proporcion
@@ -7990,20 +7987,20 @@ Public Class ClsPaginas
ImporteMovimiento = (PorcentajePago * VentaActual.RetIVA).RoundSQL
ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 62, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 62, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
End If
'si tiene Ret ISR y su proporcion
If Not ErrorMovtos AndAlso VentaActual.RetISR > 0 Then
ImporteMovimiento = (PorcentajePago * VentaActual.RetISR).RoundSQL
ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 63, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 63, VentaActual.SerieFolio, Concepto, 0, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
End If
'si tiene IEPS y su proporcion
If Not ErrorMovtos AndAlso VentaActual.IEPS > 0 Then
@@ -8015,10 +8012,10 @@ Public Class ClsPaginas
If ObjConta.GetRetCuenta(38, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContablexAcreditar = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero
If ObjConta.GetRetCuenta(39, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then Ret.IdCtaContableAcreditable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSTrasladado").ToString.ToEntero
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, Ret.IdCtaContablexAcreditar, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 39, VentaActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 39, VentaActual.SerieFolio, Concepto, Ret.IdCtaContableAcreditable, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto) Then ErrorMovtos = True
End If
'concepto pago
Concepto = String.Format("{0} NC:{1}", VentaActual.ClienteNombre, Pago.Referencia)

View File

@@ -1470,7 +1470,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
Public Property Estado As String
Public Property ClaveEstado As String
Public Property Telefono As String
Public Property TelefonoEmergencia As String
Public Property TelefonoEmergencia As String
Public Property Beneficiario As String
Public Property Celular As String
Public Property LugarNacimiento As String
Public Property CredencialElector As String
@@ -1684,6 +1685,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
Me.ClaveEstado = Data.Rows(0)("ClaveEstado").ToString
Me.Telefono = Data.Rows(0)("Telefono").ToString
Me.TelefonoEmergencia = Data.Rows(0)("NombreTelEmergencia").ToString
Me.Beneficiario = Data.Rows(0)("Beneficiario").ToString
Me.Celular = Data.Rows(0)("Celular").ToString
Me.RFC = Data.Rows(0)("RFC").ToString
Me.CURP = Data.Rows(0)("CURP").ToString
@@ -1860,6 +1862,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
Me.Estado = Data.Rows(0)("Estado").ToString
Me.Telefono = Data.Rows(0)("Telefono").ToString
Me.TelefonoEmergencia = Data.Rows(0)("NombreTelEmergencia").ToString
Me.Beneficiario = Data.Rows(0)("Beneficiario").ToString
Me.Celular = Data.Rows(0)("Celular").ToString
Me.RFC = Data.Rows(0)("RFC").ToString
Me.CURP = Data.Rows(0)("CURP").ToString
@@ -1939,7 +1942,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
CveEstadoCivil As Integer, CveGenero As Integer, CveMotivoBaja As Integer, FechaBaja As String, CveEstatusPersonal As Integer, FechaNacimiento As Date, LugarNacimiento As String,
Calle As String, NumExt As String, NumInt As String, Colonia As String, CP As String, Ciudad As String, CveEstado As Integer, Telefono As String, TelefonoEmergencia As String, Celular As String, RFC As String, CURP As String, CredencialElector As String,
NombrePadre As String, NombreMadre As String, CveSATBanco As Integer, CveSATRiesgoPuesto As Integer, CveSATRegimenContratacion As Integer, CveClienteAsignado As Integer, CveSubProyecto As Integer, URL As String, CveSupervisor As Integer, CLABE As String, BancoNumCuenta As String,
CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveUsuario As Integer, CveEmpresa As Integer, CveUsuarioNomina As Integer, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1,
CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveUsuario As Integer, CveEmpresa As Integer, CveUsuarioNomina As Integer, Beneficiario As String, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1,
Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Boolean = False, Optional CvePais As Integer = -1,
Optional Pensionado As Boolean = False, Optional CveMedioTransporte As Integer = -1, Optional CveRegistroPatronal As Integer = -1, Optional CveEmpresaAsignado As Integer = -1, Optional CveTipoTrabajador As Integer = -1) As Boolean
@@ -2016,6 +2019,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@CtaContPrestamos", SqlDbType.VarChar).Value = CtaContPrestamos
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Beneficiario", SqlDbType.VarChar).Value = Beneficiario
.Add("@CveUsuarioNomina", SqlDbType.VarChar).Value = CveUsuarioNomina
.Add("@CveSubProyectoZona", SqlDbType.Int).Value = CveSubProyectoZona
.Add("@CveUniforme", SqlDbType.Int).Value = CveUniforme '
@@ -2073,7 +2077,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
CveEstadoCivil As Integer, CveGenero As Integer, CveMotivoBaja As Integer, FechaBaja As String, CveEstatusPersonal As Integer, FechaNacimiento As Date, LugarNacimiento As String,
Calle As String, NumExt As String, NumInt As String, Colonia As String, CP As String, Ciudad As String, CveEstado As Integer, Telefono As String, TelefonoEmergencia As String, Celular As String, RFC As String, CURP As String, CredencialElector As String,
NombrePadre As String, NombreMadre As String, CveSATBanco As Integer, CveSATRiesgoPuesto As Integer, CveSATRegimenContratacion As Integer, CveClienteAsignado As Integer, CveSubProyecto As Integer, CvePersonal As Integer, URL As String, CveSupervisor As Integer, CLABE As String, BancoNumCuenta As String,
CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveEmpresa As Integer, CveUsuarioNomina As Integer, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1,
CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveEmpresa As Integer, CveUsuarioNomina As Integer, Beneficiario As String, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1,
Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveUsuarioModifico As Integer = -1,
Optional FechaActivo As Date = MinFecha, Optional FechaReingreso As Date = MinFecha, Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Integer = -1, Optional CvePais As Integer = -1, Optional Pensionado As Boolean = False, Optional CveRegistroPatronal As Integer = -1,
Optional CveEmpresaAsignado As Integer = -1, Optional CveMedioTransporte As Integer = -1, Optional EsReserva As Integer = -1, Optional Fiscalizable As Integer = -1, Optional CveTipoTrabajador As Integer = -1) As Boolean
@@ -2152,6 +2156,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@IdCtaContPrestamos", SqlDbType.Int).Value = IdCtaContPrestamos
.Add("@CtaContPrestamos", SqlDbType.VarChar).Value = CtaContPrestamos
.Add("@CveUsuarioNomina", SqlDbType.VarChar).Value = CveUsuarioNomina
.Add("@Beneficiario", SqlDbType.VarChar).Value = Beneficiario
.Add("@CveSubProyectoZona", SqlDbType.Int).Value = CveSubProyectoZona
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUniforme", SqlDbType.Int).Value = CveUniforme

View File

@@ -326,47 +326,6 @@ Namespace Modelos
IniciaValores()
End Sub
'Public Sub New(ObjsClsPaginas As ClsPaginas, Optional Row As Data.DataRow = Nothing)
' If Row IsNot Nothing Then
' setValues(Row)
' Else
' IniciaValores()
' End If
' SetMetodoPago()
' Timbre = New CFDITimbre
' DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
'End Sub
'Public Sub New(ObjsClsPaginas As ClsPaginas, CveVenta As Integer, CveEmpresa As Integer)
' Me.CveEmpresa = CveEmpresa
' Dim ObjVentas As New ClsVentas()
' If ObjVentas.GetVenta(CveVenta, CveEmpresa) Then
' If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
' setValues(ObjVentas.DtResultados.Rows(0))
' SetMetodoPago()
' SetMoneda()
' End If
' End If
' ObjVentas.Dispose()
' DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
'End Sub
'Public Sub New(ObjsClsPaginas As ClsPaginas, UsuarioActual As Usuario, Optional Row As Data.DataRow = Nothing)
' Me.UsuarioActual = UsuarioActual
' Me.ErrorList = New List(Of String)
' Me.RemisionesLista = New List(Of Integer)
' Me.ListaMensajes = New List(Of String)
' If Row IsNot Nothing Then
' setValues(Row)
' Else
' IniciaValores()
' End If
' SetMetodoPago()
' SetMoneda()
' SetSubProyecto(ObjsClsPaginas)
' SetSubProyectoMatriz(ObjsClsPaginas)
' Timbre = New CFDITimbre
' DirectorioServidor = ModExtensiones.DirectorioBaseEmpresas
'End Sub
Public Sub New(UsuarioActual As Usuario, Optional Row As Data.DataRow = Nothing)
Me.UsuarioActual = UsuarioActual
Me.ErrorList = New List(Of String)
@@ -1306,7 +1265,7 @@ Namespace Modelos
Dim tmpcon As DataTable = DtDetalle.Clone
tmpcon.Clear()
Dim drpss As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:="84111506").FiltroPrimero("SATClavePS = '84111506'")
Dim drpss As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:="84111506").FiltroPrimero("SATClavePS = '84111506'")
If drpss IsNot Nothing Then
Dim ii As Integer = 1
@@ -2381,7 +2340,7 @@ Namespace Modelos
If ObjFactura.CveMoneda = 2 AndAlso ObjFactura.TipoCambio > 0 Then
tipoCambio = ObjFactura.TipoCambio
ElseIf ObjFactura.CveMoneda = 2 AndAlso ObjFactura.TipoCambio <= 1 Then
tipoCambio = GlobalTipoCambio(ObjFactura.Fecha).ToString.ToDecimal
tipoCambio = ClsPaginas.GlobalTipoCambio(ObjFactura.Fecha).ToString.ToDecimal
Else
tipoCambio = 1
End If
@@ -2411,9 +2370,9 @@ Namespace Modelos
SeContabiliza = False
End If
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=ObjFactura.DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then
IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero
IdCtaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero
If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=ObjFactura.DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then
IdCtaIVAXTrasladar = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero
IdCtaIVATrasladado = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("IdCtaIVATrasladado").ToString.ToEntero
End If
Dim UsaComplementariaClientes As Boolean = True
@@ -2441,7 +2400,7 @@ Namespace Modelos
Dim TCFluctuacion As Decimal = tipoCambio
'TOMA EL TC DE LA ULTIMA FLUCTUACION
If ValorMultiplicador = -1 AndAlso UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso ObjFactura.CveMoneda = 2 Then
Dim UltimaFluctuacion As ClsPaginas.MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(Now)
Dim UltimaFluctuacion As ClsPaginas.MTipoCambioFluctuacion = ClsPaginas.GlobalTipoCambioUltimaFluctuacion(Now)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion <= Now Then
@@ -2705,7 +2664,7 @@ Namespace Modelos
If tipoCambio > 1 Then
TipoCambioNC = tipoCambio
Else
TipoCambioNC = GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
TipoCambioNC = ClsPaginas.GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
End If
'APLICA NC SALDOS DIRECTOS
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
@@ -2775,7 +2734,7 @@ Namespace Modelos
Dim TCFluctuacion As Decimal = Dr("TCCambioValuacion").ToString.ToDecimal
If TCFluctuacion = 1 AndAlso TipoCambioNC > 1 Then
TCFluctuacion = GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
TCFluctuacion = ClsPaginas.GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
End If
If TipoCambioNC <> TCFluctuacion AndAlso TCFluctuacion > 1 AndAlso TipoCambioNC > 1 Then
Dim difFluctuacion As Decimal = TipoCambioNC - TCFluctuacion
@@ -3099,7 +3058,7 @@ Namespace Modelos
Dim TCFluctuacion As Decimal = row2("TCCambioValuacion").ToString.ToDecimal
If TCFluctuacion = 1 AndAlso tipoCambio > 1 Then
TCFluctuacion = GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
TCFluctuacion = ClsPaginas.GlobalTipoCambio(ObjFactura.Fecha).ToDecimal
End If
If ObjFactura.CveMoneda = 2 AndAlso Not row2("TCCambioValuacion").ToString.ToDecimal > 1 Then
@@ -3318,8 +3277,8 @@ Namespace Modelos
If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933") Then
'reclasifica la clasificación del producto, por la del ingreso correspondiente a su iva
If ObjFactura.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows.Count > 0 Then
TmpDTDetalle(i)("CveClasificacion") = ObjFactura.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows(0)("CveClasificacion").ToString
If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows.Count > 0 Then
TmpDTDetalle(i)("CveClasificacion") = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal).Rows(0)("CveClasificacion").ToString
End If
End If
@@ -3383,8 +3342,8 @@ Namespace Modelos
'se excluyen las clasificaciones anteriores para que se asignen las de ingreso
If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933", "20242") Then
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows.Count > 0 Then
TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows(0)("CveClasificacion").ToString
If ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows.Count > 0 Then
TmpDTDetalle(i)("CveClasificacion") = ClsPaginas.GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDTDetalle(i)("PorcentajeIVA").ToString().ToDouble).Rows(0)("CveClasificacion").ToString
End If
End If
@@ -4633,7 +4592,7 @@ Namespace Modelos
If factura.CveMoneda = 2 AndAlso factura.TipoCambio > 0 Then
tipoCambio = factura.TipoCambio
ElseIf factura.CveMoneda = 2 AndAlso factura.TipoCambio <= 1 Then
tipoCambio = GlobalTipoCambio(factura.Fecha).ToString.ToDecimal
tipoCambio = ClsPaginas.GlobalTipoCambio(factura.Fecha).ToString.ToDecimal
Else
tipoCambio = 1
End If
@@ -7380,75 +7339,6 @@ Namespace Modelos
#Region "G L O B A L - D T"
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambio") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambio").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambio") = value
End Set
End Property
Public Property GlobalTipoCambioEuro(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambioEuro <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambioEuro") = ObjGral.DtResultados.Rows(0)("TipoCambioEuro").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambioEuro") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambioEuro").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambioEuro") = value
End Set
End Property
Property GlobalDTUsuarios(Optional CveUsuario As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1) As DataTable
Get
Dim Str As New StringBuilder
If CveUsuario <> -1 Then Str.AppendFormat("CveUsuario = {0}", CveUsuario)
If CveEmpresa <> -1 Then Str.AppendFormat(" {0} CveEmpresa = {1}", If(Str.Length > 0, "AND", ""), CveEmpresa)
If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente)
If CveProveedor <> -1 Then Str.AppendFormat(" {0} CveProveedor = {1}", If(Str.Length > 0, "AND", ""), CveProveedor)
If CveUsuario <> -1 OrElse CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTUsuarios = Dv.ToTable
Dv.Dispose()
Else
GlobalDTUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTUsuarios"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTUsuarios") = value
End Set
End Property
Property DtFacturaDefault() As DataTable
Get
DtFacturaDefault = DirectCast(HttpContext.Current.Application("DtFacturaDefault"), DataTable)
@@ -7466,214 +7356,6 @@ Namespace Modelos
End Set
End Property
'Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable
' Get
' If CveEmpresa <> -1 Then
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTEmpresas"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
' GlobalDTEmpresas = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTEmpresas = DirectCast(HttpContext.Current.Application("GlobalDTEmpresas"), DataTable)
' End If
' End Get
' Set(ByVal value As DataTable)
' HttpContext.Current.Application("GlobalDTEmpresas") = value
' End Set
'End Property
'Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
' Get
' Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
' 'sino existe, recarga los datos
' If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
' Dim P As New ClsSubProyectos
' If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
' P.Dispose()
' Dim msg As String = "aqui no se carga subproyectos"
' If HttpContext.Current.Request IsNot Nothing Then
' msg = msg & HttpContext.Current.Request.ServerVariables("URL")
' End If
' msg.GuardaLog()
' End If
' If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
' Dim StrSQL As New StringBuilder
' If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
' If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
' If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
' If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
' GlobalDTSubProyectos = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
' End If
' End Get
' Set(ByVal value As DataTable)
' Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
' HttpContext.Current.Application(AppNombre) = value
' End Set
'End Property
'Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable
' Get
' If HttpContext.Current.Application("GlobalDTSubProyectosUsuarios") Is Nothing Then
' Dim ObjSubProyectos As New ClsSubProyectos()
' If ObjSubProyectos.GetSubProyectosUsuarios Then HttpContext.Current.Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados Else Alert("Ocurrió un error al cargar los SubProyectos. Por favor comuniquese con sistemas.", TipoMensaje.MsgError)
' ObjSubProyectos.Dispose()
' End If
' If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse CveEstatus <> -1 Then
' Dim StrSQL As New StringBuilder
' If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
' If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
' If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
' If CveUsuario <> -1 Then StrSQL.AppendFormat(" AND CveUsuario = {0}", CveUsuario)
' If CveEstatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", CveEstatus)
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubProyectosUsuarios"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
' GlobalDTSubProyectosUsuarios = Dv.ToTable
' Dv.Dispose()
' Dim ObjSubProyectos As New ClsSubProyectos()
' If ObjSubProyectos.GetSubProyectosUsuarios(CveUsuario:=CveUsuario, CveProyecto:=CveProyecto, CveSubProyecto:=CveSubProyecto, CveEstatus:=CveEstatus, CveEmpresa:=CveEmpresa) Then
' GlobalDTSubProyectosUsuarios = ObjSubProyectos.DtResultados
' Else
' GlobalDTSubProyectosUsuarios = Nothing
' End If
' ObjSubProyectos.Dispose()
' Else
' GlobalDTSubProyectosUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTSubProyectosUsuarios"), DataTable)
' End If
' End Get
' Set(ByVal value As DataTable)
' If value Is Nothing OrElse value.Rows.Count = 0 Then
' End If
' HttpContext.Current.Application("GlobalDTSubProyectosUsuarios") = value
' End Set
'End Property
'Property GlobalDTProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, CveEstatus As Integer) As DataTable
' Get
' If HttpContext.Current.Application("GlobalDTProyectosUsuarios") Is Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTProyectosUsuarios"), DataTable).Rows.Count = 0 Then
' Dim ObjSubProyectos As New ClsSubProyectos()
' If ObjSubProyectos.GetSubProyectosUsuarios Then HttpContext.Current.Application("GlobalDTProyectosUsuarios") = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"}) Else Alert("Ocurrió un error al cargar los Proyectos. Por favor comuniquese con sistemas.", TipoMensaje.MsgError)
' ObjSubProyectos.Dispose()
' GuardaLog("Se Cargo GlobalDTProyectosUsuarios")
' End If
' If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveEmpresa <> -1 OrElse CveEstatus <> -1 Then
' Dim StrSQL As New StringBuilder
' If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
' If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
' If CveUsuario <> -1 Then StrSQL.AppendFormat(" AND CveUsuario = {0}", CveUsuario)
' If CveEstatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatusProyecto = {0}", CveEstatus)
' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTProyectosUsuarios"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
' GlobalDTProyectosUsuarios = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTProyectosUsuarios = DirectCast(HttpContext.Current.Application("GlobalDTProyectosUsuarios"), DataTable)
' End If
' End Get
' Set(ByVal value As DataTable)
' If value Is Nothing OrElse value.Rows.Count = 0 Then
' End If
' HttpContext.Current.Application("GlobalDTProyectosUsuarios") = value
' End Set
'End Property
ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1) As DataTable
Get
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePS, -1, CveEmpresa, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta) Then
GlobalDTPS = ObjPS.DtResultados
Else
GlobalDTPS = Nothing
End If
ObjPS.Dispose()
End Get
End Property
Public ReadOnly Property GlobalTipoCambioUltimaFluctuacion(Optional Fecha As Date = MinFecha) As ClsPaginas.MTipoCambioFluctuacion
Get
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") Is Nothing Then
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambioUltimaFluctuacion(-1, Now) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = ObjGral.DtResultados.Copy()
Else
HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") = Nothing
End If
ObjGral.Dispose()
End If
Dim fluctuacion = New ClsPaginas.MTipoCambioFluctuacion() With {
.TCFluctuacion = 0,
.FechaFluctuacion = MinFecha
}
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
If HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion") IsNot Nothing Then
Dim dr = DirectCast(HttpContext.Current.Application("GlobalTipoCambioUltimaFluctuacion"), DataTable).FiltroPrimero(String.Format("Fecha <= '{0}'", Fecha), Orderby:="Fecha DESC")
If dr IsNot Nothing Then
fluctuacion.TCFluctuacion = dr("TCFluctuacion").ToString().ToDecimal()
fluctuacion.FechaFluctuacion = dr("FechaFluctuacion").ToString().ToDateTime()
End If
Return fluctuacion
Else
Return fluctuacion
End If
End Get
End Property
Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1,
Optional PorcentajeIVA As Double = -1) As DataTable
Get
Dim Str As StringBuilder = New StringBuilder()
If CveEmpresa <> -1 Or CveClasicacionPorcentaje <> -1 Or CveClasicacion <> -1 Or PorcentajeIVA <> -1 Then
If CveEmpresa <> -1 Then Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje)
If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion)
If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTClasificacionPorcentaje = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClasificacionPorcentaje = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClasificacionPorcentaje") = value
End Set
End Property
Public Property CveContratoSecciones As String
Public Property CveEstatus As Integer
Public Property GenerarPDFFactura As Boolean = False

View File

@@ -59,206 +59,6 @@ Public Class E141 : Implements IHttpHandler
End Get
End Property
#Region "GLOBAL DT"
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
P.Dispose()
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1, Optional Estatus As Integer = -1, Optional Codigo As String = "-1") As DataTable
Get
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePS, -1, CveEmpresa, Codigo:=Codigo, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta, pEstado:=Estatus) Then
GlobalDTPS = ObjPS.DtResultados
Else
GlobalDTPS = Nothing
End If
ObjPS.Dispose()
End Get
End Property
Public Property GlobalDTPSSimplificado(Optional CveClasificacion As Integer = -1, Optional Codigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
If CveEmpresa <> -1 Then
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
End If
Dim Cons = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow))
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
Codigo = Codigo.ToUpper()
If Codigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!Codigo).ToUpper() = Codigo))
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS))
Try
GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
Catch ex As Exception
GlobalDTPSSimplificado = New DataTable
End Try
Else
GlobalDTPSSimplificado = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTMonedas() As DataTable
Get
GlobalDTMonedas = DirectCast(HttpContext.Current.Application("GlobalDTMonedas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMonedas") = value
End Set
End Property
Public Property GlobalDTVtaFormaPago() As DataTable
Get
GlobalDTVtaFormaPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaFormaPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaFormaPago") = value
End Set
End Property
Property GlobalDTVtaMetodoPago() As DataTable
Get
GlobalDTVtaMetodoPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaMetodoPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaMetodoPago") = value
End Set
End Property
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
Get
If EsPersonaFisica <> -1 Then
Dim Tipo As String = ""
If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1"
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable), Tipo, " UsoCFDIDescripcion", DataViewRowState.CurrentRows)
GlobalDTSATUsosCFDI = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSATUsosCFDI = DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value
End Set
End Property
Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa)
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjUsr As New ClsInventarios
If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados
ObjUsr.Dispose()
End If
Dim Str As New StringBuilder
Str.Append("1=1 AND ")
If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAlmacen = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
'Get
' Dim Str As New StringBuilder
' Str.Append("1=1 AND ")
' If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
' If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
' If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
' Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
' GlobalDTAlmacen = Dv.ToTable
' Dv.Dispose()
'End Get
'Set(value As DataTable)
' Application("GlobalDTAlmacen") = value
'End Set
End Property
Property GlobalDTEstado(ClaveSATPais As String) As DataTable
Get
If HttpContext.Current.Application("GlobalDTEstado") Is Nothing Then
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetSATEstado("-1") Then HttpContext.Current.Application("GlobalDTEstado") = ObjGrales.DtResultados Else HttpContext.Current.Application("GlobalDTEstado") = Nothing
ObjGrales.Dispose()
End If
If ClaveSATPais <> "-1" Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTEstado"), DataTable), String.Format("ClaveSATPais = '{0}'", ClaveSATPais), "", DataViewRowState.CurrentRows)
GlobalDTEstado = Dv.ToTable
Dv.Dispose()
Else
GlobalDTEstado = DirectCast(HttpContext.Current.Application("GlobalDTEstado"), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTEstado") = value
End Set
End Property
#End Region
#Region "V A L I D A - D A T O S"
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
Dim UsuarioActual As Usuario = Nothing
@@ -852,7 +652,7 @@ Public Class E141 : Implements IHttpHandler
End If
If Not String.IsNullOrEmpty(Estado) Then
CveEstado = GlobalDTEstado("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero()
CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero()
'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
If CveEstado <= 0 Then
@@ -936,8 +736,8 @@ Public Class E141 : Implements IHttpHandler
ObjFactura.TipoCambio = 1
ObjFactura.ConvertirPesos = False
ObjFactura.CveMoneda = CveMoneda
ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", CveMoneda))
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", CveMoneda))
ObjFactura.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", CveMoneda))
ObjFactura.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", CveMoneda))
ObjFactura.TipoDocto = TipoDocto
ObjFactura.RefDocto = ""
'ObjFactura.CveMesa = -1
@@ -965,8 +765,8 @@ Public Class E141 : Implements IHttpHandler
ObjFactura.CveSubProyecto = CveSubProyecto
ObjFactura.CveSubProyectoCobranza = CveSubProyecto
ObjFactura.CveSubProyectoEjecucion = CveSubProyecto
ObjFactura.SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveEmpresa:=CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto)))
ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
ObjFactura.SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1, CveEmpresa:=CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto)))
ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
'CLIENTE
ObjFactura.CveCliente = CveCliente
@@ -978,16 +778,16 @@ Public Class E141 : Implements IHttpHandler
If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then
ObjFactura.CveFormaPago33 = ObjClientes.CveFormaPago33
ObjFactura.FormaPago33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33))
ObjFactura.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33))
ObjFactura.FormaPago33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33))
ObjFactura.FormaPagoSAT33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjClientes.CveFormaPago33))
ObjFactura.CveMetodoPago33 = ObjClientes.CveMetodoPago33
ObjFactura.MetodoPago33 = GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33))
ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33))
ObjFactura.MetodoPago33 = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33))
ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjClientes.CveMetodoPago33))
ObjFactura.CveUsoCFDI = ObjClientes.CveUsoCFDI
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI))
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI))
ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI))
ObjFactura.ClaveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjClientes.CveUsoCFDI))
End If
End If
@@ -1002,7 +802,7 @@ Public Class E141 : Implements IHttpHandler
End If
If Not String.IsNullOrEmpty(JsonRequest("invoice_way_to_pay").ToString()) Then
Dim RowFormaPago As DataRow = GlobalDTVtaFormaPago.FiltroPrimero(String.Format("ClaveFormaPagoSAT = '{0}'", JsonRequest("invoice_way_to_pay").ToString()))
Dim RowFormaPago As DataRow = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimero(String.Format("ClaveFormaPagoSAT = '{0}'", JsonRequest("invoice_way_to_pay").ToString()))
If RowFormaPago IsNot Nothing Then
ObjFactura.CveFormaPago33 = RowFormaPago("CveFormaPago").ToString().ToEntero()
ObjFactura.FormaPago33 = RowFormaPago("FormaPago").ToString()
@@ -1026,7 +826,7 @@ Public Class E141 : Implements IHttpHandler
End If
If Not String.IsNullOrEmpty(JsonRequest("invoice_use").ToString()) Then
Dim RowUsoCFDi As DataRow = GlobalDTSATUsosCFDI.FiltroPrimero(String.Format("UsoCFDI = '{0}'", JsonRequest("invoice_use").ToString()))
Dim RowUsoCFDi As DataRow = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimero(String.Format("UsoCFDI = '{0}'", JsonRequest("invoice_use").ToString()))
If RowUsoCFDi IsNot Nothing Then
ObjFactura.CveUsoCFDI = RowUsoCFDi("CveUsoCFDI").ToString().ToEntero()
ObjFactura.UsoCFDI = RowUsoCFDi("Descripcion").ToString()
@@ -1050,7 +850,7 @@ Public Class E141 : Implements IHttpHandler
End If
If Not String.IsNullOrEmpty(JsonRequest("invoice_payment_method").ToString()) Then
Dim RowMetodoPago As DataRow = GlobalDTVtaMetodoPago.FiltroPrimero(String.Format("ClaveMetodoPagoSAT = '{0}'", JsonRequest("invoice_payment_method").ToString()))
Dim RowMetodoPago As DataRow = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimero(String.Format("ClaveMetodoPagoSAT = '{0}'", JsonRequest("invoice_payment_method").ToString()))
If RowMetodoPago IsNot Nothing Then
ObjFactura.CveMetodoPago33 = RowMetodoPago("CveMetodoPago").ToString().ToEntero()
ObjFactura.MetodoPago33 = RowMetodoPago("MetodoPago").ToString()
@@ -1114,7 +914,7 @@ Public Class E141 : Implements IHttpHandler
End If
If Not String.IsNullOrEmpty(ObjFactura.Cliente.Estado) Then
CveEstado = GlobalDTEstado("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{ObjFactura.Cliente.Estado.Trim}'").ToEntero()
CveEstado = ClsPaginas.GlobalDTGralEstados("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{ObjFactura.Cliente.Estado.Trim}'").ToEntero()
'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
If CveEstado <= 0 Then
@@ -1133,7 +933,7 @@ Public Class E141 : Implements IHttpHandler
End If
ObjFactura.CveAlmacen = GlobalDTAlmacen(CveEmpresa, CveTipoAlmacen:=1).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
ObjFactura.CveAlmacen = ClsPaginas.GlobalDTAlmacen(CveEmpresa, CveTipoAlmacen:=1).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
'DETALLES
ObjFactura.DtDetalle = CreaDTDetalle(ObjInventario, ObjFactura, Resp, UsuarioActual, JsonRequest)
@@ -1436,9 +1236,9 @@ Public Class E141 : Implements IHttpHandler
For Each JsonPS As JObject In ListaPS
Dim Cantidad As Decimal = JsonPS("quantity").ToString.ToDecimal()
Dim CvePS As Integer = GlobalDTPSSimplificado(Codigo:=JsonPS("product_sku").ToString()).FiltroPrimeroValor("CvePS").ToEntero()
Dim CvePS As Integer = ClsPaginas.GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, Codigo:=JsonPS("product_sku").ToString()).FiltroPrimeroValor("CvePS").ToEntero()
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
Dim DrPS As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS Is Nothing Then
Retorno.TieneError = True
@@ -1471,7 +1271,7 @@ Public Class E141 : Implements IHttpHandler
Dim PorcentajeIVADefault As Decimal = 0.16D
Dim DrSubProyecto As DataRow = GlobalDTSubProyectos(-1, JsonRequest("branch_office_id").ToEntero(), CveEmpresa:=CveEmpresa).Rows(0)
Dim DrSubProyecto As DataRow = ClsPaginas.GlobalDTSubProyectos(-1, JsonRequest("branch_office_id").ToEntero(), CveEmpresa:=CveEmpresa).Rows(0)
If DrSubProyecto IsNot Nothing Then
PorcentajeIVADefault = DrSubProyecto("IVA").ToString().ToDecimal()
@@ -1523,7 +1323,7 @@ Public Class E141 : Implements IHttpHandler
Optional ClienteRetIVA As Double = 0, Optional ClienteRetISR As Double = 0, Optional ClienteDesglosaIEPS As Boolean = True) As DataRow
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
Dim DrPS As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS Is Nothing Then
Retorno.Mensajes.Add("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.")
@@ -1560,7 +1360,7 @@ Public Class E141 : Implements IHttpHandler
Dim Row As DataRow = Nothing
Dim TotalCalculableImpuestos As Decimal = 0
PU = Math.Round(PU, 6) ' el precio unitario puede llevar hasta 6 decimales permitidos
Dim DrSubProyecto As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto).Rows(0)
Dim DrSubProyecto As DataRow = ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto).Rows(0)
Row = TmpDT.NewRow()
Row("CveProyecto") = DrSubProyecto("CveProyecto").ToString().ToEntero()
@@ -1738,7 +1538,7 @@ Public Class E141 : Implements IHttpHandler
Dim data As New JArray
Dim DtSucursales As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=CveEmpresa).FiltraParametros("EsSucursal = True")
Dim DtSucursales As DataTable = ClsPaginas.GlobalDTSubProyectos(-1, CveEmpresa:=CveEmpresa).FiltraParametros("EsSucursal = True")
If DtSucursales IsNot Nothing Then
Try
For Each Row As DataRow In DtSucursales.Rows

View File

@@ -20,31 +20,6 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
Dim Retorno As Boolean = False
Try
'If context.Request.InputStream IsNot Nothing Then
' Using reader As New StreamReader(context.Request.InputStream)
' Dim json = reader.ReadToEnd
' If Not String.IsNullOrEmpty(json) Then
' Dim JsonRequest As JObject = JObject.Parse(json)
' If JsonRequest IsNot Nothing Then
' Dim Metodo = JsonRequest("Metodo").ToString()
' If Metodo = "FactMasivaRemisiones" Then
' Dim pCveEmpresa = JsonRequest("CveEmpresa").ToString()
' Dim pFechaI As String = ""
' Dim pFechaF As String = ""
' If JsonRequest("FechaI") IsNot Nothing AndAlso JsonRequest("FechaF") IsNot Nothing Then
' pFechaI = JsonRequest("FechaI")
' pFechaF = JsonRequest("FechaF")
' End If
' IniciaFacturacionMasiva(context, CveEmpresaFacturar, pFechaI, pFechaF)
' End If
' End If
' End If
' End Using
'End If
Dim Metodo = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
If Metodo = "FactMasivaRemisiones" Then
@@ -951,55 +926,6 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
ArchivoW.Dispose()
End Sub
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambio") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambio").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambio") = value
End Set
End Property
Public Property GlobalTipoCambioEuro(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambioEuro <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambioEuro") = ObjGral.DtResultados.Rows(0)("TipoCambioEuro").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambioEuro") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambioEuro").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambioEuro") = value
End Set
End Property

View File

@@ -139,7 +139,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
End If
If Row("Observaciones").ToString().Contains("{TC}") Then
Row("Observaciones") = Row("Observaciones").ToString().Replace("{TC}", GlobalTipoCambio(Now).FormatoNumero)
Row("Observaciones") = Row("Observaciones").ToString().Replace("{TC}", ClsPaginas.GlobalTipoCambio(Now).FormatoNumero)
End If
Dim Resp = EmitirImprimir(UsuarioActual, Row)
@@ -290,9 +290,9 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
ObjFactura.ConvertirPesos = False
ObjFactura.CveMoneda = DR("CveMoneda").ToString.ToEntero
ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DR("CveMoneda").ToString.ToEntero}")
ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, GlobalTipoCambio(Now))
ObjFactura.Moneda = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
ObjFactura.MonedaSAT = ClsPaginas.GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DR("CveMoneda").ToString.ToEntero}")
ObjFactura.TipoCambio = If(ObjFactura.CveMoneda = 1, 1, ClsPaginas.GlobalTipoCambio(Now))
ObjFactura.TipoDocto = "Ing"
ObjFactura.RefDocto = ""
ObjFactura.Folio = -1
@@ -335,8 +335,8 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
ObjFactura.CveSubProyectoCobranza = CveSubProyecto.ToEntero
ObjFactura.CveSubProyectoEjecucion = CveSubProyecto.ToEntero
ObjFactura.SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero(String.Format("CveSubProyecto = {0}", ObjFactura.CveSubProyecto)))
ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
ObjFactura.SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1).FiltroPrimero(String.Format("CveSubProyecto = {0}", ObjFactura.CveSubProyecto)))
ObjFactura.SubProyectoMatriz = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
SubProyecto = DR("SubProyectoContrato").ToString
@@ -359,7 +359,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
ObjFactura.Total = ObjFactura.SubTotal + ObjFactura.IVA + ObjFactura.IEPS - (ObjFactura.RetIVA + ObjFactura.RetISR)
For Each row As DataRow In DtDetalle.Rows
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row("CvePS").ToString().ToEntero()).FiltroPrimero("")
Dim drPS As DataRow = ClsPaginas.GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row("CvePS").ToString().ToEntero()).FiltroPrimero("")
DtR = TmpDT.NewRow
DtR("CveVenta") = -1
@@ -414,16 +414,16 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
If ObjCliente.GetClientes(ObjFactura.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
ObjFactura.CveFormaPago33 = ObjCliente.CveFormaPago33
ObjFactura.FormaPago33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjFactura.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjFactura.FormaPago33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjFactura.FormaPagoSAT33 = ClsPaginas.GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
ObjFactura.CveMetodoPago33 = ObjCliente.CveMetodoPago33
ObjFactura.MetodoPago33 = GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjFactura.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjFactura.MetodoPago33 = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjFactura.ClaveMetodoPagoSAT = ClsPaginas.GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
ObjFactura.CveUsoCFDI = ObjCliente.CveUsoCFDI
ObjFactura.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFactura.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFactura.UsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFactura.ClaveUsoCFDI = ClsPaginas.GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
'ObjFactura.CveMetodoPago = ObjCliente.CveMetodoPago
@@ -584,126 +584,4 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt
End Function
#End Region
#Region "G L O B A L - D T"
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
HttpContext.Current.Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
Else
HttpContext.Current.Application("GlobalTipoCambio") = 0
End If
ObjGral.Dispose()
End If
Return HttpContext.Current.Application("GlobalTipoCambio").ToString.ToDouble
End Get
Set(value As Double)
HttpContext.Current.Application("GlobalTipoCambio") = value
End Set
End Property
Property GlobalDTMonedas() As DataTable
Get
GlobalDTMonedas = DirectCast(HttpContext.Current.Application("GlobalDTMonedas"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMonedas") = value
End Set
End Property
ReadOnly Property GlobalDTPS(CveEmpresa As Integer, Optional CvePS As Integer = -1, Optional SATClavePS As String = "-1", Optional AplicaParaVenta As Integer = -1, Optional Estatus As Integer = -1, Optional Codigo As String = "-1") As DataTable
Get
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPS(CvePS, -1, CveEmpresa, Codigo:=Codigo, SATClavePS:=SATClavePS, pAplicaParaVenta:=AplicaParaVenta, pEstado:=Estatus) Then
GlobalDTPS = ObjPS.DtResultados
Else
GlobalDTPS = Nothing
End If
ObjPS.Dispose()
End Get
End Property
Public Property GlobalDTVtaFormaPago() As DataTable
Get
GlobalDTVtaFormaPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaFormaPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaFormaPago") = value
End Set
End Property
Property GlobalDTVtaMetodoPago() As DataTable
Get
GlobalDTVtaMetodoPago = DirectCast(HttpContext.Current.Application("GlobalDTVtaMetodoPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTVtaMetodoPago") = value
End Set
End Property
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
Get
If EsPersonaFisica <> -1 Then
Dim Tipo As String = ""
If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1"
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable), Tipo, " UsoCFDIDescripcion", DataViewRowState.CurrentRows)
GlobalDTSATUsosCFDI = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSATUsosCFDI = DirectCast(HttpContext.Current.Application("GlobalDTSATUsosCFDI"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value
End Set
End Property
Property GlobalDTMetodosPago() As DataTable
Get
GlobalDTMetodosPago = DirectCast(HttpContext.Current.Application("GlobalDTMetodosPago"), DataTable)
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTMetodosPago") = value
End Set
End Property
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
P.Dispose()
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
#End Region
End Class

View File

@@ -555,7 +555,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
sr.Close()
Catch ex As Exception
ex.ToString().GuardaLog()
'Extenciones.ApplicationParameter.GuardaLogEx(ex, $"SOAPAction : {SOAPAction} XML : {xml}")
End Try
Return resultado
@@ -768,23 +767,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim AppNombre As String = String.Format("GlobalDTCliente-{0}", CveEmpresa)
'sino existe, recarga los datos
If context.Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1, CveClienteClasificacion:=cveclienteclasificacion) Then
context.Application(AppNombre) = ObjClientes.DtResultados
End If
ObjClientes.Dispose()
End If
'Dim ObjClientes As New ClsClientes
'If ObjClientes.GetClientes(-1, Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then
' DtRetorno = ObjClientes.DtResultados
'End If
'ObjClientes.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
Dim dt As DataTable = ClsPaginas.GlobalDTCliente(CveEmpresa)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
If EsDistribuidor <> -1 Then
dt = dt.FiltraParametros(String.Format("EsDistribuidor = {0} ", CBool(EsDistribuidor)))
@@ -832,22 +816,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim AppNombre As String = String.Format("GlobalDTCompProveedores-{0}", CveEmpresa)
'sino existe, recarga los datos
If context.Application(AppNombre) Is Nothing Then
Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
context.Application(AppNombre) = ObjProveedores.DtResultados
End If
ObjProveedores.Dispose()
End If
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
' DtRetorno = ObjProveedores.DtResultados
'End If
'ObjProveedores.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
Dim dt As DataTable = ClsPaginas.GlobalDTCompProveedores(CveEmpresa)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
End If
@@ -1000,17 +970,17 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
If UsaGlobal Then
'se recarga el global, y el clspaginas, son los unicos 2 lugares
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
If context.Application(String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(CveEmpresa) Then context.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
'Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
'If context.Application(String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)) Is Nothing Then
' Dim ObjPS As New ClsProductosServicios
' If ObjPS.GetPSSimplificado(CveEmpresa) Then context.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
' ObjPS.Dispose()
End If
'End If
Dim DTPS = DirectCast(context.Application(AppNombre), EnumerableRowCollection(Of DataRow))
'Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
'Dim DTPS = DirectCast(context.Application(AppNombre), EnumerableRowCollection(Of DataRow))
Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
If DTPS IsNot Nothing Then
@@ -1078,10 +1048,6 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
DTPS = Nothing
End If
If (usuario.TienePermisoProceso(300) Or usuario.TienePermisoProceso(301)) And (DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0) Then
Dim ObjClasificaciones As New ClsClasificaciones()
@@ -1129,11 +1095,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
DtPSRetorno.Columns("CvePS").ColumnName = "id"
DtPSRetorno.Columns(PSCodigoDescripcion).ColumnName = "text"
If PSCodigoDescripcion = "PSCodigo" Then
@@ -1156,16 +1119,12 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End Function
#End Region
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
#Region "Funciones"
Public Function GetJson(ByVal dt As DataTable) As String
Dim Retorno As String = ""
@@ -1198,15 +1157,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GETPSSAT(ByVal context As HttpContext) As String
Dim retorno As String = ""
'Dim DTPS = DirectCast(context.Application("GlobalDTPSATPS"), EnumerableRowCollection(Of DataRow))
Dim DtPSRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString
'If Name <> "-1" Then
' DTPS = DTPS.Where((Function(a) a!SATClaveProductoServicio.ToString.ToLower Like ($"*{Name.ToLower}*")))
'End If
'DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!SATClavePS).CopyToDataTable).ToTable(True, {"CveSATPS", "SATClaveProductoServicio"})
DtPSRetorno = ClsPaginas.GlobalDTPSATPS(Name.ToLower)
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
@@ -1232,7 +1186,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function GETUMSAT(ByVal context As HttpContext) As String
Dim retorno As String = ""
Dim DTUM = ClsPaginas.GlobalDTPSATUM 'DirectCast(context.Application("GlobalDTPSATUM"), EnumerableRowCollection(Of DataRow))
Dim DTUM = ClsPaginas.GlobalDTPSATUM
Dim DtPSRetorno As DataTable
Dim Name = IfNull(context.Request("Name"), "-1").ToString
@@ -1459,22 +1413,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Else
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim AppNombre As String = String.Format("GlobalDTRHPersonal-{0}", CveEmpresa)
'sino existe, recarga los datos
If context.Application(AppNombre) Is Nothing Then
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, CveEmpresa) Then
context.Application(AppNombre) = ObjPersonal.DtResultados
End If
ObjPersonal.Dispose()
End If
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
' DtRetorno = ObjProveedores.DtResultados
'End If
'ObjProveedores.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
Dim dt As DataTable = ClsPaginas.GlobalDTRHPersonal(CveEmpresa)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"NombreCompleto like '%{Name}%'")
End If
@@ -1540,56 +1480,9 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
'xmlCFDI.comprobante.xmlns_cfdi = xtr.Value
Case "XMLNS:XSI"
'xmlCFDI.comprobante.xmlns_xsi = xtr.Value
'Case "XSI:SCHEMALOCATION"
' xmlCFDI.comprobante.xsi_schemaLocation = xtr.Value
'Case "VERSION"
' xmlCFDI.comprobante.Version = xtr.Value
'Case "SERIE"
' xmlCFDI.comprobante.Serie = xtr.Value
'Case "FOLIO"
' xmlCFDI.comprobante.Folio = xtr.Value
Case "FECHA"
fecha = xtr.Value
'Case "MONEDA"
' xmlCFDI.comprobante.Moneda = xtr.Value
'Case "SUBTOTAL"
' Dim SubTotal As Decimal = 0
' Decimal.TryParse(xtr.Value, SubTotal)
' xmlCFDI.comprobante.SubTotal = SubTotal
'Case "TOTAL"
' Dim Total As Decimal = 0
' Decimal.TryParse(xtr.Value, Total)
' xmlCFDI.comprobante.Total = Total
'Case "DESCUENTO"
' Dim Descuento As Decimal = 0
' Decimal.TryParse(xtr.Value, Descuento)
' xmlCFDI.comprobante.Descuento = Descuento
'Case "TIPOCAMBIO"
' Dim TipoCambio As Decimal = 0
' Decimal.TryParse(xtr.Value, TipoCambio)
' xmlCFDI.comprobante.TipoCambio = TipoCambio
'Case "TIPODECOMPROBANTE"
' xmlCFDI.comprobante.TipoDeComprobante = xtr.Value
'Case "FORMAPAGO"
' xmlCFDI.comprobante.FormaPago = xtr.Value
'Case "FORMADEPAGO"
' xmlCFDI.comprobante.FormaPago = xtr.Value
'Case "METODOPAGO"
' xmlCFDI.comprobante.MetodoPago = xtr.Value
'Case "METODODEPAGO"
' xmlCFDI.comprobante.MetodoPago = xtr.Value
'Case "CONDICIONESDEPAGO"
' xmlCFDI.comprobante.CondicionesDePago = xtr.Value
'Case "LUGAREXPEDICION"
' xmlCFDI.comprobante.LugarExpedicion = xtr.Value
'Case "CONFIRMACION"
' xmlCFDI.comprobante.Confirmacion = xtr.Value
'Case "NOCERTIFICADO"
' xmlCFDI.comprobante.NoCertificado = xtr.Value
'Case "SELLO"
' xmlCFDI.comprobante.Sello = xtr.Value
'Case "CERTIFICADO"
' xmlCFDI.comprobante.Certificado = xtr.Value
End Select
cont = xtr.MoveToNextAttribute()
@@ -1663,17 +1556,13 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Private Function getSATColonias(ByVal context As HttpContext) As String
Dim retorno As String = ""
Dim DtRetorno As DataTable = Nothing
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim dt As DataTable = DirectCast(context.Application("GlobalDTColonia"), DataTable)
Dim dt As DataTable = ClsPaginas.GlobalDTGralColonias("-1", "-1", "-1")
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"ClaveSATColoniaCP like '%{Name}%'")
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
DtRetorno.Columns("CveColonia").ColumnName = "id"
DtRetorno.Columns("ClaveSATColoniaCP").ColumnName = "text"
@@ -1701,7 +1590,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim dt As DataTable = DirectCast(context.Application("GlobalDTContratos"), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
Dim dt As DataTable = ClsPaginas.GlobalDTContratos(CveEmpresa)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros(String.Format("NumeroContrato like '%{0}%'", Name))
End If

View File

@@ -897,16 +897,17 @@
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Total</HeaderTemplate>
<ItemTemplate>
<ItemTemplate >
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="80px"></ItemStyle>
<ItemStyle Width="80px" HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Anticipo/NC</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Importe", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate>
<ItemStyle Width="80px" HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Mon</HeaderTemplate>

View File

@@ -3052,7 +3052,7 @@ Partial Class Compras_Compras
End If
If ObjCompra.GetComprasNotasCredito(-1, CveCompra) Then
dtnc = ObjCompra.DtResultados
GvAnticiposSel.Caption = "<table width='100%'><tr><td style='text-align:center'>Compras Aplicadas</td></tr></table>"
LtlGvAnticiposSel.Text = "<table width='100%'><tr><td style='text-align:center'>Compras Aplicadas</td></tr></table>"
End If
End If
@@ -6633,7 +6633,12 @@ Partial Class Compras_Compras
End If
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69) Then
Dim tTipoMovto As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then ' empresa llantera
tTipoMovto = False
SumatoriaOCINV = -SumatoriaOCINV
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tTipoMovto, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69) Then
ErrorPrepoliza = True
Exit For
End If

View File

@@ -5,6 +5,7 @@
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Impresión Masiva de pólizas
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>

View File

@@ -28,7 +28,7 @@ Partial Class Contabilidad_PolizasImpresion
If Not IsPostBack Then
ContabilidadSIG = UsuarioActual.Empresa.TipoContabilidad = 1
ContabilidadSIG = UsuarioActual.Empresa.TipoContabilidad = 1 OrElse UsuarioActual.CveEmpresa = 119
TxtFechaInicio.Text = Now.AddDays(-1).ToShortDateString
TxtFechaFin.Text = Now.ToShortDateString
@@ -88,7 +88,7 @@ Partial Class Contabilidad_PolizasImpresion
FolioF:=folf, CveUsuario:=DdlUsuarioRegistro.SelectedValue.ToEntero, CveSubProyecto:=DdlSegmentoNeg.SelectedValue.ToEntero,
CveCuenta:=DdlCuenta.SelectedValue.ToEntero, CvePlantillaPoliza:=DdlGrupoPlantilla.SelectedValue.ToEntero,
CveTipoProveedor:=DdlTipoProveedor.SelectedValue.ToEntero) Then
If ObjConta.DtResultados.Rows.Count < 10000 Then
If ObjConta.DtResultados.Rows.Count < 12000 Then
If ObjConta.DtResultados.Rows.Count > 0 Then
Dim dr As DataRow
@@ -125,7 +125,7 @@ Partial Class Contabilidad_PolizasImpresion
Private Sub CargaDdlPolizasSIG()
Dim objcont As New ClsContabilidad
If objcont.GetTiposPoliza(-1, "-1", UsuarioActual.CveEmpresa) Then
If objcont.GetTiposPoliza(-1, "-1", 1) Then
ddlTipoPoliza.DataSource = objcont.DtResultados
ddlTipoPoliza.DataBind()
ddlTipoPoliza.Items.Insert(0, New ListItem("Todos", "-1"))

View File

@@ -179,16 +179,20 @@
<div class="portlet-body formnombottom">
<asp:GridView ID="GvCompProductores" runat="server" GridLines="None"
CssClass="table table-striped table-advance table-hover ScrollAD Widthall " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True">
AutoGenerateColumns="False" AllowPaging="False">
<Columns>
<asp:BoundField DataField="RazonSocial" HeaderText="Proveedor" />
<asp:BoundField DataField="GPO" HeaderText="Prod/Serv" />
<asp:BoundField DataFormatString="{0:n}" DataField="Cantidad" ItemStyle-CssClass="margenbound" HeaderText="Cantidad(kg)" />
<asp:BoundField DataFormatString="{0:c}" DataField="SubTotal" ItemStyle-CssClass="margenbound" HeaderText="Importe" />
<asp:BoundField DataFormatString="{0:c}" DataField="PUPromedioKG" ItemStyle-CssClass="margenbound" HeaderText="Promedio/kg" />
<asp:BoundField DataFormatString="{0:c}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
<asp:BoundField DataFormatString="{0:c}" DataField="Abonado" ItemStyle-CssClass="margenbound" HeaderText="Abonado" />
<%--TODO: Esto se puede meter en el stored procedured, pero me da cosa moverle :S--%>
<asp:TemplateField ItemStyle-CssClass="margenbound" HeaderText="P. Promedio">
<ItemTemplate>
<%--TODO: Esto puede tronar si el valor es DBNull --%>
<%# If(Convert.ToDecimal(Eval("Cantidad")) = 0, 0.ToString("C"), (Convert.ToDecimal(Eval("SubTotal")) / Convert.ToInt32(Eval("Cantidad"))).ToString("C")) %>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataFormatString="{0:c}" DataField="PUPromedioKG" ItemStyle-CssClass="margenbound" HeaderText="Promedio/kg" />--%>
</Columns>
<FooterStyle CssClass="Totales"/>
</asp:GridView>
</div>
</ContentTemplate>
@@ -342,7 +346,8 @@
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>
<asp:BoundField DataField="RazonSocial" HeaderText="Proveedor" />
<asp:BoundField DataFormatString="{0:c}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
<asp:BoundField DataFormatString="{0:c}" DataField="Saldo" ItemStyle-CssClass="margenbound" HeaderText="Saldo" />
<asp:BoundField DataFormatString="{0:c}" DataField="Abonado" ItemStyle-CssClass="margenbound" HeaderText="Abonado" />
</Columns>
</asp:GridView>
</div>

View File

@@ -32,7 +32,6 @@ Partial Class General_RepIndicadorResumen
Dim ObjVentas As New ClsVentas
Dim ObjCompras As New ClsCompras
Dim ObjMovtos As New ClsMovimientos
Dim ObjCitrus As New ClsCGame
Dim Grupo As Integer = 28 'Clasificación - PS
@@ -41,9 +40,14 @@ Partial Class General_RepIndicadorResumen
GvVxP.DataSource = ObjVentas.DtResultados
End If
If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1,
UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveProveedorClasificacion:=192) Then
GvCompProductores.DataSource = ObjCompras.DtResultados.FiltraParametros("", "Cantidad DESC")
End If
If ObjCitrus.GetIndicadores(UsuarioActual.CveEmpresa, TxtFechaI.Text, TxtFechaF.Text, UsuarioActual.CveUsuario, DdlSubProyecto.SelectedValue.ToEntero) Then
'Compras Productores
GvCompProductores.DataSource = ObjCitrus.DTSetResultados.Tables(0).FiltraParametros("", "RazonSocial ASC")
'GvCompProductores.DataSource = ObjCitrus.DTSetResultados.Tables(0).FiltraParametros("", "RazonSocial ASC")
'CxP Productores
GvCxP192.DataSource = ObjCitrus.DTSetResultados.Tables(1).FiltraParametros("", "CveMoneda,Saldo DESC")
'CxP NO productores
@@ -55,6 +59,7 @@ Partial Class General_RepIndicadorResumen
End If
ObjVentas.Dispose()
ObjCompras.Dispose()
ObjCitrus.Dispose()
GvVxP.DataBind()
@@ -167,28 +172,11 @@ Partial Class General_RepIndicadorResumen
End Sub
Dim CompProductoresTotales As Decimal() = New Decimal(5 - 1) {}
Protected Sub GvCompProductores_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompProductores.RowDataBound
'Esto tambien se podría meter en el Stored Procedure
If e.Row.RowType = DataControlRowType.DataRow Then
CompProductoresTotales(0) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "Cantidad"), 0))
CompProductoresTotales(1) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "SubTotal"), 0))
CompProductoresTotales(2) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "PUPromedioKG"), 0))
CompProductoresTotales(3) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "Saldo"), 0))
CompProductoresTotales(4) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "Abonado"), 0))
ElseIf e.Row.RowType = DataControlRowType.Footer Then
'Movemos el pie a la primera fila de la tabla
Dim footerRow As GridViewRow = e.Row
GvCompProductores.Controls(0).Controls.Remove(footerRow)
GvCompProductores.Controls(0).Controls.AddAt(1, footerRow)
'Ahora se registran los datos
e.Row.Cells(0).Text = "Totales"
e.Row.Cells(1).Text = CompProductoresTotales(0).ToString("N")
e.Row.Cells(2).Text = CompProductoresTotales(1).ToString("C")
e.Row.Cells(3).Text = (CompProductoresTotales(2) / GvCompProductores.Rows.Count).ToString("C") 'Promedio
e.Row.Cells(4).Text = CompProductoresTotales(3).ToString("C")
e.Row.Cells(5).Text = CompProductoresTotales(4).ToString("C")
For i As Integer = 1 To e.Row.Cells.Count - 1
e.Row.Cells(i).CssClass = "margenbound"
Next
If e.Row.DBCampo("Orden") = "00ND" Then
e.Row.CssClass = "Totales"
e.Row.Cells(0).Text = "Total " + e.Row.DBCampo("Moneda")
End If
End If
End Sub
Protected Sub GvComprasAcreed_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompAcreed.RowDataBound
@@ -257,13 +245,15 @@ Partial Class General_RepIndicadorResumen
DtCompProductores.Columns.Add("UnidadC")
DtCompProductores.Columns.Add("UnidadI")
For Each Dr As DataRow In GvCompProductores.DataSource.Rows
Dim Row = DtCompProductores.NewRow()
Row("Texto") = Dr("RazonSocial").ToString
Row("Cantidad") = Dr("Cantidad").ToString.FormatoNumero
Row("Importe") = Dr("SubTotal").ToString.FormatoNumero
Row("UnidadC") = "Kg"
Row("UnidadI") = "MXN"
DtCompProductores.Rows.Add(Row)
If Not Dr("Orden").ToString = "00ND" Then
Dim Row = DtCompProductores.NewRow()
Row("Texto") = Dr("GPO").ToString
Row("Cantidad") = Dr("Cantidad").ToString.FormatoNumero
Row("Importe") = Dr("SubTotal").ToString.FormatoNumero
Row("UnidadC") = "Kg"
Row("UnidadI") = "MXN"
DtCompProductores.Rows.Add(Row)
End If
Next
Dim comp_productores = From s In DtCompProductores.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Cantidad = s("Cantidad").ToString().ToDouble(), .Importe = s("Importe").ToString().ToDouble(), .UnidadC = s("UnidadC").ToString(), .UnidadI = s("UnidadI").ToString()}
Dim group_comp_productores = comp_productores.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {

View File

@@ -94,7 +94,7 @@
If ObjNom.GetPeriodos(-1, -1, -1, -1, -1) Then Application("GlobalDTNominasPeriodos") = ObjNom.DtResultados Else Application("GlobalDTNominasPeriodos") = Nothing
If ObjNom.GetBancos Then Application("GlobalDTNomSatBancos") = ObjNom.DtResultados Else Application("GlobalDTNomSatBancos") = Nothing
If ObjNom.GetConceptos Then Application("GlobalDTNomSatConceptos") = ObjNom.DtResultados Else Application("GlobalDTNomSatConceptos") = Nothing
If ObjNom.GetRegimenContratacion Then Application("GlobalDTNomSatRegimenContratacion") = ObjNom.DtResultados Else Application("GlobalDTNomSatRegimenContratacion") = Nothing
'If ObjNom.GetRegimenContratacion Then Application("GlobalDTNomSatRegimenContratacion") = ObjNom.DtResultados Else Application("GlobalDTNomSatRegimenContratacion") = Nothing
If ObjNom.GetRiesgoPuesto Then Application("GlobalDTNomSatRiesgoPuesto") = ObjNom.DtResultados Else Application("GlobalDTNomSatRiesgoPuesto") = Nothing
If ObjNom.GetTipoIncapacidad Then Application("GlobalDTNomSatTipoIncapacidad") = ObjNom.DtResultados Else Application("GlobalDTNomSatTipoIncapacidad") = Nothing
End Using

View File

@@ -196,6 +196,11 @@
<asp:DropDownList ID="DdlUsuarioAsignado" runat="server" CssClass="form-control input-sm select2me" DataTextField="Nombre" DataValueField="CveUsuario" Style="width: 95px; height: 30px; display: inline-block;">
</asp:DropDownList>
</div>
<label class="colf-1">Moneda</label>
<div class="colf-2">
<asp:DropDownList ID="DdlMoneda" runat="server" CssClass="form-control input-sm select2me" DataTextField="Moneda" DataValueField="CveMoneda" Style="width: 95px; height: 30px; display: inline-block;">
</asp:DropDownList>
</div>
</div>
<div class="row rownomargin">
@@ -269,18 +274,16 @@
<asp:UpdatePanel ID="UpBusqueda" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="padding-bottom: 13px;">
<div class="col-md-3" runat="server">
</div>
<div class="row" style="display:flex; justify-content:flex-end; padding-bottom: 12px; padding-right: 15px;">
<asp:UpdatePanel class="col-md-4" ID="UPPIndicador" UpdateMode="Conditional" runat="server">
<asp:UpdatePanel class="col-md-4" style="min-width: 450px;" ID="UPPIndicador" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div id="DivIndicadores" align="Right" runat="server" visible="false">
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="col-md-4">
<div style="display:flex; align-items:flex-end;">
<div id="DivPorAtender" runat="server" visible="false">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvPorAtender.ClientID) %>" style="display: inline-block; width: 200px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvPorAtender.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>

View File

@@ -63,6 +63,7 @@ Partial Class RepOC
CargaProyectos()
'CargaSubProyectos()
CargaUsuarios()
CargaMonedas()
CargaProveedores()
CargaEstatus()
CargaActivoFijo()
@@ -122,6 +123,11 @@ Partial Class RepOC
DdlUsuarioAutorizo.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Protected Sub CargaMonedas()
DdlMoneda.DataSource = GlobalDTMonedas
DdlMoneda.DataBind()
DdlMoneda.Items.Insert(0, New ListItem("Todas", "-1"))
End Sub
Protected Sub CargaProveedores()
If (UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1") Then
DdlProveedores.setEsWebService(True)
@@ -380,7 +386,7 @@ Partial Class RepOC
DdlEstatus.SelectedValue.ToEntero, FI, FF, -1, DdlProveedores.SelectedValue.ToEntero, If(txtFolio.Text.ToEntero = 0, -1, txtFolio.Text.ToEntero), ddlUsuario.SelectedValue.ToEntero,
If(CheckNoCompleta.Checked, -1, UsuarioActual.CveUsuario), UsuarioActual.Empresa.CveEmpresa, If(DDlPS.SelectedValue = "", -1, DDlPS.SelectedValue.ToEntero), If(CheckNoCompleta.Checked, True, False),
ddlcliente.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False),
CveUsuarioAutorizo:=DdlUsuarioAutorizo.SelectedValue.ToEntero(), CveUsuarioAsignado:=DdlUsuarioAsignado.SelectedValue.ToEntero(), EntregaDirecta:=DdlEntregaDirecta.SelectedValue.ToEntero()) Then
CveUsuarioAutorizo:=DdlUsuarioAutorizo.SelectedValue.ToEntero(), CveUsuarioAsignado:=DdlUsuarioAsignado.SelectedValue.ToEntero(), EntregaDirecta:=DdlEntregaDirecta.SelectedValue.ToEntero(), CveMoneda:=DdlMoneda.SelectedValue.ToEntero()) Then
GvConsultar.DataSource = OC.DtResultados
DtOC = OC.DtResultados

View File

@@ -1194,7 +1194,7 @@ Partial Class RH_CatPersonal
TxtCURP.Text.Trim, "", "", "", -1, CveSATRiesgoPuesto, DdlRegimenContratacion.SelectedValue.ToEntero,
-1, DdlSubProyectoAsignadoAdd.SelectedValue.ToEntero, "",
DdlSupervisor.SelectedValue.ToEntero, "", "", DdlJornada.SelectedValue.ToEntero, -1, "-1",
0, "Seleccione", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, CveUniforme:=-1,
0, "Seleccione", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, "", -1, CveUniforme:=-1,
TelefonoExtension:="", CelularPersonal:="", TelefonoMarcadoRapido:="", ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=isSindicalizado, CvePais:=151,
CveMedioTransporte:=DdlMedioTransporte.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero()
) Then

View File

@@ -328,6 +328,11 @@
<label for="<%= TxtTelefonoEmergencia.ClientID.ToString()%>">Contacto en caso de emergencia (nombre y teléfono):</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtBeneficiario" runat="server" MaxLength="70"></asp:TextBox>
<label for="<%= TxtBeneficiario.ClientID.ToString()%>">Beneficiario:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtCelular" runat="server" MaxLength="10"></asp:TextBox>
<label for="<%= TxtCelular.ClientID.ToString()%>">Celular Empresa: </label>

View File

@@ -1644,6 +1644,7 @@ Partial Class RH_Personal
TxtEstado.Text = ObjPersonal.Estado
TxtTelefono.Text = ObjPersonal.Telefono
TxtTelefonoEmergencia.Text = ObjPersonal.TelefonoEmergencia
TxtBeneficiario.Text = ObjPersonal.Beneficiario
TxtCelular.Text = ObjPersonal.Celular
TxtLugarNacimiento.Text = ObjPersonal.LugarNacimiento.ToString()
TxtCredencialElector.Text = ObjPersonal.CredencialElector
@@ -1965,7 +1966,7 @@ Partial Class RH_Personal
TxtCURP.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(),
DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), URL,
DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text,
DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(),
DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(),
TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(),
Sindicalizado:=ChkSindicalizado.Checked, Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(), CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero, CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero()) Then
@@ -2049,7 +2050,7 @@ Partial Class RH_Personal
DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(),
DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), CvePersonal,
URL, DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text,
DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(),
DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(),
TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveUsuarioModifico:=UsuarioActual.CveUsuario,
CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=If(ChkSindicalizado.Checked, 1, 0), Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(),
CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(), CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero(), EsReserva:=If(chkEsReserva.Checked, 1, 0), Fiscalizable:=If(chkNoFiscalizar.Checked, 0, 1), CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero()) Then
@@ -3699,6 +3700,7 @@ Partial Class RH_Personal
params.Add(New ReportParameter("Estado", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Telefono", ObjPersonal.Telefono))
params.Add(New ReportParameter("TelefonoEmergencia", ObjPersonal.TelefonoEmergencia))
params.Add(New ReportParameter("Beneficiario", ObjPersonal.Beneficiario))
params.Add(New ReportParameter("Celular", ObjPersonal.Celular))
params.Add(New ReportParameter("Correo", ObjPersonal.Correo))
params.Add(New ReportParameter("LugarNacimiento", Now.ToDateTime.ToShortDateString))

View File

@@ -252,7 +252,7 @@
<label class="col-md-1">Agrupador: </label>
<div class="col-md-2">
<asp:DropDownList ID="DdlReporte" runat="server" Style="width: 100% !important;" CssClass="select2me" DataValueField="CveUsuario" DataTextField="Nombre">
<asp:ListItem Value="1" Text="Agregado"></asp:ListItem>
<asp:ListItem Value="1" Text="Mes Acumulado Pesos"></asp:ListItem>
<asp:ListItem Value="2" Text="Por Comprobante"></asp:ListItem>
<asp:ListItem Value="3" Text="Mes Moneda"></asp:ListItem>
</asp:DropDownList>

View File

@@ -42,461 +42,8 @@ Public Class WSApp
ObjPS.Dispose()
End Get
End Property
Property GlobalDTMonedas() As DataTable
Get
GlobalDTMonedas = DirectCast(Application("GlobalDTMonedas"), DataTable)
End Get
Set(value As DataTable)
Application("GlobalDTMonedas") = value
End Set
End Property
Property GlobalDTVtaMetodoPago() As DataTable
Get
GlobalDTVtaMetodoPago = DirectCast(Application("GlobalDTVtaMetodoPago"), DataTable)
End Get
Set(value As DataTable)
Application("GlobalDTVtaMetodoPago") = value
End Set
End Property
Property GlobalDTVtaFormaPago() As DataTable
Get
GlobalDTVtaFormaPago = DirectCast(Application("GlobalDTVtaFormaPago"), DataTable)
End Get
Set(value As DataTable)
Application("GlobalDTVtaFormaPago") = value
End Set
End Property
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose()
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos-{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
Get
If EsPersonaFisica <> -1 Then
Dim Tipo As String = ""
If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1"
Dim Dv As New DataView(DirectCast(Application("GlobalDTSATUsosCFDI"), DataTable), Tipo, " UsoCFDIDescripcion", DataViewRowState.CurrentRows)
GlobalDTSATUsosCFDI = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSATUsosCFDI = DirectCast(Application("GlobalDTSATUsosCFDI"), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Application("GlobalDTSATUsosCFDI") = value
End Set
End Property
Property GlobalDTUsuarios(Optional CveUsuario As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1) As DataTable
Get
Dim Str As New StringBuilder
If CveUsuario <> -1 Then Str.AppendFormat("CveUsuario = {0}", CveUsuario)
If CveEmpresa <> -1 Then Str.AppendFormat(" {0} CveEmpresa = {1}", If(Str.Length > 0, "AND", ""), CveEmpresa)
If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente)
If CveProveedor <> -1 Then Str.AppendFormat(" {0} CveProveedor = {1}", If(Str.Length > 0, "AND", ""), CveProveedor)
If CveUsuario <> -1 OrElse CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTUsuarios"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTUsuarios = Dv.ToTable
Dv.Dispose()
Else
GlobalDTUsuarios = DirectCast(Application("GlobalDTUsuarios"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTUsuarios") = value
End Set
End Property
'Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
' Get
' If CveEmpresa <> -1 Then
' Dim Dv As New DataView(DirectCast(Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
' GlobalDTUnidadesMedida = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTUnidadesMedida = DirectCast(Application("GlobalDTUnidadesMedida"), DataTable)
' End If
' End Get
' Set(value As DataTable)
' Application("GlobalDTUnidadesMedida") = value
' End Set
'End Property
Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTGralCategorias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTGralCategorias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTGralCategorias = DirectCast(Application("GlobalDTGralCategorias"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTGralCategorias") = value
End Set
End Property
Private ReadOnly Property GlobalDTProyectos(CveEmpresa As Integer, Optional Estatus As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 OrElse Estatus <> -1 Then 'OrElse CveProyecto <> -1
Dim StrSQL As New StringBuilder
If CveEmpresa <> -1 Then StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
' If CveProyecto <> -1 Then StrSQL.AppendFormat(" {0} CveProyecto = {1}", If(StrSQL.Length > 0, "AND", ""), CveProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" {0} CveEstatus = {1}", If(StrSQL.Length > 0, "AND", ""), Estatus)
Dim Dv As New DataView(DirectCast(Application("GlobalDTProyectos"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProyectos = DirectCast(Application("GlobalDTProyectos"), DataTable)
End If
End Get
End Property
Property GlobalDTVendedores(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTVendedores"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTVendedores = Dv.ToTable
Dv.Dispose()
Else
GlobalDTVendedores = DirectCast(Application("GlobalDTVendedores"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTVendedores") = value
End Set
End Property
Property GlobalDTCliente(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTCliente"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTCliente = Dv.ToTable
Dv.Dispose()
Else
GlobalDTCliente = DirectCast(Application("GlobalDTCliente"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTCliente") = value
End Set
End Property
Property GlobalDTOCEstatus(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatus"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTOCEstatus = Dv.ToTable
Dv.Dispose()
Else
GlobalDTOCEstatus = DirectCast(Application("GlobalDTOCEstatus"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTOCEstatus") = value
End Set
End Property
Public Property GlobalTipoCambio(Optional Fecha As Date = MinFecha) As Double
Get
If GlobalTipoCambio <= 0 Then
'sino tiene dato lo recargo por si ya esta insertado
If Fecha = MinFecha Then Fecha = Now
Dim ObjGral As New ClsGenerales
If ObjGral.GetTipoCambio(-1, Fecha) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Application("GlobalTipoCambio") = ObjGral.DtResultados.Rows(0)("TipoCambio").ToString.ToDouble
Else
Application("GlobalTipoCambio") = 0
End If
ObjGral.Dispose()
End If
Return Application("GlobalTipoCambio").ToString.ToDouble
End Get
Set(value As Double)
Application("GlobalTipoCambio") = value
End Set
End Property
Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Then
Dim ObjOC As New ClsOC
If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then
HttpContext.Current.Application(AppNombre) = ObjOC.DtResultados
Else
HttpContext.Current.Application(AppNombre) = Nothing
End If
ObjOC.Dispose()
End If
Dim filtro As New StringBuilder
filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa)
If CveUsuario > 0 Then
filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario)
End If
If Tipo <> "" Then
filtro.AppendFormat(" AND Tipo='{0}'", Tipo)
End If
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
GlobalDTOCEstatusUsuarios = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTOCEstatusUsuarios-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
'Property GlobalDTOCEstatusUsuarios(CveEmpresa As Integer, Optional CveUsuario As Integer = -1, Optional Tipo As String = "") As DataTable
' Get
' If CveEmpresa <> -1 Then
' Dim filtro As New StringBuilder
' filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa)
' If CveUsuario > 0 Then
' filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario)
' End If
' If Tipo <> "" Then
' filtro.AppendFormat(" AND Tipo='{0}'", Tipo)
' End If
' Dim Dv As New DataView(DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
' GlobalDTOCEstatusUsuarios = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTOCEstatusUsuarios = DirectCast(Application("GlobalDTOCEstatusUsuarios"), DataTable)
' End If
' End Get
' Set(value As DataTable)
' Application("GlobalDTOCEstatusUsuarios") = value
' End Set
'End Property
Property GlobalDTCompProveedores(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTCompProveedores"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTCompProveedores = Dv.ToTable
Dv.Dispose()
Else
GlobalDTCompProveedores = DirectCast(Application("GlobalDTCompProveedores"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTCompProveedores") = value
End Set
End Property
Public Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
If CveEmpresa <> -1 Then
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
End If
Dim Cons = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow))
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
If PSCodigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!PSCodigo) = PSCodigo))
If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS))
Try
GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
Catch ex As Exception
GlobalDTPSSimplificado = New DataTable
End Try
Else
GlobalDTPSSimplificado = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
Dim Dv As New DataView(DirectCast(Application("GlobalDTClasificaciones"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTClasificaciones = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClasificaciones = DirectCast(Application("GlobalDTClasificaciones"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTClasificaciones") = value
End Set
End Property
Property GlobalDTTurno(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTTurno"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTTurno = Dv.ToTable
Dv.Dispose()
Else
GlobalDTTurno = DirectCast(Application("GlobalDTTurno"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTTurno") = value
End Set
End Property
Property GlobalDTDepartamentos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTDepartamentos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTDepartamentos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTDepartamentos = DirectCast(Application("GlobalDTDepartamentos"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTDepartamentos") = value
End Set
End Property
Property GlobalDTRHPuestos(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTRHPuestos"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTRHPuestos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTRHPuestos = DirectCast(Application("GlobalDTRHPuestos"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTRHPuestos") = value
End Set
End Property
Property GlobalDTMetodosPago() As DataTable
Get
GlobalDTMetodosPago = DirectCast(Application("GlobalDTMetodosPago"), DataTable)
End Get
Set(value As DataTable)
Application("GlobalDTMetodosPago") = value
End Set
End Property
Property GlobalDTAsistenciasInasistencias(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTAsistenciasInasistencias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTAsistenciasInasistencias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAsistenciasInasistencias = DirectCast(Application("GlobalDTAsistenciasInasistencias"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTAsistenciasInasistencias") = value
End Set
End Property
Property GlobalDTMotivosHorasExtras(CveEmpresa As Integer) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTMotivosHorasExtras"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTMotivosHorasExtras = Dv.ToTable
Dv.Dispose()
Else
GlobalDTMotivosHorasExtras = DirectCast(Application("GlobalDTMotivosHorasExtras"), DataTable)
End If
End Get
Set(value As DataTable)
Application("GlobalDTMotivosHorasExtras") = value
End Set
End Property
Public Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim ObjUnidadesMedida As New ClsUnidadesMedida()
If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
ObjUnidadesMedida.Dispose()
End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedida = Dv.ToTable
Dv.Dispose()
Else
GlobalDTUnidadesMedida = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida-{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
#End Region
Public Property CveEmpresa As Integer = 143