This commit is contained in:
2019-10-22 11:14:17 -07:00
parent 783596d79d
commit 7c16087ef3
11 changed files with 6334 additions and 5786 deletions

5267
OC/OC.aspx

File diff suppressed because it is too large Load Diff

View File

@@ -174,6 +174,14 @@ Partial Class OC
ViewState("NumCotizacionesGanadoras") = value
End Set
End Property
Private Property NumCotizacionesEvaluar As Integer
Get
NumCotizacionesEvaluar = IfNull(ViewState("NumCotizacionesEvaluar"), "-1", ViewState("NumCotizacionesEvaluar")).ToString().ToEntero()
End Get
Set(value As Integer)
ViewState("NumCotizacionesEvaluar") = value
End Set
End Property
Private Property ProveedoresCotizacion As ArrayList
Get
ProveedoresCotizacion = DirectCast(ViewState("ProveedoresCotizacion"), ArrayList)
@@ -964,7 +972,7 @@ Partial Class OC
DtDetalle.Columns.Add("CveContratoDetalle", GetType(Integer))
DtDetalle.Columns.Add("CantidadNoEditable", GetType(Double))
DtDetalle.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
'DtDetalle.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
' DtDetalle.Columns.Add("ClasificacionOG", GetType(String))
@@ -1223,9 +1231,11 @@ Partial Class OC
DdlPrioridad.SelectedValueExist(objOC.Prioridad.ToString)
ChkCotizacion.Checked = objOC.RequiereCotizacion
If ChkCotizacion.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(565) = "1" Then
ChkCotizacion.Enabled = False
End If
tabCotizaciones.Enabled = objOC.RequiereCotizacion
tabCotizaciones.UpdatePanelID = uppOpciones.ID
TxtGuia.Text = objOC.Guia
@@ -1576,6 +1586,11 @@ Partial Class OC
'CARGA MOVTOS DE ALMACEN
InicializaMovtosAlmacen()
If UsuarioActual.Empresa.Funcionalidad(565) = "1" And pCveOrdenCompra > 0 And TipoOC.ToUpper() = "REQ" Then
RowCotizaciones.Visible = True
UpIvas.Update()
End If
uppEstatus.Update()
End Sub
@@ -2058,6 +2073,12 @@ Partial Class OC
Private Function ValidaGuardar() As Boolean
Dim TieneError = False
'Entrega Directa requiere Cliente y Vendedor
If ChkEntregaDirecta.Checked And Ddlcliente.SelectedValue.ToEntero <= 0 Then
Alert("Al ser una Entrega Directa es necesario seleccionar un cliente, por favor seleccione uno.")
Return True
End If
'VALIDA QUE TENGA REGISTROS
If Not GvD.Rows.Count > 0 Then
Alert(String.Format("La {0} debe de tener registros", TipoLargo), TipoMensaje.MsgAdvertencia)
@@ -2196,14 +2217,22 @@ Partial Class OC
End If
'VALIDA QUE TENGA LAS COTIZACIONES QUE DEBEN TENER
If UsuarioActual.Empresa.Funcionalidad(565) = "1" AndAlso CveConfianzaProveedor > 0 AndAlso (TipoOC.ToUpper = "REQ" And CveEstatusFinalOK = CboE.SelectedValue.ToEntero) Then
If UsuarioActual.Empresa.Funcionalidad(565) = "1" AndAlso (TipoOC.ToUpper = "REQ" And CveEstatusFinalOK = CboE.SelectedValue.ToEntero) Then
If CveConfianzaProveedor > 0 Then
'SUMA EL TOTAL DE COTIZACIONES
For Each GvRow As GridViewRow In GvBitacoraEva.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
Me.NumCotizacionesEvaluar += 1
End If
Next
If CveConfianzaProveedor = 1 AndAlso Me.NumCotizaciones < 1 Then
Alert("Para el proveedor seleccionado es necesario terner al menos 1 cotización.", TipoMensaje.MsgAdvertencia)
Me.NumCotizacionesEvaluar += Me.NumCotizaciones
If CveConfianzaProveedor = 1 AndAlso Me.NumCotizacionesEvaluar < 1 Then
Alert("Para el proveedor seleccionado es necesario tener al menos 1 cotización.", TipoMensaje.MsgAdvertencia)
TieneError = True
ElseIf CveConfianzaProveedor = 2 AndAlso Me.NumCotizaciones < 2 Then
Alert("Para el proveedor seleccionado es necesario terner al menos 2 cotizaciones", TipoMensaje.MsgAdvertencia)
ElseIf CveConfianzaProveedor = 2 AndAlso Me.NumCotizacionesEvaluar < 2 Then
Alert("Para el proveedor seleccionado es necesario tener al menos 2 cotizaciones", TipoMensaje.MsgAdvertencia)
TieneError = True
End If
@@ -2222,12 +2251,6 @@ Partial Class OC
End Function
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
'Entrega Directa requiere Cliente y Vendedor
If ChkEntregaDirecta.Checked And Ddlcliente.SelectedValue.ToEntero <= 0 Then
Alert("Al ser una Entrega Directa es necesario seleccionar un cliente, por favor seleccione uno.")
Exit Sub
End If
'VALIDACIONES PARA GUARDAR
If ValidaGuardar() Then Exit Sub
@@ -4501,18 +4524,48 @@ Partial Class OC
End If
End If
End Sub
Protected Sub GvBitacoraEva_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvBitacoraEva.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Archivo").ToString.Trim <> "" AndAlso CveOrdenCompra > 0 Then
e.Row.FCLinkButton("LinkArchivo").Visible = True
e.Row.FCLinkButton("LinkArchivo").CommandArgument = String.Format("OI\{0}", e.Row.DBCampo("Archivo").ToString)
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LinkArchivo")) 'Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione
End If
End If
End Sub
Protected Sub LnkAddCotEva_Click(sender As Object, e As EventArgs) Handles LnkAddCotEva.Click
HdnEsCotizacion.Value = "1"
ChkEventoPrioridad.Visible = False
HBitacora.InnerText = "Cotización"
LblBitacora.InnerText = "Cotización"
UPAddEventoBitacora.Update()
UpTituloBitacora.Update()
RegistraScript("$('#ModalBitacora').modal('show');")
End Sub
Protected Sub ImgAddObs_Click(sender As Object, e As EventArgs) Handles ImgAddObs.Click
HdnEsCotizacion.Value = "0"
ChkEventoPrioridad.Visible = True
HBitacora.InnerText = "Bitácora"
LblBitacora.InnerText = "Bitácora/Observaciones"
UPAddEventoBitacora.Update()
UpTituloBitacora.Update()
RegistraScript("$('#ModalBitacora').modal('show');")
End Sub
Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click
If CveOrdenCompra > 0 Then
GuardaBitacora()
GuardaBitacora(HdnEsCotizacion.Value.ToEntero() > 0)
Else
AgregaBitacoraTemporal()
End If
End Sub
#Region " GUARDA DIRECTO "
Private Sub GuardaBitacora()
Private Sub GuardaBitacora(Optional EsCotizacion As Boolean = False)
Dim ObjEventoBitacora As New ClsOIEventos
Dim FileExtension As String = ""
Dim Filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
@@ -4523,7 +4576,7 @@ Partial Class OC
Next
Dim descripcion As String = TxtEventoDescripcion.Text.Trim
Dim Prioridad As Integer = If(ChkEventoPrioridad.Checked, 3, 1)
Dim Prioridad As Integer = If(EsCotizacion, 4, If(ChkEventoPrioridad.Checked, 3, 1))
If ObjEventoBitacora.AddEventoBitacora(descripcion, String.Format("{0}", FileExtension), UsuarioActual.CveUsuario, CveEmpresaActual, CveOC:=CveOrdenCompra, Prioridad:=Prioridad) Then
@@ -4535,7 +4588,7 @@ Partial Class OC
TxtEventoDescripcion.Text = ""
Anexo.Text = "[]"
ChkEventoPrioridad.Checked = False
Alert("La bitácora/observación se guardó correctamente", TipoMensaje.MsgInformacion)
Alert($"La {If(EsCotizacion, "cotización", "bitácora/observación")} se guardó correctamente", TipoMensaje.MsgInformacion)
RegistraScript("$('#ModalBitacora').modal('hide')", "hidemodal")
'obtener el Evento de bitacora para enviar el correo
@@ -4562,7 +4615,8 @@ Partial Class OC
If ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento IN (6,2) AND CvePrioridad=3").Rows.Count > 0 Then
DivEventoUrgente.Visible = True
End If
GvEB.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento IN (6,2)")
GvEB.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento IN (6,2) AND CvePrioridad <> 4")
GvBitacoraEva.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CvePrioridad = 4")
Else
GvEB.DataSource = Nothing
End If
@@ -4570,7 +4624,9 @@ Partial Class OC
ObjEventoBitacora.Dispose()
GvEB.DataBind()
GvBitacoraEva.DataBind()
UPEventoBitacora.Update()
UpIvas.Update()
End Sub
#End Region
@@ -4638,7 +4694,7 @@ Partial Class OC
ChkEventoPrioridad.Checked = False
RegistraScript("$('#ModalBitacora').modal('hide')", "hidemodal")
CargaEventoBitacoraTemp()
CargaEventoBitacoraTemp()
End Sub
@@ -4703,7 +4759,7 @@ Partial Class OC
option72.Visible = True
DivFolioAdicional.Visible = True
generarAnticipo.Visible = True
Ddlcliente.DataSource = GlobalDTCliente(CveEmpresaActual).FiltraParametros(" Estatus = 'Activo' ")
Ddlcliente.DataSource = GlobalDTCliente(CveEmpresaActual)
Ddlcliente.DataBind()
Ddlcliente.Items.Insert(0, New ListItem(" - ", "-1"))
DdlVendedor.DataSource = GlobalDTVendedores(CveEmpresaActual)