From 72b4c47cbed8870a42e8f237fb49dcb8747195c6 Mon Sep 17 00:00:00 2001 From: Hector Javier Rodriguez Flores Date: Fri, 24 Sep 2021 14:21:25 -0700 Subject: [PATCH 1/8] Creacion del modelo clientes aunque CveCliente sea -1 y la asignacion valores para empresaCRM --- App_Code/Modelos.vb | 5 +++++ Ventas/Ventas.aspx.vb | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 7bd11e2fc..31a54c57f 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -6582,6 +6582,8 @@ Namespace Modelos Me.ClienteSucursal.Sucursal = Cliente.Sucursal Me.ClienteSucursal.ImprimeNombreSucursal = Cliente.ImprimeNombreSucursal.ToString() End If + Else + Cliente = New Modelos.ClienteModel() End If End Sub Public Sub SetMoneda() @@ -9791,6 +9793,9 @@ Namespace Modelos Inherits Modelos.EntityModel Protected Overloads Sub SetDefaultValues() CveCliente = -1 + Nombre = "" + RFC = "" + Codigo = "" EnviarFactura = "Si" Estatus = "Activo" NoExt = "" diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 4ec3cd682..8446a5dc6 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -10048,6 +10048,11 @@ Partial Class Ventas 'CLIENTE ObjFactura.CveCliente = CveCliente ObjFactura.SetCliente() + ObjFactura.CveEmpresaCRM = CveEmpresaCRM + If CveCliente = -1 And CveEmpresaCRM > 0 Then + ObjFactura.Cliente.Nombre = LblEmpresaCRM.Text + ObjFactura.Cliente.RFC = LblRFCCRM.Text + End If 'SUCURSAL 'ObjFactura.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero() @@ -13824,7 +13829,7 @@ Partial Class Ventas CreaObjetosVenta(True) - If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then + If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then Alert("Ocurrió un error al procesar los datos para la vista previa. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError) ObjFactura = Nothing Exit Sub From 0eb9ed6245d55e01a1f9b8c12fe5a00ae7f696da Mon Sep 17 00:00:00 2001 From: Hector Javier Rodriguez Flores Date: Sun, 26 Sep 2021 20:44:23 -0700 Subject: [PATCH 2/8] --- App_Code/ClsInventarios.vb | 4 ++ Inventarios/InventarioFisico.aspx.vb | 1 + Inventarios/InventarioFisicoDetalle.aspx.vb | 2 +- Inventarios/RepAnomalias.aspx.vb | 69 +++++++++++++++++++-- 4 files changed, 69 insertions(+), 7 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index c256e98fe..24652914e 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -131,6 +131,8 @@ Public Class ClsInventarios Public Property ResponsableCarga As String Public Property ResponsableRecibio As String Public Property Modulo As String + Public Property ConAplicacion As Boolean + @@ -2306,6 +2308,8 @@ Public Class ClsInventarios FechaI = dr("FechaInicio").ToString FechaF = dr("FechaFin").ToString Estatus = dr("Estatus").ToString + ConAplicacion = Convert.ToBoolean(dr("ConAplicacion").ToString) + Retorno = True End If diff --git a/Inventarios/InventarioFisico.aspx.vb b/Inventarios/InventarioFisico.aspx.vb index 4bab376ac..cffe5140e 100644 --- a/Inventarios/InventarioFisico.aspx.vb +++ b/Inventarios/InventarioFisico.aspx.vb @@ -507,6 +507,7 @@ Partial Class Inventarios_InventarioFisico FechaFin = GvRow.DataKey("FechaFin").ToEntero DdlSubProyecto.SelectedValueExist(GvRow.DataKey("CveSubProyecto").ToEntero) chkUsarApp.Checked = Convert.ToBoolean(GvRow.DataKey("ConAplicacion").ToString) + divUsuarios.Visible = chkUsarApp.Checked CargaGvAlmacen() CargaGvClasificacion() CargaGvProductosServicios() diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index 8070583a5..3f3695a07 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -161,7 +161,7 @@ Partial Class Inventarios_InventarioFisicoDetalle End If str.Clear() - CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length - 1) + CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length) End If If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb index 12a19714f..029b42eb0 100644 --- a/Inventarios/RepAnomalias.aspx.vb +++ b/Inventarios/RepAnomalias.aspx.vb @@ -41,6 +41,24 @@ Partial Class Inventarios_RepAnomalias End Set End Property + Public Property aplicacion As Boolean + Get + Return CType(ViewState("aplicacion"), Boolean) + End Get + Set(value As Boolean) + ViewState("aplicacion") = value + End Set + End Property + + Public Property CreandoNuevoInventario As Boolean + Get + Return CType(ViewState("CreandoNuevoInventario"), Boolean) + End Get + Set(value As Boolean) + ViewState("CreandoNuevoInventario") = value + End Set + End Property + #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load @@ -51,6 +69,7 @@ Partial Class Inventarios_RepAnomalias If CveInventarioFisico > 0 Then CargaDatos(CveInventarioFisico) + CreandoNuevoInventario = False End If End If @@ -72,7 +91,7 @@ Partial Class Inventarios_RepAnomalias lbFechaI.Text = Inventario.FechaI lbFechaF.Text = Inventario.FechaF CveSubProyecto = Inventario.CveSubProyectoInventario - + aplicacion = Inventario.ConAplicacion If Inventario.Estatus = "Finalizado" Then btnFin.Visible = False End If @@ -254,7 +273,7 @@ Partial Class Inventarios_RepAnomalias #End Region - Protected Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvF.RowDataBound, GvS.RowDataBound + Protected Sub GVF_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvF.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("Costo") = "-1" Then e.Row.Cells(8).Text = "0" @@ -264,6 +283,29 @@ Partial Class Inventarios_RepAnomalias End If e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1 End If + If e.Row.RowType = DataControlRowType.Header Then + If CreandoNuevoInventario Then + e.Row.FCCheckBox("ChkAllFaltante").Attributes.Add("onclick", "SeleccionarTodosFaltante(this);") + End If + End If + End Sub + + + Protected Sub GVS_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvS.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("Costo") = "-1" Then + e.Row.Cells(8).Text = "0" + End If + If e.Row.Cells(7).Text = MinFecha.ToString Then + e.Row.Cells(7).Text = "" + End If + e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1 + End If + If e.Row.RowType = DataControlRowType.Header Then + If CreandoNuevoInventario Then + e.Row.FCCheckBox("ChkAllSobrante").Attributes.Add("onclick", "SeleccionarTodosSobrante(this);") + End If + End If End Sub #Region " IMPRIMIR " @@ -353,14 +395,14 @@ Partial Class Inventarios_RepAnomalias GvF.Columns(0).Visible = True LnkGuardar.Visible = True LnkCrear.Visible = False - GvF.HeaderRow.FCCheckBox("ChkAllFaltante").Attributes.Add("onclick", "SeleccionarTodosFaltante(this);") + CreandoNuevoInventario = True End If If GvS.Rows.Count > 0 Then GvS.Columns(0).Visible = True LnkGuardar.Visible = True LnkCrear.Visible = False - GvS.HeaderRow.FCCheckBox("ChkAllSobrante").Attributes.Add("onclick", "SeleccionarTodosSobrante(this);") + CreandoNuevoInventario = True End If UPAnomalias.Update() UpdateGvS.Update() @@ -374,13 +416,15 @@ Partial Class Inventarios_RepAnomalias Dim ErrorClasif As Boolean = False Dim ObjInventario As New ClsInventarios Dim CveInventarioFisicoNew As Integer - Dim DtAlmacen, DtClasificacion, DtClasificacionExcluida, DtProveedor As DataTable + Dim DtAlmacen, DtClasificacion, DtClasificacionExcluida, DtProveedor, DtUsuario As DataTable DtAlmacen = Nothing DtClasificacion = Nothing DtClasificacionExcluida = Nothing DtProveedor = Nothing + DtUsuario = Nothing + ObjInventario.IniciaTransacSQL() - If ObjInventario.AddInventarioFisico(UsuarioActual.CveEmpresa, TxtTitulo.Text, lbObservaciones.Text, 0, CveSubProyecto) Then + If ObjInventario.AddInventarioFisico(UsuarioActual.CveEmpresa, TxtTitulo.Text, lbObservaciones.Text, 0, CveSubProyecto, aplicacion) Then CveInventarioFisicoNew = ObjInventario.CveInventarioFisico If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then @@ -396,6 +440,18 @@ Partial Class Inventarios_RepAnomalias DtProveedor = ObjInventario.DtResultados.FiltraParametros("Incluye = 1") End If + If ObjInventario.GetInventarioFisicoDetallesUsuarios(CveInventarioFisico, UsuarioActual.CveEmpresa) Then + DtUsuario = ObjInventario.DtResultados.FiltraParametros("Incluye = 1") + End If + + + For Each Gvr As DataRow In DtUsuario.Rows + If Not ObjInventario.AddInventarioFisicoUsuarios(CveInventarioFisicoNew, Gvr("CveUsuario").ToString.ToEntero, Convert.ToBoolean(Gvr("Incluye").ToString), Convert.ToBoolean(Gvr("Cerrado").ToString), Convert.ToBoolean(Gvr("Bloqueado").ToString)) Then + ErrorClasif = True + Exit For + End If + Next + For Each Gvr As DataRow In DtAlmacen.Rows If Not ObjInventario.AddInventarioFisicoAlmacenes(CveInventarioFisicoNew, Gvr("CveAlmacen").ToString.ToEntero) Then ErrorClasif = True @@ -455,6 +511,7 @@ Partial Class Inventarios_RepAnomalias GvS.Columns(0).Visible = False LnkGuardar.Visible = False LnkCrear.Visible = True + CreandoNuevoInventario = False CargaDatos(CveInventarioFisico) Else ObjInventario.RollBack() From 8e11ed91c4be8acfd78f2d4b6c7c32a52cb4aec9 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 27 Sep 2021 08:30:31 -0700 Subject: [PATCH 3/8] Contratos --- App_Code/ClsContratos.vb | 63 ++++++- Contratos/ContratoObra.aspx | 25 ++- Contratos/ContratoObra.aspx.vb | 197 +++++++++++++++++++++- Contratos/RepContratosObraAvances.aspx | 2 +- Contratos/RepContratosObraAvances.aspx.vb | 5 +- Ventas/ProductosServicios.aspx.vb | 35 ++-- 6 files changed, 294 insertions(+), 33 deletions(-) diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 54e7cf9ff..13064ce48 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -490,6 +490,30 @@ Public Class ClsContratos End Try Return Retorno + End Function + + 'Usado en conrtatos Obra + Public Function AbrirCerrarContrato(CveContrato As Integer, CveEmpresa As Integer, Cerrar As Boolean, CveUsuario As Integer) As Boolean + + Dim Retorno = False + + DataAdapter("PA_Con_ContratosObraAbrirCerrar") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveContrato", SqlDbType.Int).Value = CveContrato + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Cerrar", SqlDbType.Bit).Value = Cerrar + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al abrir o cerrar el contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function 'Public Function AddContratosTipo1(NumeroContrato As String, DescripcionContrato As String, CveProveedor As Integer, CveCliente As Integer, FechaInicial As DateTime, FechaFinal As DateTime, @@ -550,7 +574,8 @@ 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 = "", Optional LimiteDeGasto As Double = 0) 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, + Optional ImporteSubTotal As Decimal = 0) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Con_ContratosObraAdd") @@ -603,6 +628,7 @@ Public Class ClsContratos .Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev .Add("@Lugar", SqlDbType.VarChar).Value = Lugar .Add("@LimiteDeGasto", SqlDbType.Money).Value = LimiteDeGasto + .Add("@ImporteSubTotal", SqlDbType.Money).Value = ImporteSubTotal .Add("@CveContrato", SqlDbType.Int).Direction = ParameterDirection.Output @@ -629,7 +655,8 @@ 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 = "", Optional LimiteDeGasto As Double = 0) 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, + Optional ImporteSubTotal As Decimal = 0) As Boolean Dim Retorno = False DataAdapter("PA_Con_ContratosObraUpdate") @@ -680,7 +707,8 @@ 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("@LimiteDeGasto", SqlDbType.Money).Value = LimiteDeGasto + .Add("@ImporteSubTotal", SqlDbType.Money).Value = ImporteSubTotal End With @@ -1821,14 +1849,35 @@ Public Class ClsContratos End Try Return Retorno - End Function + End Function + + 'Es usando en ContratoObra para validar la actualizacion de cantidad de avance + Public Function GetContratosDetalleAvance(CveContratoDetalle As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Con_ContratosDetalleAvanceGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el avance de los detalles", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + #End Region - + #Region "S U B - T O T A L E S" - - + + Public Function GetSubTotalesConDetalle(CveEmpresa As Integer) As Boolean Dim Retorno = False diff --git a/Contratos/ContratoObra.aspx b/Contratos/ContratoObra.aspx index e14f9b4a6..fb9be9b1a 100644 --- a/Contratos/ContratoObra.aspx +++ b/Contratos/ContratoObra.aspx @@ -106,6 +106,15 @@ Agregar Maquinaria-Flotilla-Herramienta + +
  • + Abrir Contrato +
  • + +
  • + Cerrar Contrato +
  • + @@ -735,7 +744,7 @@ Descargar - + @@ -803,7 +812,7 @@
    @@ -1085,6 +1094,7 @@ + @@ -1181,7 +1191,8 @@
    +
    @@ -2220,7 +2231,9 @@ - + + +   @@ -2773,7 +2786,9 @@
    - + + +
    diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index 8e7140752..c3735a602 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -389,6 +389,19 @@ Partial Class Contratos_ContratoObra End Property + Property BloquearTodo As Boolean + Get + If ViewState("BloquearTodo") Is Nothing Then + Return False + Else + Return Boolean.Parse(ViewState("BloquearTodo").ToString) + End If + End Get + Set(value As Boolean) + ViewState("BloquearTodo") = value + End Set + End Property + #End Region @@ -483,6 +496,9 @@ Partial Class Contratos_ContratoObra CargaDLLCargaGVCentrosConsto() tabalCentrosdecotso() + + BloquearControles() + End If @@ -626,12 +642,38 @@ Partial Class Contratos_ContratoObra 'DdlProyecto.SelectedValue = "-1" TxtCantidad.Text = "" + RGVControlCantidadVentas.Visible = False TxtPU.Text = "" TmpDT.Clear() CargaGVPresupuestos(TmpDT) CargaGVPresupuestosInsumos(TmpDT) LbTotalGeneral.Text = "0.00" End Sub + + Private Sub BloquearControles() + + If BloquearTodo Then + + + LnkModalAddPSVentas.Visible = False + LnkModalAddPSControl.Visible = False + LnkModalAddPresupuestoVentas.Visible = False + LnkModalAddPresupuestoControl.Visible = False + LnkModalAddGastos.Visible = False + LnkModalAddMaquinariaFlotilla.Visible = False + + BtnDescargar.Enabled = False + A1.Visible = False + + BtnGuardar.Enabled = False + BtnEliminar.Enabled = False + BtnCancelar.Enabled = False + + + End If + + End Sub + #End Region #Region " CONFIGURA TIPOS CONTRATO " @@ -739,6 +781,24 @@ Partial Class Contratos_ContratoObra DdlCliente.SelectedValue = ObjContratos.CveCliente.ToString DdlCliente.SelectedText = ObjContratos.NombreComercial.ToString + + + LnkAbrirContrato.Visible = False + LnkCerrarContrato.Visible = False + + If UsuarioActual.TienePermisoProceso(330) Then + + If ObjContratos.TipoEstatus = 1 Then + LnkCerrarContrato.Visible = True + Else + LnkAbrirContrato.Visible = True + BloquearTodo = True + End If + + End If + + + If ObjContratos.CveProveedor > 0 Then ' TrProveedor.Visible = True TrCliente.Visible = False @@ -873,6 +933,11 @@ Partial Class Contratos_ContratoObra Alert("El Contrato Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) BtnGuardar.Enabled = False End If + + + + + Else CveContrato = -1 Alert("Ocurrió un error al cargar el Contrato. Por favor vuelva a intentar.", TipoMensaje.MsgError) @@ -1000,10 +1065,14 @@ Partial Class Contratos_ContratoObra TipoContrato = DdlTipoContratoObra.SelectedValue.ToEntero 'Crear Contrato + Dim ImporteSubTotal As Decimal = TmpDT.SUM("Total", " CveContratoDetalle > 0 AND CveTipoPresupuesto=2 ").ToDecimal If Not CveContrato > 0 Then Dim EstatusContrato As Integer = 1 + + + CveContrato = ObjContratos.AddContratosObra(TxtNumeroContrato.Text, TxtDescripcionContrato.Text, TxtNumeroLicitacion.Text.Trim, DdlContratista.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, -1, TxtFechaInicial.Text.ToDate, TxtFechaFinal.Text.ToDate, TxtUbicacion.Text, TxtResponsable.Text, DdlProyecto.SelectedValue.ToEntero, TxtPorIVA.Text.ToDouble, TxtPorAnticipo.Text.ToDouble, TxtPorAmortizacionAnticipo.Text.ToDouble, TxtPorGarantia.Text.ToDouble, "." & Session("FileExtension").ToString, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, Minimo, Maximo, Total, @@ -1011,7 +1080,7 @@ Partial Class Contratos_ContratoObra TxtTipoCambio.Text.ToDouble, CveSucursalCliente:=DdlSucursalCliente.SelectedValue.ToEntero, CveAlmacenOrigen:=-1, CveAlmacenDestino:=-1, PorcentajeComision:=0, TipoGarantia:=-1, Folio:=0, FechaVenc:=Nothing, EstatusFianza:=1, CvePeriodo:=-1, CveCuentaEquipo:=-1, CveContratoPlantilla:=-1, CveVendedor:=-1, - Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=-1, AplicaImpuestosLocales:=False, CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), Lugar:=TxtLugar.Text.Trim, LimiteDeGasto:=TxtLimiteGastos.Text.ToDouble) + Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=-1, AplicaImpuestosLocales:=False, CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), Lugar:=TxtLugar.Text.Trim, LimiteDeGasto:=TxtLimiteGastos.Text.ToDouble, ImporteSubTotal:=ImporteSubTotal) TieneError = Not GuardaFianzas(ObjContratos) @@ -1074,7 +1143,7 @@ Partial Class Contratos_ContratoObra CveAlmacenOrigen:=-1, CveAlmacenDestino:=-1, PorcentajeComision:=0, TipoGarantia:=-1, Folio:=-1, FechaVenc:=Nothing, EstatusFianza:=-1, CveContratoPlantilla:=-1, CveCuentaEquipo:=-1, CveVendedor:=-1, Observaciones:=TxtObservaciones.Text, CveDireccionEnvio:=-1, AplicaImpuestosLocales:=False, - CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), Lugar:=TxtLugar.Text.Trim, LimiteDeGasto:=TxtLimiteGastos.Text.ToDouble) Then + CorreoNotificacionPedDev:=TxtCorreoNotificacion.Text.Trim(), Lugar:=TxtLugar.Text.Trim, LimiteDeGasto:=TxtLimiteGastos.Text.ToDouble, ImporteSubTotal:=ImporteSubTotal) Then TieneError = Not GuardaFianzas(ObjContratos) @@ -1698,6 +1767,21 @@ Partial Class Contratos_ContratoObra End If + + If e.Row.RowType = DataControlRowType.DataRow Then + + If BloquearTodo Then + e.Row.FCLinkButton("LnkEditarPresupuestoVentaDetalle").Visible = False + e.Row.FCLinkButton("imgD").Visible = False + End If + + If e.Row.DataKey("CveContratoDetalle").ToEntero <= 0 Then + e.Row.FCLinkButton("LnkEditarPresupuestoVentaDetalle").Visible = False + e.Row.FCLinkButton("imgD").Visible = False + End If + + End If + If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlUMEdit").DataBind() @@ -2078,6 +2162,23 @@ Partial Class Contratos_ContratoObra e.Row.FCDropDownList("DdlUMEdit").SelectedValue = e.Row.DataKey("CveUM") End If + + If e.Row.RowType = DataControlRowType.DataRow Then + If BloquearTodo Then + e.Row.FCLinkButton("LnkEditarPresupuestoControlDetalle").Visible = False + e.Row.FCLinkButton("imgD").Visible = False + End If + + + If e.Row.DataKey("CveContratoDetalle").ToEntero <= 0 Then + + e.Row.FCLinkButton("LnkEditarPresupuestoControlDetalle").Visible = False + e.Row.FCLinkButton("imgD").Visible = False + + End If + + End If + End Sub Protected Sub GVInsumos_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvInsumos.RowEditing GvInsumos.EditIndex = e.NewEditIndex @@ -2726,8 +2827,8 @@ Partial Class Contratos_ContratoObra End Sub Protected Sub GvContratoGastos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvContratosGastos.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("CveContrato").ToString.ToEntero = 0 Or e.Row.DBCampo("CveVenta").ToString.ToEntero > 0 Then If e.Row.DBCampo("CveContrato").ToString.ToEntero = 0 Then e.Row.CssClass = "SubTotales" : e.Row.Cells(0).Text = e.Row.DBCampo("Cantidad").FormatoNumero(0) e.Row.FCLinkButton("imgE").Visible = False @@ -2738,6 +2839,16 @@ Partial Class Contratos_ContratoObra ScriptManager.GetCurrent(Me).RegisterAsyncPostBackControl(lb) End If End If + + + If e.Row.RowType = DataControlRowType.DataRow Then + If BloquearTodo Then + e.Row.FCLinkButton("imgU").Visible = False + e.Row.FCLinkButton("imgE").Visible = False + e.Row.FCLinkButton("imgD").Visible = False + End If + End If + End Sub Protected Sub GvContratoGastos_RowDeleting(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Handles GvContratosGastos.RowDeleting @@ -3185,6 +3296,15 @@ Partial Class Contratos_ContratoObra End If End If + + + If e.Row.RowType = DataControlRowType.DataRow Then + If BloquearTodo Then + e.Row.FCLinkButton("LinkEliminarBitacora").Visible = False + End If + End If + + End Sub Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click @@ -4181,12 +4301,38 @@ Partial Class Contratos_ContratoObra + Dim CantidadMinimo As Integer = 0 + Dim ObjContrtato As New ClsContratos + + If ObjContrtato.GetContratosDetalleAvance(CveContratoDetalleEditar) Then + CantidadMinimo = ObjContrtato.DtResultados.Rows(0)(0).ToString.ToEntero + + + If CantidadMinimo = 0 Then + RGVControlCantidadVentas.Visible = False + Else + RGVControlCantidadVentas.Visible = True + RGVControlCantidadVentas.MinimumValue = CantidadMinimo.ToString + End If + + + End If + + + ObjContrtato.Dispose() + + + ModalVentasPSAdd = False ChkContinualAgregandoVentas.Visible = False ChkContinualAgregandoVentas.Checked = False + UpModalVentasAddPS.Update() RegistraScript("$('#ModalVentasAddPS').modal('show')") + + + End Sub Protected Sub LnkEditarPresupuestoControlDetalle_Click(sender As Object, e As EventArgs) @@ -4276,6 +4422,7 @@ Partial Class Contratos_ContratoObra 'TxtOCInterna.Text = "" TxtCantidad.Text = "" + RGVControlCantidadVentas.Visible = False 'ChkLimitarVenta.Checked = False 'TxtNoIdentificacionv.Text = "" DdlClasificacionAdd.SelectedValueExist(-1) @@ -5088,7 +5235,6 @@ Partial Class Contratos_ContratoObra Private Sub GvGastosVeiculos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvGastosVeiculos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DataKey("ORDEN").ToEntero = 1 Then e.Row.CssClass = "Totales" e.Row.Cells(1).Text = "Total" @@ -5097,8 +5243,16 @@ Partial Class Contratos_ContratoObra End If - End If + + + + If e.Row.RowType = DataControlRowType.DataRow Then + If BloquearTodo Then + e.Row.FCLinkButton("LnkEliminarGasto").Visible = False + End If + End If + End Sub @@ -5433,6 +5587,39 @@ Partial Class Contratos_ContratoObra AddtabalCentrosdecotso(DdlCentroCostos.SelectedValue.ToEntero, DdlCentroCostos.SelectedItem.Text, TxtCentroCostosPorcentaje.Text.ToDecimal) End Sub + Protected Sub LnkAbrirContrato_Click(sender As Object, e As EventArgs) + AbrirCerrarContrto(False) + End Sub + Protected Sub LnkCerrarContrato_Click(sender As Object, e As EventArgs) + AbrirCerrarContrto(True) + End Sub + + + Private Sub AbrirCerrarContrto(Cerrar As Boolean) + + + Dim ObjConrtato As New ClsContratos + + If ObjConrtato.AbrirCerrarContrato(CveContrato, UsuarioActual.CveEmpresa, Cerrar, UsuarioActual.CveUsuario) Then + Alert($"Contrato { If(Cerrar, "Cerrado", "Abierto")} Correctamente", TipoMensaje.MsgInformacion, $"window.location.href=""./ContratoObra.aspx?CveContrato={CveContrato}"";") + End If + + + End Sub + + Private Sub GvInt_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvInt.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + If BloquearTodo Then + + 'e.Row.FCLinkButton("LinkButton1").Enabled = False + 'e.Row.FCLinkButton("LinkButton2").Enabled = False + e.Row.FCLinkButton("LinkButton3").Visible = False + e.Row.FCLinkButton("LinkButton4").Visible = False + + End If + End If + End Sub End Class diff --git a/Contratos/RepContratosObraAvances.aspx b/Contratos/RepContratosObraAvances.aspx index dc16ca9f5..13488ad15 100644 --- a/Contratos/RepContratosObraAvances.aspx +++ b/Contratos/RepContratosObraAvances.aspx @@ -309,7 +309,7 @@ - + diff --git a/Contratos/RepContratosObraAvances.aspx.vb b/Contratos/RepContratosObraAvances.aspx.vb index 1ee3aa59b..e3e4fc141 100644 --- a/Contratos/RepContratosObraAvances.aspx.vb +++ b/Contratos/RepContratosObraAvances.aspx.vb @@ -47,7 +47,10 @@ Partial Class RepContratosObraAvances Dim NumeroContratos As Integer = DTDatos.Rows.Count - Dim TotalContratos As Decimal = DTDatos.SUM("Importe") + 'Dim TotalContratos As Decimal = DTDatos.SUM("Importe") + Dim TotalContratos As Decimal = DTDatos.SUM("ImporteSubTotal") + + Dim TotalAvance As Decimal = DTDatos.SUM("AvanceImporte") Dim TotalFaltante As Decimal = TotalContratos - TotalAvance diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 7118644ca..61da68735 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -2187,20 +2187,27 @@ Partial Class ProductosyServicios ' CargaClasificacionesDetalles() End If - Try - Dim Dr = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0) - If Boolean.Parse(Dr("EsAcumulador").ToString) Then - MostarOcultarDivTamanio(True) - Else - MostarOcultarDivTamanio(False) - End If - 'SI ES MOTOBATERIA - If DdlClasificacion.SelectedValue = "20517" Then - MostarOcultarDivTamanio(True) - End If - Catch ex As Exception - OnError("Ocurrió un error al mostrar los tamaños", ex) - End Try + + If DdlClasificacion.SelectedValue.ToEntero > 0 Then + Try + Dim Dr = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue.ToEntero()))(0) + If Boolean.Parse(Dr("EsAcumulador").ToString) Then + MostarOcultarDivTamanio(True) + Else + MostarOcultarDivTamanio(False) + End If + 'SI ES MOTOBATERIA + If DdlClasificacion.SelectedValue = "20517" Then + MostarOcultarDivTamanio(True) + End If + Catch ex As Exception + OnError("Ocurrió un error al mostrar los tamaños", ex) + End Try + End If + + + + End Sub Private Sub MostarOcultarDivTamanio(Mostrar As Boolean) From fe398bff979b11d6286c0e4470fcd85fa2eaf557 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 27 Sep 2021 08:41:25 -0700 Subject: [PATCH 4/8] Factura se agrego numero de portillo --- Empresas/141/Formatos/Factura.rdlc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Empresas/141/Formatos/Factura.rdlc b/Empresas/141/Formatos/Factura.rdlc index 733c5c817..fc1c7ac96 100644 --- a/Empresas/141/Formatos/Factura.rdlc +++ b/Empresas/141/Formatos/Factura.rdlc @@ -1,5 +1,5 @@ - + 0 @@ -2233,7 +2233,7 @@ - 715-5004 + 715-5004 - Portillo (662) 6885349 - 715-5004 - Portillo (662) 6885349 + 715-5004 - Portillo (662) 688-5349 + + + Portillo (662) 688-5349 + + + + - Quiroga (662) 261- 0838 - Caborca (637) 3724214 - - - - - - - - Tecate (665) 5212080 - Ensenada (646) 172-4075 - Ensenada2 (646) 176-2703 - Baja California Sur: La Paz (612) 146-3656 - La Paz 2 (612) 121-3185 - Los Cabos (624) 688 3552 + Sanalona (667) 713-667 - Tres Ríos (667) 455-4621 - Mazatlán (669) 910-2122 - Baja California: Tijuana1 (664) 622-5221 - Tijuana3 (664) 626-2615 - Rosarito (661) 612-4461 - Mexicali (686) 567-6102 Mexicali3 (686) 326 02 79 - Tecate (665) 5212080 - Ensenada (646) 172-4075 - Ensenada2 (646) 176-2703 - Baja California Sur: La Paz (612) 146-3656 - La Paz 2 (612) 121-3185 - Los Cabos (624) 688 3552 - 715-5004 - Portillo (662) 688-5349 + 715-5004 - - - -