Commit inicial Ventas Productivo

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-14 16:40:54 -07:00
commit c35cf91883
13328 changed files with 3711549 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,201 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCuadreContaAdmon.aspx.vb" Inherits="RepCuadreContaAdmon" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
.white a {
color: white !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="LnkPdf" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Label ID="LblTitulo" runat="server" Text="Reporte de Cuadre Contable vs Administrativo"></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
<%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 truncate">F.I.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding-top: 6px !important;">
<asp:TextBox 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>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 truncate">F.F.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 140px !important; padding-top: 6px !important;">
<asp:TextBox 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>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 ">Grupo:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlGrupo" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Text="Clientes" Value="1"></asp:ListItem>
<asp:ListItem Text="Proveedores" Value="2"></asp:ListItem>
<asp:ListItem Text="Bancos" Value="3"></asp:ListItem>
<asp:ListItem Text="Caja Chica" Value="4"></asp:ListItem>
<asp:ListItem Text="Deudores" Value="5"></asp:ListItem>
<asp:ListItem Text="Acreedores" Value="6"></asp:ListItem>
<asp:ListItem Text="Anticipo Clientes" Value="7"></asp:ListItem>
<asp:ListItem Text="Anticipo Proveedores" Value="8"></asp:ListItem>
<asp:ListItem Text="IVA x Acreditar" Value="9"></asp:ListItem>
<asp:ListItem Text="IVA Acreditado" Value="10"></asp:ListItem>
<asp:ListItem Text="IVA x Trasladar" Value="11"></asp:ListItem>
<asp:ListItem Text="IVA Trasladado" Value="12"></asp:ListItem>
<asp:ListItem Text="Ingresos" Value="13"></asp:ListItem>
<asp:ListItem Text="Gastos" Value="14"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningun corte" DataKeyNames="Orden" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
<asp:Label Text="Cuenta Contable" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCuenta" runat="server" Text='<%# Eval("Cuenta") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
<asp:Label Text="Nombre" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
<asp:Label Text="Contable" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlImporteContable" runat="server" Text='<%# Eval("ImporteConta", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
<asp:Label Text="Administrativo" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlImporteAdmon" runat="server" Text='<%# Eval("ImporteAdmon", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
</script>
</asp:Content>

View File

@@ -0,0 +1,145 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Microsoft.Reporting.WebForms
Imports Extensiones
Partial Class RepCuadreContaAdmon
Inherits ClsPaginas
Private Shared missing As Object = System.Reflection.Missing.Value
#Region "PROPIEDADES"
Private Property DtVentas As DataTable
Get
Return DirectCast(ViewState("DtVentas"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtVentas") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
End If
End Sub
#Region " C A R G A - D A T O S "
Public Sub CargaDatos()
Dim ObjContpaq As New ClsContPAQi(UsuarioActual.Empresa)
Dim FechaI As Date = If(txtFechaI.Text = "", MinFecha, txtFechaI.Text.ToDate)
Dim FechaF As Date = If(txtFechaF.Text = "", MaxFecha, txtFechaF.Text.ToDate)
If ObjContpaq.GetReporteCuadreContaAdmon(UsuarioActual.CveEmpresa, FuncionalidadGrupoGet(DdlGrupo.SelectedValue.ToEntero), DdlGrupo.SelectedValue.ToEntero, 1, FechaI, FechaF) Then
GvDatos.DataSource = ObjContpaq.DtResultados
GvDatos.DataBind()
UPDatos.Update()
Else
Alert("Ocurrio un error al obtener el reporte", TipoMensaje.MsgError)
End If
ObjContpaq.Dispose()
End Sub
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Private Function FuncionalidadGrupoGet(Grupo As Integer) As Integer
Select Case Grupo
Case 1 'Clientes
Return 211
Case 2 'Proveedores
Return 201
Case 3 'Bancos
Return 209
Case 4 'Caja Chica
Return 218
Case 5 'Deudores
Return 205
Case 6 'Acreedores
Return 202
Case 7 'Ant Clientes
Return 212
Case 8 'Ant Proveedores
Return 204
Case 9 'IVA x Acreditar
Return UsuarioActual.Empresa.IdCuentaIVAxAcreditar
Case 10 'IVA Acreditado
Return UsuarioActual.Empresa.IdCuentaIVAAcreditable
Case 11 'IVA x Trasladar
Return UsuarioActual.Empresa.IdCuentaIVAxTrasladar
Case 12 'IVA Trasladado
Return UsuarioActual.Empresa.IdCuentaIVATrasladado
Case 13 'Ingresos
Return 222
Case 14 'Gastos
Return 216
End Select
Return 0
End Function
#End Region
#Region "O R D E N A M I E N T O"
Private Sub OrdenaDatos()
If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
End If
End Sub
#End Region
#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
If e.Row.RowType = DataControlRowType.DataRow Then
Dim Css As String = "Texto"
If e.Row.FCLiteral("LtlImporteContable").Text <> e.Row.FCLiteral("LtlImporteAdmon").Text AndAlso e.Row.DataKey("Orden") = "2" Then
e.Row.ForeColor = Drawing.Color.Red
ElseIf e.Row.FCLiteral("LtlImporteContable").Text = e.Row.FCLiteral("LtlImporteAdmon").Text AndAlso e.Row.DataKey("Orden") = "1" Then
e.Row.Cells(2).ForeColor = Drawing.Color.Green
e.Row.Cells(3).ForeColor = Drawing.Color.Green
End If
If e.Row.DataKey("Orden").Contiene("0", "1") Then
e.Row.CssClass = "Totales"
End If
'LIGA A DETALLE
Dim Liga As String = $"/Contabilidad/Reportes/RepCuadreContaAdmonDetalle.aspx?GPO={DdlGrupo.SelectedValue}&FechaI={txtFechaI.Text}&FechaF={txtFechaF.Text}"
e.Row.FCLiteral("LtlCuenta").Text = "<a class=""" & Css & """ Target=_blank href=""" & Liga & """>" & e.Row.FCLiteral("LtlCuenta").Text & "</a>"
End If
End Sub
#End Region
#Region "CARGA COMBOS FILTRO"
#End Region
#Region "DDLS SELECTED INDEX CHANGED"
#End Region
#Region "PDF"
#End Region
End Class

View File

@@ -0,0 +1,262 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCuadreContaAdmonDetalle.aspx.vb" Inherits="RepCuadreContaAdmonDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
.white a {
color: white !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="LnkPdf" runat="server"> <i class="fa fa-ad-pdf"></i> Generar PDF</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
<asp:Label ID="LblTitulo" runat="server" Text="Reporte de Cuadre Contable vs Administrativo"></asp:Label>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="HA" runat="Server">
<%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-default" />
<a href="javascript:;" class="expand"></a>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 truncate">F.I.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding-top: 6px !important;">
<asp:TextBox 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>
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 truncate">F.F.:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 140px !important; padding-top: 6px !important;">
<asp:TextBox 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>
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 ">Grupo:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlGrupo" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Text="Clientes" Value="1"></asp:ListItem>
<asp:ListItem Text="Proveedores" Value="2"></asp:ListItem>
<asp:ListItem Text="Bancos" Value="3"></asp:ListItem>
<asp:ListItem Text="Caja Chica" Value="4"></asp:ListItem>
<asp:ListItem Text="Deudores" Value="5"></asp:ListItem>
<asp:ListItem Text="Acreedores" Value="6"></asp:ListItem>
<asp:ListItem Text="Anticipo Clientes" Value="7"></asp:ListItem>
<asp:ListItem Text="Anticipo Proveedores" Value="8"></asp:ListItem>
<asp:ListItem Text="IVA x Acreditar" Value="9"></asp:ListItem>
<asp:ListItem Text="IVA Acreditado" Value="10"></asp:ListItem>
<asp:ListItem Text="IVA x Trasladar" Value="11"></asp:ListItem>
<asp:ListItem Text="IVA Trasladado" Value="12"></asp:ListItem>
<asp:ListItem Text="Ingresos" Value="13"></asp:ListItem>
<asp:ListItem Text="Gastos" Value="14"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="Id, CvePrePolizaDetalle, IdPoliza, IdPolizaPrePoliza, CvePrePoliza, CveIE, CveVenta, CveCompra" EmptyDataText="No se encontró ningun corte" class="table table-advance table-hover Widthall" CellSpacing="0" data-sort="true" Style="border-collapse: collapse;" GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
<asp:Label Text="Cuenta Contable" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCuenta" runat="server" Text='<%# Eval("Cuenta") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Label Text="Folio" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFolioPoliza" runat="server" Text='<%# Eval("IdPoliza") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Font-Bold="true" />
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
<asp:Label Text="Cargo" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCargoConta" runat="server" Text='<%# If(Eval("TipoMovtoConta").ToString = "True", "", Eval("Importe", "{0:N2}")) %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
<asp:Label Text="Abono" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAbonoConta" runat="server" Text='<%# If(Eval("TipoMovtoConta").ToString = "False", "", Eval("Importe", "{0:N2}")) %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>
<asp:Label Text="Nombre" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Label Text="Folio" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFolioPrePoliza" runat="server" Text='<%# Eval("IdPolizaPrePoliza") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Font-Bold="true" />
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
<asp:Label Text="Cargo" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCargoAdmon" runat="server" Text='<%# If(Eval("TipoMovtoAdmon").ToString = "True", "", Eval("ImporteMN", "{0:N2}")) %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right">
<HeaderTemplate>
<asp:Label Text="Abono" runat="server" CausesValidation="false"> </asp:Label>
<asp:Literal runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAbonoAdmon" runat="server" Text='<%# If(Eval("TipoMovtoAdmon").ToString = "False", "", Eval("ImporteMN", "{0:N2}")) %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%--Acciones--%>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Label Text="" runat="server" CausesValidation="false"> </asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlLigaReferencia" runat="server" Text=''></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<HeaderTemplate>
<asp:Label Text="Vínculo" runat="server" CausesValidation="false"> </asp:Label>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="TxtVinculo" runat="server" Text='' MaxLength="4" Width="35px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
<div class="modal-footer">
<asp:Button ID="BtnVincular" runat="server" CssClass="btn btn-primary" Text="Vincular Pólizas" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
</script>
</asp:Content>

View File

@@ -0,0 +1,306 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Drawing
Imports Microsoft.Reporting.WebForms
Imports Extensiones
Partial Class RepCuadreContaAdmonDetalle
Inherits ClsPaginas
Private Shared missing As Object = System.Reflection.Missing.Value
#Region "PROPIEDADES"
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If Request("GPO") IsNot Nothing AndAlso Request("GPO").ToEntero() > 0 Then
DdlGrupo.SelectedValue = Request("GPO").ToString
End If
If Request("FechaI") IsNot Nothing AndAlso Request("FechaI").ToString() <> "" Then
txtFechaI.Text = Request("FechaI").ToString()
End If
If Request("FechaF") IsNot Nothing AndAlso Request("FechaF").ToString() <> "" Then
txtFechaF.Text = Request("FechaF").ToString
End If
If Request("GPO") IsNot Nothing Then
CargaDatos()
End If
End If
End Sub
#Region " C A R G A - D A T O S "
Public Sub CargaDatos()
Dim ObjContpaq As New ClsContPAQi(UsuarioActual.Empresa)
Dim FechaI As Date = If(txtFechaI.Text = "", MinFecha, txtFechaI.Text.ToDate)
Dim FechaF As Date = If(txtFechaF.Text = "", MaxFecha, txtFechaF.Text.ToDate)
If ObjContpaq.GetReporteCuadreContaAdmon(UsuarioActual.CveEmpresa, FuncionalidadGrupoGet(DdlGrupo.SelectedValue.ToEntero), DdlGrupo.SelectedValue.ToEntero, 2, FechaI, FechaF) Then
GvDatos.DataSource = ObjContpaq.DtResultados
GvDatos.DataBind()
UPDatos.Update()
Else
Alert("Ocurrio un error al obtener el reporte", TipoMensaje.MsgError)
End If
ObjContpaq.Dispose()
End Sub
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Private Function FuncionalidadGrupoGet(Grupo As Integer) As Integer
Select Case Grupo
Case 1 'Clientes
Return 211
Case 2 'Proveedores
Return 201
Case 3 'Bancos
Return 209
Case 4 'Caja Chica
Return 218
Case 5 'Deudores
Return 205
Case 6 'Acreedores
Return 202
Case 7 'Ant Clientes
Return 212
Case 8 'Ant Proveedores
Return 204
Case 9 'IVA x Acreditar
Return UsuarioActual.Empresa.IdCuentaIVAxAcreditar
Case 10 'IVA Acreditado
Return UsuarioActual.Empresa.IdCuentaIVAAcreditable
Case 11 'IVA x Trasladar
Return UsuarioActual.Empresa.IdCuentaIVAxTrasladar
Case 12 'IVA Trasladado
Return UsuarioActual.Empresa.IdCuentaIVATrasladado
Case 13 'Ingresos
Return 222
Case 14 'Gastos
Return 216
End Select
Return 0
End Function
#End Region
#Region "O R D E N A M I E N T O"
Private Sub OrdenaDatos()
If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
End If
End Sub
#End Region
#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
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).BackColor = ColorTranslator.FromHtml("#e9e9e9")
e.Row.Cells(1).BackColor = ColorTranslator.FromHtml("#e9e9e9")
e.Row.Cells(2).BackColor = ColorTranslator.FromHtml("#e9e9e9")
e.Row.Cells(3).BackColor = ColorTranslator.FromHtml("#e9e9e9")
e.Row.Cells(4).BackColor = ColorTranslator.FromHtml("#ffffff")
e.Row.Cells(5).BackColor = ColorTranslator.FromHtml("#ffffff")
e.Row.Cells(6).BackColor = ColorTranslator.FromHtml("#ffffff")
e.Row.Cells(7).BackColor = ColorTranslator.FromHtml("#ffffff")
e.Row.Cells(8).BackColor = ColorTranslator.FromHtml("#fafafa")
e.Row.Cells(9).BackColor = ColorTranslator.FromHtml("#fafafa")
If e.Row.DataKey("IdPoliza").ToEntero > 0 Then
Dim LigaConta As String = $"/Contabilidad/RegPoliza.aspx?IdPoliza={e.Row.DataKey("IdPoliza")}"
e.Row.FCLiteral("LtlCargoConta").Text = "<a Target=_blank href=""" & LigaConta & """>" & e.Row.FCLiteral("LtlCargoConta").Text & "</a>"
e.Row.FCLiteral("LtlAbonoConta").Text = "<a Target=_blank href=""" & LigaConta & """>" & e.Row.FCLiteral("LtlAbonoConta").Text & "</a>"
End If
If e.Row.DataKey("CvePrePoliza").ToEntero > 0 Then
Dim LigaPrePoliza As String = $"/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={e.Row.DataKey("CvePrePoliza")}&Tipo=1"
e.Row.FCLiteral("LtlCargoAdmon").Text = "<a Target=_blank href=""" & LigaPrePoliza & """> " & e.Row.FCLiteral("LtlCargoAdmon").Text & " </a>"
e.Row.FCLiteral("LtlAbonoAdmon").Text = "<a Target=_blank href=""" & LigaPrePoliza & """> " & e.Row.FCLiteral("LtlAbonoAdmon").Text & " </a>"
End If
If e.Row.DataKey("CveIE").ToEntero > 0 AndAlso Not DdlGrupo.SelectedValue.Contiene("13", "14") Then
Dim LigaReferencia As String = $"/Bancos/IE.aspx?CveIE={e.Row.DataKey("CveIE")}"
e.Row.FCLiteral("LtlLigaReferencia").Text = "<a Target=_blank href=""" & LigaReferencia & """> Ir </a>"
ElseIf e.Row.DataKey("CveVenta").ToEntero > 0 Then
Dim LigaReferencia As String = $"/Ventas/Ventas.aspx?CveVenta={e.Row.DataKey("CveVenta")}"
e.Row.FCLiteral("LtlLigaReferencia").Text = "<a Target=_blank href=""" & LigaReferencia & """> Ir </a>"
ElseIf e.Row.DataKey("CveCompra").ToEntero > 0 Then
Dim LigaReferencia As String = $"/Compras/Compras.aspx?CveCompra={e.Row.DataKey("CveCompra")}"
e.Row.FCLiteral("LtlLigaReferencia").Text = "<a Target=_blank href=""" & LigaReferencia & """> Ir </a>"
End If
End If
End Sub
Protected Sub GvDatos_DataBound(sender As Object, e As EventArgs) Handles GvDatos.DataBound
CrearVinculoContableAdmon()
End Sub
Private Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated
If (e.Row.RowType = DataControlRowType.Header) Then
Dim HeaderGrid As GridView = CType(sender, GridView)
Dim HeaderGridRow As GridViewRow = New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert)
Dim HeaderCell As TableCell = New TableCell()
HeaderCell.Text = "Contable"
HeaderCell.ColumnSpan = 4
HeaderCell.BackColor = ColorTranslator.FromHtml("#F08886")
HeaderCell.ForeColor = Color.White
HeaderGridRow.Cells.Add(HeaderCell)
HeaderCell = New TableCell()
HeaderCell.Text = "Administrativo"
HeaderCell.ColumnSpan = 4
HeaderCell.BackColor = ColorTranslator.FromHtml("#44b6ae")
HeaderCell.ForeColor = Color.White
HeaderGridRow.Cells.Add(HeaderCell)
HeaderCell = New TableCell()
HeaderCell.Text = "Acciones"
HeaderCell.ColumnSpan = 2
HeaderCell.BackColor = ColorTranslator.FromHtml("#3598dc")
HeaderCell.ForeColor = Color.White
HeaderGridRow.Cells.Add(HeaderCell)
GvDatos.Controls(0).Controls.AddAt(0, HeaderGridRow)
End If
End Sub
#End Region
#Region "CARGA COMBOS FILTRO"
#End Region
#Region "DDLS SELECTED INDEX CHANGED"
#End Region
#Region "PDF"
#End Region
#Region "Metodos Generales"
Private Sub CrearVinculoContableAdmon()
Dim contador = 0
For Each row As GridViewRow In GvDatos.Rows
If row.DataKey("IdPolizaPrePoliza") <> "" AndAlso row.DataKey("IdPoliza") = "" Then 'Las PrePolizas contabilizadas no vinculadas
contador += 1
row.FCTextBox("TxtVinculo").Text = contador.ToString
row.FCTextBox("TxtVinculo").Enabled = False
For Each row2 As GridViewRow In GvDatos.Rows
If row.DataKey("IdPolizaPrePoliza") = row2.DataKey("IdPoliza") And (row.FCLiteral("LtlCargoConta").Text <> "" AndAlso (row.FCLiteral("LtlCargoConta").Text = row2.FCLiteral("LtlCargoAdmon").Text) Or (row.FCLiteral("LtlAbonoConta").Text <> "" AndAlso row.FCLiteral("LtlAbonoConta").Text = row2.FCLiteral("LtlAbonoAdmon").Text)) And row2.FCTextBox("TxtVinculo").Text = "" Then 'row2 son las polizas que queremos identificar
row2.FCTextBox("TxtVinculo").Text = contador.ToString
Exit For
End If
Next
End If
Next
End Sub
Private Sub VincularPolizas()
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim Contador As Integer = 0
'Hay que agregarle el metodo de vinculacion y que la vinculacion ponga automaticamente la cuenta contable del movimientopoliza en la prepolizadetalle
For Each row As GridViewRow In GvDatos.Rows
If row.DataKey("IdPolizaPrePoliza") <> "" AndAlso row.FCTextBox("TxtVinculo").Text.Trim <> "" Then
For Each row2 As GridViewRow In GvDatos.Rows
If row.FCTextBox("TxtVinculo").Text = row2.FCTextBox("TxtVinculo").Text AndAlso row2.FCTextBox("TxtVinculo").Enabled Then
If ObjConta.VincularPolizaPrepoliza(row2.DataKey("Id").ToEntero, row.DataKey("CvePrePolizaDetalle").ToEntero) Then
Contador += 1
End If
End If
Next
End If
Next
Alert("Se vincularon correctamente " & Contador & " pólizas.")
CargaDatos()
ObjConta.Dispose()
End Sub
Private Function VerificarVinculacion() As Boolean
Dim valida = True
For Each row As GridViewRow In GvDatos.Rows
Dim ContadorSimilitud As Integer = 0
If Not row.FCTextBox("TxtVinculo").Enabled Then
For Each row2 As GridViewRow In GvDatos.Rows
If row.FCTextBox("TxtVinculo").Text = row2.FCTextBox("TxtVinculo").Text AndAlso row2.FCTextBox("TxtVinculo").Enabled Then
ContadorSimilitud += 1
If ContadorSimilitud > 1 Then
row2.FCTextBox("TxtVinculo").BorderColor = Color.Red
valida = False
End If
End If
Next
End If
Next
If valida = False Then
Alert("Los movimientos no se pudieron vincular debido a que algunos de ellos estan repetidos.<br>Los movimientos repetidos estan marcados en rojo.", TipoMensaje.MsgError)
End If
Return valida
End Function
Private Sub BtnVincular_Click(sender As Object, e As EventArgs) Handles BtnVincular.Click
If VerificarVinculacion() Then
VincularPolizas()
End If
End Sub
#End Region
End Class

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff