diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 825a06a64..0fe3e20d1 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -2206,7 +2206,7 @@ Public Class ClsCompras Return Retorno End Function - Public Function UpdateEstatusAlmacenDetalle(CveCompraDetalle As Integer, ValorEstatus As Integer, CveUsuario As Integer) As Boolean + Public Function UpdateEstatusAlmacenDetalle(CveCompraDetalle As Integer, ValorEstatus As Integer, CveUsuario As Integer, Optional CantidadDevolucion As Decimal = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ComprasDetalleEstatusAlmacenUpdate") @@ -2214,6 +2214,7 @@ Public Class ClsCompras .Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle .Add("@Estatus", SqlDbType.Int).Value = ValorEstatus .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CantidadDevolucion", SqlDbType.Decimal).Value = CantidadDevolucion End With Try diff --git a/App_Code/ClsContratos.vb b/App_Code/ClsContratos.vb index 2f6dc4b60..e7b9a2971 100644 --- a/App_Code/ClsContratos.vb +++ b/App_Code/ClsContratos.vb @@ -1007,14 +1007,16 @@ Public Class ClsContratos End Try Return Retorno - End Function - - - + End Function + + + #End Region - + #Region "CONTRATOS DETALLE" - Public Function AddContratosDetalle(CveContrato As Integer, CvePS As Integer, Cantidad As Double, PU As Double, CveUsuario As Integer, CveTipoPresupuesto As Integer, NoIdentificacion As String, LimitarCantidad As Boolean, OCInterna As String, Optional Observacion As String = "") As Boolean + + Public Function AddContratosDetalle(CveContrato As Integer, CvePS As Integer, Cantidad As Double, PU As Double, CveUsuario As Integer, CveTipoPresupuesto As Integer, NoIdentificacion As String, LimitarCantidad As Boolean, OCInterna As String, + Optional Observacion As String = "", Optional CveRubro As Integer = -1, Optional CveActividad As Integer = -1, Optional CveSubTipoActivoFijo As Integer = -1, Optional Dias As Integer = -1) As Boolean Dim Retorno = False DataAdapter("PA_Con_ContratosDetalleAdd") @@ -1029,6 +1031,10 @@ Public Class ClsContratos .Add("@OCInterna", SqlDbType.VarChar).Value = OCInterna .Add("@LimitarCantidad", SqlDbType.Bit).Value = If(LimitarCantidad, 1, 0) .Add("@Observacion", SqlDbType.VarChar).Value = Observacion + .Add("@CveRubro", SqlDbType.Int).Value = CveRubro + .Add("@CveActividad", SqlDbType.Int).Value = CveActividad + .Add("@CveSubTipoActivoFijo", SqlDbType.Int).Value = CveSubTipoActivoFijo + .Add("@Dias", SqlDbType.Int).Value = Dias 'NoIdentificacion End With @@ -1044,7 +1050,8 @@ Public Class ClsContratos End Function - Public Function UpdateContratosDetalle(CveContratoDetalle As Integer, CveContrato As Integer, CvePS As Integer, Cantidad As Double, PU As Double, CveUsuario As Integer, NoIdentificacion As String, LimitarCantidad As Boolean, OCInterna As String, Optional Observacion As String = "") As Boolean + Public Function UpdateContratosDetalle(CveContratoDetalle As Integer, CveContrato As Integer, CvePS As Integer, Cantidad As Double, PU As Double, CveUsuario As Integer, NoIdentificacion As String, LimitarCantidad As Boolean, OCInterna As String, + Optional Observacion As String = "", Optional CveRubro As Integer = -1, Optional CveActividad As Integer = -1, Optional CveSubTipoActivoFijo As Integer = -1, Optional Dias As Integer = -1) As Boolean Dim Retorno = False DataAdapter("PA_Con_ContratosDetalleUpdate") @@ -1058,7 +1065,11 @@ Public Class ClsContratos .Add("@NoIdentificacion", SqlDbType.VarChar).Value = NoIdentificacion .Add("@OCInterna", SqlDbType.VarChar).Value = OCInterna .Add("@LimitarCantidad", SqlDbType.Bit).Value = If(LimitarCantidad, 1, 0) - .Add("@Observacion", SqlDbType.VarChar).Value = Observacion + .Add("@Observacion", SqlDbType.VarChar).Value = Observacion + .Add("@CveRubro", SqlDbType.Int).Value = CveRubro + .Add("@CveActividad", SqlDbType.Int).Value = CveActividad + .Add("@CveSubTipoActivoFijo", SqlDbType.Int).Value = CveSubTipoActivoFijo + .Add("@Dias", SqlDbType.Int).Value = Dias End With diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index de61d09e9..b89221914 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1309,8 +1309,14 @@ Public Class ClsInventarios Retorno = True End If Catch Ex1 As SqlException + If Ex1.Message.Contains("50019") Then Me.OnError(" El producto no tiene existencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + + ElseIf Ex1.Message.Contains("CK_Inv_MovimientosDetalle_MetodoInventario") Then + + Me.OnError("El movimiento debe de tener una Serie.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Else If Ex1.Message.Contains("50021") Then Me.OnError(" El producto ingresado previamente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) @@ -1437,7 +1443,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetMovimientosTransitorios(CveAlmacenDestino As Integer, CveTipoAlmacenDestino As Integer, CveAlmacenTransitorio As Integer, CveUsuarioResponsable As Integer, Folio As Integer, CveEmpresa As Integer) As Boolean + Public Function GetMovimientosTransitorios(CveAlmacenDestino As Integer, CveTipoAlmacenDestino As Integer, CveAlmacenTransitorio As Integer, CveUsuarioResponsable As Integer, Folio As Integer, CveEmpresa As Integer, CveUsuario As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_MovimientosTransitoriosGet") @@ -1448,6 +1454,7 @@ Public Class ClsInventarios .Add("@Folio", SqlDbType.Int).Value = Folio .Add("@CveUsuarioResponsable", SqlDbType.Int).Value = CveUsuarioResponsable .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With Try SqlAdapter.Fill(Data) @@ -1868,7 +1875,7 @@ Public Class ClsInventarios Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha, Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, - Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1) As Decimal + Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1, Optional ExcluyeTransitorios As Integer = -1) As Decimal Dim Retorno As Decimal = -1 If FechaMovto = "-1" Then @@ -1893,6 +1900,7 @@ Public Class ClsInventarios .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados + .Add("@ExcluyeTransitorios", SqlDbType.Int).Value = ExcluyeTransitorios .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes .Add("@Existencia", SqlDbType.Money).Direction = ParameterDirection.Output @@ -1920,7 +1928,7 @@ Public Class ClsInventarios Optional FechaMovto As String = "-1", Optional CveVendedor As Integer = -1, Optional CveCliente As Integer = -1, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional Caducidad As Date = MinFecha, Optional ExcluyeAdelantado As Integer = -1, Optional PendientePorSurtir As Integer = -1, - Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean + Optional ExcluyeApartados As Integer = 1, Optional RestringirAlmacenes As Integer = -1, Optional ExcluyeTransitorios As Integer = -1, Optional TopSelect As Integer = 10000) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_ExistenciasGet") @@ -1941,6 +1949,7 @@ Public Class ClsInventarios .Add("@ExcluyeAdelantado", SqlDbType.Int).Value = ExcluyeAdelantado .Add("@PendientePorSurtir", SqlDbType.Int).Value = PendientePorSurtir .Add("@ExcluyeApartados", SqlDbType.Int).Value = ExcluyeApartados + .Add("@ExcluyeTransitorios", SqlDbType.Int).Value = ExcluyeTransitorios .Add("@RestringirAlmacenes", SqlDbType.Int).Value = RestringirAlmacenes .Add("@TopSelect", SqlDbType.Int).Value = TopSelect diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 850cbb1c6..be81c310e 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -634,6 +634,8 @@ Public Class ClsPaginas Application("GlobalDTEmpresas") = value End Set End Property + + Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa) @@ -664,6 +666,41 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property + + + + + Property GlobalDTRHActividades(CveEmpresa As Integer) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTRHActividades-{0}", CveEmpresa) + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + + Dim ObjRH As New ClsRH + If ObjRH.GetActividades(CveEmpresa) Then Application(AppNombre) = ObjRH.DtResultados + ObjRH.Dispose() + + End If + + If CveEmpresa <> -1 Then + Dim Str As New StringBuilder + Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + GlobalDTRHActividades = Dv.ToTable + Dv.Dispose() + Else + GlobalDTRHActividades = DirectCast(Application(AppNombre), DataTable) + End If + + + + End Get + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTRHActividades-{0}", CveEmpresa) + Application(AppNombre) = value + End Set + End Property + Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTClasificaciones2-{0}", CveEmpresa) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index de7538cf9..9d5bfabce 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1359,6 +1359,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo Public Property CveUniforme As Integer + Public Property CveActividad As Integer + Public ReadOnly Property DtResultados() As DataTable Get @@ -6865,21 +6867,65 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo OnError("Ocurrió un error al eliminar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function + End Function #End Region + +#Region " A C T I V I D A D E S" + + + Public Function GetActividades(CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_RH_ActividadesGet") + 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 el listado de actividades ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + + Public Function AddActividades(Actividad As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + CveActividad = -1 + Dim Retorno As Boolean = False + DataAdapter("PA_RH_ActividadesAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@Actividad", SqlDbType.VarChar).Value = Actividad + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveActividad", SqlDbType.Int).Direction = ParameterDirection.Output + End With + Try + SqlAdapter.Fill(Data) - 'Public msgsError As New StringBuilder() - 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") - ' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) - ' msgsError.AppendLine(Mensaje) - ' msgsError.Append("
") - ' 'Alert(Obj, Mensaje, TipoMensaje.MsgError) - ' 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) - 'End Sub - + CveActividad = SqlAdapter.SelectCommand.Parameters("@CveActividad").Value.ToString.ToEntero + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el listado de ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return Retorno + End Function + + +#End Region + + + 'Public msgsError As New StringBuilder() + 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") + ' GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) + ' msgsError.AppendLine(Mensaje) + ' msgsError.Append("
") + ' 'Alert(Obj, Mensaje, TipoMensaje.MsgError) + ' 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) + 'End Sub + #Region " IDisposable Support " - ' IDisposable + ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) 'If msgsError.ToString().Length > 0 Then ' Alert(msgsError.ToString(), TipoMensaje.MsgError) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 2a0131d71..9c2df14e1 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2886,7 +2886,7 @@ Namespace Modelos Next - DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto"}) + DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA"}) If DT.Rows.Count > 0 Then 'Se agrega movimiento separado por la cuenta de ventas (ER) @@ -2919,7 +2919,7 @@ Namespace Modelos ' CveCuentaContabilizacion = 0 'End If - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveCuenta:=CveCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, PorcentajeImpuesto:=Row2("PorcentajeIVA").ToString().ToDecimal) Then ErrorPrepoliza = True Else ObjFactura.SeGuardoPrePoliza = True @@ -2961,7 +2961,7 @@ Namespace Modelos End If - DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto"}) + DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto", "PorcentajeIVA"}) If DT.Rows.Count > 0 Then 'Se agrega movimiento separado por la cuenta de ventas (ER) @@ -3006,7 +3006,7 @@ Namespace Modelos ' CveCuentaContabilizacion = 0 'End If - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, CveCuenta:=CveCuenta) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContableAplicar, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=CveVentaAplicar, CveVentaAmortizacion:=CveVentaAmortizacionAplicar, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), TipoCambio:=tipoCambio, PorcentajeImpuesto:=Row2("PorcentajeIVA").ToString().ToDecimal) Then ErrorPrepoliza = True Else ObjFactura.SeGuardoPrePoliza = True diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index d8325a81b..c16a3ca10 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -446,7 +446,7 @@ Partial Class Bancos_ProveedoresAbonar HlSaldarCuentasSinPagar.Visible = True End If - If UsuarioActual.CveEmpresa = 119 And CveUsuarioProgramo <> -1 Then + If UsuarioActual.CveEmpresa.Contiene(119, 158) And CveUsuarioProgramo <> -1 Then LnkPDFSolicitud.Visible = True LnkExcelSolicitud.Visible = True End If @@ -942,6 +942,9 @@ Partial Class Bancos_ProveedoresAbonar Dim TipoCambioGeneral As Decimal = 0 Dim tipoCambioCompraValuacion As Decimal = 1 + Dim UsaComplementariaBancos As Boolean = If(UsuarioActual.CveEmpresa.Contiene(119, 158), True, False) + Dim UsaComplementariaProveedores As Boolean = If(UsuarioActual.CveEmpresa.Contiene(119, 158), True, False) + Dim FuncionalidadFluctuacionImpuestos As Boolean = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", True, False) Dim TipoCambioFluctuacion As Decimal = 1 @@ -1046,7 +1049,7 @@ Partial Class Bancos_ProveedoresAbonar ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}" IdCtaContable = IdCtaContComplementaria CveCuenta = CveCuentaProveedorExtranjera - If ImporteMovimiento <> 0 AndAlso (UsuarioActual.CveEmpresa = 119 Or IdCtaContable > 0) Then 'Cuando tiene complementaria lo dividimos en dos + If ImporteMovimiento <> 0 AndAlso (UsaComplementariaProveedores Or IdCtaContable > 0) Then 'Cuando tiene complementaria lo dividimos en dos importeMX = ImporteMovimiento If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0.00D, Referencia, CveConceptoComplementaria, ConceptoMovimiento, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedor, ImporteMX:=Math.Round(ImporteMovimiento * tipoCambioCompraValuacion - ImporteMovimiento, 2, MidpointRounding.AwayFromZero), ImporteME:=ImporteMovimiento, TipoCambio:=tipoCambioCompraValuacion, CveCuenta:=CveCuentaComplementaria) Then MsgError = "No se pudo insertar la póliza" @@ -2034,7 +2037,7 @@ Partial Class Bancos_ProveedoresAbonar If (Not DivTarjeta.Visible Or DdlTarjeta.SelectedValue.ToEntero = -1) Then If TipoCambioPago > 1 AndAlso CveMoneda = 2 Then - If UsuarioActual.CveEmpresa = 119 Or (CveCuentaBancariaComplementaria > 0 OrElse IdCuentaBancariaComplementaria > 0) Then + If UsaComplementariaBancos Or (CveCuentaBancariaComplementaria > 0 OrElse IdCuentaBancariaComplementaria > 0) Then If CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES TipoCambioPago = TxtTCDolares.Text.ToDecimal ElseIf CveMoneda = 2 AndAlso CveMonedaFiltro = 2 Then @@ -3121,6 +3124,7 @@ Partial Class Bancos_ProveedoresAbonar Dim CveMoneda As Integer = gr.DataKey("CveMoneda").ToEntero Dim FechaCompra As Date = gr.DataKey("Fecha").ToDate Dim CveSubProyecto As Integer = gr.DataKey("CveSubProyecto").ToEntero + Dim UsaComplementariaProveedores As Boolean = If(UsuarioActual.CveEmpresa.Contiene(119, 158), True, False) Dim CveConceptoContablePago As Integer = 17 If gr.DataKey("CveTipoConcepto").ToEntero = 2 Then CveConceptoContablePago = 308 'cuando es acreedor @@ -3141,7 +3145,7 @@ Partial Class Bancos_ProveedoresAbonar CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ProveedoresAbonar/Saldar", 98, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, TxtFechaIncobrable.Text.ToDate, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) - If CveMoneda > 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then + If CveMoneda > 1 AndAlso (IdCtaContComplementaria > 0 Or UsaComplementariaProveedores) Then IdCtaContable = IdCtaContComplementaria CveCuenta = CveCuentaProveedorExtranjera If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, 0.00D, gr.DataKey("SerieFolio").ToString, CveConceptoContableComplementaria, ConceptoPartida, Now, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Round(Saldo * TCCompra - Saldo, 2, MidpointRounding.AwayFromZero), ImporteME:=Saldo, TipoCambio:=TCCompra, CveCuenta:=CveCuentaComplementaria) Then diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 2a8f5fe6a..af6b2a37b 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1314,7 +1314,7 @@ Partial Class Compras_Compras Dim ObjPersonal As New ClsRH ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) DdlPersonal.DataSource = ObjPersonal.DtResultados - DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados + DdlPersonalReembolso.DataSource = ObjPersonal.DtResultados.FiltraParametros("CveEstatusPersonal = 1") ObjPersonal.Dispose() DdlPersonal.DataBind() DdlPersonalReembolso.DataBind() @@ -4604,19 +4604,18 @@ Partial Class Compras_Compras CveEstatusFactura = 6 End If 'hay amortización directa como descuento. RMF Temporal - If UsuarioActual.CveEmpresa = 119 Then - 'If LblAmortizacion.Text.ToDouble > 0 AndAlso TxtDescuento.Text.ToDouble = 0 Then - ' TxtDescuento.Text = LblAmortizacion.Text - ' LblAmortizacion.Text = "0.00" - 'End If - 'o si el descuento es igual a la amortizacion - 'If LblAmortizacion.Text.ToDouble = TxtDescuento.Text.ToDouble Then - ' TxtDescuento.Text = LblAmortizacion.Text - ' LblAmortizacion.Text = "0.00" - 'End If + 'If LblAmortizacion.Text.ToDouble > 0 AndAlso TxtDescuento.Text.ToDouble = 0 Then + ' TxtDescuento.Text = LblAmortizacion.Text + ' LblAmortizacion.Text = "0.00" + 'End If + + 'o si el descuento es igual a la amortizacion + 'If LblAmortizacion.Text.ToDouble = TxtDescuento.Text.ToDouble Then + ' TxtDescuento.Text = LblAmortizacion.Text + ' LblAmortizacion.Text = "0.00" + 'End If - End If 'si el registro es manual, toma el mismo dato If CveFactura <= 0 Then TotalOriginal = TxtTotal.Text.ToDecimal @@ -5030,7 +5029,7 @@ Partial Class Compras_Compras Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" - If UsuarioActual.CveEmpresa = 119 AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0 Or DdlTipoComprobante.SelectedValue = "Ant") Then + If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0 Or DdlTipoComprobante.SelectedValue = "Ant") Then AutoConta = False End If @@ -6897,7 +6896,7 @@ Partial Class Compras_Compras If Not RegistroCuentaPuente AndAlso Not ChkNCInvNC.Checked Then 'GASTO - If UsuarioActual.CveEmpresa = 119 Then + If UsuarioActual.CveEmpresa.Contiene(119, 158) Then DT = TmpDT Else DT = TmpDT.FiltraParametros("ISNULL(AplicaCostoIndirecto,0) <> 1") @@ -7034,6 +7033,7 @@ Partial Class Compras_Compras End If Case 5 'Proveedores If CveTipoConcepto = 2 Then ConceptoContable = 305 'cuando es acreedor + Dim UsaComplementaria As Boolean = UsuarioActual.CveEmpresa.Contiene(119, 158) If tipoCambioActual <> 1 Then Select Case ConceptoContable Case 5 @@ -7059,7 +7059,7 @@ Partial Class Compras_Compras Else IdCtaContable = CtaProveedorComplementaria CveCuenta = CveCuentaProveedorComplementaria - If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or CveCuenta > 0 Or UsuarioActual.CveEmpresa = 119) Then 'Cuando tiene complementaria lo dividimos en dos Then + If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or CveCuenta > 0 OrElse UsaComplementaria) Then 'Cuando tiene complementaria lo dividimos en dos Then importeMN = importeMovimiento If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, CveConceptoContableComplementaria, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * tipoCambioActual - importeMovimiento, ImporteME:=importeMovimiento, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True @@ -15228,7 +15228,7 @@ Partial Class Compras_Compras 'SI PUEDE RECIBIR POR OC Y COMPRA ' si usa almacen, si tiene activado que reciba por OC, y que si la compra tipo Proveedor. que lo muestre - If UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then + If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then DivOCVinculaInv.Visible = True End If @@ -15270,7 +15270,7 @@ Partial Class Compras_Compras 'PROMOCIONES LtOCPromocion.Text = StrPromos.ToString - If LtOCPromocion.Text.Length > 0 And UsuarioActual.CveEmpresa = 119 Then + If LtOCPromocion.Text.Length > 0 And UsuarioActual.CveEmpresa.Contiene(119, 158) Then DivOCPromocion.Visible = True End If @@ -15544,12 +15544,6 @@ Partial Class Compras_Compras 'If DdlOCVinculaInv.SelectedValue.ToEntero = 237 And Not CveFlete > 0 Then Alert("Necesita vincular un flete si selecciona Factura de Flete", TipoMensaje.MsgAdvertencia) : Exit Sub 'If DdlOCVinculaInv.SelectedValue.ToEntero = 240 And Not CveImportacion > 0 Then Alert("Necesita vincular una Importación si selecciona Factura de Importación", TipoMensaje.MsgAdvertencia) : Exit Sub - 'If UsuarioActual.CveEmpresa = 119 And DdlTipoComprobante.SelectedValue = "Fac" Then - ' If Not VerificarProductosCompraConOC() Then - ' Exit Sub - ' End If - 'End If - Dim SubTotalGV = 0.0D Dim Amortizacion As Decimal = TmpDT.SUMD("Total") If ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 Then @@ -15612,7 +15606,7 @@ Partial Class Compras_Compras 'SI PUEDE RECIBIR POR OC Y COMPRA - If UsuarioActual.CveEmpresa = 119 AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then + If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso UsuarioActual.Empresa.UsaInventarios And UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 AndAlso CveTipoConcepto = 1 Then If DdlOCVinculaInv.SelectedValue.ToEntero <= 0 Then Alert("El campo Tipo de recepción almacén es necesario. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) @@ -17275,7 +17269,7 @@ Partial Class Compras_Compras LblAmortizacion.Text = "0.00" End If - If UsuarioActual.CveEmpresa = 119 AndAlso TieneAmortizacion Then + If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso TieneAmortizacion Then Amortizacion = LblAmortizacion.Text.Trim.ToDecimal TxtSubTotal.Text = (TxtSubTotal.Text.ToDouble + Amortizacion).ToString End If @@ -18798,9 +18792,9 @@ Partial Class Compras_Compras For Each gvr As GridViewRow In GvSolDev.Rows If gvr.FCTextBox("TxtCant").Text.ToDecimal > 0 Then 'actualiza el estatus del detalle - ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0, UsuarioActual.CveUsuario) + ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 0, UsuarioActual.CveUsuario, CantidadDevolucion:=gvr.FCTextBox("TxtCant").Text.ToDecimal) Else - ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1, UsuarioActual.CveUsuario) + ObjCompras.UpdateEstatusAlmacenDetalle(gvr.DataKey("CveCompraDetalle").ToEntero, 1, UsuarioActual.CveUsuario, CantidadDevolucion:=0) End If Next End If diff --git a/Compras/ProveedoresAuxiliar.aspx.vb b/Compras/ProveedoresAuxiliar.aspx.vb index 529a6887d..41bcfe68c 100644 --- a/Compras/ProveedoresAuxiliar.aspx.vb +++ b/Compras/ProveedoresAuxiliar.aspx.vb @@ -83,7 +83,7 @@ Partial Class Compras_ProveedoresAuxiliar If ObjConta.GetProveedoresAuxiliar(DdlProveeedores.SelectedValue.ToEntero, -1, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, DdlOpcion.SelectedValue.ToEntero, DdlTipoProveedor.SelectedValue.ToEntero, DdlOpcionContabilizable.SelectedValue.ToEntero) Then If DdlOpcion.SelectedValue.ToEntero = 2 Then - GvP.DataSource = ObjConta.DtResultados.FiltraParametros($" IIF(ISNULL(CveConceptoContable,0) = 5 AND Importe >= 0,0,1) = 1 ") + GvP.DataSource = ObjConta.DtResultados '.FiltraParametros($" IIF(ISNULL(CveConceptoContable,0) in (5,311) AND Importe >= 0,0,1) = 1 ") 'excluye las provisiones Else GvP.DataSource = ObjConta.DtResultados End If diff --git a/Compras/RepComprasDetalle.aspx.vb b/Compras/RepComprasDetalle.aspx.vb index e7a5e5439..9e2776116 100644 --- a/Compras/RepComprasDetalle.aspx.vb +++ b/Compras/RepComprasDetalle.aspx.vb @@ -291,7 +291,10 @@ Partial Class Compras_RepComprasDetalle FechaICaptura = If(IsDate(TxtFechaICaptura.Text.Trim()), TxtFechaICaptura.Text.Trim(), "-1") FechaFCaptura = If(IsDate(TxtFechaFCaptura.Text.Trim()), TxtFechaFCaptura.Text.Trim(), "-1") - + Dim AnioMes As String = If(FechaF <> "-1", "-1", IfNull(Request("AnioMes"), "-1").ToString()) + + + If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then TCEspecifico = TxtEspecifico.Text.ToDouble Else @@ -301,7 +304,7 @@ Partial Class Compras_RepComprasDetalle Dim SubProyectos As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString Dim TipoGasto As String = IIf(DdlTipoGasto.GetSelectedValuesM = "", "-1", DdlTipoGasto.GetSelectedValuesM).ToString - If ObjCompras.GetRepComprasDetalle(DdlGrupo.SelectedValue.ToEntero, IfNull(Request("Anio"), Now.Year).ToString.ToEntero, IfNull(Request("Mes"), "-1").ToString.ToEntero, IfNull(Request("AnioMes"), "-1").ToString(), IfNull(Request("Fecha"), "-1").ToString(), + If ObjCompras.GetRepComprasDetalle(DdlGrupo.SelectedValue.ToEntero, IfNull(Request("Anio"), Now.Year).ToString.ToEntero, IfNull(Request("Mes"), "-1").ToString.ToEntero, AnioMes, IfNull(Request("Fecha"), "-1").ToString(), DdlProveedores.SelectedValue.ToEntero, CveMoneda, DdlUsuario.SelectedValue.ToEntero, FechaI, FechaF, DDlUsuarioCaptura.SelectedValue.ToEntero, IfNull(Request("NumeroRemesa"), "-1").ToString.ToEntero, IfNull(Request("CveUsuarioRemesa"), "-1").ToString.ToEntero, FechaICaptura, FechaFCaptura, IfNull(Request("FechaCaptura"), "-1").ToString, SubProyectos, DdlTipoDocto.SelectedValue, UsuarioActual.CveEmpresa, diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx b/Contabilidad2/RepEstadoResultadosHorizontal.aspx index 3b9cb9c02..b30462cd0 100644 --- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx +++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultadosHorizontal.aspx.vb" Inherits="Contabilidad_RepEstadoResultadosHorizontal" %> +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEstadoResultadosHorizontal.aspx.vb" Inherits="Contabilidad_RepEstadoResultadosHorizontal" EnableEventValidation="false" %> @@ -1048,6 +1048,28 @@ + + + + + + + + + + + + + + + + + + + + + + <%-- @@ -1120,6 +1142,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + <%-- @@ -1192,6 +1238,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb b/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb index bb9bbfec4..5a89787b7 100644 --- a/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb +++ b/Contabilidad2/RepEstadoResultadosHorizontal.aspx.vb @@ -1821,7 +1821,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal Row = DtGastosSubProyectoH.NewRow - If DtGastosSubProyectoH.Rows.Count > 0 Then + If DtGastosSubProyectoH.Rows.Count > 1 Then IndexData = 0 diff --git a/Contratos/ContratoObra.aspx b/Contratos/ContratoObra.aspx index 78eed7830..ef3d982e3 100644 --- a/Contratos/ContratoObra.aspx +++ b/Contratos/ContratoObra.aspx @@ -942,7 +942,7 @@
@@ -997,6 +997,13 @@ + + + + + + + @@ -2696,7 +2703,15 @@
- <%--
- - -
--%> - - <%--
- - -
--%> - - -
+
-
+
- - +
-
+
@@ -2744,10 +2746,28 @@
+ + + +
+ + + + + +
+ +
+ + + + +
-
+
+
@@ -2793,10 +2813,14 @@ + + + +
diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index 5d5d25493..f627ea687 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -595,7 +595,20 @@ Partial Class Contratos_ContratoObra TmpDT.Columns.Add("NoIdentificacion", GetType(String)) TmpDT.Columns.Add("LimitarCantidad", GetType(Integer)) TmpDT.Columns.Add("OCInterna", GetType(String)) - TmpDT.Columns.Add("Observacion", GetType(String)) + TmpDT.Columns.Add("Observacion", GetType(String)) + + + TmpDT.Columns.Add("CveRubro", GetType(Integer)) + TmpDT.Columns.Add("CveActividad", GetType(Integer)) + TmpDT.Columns.Add("CveSubTipoActivoFijo", GetType(Integer)) + + TmpDT.Columns.Add("Rubro", GetType(String)) + TmpDT.Columns.Add("Actividad", GetType(String)) + TmpDT.Columns.Add("SubTipoActivoFijo", GetType(String)) + + TmpDT.Columns.Add("Dias", GetType(Integer)) + + End Sub Protected Sub Limpiar() TxtNumeroContrato.Text = "" @@ -1477,10 +1490,14 @@ Partial Class Contratos_ContratoObra Row("LimitarCantidad") = False 'If(ChkLimitarVenta.Checked, 1, 0) Row("Observacion") = "" 'TxtObservacionesDetalles.Text + Row("CveRubro") = 1 + + + Dim ObjContratos As New ClsContratos - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "", Observacion:=Row("Observacion").ToString) Then + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "", Observacion:=Row("Observacion").ToString, CveRubro:=1) Then If Autorizado Then Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) @@ -1535,7 +1552,7 @@ Partial Class Contratos_ContratoObra Dim ObjContratos As New ClsContratos - If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, NoIdentificacion, False, "", Observaciones) Then + If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, NoIdentificacion, False, "", Observaciones, CveRubro:=1) Then If Autorizado Then Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}", @@ -1796,25 +1813,59 @@ Partial Class Contratos_ContratoObra Dim Row As DataRow = TmpDT.NewRow() Row("Cantidad") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero Row("CantidadContratada") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero - Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero - Row("UM") = DdlUMInsumos.SelectedItem - Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue - Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem - Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero - Row("PS") = DdlProductowsInsumos.SelectedText - Row("CodigoPS") = DdlProductowsInsumos.SelectedText + Row("PU") = TxtPUInsumos.Text.ToDouble.FormatoNumero Row("Total") = (TxtCantidadInsumos.Text.ToDouble * TxtPUInsumos.Text.ToDouble).FormatoNumero Row("CveTipoPresupuesto") = 1 Row("NoIdentificacion") = "" 'TxtNoIdentificacionvInsumos.Text.Trim Row("LimitarCantidad") = False + Row("CveRubro") = DdlRubro.SelectedValue.ToEntero + Row("Rubro") = DdlRubro.SelectedItem.Text + + If DdlRubro.SelectedValue.ToEntero = 3 Then + Row("CveActividad") = DdlActividades.SelectedValue.ToEntero + Row("Actividad") = DdlActividades.SelectedItem.Text + Row("Dias") = TxtDias.Text.ToEntero + Row("CveSubTipoActivoFijo") = -1 + + + Row("CveUM") = -1 + Row("UM") = "" + Row("CveClasificacion") = -1 + Row("Clasificacion") = "" + Row("CvePS") = -1 + Row("PS") = DdlActividades.SelectedItem.Text + Row("CodigoPS") = DdlActividades.SelectedItem.Text + + Else + Row("CveActividad") = -1 + Row("Actividad") = "" + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + + + Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero + Row("UM") = DdlUMInsumos.SelectedItem + Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue + Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem + Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero + Row("PS") = DdlProductowsInsumos.SelectedText + Row("CodigoPS") = DdlProductowsInsumos.SelectedText + + + + End If + + Dim ObjContratos As New ClsContratos - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "") Then - If Autorizado Then - Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) - guardarBitacora(msj) - End If + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, False, "", + CveRubro:=Row("CveRubro").ToString.ToEntero, CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then + 'If Autorizado Then + ' Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) + ' guardarBitacora(msj) + 'End If + Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") TmpDT.Rows.Add(Row) Dim TotalRow = Row("Total").ToString.ToDouble @@ -1843,22 +1894,34 @@ Partial Class Contratos_ContratoObra Dim Cantidad, PU As Double Dim CvePS, CveUM As Integer - 'Dim NoIdentificacion As String = "" - 'Dim LimitarCantidad As Boolean + + Dim CveRubro As Integer = DdlRubro.SelectedValue.ToEntero + + Dim CveActividad As Integer = -1 + Dim CveSubTipoActivoFijo As Integer = -1 + Dim Dias As Integer = 0 + + If CveRubro = 3 Then + + CveActividad = DdlActividades.SelectedValue.ToEntero + Dias = TxtDias.Text.ToEntero + + CvePS = -1 + CveUM = -1 + Else + CvePS = DdlProductowsInsumos.SelectedValue.ToEntero + CveUM = DdlUMInsumos.SelectedValue.ToEntero + End If + Cantidad = TxtCantidadInsumos.Text.ToDouble PU = TxtPUInsumos.Text.ToDouble - CvePS = DdlProductowsInsumos.SelectedValue.ToEntero - CveUM = DdlUMInsumos.SelectedValue.ToEntero - 'NoIdentificacion = TxtNoIdentificacionvInsumos.Text.Trim - 'LimitarCantidad = If(ChkLimitarInsumos.Checked, True, False) + Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalleEditar))(0) - - Dim ObjContratos As New ClsContratos - If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, "", False, "") Then + If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, "", False, "", CveRubro:=CveRubro, CveActividad:=CveActividad, CveSubTipoActivoFijo:=CveSubTipoActivoFijo, Dias:=Dias) Then If Autorizado Then Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}", @@ -2194,9 +2257,6 @@ Partial Class Contratos_ContratoObra End If - - - If ObjContratos.GetReporteContratosAvancesDetalleControl(CveContrato, UsuarioActual.CveEmpresa) Then GvDatosAvanceControl.DataSource = ObjContratos.DtResultados @@ -4008,17 +4068,10 @@ Partial Class Contratos_ContratoObra Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) LimpiarModalVentas() - 'CveContratoDetalle,CveUM,CvePS,Cantidad,PU,CveTipoPresupuesto,CveClasificacion,CodigoPS,LimitarCantidad - CveContratoDetalleEditar = GvRow.DataKey("CveContratoDetalle").ToEntero - - 'TxtOCInterna.Text = GvRow.DataKey("OCInterna") TxtCantidad.Text = GvRow.DataKey("CantidadContratada").ToDouble.ToString - 'ChkLimitarVenta.Checked = Boolean.Parse(GvRow.DataKey("LimitarCantidad")) - - 'TxtNoIdentificacionv.Text = GvRow.DataKey("NoIdentificacion").ToDouble.ToString DdlClasificacionAdd.SelectedValueExist(GvRow.DataKey("CveClasificacion").ToEntero) DdlProductows.txtText.Value = GvRow.DataKey("PS").ToString @@ -4040,14 +4093,17 @@ Partial Class Contratos_ContratoObra RegistraScript("$('#ModalVentasAddPS').modal('show')") End Sub Protected Sub LnkEditarPresupuestoControlDetalle_Click(sender As Object, e As EventArgs) + Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + + Dim CveRubro As Integer = gvRow.DataKey("CveRubro").ToEntero + LimpiarModalControl() CveContratoDetalleEditar = gvRow.DataKey("CveContratoDetalle").ToEntero TxtCantidadInsumos.Text = gvRow.DataKey("CantidadContratada").ToDouble.ToString - 'ChkLimitarInsumos.Checked = Boolean.Parse(gvRow.DataKey("LimitarCantidad")) - ' TxtNoIdentificacionvInsumos.Text = gvRow.DataKey("NoIdentificacion") + DdlClasificacionAddInsumos.SelectedValueExist(gvRow.DataKey("CveClasificacion").ToEntero) @@ -4059,16 +4115,42 @@ Partial Class Contratos_ContratoObra DdlUMInsumos.DataBind() DdlUMInsumos.SelectedValueExist(gvRow.DataKey("CveUM").ToDouble.ToString) - - TxtPUInsumos.Text = gvRow.DataKey("PU").ToDouble.ToString + DdlRubro.SelectedValueExist(gvRow.DataKey("CveRubro").ToString) + + If CveRubro = 3 Then + + DVDias.Visible = True + DVActividadesRH.Visible = True + + DVClasificacion.Visible = False + DVPS.Visible = False + DVUM.Visible = False + + DdlActividades.SelectedValueExist(gvRow.DataKey("CveActividad")) + TxtDias.Text = gvRow.DataKey("Dias") + Else + DVDias.Visible = False + DVActividadesRH.Visible = False + + DVClasificacion.Visible = True + DVPS.Visible = True + DVUM.Visible = True + + DdlActividades.SelectedValueExist(-1) + TxtDias.Text = "0" + + End If + ModalControlPSAdd = False ChkContinualAgregandoControl.Visible = False ChkContinualAgregandoControl.Checked = False + UpModalControlAddPS.Update() + RegistraScript("$('#ModalControlAddPS').modal('show')") End Sub @@ -4098,7 +4180,12 @@ Partial Class Contratos_ContratoObra End Sub Private Sub LimpiarModalControl() + DdlActividades.Items.Clear() + DdlActividades.DataSource = GlobalDTRHActividades(UsuarioActual.CveEmpresa) + DdlActividades.DataBind() + + DdlActividades.Items.Insert(0, New ListItem("Seleccione una", "-1")) TxtCantidadInsumos.Text = "" 'ChkLimitarInsumos.Checked = False @@ -4110,6 +4197,21 @@ Partial Class Contratos_ContratoObra DdlUMInsumos.SelectedValueExist(-1) TxtPUInsumos.Text = "" + DdlRubro.SelectedValue = "2" + ' DdlRubro_SelectedIndexChanged(Nothing, Nothing) + + + DVClasificacion.Visible = True + DVPS.Visible = True + DVUM.Visible = True + + DVDias.Visible = False + DVActividadesRH.Visible = False + + TxtDias.Text = "" + DdlActividades.SelectedValueExist(-1) + + If ModalControlPSAdd = True Then LtlModalControlPSTitulo.Text = "Agregar Producto Presupuesto Control" @@ -4126,19 +4228,67 @@ Partial Class Contratos_ContratoObra Protected Sub BtnCargaPresupuesto_Click(sender As Object, e As EventArgs) Dim DTCargaPresupuesto As New DataTable - DTCargaPresupuesto = CargaPreSupuestoExcel() + Dim DTCargaPresupuestoInsumos As New DataTable + Dim DTCargaPresupuestoManoObra As New DataTable + Dim DTCargaPresupuestoFlotillas As New DataTable + + + If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then + + DTCargaPresupuesto = CargaPreSupuestoExcel("Presupuesto") + + If DTCargaPresupuesto.Rows.Count > 0 Then + ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, Nothing, Nothing) + Else + Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia) + End If - If DTCargaPresupuesto.Rows.Count > 0 Then - ' ProcesaDatosCargaPresupuesto(DTCargaPresupuesto) Else - Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia) + + DTCargaPresupuesto = CargaPreSupuestoExcel("Insumos") + DTCargaPresupuestoManoObra = CargaPreSupuestoExcel("ManoObra") + DTCargaPresupuestoFlotillas = CargaPreSupuestoExcel("Flotillas") + + ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, DTCargaPresupuestoManoObra, DTCargaPresupuestoFlotillas) + End If + TxtModalCargaPresupuesto.Text = "" + + End Sub + + Protected Sub BtnDecargaFormato_Click(sender As Object, e As EventArgs) + + + Dim FI As New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx") + + If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then + FI = New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx") + Else + FI = New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObraInterno.xlsx") + End If + + + If FI.Exists Then + + Response.ContentType = "application/octet-stream" + + If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then + Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObra.xlsx") + Else + Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObraInterno.xlsx") + End If + + Response.TransmitFile(FI.FullName) + Response.End() + + End If + + End Sub - - Private Function CargaPreSupuestoExcel() As DataTable + Private Function CargaPreSupuestoExcel(Hoja As String) As DataTable Dim FileExtension As String = "-1" Dim Filesgral As List(Of Archivo) = TxtModalCargaPresupuesto.getfiles().Archivos @@ -4160,7 +4310,7 @@ Partial Class Contratos_ContratoObra tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) SpreadsheetInfo.SetLicense(Extensiones.SerialGemBoxSpreadsheet) Dim workbook = ExcelFile.Load(fileItem.FileUrl) - Dim worksheet = workbook.Worksheets(0) + Dim worksheet = workbook.Worksheets(Hoja) DTPS = worksheet.CreateDataTable(New CreateDataTableOptions() With { .ColumnHeaders = True, @@ -4172,7 +4322,7 @@ Partial Class Contratos_ContratoObra Next - TxtModalCargaPresupuesto.Text = "" + RegistraScript("$('#ModalUploadPresupuesto').modal('hide')") @@ -4183,179 +4333,334 @@ Partial Class Contratos_ContratoObra End Function - 'Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable) - - ' Dim DTPS = New DataTable - ' DTPS.Columns.Add("CveContratoDetalle", GetType(Integer)) - ' DTPS.Columns.Add("Cantidad", GetType(Double)) - ' DTPS.Columns.Add("CantidadContratada", GetType(Double)) - ' DTPS.Columns.Add("CveUM", GetType(Integer)) - ' DTPS.Columns.Add("UM", GetType(String)) - ' DTPS.Columns.Add("CveClasificacion", GetType(Integer)) - ' DTPS.Columns.Add("Clasificacion", GetType(String)) - ' DTPS.Columns.Add("CvePS", GetType(Integer)) - ' DTPS.Columns.Add("PS", GetType(String)) - ' DTPS.Columns.Add("CodigoPS", GetType(String)) - ' DTPS.Columns.Add("PU", GetType(Double)) - ' DTPS.Columns.Add("Total", GetType(Double)) - ' DTPS.Columns.Add("CveTipoPresupuesto", GetType(Integer)) - ' DTPS.Columns.Add("PermitirAvance", GetType(Integer)) - ' DTPS.Columns.Add("PermitirEstimacion", GetType(Integer)) - ' DTPS.Columns.Add("UsuarioAvance", GetType(Integer)) - ' DTPS.Columns.Add("Cantidad_Original", GetType(Double)) - ' DTPS.Columns.Add("PU_Original", GetType(Double)) - ' DTPS.Columns.Add("Total_Original", GetType(Double)) - ' DTPS.Columns.Add("NoIdentificacion", GetType(String)) - ' DTPS.Columns.Add("LimitarCantidad", GetType(Integer)) - ' DTPS.Columns.Add("OCInterna", GetType(String)) - ' DTPS.Columns.Add("Observacion", GetType(String)) - - ' Dim RowNoEncontrados As String = "" - - ' For Each DrowPS As DataRow In DTPresupuesto.Rows + Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable, DTCargaPresupuestoManoObra As DataTable, DTCargaPresupuestoFlotillas As DataTable) - ' Dim StrArray() As String = GetPS("PS", DrowPS("PS").ToString).Split("|"c) - ' Dim CvePS As Integer - ' Dim CveUM As Integer + If Not DTPresupuesto Is Nothing Then + DTPresupuesto.CaseSensitive = False + End If - ' If StrArray.Length > 0 Then - ' If CBool(StrArray(0)) = True Then - ' CvePS = StrArray(1).ToEntero - ' Else - ' RowNoEncontrados &= StrArray(1) & "<\BR>" - ' End If - ' End If + If Not DTCargaPresupuestoManoObra Is Nothing Then + DTCargaPresupuestoManoObra.CaseSensitive = False + End If - ' If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then + If Not DTCargaPresupuestoFlotillas Is Nothing Then + DTCargaPresupuestoFlotillas.CaseSensitive = False + End If - ' CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero - - ' Dim Row As DataRow = DTPS.NewRow() - ' Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble - ' Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble - ' Row("CveUM") = CveUM - ' Row("UM") = "" - ' Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero - ' Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString - ' Row("CvePS") = CvePS - ' Row("PS") = DrowPS("PS").ToString - ' Row("CodigoPS") = DrowPS("PS").ToString - ' Row("PU") = DrowPS("PU").ToString.ToDouble - ' Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble - - - ' Select Case TipoCargaPresupuesto - ' Case EnumTipoCargaPresupuesto.Ventas - ' Row("CveTipoPresupuesto") = 2 - ' Exit Select - ' Case EnumTipoCargaPresupuesto.Control - ' Row("CveTipoPresupuesto") = 1 - ' Exit Select - ' Case Else - ' Row("CveTipoPresupuesto") = 1 - ' End Select - - - ' Row("NoIdentificacion") = "" - ' Row("OCInterna") = "" - ' Row("LimitarCantidad") = 0 - ' Row("Observacion") = "" - - ' DTPS.Rows.Add(Row) - - ' End If - ' Next + Dim ErrorProceso = False - ' Dim ErrorProceso = False - ' Dim ObjContratos As New ClsContratos - ' Dim TotalRow As Double = 0 - ' ObjContratos.IniciaTransacSQL() - - ' For Each Row As DataRow In DTPS.Rows - ' If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString) Then + Dim DTPS = New DataTable + DTPS.Columns.Add("CveContratoDetalle", GetType(Integer)) + DTPS.Columns.Add("Cantidad", GetType(Double)) + DTPS.Columns.Add("CantidadContratada", GetType(Double)) + DTPS.Columns.Add("CveUM", GetType(Integer)) + DTPS.Columns.Add("UM", GetType(String)) + DTPS.Columns.Add("CveClasificacion", GetType(Integer)) + DTPS.Columns.Add("Clasificacion", GetType(String)) + DTPS.Columns.Add("CvePS", GetType(Integer)) + DTPS.Columns.Add("PS", GetType(String)) + DTPS.Columns.Add("CodigoPS", GetType(String)) + DTPS.Columns.Add("PU", GetType(Double)) + DTPS.Columns.Add("Total", GetType(Double)) + DTPS.Columns.Add("CveTipoPresupuesto", GetType(Integer)) + DTPS.Columns.Add("PermitirAvance", GetType(Integer)) + DTPS.Columns.Add("PermitirEstimacion", GetType(Integer)) + DTPS.Columns.Add("UsuarioAvance", GetType(Integer)) + DTPS.Columns.Add("Cantidad_Original", GetType(Double)) + DTPS.Columns.Add("PU_Original", GetType(Double)) + DTPS.Columns.Add("Total_Original", GetType(Double)) + DTPS.Columns.Add("NoIdentificacion", GetType(String)) + DTPS.Columns.Add("LimitarCantidad", GetType(Integer)) + DTPS.Columns.Add("OCInterna", GetType(String)) + DTPS.Columns.Add("Observacion", GetType(String)) - ' If Autorizado Then - ' Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) - ' guardarBitacora(msj) - ' End If + DTPS.Columns.Add("CveRubro", GetType(Integer)) + DTPS.Columns.Add("CveActividad", GetType(Integer)) + DTPS.Columns.Add("CveSubTipoActivoFijo", GetType(Integer)) - ' Dim NrowTmpDT As DataRow = TmpDT.NewRow + DTPS.Columns.Add("Rubro", GetType(String)) + DTPS.Columns.Add("Actividad", GetType(String)) + DTPS.Columns.Add("SubTipoActivoFijo", GetType(String)) + DTPS.Columns.Add("Dias", GetType(Integer)) + + Dim RowNoEncontrados As String = "" + + If Not DTPresupuesto Is Nothing Then + For Each DrowPS As DataRow In DTPresupuesto.Rows - ' NrowTmpDT("Cantidad") = Row("Cantidad") - ' NrowTmpDT("CantidadContratada") = Row("CantidadContratada") - ' NrowTmpDT("CveUM") = Row("CveUM") - ' NrowTmpDT("UM") = Row("UM") - ' NrowTmpDT("CveClasificacion") = Row("CveClasificacion") - ' NrowTmpDT("Clasificacion") = Row("Clasificacion") - ' NrowTmpDT("CvePS") = Row("CvePS") - ' NrowTmpDT("PS") = Row("PS") - ' NrowTmpDT("CodigoPS") = Row("CodigoPS") - ' NrowTmpDT("PU") = Row("PU") - ' NrowTmpDT("Total") = Row("Total") - ' NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto") - ' NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion") - ' NrowTmpDT("OCInterna") = Row("OCInterna") - ' NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad") - ' NrowTmpDT("Observacion") = Row("Observacion") + Dim StrArray() As String = GetPS("PS", DrowPS("Producto").ToString).Split("|"c) + Dim CvePS As Integer + Dim CveUM As Integer - - ' NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") - - ' TmpDT.Rows.Add(NrowTmpDT) - ' TmpDT.AcceptChanges() - - ' TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble - ' Else - ' ErrorProceso = True - ' Exit For - ' End If - ' Next - - - ' If ErrorProceso Then - ' ObjContratos.RollBack() - ' Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError) - ' Else - - ' ObjContratos.Commit() - ' Alert("Presupuesto Cargado correctamente") - - - ' Select Case TipoCargaPresupuesto - ' Case EnumTipoCargaPresupuesto.Ventas - ' CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) - ' UpGV.Update() - ' Exit Select - ' Case EnumTipoCargaPresupuesto.Control - ' CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) - ' UpGVInsumos.Update() - ' Exit Select - ' Case Else - - ' End Select - - ' LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero - ' LblImporte.Text = LbTotalGeneral.Text - ' UpGral.Update() - - ' End If + If StrArray.Length > 0 Then + If CBool(StrArray(0)) = True Then + CvePS = StrArray(1).ToEntero + Else + RowNoEncontrados &= StrArray(1) & "<\BR>" + End If + End If - ' ObjContratos.Dispose() - - ' If RowNoEncontrados.Length > 0 Then - ' Alert($"Productos no encontrados
{RowNoEncontrados} ") - ' End If + If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then - 'End Sub + + CveUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $" UnidadMedida = '{ DrowPS("UnidadMedida").ToString.Trim }' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString.Trim }'").ToEntero + + If CveUM <= 0 Then + CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero + End If + + + Dim Row As DataRow = DTPS.NewRow() + + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble + Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble + Row("CveUM") = CveUM + Row("UM") = "" + Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero + Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString + Row("CvePS") = CvePS + Row("PS") = DrowPS("Producto").ToString + Row("CodigoPS") = DrowPS("Producto").ToString + Row("PU") = DrowPS("PU").ToString.ToDouble + Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + + Select Case TipoCargaPresupuesto + Case EnumTipoCargaPresupuesto.Ventas + + Row("CveTipoPresupuesto") = 2 + Row("CveRubro") = 1 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + + Exit Select + Case EnumTipoCargaPresupuesto.Control + Row("CveTipoPresupuesto") = 1 + Row("CveRubro") = 2 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + Exit Select + Case Else + Row("CveTipoPresupuesto") = 1 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + End Select + + + Row("NoIdentificacion") = "" + Row("OCInterna") = "" + Row("LimitarCantidad") = 0 + Row("Observacion") = "" + + DTPS.Rows.Add(Row) + Else + ErrorProceso = True + End If + Next + + End If + + + + If Not DTCargaPresupuestoManoObra Is Nothing And Not ErrorProceso Then + + + For Each DrowPS As DataRow In DTCargaPresupuestoManoObra.Rows + + Dim CveActividad As Integer = 0 + Dim Actividad As String + + + If DrowPS("Actividad").ToString.Trim.Length > 0 Then + GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing + CveActividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActividad", $" Actividad = '{ DrowPS("Actividad").ToString.Trim }'").ToEntero + + If CveActividad <= 0 Then + + + Dim ObjRH As New ClsRH() + + If ObjRH.AddActividades(DrowPS("Actividad").ToString.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + + CveActividad = ObjRH.CveActividad + + If CveActividad <= 0 Then + ErrorProceso = True + End If + + GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing + + Else + ErrorProceso = True + End If + + ObjRH.Dispose() + + End If + + + If CveActividad > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 And Not ErrorProceso Then + + Actividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Actividad", $" CveActividad = {CveActividad}") + + Dim Row As DataRow = DTPS.NewRow() + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble + Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble + Row("CveUM") = -1 + Row("UM") = "Actividad RH" + Row("CveClasificacion") = -1 + Row("Clasificacion") = "" + Row("CvePS") = -1 + Row("PS") = Actividad + Row("CodigoPS") = Actividad + Row("PU") = DrowPS("PU").ToString.ToDouble + Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + + Row("CveTipoPresupuesto") = 1 + Row("CveRubro") = 3 + Row("CveActividad") = CveActividad + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = DrowPS("Dias").ToString.ToEntero + + Row("NoIdentificacion") = "" + Row("OCInterna") = "" + Row("LimitarCantidad") = 0 + Row("Observacion") = "" + + DTPS.Rows.Add(Row) + + End If + End If + + + Next + + End If + + If Not DTCargaPresupuestoFlotillas Is Nothing Then + + End If + + + If Not ErrorProceso Then + + Dim ObjContratos As New ClsContratos + Dim TotalRow As Double = 0 + ObjContratos.IniciaTransacSQL() + + For Each Row As DataRow In DTPS.Rows + + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, + Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString, CveRubro:=Row("CveRubro").ToString.ToEntero, + CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then + + If Autorizado Then + Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con rubro {4} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"), Row("CveRubro")) + guardarBitacora(msj) + End If + + Dim NrowTmpDT As DataRow = TmpDT.NewRow + + + NrowTmpDT("Cantidad") = Row("Cantidad") + NrowTmpDT("CantidadContratada") = Row("CantidadContratada") + NrowTmpDT("CveUM") = Row("CveUM") + NrowTmpDT("UM") = Row("UM") + NrowTmpDT("CveClasificacion") = Row("CveClasificacion") + NrowTmpDT("Clasificacion") = Row("Clasificacion") + NrowTmpDT("CvePS") = Row("CvePS") + + + NrowTmpDT("PS") = Row("PS") + NrowTmpDT("CodigoPS") = Row("CodigoPS") + + + + + NrowTmpDT("PU") = Row("PU") + NrowTmpDT("Total") = Row("Total") + NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto") + NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion") + NrowTmpDT("OCInterna") = Row("OCInterna") + NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad") + NrowTmpDT("Observacion") = Row("Observacion") + + NrowTmpDT("CveRubro") = Row("CveRubro") + NrowTmpDT("CveActividad") = Row("CveActividad") + NrowTmpDT("CveSubTipoActivoFijo") = Row("CveSubTipoActivoFijo") + + NrowTmpDT("Rubro") = Row("Rubro") + NrowTmpDT("Actividad") = Row("Actividad") + NrowTmpDT("SubTipoActivoFijo") = Row("SubTipoActivoFijo") + + + NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") + + TmpDT.Rows.Add(NrowTmpDT) + TmpDT.AcceptChanges() + + TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble + Else + ErrorProceso = True + Exit For + End If + Next + + + If ErrorProceso Then + ObjContratos.RollBack() + Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError) + Else + + ObjContratos.Commit() + Alert("Presupuesto Cargado correctamente") + + + Select Case TipoCargaPresupuesto + Case EnumTipoCargaPresupuesto.Ventas + CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) + UpGV.Update() + Exit Select + Case EnumTipoCargaPresupuesto.Control + CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) + UpGVInsumos.Update() + Exit Select + Case Else + + End Select + + LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero + LblImporte.Text = LbTotalGeneral.Text + UpGral.Update() + + End If + + ObjContratos.Dispose() + + + End If + + + + If RowNoEncontrados.Length > 0 Then + Alert($"Productos no encontrados
{RowNoEncontrados} ") + End If + + + + + End Sub @@ -4588,42 +4893,34 @@ Partial Class Contratos_ContratoObra Con.Dispose() - If DTDatos.Rows.Count > 0 Then + Try + If DTDatos.Rows.Count > 0 Then - Dim CantidadAvance As Decimal = DTDatos.Rows(0)("Cantidad").ToString.ToDecimal - Dim ImporteAvance As Decimal = DTDatos.Rows(0)("AvanceImporte").ToString.ToDecimal - Dim TotalAvancePorcentaje As Decimal = If(ImporteAvance > 0, (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2), 0) + Dim CantidadAvance As Decimal = DTDatos.Rows(0)("Cantidad").ToString.ToDecimal + Dim ImporteAvance As Decimal = DTDatos.Rows(0)("AvanceImporte").ToString.ToDecimal + Dim TotalAvancePorcentaje As Decimal = If(ImporteAvance > 0, (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2), 0) - Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal - Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal - Dim TotalFaltantePorcentaje As Decimal = If(ImporteInterno > 0, (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2), 0) + Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal + Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal + Dim TotalFaltantePorcentaje As Decimal = If(ImporteInterno > 0, (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2), 0) - LtlAvanceImporte.Text = $"$ { ImporteAvance.ToString("###,###,###.00") }" - LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %" - LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%" - SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%") + LtlAvanceImporte.Text = $"$ { ImporteAvance.ToString("###,###,###.00") }" + LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %" + LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%" + SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%") - LtlAvanceInternoImporte.Text = $"$ {DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal.ToString("###,###,###.00")}" - LtlAvanceInternoImportePorcentaje1.Text = $"{TotalFaltantePorcentaje.ToString("###.00")} %" - LtlAvanceInternoImportePorcentaje2.Text = $"{TotalFaltantePorcentaje.ToString("###.00")}%" - SPFaltante.Attributes.Add("style", $"width:{TotalFaltantePorcentaje.ToString.ToEntero}%") + LtlAvanceInternoImporte.Text = $"$ {DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal.ToString("###,###,###.00")}" + LtlAvanceInternoImportePorcentaje1.Text = $"{TotalFaltantePorcentaje.ToString("###.00")} %" + LtlAvanceInternoImportePorcentaje2.Text = $"{TotalFaltantePorcentaje.ToString("###.00")}%" + SPFaltante.Attributes.Add("style", $"width:{TotalFaltantePorcentaje.ToString.ToEntero}%") - End If + End If + Catch ex As Exception - 'Dim TotalContratos As Decimal = DTDatos.SUM("Importe") - 'Dim TotalAvance As Decimal = DTDatos.SUM("AvanceImporte") - 'Dim TotalFaltante As Decimal = TotalContratos - TotalAvance - - - 'Dim TotalAvancePorcentaje As Decimal = ((TotalAvance * 100) / TotalContratos).RoundAD(2) - 'Dim TotalFaltantePorcentaje As Decimal = (100 - TotalAvancePorcentaje).RoundAD(2) - - - ' LtlGrafNumeroContratos.Text = NumeroContratos.ToString - 'LtlGrafTotal.Text = TotalContratos.ToString("###,###,###.00") + End Try DVGraficas.Visible = True @@ -4635,6 +4932,29 @@ Partial Class Contratos_ContratoObra + Protected Sub DdlRubro_SelectedIndexChanged(sender As Object, e As EventArgs) + + + If DdlRubro.SelectedValue.ToEntero = 3 Then + DVDias.Visible = True + DVActividadesRH.Visible = True + + DVClasificacion.Visible = False + DVPS.Visible = False + DVUM.Visible = False + Else + DVDias.Visible = False + DVActividadesRH.Visible = False + + DVClasificacion.Visible = True + DVPS.Visible = True + DVUM.Visible = True + + End If + + UpModalControlAddPS.Update() + + End Sub End Class diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 1ec5937e6..532f5c204 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2512,7 +2512,7 @@ Partial Class Inventarios_EntregaAlmacen End If 'se registra - If ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.ToDate, HLFolio.Text, "EntregaAlmacen", CveMovimiento, CveMovimientoEntrada, ImporteAlmacen, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, True) <= 0 Then + If ContabilizaMovimientoAlmacen(ObjConta, TxtFecha.Text.ToDate, HLFolio.Text, "EntregaAlmacen", CveMovimiento, CveMovimientoEntrada, ImporteAlmacen, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False) <= 0 Then ErrorMovInv = True End If diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx b/Inventarios/PopUpExistenciasAlmacen.aspx index 2528fc984..3588e3237 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx +++ b/Inventarios/PopUpExistenciasAlmacen.aspx @@ -45,7 +45,7 @@ -
+
@@ -138,7 +138,7 @@
-
+
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx.vb b/Inventarios/PopUpExistenciasAlmacen.aspx.vb index 7b6ec9130..08d54fcc4 100644 --- a/Inventarios/PopUpExistenciasAlmacen.aspx.vb +++ b/Inventarios/PopUpExistenciasAlmacen.aspx.vb @@ -100,7 +100,7 @@ Partial Class Inventarios_Default If ValidarFiltrosSeleccionados() OrElse CvePS > 0 Then Dim ObjInventarios As New ClsInventarios() If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), - ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero, TopSelect:=100) Then + ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero, ExcluyeTransitorios:=1, TopSelect:=100) Then Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") If dr IsNot Nothing Then @@ -243,6 +243,7 @@ Partial Class Inventarios_Default ObjInventarios.Dispose() GvMedRin.DataBind() UPDatos.Update() + DivMedRin.Visible = True End Sub Private Sub CargaEquivalencia() diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 434eaf4fb..4af10e301 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -1525,7 +1525,7 @@ Partial Class Inventarios_TraspasoAlmacen FolioBusqueda = If(TxtFolioRecepcion.Text = "", -1, TxtFolioRecepcion.Text.ToEntero) Dim ObjInventarios As New ClsInventarios - If ObjInventarios.GetMovimientosTransitorios(DdlAlmacenRecepcion.SelectedValue.ToEntero, -1, DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero, -1, FolioBusqueda, UsuarioActual.CveEmpresa) Then + If ObjInventarios.GetMovimientosTransitorios(DdlAlmacenRecepcion.SelectedValue.ToEntero, -1, DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero, -1, FolioBusqueda, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then Dtt = ObjInventarios.DtResultados.FiltraParametros(String.Format("CveTipoAlmacenDestino <> 4")) Else Alert("Ocurrió un error al consultar los movimientos transitorios. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia) @@ -1820,7 +1820,7 @@ Partial Class Inventarios_TraspasoAlmacen Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) '' verifica que no se halla recibido previamente, si ya se recibió da salida - If ObjInventario.GetMovimientosTransitorios(CveAlmacenDestino, -1, CveAlmacenTransitorio, -1, FolioBusqueda, UsuarioActual.CveEmpresa) Then + If ObjInventario.GetMovimientosTransitorios(CveAlmacenDestino, -1, CveAlmacenTransitorio, -1, FolioBusqueda, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then Dtt = ObjInventario.DtResultados.FiltraParametros(String.Format("CveTipoAlmacenDestino <> 4"), "", {"CveMovimientoDetalle", "Codigo", "Cantidad"}) If Dtt IsNot Nothing AndAlso Dtt.FiltraParametros("Cantidad < 0").Rows.Count > 0 Then diff --git a/Site.master b/Site.master index 5c6489dad..30390b077 100644 --- a/Site.master +++ b/Site.master @@ -1,672 +1,672 @@ -<%@ Master Language="VB" CodeFile="Site.master.vb" Inherits="Site" %> - -<%@ Import Namespace="System.Web.Optimization" %> - - - - - - Sistema de Información Gerencial - - - - - - - <%: Scripts.Render("~/bundles/modernizr") %> - <%: Styles.Render("~/Content/AjaxControlToolkit/Styles/Bundle") %> - - - <%-- - - --%> - <%: Styles.Render("~/Metronic/assets/global/css/css") %> - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - <%--Site Scripts--%> - - - - <%: Scripts.Render("~/bundles/scripts") %> - - - - -
- -
- - - - -
-
- - -
- - -
- -
- - - -
-
- -
-
-

- - -

-
+<%@ Master Language="VB" CodeFile="Site.master.vb" Inherits="Site" %> + +<%@ Import Namespace="System.Web.Optimization" %> + + + + + + Sistema de Información Gerencial + + + + + + + <%: Scripts.Render("~/bundles/modernizr") %> + <%: Styles.Render("~/Content/AjaxControlToolkit/Styles/Bundle") %> + + + <%-- + + --%> + <%: Styles.Render("~/Metronic/assets/global/css/css") %> + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + <%--Site Scripts--%> + + + + <%: Scripts.Render("~/bundles/scripts") %> + + + + +
+ +
+ + + + +
+
+ + +
+ + +
+ +
+ + + +
+
+ +
+
+

+ + +

+
-
-
-
- - - -
-
-
-
- -
-
- - -
- - -
-
-
- - -
-
-
-
- - - - -
-
- -
-
- -
- - - - <%-- MODAL SOPORTE --%> - <%-- --%> - <%-- END MODAL SOPORTE --%> - - - - - - <%----%> - - - +
+
+
+ + + +
+
+
+
+ +
+
+ + +
+ + +
+
+
+ + +
+
+
+
+ + + + +
+
+ +
+
+ +
+ + + + <%-- MODAL SOPORTE --%> + <%-- --%> + <%-- END MODAL SOPORTE --%> + + + + + + <%----%> + + + @@ -723,44 +723,44 @@
- - - - - - - - - <%: Scripts.Render("~/Metronic/assets/global/scripts/JS") %> - - - - - - - - - - + + + + + + + + + <%: Scripts.Render("~/Metronic/assets/global/scripts/JS") %> + + + + + + + + + + diff --git a/Ventas/ActualizarPrecios.aspx b/Ventas/ActualizarPrecios.aspx index 7fa9d0f4f..831afae7e 100644 --- a/Ventas/ActualizarPrecios.aspx +++ b/Ventas/ActualizarPrecios.aspx @@ -46,8 +46,7 @@
- - +
diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index b63f2978b..22ef5da09 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -221,7 +221,7 @@ Partial Class Ventas_ActualizarPrecios Next - If Correcto Then + If Correcto AndAlso Not TieneError Then Alert("Los Precios de lista de los Productos/Servicios se actualizaron correctamente") End If @@ -531,29 +531,38 @@ Partial Class Ventas_ActualizarPrecios Private Function ActualizarPreciosFranquicia(ObjPS As ClsProductosServicios, Codigo As String, PS As String, Precio As Decimal, PrecioMinimo As Decimal, PrecioLista As String) As Boolean Dim FranquiciasStr As String = UsuarioActual.Empresa.Funcionalidad(563) - Dim Franquicias = FranquiciasStr.Split(","c) - Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal) Dim StrMsg As New StringBuilder - For Each Franquicia In Franquicias - Dim CveFranquicia As Integer = Franquicia.ToEntero - Dim CvePS As Integer = GlobalDTPS(CveFranquicia, Codigo:=Codigo).FiltroPrimeroValor("CvePS", "").ToEntero - Dim CvePrecioLisa As Integer = GlobalDTPrecioListas(CveFranquicia).FiltroPrimeroValor("CvePrecioLista", String.Format("PrecioLista = '{0}'", PrecioLista)).ToEntero + Dim StrMsgError As New StringBuilder + If FranquiciasStr <> "" Then - If CvePS <= 0 Then - Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa") - StrMsg.AppendFormat("El producto '{0}' no se encuentra en la Franquicia '{1}'", PS, EmpresaFranquicia) + Dim Franquicias = FranquiciasStr.Split(","c) + Dim Porcentaje As Decimal = If(TxtPorcentaje.Text = "", -1, TxtPorcentaje.Text.ToDecimal) - End If - If CvePrecioLisa <= 0 Then - Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa") - StrMsg.AppendFormat("El precio lista '{0}' no existe en la Franquicia '{1}'", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia) - End If - If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then - StrMsg.AppendFormat("No se pudo actualizar el producto") - End If - Next + For Each Franquicia In Franquicias + Dim CveFranquicia As Integer = Franquicia.ToEntero + Dim CvePS As Integer = GlobalDTPS(CveFranquicia, Codigo:=Codigo).FiltroPrimeroValor("CvePS", "").ToEntero + Dim CvePrecioLisa As Integer = GlobalDTPrecioListas(CveFranquicia).FiltroPrimeroValor("CvePrecioLista", String.Format("PrecioLista = '{0}'", PrecioLista)).ToEntero - If StrMsg.ToString = "" Then + If CvePS <= 0 Then + Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa") + StrMsg.AppendFormat("El producto '{0}' no se encuentra en la Franquicia '{1}'
", PS, EmpresaFranquicia) + + End If + 'If CvePrecioLisa <= 0 Then + ' Dim EmpresaFranquicia As String = GlobalDTEmpresas(CveEmpresa:=CveFranquicia).FiltroPrimeroValor("Empresa") + ' StrMsg.AppendFormat("El precio lista '{0}' no existe en la Franquicia '{1}'
", DdlPrecioLista.SelectedItem.Text, EmpresaFranquicia) + 'End If + If CvePrecioLisa > 0 AndAlso CvePS > 0 AndAlso Not ObjPS.UpdatePSPreciosLista(Precio, CvePrecioLisa, Porcentaje, CvePS, UsuarioActual.CveUsuario, DateTime.Now, If(RblTipo.SelectedValue = "Imp", True, False), PrecioMinimo:=PrecioMinimo) Then + StrMsgError.AppendFormat("No se pudo actualizar el producto") + End If + Next + + End If + + If StrMsgError.ToString = "" Then + If StrMsg.ToString <> "" Then + Alert(StrMsg.ToString, TipoMensaje.MsgAdvertencia) + End If Return False Else Return True diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index 7a5c4faa1..d83ba7ada 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -132,7 +132,7 @@
- +