diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index 7f2c2e6ca..d7134d6b8 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -728,7 +728,7 @@ Public Class ClsAcumuladores Public Function AddGarantiasDetalle(CveVentaDetalle As Integer, CvePS As Integer, CveFolioGarantia As Integer, CveTipoUso As Integer, CodigoEnsamble As String, CodigoLinea As String, CodigoInspeccion As String, CveTipoDefecto As Integer, NumPoliza As String, Importe As Double, - Consecutivo As String, FechaAjuste As DateTime) As Boolean + Consecutivo As String, FechaAjuste As DateTime, PorcentajeAjuste As Decimal) As Boolean Dim Retorno As Boolean = False SqlDataAdapter("PA_Acum_GarantiasDetalleAdd") With SqlAdapter.SelectCommand.Parameters @@ -744,6 +744,7 @@ Public Class ClsAcumuladores .Add("@Importe", SqlDbType.Float).Value = Importe .Add("@Consecutivo", SqlDbType.VarChar).Value = Consecutivo .Add("@FechaAjuste", SqlDbType.DateTime).Value = FechaAjuste + .Add("@PorcentajeAjuste", SqlDbType.Float).Value = PorcentajeAjuste End With Try SqlAdapter.Fill(Data) @@ -926,7 +927,7 @@ Public Class ClsAcumuladores Return Retorno End Function - Public Function DistribuidorMovtosGet(CveCliente As Integer, CveEmpresa As Integer, Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha, Optional CveVentaRNCCargo As Integer = -1) As Boolean + Public Function DistribuidorMovtosGet(CveCliente As Integer, CveEmpresa As Integer, Optional FechaI As Date = MinFecha, Optional FechaF As Date = MaxFecha, Optional CveVentaRNCCargo As Integer = -1, Optional CveConcepto As Integer = -1) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -938,6 +939,32 @@ Public Class ClsAcumuladores .Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@CveVentaRNCCargo", SqlDbType.Int).Value = CveVentaRNCCargo + .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto + 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 + + 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 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/ClsOC.vb b/App_Code/ClsOC.vb index f9723e55e..98e94a859 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -1252,7 +1252,7 @@ Public Class ClsOC pObservacion As String, pCveUsuario As Integer, Optional pCveOrdenCompraPadre As Integer = -1, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Double = 0, Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional Total As Double = 0, Optional CveContratoDetalle As Integer = -1, 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 CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1) As Boolean + Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraDetalleAdd") @@ -1284,8 +1284,7 @@ Public Class ClsOC .Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje .Add("@CveVentaDetalleCotizacion", SqlDbType.Int).Value = CveVentaDetalleCotizacion .Add("@CveTipoGastoObra", SqlDbType.Int).Value = CveTipoGastoObra - - + .Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle End With 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/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index f58fdce07..016bdbaee 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -404,7 +404,7 @@ Public Class ClsProductosServicios Optional CveFraccionArancelaria As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, - Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1) As Integer + Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_ProductosServiciosAdd") @@ -483,7 +483,9 @@ Public Class ClsProductosServicios .Add("@AplicaLote", SqlDbType.Bit).Value = AplicaLote .Add("@AplicaCaducidad", SqlDbType.Bit).Value = AplicaCaducidad .Add("@AplicaSeccion", SqlDbType.Bit).Value = AplicaSeccion - .Add("@TiempoCaducidad", SqlDbType.SmallInt).Value = TiempoCaducidad + .Add("@TiempoCaducidad", SqlDbType.SmallInt).Value = TiempoCaducidad + + .Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia End With Try @@ -630,7 +632,7 @@ Public Class ClsProductosServicios Optional CveFraccionArancelaria As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, - Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1) As Boolean + Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -711,7 +713,9 @@ Public Class ClsProductosServicios .Add("@AplicaLote", SqlDbType.Bit).Value = AplicaLote .Add("@AplicaCaducidad", SqlDbType.Bit).Value = AplicaCaducidad .Add("@AplicaSeccion", SqlDbType.Bit).Value = AplicaSeccion - .Add("@TiempoCaducidad", SqlDbType.SmallInt).Value = TiempoCaducidad + .Add("@TiempoCaducidad", SqlDbType.SmallInt).Value = TiempoCaducidad + + .Add("@CvePSAdicionalVigencia", SqlDbType.Int).Value = CvePSAdicionalVigencia End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index d6b72340c..b2e9e897d 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1468,7 +1468,7 @@ Namespace Modelos For Each Dr As DataRow In DtAjustes.Rows If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero, Dr("CodigoEnsamble").ToString, Dr("CodigoLinea").ToString, Dr("CodigoInspeccion").ToString, Dr("CveTipoDefecto").ToString.ToEntero, - Dr("NumPoliza").ToString, Dr("Importe").ToString.ToDouble, Dr("Consecutivo").ToString, Dr("FechaAjuste").ToString.ToDateTime()) Then + Dr("NumPoliza").ToString, Dr("Importe").ToString.ToDouble, Dr("Consecutivo").ToString, Dr("FechaAjuste").ToString.ToDateTime(), Dr("PorcentajeAjuste").ToString.ToDecimal()) Then ErrorList.Add("Ocurrió un error al agregar la garantia detalle.") End If Next diff --git a/Bancos/RepComplementoPago.aspx.vb b/Bancos/RepComplementoPago.aspx.vb index 629fa321f..ba740b104 100644 --- a/Bancos/RepComplementoPago.aspx.vb +++ b/Bancos/RepComplementoPago.aspx.vb @@ -160,7 +160,7 @@ Partial Class Bancos_RepComplementoPago e.Row.FCCheckBox("Chk").Visible = False End If - e.Row.FCCheckBox("Chk").ToolTip = "Hay una inconsistencia entre lo pagado en las facturas y el importe expedido" + e.Row.FCCheckBox("Chk").ToolTip += ". Hay una inconsistencia entre lo pagado en las facturas y el importe expedido" End If End If diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 8f1c3a848..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 @@ -4547,7 +4548,7 @@ Partial Class Compras_Compras 'End If 'METODO DE PREPOLIZA DE ALMACEN - If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140, 141, 153) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal If ImporteAlmacen > 0 Then If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then @@ -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--%> - - - - + +
    +
    +
    +
    + + Saldo de Cliente +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + +
    +
    +
    @@ -4269,6 +4298,14 @@ + +
    + + + + + +
    @@ -4302,8 +4339,8 @@ --%> + - @@ -4577,14 +4614,9 @@

    - - + + -
    diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index f6fcd022c..afd23bfe7 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -9137,7 +9137,7 @@ Partial Class Clientes Dim ImporteCargo As Decimal = 0D Dim ImporteBonificacion As Decimal = 0D - If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, TxtFechaIUsados.Text.ToDate, TxtFechaFUsados.Text.ToDate) Then + If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, TxtFechaIUsados.Text.ToDate, TxtFechaFUsados.Text.ToDate, CveConcepto:=DdlConceptoUsado.SelectedValue.ToEntero()) Then GvAcum.DataSource = ObjAcum.DtResultados @@ -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) @@ -9169,6 +9174,7 @@ Partial Class Clientes UpAcciones.Update() UpUsadosResumen.Update() + UpGvUsadosResumen.Update() UpAcum.Update() End If diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index b628ad122..152d2e3cc 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1902,7 +1902,7 @@ Partial Class PV For Each Dr As DataRow In TmpDTAjustes.Rows If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero, Dr("CodigoEnsamble").ToString, Dr("CodigoLinea").ToString, Dr("CodigoInspeccion").ToString, Dr("CveTipoDefecto").ToString.ToEntero, - Dr("NumPoliza").ToString, Dr("Importe").ToString.ToDouble, Dr("Consecutivo").ToString, Dr("FechaAjuste").ToString.ToDateTime()) Then + Dr("NumPoliza").ToString, Dr("Importe").ToString.ToDouble, Dr("Consecutivo").ToString, Dr("FechaAjuste").ToString.ToDateTime(), Dr("PorcentajeAjuste").ToString.ToDecimal()) Then ErrorList.Add("Ocurrió un error al agregar la garantia detalle.") End If Next diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index 91b9fb262..7a5c4faa1 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -224,12 +224,13 @@
    - <%-- - - --%> - <%-- - --%> + +
    +
    +
    + +

    diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 4311727ff..6f9b5de8f 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -212,6 +212,11 @@ Partial Class ProductosyServicios DdlIVA.Enabled = False End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + DivPSAdicionalVigencia.Visible = True + CargaPSAdicionalesVigencias() + End If + If CvePS > 0 Then CargaEquivalencias() CargaPSAdicionales() @@ -769,6 +774,12 @@ Partial Class ProductosyServicios DdlSATPS.SelectedText = $"{ObjProductosServicios.SATClavePS} - {ObjProductosServicios.SATDescripcion}" CveSATPS = ObjProductosServicios.CveSATPS End If + + If ObjProductosServicios.DtResultados.Rows(0)("CvePSAdicionalVigencia").ToString.ToEntero() > 0 Then + DdlPSAdicionalVigencia.SelectedValue = ObjProductosServicios.DtResultados.Rows(0)("CvePSAdicionalVigencia").ToString + DdlPSAdicionalVigencia.SelectedText = ObjProductosServicios.DtResultados.Rows(0)("CodigoPSVigencia").ToString + End If + If ObjProductosServicios.CveFraccionArancelaria.ToString <> Nothing Then DdlFraccionArancelaria.SelectedValue = ObjProductosServicios.CveFraccionArancelaria.ToString DdlFraccionArancelaria.SelectedText = ObjProductosServicios.ClaveSATFraccionArancelariaDescripcion @@ -918,6 +929,14 @@ Partial Class ProductosyServicios DdlSATPS.ddlWS.Attributes.Add("data-metodo", "getpssat") End Sub + Public Sub CargaPSAdicionalesVigencias() + DdlPSAdicionalVigencia.setEsWebService(True) + DdlPSAdicionalVigencia.Attributes.Add("data-cvesubproyecto", "-1") + DdlPSAdicionalVigencia.ddlWS.Attributes.Add("data-cveclasificacion", "-1") + DdlPSAdicionalVigencia.ddlWS.Attributes.Add("data-pagina", "ventas/ventas") + DdlPSAdicionalVigencia.ddlWS.Attributes.Add("data-Estatus", "1") + End Sub + Public Sub CargaDdlFraccionArancelaria() DdlFraccionArancelaria.setEsWebService(True) DdlFraccionArancelaria.Attributes.Add("data-metodo", "getfraccionarancelaria") @@ -1218,7 +1237,7 @@ Partial Class ProductosyServicios CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero, CveTamaño:=DdlTamanio.SelectedValue.ToEntero, CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(), ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, - ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad) > 0 Then + ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero()) > 0 Then ViewState("CvePS") = ObjProductosServicios.CvePS For Each GVR As GridViewRow In GvImpuestosLocales.Rows If GVR.FCCheckBox("ChkDeduccion").Checked Then @@ -1267,7 +1286,7 @@ Partial Class ProductosyServicios CveModelo:=DdlModelo.SelectedValue.ToEntero(), CveMedida:=DdlMedida.SelectedValue.ToEntero(), CveRinTamaño:=DdlRin.SelectedValue.ToEntero(), ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, - AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad) Then + AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero()) Then If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then TieneError = True diff --git a/Ventas/RepComisionesJAM.aspx b/Ventas/RepComisionesJAM.aspx index eeeb3e5c9..8fac2b313 100644 --- a/Ventas/RepComisionesJAM.aspx +++ b/Ventas/RepComisionesJAM.aspx @@ -69,7 +69,7 @@
    - +
    @@ -86,26 +86,26 @@
    -
    Esquema Nuevo:
    -
    - -
    +
    Esquema Nuevo:
    +
    + +
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + - + OnRowDataBound="GvDatos_RowDataBound" OnPreRender="GvDatos_PreRender"> <%-- 0 --%> @@ -130,7 +130,7 @@ <%-- 10 --%> <%-- 11 --%> - + <%-- 12 --%> <%-- 13 --%> @@ -150,13 +150,42 @@ <%-- 20 --%> <%-- 21 --%> - + <%-- 22 --%> + + <%-- 23 --%> + + <%-- 24 --%> + <%-- 25 --%> + + + + + + +
    + + diff --git a/Ventas/RepComisionesJAM.aspx.cs b/Ventas/RepComisionesJAM.aspx.cs index 06f32a97b..1dfcf5071 100644 --- a/Ventas/RepComisionesJAM.aspx.cs +++ b/Ventas/RepComisionesJAM.aspx.cs @@ -60,6 +60,10 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas GvDatos.Columns[15].Visible = UsuarioActual.TienePermisoProceso(201); + GvDatos.Columns[21].Visible = UsuarioActual.TienePermisoProceso(311); + GvDatos.Columns[22].Visible = UsuarioActual.TienePermisoProceso(311); + + } private void Consulta() @@ -106,29 +110,33 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas } else { - if (e.Row.DBCampo("Transaccion").ToString() == "Pago") + if (e.Row.DBCampo("Transaccion").ToString() == "Pago" && ChkEsquemaNuevo.Checked) { - if (e.Row.DBCampo("CveCategoria").ToEntero() < 1 && e.Row.DBCampo("Comision").ToDouble() == 0) - { - //if (UsuarioActual.TienePermisoProceso(201)) - //{ - // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; - // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; - //} - //else - //{ - e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; - e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; - //} - }else if (e.Row.DBCampo("CveCategoria").ToEntero() > 0 ) - { - e.Row.Cells[21].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria",$"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}."; - e.Row.Cells[22].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}."; - }else if(e.Row.DBCampo("Comision").ToDouble() > 0) - { - e.Row.Cells[21].ToolTip = "El producto obtuvo comision porque esta dentro de los de las comisiones especiales."; - e.Row.Cells[22].ToolTip = "El producto obtuvo comision porque esta dentro de los de las comisiones especiales."; - } + e.Row.FCLinkButton("LnkInfo").Visible = true; + //if (e.Row.DBCampo("CveCategoria").ToEntero() < 1 && e.Row.DBCampo("Comision").ToDouble() == 0) + //{ + // //if (UsuarioActual.TienePermisoProceso(201)) + // //{ + // // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; + // // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; + // //} + // //else + // //{ + // e.Row.Cells[21].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; + // e.Row.Cells[22].ToolTip = "No se encuentra dentro de alguna categoria que de comision ni a alguno de los productos especiales."; + // //} + //}else if (e.Row.DBCampo("CveCategoria").ToEntero() > 0 ) + //{ + // e.Row.Cells[21].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria",$"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}."; + // e.Row.Cells[22].ToolTip = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {e.Row.DBCampo("CveCategoria").ToString()}")}."; + //}else if(e.Row.DBCampo("Comision").ToDouble() > 0) + //{ + // e.Row.Cells[21].ToolTip = "El producto obtuvo comision porque esta dentro de los de las comisiones especiales."; + // e.Row.Cells[22].ToolTip = "El producto obtuvo comision porque esta dentro de los de las comisiones especiales."; + //} + }else + { + e.Row.FCLinkButton("LnkInfo").Visible = false; } //if (e.Row.DBCampo("CveMoneda").ToEntero() != 1) @@ -342,4 +350,28 @@ public partial class Ventas_RepComisionesJAM : ClsPaginas ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Empresas/119/Formatos/RepComisionesJAM.rpt"), DtDatos, lista, "RepComisionesJAM", Formato), "RepComisionesJAM", Formato); } + + protected void LnkInfo_Click(object sender, EventArgs e) + { + GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + + if (!Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0) + { + LblInfo.Text = $"No se encuentra dentro de alguna categoria que de comision ni alguno de los productos especiales.
    La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}. "; + } + else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() > 0) + { + LblInfo.Text = $"El producto obtuvo la comision porque se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")} y esta dentro de los rangos de precio publico y dias validos. "; + } + else if (Convert.ToBoolean(gvRow.DataKey("TieneCategoriaValida")) && gvRow.DataKey("Comision").ToDouble() == 0) + { + LblInfo.Text = $"El producto se encuentra en la categoria: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = {gvRow.DataKey("CveCategoria").ToString()}")} que da comision, pero no se encuentra dentro de los rangos de precio publico y dias validos."; + } + else if (gvRow.DataKey("Comision").ToDouble() > 0) + { + LblInfo.Text = $"El producto obtuvo comision porque esta dentro de los de las comisiones especiales.
    La categoria del producto es: {get_GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Categoria", $"CveCategoria = { gvRow.DataKey("CveCategoria").ToString()}")}.
    El producto es: {gvRow.DataKey("CodigoPS").ToString()}. "; + } + + this.RegistraScript("$('#DModalInfo').modal();"); UpModalInformacion.Update(); + } } \ No newline at end of file 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..bab37aa2a 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -4343,11 +4343,11 @@
    Agendar
    - + @@ -6152,7 +6152,7 @@
    + DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None"> @@ -6255,7 +6255,7 @@
    -<%-- + <%-- --%>
    @@ -6427,6 +6427,20 @@