From c8ceac00b18bdde74086ffbc791c44ff4079d101 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 17 Nov 2020 09:02:08 -0700 Subject: [PATCH 01/17] Global de tipos de contrato --- Contratos/CatContratosTipos.aspx.vb | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) 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 From 319edf80e57f581edf80d3160cf66837eec85a2b Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 23 Nov 2020 16:02:46 -0700 Subject: [PATCH 02/17] -- texto --- Bancos/RepComplementoPago.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From edb8c16ab6c2d32b2a5884169278f55a8f8b29aa Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Mon, 23 Nov 2020 16:16:18 -0700 Subject: [PATCH 03/17] =?UTF-8?q?Contratos=20pesta=C3=B1a=20gastos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsContratos.vb | 80 +++- Contratos/ContratoObra.aspx | 225 +++++++++- Contratos/ContratoObra.aspx.vb | 765 ++++++++++++++++++++------------- 3 files changed, 760 insertions(+), 310 deletions(-) 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/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--%> - - - - + @@ -2046,53 +2046,53 @@ " style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> - +

    - - + + - - - - - - - - - - -   + + + + + + + + + + +   - - - - -   + + + + +   - - - - -   + + + + +   - - - - - - - - - - - - -
    + + + + + + + + + + + + +
    @@ -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) From 92b3d0d05fb08ff03f65e090a40f14086ef7ffc7 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Tue, 24 Nov 2020 18:01:03 -0700 Subject: [PATCH 10/17] Cultivos OC y vinculacion en compras --- App_Code/ClsCompras.vb | 4 ++- App_Code/ClsGenerales.vb | 32 ++++++++++++++++++++++ App_Code/ClsPaginas.vb | 36 +++++++++++++++++++++++++ Compras/Compras.aspx.vb | 12 ++++++--- OC/OC.aspx | 27 +++++++++++++++++-- OC/OC.aspx.vb | 58 +++++++++++++++++++++++++++++++--------- 6 files changed, 151 insertions(+), 18 deletions(-) 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/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 8f1c3a848..6760d633d 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/OC/OC.aspx b/OC/OC.aspx index 2c413b4c3..d4dce1d93 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -809,6 +809,14 @@ + +
    + + + +
    + @@ -875,7 +883,7 @@ + DataKeyNames="SubProyecto, Cantidad, Importe, Descuento, CveOrdenCompra, CveUnidadMedida, CvePresupuestoEgreso, PS,CveClasificacion, CvePS, CveSubProyecto, CveActivoFijo, CodigoAF, TipoDato, Observacion, CveOrdenCompraDetalle,CveCompra,IVAPorcentaje,RetIVAPorcentaje,RetISRPorcentaje,IEPSPSPorcentaje,IEPSPSIVAPorcentaje,CantidadNoEditable,CveCultivoCuadroDetalle" data-tableheader=".GVDHeader" ShowHeader="false" data-rows="0"> @@ -932,17 +940,32 @@ - + + + + + + + + + + + + + + + diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 5bbe07768..ce5dfb98d 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -798,6 +798,14 @@ Partial Class OC DdlSubProyectoContrato.DataBind() DdlSubProyectoContrato.Items.Insert(0, New ListItem("Seleccione", "-1")) + + If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then + DVCultivosCuadro.Visible = True + DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) + DdlCultivosCuadro.DataBind() + DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + End If + 'SOLO SE MUESTRA CUANDO ES REGISTRO NUEVO If Not CveOrdenCompra > 0 Then If UsuarioActual.Empresa.EsComercializadora And Not CveCotizacion > 0 Then @@ -1085,6 +1093,8 @@ Partial Class OC DtDetalle.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer)) DtDetalle.Columns.Add("CveTipoGastoObra", GetType(Integer)) + DtDetalle.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer)) + DtDetalle.Columns.Add("Cuadro", GetType(String)) 'DtDetalle.Columns.Add("CveOrdenCompraDetalle", GetType(Integer)) @@ -2141,7 +2151,7 @@ Partial Class OC CboUnidadMedida.SelectedValue.ToEntero, IvaPS, IEPSPS, IEPSPSIVA, DdlClasificacion.SelectedValue.ToEntero, CboUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero, Proyecto, DdlSubProyecto.SelectedValue.ToEntero, SubProyecto, LblCodigo.Text, HdnCveActivoFijo.Value.ToEntero, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer, IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero, - DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR) + DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR, CveCultivoCuadroDetalle:=DdlCultivosCuadro.SelectedValue.ToEntero, Cuadro:=DdlCultivosCuadro.SelectedItem.Text) TxtCant.Text = "" CboUnidadMedida.SelectedIndex = 0 @@ -2171,7 +2181,8 @@ Partial Class OC Private Sub AddPS(Cantidad As String, CvePS As Integer, PS As String, Observaciones As String, Importe As Double, Descuento As Double, Total As Double, CveUnidadMedida As Integer, IVAPS As Double, IEPSPS As Double, IEPSPSIVA As Double, CveClasificacion As Integer, UM As String, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, CodigoAF As String, CveActivoFijo As Integer, TipoDato As Integer, CveOrdenCompraDetalle As Integer, CveOrdenCompra As Integer, IdCuentaPorEjercer As Integer, IdCuentaComprometido As Integer, CveProgramaOperativo As Integer, CveUnidadAdministrativa As Integer, - CveFuenteFinanciamiento As Integer, CveTipoGasto As Integer, CveClasificacionOG As Integer, RetIVA As Double, RetISR As Double, Optional CveContratoDetalle As Integer = -1, Optional CveTipoGastoObra As Integer = -1) + CveFuenteFinanciamiento As Integer, CveTipoGasto As Integer, CveClasificacionOG As Integer, RetIVA As Double, RetISR As Double, Optional CveContratoDetalle As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1, + Optional Cuadro As String = "") If DtDetalle IsNot Nothing Then Dim dr As DataRow = DtDetalle.NewRow @@ -2228,6 +2239,9 @@ Partial Class OC dr("CveClasificacionOG") = CveClasificacionOG dr("CveContratoDetalle") = CveContratoDetalle dr("CveTipoGastoObra") = CveTipoGastoObra + dr("CveCultivoCuadroDetalle") = CveCultivoCuadroDetalle + dr("Cuadro") = Cuadro + DtDetalle.Rows.Add(dr) @@ -2511,7 +2525,7 @@ Partial Class OC IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, - IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero) Then + IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then TieneError = True Exit For End If @@ -2589,7 +2603,7 @@ Partial Class OC dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, pCveOrdenCompraPadre:=CveOrdenCompraPadre, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, - IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString().ToEntero(), CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero) Then + IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveVentaDetalleCotizacion:=dr("CveVentaDetalleCotizacion").ToString().ToEntero(), CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then TieneError = True Exit For End If @@ -2702,7 +2716,7 @@ Partial Class OC 'inserto los nuevos detalles If Not TieneError Then For Each dr As DataRow In DtDetalle.FiltraParametros("TipoDato = 0").Rows - If Not OC.AddOrdenCompraDetalle(CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero), Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero) Then + If Not OC.AddOrdenCompraDetalle(CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero, dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CvePresupuestoEgreso:=If(TipoOC = "REQ", -1, dr("CvePresupuestoEgreso").ToString.ToEntero), Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then TieneError = True Exit For Else @@ -3182,7 +3196,7 @@ Partial Class OC CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, - CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero) Then + CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then HuboError = True Exit For End If @@ -3223,7 +3237,7 @@ Partial Class OC 'CveOrdenCompra = objOrdenCompra.CveOrdenCompra If Not HuboError Then For Each dr As DataRow In DtDetalle.Rows - If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero) Then + If Not objOrdenCompra.AddOrdenCompraDetalle(objOrdenCompra.CveOrdenCompra, dr("Cantidad").ToString.ToDouble(), dr("CveUnidadMedida").ToString.ToEntero, dr("CvePS").ToString.ToEntero, dr("Importe").ToString.ToDouble, dr("CveSubProyecto").ToString.ToEntero(), dr("CveActivoFijo").ToString.ToEntero, dr("Observacion").ToString, UsuarioActual.CveUsuario, CveOrdenCompra, CvePresupuestoEgreso:=dr("CvePresupuestoEgreso").ToString.ToEntero, Descuento:=dr("Descuento").ToString.ToDouble, IEPSPS:=dr("IEPSPS").ToString.ToDouble, IEPSPSIVA:=dr("IEPSPSIVA").ToString.ToDouble, IVA:=dr("IVA").ToString.ToDouble, RetIVA:=dr("RetIVA").ToString.ToDouble, RetISR:=dr("RetISR").ToString.ToDouble, Total:=dr("Total").ToString.ToDouble, CveContratoDetalle:=dr("CveContratoDetalle").ToString.ToEntero, IVAPorcentaje:=dr("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=dr("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=dr("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=dr("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=dr("IEPSPSIVAPorcentaje").ToString.ToDouble, CveTipoGastoObra:=dr("CveTipoGastoObra").ToString.ToEntero, CveCultivoCuadroDetalle:=dr("CveCultivoCuadroDetalle").ToString.ToEntero) Then HuboError = True Exit For End If @@ -3729,6 +3743,18 @@ Partial Class OC End If End If + + + If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then + e.Row.FCDropDownList("DdlCultivosCuadroEdit").Visible = True + e.Row.FCDropDownList("DdlCultivosCuadroEdit").DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) + e.Row.FCDropDownList("DdlCultivosCuadroEdit").DataBind() + + e.Row.FCDropDownList("DdlCultivosCuadroEdit").Items.Insert(0, New ListItem("Seleccione uno", "-1")) + e.Row.FCDropDownList("DdlCultivosCuadroEdit").SelectedValueExist(e.Row.DBCampo("CveCultivoCuadroDetalle").ToEntero) + + End If + e.Row.FCTextBox("LblEditCodigo").Attributes.Add("onkeyup", String.Format("EnterAFEdit(event,this,{0},{1});", e.Row.FCHiddenField("HdnCveActivoFijo").ClientID, e.Row.FCHiddenField("HdnCodigoAF").ClientID)) e.Row.FCTextBox("LblEditCodigo").Attributes.Add("onblur", String.Format("AFBlurEdit(this,{0},{1});", e.Row.FCHiddenField("HdnCveActivoFijo").ClientID, e.Row.FCHiddenField("HdnCodigoAF").ClientID)) e.Row.FCImage("ImgAF").Attributes.Add("onclick", String.Format("AbrirVentana('/AF/PopUpBuscarAF.aspx?OPCION=OCE&RI={0}',950,600,'N');", e.Row.RowIndex)) @@ -3787,8 +3813,8 @@ Partial Class OC End Sub Protected Sub GvD_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvD.RowUpdating Dim Cantidad, Importe, Descuento As Double - Dim CveUnidad, CveClasificacion, CveActivoFijo, CvePS, CveSubProyecto, CveProyecto As Integer - Dim Obs, UM, Clasificacion, Codigo, PS, SubProyecto, Proyecto As String + Dim CveUnidad, CveClasificacion, CveActivoFijo, CvePS, CveSubProyecto, CveProyecto, CveCultivoCuadroDetalle As Integer + Dim Obs, UM, Clasificacion, Codigo, PS, SubProyecto, Proyecto, Cuadro As String Dim gvr As GridViewRow = GvD.Rows(e.RowIndex) Cantidad = gvr.FCTextBox("TxtCantEdit").Text.Trim.ToDouble @@ -3839,6 +3865,11 @@ Partial Class OC CveSubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero SubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedItem.Text + + CveCultivoCuadroDetalle = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedValue.ToEntero + Cuadro = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedItem.Text + + If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then CveProyecto = -1 Proyecto = "Seleccione" @@ -3857,8 +3888,8 @@ Partial Class OC CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero If CvePresupuesto > 0 Then If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then - If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} AND Importe > 0").Rows.Count > 0 Then - Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} AND Importe > 0").Rows(0)("Importe").ToString.ToDouble + If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows.Count > 0 Then + Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows(0)("Importe").ToString.ToDouble End If End If If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, CveProyecto, @@ -3935,6 +3966,9 @@ Partial Class OC dr(0)("CveActivoFijo") = CveActivoFijo dr(0)("CodigoAF") = Codigo + dr(0)("CveCultivoCuadroDetalle") = CveCultivoCuadroDetalle + dr(0)("Cuadro") = Cuadro + 'si el tipodato viene de la BD, entonces sufrió una actualización If dr(0)("TipoDato").ToString.ToEntero = 2 Then dr(0)("TipoDato") = 1 DtDetalle.AcceptChanges() @@ -8361,7 +8395,7 @@ Partial Class OC CveUnidadMedida, IvaPS, IEPSPS, IEPSPSIVA, CveClasificacion, UMAbreviatura, Clasificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto, Codigo, -1, 0, -1, -1, IdCuentaPorEjercer, IdCuentaComprometido, -1, -1, -1, -1, - -1, RetIVA, RetISR, CveContratoDetalle:=CveContratoDetalle, CveTipoGastoObra:=CveTipoGastoObra) + -1, RetIVA, RetISR, CveContratoDetalle:=CveContratoDetalle, CveTipoGastoObra:=CveTipoGastoObra, CveCultivoCuadroDetalle:=-1, Cuadro:="") ContratoObraAplciado = True From 3375d7a9c45a0dad7f4507a819f3cb0ad42d734f Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 24 Nov 2020 20:21:28 -0700 Subject: [PATCH 11/17] -- incluye servec --- Compras/Compras.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 8f1c3a848..9372c7bf7 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4547,7 +4547,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 From 8c803b4a992ed40ae579cc64a89a926bd85d7670 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Tue, 24 Nov 2020 22:16:30 -0700 Subject: [PATCH 12/17] OC Correcion DropDownCultivos --- OC/OC.aspx | 8 ++++---- OC/OC.aspx.vb | 32 +++++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/OC/OC.aspx b/OC/OC.aspx index d4dce1d93..b7c9eb33e 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -812,8 +812,7 @@
    - + DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar">
    @@ -941,7 +940,7 @@ - + @@ -951,7 +950,8 @@ - + Date: Wed, 25 Nov 2020 22:09:14 -0700 Subject: [PATCH 13/17] Concepto de ajuste o garantia total,bonificacion por usados, porcentaje de ajuste --- App_Code/ClsAcumuladores.vb | 6 +- App_Code/Modelos.vb | 2 +- Ventas/PV.aspx.vb | 2 +- Ventas/Ventas.aspx | 28 +- Ventas/Ventas.aspx.vb | 562 +++++++++++++++++++++--------------- 5 files changed, 343 insertions(+), 257 deletions(-) diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index 3b0b13e38..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,7 @@ 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 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/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/Ventas.aspx b/Ventas/Ventas.aspx index e8fc5c8c7..bab37aa2a 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -6152,7 +6152,7 @@
    + DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None"> @@ -6427,16 +6427,19 @@
    + +
    + + + + + +
    diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index be55071aa..b5e4b733d 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 From 5c0a418d0bee787be4dba8cb0e687bf0a03363bd Mon Sep 17 00:00:00 2001 From: Raul Pimienta Date: Wed, 25 Nov 2020 22:58:43 -0700 Subject: [PATCH 16/17] Cambios en el reporte de comisiones de JAM --- Ventas/RepComisionesJAM.aspx | 57 +++++++++++++++++++------ Ventas/RepComisionesJAM.aspx.cs | 76 +++++++++++++++++++++++---------- 2 files changed, 97 insertions(+), 36 deletions(-) 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 From f2c9afc401e7d08dad9f890cbe2ce33b99ec35c9 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 26 Nov 2020 11:54:55 -0700 Subject: [PATCH 17/17] Correciones de clientes --- Ventas/Clientes.aspx | 22 +++++++++++++--------- Ventas/Clientes.aspx.vb | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index 534af4d89..bab59dcf6 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -4223,15 +4223,19 @@
    - - - - - - - + + + + + + + + + + +
    diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index b5e4b733d..afd23bfe7 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -9174,6 +9174,7 @@ Partial Class Clientes UpAcciones.Update() UpUsadosResumen.Update() + UpGvUsadosResumen.Update() UpAcum.Update() End If