Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -7,6 +7,7 @@ Imports DocumentFormat.OpenXml.Drawing.Diagrams
|
||||
Imports Extensiones
|
||||
Imports iText.StyledXmlParser.Css.Resolve.Shorthand.Impl
|
||||
Imports Microsoft.Owin.Security.Provider
|
||||
Imports Telerik.Web.UI
|
||||
|
||||
Partial Class Ventas_Promociones
|
||||
Inherits ClsPaginas
|
||||
@@ -84,18 +85,18 @@ Partial Class Ventas_Promociones
|
||||
End Property
|
||||
|
||||
|
||||
Private Property DTPSUltimoCosto As DataTable
|
||||
Get
|
||||
If ViewState("DTPSUltimoCosto") Is Nothing Then
|
||||
ViewState("DTPSUltimoCosto") = New DataTable
|
||||
End If
|
||||
'Private Property DTPSUltimoCosto As DataTable
|
||||
' Get
|
||||
' If ViewState("DTPSUltimoCosto") Is Nothing Then
|
||||
' ViewState("DTPSUltimoCosto") = New DataTable
|
||||
' End If
|
||||
|
||||
Return CType(ViewState("DTPSUltimoCosto"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTPSUltimoCosto") = value
|
||||
End Set
|
||||
End Property
|
||||
' Return CType(ViewState("DTPSUltimoCosto"), DataTable)
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("DTPSUltimoCosto") = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Private Property PermisoAutorizPromocionPorcentaje As Boolean
|
||||
Get
|
||||
@@ -158,7 +159,7 @@ Partial Class Ventas_Promociones
|
||||
PorMinMasCostoVentaFnc129 = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal
|
||||
PermisoAutorizPromocionPorcentaje = UsuarioActual.TienePermisoProceso(386)
|
||||
|
||||
EmpresaFnc382 = If(UsuarioActual.Empresa.Funcionalidad(352) = "1", True, False) 'Grupo díaz
|
||||
EmpresaFnc382 = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False) 'Grupo díaz
|
||||
'EmpresaFnc382 = True ''Para pruebas
|
||||
|
||||
CvePromocion = -1
|
||||
@@ -173,7 +174,6 @@ Partial Class Ventas_Promociones
|
||||
LnkAgrgarPlantillaPS.Visible = False
|
||||
|
||||
|
||||
|
||||
ValidaPromosiones(False)
|
||||
If EmpresaFnc382 AndAlso ChkEstatus.Checked = False AndAlso BloqueadoPromocionPorcentaje AndAlso Not PermisoAutorizPromocionPorcentaje Then
|
||||
ChkEstatus.Enabled = False
|
||||
@@ -345,20 +345,20 @@ Partial Class Ventas_Promociones
|
||||
|
||||
Private Sub CargaDTUltimoCosto()
|
||||
|
||||
If Not EmpresaFnc382 Then
|
||||
Exit Sub
|
||||
If EmpresaFnc382 Then
|
||||
Dim DTPSUltimoCosto = New DataTable
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
|
||||
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||
DTPSUltimoCosto = ObjInv.DtResultados
|
||||
End If
|
||||
|
||||
ObjInv.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
DTPSUltimoCosto = New DataTable
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
|
||||
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||
DTPSUltimoCosto = ObjInv.DtResultados
|
||||
End If
|
||||
|
||||
ObjInv.Dispose()
|
||||
|
||||
|
||||
End Sub
|
||||
@@ -619,6 +619,16 @@ Partial Class Ventas_Promociones
|
||||
End If
|
||||
|
||||
|
||||
Dim DTPSUltimoCosto = New DataTable
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||
DTPSUltimoCosto = ObjInv.DtResultados
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
|
||||
|
||||
|
||||
If PorMinMasCostoVentaFnc129 > 0 Then
|
||||
|
||||
For Each dRow As DataRow In TempDT.Rows
|
||||
@@ -792,6 +802,11 @@ Partial Class Ventas_Promociones
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
|
||||
If Not TieneError AndAlso BloqueadoPromocionPorcentaje Then
|
||||
MandaCorreoNotificacionPromocionBloqueo(CvePromocion, TxtPromocion.Text.Trim)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -847,24 +862,6 @@ Partial Class Ventas_Promociones
|
||||
|
||||
If Not TieneError Then
|
||||
|
||||
'366 Estatus
|
||||
|
||||
'367 CvePS
|
||||
'368 PUPromocion
|
||||
'369 CveTipoPromocion
|
||||
'370 Cantidad Minima
|
||||
'371 AplicaRestriccion
|
||||
'372 HoraInicio
|
||||
'373 HoraFin
|
||||
|
||||
'374 AplicaLunes
|
||||
'375 AplicaMartes
|
||||
'376 AplicaMiercoles
|
||||
'377 AplicaJueves
|
||||
'378 AplicaViernes
|
||||
'379 AplicaSabado
|
||||
'380 AplicaDomingo
|
||||
'381 IncluyeImpuestos
|
||||
|
||||
|
||||
Dim Dr2 As DataRow = TempDTOrigial.FiltraParametros($"CvePromocionDetalle = {Dr("CvePromocionDetalle").ToString}").Rows(0)
|
||||
@@ -893,12 +890,7 @@ Partial Class Ventas_Promociones
|
||||
End If
|
||||
|
||||
|
||||
'If Not TieneError And Dr("AplicaRestriccion").ToString <> Dr2("AplicaRestriccion").ToString Then
|
||||
' If Not ObjGral.AddHistorialBitacora(371, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr2("AplicaRestriccion").ToString, $"{Dr("CodigoPS").ToString} - {Dr("AplicaRestriccion").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
|
||||
' TieneError = True
|
||||
' Exit For
|
||||
' End If
|
||||
'End If
|
||||
|
||||
|
||||
If Not TieneError And Dr("HoraInicio").ToString <> Dr2("HoraInicio").ToString Then
|
||||
If Not ObjGral.AddHistorialBitacora(372, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("HoraInicio").ToString, $"{Dr("CodigoPS").ToString} - {Dr2("HoraInicio").ToString}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then
|
||||
@@ -1043,7 +1035,7 @@ Partial Class Ventas_Promociones
|
||||
If EmpresaFnc382 AndAlso EstatusOriginal = False AndAlso ChkEstatus.Checked And BloqueadoPromocionPorcentaje Then
|
||||
|
||||
Dim objGeneral As New ClsGenerales(ObjVentas.IniciaTransacSQL)
|
||||
If Not objGeneral.AddHistorialBitacora(360, -1, -1, -1, -1, -1, -1, -1, "Si Autoriza con bloqueo", "No", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "", "", "", CvePromocion:=CvePromocion) Then
|
||||
If Not objGeneral.AddHistorialBitacora(360, -1, -1, -1, -1, -1, -1, -1, "Se Autorizo con bloqueo", "No", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, "", "", "", CvePromocion:=CvePromocion) Then
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
@@ -1069,6 +1061,51 @@ Partial Class Ventas_Promociones
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "ENVIAR CORREO PROMOSION BLOQUEADA"
|
||||
|
||||
|
||||
Private Sub MandaCorreoNotificacionPromocionBloqueo(CvePromocionNueva As Integer, PromocionNueva As String)
|
||||
Dim Asunto, Para, ArrayCC, Body, URL As String
|
||||
Asunto = $"Promoción {PromocionNueva} requiere autorización"
|
||||
Para = ""
|
||||
ArrayCC = ""
|
||||
URL = ""
|
||||
|
||||
If Request.Url.Port = 80 Then
|
||||
URL = $"{Request.Url.Scheme}://{Request.Url.Host}{Request.Url.AbsolutePath}?CvePromocion={CvePromocionNueva}"
|
||||
Else
|
||||
URL = $"{Request.Url.Scheme}://{Request.Url.Host}:{Request.Url.Port}{Request.Url.AbsolutePath}?CvePromocion={CvePromocionNueva}"
|
||||
End If
|
||||
|
||||
Body = $"Se a registrado promoción que requiere autorización <a href='{URL}' >{PromocionNueva}</a>"
|
||||
|
||||
Dim objUsu As New ClsSisUsuarios
|
||||
Dim ListaCorreos As New List(Of String)
|
||||
If objUsu.GetPermisosPorUsuarioProcesos(-1, -1, -1, -1, 386, CveEmpresa:=UsuarioActual.CveEmpresa) Then
|
||||
For Each dRow As DataRow In objUsu.DtResultados.Rows
|
||||
If dRow("Correo").ToString.Trim.Length > 0 Then
|
||||
ListaCorreos.Add(dRow("Correo").ToString)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
objUsu.Dispose()
|
||||
|
||||
If ListaCorreos.Count > 0 Then
|
||||
|
||||
Para = String.Join(";", ListaCorreos)
|
||||
|
||||
Dim Mail As New ClsSisMail()
|
||||
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, ArrayCC, LSRutasMail)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region " ELIMINAR "
|
||||
Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs)
|
||||
@@ -1114,22 +1151,6 @@ Partial Class Ventas_Promociones
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
'Protected Sub DdlTipoPromocion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPromocion.SelectedIndexChanged
|
||||
' If DdlTipoPromocion.SelectedValue = "3" Then
|
||||
' DivCantMinima.Visible = True
|
||||
' Else
|
||||
' DivCantMinima.Visible = False
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
|
||||
@@ -1294,11 +1315,6 @@ Partial Class Ventas_Promociones
|
||||
ObjPS.Dispose()
|
||||
|
||||
|
||||
'Dim ObjGral As New ClsGenerales
|
||||
'If ObjGral.GetRinTamanios(UsuarioActual.CveEmpresa) Then
|
||||
' DTRines = ObjGral.DtResultados
|
||||
'End If
|
||||
'ObjGral.Dispose()
|
||||
DTRines = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa)
|
||||
|
||||
Dim RegistroActual As Integer = 1
|
||||
@@ -1308,8 +1324,6 @@ Partial Class Ventas_Promociones
|
||||
|
||||
Dim ClasificacionStr, CodigoStr, TipoPromocionStr, PromocionStr, CantidadMinimaStr, RinStr, IncluyeImpuestosStr As String
|
||||
|
||||
|
||||
|
||||
ClasificacionStr = dRow("Clasificacion").ToString.Trim
|
||||
CodigoStr = dRow("Codigo").ToString.Trim
|
||||
TipoPromocionStr = dRow("TipoPromocion").ToString.Trim
|
||||
@@ -1387,7 +1401,6 @@ Partial Class Ventas_Promociones
|
||||
|
||||
Next
|
||||
|
||||
|
||||
If Errores.ToString.Length = 0 Then
|
||||
DTPlantilla.AcceptChanges()
|
||||
Return True
|
||||
@@ -1396,20 +1409,23 @@ Partial Class Ventas_Promociones
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
Protected Sub DdlPS_selectedindexchange(sender As Object, e As EventArgs)
|
||||
|
||||
Dim DTPSUltimoCosto = New DataTable
|
||||
|
||||
Dim ObjInv As New ClsInventarios
|
||||
If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then
|
||||
DTPSUltimoCosto = ObjInv.DtResultados
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
|
||||
LblUltimoCosto.Text = DTPSUltimoCosto.FiltroPrimeroValor("UltimoCosto", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero
|
||||
LblCostoPromedio.Text = DTPSUltimoCosto.FiltroPrimeroValor("CostoPromedio", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero
|
||||
|
||||
UpAgregar.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user