Tipo de cambio en reporte de ingresos
This commit is contained in:
@@ -3963,7 +3963,7 @@ Public Class ClsVentas
|
||||
|
||||
#End Region
|
||||
|
||||
Public Function RepIngresos(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, TipoDocto As String, Cves_Subprotectos As String) As Boolean
|
||||
Public Function RepIngresos(CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, TipoDocto As String, Cves_Subprotectos As String, Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_Ventas_RepIngresos", CommandType.StoredProcedure)
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -3972,6 +3972,8 @@ Public Class ClsVentas
|
||||
.Add("@TipoDoc", SqlDbType.VarChar).Value = TipoDocto
|
||||
.Add("@Cves_Subprotectos", SqlDbType.VarChar).Value = Cves_Subprotectos
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio
|
||||
.Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -68,6 +68,9 @@
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server"><i class="fa fa-file-excel-o" style="font-weight:bold;"></i> Excel</asp:LinkButton>
|
||||
</li>
|
||||
<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>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkPDF" />
|
||||
@@ -122,11 +125,11 @@
|
||||
<asp:Label runat="server" Text="Tipo" AssociatedControlID="DdlTipoDocto"></asp:Label>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-2">
|
||||
|
||||
|
||||
<asp:ListBox ID="DdlTipoDocto" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Value="Ant" Text="Anticipos"></asp:ListItem>
|
||||
<asp:ListItem Value="Dev" Text="Devolución"></asp:ListItem>
|
||||
<asp:ListItem Value="Egs" Text="Egresos"></asp:ListItem>
|
||||
@@ -134,14 +137,13 @@
|
||||
</asp:ListBox>
|
||||
|
||||
|
||||
<%-- <asp:DropDownList ID="DdlTipoDocto" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<%-- <asp:DropDownList ID="DdlTipoDocto" runat="server" AppendDataBoundItems="true" CssClass="form-control input-small input-sm select2me" Width="100%">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Value="Ant" Text="Anticipos"></asp:ListItem>
|
||||
<asp:ListItem Value="Dev" Text="Devolución"></asp:ListItem>
|
||||
<asp:ListItem Value="Egs" Text="Egresos"></asp:ListItem>
|
||||
<asp:ListItem Value="Ing" Text="Ingresos"></asp:ListItem>
|
||||
</asp:DropDownList>--%>
|
||||
|
||||
</div>
|
||||
<div class="col-md-1 lbltitle ">
|
||||
<asp:Label runat="server" Text="Sub Proyecto" AssociatedControlID="DdlSubProyecto"></asp:Label>
|
||||
@@ -162,7 +164,7 @@
|
||||
|
||||
|
||||
<asp:GridView ID="GVRepIngresos" runat="server" GridLines="None" CssClass="table table-hover table-striped GVRepIngresos ScrollAD Widthall" AutoGenerateColumns="False"
|
||||
DataKeyNames="Importe,Descuento,Amortizacion,IVA,IEPS,ImpuestoLocal,Total" OnRowDataBound="GVRepIngresos_RowDataBound" >
|
||||
DataKeyNames="Importe,Descuento,Amortizacion,IVA,IEPS,ImpuestoLocal,Total" OnRowDataBound="GVRepIngresos_RowDataBound">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Titulo">
|
||||
<ItemTemplate>
|
||||
@@ -208,6 +210,42 @@
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server" ID="UpTipoCambio" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="DivTipoCambio" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Label ID="Label2" runat="server" ClientIDMode="Static" Text="Cambiar Tipo Cambio de Dólares"></asp:Label>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpBodyTipoCambio" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:RadioButtonList runat="server" ID="RblTipoCambio" AutoPostBack="true">
|
||||
<asp:ListItem Selected="true" Text="Moneda Original" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Dólares en Tipo Cambio de la Fecha Venta" Value="2"></asp:ListItem>
|
||||
<%--<asp:ListItem Text="Tipo Cambio Especifico" Value="3"></asp:ListItem>--%>
|
||||
</asp:RadioButtonList>
|
||||
<div class="row" style="margin-left: 10px;" runat="server" id="LiEspecifico" visible="false">
|
||||
Especifico:
|
||||
|
||||
<asp:TextBox ID="TxtEspecifico" runat="server" Width="55px" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnTipoCambio" runat="server" Text="Aceptar" class="btn btn-primary" />
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -70,10 +70,31 @@ Partial Class Ventas_RepIngresos
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property TipoCambio As Integer
|
||||
Get
|
||||
Return ViewState("TipoCambio").ToString.ToEntero
|
||||
End Get
|
||||
|
||||
Set(value As Integer)
|
||||
ViewState("TipoCambio") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property TCEspecifico As Decimal
|
||||
Get
|
||||
Return ViewState("TCEspecifico").ToString.ToDecimal
|
||||
End Get
|
||||
|
||||
Set(value As Decimal)
|
||||
ViewState("TCEspecifico") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
TCEspecifico = -1
|
||||
TipoCambio = 1
|
||||
CveSubProyecto = -1
|
||||
TxtFechaInicio.Text = String.Format("01/01/{0}", Now.Year)
|
||||
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
|
||||
@@ -82,17 +103,21 @@ Partial Class Ventas_RepIngresos
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaRepIngresos(Optional tipoReporte As Integer = -1)
|
||||
Dim ObjRepI As New ClsVentas()
|
||||
|
||||
Protected Sub CargaRepIngresos(Optional tipoReporte As Integer = -1)
|
||||
Dim Cves_Subprotectos As String = If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM)
|
||||
Dim TiposDoc As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM)
|
||||
|
||||
|
||||
|
||||
ObjRepI.RepIngresos(UsuarioActual.CveEmpresa, If(RsFechaI = "-1", MinFecha, RsFechaI.ToDate), If(RsFechaF = "-1", MaxFecha, RsFechaF.ToDate), TiposDoc, Cves_Subprotectos)
|
||||
GVRepIngresos.DataSource = ObjRepI.DtResultados
|
||||
DtDatos = ObjRepI.DtResultados
|
||||
Dim TiposDoc As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM)
|
||||
|
||||
If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then
|
||||
TCEspecifico = TxtEspecifico.Text.ToDecimal
|
||||
Else
|
||||
TCEspecifico = -1
|
||||
End If
|
||||
|
||||
Dim ObjRepI As New ClsVentas()
|
||||
If ObjRepI.RepIngresos(UsuarioActual.CveEmpresa, If(RsFechaI = "-1", MinFecha, RsFechaI.ToDate), If(RsFechaF = "-1", MaxFecha, RsFechaF.ToDate), TiposDoc, Cves_Subprotectos, TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico) Then
|
||||
GVRepIngresos.DataSource = ObjRepI.DtResultados
|
||||
DtDatos = ObjRepI.DtResultados
|
||||
End If
|
||||
ObjRepI.Dispose()
|
||||
GVRepIngresos.DataBind()
|
||||
upDatosRepI.Update()
|
||||
@@ -147,9 +172,26 @@ Partial Class Ventas_RepIngresos
|
||||
#End Region
|
||||
Protected Sub GVRepIngresos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("ConceptoContable").Contiene("INGRESOS", "ANTICIPOS") Then
|
||||
If e.Row.DBCampo("TipoAmortizacion") = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
ElseIf e.Row.DBCampo("TipoAmortizacion") <> "" AndAlso e.Row.DBCampo("CveConceptoContable") = "-1" Then
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub RblTipoCambio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipoCambio.SelectedIndexChanged
|
||||
TipoCambio = RblTipoCambio.SelectedValue.ToEntero
|
||||
If TipoCambio = 3 Then
|
||||
LiEspecifico.Visible = True
|
||||
TCEspecifico = GlobalTipoCambio(Now).ToDecimal
|
||||
TxtEspecifico.Text = TCEspecifico.ToString
|
||||
Else
|
||||
LiEspecifico.Visible = False
|
||||
End If
|
||||
UpBodyTipoCambio.Update()
|
||||
End Sub
|
||||
Private Sub BtnTipoCambio_Click(sender As Object, e As EventArgs) Handles BtnTipoCambio.Click
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio"))
|
||||
LnkFiltrar_Click(LnkFiltrar, EventArgs.Empty)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user