-
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index fecbf4358..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()
@@ -1020,16 +1038,12 @@ Partial Class OC_OC
TrDescuentoProntoPago.Visible = True
End If
-
-
If UsuarioActual.Empresa.CveEmpresa = 189 AndAlso CveOrdenCompra <> Nothing AndAlso CveOrdenCompra > 0 Then
BtnEdicionMasiva.Visible = True
End If
-
End If
MostrarUsuarioAsignado()
-
ValidaCancelacionConAlamcen()
Me.Form.DefaultButton = ""
@@ -1396,9 +1410,9 @@ Partial Class OC_OC
Dim dts As DataRow = DT.FiltraParametros("CveSubProyecto = " + tCveSubProyecto.ToString).FiltroPrimero("")
If dts IsNot Nothing Then
ViewState("CveFolio") = dts("CveFolio").ToString.ToEntero
- If UsuarioActual.CveEmpresa = 189 Then
- lblFolio.Text = dts("Serie").ToString + " " + dts("FActual").ToString
- SerieFolio = dts("Serie").ToString + " " + dts("FActual").ToString
+ If ModalidadSubProyectoGeneral Then
+ lblFolio.Text = dts("Serie").ToString + "-" + dts("FActual").ToString
+ SerieFolio = dts("Serie").ToString + "-" + dts("FActual").ToString
Else
lblFolio.Text = TipoOC + " " + dts("FActual").ToString
SerieFolio = dts("FActual").ToString
@@ -1409,7 +1423,7 @@ Partial Class OC_OC
lblFolio.Text = TipoOC + " " + DT.Rows(0)("FActual").ToString
SerieFolio = DT.Rows(0)("FActual").ToString
Else
- Alert("No tiene registrados Folios en esta sucursal.", TipoMensaje.MsgAdvertencia)
+ Alert("No tiene registrados folios en esta sucursal.", TipoMensaje.MsgAdvertencia)
End If
DT.Dispose()
@@ -1466,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)
@@ -2921,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
@@ -2971,8 +2985,6 @@ Partial Class OC_OC
TieneError = True
End If
-
-
If CveOrdenTrabajo > 0 Then
Dim ObjAF As New ClsAF(OC.IniciaTransacSQL)
@@ -2981,9 +2993,6 @@ Partial Class OC_OC
End If
End If
-
-
-
End If
@@ -3019,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)))
@@ -3599,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
@@ -3694,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
@@ -4019,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
@@ -6279,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
@@ -6380,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
@@ -6401,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
@@ -6438,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
@@ -6462,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
@@ -6578,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
@@ -6901,8 +6922,12 @@ Partial Class OC_OC
SubProyecto = DrProyecto("SubProyecto").ToString
End If
Else
- CveProyecto = -1
- CveSubProyecto = -1
+ If ModalidadSubProyectoGeneral Then
+ CveSubProyecto = DdlSubProyectoGral.SelectedValue.ToEntero
+ Else
+ CveProyecto = -1
+ CveSubProyecto = -1
+ End If
End If
If Codigo.Length > 0 Then
@@ -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
@@ -7731,8 +7754,8 @@ Partial Class OC_OC
Private Function ValidarDescuentos() As Boolean
Dim Retorno As Boolean = True
- Dim DescuentoConceptos As Decimal = DtDetalle.SUMD("Descuento")
- Dim DescuentoGeneral As Decimal = TxtDescuento.Text.ToDecimal
+ Dim DescuentoConceptos As Decimal = DtDetalle.SUMD("Descuento").RoundSQL
+ Dim DescuentoGeneral As Decimal = TxtDescuento.Text.ToDecimal.RoundSQL
If DescuentoConceptos <> DescuentoGeneral Then
Alert(String.Format("Los descuentos no cuadran. Por favor de verificar.({0}-{1})", DescuentoConceptos, DescuentoGeneral), TipoMensaje.MsgAdvertencia)
@@ -9394,6 +9417,8 @@ Partial Class OC_OC
Protected Sub DdlSubProyectoGral_SelectedIndexChanged(sender As Object, e As EventArgs)
DdlSubProyecto.SelectedValueExist(DdlSubProyectoGral.SelectedValue)
+ DdlSubProyectoEntrega.SelectedValueExist(DdlSubProyectoGral.SelectedValue)
+ UPPLugarEntrega.Update()
UPPDetalle.Update()
CargaFolios()
End Sub
@@ -9588,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
diff --git a/Ventas/RepVentasUtilidadPadre.aspx b/Ventas/RepVentasUtilidadPadre.aspx
index 286745018..b62cca4b0 100644
--- a/Ventas/RepVentasUtilidadPadre.aspx
+++ b/Ventas/RepVentasUtilidadPadre.aspx
@@ -286,7 +286,7 @@
@@ -346,17 +346,18 @@
CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None" OnRowDataBound="GvPorcentajes_RowDataBound" >
-
+
-
-
+
+
+
+
+
+
-
-
-