Modalidad Contable en RepVentas
This commit is contained in:
@@ -1346,7 +1346,7 @@ Public Class ClsVentas
|
|||||||
Public Function GetRepVentas(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer,
|
Public Function GetRepVentas(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer,
|
||||||
CveVendedor As String, CveUsuario As Integer, CveEstatus As String, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1",
|
CveVendedor As String, CveUsuario As Integer, CveEstatus As String, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1",
|
||||||
Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1,
|
Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1,
|
||||||
Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1) As Boolean
|
Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Vta_VentasGetRep")
|
DataAdapter("PA_Vta_VentasGetRep")
|
||||||
|
|
||||||
@@ -1373,6 +1373,7 @@ Public Class ClsVentas
|
|||||||
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
||||||
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
|
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
|
||||||
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
|
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
|
||||||
|
.Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
@@ -1477,7 +1478,7 @@ Public Class ClsVentas
|
|||||||
Vendedor As String, CveUsuario As Integer, CveEstatus As String, FechaI As Date, FechaF As Date, CveCorte As Integer, TipoDocto As String,
|
Vendedor As String, CveUsuario As Integer, CveEstatus As String, FechaI As Date, FechaF As Date, CveCorte As Integer, TipoDocto As String,
|
||||||
CveSubProyectoEjecucion As Integer, CveEmpresa As Integer, FechaIEjec As Date, FechaFEjec As Date, Optional CveProyecto As Integer = -1,
|
CveSubProyectoEjecucion As Integer, CveEmpresa As Integer, FechaIEjec As Date, FechaFEjec As Date, Optional CveProyecto As Integer = -1,
|
||||||
Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveMoneda As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
|
Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveMoneda As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
|
||||||
Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1) As Boolean
|
Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1, Optional TipoCliente As Integer = -1, Optional ModalidadContable As Boolean = False) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Vta_VentasGetRepDetalle")
|
DataAdapter("PA_Vta_VentasGetRepDetalle")
|
||||||
|
|
||||||
@@ -1509,6 +1510,7 @@ Public Class ClsVentas
|
|||||||
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
||||||
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
|
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
|
||||||
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
|
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
|
||||||
|
.Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -303,6 +303,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-1 truncate">Modalidad Contable:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:CheckBox ID="ChkModalidadContable" runat="server" Checked="false" CssClass="input-sm" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
|||||||
@@ -450,8 +450,8 @@ Partial Class RepVentaDetalle
|
|||||||
ConfiguraEmpresa()
|
ConfiguraEmpresa()
|
||||||
UPDatos.Update()
|
UPDatos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
Dim ObjVentas As New ClsVentas()
|
|
||||||
Dim AnioMes = If(Request("AnioMes") IsNot Nothing, Request("AnioMes").ToString, "-1").ToString
|
Dim AnioMes = If(Request("AnioMes") IsNot Nothing, Request("AnioMes").ToString, "-1").ToString
|
||||||
Dim Fecha = If(Request("Fecha") IsNot Nothing, Request("Fecha").ToString, "-1").ToString
|
Dim Fecha = If(Request("Fecha") IsNot Nothing, Request("Fecha").ToString, "-1").ToString
|
||||||
Dim IVA = If(Request("IVA") IsNot Nothing, Request("IVA").ToString, "-1").ToString
|
Dim IVA = If(Request("IVA") IsNot Nothing, Request("IVA").ToString, "-1").ToString
|
||||||
@@ -478,12 +478,15 @@ Partial Class RepVentaDetalle
|
|||||||
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim.ToDate, MinFecha)
|
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim.ToDate, MinFecha)
|
||||||
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha)
|
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha)
|
||||||
|
|
||||||
'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero
|
Dim ModalidadContable As Boolean = CBool(If(Request("ModalidadContable") IsNot Nothing, Request("ModalidadContable").ToEntero(), 0))
|
||||||
|
|
||||||
|
Dim ObjVentas As New ClsVentas()
|
||||||
|
'FechaI, FechaF, -1, UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero
|
||||||
If ObjVentas.GetRepVentasDetalle(DdlGrupo.SelectedValue.ToEntero, Anio.ToEntero, Mes.ToEntero, AnioMes, Fecha, CveCliente,
|
If ObjVentas.GetRepVentasDetalle(DdlGrupo.SelectedValue.ToEntero, Anio.ToEntero, Mes.ToEntero, AnioMes, Fecha, CveCliente,
|
||||||
IVA, Vendedores, DdlUsuario.SelectedValue.ToEntero, Estatus, FechaI, FechaF,
|
IVA, Vendedores, DdlUsuario.SelectedValue.ToEntero, Estatus, FechaI, FechaF,
|
||||||
CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec,
|
CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec,
|
||||||
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
|
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero,
|
||||||
CveCondicionesPago:=CveCondicionesPago, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero) Then
|
CveCondicionesPago:=CveCondicionesPago, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=ModalidadContable) Then
|
||||||
DtVentas = AddRows(ObjVentas.DtResultados)
|
DtVentas = AddRows(ObjVentas.DtResultados)
|
||||||
ImgImprimir.Enabled = True
|
ImgImprimir.Enabled = True
|
||||||
GvDatos.DataSource = AddRows(ObjVentas.DtResultados)
|
GvDatos.DataSource = AddRows(ObjVentas.DtResultados)
|
||||||
@@ -491,9 +494,11 @@ Partial Class RepVentaDetalle
|
|||||||
Else
|
Else
|
||||||
GvDatos.DataSource = Nothing
|
GvDatos.DataSource = Nothing
|
||||||
GvVsh.DataSource = Nothing
|
GvVsh.DataSource = Nothing
|
||||||
End If
|
End If
|
||||||
Agrupador = DdlGrupo.SelectedItem.Text
|
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
|
Agrupador = DdlGrupo.SelectedItem.Text
|
||||||
|
|
||||||
GvDatos.DataBind()
|
GvDatos.DataBind()
|
||||||
GvVsh.DataBind()
|
GvVsh.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -293,8 +293,12 @@
|
|||||||
<asp:ListItem Text="Venta Mostrador" Value="2"></asp:ListItem>
|
<asp:ListItem Text="Venta Mostrador" Value="2"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-1 truncate">Modalidad Contable:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:CheckBox ID="ChkModalidadContable" runat="server" Checked="false" CssClass="input-sm" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ Imports System.IO
|
|||||||
Imports System.Xml
|
Imports System.Xml
|
||||||
|
|
||||||
Partial Class Ventas_RepVentas
|
Partial Class Ventas_RepVentas
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
|
|
||||||
#Region "Propiedades"
|
#Region "Propiedades"
|
||||||
Private Property Opcion As String
|
Private Property Opcion As String
|
||||||
Get
|
Get
|
||||||
@@ -74,12 +74,12 @@ Partial Class Ventas_RepVentas
|
|||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
ViewState("DtColor") = value
|
ViewState("DtColor") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
TipoCambio = 1
|
TipoCambio = 1
|
||||||
@@ -117,11 +117,11 @@ Partial Class Ventas_RepVentas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
#Region " CARGA COMBOS "
|
#Region " CARGA COMBOS "
|
||||||
|
|
||||||
Private Sub CargaGrupo()
|
Private Sub CargaGrupo()
|
||||||
DdlGrupo.Items.Insert(0, New ListItem("Año", "1"))
|
DdlGrupo.Items.Insert(0, New ListItem("Año", "1"))
|
||||||
DdlGrupo.Items.Insert(1, New ListItem("Mes", "2"))
|
DdlGrupo.Items.Insert(1, New ListItem("Mes", "2"))
|
||||||
@@ -284,10 +284,10 @@ Partial Class Ventas_RepVentas
|
|||||||
DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa)
|
DdlSubProyecto.DataSource = GlobalDTSubProyectos(DdlProyecto.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa)
|
||||||
DdlSubProyecto.DataBind()
|
DdlSubProyecto.DataBind()
|
||||||
'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " CARGA DATOS "
|
#Region " CARGA DATOS "
|
||||||
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
@@ -321,7 +321,7 @@ Partial Class Ventas_RepVentas
|
|||||||
|
|
||||||
If ObjVentas.GetRepVentas(FechaI, FechaF, FechaIEjec, FechaFEjec, CveCliente, DdlSubProyectoEjecucion.SelectedValue.ToEntero, Vendedores,
|
If ObjVentas.GetRepVentas(FechaI, FechaF, FechaIEjec, FechaFEjec, CveCliente, DdlSubProyectoEjecucion.SelectedValue.ToEntero, Vendedores,
|
||||||
DdlUsuario.SelectedValue.ToEntero, Estatus, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, TipoComprobante, DdlProyecto.SelectedValue.ToEntero, Sucursales, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, CveUsuarioConsulta:=UsuarioActual.CveUsuario,
|
DdlUsuario.SelectedValue.ToEntero, Estatus, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, TipoComprobante, DdlProyecto.SelectedValue.ToEntero, Sucursales, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, CveUsuarioConsulta:=UsuarioActual.CveUsuario,
|
||||||
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero) Then
|
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, ModalidadContable:=ChkModalidadContable.Checked) Then
|
||||||
GvDatos.DataSource = ObjVentas.DtResultados
|
GvDatos.DataSource = ObjVentas.DtResultados
|
||||||
DtVentas = ObjVentas.DtResultados
|
DtVentas = ObjVentas.DtResultados
|
||||||
Else
|
Else
|
||||||
@@ -332,12 +332,12 @@ Partial Class Ventas_RepVentas
|
|||||||
CveProyecto = DdlProyecto.SelectedValue.ToEntero
|
CveProyecto = DdlProyecto.SelectedValue.ToEntero
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
GvDatos.DataBind()
|
GvDatos.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "SELECTED INDEX CHANGE"
|
#Region "SELECTED INDEX CHANGE"
|
||||||
|
|
||||||
Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
CargaClientes()
|
CargaClientes()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -380,10 +380,10 @@ Partial Class Ventas_RepVentas
|
|||||||
CargaDatos()
|
CargaDatos()
|
||||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio"))
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio"))
|
||||||
UPDatos.Update()
|
UPDatos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " GV DATOS - ROW DATABOUND "
|
#Region " GV DATOS - ROW DATABOUND "
|
||||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
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.RowType = DataControlRowType.DataRow Then
|
||||||
@@ -417,11 +417,60 @@ Partial Class Ventas_RepVentas
|
|||||||
Else
|
Else
|
||||||
CveSubProyecto = e.Row.DBCampo("CveSubProyecto")
|
CveSubProyecto = e.Row.DBCampo("CveSubProyecto")
|
||||||
CveProyecto = e.Row.DBCampo("CveProyecto")
|
CveProyecto = e.Row.DBCampo("CveProyecto")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim FechaInicial As String = FechaI
|
||||||
'LIGA A DETALLE
|
Dim FechaFinal As String = FechaF
|
||||||
Dim Liga As String = $"/Ventas/RepVentaDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&AnioEjec={e.Row.DBCampo("AnioEjec")}&MesEjec={e.Row.DBCampo("MesEjec")}&AnioMesEjec={e.Row.DBCampo("AnioMesEjec")}&FechaEjec={e.Row.DBCampo("FechaEjec")}&CveCliente={e.Row.DBCampo("CveCliente")}&CveVendedor={ e.Row.DBCampo("CveVendedor")}&CveUsuario={e.Row.DBCampo("CveUsuario")}&CveEstatusFactura={e.Row.DBCampo("CveEstatusFactura")}&FechaI={FechaI}&FechaF={FechaF}&FechaIEjec={FechaIEjec}&FechaFEjec={FechaFEjec}&IVA={e.Row.DBCampo("GPO_IVA")}&CveCorte={ e.Row.DBCampo("CveCorte")}&TipoDocto={ DdlTipoComprobante.GetSelectedValuesM}&CveSubProyectoEjecucion={e.Row.DBCampo("CveSubProyectoEjecucion")}&CveSubProyecto={CveSubProyecto}&CveProyecto={CveProyecto}&TipoCambio={TipoCambio}&TCEspecifico={TCEspecifico}&CveMoneda={CveMoneda}&CveClienteClasificacion={e.Row.DBCampo("CveClienteClasificacion")}&CveCondicionesPago={DdlCondicionesPago.SelectedValue}&TipoCliente={ If(DdlGrupo.SelectedValue.ToEntero = 20, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue)}"
|
|
||||||
|
If Not e.Row.DBCampo("GPO").Contains("Total") Then
|
||||||
|
Select Case DdlGrupo.SelectedValue.ToEntero()
|
||||||
|
Case 2 ' MES
|
||||||
|
Dim FechaIRef As DateTime = FechaI.ToDateTime()
|
||||||
|
Dim FechaFRef As DateTime = FechaF.ToDateTime()
|
||||||
|
|
||||||
|
Dim Anio As Integer = FechaFRef.Year
|
||||||
|
Dim Mes As Integer = e.Row.DBCampo("Mes").ToEntero()
|
||||||
|
Dim lastDayOfMonth = DateTime.DaysInMonth(Anio, Mes)
|
||||||
|
|
||||||
|
Dim Dia As Integer = FechaFRef.Day
|
||||||
|
|
||||||
|
If e.Row.DBCampo("Mes").ToEntero() <> FechaFRef.Month Then
|
||||||
|
Dia = lastDayOfMonth
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.Row.DBCampo("Mes").ToEntero() <> FechaIRef.Month Then
|
||||||
|
FechaInicial = New DateTime(Anio, Mes, 1).ToString("dd/MM/yyyy")
|
||||||
|
End If
|
||||||
|
|
||||||
|
FechaFinal = New DateTime(Anio, Mes, Dia).ToString("dd/MM/yyyy")
|
||||||
|
Case 3 ' AÑO/MES
|
||||||
|
Dim FechaIRef As DateTime = FechaI.ToDateTime()
|
||||||
|
Dim FechaFRef As DateTime = FechaF.ToDateTime()
|
||||||
|
|
||||||
|
Dim Anio As Integer = e.Row.DBCampo("Anio").ToEntero()
|
||||||
|
Dim Mes As Integer = e.Row.DBCampo("Mes").ToEntero()
|
||||||
|
Dim lastDayOfMonth = DateTime.DaysInMonth(Anio, Mes)
|
||||||
|
|
||||||
|
Dim Dia As Integer = FechaFRef.Day
|
||||||
|
|
||||||
|
If e.Row.DBCampo("Mes").ToEntero() <> FechaFRef.Month Then
|
||||||
|
Dia = lastDayOfMonth
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.Row.DBCampo("Mes").ToEntero() <> FechaIRef.Month Then
|
||||||
|
FechaInicial = New DateTime(Anio, Mes, 1).ToString("dd/MM/yyyy")
|
||||||
|
End If
|
||||||
|
|
||||||
|
FechaFinal = New DateTime(Anio, Mes, Dia).ToString("dd/MM/yyyy")
|
||||||
|
Case 4 ' FECHA
|
||||||
|
FechaInicial = e.Row.DBCampo("Fecha").ToDateTime().ToString("dd/MM/yyyy")
|
||||||
|
FechaFinal = e.Row.DBCampo("Fecha").ToDateTime().ToString("dd/MM/yyyy")
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
'LIGA A DETALLE
|
||||||
|
Dim Liga As String = $"/Ventas/RepVentaDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&AnioEjec={e.Row.DBCampo("AnioEjec")}&MesEjec={e.Row.DBCampo("MesEjec")}&AnioMesEjec={e.Row.DBCampo("AnioMesEjec")}&FechaEjec={e.Row.DBCampo("FechaEjec")}&CveCliente={e.Row.DBCampo("CveCliente")}&CveVendedor={ e.Row.DBCampo("CveVendedor")}&CveUsuario={e.Row.DBCampo("CveUsuario")}&CveEstatusFactura={e.Row.DBCampo("CveEstatusFactura")}&FechaI={FechaInicial}&FechaF={FechaFinal}&FechaIEjec={FechaIEjec}&FechaFEjec={FechaFEjec}&IVA={e.Row.DBCampo("GPO_IVA")}&CveCorte={ e.Row.DBCampo("CveCorte")}&TipoDocto={ DdlTipoComprobante.GetSelectedValuesM}&CveSubProyectoEjecucion={e.Row.DBCampo("CveSubProyectoEjecucion")}&CveSubProyecto={CveSubProyecto}&CveProyecto={CveProyecto}&TipoCambio={TipoCambio}&TCEspecifico={TCEspecifico}&CveMoneda={CveMoneda}&CveClienteClasificacion={e.Row.DBCampo("CveClienteClasificacion")}&CveCondicionesPago={DdlCondicionesPago.SelectedValue}&TipoCliente={ If(DdlGrupo.SelectedValue.ToEntero = 20, e.Row.DBCampo("TipoCliente"), DdlTipoCliente.SelectedValue)}&ModalidadContable={If(ChkModalidadContable.Checked, 1, 0)}"
|
||||||
|
|
||||||
|
|
||||||
e.Row.FCLiteral("LtlGrupo").Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.FCLiteral("LtlGrupo").Text & "</a>"
|
e.Row.FCLiteral("LtlGrupo").Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.FCLiteral("LtlGrupo").Text & "</a>"
|
||||||
@@ -434,9 +483,9 @@ Partial Class Ventas_RepVentas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " PERSONALIZAR "
|
#Region " PERSONALIZAR "
|
||||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs)
|
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs)
|
||||||
Personaliza()
|
Personaliza()
|
||||||
@@ -519,18 +568,18 @@ Partial Class Ventas_RepVentas
|
|||||||
|
|
||||||
|
|
||||||
UPDatos.Update()
|
UPDatos.Update()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " EXCEL "
|
#Region " EXCEL "
|
||||||
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||||
'GvDatos.ExportToExcel("ReporteVentas" & Now.ToShortDateString)
|
'GvDatos.ExportToExcel("ReporteVentas" & Now.ToShortDateString)
|
||||||
GenerarPDF("Excel")
|
GenerarPDF("Excel")
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "PDF"
|
#Region "PDF"
|
||||||
|
|
||||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||||
If DtVentas IsNot Nothing Then
|
If DtVentas IsNot Nothing Then
|
||||||
Dim StrFiltro As New StringBuilder
|
Dim StrFiltro As New StringBuilder
|
||||||
@@ -602,10 +651,10 @@ Partial Class Ventas_RepVentas
|
|||||||
Response.AppendHeader("Content-Disposition", "attachment; filename=ReporteHP.csv")
|
Response.AppendHeader("Content-Disposition", "attachment; filename=ReporteHP.csv")
|
||||||
Response.Write(Str.ToString)
|
Response.Write(Str.ToString)
|
||||||
Context.Response.End()
|
Context.Response.End()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "XML-CONFIGURACIÓN"
|
#Region "XML-CONFIGURACIÓN"
|
||||||
Private Sub XmlConf(CveUsuario As Integer, CveModulo As Integer, Values As String(,))
|
Private Sub XmlConf(CveUsuario As Integer, CveModulo As Integer, Values As String(,))
|
||||||
Dim settings As New XmlWriterSettings()
|
Dim settings As New XmlWriterSettings()
|
||||||
@@ -644,11 +693,11 @@ Partial Class Ventas_RepVentas
|
|||||||
{"SucursalEjecuccion", DdlSubProyectoEjecucion.Text.ToString()},
|
{"SucursalEjecuccion", DdlSubProyectoEjecucion.Text.ToString()},
|
||||||
{"Proyecto", DdlProyecto.Text.ToString()}
|
{"Proyecto", DdlProyecto.Text.ToString()}
|
||||||
}
|
}
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "GRAFICA"
|
#Region "GRAFICA"
|
||||||
|
|
||||||
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
|
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
|
||||||
If Not DtVentas IsNot Nothing AndAlso DtVentas.Rows.Count > 0 Then
|
If Not DtVentas IsNot Nothing AndAlso DtVentas.Rows.Count > 0 Then
|
||||||
Alert("No hay datos disponibles", TipoMensaje.MsgAdvertencia)
|
Alert("No hay datos disponibles", TipoMensaje.MsgAdvertencia)
|
||||||
@@ -778,9 +827,9 @@ Partial Class Ventas_RepVentas
|
|||||||
|
|
||||||
Protected Sub DdlVer_SelectedIndexChanged(sender As Object, e As EventArgs)
|
Protected Sub DdlVer_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
CambioGrafica()
|
CambioGrafica()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user