-- libro de diario conta sig

This commit is contained in:
rrene
2020-08-07 11:42:24 -07:00
parent f75b0aedfb
commit 860348d7b0
2 changed files with 248 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepLibroDiario.aspx.vb" Inherits="Contabilidad2_RepLibroDiario" %>
<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">
Libro Diario
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<li>
<asp:LinkButton ID="ImgExcel" Visible="false" runat="server"><i class="fa fa-ad-excel"></i> Generar EXCEL</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="Imprimir" Visible="false" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgExcel" />
<asp:PostBackTrigger ControlID="Imprimir" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
</asp:Content>
<asp:Content ID="Content7" 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" CssClass="btn btn-primary" Text="Consultar" Width="100px" OnClick="BtnConsultar_Click" Enabled="false"/>
</div>
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1" style="width: 90px; padding-right: 2px;">Fecha Inicio:</label>
<div class="col-md-2" style="width: 140px;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaDel" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioDel" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaDel" runat="server" TargetControlID="TxtFechaDel" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioDel" runat="server" TargetControlID="TxtFechaDel" PopupButtonID="ImgCalendarioDel" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaDel" runat="server" ControlToValidate="TxtFechaDel" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha2Del" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaDel" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1" style="width: 80px; padding-right: 2px;">Fecha Fin:</label>
<div class="col-md-2" style="width: 140px;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAl" runat="server" CssClass="form-control" Width="99%" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioAl" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAl" runat="server" TargetControlID="TxtFechaAl" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarioAl" runat="server" TargetControlID="TxtFechaAl" PopupButtonID="ImgCalendarioAl" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaAl" runat="server" ControlToValidate="TxtFechaAl" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha2Al" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaAl" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server" style="margin-left: 15px; margin-right: 15px;">
<ContentTemplate>
<asp:GridView ID="GvDatos" CssClass="table table-striped table-hover Widthall" GridLines="None" AutoGenerateColumns="False" runat="server">
<Columns>
<asp:BoundField HeaderText="Fecha" DataField="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="Tipo" DataField="TipoPoliza" />
<asp:BoundField HeaderText="Poliza" DataField="FolioPoliza" />
<asp:BoundField HeaderText="Concepto" DataField="Concepto" />
<asp:BoundField HeaderText="Cuenta" DataField="Codigo" />
<asp:BoundField HeaderText="Nombre" DataField="Nombre" />
<asp:BoundField HeaderText="Descripción" DataField="Descripcion" />
<asp:BoundField HeaderText="Cargos" DataField="Cargos" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.00}" />
<asp:BoundField HeaderText="Abonos" DataField="Abonos" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#,##0.00}" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
</asp:Content>

View File

@@ -0,0 +1,144 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Contabilidad2_RepLibroDiario
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 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
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
InicializaValores()
BtnConsultar.Enabled = True
End If
End Sub
Private Sub InicializaValores()
TxtFechaDel.Text = $"01/01/{Now.Year}"
TxtFechaAl.Text = Now.ToShortDateString
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
#Region "C A R G A - D A T O S"
Private Sub CargaDatos()
FechaInicio = If(IsDate(TxtFechaDel.Text), TxtFechaDel.Text.ToDate, MinFecha)
FechaFin = If(IsDate(TxtFechaAl.Text), TxtFechaAl.Text.ToDate, MaxFecha)
'FechaInicio = New Date(2016, 1, 1)
'FechaFin = New Date(2016, 1, 31)
Dim ObjConta As New ClsContabilidad
If ObjConta.GetLibroDiario(FechaInicio, FechaFin, UsuarioActual.CveEmpresa) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
End If
ObjConta.Dispose()
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
If DtDatos IsNot Nothing Then
ImgExcel.Visible = True
Imprimir.Visible = True
Else
ImgExcel.Visible = False
Imprimir.Visible = False
End If
End Sub
#End Region
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
''CABECERA
'If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 1 Then
' e.Row.Font.Bold = True
' e.Row.Cells(4).Text = ""
' e.Row.Cells(5).Text = ""
' e.Row.Cells(6).Text = ""
' e.Row.Cells(7).Text = ""
' e.Row.Cells(8).Text = ""
' e.Row.CssClass = "SubTotales" '
'End If
'DETALLE
If e.Row.DBCampo("Codigo") <> "" Then
e.Row.Cells(0).Text = ""
e.Row.Cells(1).Text = ""
e.Row.Cells(2).Text = ""
e.Row.Cells(3).Text = ""
End If
'SUBTOTAL
If e.Row.DBCampo("Codigo") = "" Then
e.Row.Font.Bold = True
e.Row.Cells(0).Text = ""
e.Row.Cells(1).Text = ""
e.Row.Cells(2).Text = ""
e.Row.Cells(3).Text = ""
e.Row.Cells(4).Text = ""
e.Row.Cells(5).Text = ""
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(6).Text = "Total:"
e.Row.CssClass = "SubTotales"
End If
'TOTAL
If e.Row.DBCampo("TipoRenglon").ToString.ToEntero = 4 Then
e.Row.Font.Bold = True
e.Row.Cells(0).Text = ""
e.Row.Cells(1).Text = ""
e.Row.Cells(2).Text = ""
e.Row.Cells(3).Text = ""
e.Row.Cells(4).Text = ""
e.Row.Cells(5).Text = ""
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(6).Text = "Total:"
e.Row.CssClass = "Totales"
End If
End If
End Sub
End Class