-
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index f91a5a395..29954f12e 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -45,6 +45,24 @@ Partial Class OC_OC
ViewState("ModalidadSubProyectoGeneral") = value
End Set
End Property
+ Private Property NotificacionCorreo As Boolean
+ Get
+ Return If(IsNothing(ViewState("NotificacionCorreo")), True, CBool(ViewState("NotificacionCorreo")))
+ End Get
+ Set(value As Boolean)
+ ViewState("NotificacionCorreo") = value
+ End Set
+ End Property
+
+ Private Property VisualizaContrato As Boolean
+ Get
+ Return If(IsNothing(ViewState("VisualizaContrato")), False, CBool(ViewState("VisualizaContrato")))
+ End Get
+
+ Set(ByVal value As Boolean)
+ ViewState("VisualizaContrato") = value
+ End Set
+ End Property
Private Property TipoOC As String
Get
If ViewState("TipoOC") Is Nothing Then
@@ -213,8 +231,6 @@ Partial Class OC_OC
Else
Return ViewState("NumCotizaciones").ToString.ToEntero
End If
-
-
End Get
Set(value As Integer)
ViewState("NumCotizaciones") = value
@@ -646,6 +662,9 @@ Partial Class OC_OC
If Not Page.IsPostBack Then
GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing
+ NotificacionCorreo = True
+ If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then NotificacionCorreo = False
+
CargaDatosAgregarPS()
CveProveedorOriginal = -1
InventarioPrePoliza176 = 0
@@ -704,12 +723,10 @@ Partial Class OC_OC
CargaDatos(CveOrdenCompra)
ConfiguraRetencionesProveedor()
Else
- LIContratos.Visible = True
+ LIContratos.Visible = VisualizaContrato
EsNuevo = True
InicializarValores()
HlAgregarExcel.Visible = True
- LbDescargarExcel.Visible = True
-
TxtDescrip.Attributes.Add("onKeyUp", String.Format("SetText({0}, {1})", TxtDescrip.ClientID, TxtJustificacion.ClientID))
CreaDTDetalles()
@@ -793,7 +810,8 @@ Partial Class OC_OC
'End If
- BtnGeneraContrato.Visible = True : CargaClientesContrato()
+ 'BtnGeneraContrato.Visible = True
+ 'CargaClientesContrato()
CargaEstatusInicialFinal()
CargaEstatusUsuarios()
@@ -1462,7 +1480,7 @@ Partial Class OC_OC
TieneInventario = CBool(objOC.DtResultados.Rows(0)("TieneInvOC"))
DdlMetodoPago.SelectedValueExist(objOC.DtResultados.Rows(0)("MetodoPago"))
-
+ LnkDescargarDetalleExcel.Visible = True
If objOC.DtResultados.Rows(0)("CveSubProyectoEntrega").ToString.ToEntero > 0 Then
DdlSubProyectoEntrega.SelectedValueExist(objOC.DtResultados.Rows(0)("CveSubProyectoEntrega").ToString)
@@ -2917,7 +2935,7 @@ Partial Class OC_OC
If Not TieneError Then
CveOCGeneradas.Add(CveOrdenCompra)
FolioOCGeneradas.Add(OC.Folio)
- SerieFolio = OC.Folio.ToString
+ SerieFolio = OC.SerieFolio.ToString
End If
End If
@@ -2967,8 +2985,6 @@ Partial Class OC_OC
TieneError = True
End If
-
-
If CveOrdenTrabajo > 0 Then
Dim ObjAF As New ClsAF(OC.IniciaTransacSQL)
@@ -2977,9 +2993,6 @@ Partial Class OC_OC
End If
End If
-
-
-
End If
@@ -3015,7 +3028,7 @@ Partial Class OC_OC
End If
End If
- ViewState("LigaOCs") = If(CveEstatusNuevo <> CboE.SelectedValue.ToEntero, String.Format("
{1}", CveOrdenCompra, Folio), "")
+ ViewState("LigaOCs") = If(CveEstatusNuevo <> CboE.SelectedValue.ToEntero, String.Format("
{1}", CveOrdenCompra, SerieFolio), "")
If CveOrdenCompra > 0 Then
Dim ImprimirOC As String = String.Format("
Imprimir Orden de Compra ", Encripta(String.Format("OP=OC&CVEOC={0}", CveOrdenCompra)))
@@ -3595,7 +3608,7 @@ Partial Class OC_OC
'End If
If Not HuboError Then
- LigaOcsTemp = String.Format("{0}
{2}", LigaOcsTemp, objOrdenCompra.CveOrdenCompra, objOrdenCompra.Folio)
+ LigaOcsTemp = String.Format("{0}
{2}", LigaOcsTemp, objOrdenCompra.CveOrdenCompra, objOrdenCompra.SerieFolio)
CveOCGeneradasTemp.Add(objOrdenCompra.CveOrdenCompra)
FolioOCGeneradasTemp.Add(objOrdenCompra.Folio)
End If
@@ -3690,7 +3703,7 @@ Partial Class OC_OC
If HuboError = False Then
- ViewState("LigaOCs") = String.Format("{0}
{2}", LigaOCs, objOrdenCompra.CveOrdenCompra, objOrdenCompra.Folio)
+ ViewState("LigaOCs") = String.Format("{0}
{2}", LigaOCs, objOrdenCompra.CveOrdenCompra, objOrdenCompra.SerieFolio)
CveOCGeneradas.Add(objOrdenCompra.CveOrdenCompra)
FolioOCGeneradas.Add(objOrdenCompra.Folio)
End If
@@ -4015,6 +4028,10 @@ Partial Class OC_OC
e.Row.FCLiteral("LtlSubProyecto").Text = Str
End If
End If
+ If e.Row.DBCampo("Descuento").ToDecimal > 0 Then
+ Dim Desc As Decimal = e.Row.DBCampo("Descuento").ToDecimal
+ e.Row.FCLiteral("LtlDescuento").Text = String.Format("{0}
{1}%", Desc.FormatoNumero, (Desc / (e.Row.DBCampo("Cantidad").ToDecimal * e.Row.DBCampo("PU").ToDecimal) * 100.0).FormatoNumero)
+ End If
e.Row.Cells(0).ToolTip = e.Row.DBCampo("CvePresupuestoEgreso")
'comente esta linea, RMF: 2015.04.20
@@ -6275,6 +6292,9 @@ Partial Class OC_OC
End If
End Sub
Protected Sub EnviarCorreoCambioEstatus(pCveEstatus As Integer, Estatus As String, Optional NotificarAlert As Boolean = True, Optional AsuntoMail As String = "")
+
+ If Not NotificacionCorreo Then Exit Sub
+
Dim strOpciones As New StringBuilder
If CveUsuario = -1 Or Not CBool(GlobalDTUsuarios(CveUsuario, CveEmpresa:=CveEmpresaActual).FiltroPrimeroValor("Estatus")) Then
CveUsuario = UsuarioActual.CveUsuario
@@ -6376,6 +6396,7 @@ Partial Class OC_OC
#Region " ENVIAR CORREO USUARIO ASIGNADO "
Protected Sub MandaCorreoUsuario(Para As String, CorreosCCP As String, CorreosCCPNombre As List(Of String), Optional NotificarAlert As Boolean = True)
+ If Not NotificacionCorreo Then Exit Sub
Dim strOpciones As New StringBuilder
Dim Body As String = GeneraCorreo(CveOrdenCompra, "") 'strOpciones.ToString) 'genero los datos de la OC
@@ -6397,6 +6418,7 @@ Partial Class OC_OC
End Sub
Protected Sub CorreoUsuarioAsignado(pCveEstatus As Integer, Estatus As String, Optional NotificarAlert As Boolean = True)
+ If Not NotificacionCorreo Then Exit Sub
If CBool(GlobalDTUsuarios(DdlUsuariosAsignado.SelectedValue.ToEntero, CveEmpresaActual).FiltroPrimeroValor("Estatus").ToString) Then
'Dim CorreosCCP As New List(Of String)
Dim StrCorreos As New StringBuilder
@@ -6434,6 +6456,7 @@ Partial Class OC_OC
#Region " enviarCorreoOrdenDeCompra "
Protected Sub EnviarCorreoOrdenCompra(CveOrdenCompra As Integer)
+ If Not NotificacionCorreo Then Exit Sub
Dim CveProveedor As Integer
Dim strOpciones As New StringBuilder
@@ -6458,6 +6481,7 @@ Partial Class OC_OC
#End Region
Private Function GeneraCorreo(CveOrdenCompra As Integer, Opciones As String, Optional IncluirDetalles As Boolean = True, Optional Bitacora As String = "", Optional LigaAdjunto As String = "") As String
+ If Not NotificacionCorreo Then Return ""
Dim strBody As New StringBuilder
Dim objOC As New ClsOC
@@ -6574,6 +6598,7 @@ Partial Class OC_OC
Return strBody.ToString
End Function
Private Function GeneraCorreoProveedor(CveOrdenCompra As Integer, ByRef CveProveedor As Integer) As String
+ If Not NotificacionCorreo Then Return ""
Dim strBody As New StringBuilder
Dim objOC As New ClsOC
@@ -7005,7 +7030,7 @@ Partial Class OC_OC
Return StrReturn
End Function
- Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click, LbDescargarExcel.Click
+ Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\FormatoOC.xlsx"
Dim Archivo As New IO.FileInfo(Directorio)
If Archivo.Exists Then
@@ -7122,7 +7147,6 @@ Partial Class OC_OC
BtnCancelarPrevio.Visible = False
BtnCrearApartirDe.Visible = False
-
uppSeguimientoEstatus.Update()
UPProv.Update()
UPPEmp.Update()
@@ -7204,7 +7228,6 @@ Partial Class OC_OC
CargarOptionAnticipos()
HlAgregarExcel.Visible = True
- LbDescargarExcel.Visible = True
CargaEstatusInicialFinal()
CargaEstatusUsuarios()
@@ -7250,8 +7273,8 @@ Partial Class OC_OC
BtnSolicitudAnticipo.Visible = False
HlAgregarExcel.Visible = True
- LbDescargarExcel.Visible = True
- BtnGeneraContrato.Visible = True : CargaClientesContrato()
+ 'BtnGeneraContrato.Visible = True
+ CargaClientesContrato()
LbVerificarExistencia.Visible = True
LnkAgregarGuia.Visible = False
@@ -9590,6 +9613,9 @@ Partial Class OC_OC
End Function
+ Protected Sub LnkDescargarDetalleExcel_Click(sender As Object, e As EventArgs)
+ GvD.ExportToExcel("des")
+ End Sub
End Class