diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index 7f2c2e6ca..3b0b13e38 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -949,6 +949,31 @@ Public Class ClsAcumuladores End Try + Return Retorno + End Function + + Public Function GetMovimientosDistribuidorResumen(CveCliente As Integer, CveEmpresa As Integer, Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha) As Boolean + Dim Retorno As Boolean = False + 'Data = New DataTable + + SqlDataAdapter("PA_Acum_DistribuidorMovtosResumenGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As SqlException + + OnError("Ocurrió un error al consultar los movimientos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + End Try + Return Retorno End Function diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 11f45eec7..825a06a64 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -440,7 +440,7 @@ Public Class ClsCompras Optional AF_Medida As Integer = -1, Optional AF_TipoMantenimiento As Integer = -1, Optional Referencia As String = "", Optional OtrosGastos As Decimal = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0, Optional IEPSPSIVAPorcentaje As Double = 0, - Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1) As Boolean + Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -484,6 +484,7 @@ Public Class ClsCompras .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje .Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle + .Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle End With Try @@ -535,6 +536,7 @@ Public Class ClsCompras .Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje .Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible + End With Try diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index fb7ca7697..74b4d1432 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -146,6 +146,7 @@ Public Class ClsContratos Public Property Ubicacion As String Public Property Responsable As String Public Property Lugar As String + Public Property LimiteDeGasto As Double Public Property CveSubProyecto As Integer Public Property SubProyectoContrato As String Public Property CveProyecto As Integer @@ -291,7 +292,8 @@ Public Class ClsContratos Me.FechaVenc = Data.Rows(0)("FechaVenc").ToString.ToDate Me.CveVendedor = Data.Rows(0)("CveVendedor").ToString.ToEntero Me.ImporteTotal = Data.Rows(0)("ImporteTotal").ToString.ToDecimal - Me.Lugar = Data.Rows(0)("Lugar").ToString + Me.Lugar = Data.Rows(0)("Lugar").ToString + Me.LimiteDeGasto = Data.Rows(0)("LimiteDeGasto").ToString.ToDouble Observaciones = Data.Rows(0)("Observaciones").ToString CveDireccionEnvio = Data.Rows(0)("CveDireccionEnvio").ToString.ToEntero @@ -543,7 +545,7 @@ Public Class ClsContratos Geom As String, CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer, Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1, Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1, - Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional Lugar As String = "") As Integer + Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional Lugar As String = "", Optional LimiteDeGasto As Double = 0) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Con_ContratosObraAdd") @@ -595,6 +597,7 @@ Public Class ClsContratos .Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0) .Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev .Add("@Lugar", SqlDbType.VarChar).Value = Lugar + .Add("@LimiteDeGasto", SqlDbType.Money).Value = LimiteDeGasto .Add("@CveContrato", SqlDbType.Int).Direction = ParameterDirection.Output @@ -621,7 +624,7 @@ Public Class ClsContratos CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer, Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1.0, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1, Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1, - Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional Lugar As String = "") As Boolean + Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "", Optional Lugar As String = "", Optional LimiteDeGasto As Double = 0) As Boolean Dim Retorno = False DataAdapter("PA_Con_ContratosObraUpdate") @@ -671,7 +674,8 @@ Public Class ClsContratos .Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio .Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0) .Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev - .Add("@Lugar", SqlDbType.VarChar).Value = Lugar + .Add("@Lugar", SqlDbType.VarChar).Value = Lugar + .Add("@LimiteDeGasto", SqlDbType.Money).Value = LimiteDeGasto End With @@ -824,6 +828,74 @@ Public Class ClsContratos #End Region +#Region "GASTOS OBRA" + + + + + Public Function GetContratosObragGastosVeiculos(CveContrato As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno = False + + DataAdapter("PA_Con_ContratosObraGastosVeiculosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar los gastos de veiculos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + + Public Function GetContratosObragGastosCompras(CveContrato As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno = False + + DataAdapter("PA_Con_ContratosObraGastosComprasGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar los gastos de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + + + Public Function GetContratosObragGastosNomina(CveContrato As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno = False + + DataAdapter("PA_Con_ContratosObraGastosNominaGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar los gastos de nomina.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + +#End Region + + #Region "C I C L O C O M E R C I A L" Public Function CicloComercialAdd(CveContrato As Integer, CveCotizacion As Integer, CveCliente As Integer, FueFacturado As Boolean, CveFactura As Integer, Estatus As Integer, CveEmpresa As Integer, FechaVenc As Date) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index 16d1f7a61..59017b394 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3356,6 +3356,38 @@ Public Class ClsGenerales #End Region + + + + +#Region "CULTIVOS" + + + Public Function GetCultivosCuadro(CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Agro_CultivosCuadroGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError($"Ocurrió un error al obtener los datos de cultivo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + + End Function + + + + + +#End Region + #Region " IDisposable Support " ' Visual Basic agregó este código para implementar correctamente el modelo descartable. Public Sub Dispose() Implements IDisposable.Dispose diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 0cceddab1..b1d582319 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3488,6 +3488,7 @@ Public Class ClsPaginas End Set End Property + Property GlobalDTAcumGarantiasMesesTipoUso(CveEmpresa As Integer, CveMarca As Integer) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTAcumGarantiasMesesTipoUso-{0}", CveEmpresa) @@ -3516,6 +3517,41 @@ Public Class ClsPaginas End Property + + Property GlobalDTCultivosCuadro(CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTCultivosCuadro-{0}", CveEmpresa) + If Application(AppNombre) Is Nothing Then + + Dim ObjGenerales As New ClsGenerales() + If ObjGenerales.GetCultivosCuadro(CveEmpresa) Then Application(AppNombre) = ObjGenerales.DtResultados + ObjGenerales.Dispose() + + End If + + 'If CveMarca <> -1 Then + ' Dim Str As StringBuilder = New StringBuilder() + ' If CveMarca <> -1 Then Str.AppendFormat("CveMarca = {0}", CveMarca) + + ' Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + ' GlobalDTCultivosCuadro = Dv.ToTable + ' Dv.Dispose() + 'Else + + 'End If + + GlobalDTCultivosCuadro = DirectCast(Application(AppNombre), DataTable) + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTCultivosCuadro-{0}", CveEmpresa) + Application(AppNombre) = value + End Set + End Property + + + + Property GlobalDTAcumTamaños() As DataTable Get GlobalDTAcumTamaños = DirectCast(Application("GlobalDTAcumTamaños"), DataTable) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 9372c7bf7..fc53b60e5 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2680,6 +2680,7 @@ Partial Class Compras_Compras TmpDT.Columns.Add("CveContrato", GetType(Integer)) TmpDT.Columns.Add("DifPSSat", GetType(Integer)) TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer)) + TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer)) GvPS.DataSource = TmpDT @@ -5056,7 +5057,7 @@ Partial Class Compras_Compras RetIVA:=Row("RetIVA").ToString.ToDouble, RetISR:=Row("RetISR").ToString.ToDouble, IEPSPS:=Row("IEPSPS").ToString.ToDouble, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDouble, IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False), - CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero) Then + CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CveCultivoCuadroDetalle:=Row("CveCultivoCuadroDetalle").ToString.ToEntero) Then ErrorDetalles = True Exit For @@ -11264,6 +11265,7 @@ Partial Class Compras_Compras TmpDT.Columns.Add("DifPSSat", GetType(Integer)) TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer)) + TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer)) TmpDTOriginal = New DataTable TmpDTOriginal.Columns.Add("Consec", GetType(Integer)) @@ -11371,6 +11373,7 @@ Partial Class Compras_Compras TmpDTOriginal.Columns.Add("Importe", GetType(Double)) TmpDTOriginal.Columns.Add("CveContratoDetalle", GetType(Double)) + TmpDTOriginal.Columns.Add("CveCultivoCuadroDetalle", GetType(Double)) End Sub @@ -15653,6 +15656,7 @@ Partial Class Compras_Compras Dim CveTipoGasto As Integer = dr("CveTipoGastoObra").ToString.ToEntero Dim TipoGasto As String = dr("TipoGasto").ToString Dim CveContratoDetalle As Integer = dr("CveContratoDetalle").ToString.ToEntero + Dim CveCultivoCuadroDetalle As Integer = dr("CveCultivoCuadroDetalle").ToString.ToEntero '[IPP] PROVISIONAL PARA TIPO GASTO If GlobalDTTiposGastos(UsuarioActual.CveEmpresa) IsNot Nothing AndAlso GlobalDTTiposGastos(UsuarioActual.CveEmpresa).Rows.Count = 1 Then @@ -15664,7 +15668,7 @@ Partial Class Compras_Compras End If AddPS(Cantidad, CveUM, UM, CveClasificacion, Clasificacion, CvePS, PS, CveTipoPS, CveSubProyectoContrato, SubProyecto, Proyecto, CveProyecto, Obs, PU, Total, IVA, RetIVA, RetISR, IEPSPS, IEPSPSIVA, Descuento, CveOrdenCompraDetalle, False, - CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto, CveContratoDetalle:=CveContratoDetalle) + CantidadF:=CantidadF, EntregaDirecta:=EntregaDirecta, CveSATPS:=CveSATPS, CveTipoGasto:=CveTipoGasto, TipoGasto:=TipoGasto, CveContratoDetalle:=CveContratoDetalle, CveCultivoCuadroDetalle:=CveCultivoCuadroDetalle) 'CARGA PE Index = TmpDT.Rows.Count - 1 @@ -17903,7 +17907,7 @@ Partial Class Compras_Compras Obs As String, PU As Double, Total As Double, IVA As Double, RetIVA As Double, RetISR As Double, IEPSPS As Double, IEPSPSIVA As Double, Descuento As Double, Optional CveOrdenCompraDetalle As Integer = -1, Optional TCalculaTotales As Boolean = True, Optional PSCodigo As String = "-", Optional PSDescripcion As String = "-", Optional CantidadF As Double = -1, Optional EntregaDirecta As Integer = -1, Optional OtrosGastos As Double = 0, Optional CveSATPS As Integer = -1, Optional CargaXml As Boolean = False, Optional CveTipoGasto As Integer = -1, Optional TipoGasto As String = "", Optional PorcentajeIVA As Double = 0, - Optional PorcentajeIEPS As Double = 0, Optional PorcentajeRetIVA As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1) As Integer + Optional PorcentajeIEPS As Double = 0, Optional PorcentajeRetIVA As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional NoDeducible As Boolean = False, Optional CveContratoDetalle As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Integer Dim Row As DataRow = Nothing @@ -18026,6 +18030,8 @@ Partial Class Compras_Compras Row("CveContratoDetalle") = CveContratoDetalle + Row("CveCultivoCuadroDetalle") = CveCultivoCuadroDetalle + If UsuarioActual.Empresa.UsaAC Then Row("CveProgramaOperativo") = DdlACGeneral1.SelectedValue.ToEntero Row("CveUnidadAdministrativa") = DdlACGeneral2.SelectedValue.ToEntero diff --git a/Contratos/CatContratosTipos.aspx.vb b/Contratos/CatContratosTipos.aspx.vb index f0bdc4aea..7b36b4837 100644 --- a/Contratos/CatContratosTipos.aspx.vb +++ b/Contratos/CatContratosTipos.aspx.vb @@ -16,8 +16,7 @@ Partial Class Contratos_CatContratosTipos Private Sub CargaDatos() Dim Objeto As New ClsContratos If Objeto.GetContratosTipos(UsuarioActual.CveEmpresa) Then - GvContratos.DataSource = Objeto.DtResultados - GlobalDTContratosTipos(UsuarioActual.CveEmpresa) = Objeto.DtResultados + GvContratos.DataSource = Objeto.DtResultados End If GvContratos.DataBind() Objeto.Dispose() @@ -40,9 +39,10 @@ Partial Class Contratos_CatContratosTipos UpDatos.Update() End If - Objeto.Dispose() - Alert("El Contrato se agregó correctamente.", TipoMensaje.MsgInformacion) + RecargaGlobal() + Alert("El Contrato se agregó correctamente.", TipoMensaje.MsgInformacion) + End Sub @@ -72,6 +72,7 @@ Partial Class Contratos_CatContratosTipos End If GvContratos.EditIndex = -1 CargaDatos() + RecargaGlobal() UpDatos.Update() End Sub @@ -92,10 +93,14 @@ Partial Class Contratos_CatContratosTipos Objeto.Dispose() GvContratos.EditIndex = -1 CargaDatos() - End Sub - - + RecargaGlobal() + End Sub + Private Sub RecargaGlobal() + GlobalDTContratosTipos(-1) = Nothing + End Sub + + #End Region - - + + End Class diff --git a/Contratos/ContratoObra.aspx b/Contratos/ContratoObra.aspx index b710ac331..e3ccfab73 100644 --- a/Contratos/ContratoObra.aspx +++ b/Contratos/ContratoObra.aspx @@ -97,6 +97,11 @@ Agregar Presupuesto Interno + +
  • + Agregar Gasto +
  • + @@ -570,10 +575,20 @@ --%> + +
    + +
    + + +
    +
    +
    - + +
    @@ -1647,6 +1662,156 @@ + + + + + + + + +
    +
    + + + + + + + + + +
    Contrato:Gastos:Nomina:Indirectos:%Gasto:
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    vehículos
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    Compras
    +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + + +
    +
    + +
    +
    +
    + +
    +
    Nomina
    +
    +
    + + + + + + + + + + + + + + + +
    +
    +
    + +
    + + + + + +
    +
    + + +
    +
    + @@ -2039,7 +2204,11 @@ - + + + + + <%-- @@ -2050,7 +2219,7 @@ - + --%> @@ -2761,14 +2930,11 @@ <%--Modal Carga Presupuesto--%> - - - - + @@ -4188,7 +4188,7 @@ - + @@ -4197,7 +4197,7 @@ - + @@ -4210,6 +4210,31 @@ +
    +
    +
    +
    + + Saldo de Cliente +
    +
    +
    +
    +
    +
    +
    + + + + + + + +
    +
    +
    @@ -4302,8 +4327,8 @@ --%> + - @@ -4577,14 +4602,9 @@

    - - + + -
    diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index f6fcd022c..be55071aa 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -9161,6 +9161,11 @@ Partial Class Clientes End If + If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa, TxtFechaIUsados.Text.ToDate, TxtFechaFUsados.Text.ToDate) Then + GvUsadosResumen.DataSource = ObjAcum.DtResultados + End If + GvUsadosResumen.DataBind() + 'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False) LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False) diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb index 548d83a87..2365c576f 100644 --- a/Ventas/RepVentas.aspx.vb +++ b/Ventas/RepVentas.aspx.vb @@ -428,40 +428,50 @@ Partial Class Ventas_RepVentas 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) + If e.Row.DBCampo("Mes").ToEntero() > 0 Then + 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 + Dim Dia As Integer = FechaFRef.Day - If e.Row.DBCampo("Mes").ToEntero() <> FechaFRef.Month Then - Dia = lastDayOfMonth + 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") 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 separator As Char = "/".ToCharArray().FirstOrDefault() + Dim AnioMes = e.Row.DBCampo("AnioMes").Split(separator) - Dim Dia As Integer = FechaFRef.Day + Dim Anio As Integer = AnioMes(0).ToEntero() + Dim Mes As Integer = AnioMes(1).ToEntero() - If e.Row.DBCampo("Mes").ToEntero() <> FechaFRef.Month Then - Dia = lastDayOfMonth + If Anio > 0 AndAlso Mes > 0 Then + 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") 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") diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 9e8be3ff7..e8fc5c8c7 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -4343,11 +4343,11 @@
    Agendar
    - +
    @@ -6255,7 +6255,7 @@
    -<%-- + <%-- --%>
    @@ -6427,6 +6427,17 @@