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,
|
||||
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 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
|
||||
DataAdapter("PA_Vta_VentasGetRep")
|
||||
|
||||
@@ -1373,6 +1373,7 @@ Public Class ClsVentas
|
||||
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
||||
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
|
||||
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
|
||||
.Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable
|
||||
End With
|
||||
|
||||
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,
|
||||
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 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
|
||||
DataAdapter("PA_Vta_VentasGetRepDetalle")
|
||||
|
||||
@@ -1509,6 +1510,7 @@ Public Class ClsVentas
|
||||
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
||||
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
|
||||
.Add("@TipoCliente", SqlDbType.Int).Value = TipoCliente
|
||||
.Add("@ModalidadContable", SqlDbType.Bit).Value = ModalidadContable
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -303,6 +303,12 @@
|
||||
</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>
|
||||
</ContentTemplate>
|
||||
|
||||
@@ -450,8 +450,8 @@ Partial Class RepVentaDetalle
|
||||
ConfiguraEmpresa()
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
Private Sub CargaDatos()
|
||||
|
||||
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 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)
|
||||
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,
|
||||
IVA, Vendedores, DdlUsuario.SelectedValue.ToEntero, Estatus, FechaI, FechaF,
|
||||
CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec,
|
||||
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)
|
||||
ImgImprimir.Enabled = True
|
||||
GvDatos.DataSource = AddRows(ObjVentas.DtResultados)
|
||||
@@ -491,9 +494,11 @@ Partial Class RepVentaDetalle
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
GvVsh.DataSource = Nothing
|
||||
End If
|
||||
Agrupador = DdlGrupo.SelectedItem.Text
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
Agrupador = DdlGrupo.SelectedItem.Text
|
||||
|
||||
GvDatos.DataBind()
|
||||
GvVsh.DataBind()
|
||||
End Sub
|
||||
|
||||
@@ -293,8 +293,12 @@
|
||||
<asp:ListItem Text="Venta Mostrador" Value="2"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</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>
|
||||
|
||||
@@ -10,8 +10,8 @@ Imports System.IO
|
||||
Imports System.Xml
|
||||
|
||||
Partial Class Ventas_RepVentas
|
||||
Inherits ClsPaginas
|
||||
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Private Property Opcion As String
|
||||
Get
|
||||
@@ -74,12 +74,12 @@ Partial Class Ventas_RepVentas
|
||||
Set(value As DataTable)
|
||||
ViewState("DtColor") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
TipoCambio = 1
|
||||
@@ -117,11 +117,11 @@ Partial Class Ventas_RepVentas
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#Region " CARGA COMBOS "
|
||||
|
||||
|
||||
Private Sub CargaGrupo()
|
||||
DdlGrupo.Items.Insert(0, New ListItem("Año", "1"))
|
||||
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.DataBind()
|
||||
'DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
@@ -321,7 +321,7 @@ Partial Class Ventas_RepVentas
|
||||
|
||||
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,
|
||||
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
|
||||
DtVentas = ObjVentas.DtResultados
|
||||
Else
|
||||
@@ -332,12 +332,12 @@ Partial Class Ventas_RepVentas
|
||||
CveProyecto = DdlProyecto.SelectedValue.ToEntero
|
||||
ObjVentas.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "SELECTED INDEX CHANGE"
|
||||
|
||||
|
||||
Protected Sub DdlClienteClasificacion_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaClientes()
|
||||
End Sub
|
||||
@@ -380,10 +380,10 @@ Partial Class Ventas_RepVentas
|
||||
CargaDatos()
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivTipoCambio"))
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " GV DATOS - ROW DATABOUND "
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
@@ -417,11 +417,60 @@ Partial Class Ventas_RepVentas
|
||||
Else
|
||||
CveSubProyecto = e.Row.DBCampo("CveSubProyecto")
|
||||
CveProyecto = e.Row.DBCampo("CveProyecto")
|
||||
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={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)}"
|
||||
End If
|
||||
|
||||
Dim FechaInicial As String = FechaI
|
||||
Dim FechaFinal As String = FechaF
|
||||
|
||||
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>"
|
||||
@@ -434,9 +483,9 @@ Partial Class Ventas_RepVentas
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " PERSONALIZAR "
|
||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs)
|
||||
Personaliza()
|
||||
@@ -519,18 +568,18 @@ Partial Class Ventas_RepVentas
|
||||
|
||||
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " EXCEL "
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||
'GvDatos.ExportToExcel("ReporteVentas" & Now.ToShortDateString)
|
||||
GenerarPDF("Excel")
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "PDF"
|
||||
|
||||
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
If DtVentas IsNot Nothing Then
|
||||
Dim StrFiltro As New StringBuilder
|
||||
@@ -602,10 +651,10 @@ Partial Class Ventas_RepVentas
|
||||
Response.AppendHeader("Content-Disposition", "attachment; filename=ReporteHP.csv")
|
||||
Response.Write(Str.ToString)
|
||||
Context.Response.End()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "XML-CONFIGURACIÓN"
|
||||
Private Sub XmlConf(CveUsuario As Integer, CveModulo As Integer, Values As String(,))
|
||||
Dim settings As New XmlWriterSettings()
|
||||
@@ -644,11 +693,11 @@ Partial Class Ventas_RepVentas
|
||||
{"SucursalEjecuccion", DdlSubProyectoEjecucion.Text.ToString()},
|
||||
{"Proyecto", DdlProyecto.Text.ToString()}
|
||||
}
|
||||
End Sub
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "GRAFICA"
|
||||
|
||||
|
||||
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
|
||||
If Not DtVentas IsNot Nothing AndAlso DtVentas.Rows.Count > 0 Then
|
||||
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)
|
||||
CambioGrafica()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user