Merge branch 'master' of http://oirigoyen@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -5,6 +5,8 @@ Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports System.Xml
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports GemBox.Spreadsheet
|
||||
|
||||
Partial Class Bancos_CargarConciliacionesBancarias
|
||||
Inherits ClsPaginas
|
||||
|
||||
@@ -83,51 +85,99 @@ Partial Class Bancos_CargarConciliacionesBancarias
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
|
||||
|
||||
Dim unnamed As Integer = 0
|
||||
Dim cols As Integer
|
||||
Dim columns As String()
|
||||
Dim curRow As Integer = 0
|
||||
Dim curCol As Integer = 0
|
||||
Dim dataTable As DataTable = New DataTable()
|
||||
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
|
||||
|
||||
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
|
||||
|
||||
If firstRowHasHeaders Then
|
||||
|
||||
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
||||
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString())
|
||||
Else
|
||||
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
||||
End If
|
||||
|
||||
curRow = 1
|
||||
Else
|
||||
dataTable.Columns.Add("Column " & (cols + 1))
|
||||
End If
|
||||
Next
|
||||
|
||||
While curRow < worksheet.Rows.Count
|
||||
columns = New String(cols - 1) {}
|
||||
|
||||
For curCol = 0 To cols - 1
|
||||
|
||||
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
|
||||
columns(curCol) = ""
|
||||
Else
|
||||
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
||||
End If
|
||||
Next
|
||||
|
||||
dataTable.Rows.Add(columns)
|
||||
curRow += 1
|
||||
End While
|
||||
|
||||
Return dataTable
|
||||
End Function
|
||||
|
||||
Private Sub CargaExcel(Ruta As String, FileName As String, Tipo As String)
|
||||
If Not DdlCuenta.SelectedValue.ToEntero > 0 Then
|
||||
Alert("Tiene que seleccionar una cuenta", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Dim dt As New DataTable
|
||||
Dim Conexion As Odbc.OdbcConnection = Nothing
|
||||
Dim ErrorArchivo = False
|
||||
Dim ErrorExcel = False
|
||||
Dim strConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + Ruta + FileName + ";Extended Properties=Excel 8.0;"
|
||||
Dim objDbFactory As Common.DbProviderFactory = Common.DbProviderFactories.GetFactory("System.Data.OleDb")
|
||||
Dim objDbAdapter As Common.DbDataAdapter = objDbFactory.CreateDataAdapter()
|
||||
Dim objDbConnection As Common.DbConnection = objDbFactory.CreateConnection()
|
||||
objDbConnection.ConnectionString = strConnString
|
||||
objDbConnection.Open()
|
||||
Dim objSheetNames As DataTable = objDbConnection.GetSchema("Tables")
|
||||
Dim HojaExcel As String = objSheetNames.FiltroPrimeroValor("TABLE_NAME")
|
||||
Try
|
||||
Select Case Tipo
|
||||
Case "CSV"
|
||||
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Access Text Driver (*.txt, *.csv)};Dbq=" + Ruta + ";Extensions=asc,csv,tab,txt;")
|
||||
Conexion.Open()
|
||||
Dim cmd = Conexion.CreateCommand()
|
||||
cmd.CommandType = CommandType.Text
|
||||
cmd.CommandText = $"SELECT * FROM [{FileName}]"
|
||||
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
DataAdapter.Fill(dt)
|
||||
Case "EXCEL"
|
||||
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
|
||||
Conexion.Open()
|
||||
Dim cmd = Conexion.CreateCommand()
|
||||
cmd.CommandType = CommandType.Text
|
||||
cmd.CommandText = $"SELECT * FROM [{HojaExcel}]"
|
||||
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
DataAdapter.Fill(dt)
|
||||
Case Else
|
||||
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
ErrorArchivo = True
|
||||
OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
||||
End Try
|
||||
Conexion.Close()
|
||||
If Not ErrorArchivo Then
|
||||
dt = ReadExcelFile(Ruta + FileName, True)
|
||||
'Dim Conexion As Odbc.OdbcConnection = Nothing
|
||||
'Dim ErrorArchivo = False
|
||||
'Dim ErrorExcel = False
|
||||
'Dim strConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + Ruta + FileName + ";Extended Properties=Excel 8.0;"
|
||||
'Dim objDbFactory As Common.DbProviderFactory = Common.DbProviderFactories.GetFactory("System.Data.OleDb")
|
||||
'Dim objDbAdapter As Common.DbDataAdapter = objDbFactory.CreateDataAdapter()
|
||||
'Dim objDbConnection As Common.DbConnection = objDbFactory.CreateConnection()
|
||||
'objDbConnection.ConnectionString = strConnString
|
||||
'objDbConnection.Open()
|
||||
'Dim objSheetNames As DataTable = objDbConnection.GetSchema("Tables")
|
||||
'Dim HojaExcel As String = objSheetNames.FiltroPrimeroValor("TABLE_NAME")
|
||||
'Try
|
||||
' Select Case Tipo
|
||||
' Case "CSV"
|
||||
' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Access Text Driver (*.txt, *.csv)};Dbq=" + Ruta + ";Extensions=asc,csv,tab,txt;")
|
||||
' Conexion.Open()
|
||||
' Dim cmd = Conexion.CreateCommand()
|
||||
' cmd.CommandType = CommandType.Text
|
||||
' cmd.CommandText = $"SELECT * FROM [{FileName}]"
|
||||
' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
' DataAdapter.Fill(dt)
|
||||
' Case "EXCEL"
|
||||
' Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
|
||||
' Conexion.Open()
|
||||
' Dim cmd = Conexion.CreateCommand()
|
||||
' cmd.CommandType = CommandType.Text
|
||||
' cmd.CommandText = $"SELECT * FROM [{HojaExcel}]"
|
||||
' Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
|
||||
' DataAdapter.Fill(dt)
|
||||
' Case Else
|
||||
' Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
|
||||
' Exit Sub
|
||||
' End Select
|
||||
'Catch ex As Exception
|
||||
' ErrorArchivo = True
|
||||
' OnError("Ocurrio un error al leer el archivo <br/>" & ex.Message, ex)
|
||||
'End Try
|
||||
'Conexion.Close()
|
||||
If dt IsNot Nothing Then
|
||||
dt.Columns(0).ColumnName = "FechaDocumento"
|
||||
dt.Columns(1).ColumnName = "Referencia"
|
||||
dt.Columns(2).ColumnName = "Importe"
|
||||
@@ -166,6 +216,8 @@ Partial Class Bancos_CargarConciliacionesBancarias
|
||||
ObjBancos.RollBack()
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
Else
|
||||
Alert("Hubo un error al intentar leer el archivo.", TipoMensaje.MsgError)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LbPDF" runat="server" OnClick="LbPDF_Click"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LbExcel" runat="server" OnClick="LbExcel_Click"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Bancos
|
||||
@@ -15,7 +21,7 @@
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<table class="table table-striped table-advance table-hover">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="150px">
|
||||
|
||||
@@ -4,54 +4,67 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Bancos_CatBancos
|
||||
Inherits ClsPaginas
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
Private Property DtBan As DataTable
|
||||
Get
|
||||
DtBan = DirectCast(ViewState("DtBan"), DataTable)
|
||||
End Get
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetBancos() Then
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtBan") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
ObjBancos.Dispose()
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetBancos() Then
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtBanco.Text = ""
|
||||
TxtEjecutivo.Text = ""
|
||||
ObjBancos.Dispose()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.AddBancos(TxtBanco.Text.Trim, TxtEjecutivo.Text.Trim, TxtTelefono.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
TxtBanco.Text = ""
|
||||
TxtEjecutivo.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
Alert("El nuevo Banco se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
UpTitulos.Update()
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
UpTitulos.Update()
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
End Sub
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
End Sub
|
||||
|
||||
#Region "G V D A T O S"
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
@@ -80,6 +93,7 @@ Partial Class Bancos_CatBancos
|
||||
If ObjBancos.RemoveBancos(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("El Banco se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
@@ -116,6 +130,7 @@ Partial Class Bancos_CatBancos
|
||||
If ObjBancos.UpdateBancos(Banco, Ejecutivo, Telefono, Estatus, CveBanco) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancos") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
GlobalDTBancos = ObjBancos.DtResultados
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
@@ -178,4 +193,28 @@ Partial Class Bancos_CatBancos
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
Protected Sub LbPDF_Click(sender As Object, e As EventArgs)
|
||||
Imprime("PDF")
|
||||
End Sub
|
||||
Protected Sub LbExcel_Click(sender As Object, e As EventArgs)
|
||||
Imprime("Excel")
|
||||
End Sub
|
||||
Private Sub Imprime(Formato As String)
|
||||
|
||||
If DtBan IsNot Nothing AndAlso DtBan.Rows.Count > 0 Then
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepBancos.rdlc", DtBan, params, "Reporte Bancos", Formato)
|
||||
Else
|
||||
Alert("No hay información para mostrar.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -6,14 +6,17 @@
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LBAdd" PostBackUrl="/Bancos/CuentasBancariasDetalle.aspx" CommandArgument="-1" runat="server"><i class="fa fa-plus-circle"></i> Agregar Cuenta Bancaria</asp:LinkButton>
|
||||
<%-- <img alt="Nuevo Número de Cuenta Bancaria" onclick="document.location.href='/Bancos/CuentasBancariasDetalle.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer;" />--%>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<li>
|
||||
<asp:LinkButton ID="LBAdd" PostBackUrl="/Bancos/CuentasBancariasDetalle.aspx" CommandArgument="-1" runat="server"><i class="fa fa-plus-circle"></i> Agregar Cuenta Bancaria</asp:LinkButton>
|
||||
<%-- <img alt="Nuevo Número de Cuenta Bancaria" onclick="document.location.href='/Bancos/CuentasBancariasDetalle.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer;" />--%>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LbPDF" runat="server" OnClick="LbPDF_Click"><i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LbExcel" runat="server" OnClick="LbExcel_Click"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Número de Cuentas Bancarias / Cajas Chicas.
|
||||
@@ -23,10 +26,10 @@
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCuenta" EmptyDataText="No se encontraron Números de Cuentas Registrados" ToolTip="Listado de Números de Cuentas" CssClass="table table-striped table-advance table-hover" Style=" text-align: center;" GridLines="None" Width="100%">
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCuenta" EmptyDataText="No se encontraron Números de Cuentas Registrados" ToolTip="Listado de Números de Cuentas" CssClass="table table-striped table-advance table-hover" Style="text-align: center;" GridLines="None" Width="100%">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="TipoCuenta" HeaderText="Tipo Cuenta" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Bancos/CuentasBancariasDetalle.aspx?CveCuenta={0}" DataNavigateUrlFields="CveCuenta" Target="_blank"/>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<asp:HyperLinkField DataTextField="TipoCuenta" HeaderText="Tipo Cuenta" ControlStyle-CssClass="Texto" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="/Bancos/CuentasBancariasDetalle.aspx?CveCuenta={0}" DataNavigateUrlFields="CveCuenta" Target="_blank" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Banco</HeaderTemplate>
|
||||
<ItemTemplate> <asp:Literal ID="LtlBanco" runat="server" Text='<%# Eval("Banco", "{0}") %>'></asp:Literal></ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -35,7 +38,7 @@
|
||||
<ItemTemplate> <asp:Literal ID="LtlNumCuenta" runat="server" Text='<%# Eval("NumCuenta", "{0}") %>'></asp:Literal></ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>CLABE</HeaderTemplate>
|
||||
<ItemTemplate> <asp:Literal ID="LtlCLABE" runat="server" Text='<%# Eval("CLABE", "{0}") %>'></asp:Literal></ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
@@ -43,26 +46,30 @@
|
||||
<HeaderTemplate>Moneda</HeaderTemplate>
|
||||
<ItemTemplate> <asp:Literal ID="LtlMoneda" runat="server" Text='<%# Eval("Moneda", "{0}") %>'></asp:Literal></ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Folio Inicial</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFInicial" runat="server" Text='<%# Eval("FInicial", "{0:d}") %>'></asp:Literal></ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:Literal ID="LtlFInicial" runat="server" Text='<%# Eval("FInicial", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Estatus</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal></ItemTemplate>
|
||||
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>Fecha</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal></ItemTemplate>
|
||||
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="75px" ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField ItemStyle-Width="75px" ItemStyle-HorizontalAlign="Left">
|
||||
<HeaderTemplate>Usuario</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal></ItemTemplate>
|
||||
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
|
||||
@@ -4,9 +4,21 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Linq
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Bancos_CuentasBancarias
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DtBan As DataTable
|
||||
Get
|
||||
DtBan = DirectCast(ViewState("DtBan"), DataTable)
|
||||
End Get
|
||||
|
||||
Set(ByVal value As DataTable)
|
||||
ViewState("DtBan") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Configuración
|
||||
Private ReadOnly Property CveCuenta As Integer
|
||||
Get
|
||||
@@ -22,7 +34,7 @@ Partial Class Bancos_CuentasBancarias
|
||||
Dim ObjBancos As New ClsBancos
|
||||
If ObjBancos.GetBancosCuentas(-1) Then
|
||||
ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
@@ -53,6 +65,7 @@ Partial Class Bancos_CuentasBancarias
|
||||
If ObjBancos.RemoveBancosCuentas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
|
||||
GvDatos.EditIndex = -1
|
||||
ViewState("DTBancosCuentas") = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
DtBan = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
If ObjBancos.GetBancosCuentasUsuarios(-1) Then
|
||||
GlobalDTBancosCuentas(-1) = ObjBancos.DtResultados
|
||||
End If
|
||||
@@ -126,4 +139,27 @@ Partial Class Bancos_CuentasBancarias
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Protected Sub LbPDF_Click(sender As Object, e As EventArgs)
|
||||
Imprime("PDF")
|
||||
End Sub
|
||||
Protected Sub LbExcel_Click(sender As Object, e As EventArgs)
|
||||
Imprime("Excel")
|
||||
End Sub
|
||||
Private Sub Imprime(Formato As String)
|
||||
If DtBan IsNot Nothing AndAlso DtBan.Rows.Count > 0 Then
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/CuentasBancarias.rdlc", DtBan, params, "Reporte de Cuentas Bancarias", Formato)
|
||||
Else
|
||||
Alert("No hay información para mostrar.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -712,6 +712,7 @@
|
||||
<td>
|
||||
<asp:TextBox ID="TxtTipoCambio" runat="server" MaxLength="12" Width="80px"></asp:TextBox></td>
|
||||
</tr>
|
||||
<asp:Button ID="BtnCambiaTipoMoneda" Text="" OnClick="BtnCambiaTipoMoneda_Click" ClientIDMode="Static" Style="display: none;" runat="server" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -1533,5 +1534,14 @@
|
||||
t.value = (ToDouble(t.value) > ToDouble(c) ? c : t.value)
|
||||
}
|
||||
|
||||
var TipoCambioActual = 0.0;
|
||||
function CambiaTC(txt) {
|
||||
let TipoCambioTxt = ToDouble(txt.value)
|
||||
if (TipoCambioActual != TipoCambioTxt) {
|
||||
$get("BtnCambiaTipoMoneda").click();
|
||||
TipoCambioActual = TipoCambioTxt;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
@@ -649,6 +649,7 @@ Partial Class Bancos_IE
|
||||
CveIE = -1
|
||||
TxtFechaDocumento.Text = Now.ToShortDateString
|
||||
ImgUpdateCuentaDeposito.Visible = False
|
||||
TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);")
|
||||
End If
|
||||
|
||||
InicializaSolicitudAnticipoOC()
|
||||
@@ -2251,7 +2252,12 @@ Partial Class Bancos_IE
|
||||
Dep.Dispose()
|
||||
|
||||
Return EsValido
|
||||
End Function
|
||||
End Function
|
||||
|
||||
Protected Sub BtnCambiaTipoMoneda_Click(sender As Object, e As EventArgs)
|
||||
CambiaTipoMoneda()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
|
||||
|
||||
@@ -2259,9 +2265,7 @@ Partial Class Bancos_IE
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'PARA QUE TOME EL TIPO DE CAMBIO DEL DIA
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToString
|
||||
UpTipoCambio.Update()
|
||||
|
||||
|
||||
|
||||
Dim ObjIE As New ClsBancos()
|
||||
@@ -3045,14 +3049,13 @@ Partial Class Bancos_IE
|
||||
'BANCOS COMPLEMENTARIA
|
||||
If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then
|
||||
Dim ImporteAplicar As Decimal = TxtImporte.Text.ToDecimal
|
||||
Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToDecimal
|
||||
Dim ImporteAplicarMN = (ImporteAplicar * TCPago - ImporteAplicar).RoundSQL()
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAplicar, Ref, 204, Conc, Now, IDCtaContableComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, CveCuenta:=CveCuentaConta, TipoCambio:=TCPago) Then
|
||||
Dim ImporteAplicarMN = (ImporteAplicar * TxtTipoCambio.Text.ToDecimal - ImporteAplicar).RoundSQL()
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAplicar, Ref, 204, Conc, Now, IDCtaContableComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, CveCuenta:=CveCuentaConta, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
|
||||
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
|
||||
End If
|
||||
|
||||
If CveConceptoCompra = 10 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, 266, Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, CveCuenta:=0, TipoCambio:=TCPago) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, 266, Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, CveCuenta:=0, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
|
||||
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
|
||||
End If
|
||||
End If
|
||||
@@ -3834,24 +3837,6 @@ Partial Class Bancos_IE
|
||||
|
||||
Else
|
||||
|
||||
'SE COMENTO PARA PODER DESBLOQUEAR LA PREPOLIZA Y CREAR UNA NUEVA POLIZA
|
||||
''LIMPIA POLIZA PONIENDO IMPORTE EN CEROS
|
||||
'For Each dr As DataRow In dt.Rows
|
||||
' If Not ObjAC.UpdateMovimiento(dr("Id").ToString.ToEntero, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "1", 0, dr("Referencia").ToString, dr("Concepto").ToString, dr("IdSegNeg").ToString.ToEntero, dr("Fecha").ToString.ToDate) Then
|
||||
' ErrorCancelar = True
|
||||
' MensajeError = "Error al actualizar Movimientos con importe 0"
|
||||
' Exit For
|
||||
' End If
|
||||
'Next
|
||||
|
||||
''AJUSTA POLIZA
|
||||
'If Not ErrorCancelar Then
|
||||
' If Not ObjAC.AjustaPoliza(IDPoliza) Then
|
||||
' ErrorCancelar = True
|
||||
' MensajeError = "Error al ajustar poliza negativa"
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If ObjAC.RemovePoliza(IDPoliza) Then
|
||||
If Not ObjConta.DesvincularPrePolizaContabilizada(IDPoliza, UsuarioActual.CveEmpresa) Then
|
||||
ErrorCancelar = True
|
||||
@@ -3883,7 +3868,9 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Error al obtener la poliza"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -1414,6 +1414,7 @@ Partial Class Bancos_PopIEVentas
|
||||
|
||||
Dim ObjIE As New ClsBancos()
|
||||
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
|
||||
Dim ObjCliente As New ClsClientes(ObjIE.IniciaTransacSQL)
|
||||
|
||||
Dim CvePlantillaPoliza As Integer = 11
|
||||
Dim ConceptoPoliza As String = String.Format("{0} {1}", NombreCliente, SerieFolio)
|
||||
@@ -2171,32 +2172,50 @@ Partial Class Bancos_PopIEVentas
|
||||
TimpocambioGeneral = tipoCambioPago
|
||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
|
||||
|
||||
|
||||
CveIE = rw.DataKey("CveIE").ToString.ToEntero
|
||||
'si la factura es en dólares y trae complementaria, el importemn debe ser igual al importe
|
||||
If CveMoneda = 2 Then
|
||||
ImporteMX = ImporteMovimiento
|
||||
IdCtaContable = IdCtaContMonedaExtranjeraAnticipo
|
||||
CveCuenta = CveCuentaMonedaExtranjera
|
||||
Else
|
||||
IdCtaContable = IdCtaAnticipo
|
||||
CveCuenta = CveCuentaAnticipo
|
||||
End If
|
||||
TotalPagarCliente = ImporteMovimiento
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, ReferenciaConcepto, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaAnticipo, -1, CveIE, CveVenta, -1, CveSubProyectoContabilizar, If(ViewState("CveCliente") IsNot Nothing, ViewState("CveCliente").ToString.ToEntero, -1), ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioPago) Then
|
||||
|
||||
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
If CveMoneda = 2 Then
|
||||
IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos
|
||||
Else
|
||||
IdCtaContable = ObjCliente.IdCtaContAnticipos
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, ReferenciaConcepto, ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, CveVenta, -1, CveSubProyectoContabilizar, If(ViewState("CveCliente") IsNot Nothing, ViewState("CveCliente").ToString.ToEntero, -1), ImporteMX:=ImporteMX, TipoCambio:=tipoCambioPago) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
|
||||
If CveMoneda <> 1 AndAlso (IdCtaContMonedaComplementariaAnticipo > 0 Or UsuarioActual.CveEmpresa = 119) Then
|
||||
IdCtaContable = IdCtaContMonedaComplementariaAnticipo
|
||||
CveCuenta = CveCuentaComplementaria
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjCliente.IdCtaContCompAnticipos
|
||||
End If
|
||||
If ImporteMovimiento <> 0 AndAlso (IdCtaContable > 0 Or UsuarioActual.CveEmpresa = 119) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, ReferenciaConcepto, 227, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, CveVenta, -1, CveSubProyectoContabilizar, If(ViewState("CveCliente") IsNot Nothing, ViewState("CveCliente").ToString.ToEntero, -1), ImporteMX:=ImporteMovimiento * tipoCambioPago - ImporteMovimiento, CveCuenta:=CveCuenta, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioPago) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, ReferenciaConcepto, 227, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, CveVenta, -1, CveSubProyectoContabilizar, If(ViewState("CveCliente") IsNot Nothing, ViewState("CveCliente").ToString.ToEntero, -1), ImporteMX:=ImporteMovimiento * tipoCambioPago - ImporteMovimiento, ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioPago) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
TotalPagarCliente += Math.Round(ImporteMovimiento * tipoCambioVenta - ImporteMovimiento, 2) 'le agrego la complementario
|
||||
ImporteMX = ImporteMovimiento
|
||||
IdCtaContable = IdCtaContMonedaExtranjeraAnticipo
|
||||
CveCuenta = CveCuentaMonedaExtranjera
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjCliente.IdCtaMonedaExtranjeraAnticipos
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -3462,6 +3481,7 @@ Partial Class Bancos_PopIEVentas
|
||||
|
||||
ObjIE.Dispose()
|
||||
ObjMov.Dispose()
|
||||
ObjCliente.Dispose()
|
||||
|
||||
'CargaVenta(CveVenta)
|
||||
'UpDatosVenta.Update()
|
||||
|
||||
@@ -119,7 +119,7 @@ Partial Class Bancos_Reportes
|
||||
If Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then
|
||||
'CONVIERTO A PESOS CUANDO SE PAGA CON PESOS FACTURAS DE DOLARES
|
||||
For Each Dr As DataRow In dtMovs.Rows
|
||||
Dr("Importe") = Dr("Importe").ToString.ToDecimal * Dr("TC").ToString.ToDecimal
|
||||
Dr("Importe") = Dr("ImporteMN").ToString.ToDecimal
|
||||
Dr("ImporteNC") = Dr("ImporteNC").ToString.ToDecimal * Dr("TC").ToString.ToDecimal
|
||||
Dr("Total") = Dr("Total").ToString.ToDecimal * Dr("TC").ToString.ToDecimal
|
||||
Dr("Saldo") = Dr("Saldo").ToString.ToDecimal * Dr("TC").ToString.ToDecimal
|
||||
|
||||
Reference in New Issue
Block a user