This commit is contained in:
2024-08-29 19:22:04 -07:00
44 changed files with 6010 additions and 4253 deletions

View File

@@ -0,0 +1,134 @@
Option Strict On
Option Explicit On
Imports Extensiones
<Serializable>
Public Class CFDITimbreRetenciones
Private StrMsg As StringBuilder
Public Property Retencion As CFDIRetencion
Public Property CFDIRelacionados As CFDIRelacionados
Public Property Fecha As DateTime
Public Property Emisor As CFDIEmisor
Public Property Receptor As CFDIReceptorR
Public Property RetencionesImpuestos As List(Of CFDIImpuestosRetenidos)
Public Property ISRCorrespondiente As Decimal = 0
'Public Property Complementos As CFDIComplementos
Public Property Timbrado As Boolean
Public Property IStimbreFiniquito As Boolean
Public ReadOnly Property TotalOperacionRetenidos As Decimal
Get
Return (From c In RetencionesImpuestos
Where c.ImpuestoRetencion = "001"
Select c.MontoRetencion).Sum
End Get
End Property
Public ReadOnly Property TotalImpuestosGravado As Decimal
Get
Return (From c In RetencionesImpuestos
Where c.ImpuestoRetencion = "001"
Select c.MontoRetencion).Sum
End Get
End Property
Public ReadOnly Property TotalImpuestosRetenidos As Decimal
Get
Return (From c In RetencionesImpuestos
Where c.ImpuestoRetencion = "001"
Select c.MontoRetencion).Sum
End Get
End Property
Public ReadOnly Property TotalImpuestosExento As Decimal
Get
Return (From c In RetencionesImpuestos
Where c.ImpuestoRetencion = "001"
Select c.MontoRetencion).Sum
End Get
End Property
'Public ReadOnly Property Retenciones As List(Of CFDIRetenciones)
' Get
' Dim tRetorno As New List(Of CFDIRetenciones)
' Dim TRetenciones As New List(Of CFDIRetenciones)
' For Each c As CFDIConceptos In Conceptos
' For Each imp As CFDIConceptosImpuestos In c.Impuestos
' If imp.TrasladooRetencion = "R" Then
' tRetorno.Add(New CFDIRetenciones With {.Impuesto = imp.Impuesto, .Importe = imp.Importe})
' 'If imp.Impuesto = "001" Then RetencionISR += imp.Importe
' 'If imp.Impuesto = "002" Then RetencionIVA += imp.Importe
' 'If imp.Impuesto = "003" Then RetencionIEPS += imp.Importe
' End If
' Next
' Next
' If tRetorno.Count > 0 Then
' TRetenciones = tRetorno.GroupBy(Function(t) New With {Key t.Impuesto}) _
' .Select(Function(t) New CFDIRetenciones With {.Impuesto = t.Key.Impuesto,
' .Importe = t.Sum(Function(tt) tt.Importe)}) _
' .OrderBy(Function(x) x.Impuesto).ToList
' End If
' 'If RetencionISR > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "001", .Importe = RetencionISR})
' 'if RetencionIVA > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "002", .Importe = RetencionIVA})
' 'If RetencionIEPS > 0 Then Retorno.Add(New CFDIRetenciones With {.Impuesto = "003", .Importe = RetencionIEPS})
' tRetorno = Nothing
' Return TRetenciones
' End Get
'End Property
Public ReadOnly Property Mensaje As String
Get
Return StrMsg.ToString
End Get
End Property
Sub New()
StrMsg = New StringBuilder
Retencion = New CFDIRetencion
CFDIRelacionados = New CFDIRelacionados
Emisor = New CFDIEmisor
Receptor = New CFDIReceptorR
RetencionesImpuestos = New List(Of CFDIImpuestosRetenidos)
'Complementos = New CFDIComplementos
End Sub
Public Sub AddMsg(Msg As String)
StrMsg.AppendLine(Msg)
End Sub
End Class
<Serializable>
Public Class CFDIRetencion
Public Property Version As String
Public Property Serie As String = ""
Public Property Folio As String = ""
Public ReadOnly Property SerieFolio As String
Get
'sino tiene serie no pone el guión
Return If(Serie = "", Folio, $"{Serie}-{Folio}")
End Get
End Property
Public Property ClaveRetencion As String = "28"
Public Property Fecha As Date
Public Property LugarExpedicion As String = ""
Public Property PeriodoMesInicio As String = ""
Public Property PeriodoMesFin As String = ""
Public Property PeriodoEjercicio As Integer = 0
End Class
<Serializable>
Public Class CFDIReceptorR
Public Property RFCR As String
Public Property NombreDenominacionR As String
Public Property NacionalidadR As String = "Nacional"
Public Property DomicilioFiscalR As String = ""
End Class
Public Class CFDIImpuestosRetenidos
Public Property BaseRetencion As Decimal = 0.00D
Public Property ImpuestoRetencion As String = "" '001,002,003
Public Property MontoRetencion As Decimal = 0.00D ' propiedad utilizada solo para hacer ajustes, por default toma la multiplicación de base * tasa
Public Property TipoPagoRetencion As String = ""
Public Property BaseRetencionGravado As Decimal = 0.00D
Public Property BaseRetencionExento As Decimal = 0.00D
End Class

View File

@@ -3599,6 +3599,32 @@ Public Class ClsContabilidad
Return Retorno
End Function
Public Function GetLibroMayor2(CveCuenta As Integer, FechaI As Date, FechaF As Date, CveMoneda As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, TipoReporte As String, OpcionCuentas As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta_LibroMayor2Get")
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Tipo", SqlDbType.Int).Value = TipoReporte
.Add("@OpcionCuentas", SqlDbType.Int).Value = OpcionCuentas
End With
SqlAdapter.SelectCommand.CommandTimeout = 0
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
Me.OnError("Ocurrió un error al obtener los Movimientos Libro mayor", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function PolizaGet(CvePoliza As Integer) As Boolean
Dim Retorno As Boolean = False

View File

@@ -4495,24 +4495,24 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function UpdateOSEstatusInventario(CveOS As Integer, Estatus As Boolean, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OS_OSEstatusInventarioUpdate")
With SqlAdapter.SelectCommand.Parameters
Public Function UpdateOSEstatusInventario(CveOS As Integer, Estatus As Boolean, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OS_OSEstatusInventarioUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveOS", SqlDbType.Int).Value = CveOS
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el estatus de OS.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el estatus de OS.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region

View File

@@ -1539,7 +1539,7 @@ Public Class ClsMovimientos
Public Function GetRepRecuperacion(FechaI As Date, FechaF As Date, CveCliente As Integer, CveSubProyecto As Integer,
CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String,
CveEmpresa As Integer, Gpo As Integer, CveResponsable As Integer,
Optional TipoDocto As String = "-1",
Optional TipoDocto As String = "-1", Optional CveProyecto As Integer = -1,
Optional EstatusCliente As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
Optional CveBanco As Integer = -1, Optional CveCuenta As Integer = -1,
Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1,
@@ -1554,6 +1554,7 @@ Public Class ClsMovimientos
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
@@ -1588,7 +1589,7 @@ Public Class ClsMovimientos
End Try
Return Retorno
End Function
Public Function GetRepRecuperacionPerido(FechaI As Date, FechaF As Date, CveCliente As Integer, CveSubProyecto As Integer,
Public Function GetRepRecuperacionPerido(FechaI As Date, FechaF As Date, CveCliente As Integer, CveProyecto As Integer, CveSubProyecto As Integer,
CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, IVA As String,
CveEmpresa As Integer, Gpo As Integer, CveResponsable As Integer,
TipoDocto As String, EstatusCliente As Integer, CveUsuarioConsulta As Integer,
@@ -1600,6 +1601,7 @@ Public Class ClsMovimientos
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
@@ -1627,7 +1629,7 @@ Public Class ClsMovimientos
Public Function GetRepRecuperacionDetalle(FechaI As Date, FechaF As Date, CveCliente As Integer, CveSubProyecto As Integer,
CveVendedor As Integer, CveUsuario As Integer, CveClienteSucursal As Integer,
CveEstatus As Integer, IVA As String, Agrupador As Integer, CveEmpresa As Integer,
CveResponsable As Integer, Optional TipoDocto As String = "-1",
CveResponsable As Integer, Optional TipoDocto As String = "-1", Optional CveProyecto As Integer = -1,
Optional CveUsuarioConsulta As Integer = -1, Optional CveBanco As Integer = -1,
Optional CveCuenta As Integer = -1, Optional Grupo As String = "-1",
Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0,
@@ -1644,6 +1646,7 @@ Public Class ClsMovimientos
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario

View File

@@ -1670,7 +1670,8 @@ 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, Optional CveMoneda As Integer = -1, Optional MetodoPago As Integer = -1) As Boolean
Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveMoneda As Integer = -1,
Optional MetodoPago As Integer = -1, Optional Serie As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraRep")
@@ -1701,6 +1702,7 @@ Public Class ClsOC
.Add("@TopSelect", SqlDbType.Int).Value = TopSelect
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago
.Add("@Serie", SqlDbType.VarChar).Value = Serie
End With

View File

@@ -9719,6 +9719,7 @@ Public Class ClsPaginas
PaginaDict.Add("/General/JAMComparativos.aspx".ToUpper(), 643)
PaginaDict.Add("/General/CatMotivoRechazoGuias.aspx".ToUpper(), 729)
PaginaDict.Add("/General/FolioFechaCancelacion.aspx".ToUpper(), -1)
PaginaDict.Add("/General/TimbraRetencion.aspx".ToUpper(), 588)
#Region "####### Q U I T A R #######"
'PaginaDict.Add("/Contratos/Estimaciones.aspx".ToUpper(), -1)
@@ -10172,6 +10173,9 @@ Public Class ClsPaginas
PaginaDict.Add("/Contabilidad/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420)
PaginaDict.Add("/Contabilidad/RepAnexoCatalogoMensualHorizontal.aspx".ToUpper(), -1)
PaginaDict.Add("/Contabilidad/CatBloqueoDiario.aspx".ToUpper(), 680)
PaginaDict.Add("/Contabilidad/LibroMayor2.aspx".ToUpper(), 1353)
#End Region
#Region "Contratos"
'--------------------- C O N T R A T O S - P R E S U P U E S T O S ---------------------
@@ -10822,6 +10826,10 @@ Public Class ClsPaginas
PaginaDict.Add("/Ventas/CatPSSubProyectosVendedores.aspx".ToUpper(), 787)
#End Region
#Region "VIA"
PaginaDict.Add("/VIA/TripsChecks.aspx".ToUpper(), 1351)
PaginaDict.Add("/VIA/RepTripsChecks.aspx".ToUpper(), 1352)
#End Region
#Region "Varios"
'Portal Cliente/Proveedor
PaginaDict.Add("/PortalCliente/PortalCliente.aspx".ToUpper(), 1101)

View File

@@ -34,34 +34,6 @@ Public Class ClsSisUsuarioAutenticacion
End Get
End Property
Public Property CveUsuario As Integer
Public Property Usuario As String
Public Property Nombre As String
Public Property CveRol As Integer
Public Property Correo As String
Public Property CveSupervisa As Integer
Public Property CveAutoriza As Integer
Public Property CveEmpresa As Integer
Public Property CveAlmacen As Integer
Public Property CveEmpresaPredeterminada As Integer
Public Property CvePersonal As Integer
Public Property CveVendedor As Integer
Public Property CveTipoDocumento As String
Public Property Estado As Boolean
Public Property Fecha As DateTime
Public Property Registro As Integer
Public Property UsuarioCreo As String
Public Property Contraseña As String
Public Property EsLogIn As Integer
Public Property FechaUltimoAcceso As Date
Public Property FechaUltimoCambioContraseña As Date
Public Property PolCambiarContraseña As Boolean
Public Property TipoControl As Integer
Public Property CveSubProyecto As Integer
Public Property AsignarAutomaticamenteSubProyecto As Boolean
Public Property AsignarAutomaticamenteOC As Boolean
Public Property DescuentoAutorizado As Double
#End Region
Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing, Optional NombreCadena As String = "Conexion")
@@ -342,7 +314,7 @@ Public Class ClsSisUsuarioAutenticacion
Retorno.Acceso = Data.Rows(0)("Acceso").ToString().ToEntero()
Retorno.CveUsuario = Data.Rows(0)("CveUsuario").ToString().ToEntero()
Retorno.Usuario = Usuario
Retorno.Usuario = Data.Rows(0)("Usuario").ToString()
Retorno.Contraseña = Data.Rows(0)("Contraseña").ToString()
Retorno.Nombre = Data.Rows(0)("Nombre").ToString()
Retorno.CveRol = Data.Rows(0)("CveRol").ToString().ToEntero()
@@ -354,6 +326,7 @@ Public Class ClsSisUsuarioAutenticacion
Retorno.FechaUltimoAcceso = Data.Rows(0)("FechaUltimoAcceso").ToString().ToDate()
Retorno.FechaUltimoCambioContraseña = Data.Rows(0)("FechaUltimoCambioContraseña").ToString().ToDate()
Retorno.ActCambiarContraseña = If(Data.Rows(0)("ActCambiarContraseña").ToString() = "SI", True, False)
'Retorno.PolCambiarContraseña = If(Data.Rows(0)("PolCambiarContraseña").ToString() = "SI", True, False)
Retorno.TipoControl = Data.Rows(0)("TipoControl").ToString().ToEntero()
'*
Retorno.CveProveedor = Data.Rows(0)("CveProveedor").ToString().ToEntero()
@@ -400,6 +373,8 @@ Public Class ClsSisUsuarioAutenticacion
Return Retorno
End Function
'Public Function ValidaUsuarioAsignacion(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
' Dim Retorno As Usuario = Nothing

View File

@@ -575,6 +575,35 @@ Public Class ClsSisUsuarios
Return Retorno
End Function
Public Function UpdateUsuarioContrasenia(Contrasenia As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("UPDATE U SET [Contraseña] = @Contrasenia, FechaUltimoCambioContraseña = GETDATE() FROM Usuarios U WHERE U.CveUsuario = @CveUsuario ", CommandType.Text)
With SqlAdapter.SelectCommand.Parameters
.Add("@Contrasenia", SqlDbType.VarChar).Value = Contrasenia
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Alert("Ya existe un Usuario con el mismo nombre: " & Usuario & ".", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al guardar los cambios en el Usuario", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar los cambios en el Usuario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddUsuarioAsignar(CvePersonal As Integer, CveVendedor As Integer, CveSubProyecto As Integer, CveAlmacen As Integer, CveTipoDocumento As String, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
@@ -723,34 +752,6 @@ Public Class ClsSisUsuarios
Return Retorno
End Function
Public Function UpdateUsuarioContrasenia(Contrasenia As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("UPDATE U SET [Contraseña] = @Contrasenia, FechaUltimoCambioContraseña = GETDATE() FROM Usuarios U WHERE U.CveUsuario = @CveUsuario ", CommandType.Text)
With SqlAdapter.SelectCommand.Parameters
.Add("@Contrasenia", SqlDbType.VarChar).Value = Contrasenia
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("Número: 2627;") Then
Alert("Ya existe un Usuario con el mismo nombre: " & Usuario & ".", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al guardar los cambios en el Usuario", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar los cambios en el Usuario.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function RemoveUsuario(CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False

View File

@@ -433,8 +433,7 @@
<div class="col-xs-12">
<asp:UpdatePanel ID="UpVentas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:CheckBox ID="ChkEmitirComplementoPago" CssClass="md-checksd" Text="Emitir Complemento de Pago" runat="server" align="Right" />
<br />
<asp:GridView ID="GvVentas" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron movimientos" DataKeyNames="CveVenta,SerieFolio,Saldo,Folio,CveCliente,CveMoneda,RetISR,RetIVA,IVA,IEPS,TipoCambio,Total,PorcentajeIVA,CveSubProyecto"
ToolTip="Listado de Movimientos" data-height="200" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None" HeaderStyle-ForeColor="Black">
<Columns>
@@ -485,7 +484,8 @@
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:GridView>
<asp:CheckBox ID="ChkEmitirComplementoPago" CssClass="md-checksd" Text="Emitir Complemento de Pago" runat="server" align="Right" />
</ContentTemplate>
</asp:UpdatePanel>
</div>

View File

@@ -1501,7 +1501,7 @@ Partial Class Bancos_PopIECompras
End If
If RBLContado.SelectedValue.ToEntero = 6 And ChkEmitirComplementoPago.Checked Then GeneraTimbre(CvePrePoliza) Else Alert(StrMsg.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
EnviarCorreoNotificacion(CveIE, NotificarA, "", UsuarioActual, False)
If NotificarA <> "" Then EnviarCorreoNotificacion(CveIE, NotificarA, "", UsuarioActual, False)
Else
ObjIE.RollBack()
@@ -1574,7 +1574,7 @@ Partial Class Bancos_PopIECompras
Banco.IniciaTransacSQL()
If Banco.GeneraTimbrePago(CveIE, -1, UsuarioActual, CvePrePoliza:=CvePrePoliza) Then
If Banco.GeneraTimbrePago(-1, -1, UsuarioActual, CvePrePoliza:=CvePrePoliza) Then
If Banco.Mensaje = "" Then
Banco.Commit()
PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)

View File

@@ -14902,7 +14902,7 @@ Partial Class Compras_Compras
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA)
If ConfirmaVinculacionOCProntoPago() Then
If ConfirmaVinculacionOCProntoPago(AjusteProntoPagoPorcentajeIVA) Then
Vinculacion()
End If
@@ -21246,14 +21246,18 @@ Partial Class Compras_Compras
End Set
End Property
Public Function ConfirmaVinculacionOCProntoPago() As Boolean
Public Function ConfirmaVinculacionOCProntoPago(AjusteProntoPagoPorcentajeIVA As Decimal) As Boolean
If VincularOcProntoPago Then
Return True
Else
Dim StrMsg As String = $"Existe una diferencia de ${(ImporteRNC + ImporteRNCProntoPago).ToString("###,###,###.00")} entre la compra y la Orden de Compra. <br/> Se generaran Remisiones de Nota de Crédito. <br/> - Descuento de ${ImporteRNC.ToString("###,###,###.00")}.<br/>"
If ImporteRNCProntoPago > 0 Then
StrMsg = StrMsg & $"- Pronto pago de ${ImporteRNCProntoPago.ToString("###,###,###.00")}"
Dim TmpImporteRNC As Decimal = If(AjusteProntoPagoPorcentajeIVA > 0, ImporteRNC + (ImporteRNC * AjusteProntoPagoPorcentajeIVA), ImporteRNC)
Dim TmpImporteRNCProntoPago As Decimal = If(AjusteProntoPagoPorcentajeIVA > 0, ImporteRNCProntoPago + (ImporteRNCProntoPago * AjusteProntoPagoPorcentajeIVA), ImporteRNCProntoPago)
Dim StrMsg As String = $"Existe una diferencia de ${(TmpImporteRNC + TmpImporteRNCProntoPago).ToString("###,###,###.00")} entre la compra y la Orden de Compra. <br/> Se generaran Remisiones de Nota de Crédito. <br/> - Descuento de ${TmpImporteRNC.ToString("###,###,###.00")}.<br/>"
If TmpImporteRNCProntoPago > 0 Then
StrMsg = StrMsg & $"- Pronto pago de ${TmpImporteRNCProntoPago.ToString("###,###,###.00")}"
End If
LblModalConfirmaVinculacionProntoPago.Text = StrMsg

View File

@@ -0,0 +1,246 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="LibroMayor2.aspx.vb" Inherits="Conta_LibroMayor2" EnableEventValidation="false" %>
<asp:Content ContentPlaceHolderID="Css" runat="server">
<style>
.truncate {
width: 300px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
table {
border: none !important;
}
tr {
border: none !important;
}
td {
border: none !important;
}
</style>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server" Visible="false"><i class="fa fa-ad-excel" ></i> Generar EXCEL</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="Imprimir" runat="server" Visible="false"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
Libro Mayor
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" CssClass="btn btn-default" OnClick="BtnConsultar_Click" ValidationGroup="Valida" />
<a href="javascript:;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a><%--class="expand"--%>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<div class="col-md-1">
Cuenta:
</div>
<div class="col-md-3">
<asp:DropDownList ID="DdlCuentas" runat="server" AppendDataBoundItems="true" DataTextField="CuentaFormatoNombre" DataValueField="CveCuenta" CssClass="form-control input-sm select2me" Enabled="false">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlCuentas" runat="server" InitialValue="-1" ControlToValidate="DdlCuentas" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpConsulta"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CERFVDdlCuentas" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlCuentas" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1">
Fecha Inicio:
</div>
<div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpConsulta"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpConsulta"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1">
Fecha Fin:
</div>
<div class="col-md-1" style="min-width: 115px">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;">
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpConsulta"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpConsulta"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<div class="col-md-1 ">
Tipo Movto
</div>
<div class="col-md-3 ">
<asp:DropDownList ID="DdlOpcionCuentas" runat="server" DataTextField="Cuenta" DataValueField="CveCuenta" TabIndex="4" CssClass="form-control input-sm select2me" Width="100%">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Con movimientos" Value="1"></asp:ListItem>
<asp:ListItem Text="Saldo actual no igual a cero" Value="2"></asp:ListItem>
<asp:ListItem Text="Con movimientos y saldo no igual a cero" Value="3"></asp:ListItem>
<asp:ListItem Text="Con movimientos o saldo no igual a cero" Value="4"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 " id="tdTipoReporte" visible="false" runat="server">
Tipo
</div>
<div class="col-md-2" id="tdTipoReporte2" visible="false" runat="server">
<asp:DropDownList ID="DdlTipoReporte" CssClass="form-control input-sm select2me" runat="server" Width="100%">
<asp:ListItem Text="Contable" Value="1"></asp:ListItem>
<asp:ListItem Text="Contable y Complementario" Value="3"></asp:ListItem>
<asp:ListItem Text="Complementario" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1" id="divProyecto" runat="server">
<asp:Label ID="LblProyecto" runat="server">Proyecto:</asp:Label>
</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Width="95%">
</asp:DropDownList>
</div>
<asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-1">SubProyecto:</asp:Label>
<div class="col-md-2">
<asp:DropDownList ID="DdlSubproyecto" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="95%" AutoPostBack="True">
</asp:DropDownList>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row" style="margin-right: 10px; margin-top: 8px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" AutoGenerateColumns="False"
EmptyDataText="No se encontrarios movimientos."
DataKeyNames="" OnRowDataBound="GvDatos_RowDataBound">
<Columns>
<asp:TemplateField ControlStyle-CssClass="Widthall">
<HeaderTemplate>
<table width="100%" style="border: none">
<tr>
<td colspan="3"><font size="2">Cuenta</font></td>
<td colspan="1"><font size="2">Nombre</font></td>
<td colspan="4"></td>
<td><font size="2">Saldo Inicial</font></td>
</tr>
<tr>
<td width="60px" align="center">Fecha</td>
<td width="60px" align="center">Tipo</td>
<td width="60px" align="center">Número</td>
<td width="300px" align="left">Concepto</td>
<td width="100px" align="center">Referencia</td>
<td width="100px" align="center">Referencia Movto</td>
<td width="100px" align="center">SubProyecto</td>
<td width="100px" align="center">Cargos</td>
<td width="100px" align="center">Abonos</td>
<td width="100px" align="center">Saldo</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table width="100%" style="border: none">
<tr runat="server" id="tr1">
<td colspan="3" align="left" width="180px">
<asp:Label ID="LbCuenta" runat="server" Text='<%# Eval("Codigo")%>'></asp:Label>
</td>
<td colspan="1" align="left" width="300px">
<asp:Label ID="LbNombre" runat="server" Text='<%# Eval("Nombre")%>'></asp:Label>
</td>
<td colspan="2" width="200px"></td>
<td style="font-weight: normal;" align="right" width="100px">Saldo Inicial:
</td>
<td style="font-weight: normal;" align="right" width="100px">
<asp:Label ID="LbSaldoInicial" runat="server" Text='<%# Eval("SaldoInicial", "{0:N2}")%>'></asp:Label>
</td>
</tr>
<tr runat="server" id="tr2">
<td width="60px" style="border: 0px;" align="center">
<asp:Literal ID="LbFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Literal>
</td>
<td width="60px" style="border: 0px;" align="center">
<asp:Literal ID="LbTipo" runat="server" Text='<%# Eval("TipoPoliza")%>'></asp:Literal>
</td>
<td width="60px" style="border: 0px;" align="center">
<asp:HyperLink ID="HLPoliza" runat="server" Text='<%# Eval("Folio")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</td>
<td width="300px" align="left">
<div class="truncate" style="width: 300px;">
<asp:Label ID="LbConcepto" runat="server" CssClass="truncate" Text='<%# Eval("Concepto")%>' title='<%# Eval("Concepto")%>'></asp:Label>
</div>
</td>
<td width="100px">
<asp:Label ID="LbReferencia" runat="server" Text='<%# Eval("Referencia")%>'></asp:Label>
</td>
<td width="60px" style="border: 0px;" align="center">
<asp:Literal ID="LtlRefMovto" runat="server" Text='<%# Eval("ReferenciaAdmin")%>'></asp:Literal>
</td>
<td width="100px">
<asp:Label ID="LblSubProyecto" runat="server" Text='<%# Eval("SubProyecto")%>'></asp:Label>
</td>
<td width="100px" align="right">
<asp:Label ID="LbCargos" runat="server"></asp:Label>
</td>
<td width="100px" align="right">
<asp:Label ID="LbAbonos" runat="server"></asp:Label>
</td>
<td width="100px" align="right">
<asp:Label ID="LbSaldo" runat="server"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
<ItemStyle />
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
</script>
</asp:Content>

View File

@@ -0,0 +1,456 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Conta_LibroMayor2
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property DtDatos As DataTable
Get
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
Private Property DtTotales As DataTable
Get
DtTotales = DirectCast(ViewState("DtTotales"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtTotales") = value
End Set
End Property
Private Property FechaInicio As Date
Get
FechaInicio = ViewState("FechaInicio").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaInicio") = value
End Set
End Property
Private Property FechaFin As Date
Get
FechaFin = ViewState("FechaFin").ToString.ToDate
End Get
Set(value As Date)
ViewState("FechaFin") = value
End Set
End Property
Private Property TotalPadre As Boolean
Get
TotalPadre = CBool(ViewState("TotalPadre"))
End Get
Set(value As Boolean)
ViewState("TotalPadre") = value
End Set
End Property
Private Property DTCuentas As DataTable
Get
Return CType(ViewState("DTCuentas"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTCuentas") = value
End Set
End Property
Private Property TipoReporte As String
Get
TipoReporte = ViewState("TP").ToString
End Get
Set(value As String)
ViewState("TP") = value
End Set
End Property
Private Property Cuenta As String
Get
Return ViewState("Cuenta").ToString
End Get
Set(value As String)
ViewState("Cuenta") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
'If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.CveEmpresa <> 119 Then
' Response.Redirect($"/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx")
'End If
Dim ErrorParametros As Boolean = True
CargaTipoCuentas()
'TxtCuenta.Enabled = False
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
If Request("CveCuenta") IsNot Nothing AndAlso IsNumeric(Request("CveCuenta")) AndAlso Request("CveCuenta").ToEntero > 0 Then
If Request("FF") IsNot Nothing AndAlso Request("FF").ToString.Length = 10 AndAlso Request("FF").ToDate > "01/01/1000".ToDate Then
FechaFin = Request("FF").ToDate
txtFechaF.Text = FechaFin.ToShortDateString
DdlCuentas.SelectedValueExist(Request("CveCuenta").ToEntero)
If Request("FI") IsNot Nothing AndAlso Request("FI").ToString.Length = 10 AndAlso Request("FI").ToDate > "01/01/1000".ToDate Then
FechaInicio = Request("FI").ToDate
txtFechaI.Text = FechaInicio.ToShortDateString
Else
FechaInicio = DateSerial(Year(FechaFin), Month(FechaFin), 1)
TxtFechaF.Text = FechaInicio.ToShortDateString
End If
If Request("CveProyecto") IsNot Nothing AndAlso IsNumeric(Request("CveProyecto")) Then
DdlProyecto.SelectedValueExist(Request("CveProyecto"))
DdlProyecto_SelectedIndexChanged(Nothing, Nothing)
End If
If Request("CveSubProyecto") IsNot Nothing AndAlso IsNumeric(Request("CveSubProyecto")) Then
DdlSubproyecto.SelectedValueExist(Request("CveSubProyecto"))
End If
ErrorParametros = False
If Request("TP") IsNot Nothing AndAlso IsNumeric(Request("TP")) AndAlso Request("TP").ToEntero > 0 Then
TipoReporte = Request("TP").ToString
' DdlTipoReporte.SelectedValue = TipoReporte.ToString
End If
''If DdlTipoCuentas.Items.FindByValue(IdCuenta.ToString) IsNot Nothing Then
'' DdlTipoCuentas.SelectedValue = IdCuenta.ToString
''Else
'' DdlTipoCuentas.SelectedValue = "-2"
'' TxtCuenta.Enabled = True
'' If DTCuentas.FiltraParametros(String.Format("Cvecuenta = {0}", IdCuenta)).Rows.Count > 0 Then
'' TxtCuenta.Text = DTCuentas.FiltraParametros(String.Format("CveCuenta = {0}", IdCuenta)).Rows(0)("Codigo").ToString
'' End If
''End If
End If
End If
If Not ErrorParametros Then
TotalPadre = True
TipoReporte = "1"
CargaDatos()
End If
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
If DdlCuentas.SelectedValue.ToEntero = -2 Then
Alert("El campo Cuenta es obligatorio.", TipoMensaje.MsgError)
Else
FechaInicio = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", NowADS(), txtFechaI.Text.ToDate)
FechaFin = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", NowADS(), txtFechaF.Text.ToDate)
CargaDatos()
End If
' Imprimir_click(sender, e)
'RegistraScript("Enable();")
End Sub
#Region "C A R G A - D A T O S"
Public Function WSCuentas() As String
Dim Str As New StringBuilder
Dim i As Integer = 0
Dim dt As DataTable = DTCuentas
For Each dr As DataRow In dt.Rows
i += 1
Str.AppendFormat("{{value:""{0}"",label:""{1}""}}{2}", dr("CveCuenta"), dr("Codigo").ToString.Replace("""", ""), If(i < dt.Rows.Count, ",", ""))
Next
Return Str.ToString
End Function
Private Sub CargaTipoCuentas()
Dim ObjTipoCuenta As New ClsContabilidad
DdlCuentas.Enabled = True
If ObjTipoCuenta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
DTCuentas = ObjTipoCuenta.DtResultados
DdlCuentas.DataSource = ObjTipoCuenta.DtResultados.FiltraParametros("Codigo NOT IN ('_ACTIVO', '_PASIVO', '_CAPITAL', '_CUADRE', '_ESTADISTICAS', '_ORDEN', '_RACREEDOR', '_RDEUDOR', '_UTILIDAD')")
End If
ObjTipoCuenta.Dispose()
DdlCuentas.DataBind()
CargarCentrosDeCosto(DdlProyecto, DdlSubproyecto, LblProyecto, LblSubProyecto, divProyecto:=divProyecto)
End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargarSubProyecto(DdlSubproyecto, DdlProyecto.SelectedValue, "Todos")
End Sub
Private Sub CargaDatos()
Dim CveProyecto As Integer = DdlProyecto.SelectedValue.ToEntero
Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero
TipoReporte = DdlTipoReporte.SelectedValue.ToString
'If TipoReporte = "1" And DdlCuentas.SelectedValue.ToEntero < 0 Then
' Alert("No ha seleccionado cuenta, Favor de especificar una", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
Cuenta = DdlCuentas.SelectedItem.ToString
Dim ObjConta As New ClsContabilidad
If ObjConta.GetLibroMayor2(DdlCuentas.SelectedValue.ToEntero, FechaInicio, FechaFin, -1, CveProyecto, CveSubProyecto, UsuarioActual.CveEmpresa, TipoReporte, DdlOpcionCuentas.SelectedValue.ToEntero) Then
DtDatos = ObjConta.DtResultados
DtTotales = DtDatos.Clone
CargaGrid()
Else
DtDatos = Nothing
End If
ObjConta.Dispose()
End Sub
#End Region
Private Sub InsertaTotales()
Dim i As Integer = 0
Dim Aumento As Integer = 0
Dim Row As DataRow
Dim Row2 As DataRow
'Llena DtTotales
For Each dr As DataRow In DtDatos.Rows
If dr("Concepto").ToString = "" Then
Row = DtTotales.NewRow
Row("CveCuenta") = -1
Row("CargosMovto") = If("1" = "1", dr("Cargos"), dr("CargosME"))
Row("AbonosMovto") = If("1" = "1", dr("Abonos"), dr("AbonosME"))
Row("Saldo") = dr("SaldoActual")
Row("CtaMayor") = dr("CtaMayor")
Row("Concepto") = String.Format("Total {0}:", dr("Nombre"))
Row("Nombre") = dr("Nombre")
DtTotales.Rows.Add(Row)
Row("Clasificacion") = i
End If
i += 1
Next
'Inserta Totales en DtDatos
For Each dr As DataRow In DtTotales.Rows
i = 0
If dr("CtaMayor").ToString = "1" Then
DtDatos.ImportRow(dr)
End If
If dr("CtaMayor").ToString = "2" Then
For index As Integer = dr("Clasificacion").ToString.ToEntero + Aumento To DtDatos.Rows.Count
If DtDatos.Rows(index)("Nombre").ToString <> dr("Nombre").ToString Then
i = index
Exit For
End If
Next
Row2 = DtDatos.NewRow
Row2.ItemArray = dr.ItemArray
DtDatos.Rows.InsertAt(Row2, i + Aumento)
Aumento += 1
End If
Next
End Sub
#Region "G R I D - GV DATOS"
Private Sub CargaGrid()
GvDatos.DataSource = DtDatos
'GvDatos.Dispose()
GvDatos.DataBind()
UpDatos.Update()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Concepto") = "" Then
e.Row.ControlStyle.Font.Bold = True
e.Row.ControlStyle.Height = 35
'Cuando es Titulo
If e.Row.DBCampo("SaldoActual") = "" Then
CType(e.Row.FindControl("tr2"), HtmlTableRow).Visible = False
'Cuando Es Total
Else
CType(e.Row.FindControl("tr1"), HtmlTableRow).Visible = False
'Anterior para TotalPadre
'If e.Row.DBCampo("CtaMayor").ToString = "2" And (e.Row.DBCampo("Nivel3").ToString <> "" Xor e.Row.DBCampo("Orden").ToString.Length = 18) Then
' e.Row.FCLabel("LbReferencia").Text = "Total:"
'Else
' e.Row.FCLabel("LbConcepto").Text = String.Format("Total {0}:", e.Row.DBCampo("Nombre").ToString)
'End If
If TotalPadre Then
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Width = "1px"
'CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells.Remove(CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3))
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Align = "Right"
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Width = "400px"
If e.Row.RowIndex + 1 = DtDatos.Rows.Count Then
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(4).Attributes.Add("style", "border-top: 1px solid black;")
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(5).Attributes.Add("style", "border-top: 1px solid black;")
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(6).Attributes.Add("style", "border-top: 1px solid black;")
End If
e.Row.FCLabel("LbReferencia").Text = String.Format("Total {0}:", e.Row.DBCampo("Nombre").ToString)
Else
TotalPadre = True
e.Row.FCLabel("LbReferencia").Font.Bold = False
e.Row.FCLabel("LbReferencia").Text = "Total:"
CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(4).Align = "Right"
End If
'e.Row.FCLabel("LbReferencia").Text = String.Format("Total {0}:", If(e.Row.DBCampo("CtaMayor").ToString = "2", "", e.Row.DBCampo("Nombre").ToString))
e.Row.FCLabel("LbCargos").Text = e.Row.DBCampo("Cargos").ToString.FormatoNumero(If("1" = "1", 2, 4))
e.Row.FCLabel("LbAbonos").Text = e.Row.DBCampo("Abonos").ToString.FormatoNumero(If("1" = "1", 2, 4))
e.Row.FCLabel("LbSaldo").Text = e.Row.DBCampo("SaldoActual").ToString.FormatoNumero(If("1" = "1", 2, 4))
End If
Else
TotalPadre = False
e.Row.ControlStyle.Font.Bold = False
CType(e.Row.FindControl("tr1"), HtmlTableRow).Visible = False
e.Row.FCHyperLink("HLPoliza").NavigateUrl = String.Format("/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}", e.Row.DBCampo("CvePoliza"))
If e.Row.DBCampo("CargosMovto").ToDouble <> 0 Then e.Row.FCLabel("LbCargos").Text = e.Row.DBCampo("CargosMovto").ToString.FormatoNumero(If("1" = "1", 2, 4))
If e.Row.DBCampo("AbonosMovto").ToDouble <> 0 Then e.Row.FCLabel("LbAbonos").Text = e.Row.DBCampo("AbonosMovto").ToString.FormatoNumero(If("1" = "1", 2, 4))
If e.Row.DBCampo("Saldo").ToDouble <> 0 Then e.Row.FCLabel("LbSaldo").Text = e.Row.DBCampo("Saldo").ToString.FormatoNumero(If("1" = "1", 2, 4))
End If
'COLOREA NEGATIVOS
If e.Row.FCLabel("LbCargos").Text.ToDouble < 0 Then
e.Row.FCLabel("LbCargos").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbCargos").ForeColor = Drawing.Color.Black
End If
If e.Row.FCLabel("LbAbonos").Text.ToDouble < 0 Then
e.Row.FCLabel("LbAbonos").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbAbonos").ForeColor = Drawing.Color.Black
End If
If e.Row.FCLabel("LbSaldo").Text.ToDouble < 0 Then
e.Row.FCLabel("LbSaldo").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbSaldo").ForeColor = Drawing.Color.Black
End If
If e.Row.FCLabel("LbSaldoInicial").Text.ToDouble < 0 Then
e.Row.FCLabel("LbSaldoInicial").ForeColor = Drawing.Color.Red
Else
e.Row.FCLabel("LbSaldoInicial").ForeColor = Drawing.Color.Black
End If
End If
End Sub
#End Region
Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click
If DdlCuentas.SelectedValue.ToEntero = -1 Then
Alert("El campo Cuenta es obligatorio.", TipoMensaje.MsgError)
Else
FechaInicio = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", NowADS(), txtFechaI.Text.ToDate)
FechaFin = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", NowADS(), txtFechaF.Text.ToDate)
DtDatos = DtDatos
ImprimirReporte()
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
ImprimirReporte("Excel")
'Dim htmlTabe As New HtmlTable
'Dim RutaLogo As String = $"{UsuarioActual.Empresa.Ruta}Logo.png"
'Dim strinLiteral As String = ""
'Dim EncabezadoLiteral As New LiteralControl
'If System.IO.File.Exists(RutaLogo) Then
' RutaLogo = $"http://{Request.Url.Host }/Empresas/{UsuarioActual.CveEmpresa}/Logo.png"
' strinLiteral = $"<table style='width:{ GvDatos.Width }px'><tr>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'><img width='200px' height='150px' style='max-height:150px!important;max-width:200px!important' src='{RutaLogo}' /> </td>
' <td colspan='3' style='width:70%;height:150px; text-align:center; vertical-align:middle;font-weight: bold; display: block;'><p><span>{UsuarioActual.Empresa.Empresa} </span><br><span> Movimientos Auxiliares del Catálogo<p></td>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'> Fecha:{NowADS().ToString("dd/MM/yyyy")}</td>
' </tr>
' <tr>
' <td style='text-align:left;' colspan='6'>
' <b>Filtros Cuenta:</b> {DdlCuentas.SelectedItem.Text} <b>Fecha inicio: </b>{ TxtFechaDel.Text} <b>Fecha Fin:</b> {TxtFechaAl.Text}
' <td>
' </tr>
' </table>"
'Else
' strinLiteral = $"<table style='width:{ GvDatos.Width }px'><tr>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'> </td>
' <td colspan='3' style='width:70%;height:150px; text-align:center; vertical-align:middle;font-weight: bold; display: block;'><p><span>{UsuarioActual.Empresa.Empresa} </span><br><span> Movimientos Auxiliares del Catálogo<p></td>
' <td colspan='3' style='width:15%;height:150px; text-align:center; vertical-align:middle;font-weight: bold;'> Fecha:{NowADS().ToString("dd/MM/yyyy")}</td>
' </tr>
' <tr>
' <td style='text-align:left;' colspan='9'>
' <b>Filtros Cuenta:</b> {DdlCuentas.SelectedItem.Text} <b>Fecha inicio: </b>{ TxtFechaDel.Text} <b>Fecha Fin:</b> {TxtFechaAl.Text}
' <td>
' <tr>
' </table>"
'End If
'EncabezadoLiteral.Text = strinLiteral
'GvDatos.ExportToExcel($"MovimientosAuxiliares_{NowADS().ToString("yyyyMMddmmss")}", Encabezado2:=EncabezadoLiteral)
End Sub
Private Sub ImprimirReporte(Optional Formato As String = "PDF")
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")
params.Add(New ReportParameter("pImg", If(Imagen.Exists, $"file://{Imagen.FullName}", "")))
params.Add(New ReportParameter("pFechaFin", FechaFin.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("pFechaInicio", FechaInicio.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("CveMoneda", "1"))
params.Add(New ReportParameter("Cuenta", Cuenta))
ImprimirPDF("Empresas/Grales/Formatos/RepMovimientosAuxiliaresCatalogo.rdlc", DtDatos, params, "MovimientosAuxiliares", Formato)
End Sub
Public Overrides Sub VerifyRenderingInServerForm(control As Control)
End Sub
End Class

View File

@@ -10,6 +10,9 @@
<asp:LinkButton ID="BtnImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
<%--<asp:ImageButton ID="BtnImprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" Visible="true" /> &nbsp;--%>
</li>
<li>
<asp:LinkButton ID="BtnImprimirPoSubProyecto" runat="server" OnClick="BtnImprimirPoSubProyecto_Click" Visible="false" ><i class="fa fa-print"></i> Imprimir por Sub Proyecto</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">

View File

@@ -5,6 +5,12 @@ Imports System
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports ClosedXML.Excel
Imports Profact.TimbraCFDI40
Imports System.IO
Imports System.Drawing
Partial Class Contabilidad2_RepBalanzaComprobacion
Inherits ClsPaginas
@@ -105,6 +111,10 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
End If
CargarCentrosDeCosto(DdlProyecto, DdlSubproyecto, LblProyecto, LblSubProyecto)
If UsuarioActual.CveRol = 1 Then
BtnImprimirPoSubProyecto.Visible = True
End If
End If
End Sub
@@ -254,4 +264,238 @@ Partial Class Contabilidad2_RepBalanzaComprobacion
ImprimirPDF(reportpath, DtDatos, params, fileName, Formato)
End Sub
Protected Sub BtnImprimirPoSubProyecto_Click(sender As Object, e As EventArgs)
Dim WBAnexoBalanza = New ClosedXML.Excel.XLWorkbook
Dim TipoReporte = DdlTipoReporte.SelectedValue.ToEntero
FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", NowADS(), TxtFechaDel.Text.ToDate)
FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", NowADS(), TxtFechaAl.Text.ToDate)
Dim SPCounter As Integer = 1
For Each drSP As DataRow In GlobalDTSubProyectos(UsuarioActual.CveEmpresa).Rows
Dim ObjConta As New ClsContabilidad
If ObjConta.GetBalanzaComprobacion(FechaInicio, FechaFin, 2, TipoReporte, -1, drSP("CveSubProyecto").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlVista.SelectedValue.ToEntero, DdlNivel.SelectedValue.ToEntero) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del Anexo del Catálogo", TipoMensaje.MsgError)
Exit For
End If
ObjConta.Dispose()
If DtDatos.Rows.Count > 0 Then
WBAnexoBalanza.AddWorksheet(WSDocumento(drSP("SubProyecto").ToString, DtDatos))
Dim spNombre As String = drSP("SubProyecto").ToString().Replace(":", "_").Replace("/", "_").Replace("\", "_").Replace("?", "_").Replace("*", "_").Replace("[", "_").Replace("]", "_")
WBAnexoBalanza.Worksheet(SPCounter).Name = $"{SPCounter}_{spNombre}"
SPCounter = SPCounter + 1
End If
Next
Dim msB = New MemoryStream()
WBAnexoBalanza.SaveAs(msB)
Dim BB As Byte() = msB.ToArray
msB.Dispose()
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment; filename=Balanza_" & Now.ToString("yyyyMMddhhmmss") & ".xlsx")
Response.ContentType = "application/vnd.ms-excel"
Response.BinaryWrite(BB)
Response.End()
End Sub
Function WSDocumento(SubProyecto As String, DtDatos As DataTable) As IXLWorksheet
Dim WBAnexoSalvar = New ClosedXML.Excel.XLWorkbook
Dim WBReporte = New ClosedXML.Excel.XLWorkbook()
WBReporte.Worksheets.Add("1")
Dim WSReporte = WBReporte.Worksheet(1)
Dim RutaLogo As String = String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta)
If File.Exists(RutaLogo) Then
Dim imagePath As String = RutaLogo
Dim img As Bitmap = New Bitmap(imagePath)
Dim picture = WSReporte.AddPicture(img).MoveTo(WSReporte.Cell("A1"))
picture.Scale(0.5)
End If
Dim Tamaniofuente As Integer = 13
Dim Range = WSReporte.Range("A1:D1")
WSReporte.Style.Font.FontSize = 10
WSReporte.Style.Font.FontName = "Arial Narrow"
WSReporte.Style.Alignment.WrapText = True
Range.Merge().Style.Font.SetBold().Font.FontSize = Tamaniofuente
WSReporte.Range("A1:F1").Merge().Style.Font.SetBold().Font.FontSize = Tamaniofuente
WSReporte.Range("A2:F2").Merge().Style.Font.SetBold().Font.FontSize = Tamaniofuente
WSReporte.Range("A3:F3").Merge().Style.Font.SetBold().Font.FontSize = Tamaniofuente
WSReporte.Range("A4:F4").Merge().Style.Font.SetBold().Font.FontSize = Tamaniofuente
WSReporte.Range("A5:F5").Merge().Style.Font.SetBold().Font.FontSize = Tamaniofuente
WSReporte.Range("A1:A5").Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
WSReporte.Column(1).Width = 15
WSReporte.Column(2).Width = 35
WSReporte.Column(3).Width = 14
WSReporte.Column(4).Width = 14
WSReporte.Column(5).Width = 14
WSReporte.Column(6).Width = 14
WSReporte.Column(7).Width = 14
WSReporte.Cell(1, 1).Value = UsuarioActual.Empresa.Empresa
WSReporte.Cell(2, 1).Value = $"Balanza de Comprobación del {TxtFechaDel.Text} al {TxtFechaAl.Text}"
WSReporte.Cell(5, 1).Value = $"Sub Proyecto: {SubProyecto}"
WSReporte.Cell(5, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left
WSReporte.Cell(5, 1).Style.Font.Bold = True
WSReporte.Cell(6, 1).Value = "Cuenta"
WSReporte.Cell(6, 2).Value = "Nombre"
WSReporte.Cell(6, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center
WSReporte.Cell(6, 2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center
WSReporte.Cell(6, 3).Value = $"Saldos Iniciales{vbCrLf}Deudor Acreedor"
WSReporte.Cell(6, 4).Value = $"Cargos"
WSReporte.Cell(6, 5).Value = $"Abonos"
WSReporte.Cell(6, 6).Value = $"Saldo Actuales{vbCrLf} Deudor Acreedo"
WSReporte.Range("A6:F6").Style.Font.Bold = True
WSReporte.Range("A6:F6").Style.Font.FontSize = 10
WSReporte.Range("A6:F6").Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
WSReporte.Range("A6:F6").Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Range("A6:F6").Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Range("A6:F6").Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
Dim CuerrentRow As Integer = 7
CuerrentRow = CuerrentRow + 1
For Each Drow As DataRow In DtDatos.Rows
WSReporte.Cell(CuerrentRow, 1).Value = Drow("Codigo").ToString
WSReporte.Cell(CuerrentRow, 2).Value = Drow("Nombre").ToString
WSReporte.Cell(CuerrentRow, 3).Value = Drow("SaldoInicial").ToString
WSReporte.Cell(CuerrentRow, 4).Value = Drow("Cargos").ToString
WSReporte.Cell(CuerrentRow, 5).Value = Drow("Abonos").ToString
WSReporte.Cell(CuerrentRow, 6).Value = Drow("SaldoActual").ToString
If Drow("CtaMayor").ToString.ToEntero.Contiene(1) Then
WSReporte.Cell(CuerrentRow, 1).Style.Font.Bold = True
WSReporte.Cell(CuerrentRow, 2).Style.Font.Bold = True
WSReporte.Cell(CuerrentRow, 3).Style.Font.Bold = True
WSReporte.Cell(CuerrentRow, 4).Style.Font.Bold = True
WSReporte.Cell(CuerrentRow, 5).Style.Font.Bold = True
WSReporte.Cell(CuerrentRow, 6).Style.Font.Bold = True
If Drow("CtaMayor").ToString.ToEntero.Contiene(1) Then
WSReporte.Cell(CuerrentRow, 1).Style.Alignment.Indent = 1
WSReporte.Cell(CuerrentRow, 1).Style.Font.Italic = True
End If
Else
WSReporte.Cell(CuerrentRow, 1).Style.Alignment.WrapText = True
WSReporte.Cell(CuerrentRow, 1).Style.Alignment.Indent = 2
End If
WSReporte.Cell(CuerrentRow, 2).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
WSReporte.Cell(CuerrentRow, 3).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
WSReporte.Cell(CuerrentRow, 4).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
WSReporte.Cell(CuerrentRow, 5).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
WSReporte.Cell(CuerrentRow, 6).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
CuerrentRow = CuerrentRow + 1
Next
For xy As Integer = 6 To CuerrentRow
WSReporte.Cell(xy, 6).Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Cell(xy, 1).Style.Border.LeftBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
Next
CuerrentRow = CuerrentRow + 1
WSReporte.Cell(CuerrentRow, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center
WSReporte.Cell(CuerrentRow, 2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center
WSReporte.Cell(CuerrentRow, 3).Value = $"Saldos Iniciales{vbCrLf}Deudor Acreedor"
WSReporte.Cell(CuerrentRow, 4).Value = $"Cargos"
WSReporte.Cell(CuerrentRow, 5).Value = $"Abonos"
WSReporte.Cell(CuerrentRow, 6).Value = $"Saldo Actuales{vbCrLf} Deudor Acreedo"
WSReporte.Cell(CuerrentRow, 1).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Cell(CuerrentRow, 2).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Cell(CuerrentRow, 3).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Cell(CuerrentRow, 4).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Cell(CuerrentRow, 5).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Cell(CuerrentRow, 6).Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Range($"A{CuerrentRow}:F{CuerrentRow}").Style.Font.Bold = True
WSReporte.Range($"A{CuerrentRow}:F{CuerrentRow}").Style.Font.FontSize = 10
WSReporte.Range($"A{CuerrentRow}:F{CuerrentRow}").Style.Alignment.SetHorizontal(XLAlignmentHorizontalValues.Center)
WSReporte.Range($"A{CuerrentRow}:F{CuerrentRow}").Style.Border.TopBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Range($"A{CuerrentRow}:F{CuerrentRow}").Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.Range($"A{CuerrentRow}:F{CuerrentRow}").Style.Border.RightBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
CuerrentRow = CuerrentRow + 1
Dim ultimaFila As DataRow = DtDatos.Rows(DtDatos.Rows.Count - 1)
Dim LastSaldoID As Decimal = ultimaFila("SaldoID").ToString.ToDecimal
Dim LastTotalAbonos As Decimal = ultimaFila("TotalAbonos").ToString.ToDecimal
Dim LastTotalCargos As Decimal = ultimaFila("TotalCargos").ToString.ToDecimal
Dim LastSaldoAD As Decimal = ultimaFila("SaldoAD").ToString.ToDecimal
Dim LastSaldoIA As Decimal = ultimaFila("SaldoIA").ToString.ToDecimal
Dim LastSaldoAA As Decimal = ultimaFila("SaldoAA").ToString.ToDecimal
WSReporte.Cell(CuerrentRow, 2).Value = "Sumas Iguales"
WSReporte.Cell(CuerrentRow, 3).Value = LastSaldoID
WSReporte.Cell(CuerrentRow, 4).Value = LastTotalCargos
WSReporte.Cell(CuerrentRow, 5).Value = LastTotalAbonos
WSReporte.Cell(CuerrentRow, 6).Value = LastSaldoAD
WSReporte.Cell(CuerrentRow, 3).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
WSReporte.Cell(CuerrentRow, 4).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
WSReporte.Cell(CuerrentRow, 5).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
WSReporte.Cell(CuerrentRow, 6).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
CuerrentRow = CuerrentRow + 1
WSReporte.Cell(CuerrentRow, 3).Value = LastSaldoIA
WSReporte.Cell(CuerrentRow, 6).Value = LastSaldoAA
WSReporte.Cell(CuerrentRow, 3).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
WSReporte.Cell(CuerrentRow, 6).Style.NumberFormat.Format = "#,##0.00; [Black] - #,##0.00 ;""-"""
WSReporte.Range($"B{CuerrentRow}:F{CuerrentRow}").Style.Border.BottomBorder = ClosedXML.Excel.XLBorderStyleValues.Medium
WSReporte.PageSetup.PrintAreas.Add($"A1:G{CuerrentRow + 0 + 1}")
WSReporte.PageSetup.Margins.Top = 0.3
WSReporte.PageSetup.Margins.Left = 0.8
WSReporte.PageSetup.Margins.Right = 0.8
WSReporte.PageSetup.FitToPages(1, 1)
WBReporte.Worksheet(1).CopyTo(WBAnexoSalvar, "SubProyecto")
Return WBReporte.Worksheet(1)
End Function
End Class

View File

@@ -0,0 +1,171 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="TimbraRetencion.aspx.vb" Inherits="General_TimbraRetencion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Timbrados de retenciones
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkAgregarRetencion" OnClick="LnkAgregarRetencion_Click" runat="server"><i class="fa fa-plus"></i>Agregar Retención</asp:LinkButton></li>
</li>
</ContentTemplate>
</asp:UpdatePanel>
<li>
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Genera Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<div id="DModalRetencion" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModal" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Literal ID="ltlMotititulo" Text="Retención" runat="server"> </asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= DdlClaveRetencion.ClientID.ToString()%>">Clave Retención:</label>
<asp:DropDownList ID="DdlClaveRetencion" runat="server" CssClass="select2me">
<asp:ListItem Text="01-Servicios profesionales" Value="01"></asp:ListItem>
<asp:ListItem Text="14-Dividendos o utilidades distribuidas" Value="14"></asp:ListItem>
<asp:ListItem Text="28-Pagos y retenciones a Contribuyentes del RIF" Value="28"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="<%= DdlClientes.ClientID%>">Cliente:</label>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" EsWebService="true" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div>
<div class="row">
<div class="form-group form-md-line-input input-iconright col-md-4">
<label for="<%= DdlPeriodoInicio.ClientID.ToString()%>">P. Inicial:</label>
<asp:DropDownList ID="DdlPeriodoInicio" runat="server" CssClass="select2me">
<asp:ListItem Text="Enero" Value="01"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="02"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="03"></asp:ListItem>
<asp:ListItem Text="Abril" Value="04"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="05"></asp:ListItem>
<asp:ListItem Text="Junio" Value="06"></asp:ListItem>
<asp:ListItem Text="Julio" Value="07"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="08"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="09"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="form-group form-md-line-input input-iconright col-md-4">
<label for="<%= DdlPeriodoFin.ClientID.ToString()%>">P. Fin:</label>
<asp:DropDownList ID="DdlPeriodoFin" runat="server" CssClass="select2me">
<asp:ListItem Text="Enero" Value="01"></asp:ListItem>
<asp:ListItem Text="Febrero" Value="02"></asp:ListItem>
<asp:ListItem Text="Marzo" Value="03"></asp:ListItem>
<asp:ListItem Text="Abril" Value="04"></asp:ListItem>
<asp:ListItem Text="Mayo" Value="05"></asp:ListItem>
<asp:ListItem Text="Junio" Value="06"></asp:ListItem>
<asp:ListItem Text="Julio" Value="07"></asp:ListItem>
<asp:ListItem Text="Agosto" Value="08"></asp:ListItem>
<asp:ListItem Text="Septiembre" Value="09"></asp:ListItem>
<asp:ListItem Text="Octubre" Value="10"></asp:ListItem>
<asp:ListItem Text="Noviembre" Value="11"></asp:ListItem>
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="form-group form-md-line-input input-iconright col-md-4">
<label for="<%= DdlEjercicio.ClientID.ToString()%>">Ejercicio:</label>
<asp:DropDownList ID="DdlEjercicio" runat="server" CssClass="select2me">
<asp:ListItem Text="2023" Value="2023"></asp:ListItem>
<asp:ListItem Text="2024" Value="2024"></asp:ListItem>
<asp:ListItem Text="2025" Value="2025"></asp:ListItem>
<asp:ListItem Text="2026" Value="2026"></asp:ListItem>
<asp:ListItem Text="2027" Value="2027"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= TxtBase.ClientID.ToString()%>">Base Impuesto:</label>
<asp:TextBox ID="TxtBase" runat="server" Width="100px"></asp:TextBox>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= DdlTipoImpuesto.ClientID.ToString()%>">Tipo Impuesto:</label>
<asp:DropDownList ID="DdlTipoImpuesto" runat="server" CssClass="select2me">
<asp:ListItem Text="ISR" Value="01"></asp:ListItem>
<asp:ListItem Text="IVA" Value="02"></asp:ListItem>
<asp:ListItem Text="IEPS" Value="03"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= TxtImpuestoRetenido.ClientID.ToString()%>">Impuesto Retenido:</label>
<asp:TextBox ID="TxtImpuestoRetenido" runat="server" Width="100px"></asp:TextBox>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= DdlTipoPagoRet.ClientID.ToString()%>">Tipo Impuesto:</label>
<asp:DropDownList ID="DdlTipoPagoRet" runat="server" CssClass="select2me">
<asp:ListItem Text="Pago definitivo IVA" Value="01"></asp:ListItem>
<asp:ListItem Text="Pago definitivo IEPS" Value="02"></asp:ListItem>
<asp:ListItem Text="Pago definitivo ISR" Value="03"></asp:ListItem>
<asp:ListItem Text="Pago provisional ISR" Value="04"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:Button ID="BtnAgregar" runat="server" Text="++" OnClick="BtnAgregar_Click" />
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvD" runat="server" DataKeyNames="TipoImpuesto,ClaveTipoImpuesto,BaseRetencion,ClaveTipoPago,TipoPago,ImpuestoRetenido"></asp:GridView>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= TxtTotal1.ClientID.ToString()%>">Base Impuesto:</label>
<asp:TextBox ID="TxtTotal1" runat="server" Width="100px"></asp:TextBox>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= TxtTotal2.ClientID.ToString()%>">Base Impuesto:</label>
<asp:TextBox ID="TxtTotal2" runat="server" Width="100px"></asp:TextBox>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<label for="<%= TxtTotal3.ClientID.ToString()%>">Base Impuesto:</label>
<asp:TextBox ID="TxtTotal3" runat="server" Width="100px"></asp:TextBox>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnEmitirRetencion" runat="server" Text="Emitir Retención" OnClick="BtnEmitirRetencion_Click" CssClass ="btn btn-primary" ValidationGroup="VgmGuardar" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,345 @@
Option Explicit On
Option Strict On
Imports System.IO
Imports System.Data
Imports System.Xml
Imports System.Xml.Serialization
Imports ADSNetLibrary.PacsTimbrado.SAT
Imports Extensiones
Imports Profact.TimbraCFDI40
Partial Class General_TimbraRetencion
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property CveMarca() As Integer
Get
Return If(IsNothing(ViewState("CveMarca")), -1, CInt(ViewState("CveMarca")))
End Get
Set
ViewState("CveMarca") = Value
End Set
End Property
Private Property Modalidad() As String
Get
Return If(IsNothing(ViewState("Modalidad")), "", (ViewState("Modalidad").ToString))
End Get
Set
ViewState("Modalidad") = Value
End Set
End Property
Private Property DtDetalle As Data.DataTable
Get
Return If(IsNothing(ViewState("DtDetalle")), Nothing, CType(ViewState("DtDetalle"), DataTable))
End Get
Set(value As DataTable)
ViewState("DtDetalle") = value
End Set
End Property
#End Region
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
DdlClientes.setEsWebService(True)
End If
End Sub
#Region "Timbra"
Private Function TimbraRetencion(cfditimbre As CFDITimbreRetenciones, UsuarioActual As Usuario) As String
Dim sw As New Diagnostics.Stopwatch
Dim swTiempo As New StringBuilder
Dim swmili As Long = 0
sw.Start()
Dim ArchivoLLave As String = $"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoKey}"
Dim ArchivoCertificado As String = $"{UsuarioActual.Empresa.Ruta}Certificados\{UsuarioActual.Empresa.ArchivoCer}"
Dim Clave As String = UsuarioActual.Empresa.ContraseñaKey
Dim EmisorRFC As String = UsuarioActual.Empresa.RFC
Dim EmisorNombre As String = UsuarioActual.Empresa.Empresa
Dim SubTotal As Decimal = 0
Dim AmbienteProductivo As Boolean = True
Dim NumDecimalesImporte As Integer = 2
If Not ClsPaginas.EsProduccion AndAlso (Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1) Then
AmbienteProductivo = False
Clave = "12345678a"
EmisorRFC = "EKU9003173C9"
EmisorNombre = "ESCUELA KEMPER URGATE"
ArchivoLLave = $"{Extensiones.ModExtensiones.DirectorioEmpresas}\1\Certificados\EKU9003173C9.key"
ArchivoCertificado = $"{Extensiones.ModExtensiones.DirectorioEmpresas}\1\Certificados\EKU9003173C9.cer"
UsuarioActual.Empresa.CodigoRegimenFiscal = "601"
End If
#Region "Valida"
If Not File.Exists(ArchivoCertificado) Then
Alert("El archivo de certificado no existe", TipoMensaje.MsgError)
Return ""
End If
If Not File.Exists(ArchivoLLave) Then
Alert("El archivo de llave privada no existe", TipoMensaje.MsgError)
Return ""
End If
If UsuarioActual.Empresa.ContraseñaKey = "" Then
Alert("La clave no puede ser vacía", TipoMensaje.MsgError)
Return ""
End If
#End Region
#Region "Variables"
Dim llaveByte As Byte(), certByte As Byte()
Dim llaveBase64 As String, certBase64 As String
Dim complemento As String = ""
Dim complementoConcepto As String = ""
'//Inicializamos el conector el parámetro indica el ambiente en el que se utilizará
'//Fasle = Ambiente de pruebas
'//True = Ambiente de producción
Dim cfdi As New Profact.TimbraCFDI40.Conector(AmbienteProductivo)
Dim comprobante As New Profact.TimbraCFDI40.Comprobante()
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1 OrElse Not ClsPaginas.EsProduccion Then
cfdi.EstableceCredenciales("mvpNUXmQfK8=")
Else
cfdi.EstableceCredenciales($"vSGxMFWnNRy/nDoowxqrqw==|Sia123654")
End If
#End Region
#Region "Verifica"
Try
llaveByte = System.IO.File.ReadAllBytes(ArchivoLLave)
llaveBase64 = Convert.ToBase64String(llaveByte)
Catch ex As Exception
Alert($"Error al leer la llave privada: {ex.Message}", TipoMensaje.MsgError)
Return ""
End Try
Try
certByte = System.IO.File.ReadAllBytes(ArchivoCertificado)
certBase64 = Convert.ToBase64String(certByte)
Catch ex As Exception
Alert($"Error al leer el certificado: {ex.Message}", TipoMensaje.MsgError)
Return ""
End Try
sw.Stop()
swTiempo.AppendFormat("Verificado : ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds)
swmili = sw.ElapsedMilliseconds
sw.Start()
#End Region
'CType([Enum].Parse(GetType(ProfactCartaPorte.CartaPorteTranspInternac), Carta.TranspInternac), ProfactCartaPorte.CartaPorteTranspInternac)
Dim retenciones As Retenciones = New Profact.TimbraCFDI40.Retenciones()
retenciones.Version = "2.0"
retenciones.FechaExp = cfditimbre.Fecha
retenciones.CveRetenc = CType([Enum].Parse(GetType(c_CveRetenc), "Item" & cfditimbre.Retencion.ClaveRetencion), c_CveRetenc)
retenciones.Emisor = New RetencionesEmisor()
retenciones.Emisor.RfcE = EmisorRFC
retenciones.Emisor.NomDenRazSocE = EmisorNombre
retenciones.Emisor.RegimenFiscalE = CType([Enum].Parse(GetType(c_RegimenFiscal), "Item" & UsuarioActual.Empresa.CodigoRegimenFiscal), c_RegimenFiscal)
retenciones.LugarExpRetenc = cfditimbre.Retencion.LugarExpedicion
Dim retencionNacional As RetencionesReceptorNacional = New RetencionesReceptorNacional()
retenciones.Receptor = New RetencionesReceptor()
retenciones.Receptor.NacionalidadR = If(cfditimbre.Receptor.NacionalidadR = "Nacional", RetencionesReceptorNacionalidadR.Nacional, RetencionesReceptorNacionalidadR.Extranjero)
retencionNacional.RfcR = cfditimbre.Receptor.RFCR
retencionNacional.NomDenRazSocR = cfditimbre.Receptor.NombreDenominacionR
retencionNacional.DomicilioFiscalR = cfditimbre.Receptor.DomicilioFiscalR
retenciones.Receptor.Item = retencionNacional
If cfditimbre.CFDIRelacionados.TipoRelacion <> "" Then
For Each uid As String In cfditimbre.CFDIRelacionados.UUID
Dim uuidrela As New RetencionesCfdiRetenRelacionados
uuidrela.TipoRelacion = CType([Enum].Parse(GetType(c_TipoRelacion), "Item" & cfditimbre.CFDIRelacionados.TipoRelacion), c_TipoRelacion)
uuidrela.UUID = uid
retenciones.CfdiRetenRelacionados = uuidrela
Next
End If
retenciones.Periodo = New RetencionesPeriodo()
retenciones.Periodo.MesIni = CType([Enum].Parse(GetType(c_Periodo), "Item" & cfditimbre.Retencion.PeriodoMesInicio), c_Periodo)
retenciones.Periodo.MesFin = CType([Enum].Parse(GetType(c_Periodo), "Item" & cfditimbre.Retencion.PeriodoMesFin), c_Periodo)
retenciones.Periodo.Ejercicio = CType([Enum].Parse(GetType(c_Ejercicio), "Item" & cfditimbre.Retencion.PeriodoEjercicio.ToString), c_Ejercicio)
retenciones.Totales = New RetencionesTotales()
retenciones.Totales.MontoTotOperacion = 0
retenciones.Totales.MontoTotGrav = 0
retenciones.Totales.MontoTotExent = 0
retenciones.Totales.MontoTotRet = cfditimbre.TotalImpuestosRetenidos
retenciones.Totales.UtilidadBimestral = 1
retenciones.Totales.UtilidadBimestralSpecified = True
retenciones.Totales.ISRCorrespondiente = cfditimbre.ISRCorrespondiente
retenciones.Totales.ISRCorrespondienteSpecified = True
retenciones.Totales.ImpRetenidos = New RetencionesTotalesImpRetenidos(cfditimbre.RetencionesImpuestos.Count - 1) {}
Dim i As Integer = 0
For Each drimp As CFDIImpuestosRetenidos In cfditimbre.RetencionesImpuestos
retenciones.Totales.ImpRetenidos(i) = New RetencionesTotalesImpRetenidos()
retenciones.Totales.ImpRetenidos(i).BaseRet = 0
retenciones.Totales.ImpRetenidos(i).BaseRetSpecified = True
retenciones.Totales.ImpRetenidos(i).ImpuestoRet = CType([Enum].Parse(GetType(c_Impuesto), "Item0" & drimp.ImpuestoRetencion), c_Impuesto) ' c_Impuesto.Item001
retenciones.Totales.ImpRetenidos(i).ImpuestoRetSpecified = True
retenciones.Totales.ImpRetenidos(i).MontoRet = drimp.MontoRetencion
retenciones.Totales.ImpRetenidos(i).TipoPagoRet = CType([Enum].Parse(GetType(c_TipoPagoRet), "Item" & drimp.TipoPagoRetencion), c_TipoPagoRet) 'c_TipoPagoRet.Item04
i += 1
Next
'retenciones.Totales.ImpRetenidos(i) = New RetencionesTotalesImpRetenidos()
'retenciones.Totales.ImpRetenidos(i).BaseRet = 0
'retenciones.Totales.ImpRetenidos(i).BaseRetSpecified = True
'retenciones.Totales.ImpRetenidos(i).ImpuestoRet = c_Impuesto.Item001
'retenciones.Totales.ImpRetenidos(i).ImpuestoRetSpecified = True
'retenciones.Totales.ImpRetenidos(i).MontoRet = 705
'retenciones.Totales.ImpRetenidos(i).TipoPagoRet = c_TipoPagoRet.Item04
'' dividendos
'Dim dividendos As Profact.TimbraCFDI.Dividendos = New Profact.TimbraCFDI.Dividendos()
'dividendos.Version = "1.0"
'dividendos.DividOUtil = New Profact.TimbraCFDI.DividendosDividOUtil()
'dividendos.DividOUtil.CveTipDivOUtil = Profact.TimbraCFDI.c_TipoDividendoOUtilidadDistribuida.Item06
'dividendos.DividOUtil.MontISRAcredRetMexico = 0.00D
'dividendos.DividOUtil.MontISRAcredRetExtranjero = 0.00D
'dividendos.DividOUtil.TipoSocDistrDiv = Profact.TimbraCFDI.DividendosDividOUtilTipoSocDistrDiv.SociedadNacional
'dividendos.DividOUtil.MontDivAcumNal = 426180D
'dividendos.DividOUtil.MontDivAcumNalSpecified = True
'dividendos.DividOUtil.MontISRAcredNal = 127586D
'dividendos.DividOUtil.MontDivAcumNalSpecified = True
Dim LXmlComplementos As List(Of XmlElement) = New List(Of XmlElement)()
'Dim nombres As System.Xml.Serialization.XmlSerializerNamespaces = New System.Xml.Serialization.XmlSerializerNamespaces()
'nombres.Add("dividendos", "http://www.sat.gob.mx/esquemas/retencionpago/1/dividendos")
'Dim xmlDividendos As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(dividendos, GetType(Profact.TimbraCFDI.Dividendos), nombres)
'Dim docDividendos As XmlDocument = New XmlDocument()
'docDividendos.LoadXml(xmlDividendos)
'retenciones.DividendosSpecified = True
'LXmlComplementos.Add(docDividendos.DocumentElement)
''fin dividendos
'retenciones.Complemento = New RetencionesComplemento()
'retenciones.Complemento.Any = LXmlComplementos.ToArray()
Dim xmlEncode As String
Using sww As New System.IO.StringWriter()
Dim xs As XmlSerializer
xs = New System.Xml.Serialization.XmlSerializer(GetType(Profact.TimbraCFDI40.Retenciones))
xs.Serialize(sww, retenciones)
xmlEncode = sww.ToString()
End Using
Dim resultadoTimbre As Profact.TimbraCFDI.ResultadoTimbre
resultadoTimbre = cfdi.TimbraRetencion(retenciones)
If resultadoTimbre.Exitoso Then
Dim Retorno As String = ""
Dim RutaArchivo As String = $"{UsuarioActual.Empresa.Ruta}XML\Ret\"
Dim NombreArchivoXML As String = ""
Dim objGrales As New ClsGenerales
objGrales.IniciaTransacSQL()
Dim tCveTimbre As Integer = objGrales.AddGralTimbre("Ret", 12679, cfditimbre.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
NombreArchivoXML = $"{objGrales.SerieInsertada}-{objGrales.FolioInsertado}.xml"
If Not Directory.Exists(RutaArchivo) Then Directory.CreateDirectory(RutaArchivo)
If tCveTimbre > 0 Then
If objGrales.UpdateTimbreTimbrado(tCveTimbre, resultadoTimbre.FolioUUID, cfditimbre.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 3, "4.0") Then
resultadoTimbre.GuardaXml(RutaArchivo, NombreArchivoXML)
Else
Retorno = "Error"
End If
Else
Retorno = "Error"
End If
If Retorno = "" Then
objGrales.Commit()
Else
objGrales.RollBack()
End If
objGrales.Dispose()
'If resultadoTimbre.GuardaXml("C:/", "EjemploRetencion_nombre") Then
' Alert("El xml fue guardado correctamente")
'Else
' Alert("Ocurrió un error al guardar el comprobante, por favor verifica los permisos de la carpeta")
'End If
'If resultadoTimbre.GuardaCodigoBidimensional("C:/", "codigoRetencion_nombre") Then
' Alert("El código bidimensional fue guardado correctamente")
'Else
' Alert("Ocurrió un error al guardar el código bidimensional, por favor verifica los permisos de la carpeta")
'End If
'Dim folioFiscal As String = resultadoTimbre.FolioUUID
'Dim noCertificado As String = resultadoTimbre.No_Certificado
'Dim noCertificadoSAT As String = resultadoTimbre.No_Certificado_SAT
'Dim fechaCert As String = resultadoTimbre.FechaCertificacion
'Dim selloCFDI As String = resultadoTimbre.SelloCFDI
'Dim selloSAT As String = resultadoTimbre.SelloSAT
'Dim cadena As String = resultadoTimbre.CadenaTimbre
Alert("Timbrado Exitoso")
Else
Alert(resultadoTimbre.Descripcion)
Dim detalle As String = resultadoTimbre.Detalle
End If
End Function
#End Region
Protected Sub BtnEmitirRetencion_Click(sender As Object, e As EventArgs)
Dim cfditimbre As New CFDITimbreRetenciones
cfditimbre.Fecha = Now
cfditimbre.Retencion.ClaveRetencion = DdlClaveRetencion.SelectedValue
cfditimbre.Retencion.PeriodoMesInicio = DdlPeriodoInicio.SelectedValue
cfditimbre.Retencion.PeriodoMesFin = DdlPeriodoFin.SelectedValue
cfditimbre.Retencion.PeriodoEjercicio = DdlEjercicio.SelectedValue.ToEntero
cfditimbre.Retencion.LugarExpedicion = UsuarioActual.Empresa.CP
cfditimbre.Receptor.RFCR = "AEMV690902NM5"
cfditimbre.Receptor.NacionalidadR = "Nacional"
cfditimbre.Receptor.DomicilioFiscalR = "11950"
cfditimbre.Receptor.NombreDenominacionR = "VERONICA MICHELLE ARMENTA MASON"
cfditimbre.CFDIRelacionados.TipoRelacion = "01"
cfditimbre.CFDIRelacionados.UUID.Add("671fdb07-406a-42a6-9a89-40219f663ea1")
cfditimbre.ISRCorrespondiente = 705
cfditimbre.RetencionesImpuestos.Add(New CFDIImpuestosRetenidos With {.MontoRetencion = 705, .BaseRetencion = 0, .ImpuestoRetencion = "01", .TipoPagoRetencion = "04"})
For Each gvr As GridViewRow In GvD.Rows
Dim ret As New CFDIImpuestosRetenidos With {.BaseRetencion = gvr.DataKey("BaseRetencion").ToDecimal,
.ImpuestoRetencion = gvr.DataKey("ImpuestoRetencion")}
cfditimbre.RetencionesImpuestos.Add(ret)
Next
TimbraRetencion(cfditimbre, UsuarioActual)
End Sub
Protected Sub LnkAgregarRetencion_Click(sender As Object, e As EventArgs)
UpModal.Update()
RegistraScript("$('#DModalRetencion').modal()")
DtDetalle = New DataTable
DtDetalle.Columns.Add("TipoImpuesto", GetType(String))
DtDetalle.Columns.Add("ClaveTipoImpuesto", GetType(String))
DtDetalle.Columns.Add("BaseRetencion", GetType(Decimal))
DtDetalle.Columns.Add("ClaveTipoPago", GetType(String))
DtDetalle.Columns.Add("TipoPago", GetType(String))
DtDetalle.Columns.Add("ImpuestoRetenido", GetType(Decimal))
End Sub
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
Dim dr As DataRow = DtDetalle.NewRow
dr("TipoImpuesto") = DdlTipoImpuesto.Text
dr("ClaveTipoImpuesto") = DdlTipoImpuesto.SelectedValue
dr("BaseRetencion") = TxtBase.Text.ToDecimal
dr("ClaveTipoPago") = DdlTipoPagoRet.SelectedValue
dr("TipoPago") = DdlTipoPagoRet.Text
dr("ImpuestoRetenido") = TxtImpuestoRetenido.Text.ToDecimal
DtDetalle.Rows.Add(dr)
GvD.DataSource = DtDetalle
GvD.DataBind()
End Sub
End Class

File diff suppressed because it is too large Load Diff

View File

@@ -79,7 +79,7 @@
<div class="portlet solid grey-cascade portlet-filter" style="min-height: 80px !important;">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="btConsultar" CssClass="btn btn-primary" runat="server" Text="Consultar" /></td>
<asp:Button ID="btConsultar" CssClass="btn btn-primary" runat="server" Text="Consultar" /></td>
</div>
<div class="titlefiltros caption ">
@@ -136,11 +136,11 @@
<asp:ListItem Text="Devolución" Value="DEV"></asp:ListItem>
</asp:DropDownList>
</div>
<%-- <div class="col-md-1 truncate" id="DivSucursal" runat="server" style="text-align: right!important;">Sucursal:</div>
<div class="col-md-1" id="DivSucursal2" runat="server">
<asp:DropDownList ID="DdlSucursal" runat="server" AppendDataBoundItems="true" DataTextField="Sucursal" DataValueField="CveSucursal" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100px">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
<%-- <div class="col-md-1 truncate" id="DivSucursal" runat="server" style="text-align: right!important;">Sucursal:</div>
<div class="col-md-1" id="DivSucursal2" runat="server">
<asp:DropDownList ID="DdlSucursal" runat="server" AppendDataBoundItems="true" DataTextField="Sucursal" DataValueField="CveSucursal" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100px">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>--%>
<div class="col-md-1 truncate" id="DivSubProyecto" runat="server" style="text-align: right!important;"><asp:Label runat="server" ID="LblSubProyecto" text="Proyecto" /></div>
<div class="col-md-1" id="DivSubProyecto2" runat="server">
@@ -192,7 +192,7 @@
<%--7--%>
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" Visible="false" />
<%--8--%>
<asp:BoundField HeaderText="Sutido" DataField="Surtido" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Surtido" DataField="Surtido" DataFormatString="{0:n2}" ItemStyle-HorizontalAlign="Right" />
<%--9--%>
<asp:TemplateField ItemStyle-Width="70px" HeaderText="Acción" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
@@ -243,51 +243,51 @@
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<%--<script src="/Scripts/DataTables.js"></script>
<script type="text/javascript">
function pageLoad(sender, e) {
$(document).ready(function () {
$('a[class="ajax__tab_tab"]').click(function () {
$.fn.dataTable.tables({ visible: true, api: true }).columns.adjust();
});
});
}
function OrdenarGvVentas() {
var Tam = TamañoVentana();
var Alto = Tam.height - 330;
if (Alto < 100) {
Alto = 100;
}
$('#GvVentas').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false
});
$('#GvVentas').parent().parent().children().first().css("position", "static");
}
function OrdenarGvCompras() {
var Tam = TamañoVentana();
var Alto = Tam.height - 330;
if (Alto < 100) {
Alto = 100;
}
$('#GvCompras').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false
});
$('#GvCompras').parent().parent().children().first().css("position", "static");
}
<%--<script src="/Scripts/DataTables.js"></script>
<script type="text/javascript">
function pageLoad(sender, e) {
$(document).ready(function () {
$('a[class="ajax__tab_tab"]').click(function () {
$.fn.dataTable.tables({ visible: true, api: true }).columns.adjust();
});
});
}
function OrdenarGvVentas() {
var Tam = TamañoVentana();
var Alto = Tam.height - 330;
if (Alto < 100) {
Alto = 100;
}
$('#GvVentas').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false
});
$('#GvVentas').parent().parent().children().first().css("position", "static");
}
function OrdenarGvCompras() {
var Tam = TamañoVentana();
var Alto = Tam.height - 330;
if (Alto < 100) {
Alto = 100;
}
$('#GvCompras').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false
});
$('#GvCompras').parent().parent().children().first().css("position", "static");
}
</script>--%>
</asp:Content>

View File

@@ -121,7 +121,7 @@
<asp:LinkButton ID="LnkMostrarTraspaso" runat="server" AlternateText="Editar" OnClick="LnkMostrarTraspaso_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-pencil'></i>" />
</div>
<div class="col-lg-4" style="text-align:left">
<asp:HyperLink ID="HypRecibeTraspaso" runat="server" Target="_blank" CssClass="btn btn-circle btn-sm blue" ToolTip="Recivir traspaso" Text="<i class='fa fa-arrow-right'></i>" Visible="false" />
<asp:HyperLink ID="HypRecibeTraspaso" runat="server" Target="_blank" CssClass="btn btn-circle btn-sm blue" ToolTip="Recibir traspaso" Text="<i class='fa fa-arrow-right'></i>" Visible="false" />
</div>
<div class="col-lg-4" style="text-align:left"></div>
</div>

View File

@@ -116,35 +116,25 @@ Partial Class LogIn
PnlLogin.Visible = False
If elapsedSpan.Days < 3 Then
Dim tGrupoEmpresa As String = ClsPaginas.GlobalGrupoEmpresa(Request.Url.Host.ToUpper())
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexionDominio(Request.Url.Host.ToUpper())
Dim Usr As New ClsSisUsuarios
If Usr.GetUsuarios(CveUsuario, -1, -1) Then
Dim ObjUsuario As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
Dim Usuario As Usuario = ObjUsuario.GetUsuarioDetalle(CveUsuario, CveEmpresa:=CveEmpresa)
Dim dr As DataRow = Usr.DtResultados.FiltroPrimero("")
If dr IsNot Nothing Then
If dr("PolCambiarContraseña").ToString = "SI" Then
PnlContra.Visible = True
'HCambio.Visible = True
'HdnCveUsr.Value = CveUsuario.ToString
Me.Form.DefaultButton = BtnGuardar.ClientID
'If Usr.UpdateUsuarioPortal(dr("Usuario").ToString, dr("Nombre").ToString,
' dr("Permiso1").ToString = "True", dr("Permiso2").ToString = "True", dr("Permiso3").ToString = "True", dr("Permiso4").ToString = "True", dr("Permiso5").ToString = "True",
' dr("Permiso6").ToString = "True", dr("Permiso7").ToString = "True", dr("Permiso8").ToString = "True", dr("Permiso9").ToString = "True", dr("Permiso10").ToString = "True",
' True, TxtContrasenia1.Text, dr("CveCliente").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, CveUsr) Then
' Alert("Contraseña Modificada.", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="location.href=""ConsultaCliente.aspx""")
'End If
Else
Alert("El usuario ya cambio su contraseña, inicie sesión normalmente.", TipoMensaje.MsgInformacion)
PnlLogin.Visible = True
End If
If Usuario IsNot Nothing Then
If Usuario.Contraseña = ClsPaginas.ContraseñaPredeterminadaEncriptada Then
PnlContra.Visible = True
Me.Form.DefaultButton = BtnGuardar.ClientID
Else
Alert("El Usuario no existe", TipoMensaje.MsgError)
Alert("El usuario ya cambio su contraseña, inicie sesión normalmente.", TipoMensaje.MsgInformacion)
PnlLogin.Visible = True
End If
Else
Alert("El Usuario no existe", TipoMensaje.MsgError)
End If
Usr.Dispose()
ObjUsuario.Dispose()
Usuario = Nothing
Else
Alert("La Activación expiró", TipoMensaje.MsgError)
End If
@@ -177,20 +167,6 @@ Partial Class LogIn
Return URLParametros
End Function
'Property GlobalDTUsuarios(Optional CveUsuario As Integer = -1, Optional CveEmpresa As Integer = -1) As Data.DataTable
' Get
' If CveUsuario <> -1 Then
' Dim Dv As New Data.DataView(DirectCast(Application("GlobalDTUsuarios"), Data.DataTable), "CveUsuario =" & CveUsuario, "", Data.DataViewRowState.CurrentRows)
' GlobalDTUsuarios = Dv.ToTable
' Dv.Dispose()
' Else
' GlobalDTUsuarios = DirectCast(Application("GlobalDTUsuarios"), Data.DataTable)
' End If
' End Get
' Set(value As Data.DataTable)
' Application("GlobalDTUsuarios") = value
' End Set
'End Property
Dim BtnLogIn_Clickenter As Integer = 0
Protected Sub BtnLogIn_Click(ByVal sender As Object, ByVal e As EventArgs) 'Handles CmdLogIn.Click
Dim ReturnUrl As String = "/"
@@ -218,7 +194,6 @@ Partial Class LogIn
If Usuario IsNot Nothing Then
If Not Usuario.AutorizadoxIP OrElse (HddAdsCodex.Text.Length > 0 AndAlso Usuario.CodigoAutorizado = HddAdsCodex.Text) Then
'CreaObjetoEmpresa(Usuario, NombreCadena)
ADSSessionConfig.sessionUser.MultipleEmpresa = True
Dim x As New ADSSessionObj(Usuario.CveUsuario, Usuario.CveEmpresa)
@@ -227,21 +202,14 @@ Partial Class LogIn
If Usuario.CvePlataforma = 6 And Usuario.CveRol = 10 Then
'PLATAFORMA PORTAL CLIENTE
'FormsAuthentication.RedirectFromLoginPage(_sessionid, False)
'Response.Redirect("/PortalCliente/PortalCliente.aspx", True)
ReturnUrl = "/PortalCliente/PortalCliente.aspx"
If Usuario.CveEmpresa = 194 Then ReturnUrl = "/Ventas/RepPedidosSTF.aspx"
ElseIf Usuario.CvePlataforma = 7 And Usuario.CveRol = 11 Then
'PLATAFORMA PORTAL PROVEEDOR
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
'Response.Redirect("/PortalProveedor/PortalProveedor.aspx", True)
ReturnUrl = "/PortalProveedor/PortalProveedor.aspx"
ElseIf Usuario.CveRol = 1200 And Usuario.Acceso > 0 Then
'PLATAFORMA GPS
Usuario.CvePlataforma = 3
'FormsAuthentication.RedirectFromLoginPage(Encripta(Usuario.CveUsuario), False)
'Response.Redirect("/PortalGPS/InicioGPS.aspx", True)
ReturnUrl = "/PortalGPS/InicioGPS.aspx"
Else
'PLATAFORMA SIG
@@ -308,51 +276,28 @@ Partial Class LogIn
End If
End Function
'Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario, Optional NombreCadena As String = "Conexion")
' Dim ObjEmpresa As New ClsSisEmpresas(UsuarioActual:=UsuarioActual)
' If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
' If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
' Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
' Dim EmpresasFuncionalidades As New HybridDictionary
' For Each Row As Data.DataRow In dttmp.Rows
' EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
' Next
' ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
' End If
' UsuarioActual.Empresa = ObjEmpresa.Empresa
' Else
' End If
' ObjEmpresa.Dispose()
'End Sub
Dim BtnGuardar_Clickenter As Integer = 0
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
If BtnGuardar_Clickenter = 0 Then 'esta variable se recicla con cada postaback
BtnGuardar_Clickenter = 1
Dim TieneError As Boolean = False
Dim ObjUsuario As New ClsSisUsuarios
Dim tGrupoEmpresa As String = ClsPaginas.GlobalGrupoEmpresa(Request.Url.Host.ToUpper())
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexionDominio(Request.Url.Host.ToUpper())
If ObjUsuario.UpdateUsuarioContrasenia(Encripta(TxtContrasenia1.Text), CveUsuario, CveEmpresa) Then
If ObjUsuario.GetUsuarios(CveUsuario) Then
If ObjUsuario.DtResultados.Rows.Count = 1 Then
Dim dr As DataRow = ObjUsuario.DtResultados.Rows(0)
txtUsuario.Text = dr("Usuario").ToString
Dim Contraseña As String = Decripta(dr("Contraseña").ToString)
TxtContraseña.Text = Contraseña
Else
TieneError = True
End If
Dim ObjUsuario As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
Dim Usuario As Usuario = ObjUsuario.GetUsuarioDetalle(CveUsuario, CveEmpresa:=CveEmpresa)
If Usuario IsNot Nothing Then
Dim ObjUsuario2 As New ClsSisUsuarios(UsuarioActual:=Usuario)
If ObjUsuario2.UpdateUsuarioContrasenia(Encripta(TxtContrasenia1.Text), CveUsuario, CveEmpresa) Then
txtUsuario.Text = Usuario.Usuario
TxtContraseña.Text = TxtContrasenia1.Text
Else
TieneError = True
End If
Else
TieneError = True
End If
ObjUsuario.Dispose()
If Not TieneError Then

View File

@@ -1700,6 +1700,7 @@ public partial class Nomina_Finiquito : ClsPaginas
string urlfile = System.IO.Path.Combine(string.Format("{0}Formatos/SobreReciboFiniquito.rdlc", UsuarioActual.Empresa.Ruta));
if (!System.IO.File.Exists(urlfile))
{
parametros.Add(new Microsoft.Reporting.WebForms.ReportParameter("EmpresaDireccion", string.Format("{0} No. {1},Colonia {2} ", UsuarioActual.Empresa.Direccion, UsuarioActual.Empresa.NoExt , UsuarioActual.Empresa.Colonia).ToLower()));
urlfile = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas/Grales/Formatos/SobreReciboFiniquito.rdlc");
}

View File

@@ -141,8 +141,8 @@
<Columns>
<asp:TemplateField HeaderText="Folio" ItemStyle-Width="5%">
<ItemTemplate>
<asp:Label Text='<%# Eval("Folio") %>' ID="LbFolio" runat="server" Style="width: 70px!important" />
<asp:HyperLink Text='<%# Eval("Folio") %>' ID="HLFolio" Visible="false" CssClass="Texto" Style="text-align: center" runat="server" Width="70px" />
<asp:Label Text='<%# Eval("SerieFolio") %>' ID="LbFolio" runat="server" Style="width: 70px!important" />
<asp:HyperLink Text='<%# Eval("SerieFolio") %>' ID="HLFolio" Visible="false" CssClass="Texto" Style="text-align: center" runat="server" Width="70px" />
</ItemTemplate>
</asp:TemplateField>

View File

@@ -176,13 +176,45 @@ Partial Class OC_PopUpBuscarReq
Dim guia As String = If(TxtGuia.Text.Trim = "", "-1", TxtGuia.Text)
'Cargar Datos
Dim Serie As String = "-1"
Dim Folio As Integer = -1
If TxtFolio.Text.Trim.Length = 0 Then
Serie = "-1"
Folio = -1
Else
Dim Array() As String = TxtFolio.Text.Trim.Split(CChar("-"))
If Array.Length >= 2 Then
If Array.Length = 2 Then
Serie = Array(0)
Folio = Array(1).ToEntero
End If
If Array.Length = 3 Then
Serie = Array(0) + "-" + Array(1)
Folio = Array(2).ToEntero
End If
Else
Serie = "-1"
Folio = -1
If TxtFolio.Text.Trim.ToEntero > 0 Then
Folio = TxtFolio.Text.Trim.ToEntero
Else
Serie = TxtFolio.Text.Trim
End If
End If
End If
If ValidarFiltrosSeleccionado() Then
Dim CveProveedor As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
Dim ObjOC As New ClsOC
ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, CveProveedor,
If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia,
SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), TopSelect:=100)
Folio, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia,
SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), TopSelect:=100, Serie:=Serie)
Dim DtOC As Data.DataTable = ObjOC.DtResultados ' tipotermino, esattus inicial
ObjOC.Dispose()
@@ -262,7 +294,7 @@ Partial Class OC_PopUpBuscarReq
If DdlTipo.SelectedValue = "REQ" OrElse DdlTipo.SelectedValue = "OC" Then Return True
If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True
If DdlProveedor.SelectedValue.ToEntero > 0 Then Return True
If TxtFolio.Text.ToEntero > 0 Then Return True
If TxtFolio.Text.Trim.Length > 0 Then Return True
If DdlSubProyectos.SelectedValue.ToEntero > 0 Then Return True
If DdlProyectos.SelectedValue.ToEntero > 0 Then Return True
Return False

View File

@@ -2,13 +2,14 @@
Option Strict On
Imports System.Data
Imports DocumentFormat.OpenXml.Spreadsheet
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports MKB.TimePicker
Partial Class OS_Asignaciones
Inherits ClsPaginas
Inherits ClsPaginas
#Region "PROPIEDADES"
Private Property TmpDT As DataTable
Get
@@ -35,7 +36,7 @@ Partial Class OS_Asignaciones
Set(value As DataTable)
ViewState("DtTecnicosSubProyectos") = value
End Set
End Property
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -103,8 +104,8 @@ Partial Class OS_Asignaciones
GvNA.Columns(11).HeaderText = "Hora Cirugía"
End If
End Sub
End Sub
#Region "C A R G A S "
Private Sub CargaSubProyecto()
DdlSubProyecto.Items.Clear()
@@ -139,10 +140,17 @@ Partial Class OS_Asignaciones
GvNA.DataSource = Nothing
End If
GvNA.DataBind()
ObjOS.Dispose()
ObjOS.Dispose()
UpOS.Update()
CargarTecnico()
End Sub
End Sub
Private Sub CargaOrdenesServiciosAsignadas()
Dim ObjOS As New ClsOS
@@ -240,7 +248,7 @@ Partial Class OS_Asignaciones
Dim picker As MKB.TimePicker.TimeSelector = DirectCast(row.FindControl("TimeSelector"), MKB.TimePicker.TimeSelector)
If row.FCCheckBox("ChbxAsignar").Checked Then
time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", row.FCTextBox("FechaOS").Text, picker.Hour, picker.Minute, picker.AmPm))
time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", row.FCTextBox("FechaOS").Text, picker.Hour, picker.Minute, If(picker.Hour < 12, TimeSelector.AmPmSpec.AM, TimeSelector.AmPmSpec.PM)))
contadorOrdenesAsignadas += 1
If ObjOS.GetSubProyectosEstatusInicial(DdlTecnico.SelectedValue.ToEntero, 3, UsuarioActual.CveEmpresa) Then
@@ -555,8 +563,14 @@ Partial Class OS_Asignaciones
e.Row.FindControl("TimeSelector").Visible = True
Dim TMSelector = DirectCast(e.Row.FindControl("TimeSelector"), TimeSelector)
TMSelector.Date = FechaCita
TMSelector.Date = FechaCita
'If TMSelector.Hour = 0 And TMSelector.AmPm = TimeSelector.AmPmSpec.AM Or e.Row.DataKey("CveOS").ToEntero = 9004 Then
If FechaCita.Hour = 0 Then
Dim scripttxth As String = " $(document).ready(function() {setTimeout(function() { document.getElementById('" + TMSelector.UniqueID + "_txtHour').value = '00'; }, 100);}); "
RegistraScript(scripttxth)
End If
e.Row.Cells(10).Attributes.Add("data-order", e.Row.DBCampo("FechaCitaOS").ToDate.Ticks.ToString)
e.Row.Cells(11).Attributes.Add("data-order", e.Row.DBCampo("FechaCitaOS").ToDate.ToString("HHmm"))

View File

@@ -10,6 +10,7 @@ Imports System.ServiceModel.Security
Imports RVCFDI.RVLTimbrado
Imports Microsoft.Owin.Security.Provider
Imports Telerik.Web.UI
Imports ADSNetLibrary.SIGAPI.Services.SAT.DescargaCFDI
@@ -478,12 +479,23 @@ Partial Class OS_OrdenesServicios
End If
End If
If TipoEstatus.Contiene(1, 2, 3, 4) And CveVenta <= 0 Then
If TipoEstatus.Contiene(1, 2, 3) And CveVenta <= 0 And (UsuarioActual.TienePermisoProceso(370) Or UsuarioActual.TienePermisoProceso(382)) Then
BtnCancelar.Visible = True
Else
ElseIf TipoEstatus.Contiene(4) And (UsuarioActual.TienePermisoProceso(370) Or UsuarioActual.TienePermisoProceso(382)) Then
BtnCancelar.Visible = False
BtnGuardar.Visible = True
DdlEstatusOS.Enabled = False
ElseIf TipoEstatus.Contiene(5) And (UsuarioActual.TienePermisoProceso(370) Or UsuarioActual.TienePermisoProceso(382)) Then
BtnCancelar.Visible = False
BtnGuardar.Visible = False
DdlEstatusOS.Enabled = False
Else
If UsuarioActual.TienePermisoProceso(369) Then ' terminado
BtnGuardar.Visible = True
Else
BtnGuardar.Visible = False
End If
End If
End If
End Sub
@@ -1189,27 +1201,27 @@ Partial Class OS_OrdenesServicios
'ObjEstatusPermisos.Dispose()
'OS Estatus Inicial
If tipoEstatus = 1 And UsuarioActual.TienePermisoProceso(366) Then
If tipoEstatus = 1 AndAlso UsuarioActual.TienePermisoProceso(366) Then
Exit Sub
End If
'OS Estatus Asignación
If tipoEstatus = 2 And UsuarioActual.TienePermisoProceso(367) Then
If tipoEstatus = 2 AndAlso UsuarioActual.TienePermisoProceso(367) Then
Exit Sub
End If
'OS Estatus Proceso
If tipoEstatus = 3 And UsuarioActual.TienePermisoProceso(368) Then
If tipoEstatus.Contiene(2, 3) AndAlso UsuarioActual.TienePermisoProceso(368) Then
Exit Sub
End If
'OS Estatus Terminado
If tipoEstatus = 4 And UsuarioActual.TienePermisoProceso(369) Then
If tipoEstatus.Contiene(2, 3, 4) AndAlso UsuarioActual.TienePermisoProceso(369) Then
Exit Sub
End If
'OS Estatus Cancelada
If tipoEstatus = 5 And UsuarioActual.TienePermisoProceso(370) Then
If tipoEstatus.Contiene(2, 3, 4, 5) AndAlso UsuarioActual.TienePermisoProceso(370) Then
Exit Sub
End If
@@ -3202,6 +3214,9 @@ Partial Class OS_OrdenesServicios
End If
End If
End If
'ProcesoOK = False
Dim Respuesta As New RespuestaFacturacion()
Dim DtVentaDetalle As New DataTable
Dim CveMovimientoSalida, CveMovimientoEntrada As Integer

View File

@@ -72,6 +72,7 @@ Partial Class CatFolios
DdlTipoDocto.Items.Insert(33, New ListItem("Productos/Servicios", "PS"))
DdlTipoDocto.Items.Insert(34, New ListItem("NC de Remisión", "RNC"))
DdlTipoDocto.Items.Insert(35, New ListItem("Traspaso Carta Porte", "Tra"))
DdlTipoDocto.Items.Insert(35, New ListItem("Retenciones", "Ret"))
ElseIf UsuarioActual.Empresa.CvePlataforma = 2 Then
DdlTipoDocto.Items.Insert(1, New ListItem("Facturas", "Ing"))
DdlTipoDocto.Items.Insert(2, New ListItem("Notas de Crédito", "Egs"))

View File

@@ -1471,14 +1471,16 @@ Partial Class Sistemas_UsuarioDetalle
#Region " CONTRASEÑA "
Protected Sub LnkRestablecer_Click(sender As Object, e As EventArgs) Handles LnkRestablecer.Click
Dim Usuario As New ClsSisUsuarios
Protected Sub LnkRestablecer_Click(sender As Object, e As EventArgs) Handles LnkRestablecer.Click
Dim ObjUsuario As New ClsSisUsuarios()
If Usuario.UpdateUsuarioContrasenia(Encripta(ContraseñaPredeterminada), CveUsuario, CveEmpresa) Then
If ObjUsuario.UpdateUsuarioContrasenia(Encripta(ContraseñaPredeterminada), CveUsuario, CveEmpresa) Then
Alert("Contraseña Restablecida.<br> La nueva contraseña es: """ & ContraseñaPredeterminada & "", TipoMensaje.MsgInformacion)
End If
Usuario.Dispose()
ObjUsuario.Dispose()
End Sub
Protected Sub LnkVerPass_Click(sender As Object, e As EventArgs) Handles LnkVerPass.Click

View File

@@ -117,7 +117,7 @@
<div class="portlet-body rowpadding">
<div class="row my-1">
<label class="col-md-4 bold text-primary">Folio</label>
<asp:Label class="col-md-2" runat="server" ID="LbFolio" Text=""></asp:Label>
<asp:TextBox class="col-md-2" runat="server" ID="TxtFolio" Text="" MaxLength="50" style="margin-left:15px" Width="120px" Height="34px"></asp:TextBox>
<div class="col-md-2">
<asp:HyperLink runat="server" Text="" Target="_blank" id="HypRemision" CssClass="Texto"></asp:HyperLink>
</div>

View File

@@ -148,7 +148,7 @@ Partial Class RepContratoDetalle
CveContratoTipo = Contrato.Rows(0)("CveContratoTipo").ToString.ToEntero
SubProyecto = Contrato.Rows(0)("SubProyecto").ToString
CveMasivo = Contrato.Rows(0)("CveMasivo").ToString.ToEntero
LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
TxtFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString
DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString
DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString
@@ -267,7 +267,7 @@ Partial Class RepContratoDetalle
Response.Clear()
Response.ClearHeaders()
Response.ClearContent()
Response.AddHeader("Content-Disposition", "attachment; filename=" & LbFolio.Text & $"{File.Extension}")
Response.AddHeader("Content-Disposition", "attachment; filename=" & TxtFolio.Text & $"{File.Extension}")
Response.AddHeader("Content-Length", File.Length.ToString())
'Response.ContentType = "text/plain"
Response.ContentType = "application/octet-stream"
@@ -297,7 +297,7 @@ Partial Class RepContratoDetalle
Dim ObjContratos As New ClsContratos
ObjContratos.IniciaTransacSQL()
Try
If ObjContratos.UpdateContratos(CveContrato, LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then
Alert("Contrato actualizado correctamente")
@@ -345,7 +345,7 @@ Partial Class RepContratoDetalle
Dim dtResult As New DataTable()
Dim params As New List(Of ReportParameter) From {
New ReportParameter("Folio", LbFolio.Text),
New ReportParameter("Folio", TxtFolio.Text),
New ReportParameter("Cliente", DdlClientes.SelectedText),
New ReportParameter("Servicio", TxtDescripcion.Text),
New ReportParameter("Observaciones", TxtObservaciones.Text),
@@ -364,7 +364,7 @@ Partial Class RepContratoDetalle
New ReportParameter("Usuario", UsuarioActual.Nombre)
}
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Contrato.mrt", dtResult, params, NombreArchivo:=LbFolio.Text)
ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Contrato.mrt", dtResult, params, NombreArchivo:=TxtFolio.Text)
End Sub
Protected Sub AgregarABitacora(Descripcion As String)
Dim ObjEventoBitacora As New ClsOIEventos

19
VIA/RepTripsChecks.aspx Normal file
View File

@@ -0,0 +1,19 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepTripsChecks.aspx.cs" Inherits="VYA_RepTripsChecks" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class VYA_RepTripsChecks : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}

19
VIA/TripsChecks.aspx Normal file
View File

@@ -0,0 +1,19 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TripsChecks.aspx.cs" Inherits="VYA_TripsChecks" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

14
VIA/TripsChecks.aspx.cs Normal file
View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class VYA_TripsChecks : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}

View File

@@ -458,7 +458,7 @@ Partial Class ProductosyServicios
DivCitricos.Visible = True
CargaPanelCitricos()
End If
If UsuarioActual.CveEmpresa = 119 Then
If UsuarioActual.CveEmpresa.Contiene(119, 194) Then
DiveCommerce.Visible = True
Dim CveCategoria2 As Integer = GlobalDTGralCategorias2(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", "Categoria = 'Ecommerce'").ToEntero
DdlEcommerceClasificacion.DataSource = GlobalDTClasificaciones2(UsuarioActual.CveEmpresa, CveCategoria2)

View File

@@ -70,7 +70,6 @@ Partial Class Ventas_RepPS
DdlPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
End If
If UsuarioActual.Empresa.Funcionalidad(130) = "1" Then
DivMarca.Visible = True
LblMarca.Visible = True
@@ -78,17 +77,12 @@ Partial Class Ventas_RepPS
DivLinea.Visible = True
DdlMarcaPSDes.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
'Using ObjMarcas As New ClsProductosServicios
' If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
' DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
' DdlMarcaPSDes.DataBind()
' End If
'End Using
DdlMarcaPSDes.DataBind()
End If
DdlLinea.DataSource = GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa)
DdlLinea.DataBind()
'DdlMarcaPSDes.Items.Insert(0, New ListItem(" Todos ", "-1"))
DdlMarcaPSDes.Items.Insert(0, New ListItem(" Todos ", "-1"))
End Sub
Private Sub CargaDatos()

View File

@@ -20,7 +20,7 @@
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:HyperLink NavigateUrl="javascript:;" data-toggle="modal" data-target="#DivTipoCambio" ID="ImgTipoCambio" runat="server"> <i class="fa fa-money"></i> Ver Dlls en pesos</asp:HyperLink>
</li>
</asp:Content>
@@ -120,13 +120,17 @@
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas con los filtros especificados"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" DataKeyNames="CveCliente,CveVendedor,CveSubProyecto,CvePS,CveUnidadMedida,Cantidad,PU,CveVentaDetalle,GastosEnvio" data-sort="true" GridLines="None" Width="99%">
<Columns>
<asp:BoundField HeaderText="Cliente" DataField="NombreComercial" ItemStyle-Width="25%" />
<asp:BoundField HeaderText="Dirección" DataField="DireccionEnvio" ItemStyle-Width="25%" />
<asp:BoundField HeaderText="SerieFolio" DataField="SerieFolio" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-Width="7.5%" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="2.5%" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-Width="25%" />
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-Width="15%" />
<asp:TemplateField >
<ItemTemplate>
<asp:Label ID="LblCliente" runat="server" Text='<%#Eval("NombreComercial") %>'></asp:Label><br />
<asp:Label ID="LblDir" Font-Italic="true" runat="server" Text='<%#Eval("DireccionEnvio") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="SerieFolio" DataField="SerieFolio" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" />
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" />
<asp:TemplateField ItemStyle-Width="2.5%">
<ItemTemplate>

View File

@@ -62,7 +62,8 @@ Partial Class Ventas_RepPedidosSTF
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveVendedor") = "" Then e.Row.FCCheckBox("Chk").Visible = False
If e.Row.DBCampo("CveVendedor") = "" OrElse e.Row.DBCampo("CvePS") = "" Then e.Row.FCCheckBox("Chk").Visible = False
If e.Row.DBCampo("TipoRenglon") = "1" Then e.Row.CssClass = "SubTotales"
End If
End Sub

View File

@@ -76,14 +76,18 @@
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1 truncate">Sucursal:</div>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:Label ID="LblProyecto" runat="server" class="col-md-1 truncate">Proyecto:</asp:Label>
<div runat="server" id="DivProyecto" class="col-md-1">
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 100%;"></asp:DropDownList>
</div>
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
<div runat="server" id="DivSubProyecto" class="col-md-1">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">Grupo:</div>
<div class="col-md-2 truncate">
<div class="col-md-1 truncate">
<asp:DropDownList ID="DdlGrupo" runat="server" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Text="Año Venta" Value="1"></asp:ListItem>
<asp:ListItem Text="Mes Venta" Value="2"></asp:ListItem>
@@ -100,7 +104,7 @@
<asp:ListItem Text="Estatus Fact." Value="9"></asp:ListItem>
<asp:ListItem Text="% IVA" Value="10"></asp:ListItem>
<asp:ListItem Text="Forma de Pago" Value="15"></asp:ListItem>
<asp:ListItem Text="Vendedor/Cliente" Value="16"></asp:ListItem>
<asp:ListItem Text="Vendedor/Cliente" Value="16"></asp:ListItem>
</asp:DropDownList>
</div>
</div>

View File

@@ -108,8 +108,12 @@ Partial Class Ventas_RepRecuperacion
End If
'Carga SubProyectos
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.DataBind()
'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
'DdlSubProyecto.DataBind()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto, VisualizacionReporte:=1)
If UsuarioActual.Empresa.Funcionalidad(307) <> "" Then DdlGrupo.Items.Add(New ListItem(UsuarioActual.Empresa.Funcionalidad(307), "18"))
'Carga Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
@@ -149,7 +153,6 @@ Partial Class Ventas_RepRecuperacion
txtFechaI.Text = $"01/{NowADS().Month}/{NowADS().Year}"
txtFechaF.Text = NowADS().ToShortDateString
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
lblEsDistribuidor.Visible = True
divEsDistribuidor.Visible = True
@@ -169,13 +172,12 @@ Partial Class Ventas_RepRecuperacion
Dim FechaAplicadoI As Date = If(IsDate(TxtFechaAplicadoI.Text), TxtFechaAplicadoI.Text.ToDate, MinFecha)
Dim FechaAplicadoF As Date = If(IsDate(TxtFechaAplicadoF.Text), TxtFechaAplicadoF.Text.ToDate, MaxFecha)
Dim FechaRegistroIEI As Date = If(IsDate(TxtFechaRegistroIEI.Text), TxtFechaRegistroIEI.Text.ToDate, MinFecha)
Dim FechaRegistroIEF As Date = If(IsDate(TxtFechaRegistroIEF.Text), TxtFechaRegistroIEF.Text.ToDate, MaxFecha)
If ObjMovtos.GetRepRecuperacion(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, -1,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero,
"-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlResponsable.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue.ToString, CveProyecto:=DdlProyecto.SelectedValue.ToEntero, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero,
EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero,
CveMoneda:=DdlMoneda.SelectedValue.ToEntero) Then
@@ -220,15 +222,15 @@ Partial Class Ventas_RepRecuperacion
End If
End If
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}",
Dim Liga4 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}&CveProyecto={26}",
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, e.Row.DBCampo("CveCondicionesPago"), e.Row.DBCampo("CveTipoTransaccion"))
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 2, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, e.Row.DBCampo("CveCondicionesPago"), e.Row.DBCampo("CveTipoTransaccion"), e.Row.DBCampo("CveProyecto"))
e.Row.FCHyperLink("HplPagado").NavigateUrl = Liga4
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}",
Dim Liga5 As String = String.Format("/Ventas/RepRecuperacionDetalle.aspx?GPO={0}&CveCliente={1}&CveSubProyecto={2}&Vendedor={3}&CveUsuario={4}&CveEstatusFactura={5}&IVA={6}&FechaI={7}&FechaF={8}&CveResponsable={9}&TipoDocto={10}&CveClienteSucursal={11}&CveBanco{12}&CveCuenta{13}&Grupo={14}&TipoCambio={15}&TCEspecifico={16}&CveMoneda={17}&Tipo={18}&EsDistribuidor={19}&FechaAplicadoI={20}&FechaAplicadoF={21}&FechaRegistroIEI={22}&FechaRegistroIEF={23}&CveCondicionesPago={24}&CveTipoTransaccion={25}&CveProyecto={26}",
DdlGrupo.SelectedValue, e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, e.Row.DBCampo("CveCondicionesPago"), e.Row.DBCampo("CveTipoTransaccion"))
e.Row.DBCampo("CveUsuario"), e.Row.DBCampo("CveEstatusFactura"), e.Row.DBCampo("GPO_IVA"), FechaI, FechaF, DdlResponsable.SelectedValue, e.Row.DBCampo("TipoDocto"), CveClienteSucursal, e.Row.DBCampo("CveBanco"), e.Row.DBCampo("CveCuenta"), e.Row.DBCampo("GPO"), e.Row.DBCampo("TipoCambio"), e.Row.DBCampo("TCEspecifico"), e.Row.DBCampo("CveMoneda"), 1, e.Row.DBCampo("EsDistribuidor"), FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF, e.Row.DBCampo("CveCondicionesPago"), e.Row.DBCampo("CveTipoTransaccion"), e.Row.DBCampo("CveProyecto"))
e.Row.FCHyperLink("HplVendido").NavigateUrl = Liga5
@@ -241,28 +243,43 @@ Partial Class Ventas_RepRecuperacion
e.Row.CssClass = "SubTotales"
End If
End If
End If
End If
End Sub
End Sub
#End Region
#Region "SELECTED INDEX CHANGE"
Protected Sub DdlBanco_SelectedIndexChanged(sender As Object, e As EventArgs)
DdlCuentaBancaria.Items.Clear()
DdlCuentaBancaria.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveBanco = {DdlBanco.SelectedValue.ToEntero}")
DdlCuentaBancaria.Items.Insert(0, New ListItem("Todos", "-1"))
DdlCuentaBancaria.DataBind()
End Sub
End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyecto(DdlSubProyecto, DdlProyecto.SelectedValue)
End Sub
Public Sub CargaSubProyecto(DdlSubProyecto As DropDownList, CveProyecto As String, Optional AplicaTodos As String = "Todos")
DdlSubProyecto.Items.Clear()
DdlSubProyecto.ClearSelection()
DdlSubProyecto.DataSource = If(Not UsuarioActual.TienePermisoProceso(110), GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, CveProyecto.ToEntero(), UsuarioActual.CveEmpresa, -1, 1), GlobalDTSubProyectos(UsuarioActual.CveEmpresa, CveProyecto:=CveProyecto.ToEntero(), Estatus:=1))
DdlSubProyecto.DataBind()
If AplicaTodos <> "" Then
If DdlSubProyecto.GetType() Is GetType(ListBox) Then
'DdlSubProyecto.Text = "Seleccione"
Else
DdlSubProyecto.Items.Insert(0, New ListItem(If(CveProyecto <> "-1", AplicaTodos, "Todos"), "-1"))
End If
End If
End Sub
#End Region
#Region "IMPRESIONES"
Protected Sub LnkPdf_Click(sender As Object, e As EventArgs)
Imprimir("PDF")
End Sub

View File

@@ -81,14 +81,18 @@
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1 truncate">Sucursal: </div>
<div class="col-md-2 ">
<asp:Label ID="LblProyecto" runat="server" class="col-md-1 truncate">Proyecto:</asp:Label>
<div runat="server" id="DivProyecto" class="col-md-1">
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me" Style="width: 100%;"></asp:DropDownList>
</div>
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
<div runat="server" id="DivSubProyecto" class="col-md-1">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate"> Grupo: </div>
<div class="col-md-2 truncate">
<div class="col-md-1 truncate">
<asp:DropDownList ID="DdlGrupo" runat="server" CssClass="form-control input-small input-sm select2me" Width="100%">
<asp:ListItem Text="Año de Venta" Value="1"></asp:ListItem>
<asp:ListItem Text="Mes de Venta" Value="2"></asp:ListItem>
@@ -104,7 +108,7 @@
<asp:ListItem Text="Usuario" Value="8"></asp:ListItem>
<asp:ListItem Text="Estatus Fact." Value="9"></asp:ListItem>
<asp:ListItem Text="% IVA" Value="10"></asp:ListItem>
<asp:ListItem Text="Forma de Pago" Value="15"></asp:ListItem>
<asp:ListItem Text="Forma de Pago" Value="15"></asp:ListItem>
</asp:DropDownList>
</div>
</div>

View File

@@ -94,7 +94,7 @@ Partial Class Ventas_RepRecuperacionDetalle
#Region "CARGAS"
Private Sub CargaCombos()
Dim CveCliente, CveVendedor, CveUsuario, CveSubProyecto,
Dim CveCliente, CveVendedor, CveUsuario, CveProyecto, CveSubProyecto,
CveEstatus, CveResponsable, CveAgrupador, CveBanco, CveCuenta, CveClienteSucursal, CveMoneda, CveClienteClasificacion As Integer
Dim FechaI, FechaF, TipoDocto, TipoCambio, FechaAplicadoI, FechaAplicadoF, FechaRegistroIEI, FechaRegistroIEF As String
@@ -111,9 +111,11 @@ Partial Class Ventas_RepRecuperacionDetalle
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
If UsuarioActual.Empresa.Funcionalidad(307) <> "" Then DdlGrupo.Items.Add(New ListItem(UsuarioActual.Empresa.Funcionalidad(307), "18"))
'Carga SubProyectos
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSubProyecto.DataBind()
'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
'DdlSubProyecto.DataBind()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto, VisualizacionReporte:=1)
'Carga Vendedor
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
@@ -179,7 +181,8 @@ Partial Class Ventas_RepRecuperacionDetalle
End If
TipoDocto = IfNull(Request("TipoDocto"), "-1").ToString
CveClienteSucursal = IfNull(Request("CveClienteSucursal"), "-1").ToString.ToEntero
CveClienteSucursal = IfNull(Request("CveClienteSucursal"), "-1").ToString.ToEntero
CveProyecto = IfNull(Request("CveProyecto"), "-1").ToString.ToEntero
CveSubProyecto = IfNull(Request("CveSubProyecto"), "-1").ToString.ToEntero
CveVendedor = IfNull(Request("Vendedor"), "-1").ToString.ToEntero
CveCliente = IfNull(Request("CveCliente"), "-1").ToString.ToEntero
@@ -225,6 +228,7 @@ Partial Class Ventas_RepRecuperacionDetalle
DdlClienteClasificacion.Items.Insert(0, New ListItem("Todas", "-1"))
DdlVendedor.SelectedValueExist(CveVendedor)
DdlProyecto.SelectedValueExist(CveProyecto)
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
If CveCliente > 0 Then
DdlClientes.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("NombreComercial", "")
@@ -268,7 +272,7 @@ Partial Class Ventas_RepRecuperacionDetalle
If ObjMovtos.GetRepRecuperacionDetalle(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, DdlClientes.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero,
DdlClienteSucursal.SelectedValue.ToEntero, -1,
Iva.ToString, DdlGrupo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlResponsable.SelectedValue.ToEntero,
DdlTipoDocto.SelectedValue, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero, Grupo:=Grupo,
DdlTipoDocto.SelectedValue, CveProyecto:=DdlProyecto.SelectedValue.ToEntero, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveBanco:=DdlBanco.SelectedValue.ToEntero, CveCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero, Grupo:=Grupo,
TipoCambio:=RblTipoCambio.SelectedValue.ToEntero, TCEspecifico:=TCEspecifico, CveMoneda:=DdlMoneda.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, Tipo:=Tipo,
EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero(), FechaAplicadoI:=FechaAplicadoI, FechaAplicadoF:=FechaAplicadoF, FechaRegistroIEI:=FechaRegistroIEI, FechaRegistroIEF:=FechaRegistroIEF,
CveTipoTransaccion:=DdlTipoTransaccion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero) Then

View File

@@ -163,7 +163,7 @@ public partial class Ventas_RepRecuperacionPeriodo : ClsPaginas
protected void BtnConsultar_Click(object sender, EventArgs e)
{
Consulta();
Consulta();
}
private void Consulta()

View File

@@ -4240,7 +4240,7 @@
</tr>
<tr align="left">
<td>
<asp:TextBox ID="TxtObsFact" runat="server" Rows="3" TextMode="MultiLine" Width="100%" MaxLength="800" CssClass="form-control input-sm"></asp:TextBox></td>
<asp:TextBox ID="TxtObsFact" runat="server" Rows="3" TextMode="MultiLine" Width="100%" MaxLength="2000" CssClass="form-control input-sm"></asp:TextBox></td>
</tr>
<tr id="TrOC" runat="server">
<td>Orden de Compra: &nbsp;