diff --git a/AF/RepDepreciacion.aspx.vb b/AF/RepDepreciacion.aspx.vb
index 77c32ae7f..03b7aaf75 100644
--- a/AF/RepDepreciacion.aspx.vb
+++ b/AF/RepDepreciacion.aspx.vb
@@ -13,7 +13,7 @@ Partial Class AF_RepDepreciacion
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- txtFechaI.Text = Now.ToString
+ txtFechaI.Text = New Date(Now.Year, Now.Month + 1, 1).AddDays(-1).ToString("dd/MM/yyyy")
End If
End Sub
@@ -35,6 +35,7 @@ Partial Class AF_RepDepreciacion
Dim CvePrePoliza = ObjConta.AddPrePolizas("Depreciacion", 74, 0, 0, 1, txtFechaI.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+
For Each RowsDt As GridViewRow In GvDatos.Rows
CveActivoFijo = RowsDt.DataKey("CveActivoFijo").ToEntero
If RowsDt.FCLiteral("LtlDepreciacionMensual").Text.ToDouble > 0 And CveActivoFijo <> 0 Then
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 31e4184e0..d80321677 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -193,7 +193,7 @@ Public Class ClsContabilidad
End Function
Public Function AddPrePolizas(Modulo As String, CvePlantillaPoliza As Integer, Cargos As Double, Abonos As Double, CveMoneda As Integer, Fecha As Date, Concepto As String, CveUsuario As Integer, CveEmpresa As Integer, Optional FolioFijo As Integer = 0, Optional ReglaFolioPoliza As String = "", Optional CveTipoPoliza As Integer = -1,
- Optional AgregarFolio As Boolean = False, Optional TipoContable As Integer = -1) As Integer
+ Optional AgregarFolio As Boolean = False, Optional TipoContable As Integer = 1) As Integer
FolioPoliza = -1
Dim Retorno As Integer = -1
diff --git a/App_Code/ClsOIEventos.vb b/App_Code/ClsOIEventos.vb
index 8d262bcc5..6d9a760da 100644
--- a/App_Code/ClsOIEventos.vb
+++ b/App_Code/ClsOIEventos.vb
@@ -221,9 +221,15 @@ Public Class ClsOIEventos
End Sub
#End Region
- Public Sub IniciaTransacSQL()
- SqlTransacc = SqlConexion.BeginTransaction()
- End Sub
+ 'Public Sub IniciaTransacSQL()
+ ' SqlTransacc = SqlConexion.BeginTransaction()
+
+ 'End Sub
+
+ Public Function IniciaTransacSQL() As SqlTransaction
+ If SqlTransacc Is Nothing Then SqlTransacc = SqlConexion.BeginTransaction()
+ Return SqlTransacc
+ End Function
Public Sub RollBack()
SqlTransacc.Rollback()
End Sub
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 98aa0cbe1..67d37fb3b 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -2151,7 +2151,7 @@ Public Class ClsVentas
End Function
Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean,
CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String,
- Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1) As Integer
+ Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1, Optional CvePromocionPadre As Integer = -1) As Integer
Dim Retorno = -1
DataAdapter("PA_Vta_PromocionesAdd")
@@ -2169,6 +2169,7 @@ Public Class ClsVentas
.Add("@TipoAplicacion", SqlDbType.VarChar).Value = TipoAplicacion
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@EsDistribuidor", SqlDbType.Int).Value = EsDistribuidor
+ .Add("@CvePromocionPadre", SqlDbType.Int).Value = CvePromocionPadre
.Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -2181,6 +2182,30 @@ Public Class ClsVentas
Return Retorno
End Function
+
+
+ Public Function AddPromociones(CvePromocion As Integer, CveUsuario As Integer, CveEmpresa As Integer, Actualizar As Boolean) As Integer
+ Dim Retorno = -1
+ DataAdapter("PA_Vta_PromocionesAddClonar")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Actualizar", SqlDbType.Bit).Value = Actualizar
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = SqlAdapter.SelectCommand.Parameters("@CvePromocion").Value.ToString.ToEntero
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar la Promoción.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
Public Function UpdatePromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean,
CveMoneda As Integer, CveUsuario As Integer, CvePromocion As Integer, CveSubProyecto As Integer, TipoAplicacion As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional EsDistribuidor As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -2278,7 +2303,7 @@ Public Class ClsVentas
Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double,
AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean,
AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1,
- Optional CveClasificacion As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional IncluyeImpuestos As Boolean = False) As Boolean
+ Optional CveClasificacion As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional IncluyeImpuestos As Boolean = False, Optional Opcion As Integer = 1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesDetalleAdd")
@@ -2304,6 +2329,7 @@ Public Class ClsVentas
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño
.Add("@IncluyeImpuestos", SqlDbType.Bit).Value = IncluyeImpuestos
+ .Add("@Opcion", SqlDbType.Int).Value = Opcion
End With
Try
@@ -2357,12 +2383,39 @@ Public Class ClsVentas
Return Retorno
End Function
- Public Function RemovePromocionesDetalle(CvePromocionDetalle As Integer) As Boolean
+ Public Function SincronizarPromocionesClonar(CvePromocion As Integer, CveUsuario As Integer, CveEmpresa As Integer, Opcion As Integer) As Boolean
+ 'Opcion 1 replicar insert
+ 'Opcion 2 replicar actualización
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_PromocionesClonar")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@Opcion", SqlDbType.Int).Value = Opcion
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError($"Ocurrió un error al actualizar las franquicias.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
+
+
+ Public Function RemovePromocionesDetalle(CvePromocionDetalle As Integer, Optional Opcion As Integer = 1, Optional CvePromocion As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesDetalleRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle
+ .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion
+ .Add("@Opcion", SqlDbType.Int).Value = Opcion
End With
Try
@@ -2374,6 +2427,7 @@ Public Class ClsVentas
Return Retorno
End Function
+
#End Region
#Region "Pruebas"
@@ -5474,20 +5528,14 @@ Public Class ClsVentas
End Function
- Public Function GetLineasAdicionales(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, TipoLinea As Integer, CveMoneda As Integer,
- FechaI As Date, FechaF As Date, CveLineaAdicionalEstatus As Integer, CveEmpresa As Integer) As Boolean
+ Public Function GetLineasAdicionales(CveCliente As Integer, TipoLinea As Integer, CveMoneda As Integer, CveLineaAdicionalEstatus As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_LineasAdicionalesGet")
With SqlAdapter.SelectCommand.Parameters
-
- .Add("@CveLineaAdicional", SqlDbType.Int).Value = CveLineaAdicional
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
- .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@TipoLinea", SqlDbType.Int).Value = TipoLinea
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
- .Add("@FechaI", SqlDbType.Date).Value = FechaI
- .Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveLineaAdicionalEstatus", SqlDbType.Int).Value = CveLineaAdicionalEstatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx
index 2f5a0ee5d..79411b565 100644
--- a/Ashx/CargaEventos.ashx
+++ b/Ashx/CargaEventos.ashx
@@ -101,98 +101,138 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
Try
For Each dr As DataRow In ObjEventos.DtResultados.Rows
- Dim cevent As CalendarEvent = New CalendarEvent()
- cevent.id = dr("CveEvento").ToString.ToEntero
- cevent.title = dr("Asunto").ToString
- cevent.description = dr("Descripcion").ToString
- cevent.start = String.Format("{0:s}", dr("FechaInicio").ToString.ToDateTime)
- cevent.end = String.Format("{0:s}", dr("FechaFin").ToString.ToDateTime)
- cevent.allDay = False
- cevent.CveEventoEstatus = dr("CveEventoEstatus").ToString.ToEntero
- cevent.cveagendatipo = dr("CveAgendaTipo").ToString
- cevent.prioridad = dr("CvePrioridad").ToString.ToEntero
- cevent.backgroundColor = dr("BackGroundColor").ToString
- cevent.recurrenciatipo = dr("RecurrenciaTipo").ToString.ToEntero
- cevent.frecuencia = dr("Frecuencia").ToString.ToEntero
- cevent.diassemana = dr("DiasSemana").ToString
- cevent.dia = dr("Dia").ToString.ToEntero
- cevent.mes = dr("Mes").ToString.ToEntero
- cevent.recurrenciafin = dr("RecurrenciaFin").ToString
- cevent.CveProspecto = dr("CveProspecto").ToString.ToEntero
- cevent.Prospecto = dr("Prospecto").ToString
- cevent.CveTipoEvento = dr("Prospecto").ToString.ToEntero
- cevent.EmpresaCRM = dr("EmpresaCRM").ToString
- cevent.SubProyecto = dr("SubProyecto").ToString
- cevent.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
- cevent.Direccion = dr("Direccion").ToString
- '11/05/2018 - Evento Gasto Recurrente
- cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero
- If cevent.CveTipoEvento = 10 Then
- cevent.Importe = dr("Importe").ToString.ToDouble
- End If
+ If dr("CveEventoEstatus").ToString.ToEntero <> 5 Then
- If cevent.CveEventoEstatus.ToString.ToEntero = 3 Then
- cevent.backgroundColor = "#1BBC9B"
- End If
+ Dim cevent As CalendarEvent = New CalendarEvent()
+ cevent.id = dr("CveEvento").ToString.ToEntero
+ cevent.title = dr("Asunto").ToString
+ cevent.description = dr("Descripcion").ToString
+ cevent.start = String.Format("{0:s}", dr("FechaInicio").ToString.ToDateTime)
+ cevent.end = String.Format("{0:s}", dr("FechaFin").ToString.ToDateTime)
+ cevent.allDay = False
+ cevent.CveEventoEstatus = dr("CveEventoEstatus").ToString.ToEntero
+ cevent.cveagendatipo = dr("CveAgendaTipo").ToString
+ cevent.prioridad = dr("CvePrioridad").ToString.ToEntero
+ cevent.backgroundColor = dr("BackGroundColor").ToString
+ cevent.recurrenciatipo = dr("RecurrenciaTipo").ToString.ToEntero
+ cevent.frecuencia = dr("Frecuencia").ToString.ToEntero
+ cevent.diassemana = dr("DiasSemana").ToString
+ cevent.dia = dr("Dia").ToString.ToEntero
+ cevent.mes = dr("Mes").ToString.ToEntero
+ cevent.recurrenciafin = dr("RecurrenciaFin").ToString
+ cevent.CveProspecto = dr("CveProspecto").ToString.ToEntero
+ cevent.Prospecto = dr("Prospecto").ToString
+ cevent.CveTipoEvento = dr("Prospecto").ToString.ToEntero
+ cevent.EmpresaCRM = dr("EmpresaCRM").ToString
+ cevent.SubProyecto = dr("SubProyecto").ToString
+ cevent.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
+ cevent.Direccion = dr("Direccion").ToString
- 'VERIFICAMOS SI TIENE O NO RECURRENCIA
- If Not cevent.recurrenciatipo > 0 Then
-
- 'AGREGAMOS CUANDO NO ES RECURRENTE
- Dim tFecha As DateTime = DateAdd(DateInterval.Month, -6, Date.Now)
- 'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
- If dr("FechaFin").ToString.ToDateTime > tFecha Or dr("FechaInicio").ToString.ToDateTime > tFecha Then
- events.Add(cevent)
+ '11/05/2018 - Evento Gasto Recurrente
+ cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero
+ If cevent.CveTipoEvento = 10 Then
+ cevent.Importe = dr("Importe").ToString.ToDouble
End If
- Else
- 'EMPIEZA METODO PARA AGREGAR CUANDO SI ES RECURRENTE
+ If cevent.CveEventoEstatus.ToString.ToEntero = 3 Then
+ cevent.backgroundColor = "#1BBC9B"
+ End If
- Dim FinRecurrencia = cevent.recurrenciafin.ToEntero
- Dim FI As DateTime, FF As DateTime, FT As DateTime
- Dim DiasSemana = cevent.diassemana.Split(","c)
- FI = cevent.start.ToDateTime
- FF = cevent.end.ToDateTime
+ 'VERIFICAMOS SI TIENE O NO RECURRENCIA
+ If Not cevent.recurrenciatipo > 0 Then
- 'OBTENEMOS LA FECHA TERMINO (FT) DE LA RECURRENCIA
- Select Case FinRecurrencia
- Case -1
- FT = DateAdd(DateInterval.Year, 2, dr("FechaInicio").ToString.ToDateTime)
- Case 0
- FT = dr("RecurrenciaFin").ToString.ToDate
- Case Is > 0
- FinRecurrencia -= 1
- Select Case cevent.recurrenciatipo
- Case 1
- FT = DateAdd(DateInterval.Hour, FinRecurrencia * cevent.frecuencia, dr("FechaInicio").ToString.ToDateTime)
- Case 2
- FT = DateAdd(DateInterval.Day, FinRecurrencia * cevent.frecuencia, dr("FechaInicio").ToString.ToDateTime)
- Case 3
- FT = DateAdd(DateInterval.WeekOfYear, FinRecurrencia * cevent.frecuencia, dr("FechaInicio").ToString.ToDateTime)
- FT = DateAdd(DateInterval.Day, (7 - Weekday(FT)).ToString.ToDouble, FT)
- Case 4
- FT = DateAdd(DateInterval.Month, FinRecurrencia * cevent.frecuencia, dr("FechaInicio").ToString.ToDateTime)
- Case 5
- FT = DateAdd(DateInterval.Year, FinRecurrencia * cevent.frecuencia, dr("FechaInicio").ToString.ToDateTime)
- End Select
- End Select
+ 'AGREGAMOS CUANDO NO ES RECURRENTE
+ Dim tFecha As DateTime = DateAdd(DateInterval.Month, -6, Date.Now)
+ 'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
+ If dr("FechaFin").ToString.ToDateTime > tFecha Or dr("FechaInicio").ToString.ToDateTime > tFecha Then
+ events.Add(cevent)
+ End If
+ Else
- 'SI ES TIPO SEMANAL Y DIASSEMANA TIENE VALORES CHECKEA ESTOS VALORES
- Do
- If DiasSemana.Length > 0 AndAlso DiasSemana(0) <> "" Then
- For Each drDias As String In DiasSemana
- Dim FIT = FI, FFT = FF
+ 'EMPIEZA METODO PARA AGREGAR CUANDO SI ES RECURRENTE
- FIT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FI)).ToString.ToDouble, FI)
- FFT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FF)).ToString.ToDouble, FF)
+ Dim FinRecurrencia = cevent.recurrenciafin.ToEntero
+ Dim FI As DateTime, FF As DateTime, FT As DateTime
+ Dim DiasSemana = cevent.diassemana.Split(","c)
+ FI = cevent.start.ToDateTime
+ FF = cevent.end.ToDateTime
+ 'OBTENEMOS LA FECHA TERMINO (FT) DE LA RECURRENCIA
+ Select Case FinRecurrencia
+ Case -1
+ FT = DateAdd(DateInterval.Year, 2, dr("FechaInicio").ToString.ToDateTime)
+ Case 0
+ FT = dr("RecurrenciaFin").ToString.ToDate
+ Case Is > 0
+ FinRecurrencia -= 1
+ Select Case cevent.recurrenciatipo
+ Case 1
+ FT = DateAdd(DateInterval.Hour, FinRecurrencia * cevent.frecuencia, dr("FechaInicio").ToString.ToDateTime)
+ Case 2
+ FT = DateAdd(DateInterval.Day, FinRecurrencia * cevent.frecuencia, dr("FechaInicio").ToString.ToDateTime)
+ Case 3
+ FT = DateAdd(DateInterval.WeekOfYear, FinRecurrencia * cevent.frecuencia, dr("FechaInicio").ToString.ToDateTime)
+ FT = DateAdd(DateInterval.Day, (7 - Weekday(FT)).ToString.ToDouble, FT)
+ Case 4
+ FT = DateAdd(DateInterval.Month, FinRecurrencia * cevent.frecuencia, dr("FechaInicio").ToString.ToDateTime)
+ Case 5
+ FT = DateAdd(DateInterval.Year, FinRecurrencia * cevent.frecuencia, dr("FechaInicio").ToString.ToDateTime)
+ End Select
+ End Select
+
+ 'SI ES TIPO SEMANAL Y DIASSEMANA TIENE VALORES CHECKEA ESTOS VALORES
+ Do
+ If DiasSemana.Length > 0 AndAlso DiasSemana(0) <> "" Then
+ For Each drDias As String In DiasSemana
+ Dim FIT = FI, FFT = FF
+
+ FIT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FI)).ToString.ToDouble, FI)
+ FFT = DateAdd(DateInterval.Day, (drDias.ToEntero - Weekday(FF)).ToString.ToDouble, FF)
+
+ cevent = New CalendarEvent()
+ cevent.id = dr("CveEvento").ToString.ToEntero
+ cevent.title = dr("Asunto").ToString
+ cevent.description = dr("Descripcion").ToString
+ cevent.start = String.Format("{0:s}", FIT)
+ cevent.end = String.Format("{0:s}", FFT)
+ cevent.allDay = False
+ cevent.CveEventoEstatus = dr("CveEventoEstatus").ToString.ToEntero
+ cevent.cveagendatipo = dr("CveAgendaTipo").ToString
+ cevent.prioridad = dr("CvePrioridad").ToString.ToEntero
+ cevent.backgroundColor = dr("BackGroundColor").ToString
+
+ cevent.recurrenciatipo = dr("RecurrenciaTipo").ToString.ToEntero
+ cevent.frecuencia = dr("Frecuencia").ToString.ToEntero
+ cevent.diassemana = dr("DiasSemana").ToString
+ cevent.dia = dr("Dia").ToString.ToEntero
+ cevent.mes = dr("Mes").ToString.ToEntero
+ cevent.recurrenciafin = dr("RecurrenciaFin").ToString
+ cevent.CveProspecto = dr("CveProspecto").ToString.ToEntero
+ cevent.Prospecto = dr("Prospecto").ToString
+
+ '11/05/2018 - Evento Gasto Recurrente
+ cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero
+ If cevent.CveTipoEvento = 10 Then
+ cevent.Importe = dr("Importe").ToString.ToDouble
+ End If
+
+ If cevent.CveEventoEstatus.ToString.ToEntero = 3 Then
+ cevent.backgroundColor = "#1BBC9B"
+ End If
+
+ 'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL Y/0 SI LA FECHA INICIAL DE LA RECURRENCIA ES MENOR A LA FECHA QUE SE CREO EL EVENTO NO LO AGREGA
+ If FIT > DateAdd(DateInterval.Month, -6, Date.Now) And FIT >= dr("FechaInicio").ToString.ToDateTime Then
+ events.Add(cevent)
+ End If
+ Next
+ Else
cevent = New CalendarEvent()
cevent.id = dr("CveEvento").ToString.ToEntero
cevent.title = dr("Asunto").ToString
cevent.description = dr("Descripcion").ToString
- cevent.start = String.Format("{0:s}", FIT)
- cevent.end = String.Format("{0:s}", FFT)
+ cevent.start = String.Format("{0:s}", FI)
+ cevent.end = String.Format("{0:s}", FF)
cevent.allDay = False
cevent.CveEventoEstatus = dr("CveEventoEstatus").ToString.ToEntero
cevent.cveagendatipo = dr("CveAgendaTipo").ToString
@@ -218,69 +258,37 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
cevent.backgroundColor = "#1BBC9B"
End If
- 'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL Y/0 SI LA FECHA INICIAL DE LA RECURRENCIA ES MENOR A LA FECHA QUE SE CREO EL EVENTO NO LO AGREGA
- If FIT > DateAdd(DateInterval.Month, -6, Date.Now) And FIT >= dr("FechaInicio").ToString.ToDateTime Then
+ 'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
+ If FI > DateAdd(DateInterval.Month, -6, Date.Now) Then
events.Add(cevent)
End If
- Next
- Else
- cevent = New CalendarEvent()
- cevent.id = dr("CveEvento").ToString.ToEntero
- cevent.title = dr("Asunto").ToString
- cevent.description = dr("Descripcion").ToString
- cevent.start = String.Format("{0:s}", FI)
- cevent.end = String.Format("{0:s}", FF)
- cevent.allDay = False
- cevent.CveEventoEstatus = dr("CveEventoEstatus").ToString.ToEntero
- cevent.cveagendatipo = dr("CveAgendaTipo").ToString
- cevent.prioridad = dr("CvePrioridad").ToString.ToEntero
- cevent.backgroundColor = dr("BackGroundColor").ToString
-
- cevent.recurrenciatipo = dr("RecurrenciaTipo").ToString.ToEntero
- cevent.frecuencia = dr("Frecuencia").ToString.ToEntero
- cevent.diassemana = dr("DiasSemana").ToString
- cevent.dia = dr("Dia").ToString.ToEntero
- cevent.mes = dr("Mes").ToString.ToEntero
- cevent.recurrenciafin = dr("RecurrenciaFin").ToString
- cevent.CveProspecto = dr("CveProspecto").ToString.ToEntero
- cevent.Prospecto = dr("Prospecto").ToString
-
- '11/05/2018 - Evento Gasto Recurrente
- cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero
- If cevent.CveTipoEvento = 10 Then
- cevent.Importe = dr("Importe").ToString.ToDouble
End If
- If cevent.CveEventoEstatus.ToString.ToEntero = 3 Then
- cevent.backgroundColor = "#1BBC9B"
- End If
+ Select Case cevent.recurrenciatipo
+ Case 1
+ FI = DateAdd(DateInterval.Hour, cevent.frecuencia, FI)
+ FF = DateAdd(DateInterval.Hour, cevent.frecuencia, FF)
+ Case 2
+ FI = DateAdd(DateInterval.Day, cevent.frecuencia, FI)
+ FF = DateAdd(DateInterval.Day, cevent.frecuencia, FF)
+ Case 3
+ FI = DateAdd(DateInterval.WeekOfYear, cevent.frecuencia, FI)
+ FF = DateAdd(DateInterval.WeekOfYear, cevent.frecuencia, FF)
+ Case 4
+ FI = DateAdd(DateInterval.Month, cevent.frecuencia, FI)
+ FF = DateAdd(DateInterval.Month, cevent.frecuencia, FF)
+ Case 5
+ FI = DateAdd(DateInterval.Year, cevent.frecuencia, FI)
+ FF = DateAdd(DateInterval.Year, cevent.frecuencia, FF)
+ End Select
- 'SI LA FECHA DEL EVENTO ES MENOR DE 6 MESES DE LA FECHA ACTUAL NO LO AGREGA
- If FI > DateAdd(DateInterval.Month, -6, Date.Now) Then
- events.Add(cevent)
- End If
- End If
+ Loop Until FI > FT
+ End If
- Select Case cevent.recurrenciatipo
- Case 1
- FI = DateAdd(DateInterval.Hour, cevent.frecuencia, FI)
- FF = DateAdd(DateInterval.Hour, cevent.frecuencia, FF)
- Case 2
- FI = DateAdd(DateInterval.Day, cevent.frecuencia, FI)
- FF = DateAdd(DateInterval.Day, cevent.frecuencia, FF)
- Case 3
- FI = DateAdd(DateInterval.WeekOfYear, cevent.frecuencia, FI)
- FF = DateAdd(DateInterval.WeekOfYear, cevent.frecuencia, FF)
- Case 4
- FI = DateAdd(DateInterval.Month, cevent.frecuencia, FI)
- FF = DateAdd(DateInterval.Month, cevent.frecuencia, FF)
- Case 5
- FI = DateAdd(DateInterval.Year, cevent.frecuencia, FI)
- FF = DateAdd(DateInterval.Year, cevent.frecuencia, FF)
- End Select
- Loop Until FI > FT
End If
+
+
Next
Catch ex As Exception
GuardaLog(ex.ToString())
diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb
index 57848c6e1..5b5937e02 100644
--- a/Bancos/DepositosCaja.aspx.vb
+++ b/Bancos/DepositosCaja.aspx.vb
@@ -43,8 +43,8 @@ Partial Class Bancos_DepositosCaja
DdlCajaChica.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoCuenta = 1", "", {"CveCuenta", "NumCuentaMoneda"})
DdlCajaChica.DataBind()
- 'código temporal, para claudia y toñita, monge, anadelia, alba
- If UsuarioActual.CveUsuario.Contiene(1937, 2452, 3358, 3033, 2897) Then
+ 'código temporal, para claudia y toñita, monge, anadelia, alba,patricia
+ If UsuarioActual.CveUsuario.Contiene(1937, 2452, 3358, 3033, 2897, 2560) Then
DdlCajaChica.Items.Add(New ListItem("Todas", "-1"))
divFolio.Visible = True
End If
@@ -255,8 +255,8 @@ Partial Class Bancos_DepositosCaja
CveTransaccionBanco = 6
End If
- 'código temporal, para claudia y toñita, monge, anadelia, alba
- If UsuarioActual.CveUsuario.Contiene(1937, 2452, 3358, 3033, 2897) Then
+ 'código temporal, para claudia y toñita, monge, anadelia, alba,patricia
+ If UsuarioActual.CveUsuario.Contiene(1937, 2452, 3358, 3033, 2897, 2560) Then
FolioIE = TxtFolio.Text.ToEntero
End If
diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb
index 9efa900c9..8bfe86260 100644
--- a/Bancos/FluctuacionCambiaria.aspx.vb
+++ b/Bancos/FluctuacionCambiaria.aspx.vb
@@ -139,10 +139,8 @@ Partial Class Bancos_FluctuacionCambiaria
LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero
LblComprasPerdidaGanancia.Text = If(Final < 0, "Ganancia", "Pérdida")
- LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
- Else
- GvProveedores.DataSource = Nothing
- Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
+ LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
+
End If
ObjBancos.Dispose()
GvProveedores.DataBind()
@@ -179,10 +177,8 @@ Partial Class Bancos_FluctuacionCambiaria
LtIndicador_CPPesosFinal.Text = Final.Abs.ToString.FormatoNumero
LblComprasPerdidaGanancia.Text = If(Final > 0, "Ganancia", "Pérdida")
- LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
- Else
- GvProveedoresAnt.DataSource = Nothing
- Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
+ LblTotal = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
+
End If
ObjBancos.Dispose()
GvProveedoresAnt.DataBind()
@@ -220,10 +216,8 @@ Partial Class Bancos_FluctuacionCambiaria
LblTotalVentas.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
- UpIndicadoresVentas.Visible = True
- Else
- GvVentas.DataSource = Nothing
- Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
+ UpIndicadoresVentas.Visible = True
+
End If
ObjBancos.Dispose()
GvVentas.DataBind()
@@ -257,10 +251,8 @@ Partial Class Bancos_FluctuacionCambiaria
LblTotalVentasAnt.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
- UpIndicadoresVentas.Visible = True
- Else
- GvClientesAnt.DataSource = Nothing
- Alert("Ocurrio un error al cargar las compras", TipoMensaje.MsgAdvertencia)
+ UpIndicadoresVentas.Visible = True
+
End If
ObjBancos.Dispose()
GvClientesAnt.DataBind()
@@ -359,7 +351,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosDeudores()
Dim ObjBancos As New ClsBancos
LblTotalDeudores.Text = "0.00"
- If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 5, UsuarioActual.CveEmpresa) Then
+ If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 9, UsuarioActual.CveEmpresa) Then
GvDeudores.DataSource = ObjBancos.DtResultados
LblTotalDeudores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
@@ -374,7 +366,7 @@ Partial Class Bancos_FluctuacionCambiaria
Private Sub CargaDatosFiliales()
Dim ObjBancos As New ClsBancos
LblTotalAcreedores.Text = "0.00"
- If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 7, UsuarioActual.CveEmpresa) Then
+ If ObjBancos.GetFluctuaciones(FechaUltimoDiaMes, 8, UsuarioActual.CveEmpresa) Then
GvFiliales.DataSource = ObjBancos.DtResultados.FiltraParametros("Saldo > 0")
LblTotalAcreedores.Text = ObjBancos.DtResultados.SUM("Fluctuacion").FormatoNumero
Else
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 4eed8c7d4..690d09452 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -3094,13 +3094,13 @@ Partial Class PopUpVerFactura
CartaPorte.Parametros.Add(New ReportParameter($"TieneCartaPorte", "False"))
End If
Else
- If UsuarioActual.CveEmpresa = 13 AndAlso Vta.TipoDocto = "Egs" Then
+ If UsuarioActual.CveEmpresa = 13 AndAlso Vta.TipoDocto.Contiene("Egs", "Ant") Then
CartaPorte = New Modelos.MSubReportData()
CartaPorte.Parametros.Add(New ReportParameter($"TieneCartaPorte", "False"))
End If
End If
Else
- If UsuarioActual.CveEmpresa = 13 AndAlso Vta.TipoDocto = "Egs" Then
+ If UsuarioActual.CveEmpresa = 13 AndAlso Vta.TipoDocto.Contiene("Egs", "Ant") Then
CartaPorte = New Modelos.MSubReportData()
CartaPorte.Parametros.Add(New ReportParameter($"TieneCartaPorte", "False"))
End If
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb
index f93a39a5f..50deab8a5 100644
--- a/Contabilidad/RegPrePolizaS.aspx.vb
+++ b/Contabilidad/RegPrePolizaS.aspx.vb
@@ -1811,7 +1811,7 @@ Partial Class ContabilidadC_RegPrePolizaS
dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero
dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero
dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero
- dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, ""))
+ dr("FolioFactura") = If(DdlComprasE.Visible = True AndAlso DdlComprasE.SelectedItem IsNot Nothing, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True AndAlso DdlVentasE.SelectedItem IsNot Nothing, DdlVentasE.SelectedItem.ToString, ""))
dr("Modificado") = True
dr("ContadoCuenta") = DdlModalConceptoCuenta.SelectedValue.ToEntero
diff --git a/Empresas/13/Formatos/72459.xlsm b/Empresas/13/Formatos/72459.xlsm
deleted file mode 100644
index 1ab70ca10..000000000
Binary files a/Empresas/13/Formatos/72459.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/72470.xlsm b/Empresas/13/Formatos/72470.xlsm
deleted file mode 100644
index 327c1010c..000000000
Binary files a/Empresas/13/Formatos/72470.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/72536.xlsm b/Empresas/13/Formatos/72536.xlsm
deleted file mode 100644
index 327c1010c..000000000
Binary files a/Empresas/13/Formatos/72536.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/72537.xlsm b/Empresas/13/Formatos/72537.xlsm
deleted file mode 100644
index 327c1010c..000000000
Binary files a/Empresas/13/Formatos/72537.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/72539.xlsm b/Empresas/13/Formatos/72539.xlsm
deleted file mode 100644
index 327c1010c..000000000
Binary files a/Empresas/13/Formatos/72539.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/72541.xlsm b/Empresas/13/Formatos/72541.xlsm
deleted file mode 100644
index 327c1010c..000000000
Binary files a/Empresas/13/Formatos/72541.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/72603.xlsm b/Empresas/13/Formatos/72603.xlsm
deleted file mode 100644
index 1192e1a70..000000000
Binary files a/Empresas/13/Formatos/72603.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/72717.xlsm b/Empresas/13/Formatos/72717.xlsm
deleted file mode 100644
index 1192e1a70..000000000
Binary files a/Empresas/13/Formatos/72717.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/Cheque.xlsm b/Empresas/13/Formatos/Cheque.xlsm
deleted file mode 100644
index 671623b9f..000000000
Binary files a/Empresas/13/Formatos/Cheque.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/Copia de 71671.xlsm b/Empresas/13/Formatos/Copia de 71671.xlsm
deleted file mode 100644
index 5ec2606ac..000000000
Binary files a/Empresas/13/Formatos/Copia de 71671.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/Copia de 72360.xlsm b/Empresas/13/Formatos/Copia de 72360.xlsm
deleted file mode 100644
index dac6807b9..000000000
Binary files a/Empresas/13/Formatos/Copia de 72360.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/Copia de Transferencia-72272.xlsm b/Empresas/13/Formatos/Copia de Transferencia-72272.xlsm
deleted file mode 100644
index c353ccb3b..000000000
Binary files a/Empresas/13/Formatos/Copia de Transferencia-72272.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/Copia de Transferencia-72274.xlsm b/Empresas/13/Formatos/Copia de Transferencia-72274.xlsm
deleted file mode 100644
index 89c0b62a1..000000000
Binary files a/Empresas/13/Formatos/Copia de Transferencia-72274.xlsm and /dev/null differ
diff --git a/Empresas/13/Formatos/Copia de Transferencia-72277.xlsm b/Empresas/13/Formatos/Copia de Transferencia-72277.xlsm
deleted file mode 100644
index 8714574b7..000000000
Binary files a/Empresas/13/Formatos/Copia de Transferencia-72277.xlsm and /dev/null differ
diff --git a/OC/RepOCxSurtir.aspx b/OC/RepOCxSurtir.aspx
index bf28662e6..0365b13b2 100644
--- a/OC/RepOCxSurtir.aspx
+++ b/OC/RepOCxSurtir.aspx
@@ -87,9 +87,9 @@
-
-
-
+
+
+
diff --git a/OC/RepSolicitudesAnticipo.aspx b/OC/RepSolicitudesAnticipo.aspx
index ccd5adc92..911133519 100644
--- a/OC/RepSolicitudesAnticipo.aspx
+++ b/OC/RepSolicitudesAnticipo.aspx
@@ -86,6 +86,7 @@
+
@@ -120,10 +121,12 @@
" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
-
+ <%--0--%>
@@ -132,40 +135,53 @@
+ <%--1--%>
+ <%--2--%>
+ <%--3--%>
+ <%--4--%>
+ <%--5--%>
-
+ <%--6--%>
-
+ <%--7--%>
-
+ <%--8--%>
-
+ <%--9--%>
+ <%--10--%>
+ <%--11--%>
+
+
+
+
+
diff --git a/OC/RepSolicitudesAnticipo.aspx.cs b/OC/RepSolicitudesAnticipo.aspx.cs
index 104bc2e02..3a8715a01 100644
--- a/OC/RepSolicitudesAnticipo.aspx.cs
+++ b/OC/RepSolicitudesAnticipo.aspx.cs
@@ -14,6 +14,10 @@ using iTextSharp.text;
using iTextSharp.text.pdf;
using System.IO;
using Ionic.Zip;
+using StackExchange.Redis;
+using static Stimulsoft.Report.Export.DeflaterHuffman;
+
+
public partial class OC_RepSolicitudesAnticipo : ClsPaginas
{
#region "Propiedades"
@@ -286,4 +290,64 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
}
+
+ protected void LnkCancelar_Click(object sender, EventArgs e)
+ {
+
+ bool errorProceso = false;
+ GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
+ int CveEvento = GvRow.DataKey("CveEvento").ToEntero();
+ int CveOrdenCompra = GvRow.DataKey("CveOrdenCompra").ToEntero();
+
+ string ImporteSol = GvRow.DataKey("ImporteSol") ;
+
+ ClsOIEventos objGenral = new ClsOIEventos();
+ ClsOIEventos objEventos = new ClsOIEventos(objGenral.IniciaTransacSQL());
+
+
+ if (objEventos.UpdateEstatusEvento(5,-1, CveEvento,UsuarioActual.CveUsuario))
+ {
+ if (!objGenral.AddEventoBitacora($"Se cancela solicitud de anticipo con importe {ImporteSol}","",UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,CveOC:CveOrdenCompra)){
+ errorProceso = true;
+ }
+ }
+ else
+ {
+ errorProceso = true;
+ }
+
+
+ if (!errorProceso)
+ {
+ objGenral.Commit();
+ Alert("Solicitud de anticipo cancelado correctamente.");
+ }
+ else
+ {
+ objGenral.RollBack();
+ }
+
+ objGenral.Dispose();
+
+ if (!errorProceso)
+ {
+ CargaDatos();
+ }
+
+ }
+
+ protected void GvSolicitudes_RowDataBound(object sender, GridViewRowEventArgs e)
+ {
+ if(e.Row.RowType == DataControlRowType.DataRow)
+ {
+ if(e.Row.DataKey("CveEventoEstatus").ToEntero() == 1)
+ {
+ e.Row.FCLinkButton("LnkCancelar").Visible = true;
+ }else if (e.Row.DataKey("CveEventoEstatus").ToEntero() == 5)
+ {
+ e.Row.FCHyperLink("HplNum").Visible = false;
+ }
+ }
+
+ }
}
\ No newline at end of file
diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx
index 3f02fa021..7c74ab75d 100644
--- a/Ventas/Clientes.aspx
+++ b/Ventas/Clientes.aspx
@@ -177,10 +177,6 @@
color: orange;
background-color: orange;
}
-
- .margenChk{
- margin-left:15px!important;
- }
@@ -1652,11 +1648,9 @@
@@ -2032,10 +2104,11 @@
-
+
-
+
+
@@ -2484,6 +2557,7 @@
+ Archivos
@@ -4501,7 +4575,7 @@
@@ -4512,7 +4586,7 @@
-
+
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index ec63096d4..28609db2d 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -1881,12 +1881,6 @@ Partial Class Clientes
TxtCorreoEntregaCompras.Text = ObjClientes.DtResultados(0)("CorreoEntregaCompras").ToString()
TxtCorreoEntregaAlmacen.Text = ObjClientes.DtResultados(0)("CorreoEntregaAlmacen").ToString()
- If ObjClientes.DtResultados.Rows(0)("FechaLimiteCredito").ToString.ToDate > MinFecha Then
- TxtFechaLimiteCredito.Text = ObjClientes.DtResultados.Rows(0)("FechaLimiteCredito").ToString.ToDate.ToString("dd/MM/yyyy")
- Else
- TxtFechaLimiteCredito.Text = ""
- End If
-
CargarClientePersonalEntrega()
Else
Existe = False
@@ -1915,9 +1909,6 @@ Partial Class Clientes
TxtRepresentanteLegal.Text = ObjClientes.RepresentanteLegal
-
-
-
End If
UpActivacionPortal.Update()
UpModalPersonaFisica.Update()
@@ -1960,10 +1951,6 @@ Partial Class Clientes
DtCxCActivas = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda, OrdenVencimiento, FechaVencimiento")
GvCxC.DataSource = DtCxCActivas
'solo tomo los 10 ultimos mas el totalizador general
-
-
- GvCxC.Columns(6).Visible = If(DtCxCActivas.FiltroPrimeroValor("LineaAdicional", "LEN(TRIM(LineaAdicional)) > 0", "LineaAdicional DESC").Trim.Length > 0, True, False)
-
Dim dt As DataTable = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Hist'")
DtHistorialCxC = dt
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
@@ -2189,6 +2176,7 @@ Partial Class Clientes
GvBancos.DataSource = ObjMovtos.DtResultados
DTCobrosRealizados = ObjMovtos.DtResultados
DTCobrosRealizados.Rows.Remove(DTCobrosRealizados.Rows(0))
+ GvBancos.Columns(5).Visible = ObjMovtos.DtResultados.COUNT("LineaAdicional", "LineaAdicional <>'' ") > 0
Else
DTCobrosRealizados = Nothing
End If
@@ -2206,7 +2194,7 @@ Partial Class Clientes
If e.Row.DBCampo("CveVenta") = "" Then
If e.Row.DBCampo("CveIE") <> "" Then
- Dim ObjBancos As New ClsBancos
+
e.Row.Cells(0).Text = String.Format("{0} - {1}", e.Row.DBCampo("Banco"), e.Row.DBCampo("NumCuenta"))
e.Row.FCLiteral("LtlFechaVenci").Text = e.Row.DBCampo("FechaDocumento").ToDate().ToShortDateString()
@@ -2214,19 +2202,25 @@ Partial Class Clientes
e.Row.FCLiteral("LtlImp").Text = e.Row.DBCampo("ImporteIE").FormatoNumero()
e.Row.FCLiteral("LtlMon").Text = e.Row.DBCampo("MonedaIE")
+ If e.Row.DBCampo("CveComplementoPago") <> "" Then
+ e.Row.FCHyperLink("HplXML").Visible = True : e.Row.FCHyperLink("HplXML").NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CompP&EXT=xml&CveComplementoPago={0}&SerieFolio={1}&CveIE={2}", e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("SerieFolio").ToString(), e.Row.DBCampo("CveIE").ToString())))
+ e.Row.FCHyperLink("HplPDF").Visible = True : e.Row.FCHyperLink("HplPDF").NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CompP&EXT=pdf&CveComplementoPago={0}&SerieFolio={1}&CveIE={2}", e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("SerieFolio").ToString(), e.Row.DBCampo("CveIE").ToString())))
- 'HLSendMail.HRef = String.Format("javascript:$get('HdnCveIE').value='{0}';$get('HdnSerieFolio').value='{1}';$get('HdnFolioPago').value='{2}';$get('TxtParaMail').value='{3}';$('#ModalDivMail').modal();", e.Row.DBCampo("CveIE"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("FolioCobro"), TxtCobranzaCorreo.Text)
-
- If ObjBancos.GetComplementoPagos(-1, e.Row.DBCampo("CveIE").ToString().ToEntero(), -1, UsuarioActual.CveEmpresa) Then
- If ObjBancos.DtResultados.Rows.Count > 0 Then
- e.Row.FCHyperLink("HplXML").Visible = True : e.Row.FCHyperLink("HplXML").NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CompP&EXT=xml&CveComplementoPago={0}&SerieFolio={1}&CveIE={2}", ObjBancos.DtResultados(0)("CveComplementoPago").ToString(), ObjBancos.DtResultados(0)("SerieFolio").ToString(), ObjBancos.DtResultados(0)("CveIE").ToString())))
- e.Row.FCHyperLink("HplPDF").Visible = True : e.Row.FCHyperLink("HplPDF").NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CompP&EXT=pdf&CveComplementoPago={0}&SerieFolio={1}&CveIE={2}", ObjBancos.DtResultados(0)("CveComplementoPago").ToString(), ObjBancos.DtResultados(0)("SerieFolio").ToString(), ObjBancos.DtResultados(0)("CveIE").ToString())))
-
- e.Row.FCLinkButton("LnkSendMail").Visible = True
- End If
+ e.Row.FCLinkButton("LnkSendMail").Visible = True
End If
- ObjBancos.Dispose()
+
+ ''HLSendMail.HRef = String.Format("javascript:$get('HdnCveIE').value='{0}';$get('HdnSerieFolio').value='{1}';$get('HdnFolioPago').value='{2}';$get('TxtParaMail').value='{3}';$('#ModalDivMail').modal();", e.Row.DBCampo("CveIE"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("FolioCobro"), TxtCobranzaCorreo.Text)
+ 'Dim ObjBancos As New ClsBancos
+ 'If ObjBancos.GetComplementoPagos(-1, e.Row.DBCampo("CveIE").ToString().ToEntero(), -1, UsuarioActual.CveEmpresa) Then
+ ' If ObjBancos.DtResultados.Rows.Count > 0 Then
+ ' e.Row.FCHyperLink("HplXML").Visible = True : e.Row.FCHyperLink("HplXML").NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CompP&EXT=xml&CveComplementoPago={0}&SerieFolio={1}&CveIE={2}", ObjBancos.DtResultados(0)("CveComplementoPago").ToString(), ObjBancos.DtResultados(0)("SerieFolio").ToString(), ObjBancos.DtResultados(0)("CveIE").ToString())))
+ ' e.Row.FCHyperLink("HplPDF").Visible = True : e.Row.FCHyperLink("HplPDF").NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=CompP&EXT=pdf&CveComplementoPago={0}&SerieFolio={1}&CveIE={2}", ObjBancos.DtResultados(0)("CveComplementoPago").ToString(), ObjBancos.DtResultados(0)("SerieFolio").ToString(), ObjBancos.DtResultados(0)("CveIE").ToString())))
+
+ ' e.Row.FCLinkButton("LnkSendMail").Visible = True
+ ' End If
+ 'End If
+ 'ObjBancos.Dispose()
End If
e.Row.BackColor = Drawing.Color.LightGray
e.Row.Font.Bold = True
@@ -2672,9 +2666,6 @@ Partial Class Clientes
Dim TipoPersona As Boolean = If(RdTipoPersona.SelectedValue.ToEntero = 1, True, False)
-
- Dim FechaLimiteCredito As Date = If(TxtFechaLimiteCredito.Text.ToDate > MinFecha, TxtFechaLimiteCredito.Text.ToDate, MinFecha)
-
If CveCliente = -1 Then
Dim ErrorAC As Boolean = False
Dim CtaCliente As Integer = DdlCtaContableClientes.SelectedValue.ToEntero()
@@ -2738,7 +2729,7 @@ Partial Class Clientes
CvePais:=DdlPais.SelectedValue.ToEntero(), CveEstado:=DdlEstado.SelectedValue.ToEntero(), CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero(), CveColonia:=DdlColonia.SelectedValue.ToEntero(), CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero(), NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(),
ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(), RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked,
TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(), CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
- CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, FechaLimiteCredito:=FechaLimiteCredito) Then
+ CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text) Then
ViewState("CveCliente") = ObjClientes.CveCliente
@@ -2835,7 +2826,7 @@ Partial Class Clientes
ApellidoPaternoPF:=IIf(TxtApellidoPaterno.Text = "", "-1", TxtApellidoPaterno.Text).ToString(), ApellidoMaternoPF:=IIf(TxtApellidoMaterno.Text = "", "-1", TxtApellidoMaterno.Text).ToString(), NombresPF:=IIf(TxtNombres.Text = "", "-1", TxtNombres.Text).ToString(),
RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(),
CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
- NoDesglosaIVA:=ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text, FechaLimiteCredito:=FechaLimiteCredito) Then
+ NoDesglosaIVA:=ChkNoDesglosaIVA.Checked, CveRegimenFiscal:=DdlRegimenFiscal.SelectedValue.ToEntero, RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, RepresentanteLegal:=TxtRepresentanteLegal.Text) Then
ObjClientes.LimpiaImpuestosLocales(CveCliente)
@@ -2992,8 +2983,8 @@ Partial Class Clientes
End If
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
+ e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right
- e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Right
If e.Row.DBCampo("Saldo").ToDouble < 0 Then e.Row.Cells(6).ForeColor = Drawing.Color.Red
If e.Row.DBCampo("DiasVencidos").ToDouble > 0 AndAlso CType(sender, GridView).ID = "GvCxC" Then e.Row.Cells(4).ForeColor = Drawing.Color.Red
@@ -7530,9 +7521,10 @@ Partial Class Clientes
Dim ciudad As String = ""
Dim estado As String = ""
Dim Telefono As String = ""
- Dim mesArray = New String() {"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"}
+ Dim mesArray = New String() {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}
Dim hoy As DateTime = DateTime.Now
Dim fechaConFormato As String = String.Format("{0} de {1} del {2}", hoy.Day, mesArray(hoy.Month), hoy.Year)
+ Dim cpCliente As String = ""
If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
monto = ObjClientes.DtResultados.FiltroPrimeroValor("LimiteCredito").ToDouble.ToString("N")
@@ -7544,14 +7536,25 @@ Partial Class Clientes
ciudad = ObjClientes.DtResultados.FiltroPrimeroValor("Ciudad")
estado = ObjClientes.DtResultados.FiltroPrimeroValor("Estado")
Telefono = ObjClientes.DtResultados.FiltroPrimeroValor("Telefono")
+ cpCliente = ObjClientes.CP
End If
+ Dim CveLocalidadSucursal As Integer = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveLocalidad", "").ToEntero
+ Dim CveEstadoSucursal As Integer = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstado", "").ToEntero
+
+
+ Dim LocalidadSucursal As String = GlobalDTLocalidad(-1, -1).FiltroPrimeroValor("NombreLocalidad", $"CveLocalidad = {CveLocalidadSucursal}")
+ Dim EstadoSucursal As String = GlobalDTGralEstados("-1", -1).FiltroPrimeroValor("NombreEstado", $"CveEstado={CveEstadoSucursal}")
+
+ Dim FechaLugar As String = $"{LocalidadSucursal}, {EstadoSucursal} a {fechaConFormato}"
+
+
Tags.Add(New TagsDocumentos("{Monto}", monto))
Tags.Add(New TagsDocumentos("{Fecha}", fechaConFormato))
Tags.Add(New TagsDocumentos("{FechaConFormato}", fechaConFormato))
Tags.Add(New TagsDocumentos("{CantidadLetra}", monto.ToDouble.Texto2Letras(1)))
Tags.Add(New TagsDocumentos("{RazonSocial}", razonSocial))
- Tags.Add(New TagsDocumentos("{Direccion}", String.Format("{0} #{1} {2}, COL.{3}", direccion, noInt, noExt, colonia).ToUpper()))
+ Tags.Add(New TagsDocumentos("{Direccion}", String.Format("{0} #{1} {2}, COL.{3}, CP. {4}", direccion, noInt, noExt, colonia, cpCliente).ToUpper()))
Tags.Add(New TagsDocumentos("{Ciudad}", String.Format("{0}, {1}", ciudad, estado).ToUpper()))
Tags.Add(New TagsDocumentos("{Telefono}", Telefono))
Tags.Add(New TagsDocumentos("{RazonSocialAval}", TxtAval.Text))
@@ -7559,6 +7562,7 @@ Partial Class Clientes
Tags.Add(New TagsDocumentos("{CiudadAval}", TxtCiudadAval.Text))
Tags.Add(New TagsDocumentos("{TelefonoAval}", TxtTelefonoAval.Text))
Tags.Add(New TagsDocumentos("{RepresentanteLegal}", TxtRepresentanteLegal.Text))
+ Tags.Add(New TagsDocumentos("{FechaLugar}", FechaLugar))
If Not ObjClientes.AddClientePagare(CveCliente, UsuarioActual.CveEmpresa, TxtAval.Text, TxtDireccionAval.Text) Then
Alert("no se pudo registrar el pagare")
@@ -10387,7 +10391,7 @@ Partial Class Clientes
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetLineasAdicionales(-1, CveCliente, -1, -1, -1, MinFecha, MaxFecha, -1, UsuarioActual.CveEmpresa) Then
+ If ObjVentas.GetLineasAdicionales(CveCliente, -1, -1, -1, UsuarioActual.CveEmpresa) Then
GvLineasAdicionales.DataSource = ObjVentas.DtResultados
End If
diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx
index 87bdea538..28d829339 100644
--- a/Ventas/Promociones.aspx
+++ b/Ventas/Promociones.aspx
@@ -187,7 +187,11 @@
-
+
<%----%>
@@ -201,12 +205,12 @@
-
+
-
+
@@ -265,6 +269,11 @@
+
+
+
diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb
index 5d55ae37c..1ed054fee 100644
--- a/Ventas/Promociones.aspx.vb
+++ b/Ventas/Promociones.aspx.vb
@@ -53,6 +53,21 @@ Partial Class Ventas_Promociones
End Set
End Property
+
+
+ Private Property CvePromocionPadre As Integer
+ Get
+
+ If ViewState("CvePromocionPadre") Is Nothing Then
+ ViewState("CvePromocionPadre") = -1
+ End If
+ Return ViewState("CvePromocionPadre").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CvePromocionPadre") = value
+ End Set
+ End Property
+
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -64,9 +79,6 @@ Partial Class Ventas_Promociones
If Request("CvePromocion") IsNot Nothing AndAlso Request("CvePromocion").ToString.ToEntero > 0 Then
CvePromocion = Request("CvePromocion").ToString.ToEntero
CargaDatos()
-
-
-
Else
ChkEstatus.Enabled = True
ChkEstatus.Checked = True
@@ -287,6 +299,8 @@ Partial Class Ventas_Promociones
DdlMarca.SelectedValueExist(Dr("CveMarca").ToString)
DdlTipoAplicacion.SelectedValueExist(Dr("TipoAplicacion").ToString)
+ CvePromocionPadre = If(Dr("CvePromocionPadre").ToString.ToEntero > 0, Dr("CvePromocionPadre").ToString.ToEntero, -1)
+
If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then
TempDT = ObjVentas.DtResultados.Copy
TempDTOrigial = ObjVentas.DtResultados.Copy
@@ -299,6 +313,13 @@ Partial Class Ventas_Promociones
Alert("Ocurrió un error al consultar la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
+ ButBtnEliminar.Visible = True
+
+ If CvePromocionPadre > 0 Then
+ BtnGuardar.Enabled = False
+ ButBtnEliminar.Enabled = False
+ End If
+
ObjVentas.Dispose()
End Sub
Private Sub CargaGrid()
@@ -537,6 +558,11 @@ Partial Class Ventas_Promociones
TieneError = True
End If
+ If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
+ TieneError = ObjVentas.SincronizarPromocionesClonar(CvePromocion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1)
+ End If
+
+
If Not TieneError Then
ObjVentas.Commit()
Alert("La promoción se guardo correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/CatPromociones.aspx"";")
@@ -547,6 +573,8 @@ Partial Class Ventas_Promociones
ObjVentas.Dispose()
End Sub
+
+
Private Sub ActualizaPromocion()
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
@@ -559,12 +587,17 @@ Partial Class Ventas_Promociones
If ObjVentas.UpdatePromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha),
DdlVendedor.SelectedValue.ToEntero, CveCliente, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario,
- CvePromocion, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveMarca:=DdlMarca.SelectedValue.ToEntero, DdlDistribuidor.SelectedValue.ToEntero) Then
+ CvePromocion, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveMarca:=DdlMarca.SelectedValue.ToEntero, EsDistribuidor:=DdlDistribuidor.SelectedValue.ToEntero) Then
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 0").Rows
+
+
+ Dim OpReplicarDetalleFranquicias As Integer = If(UsuarioActual.Empresa.Funcionalidad(563) <> "", 2, 1) ' op 2 Elimina detalles de franquicias
+
If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble,
CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")),
- Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero, CveClasificacion:=If(Dr("CvePS").ToString = "-1", Dr("CveClasificacion").ToString.ToEntero, -1), CveRinTamaño:=Dr("CveRinTamaño").ToString.ToEntero, IncluyeImpuestos:=ChkIncluyeImpuesto.Checked) Then
+ Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero, CveClasificacion:=If(Dr("CvePS").ToString = "-1", Dr("CveClasificacion").ToString.ToEntero, -1),
+ CveRinTamaño:=Dr("CveRinTamaño").ToString.ToEntero, IncluyeImpuestos:=ChkIncluyeImpuesto.Checked, Opcion:=OpReplicarDetalleFranquicias) Then
TieneError = True
Exit For
End If
@@ -759,8 +792,14 @@ Partial Class Ventas_Promociones
End If
If Not TieneError Then
+
For Each Dr As DataRow In TempDT.FiltraParametros("Estatus = 2").Rows
- If Not ObjVentas.RemovePromocionesDetalle(Dr("CvePromocionDetalle").ToString.ToEntero) Then
+
+ 'RunPromocionesClonar
+
+ Dim OpEliminacionDetalle As Integer = If(UsuarioActual.Empresa.Funcionalidad(563) <> "", 2, 1) ' op 2 Elimina detalles de franquicias
+
+ If Not ObjVentas.RemovePromocionesDetalle(Dr("CvePromocionDetalle").ToString.ToEntero, OpEliminacionDetalle) Then
TieneError = True
Exit For
End If
@@ -781,6 +820,14 @@ Partial Class Ventas_Promociones
TieneError = True
End If
+ If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
+
+ If Not ObjVentas.SincronizarPromocionesClonar(CvePromocion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 2) Then
+ TieneError = True
+ End If
+
+ End If
+
If Not TieneError Then
ObjVentas.Commit()
Alert("La promoción se guardo correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Ventas/CatPromociones.aspx"";")
@@ -801,12 +848,21 @@ Partial Class Ventas_Promociones
ObjVentas.IniciaTransacSQL()
Dim TieneError = False
- If ObjVentas.RemovePromocionesDetalle(CvePromocion) Then
- If Not ObjVentas.RemovePromociones(CvePromocion, UsuarioActual.CveEmpresa) Then
+
+ If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
+ If Not ObjVentas.SincronizarPromocionesClonar(CvePromocion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 3) Then
+ TieneError = True
+ End If
+ End If
+
+ If Not TieneError Then
+ If ObjVentas.RemovePromocionesDetalle(-1, 3, CvePromocion) Then
+ If Not ObjVentas.RemovePromociones(CvePromocion, UsuarioActual.CveEmpresa) Then
+ TieneError = True
+ End If
+ Else
TieneError = True
End If
- Else
- TieneError = True
End If
If Not TieneError Then
@@ -816,6 +872,15 @@ Partial Class Ventas_Promociones
ObjVentas.RollBack()
Alert("Ocurrió un error al registrar la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
+
+
+ If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso TieneError Then
+ If ObjVentas.SincronizarPromocionesClonar(CvePromocion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 4) Then
+ Alert("Se presento un error al eliminar, se desactivo kla promoción actual y promociones relacionadas", TipoMensaje.MsgAdvertencia, $"document.location.href=""/Ventas/Promociones.aspx?CvePromocion={CvePromocion}"";")
+ End If
+ End If
+
+
ObjVentas.Dispose()
End Sub
#End Region
@@ -836,4 +901,17 @@ Partial Class Ventas_Promociones
+
+ Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ If CvePromocionPadre > 0 Then
+ e.Row.FCLinkButton("LnkGvDetalleEditar").Visible = False
+ e.Row.FCLinkButton("LnkGvDetalleEliminar").Visible = False
+ End If
+
+ End If
+
+ End Sub
End Class
\ No newline at end of file
diff --git a/Ventas/RepCancelacionesPorRespuesta.aspx.cs b/Ventas/RepCancelacionesPorRespuesta.aspx.cs
index 977fb4f16..796c5587b 100644
--- a/Ventas/RepCancelacionesPorRespuesta.aspx.cs
+++ b/Ventas/RepCancelacionesPorRespuesta.aspx.cs
@@ -602,11 +602,11 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
if (e.Row.DBCampo("PuedeRefacturar") == "0" && e.Row.DBCampo("CveEstatusFactura") == "23" && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0)
{
- e.Row.FCLinkButton("LnkCancelar").Visible = true;
+ if (e.Row.FCLinkButton("LnkCancelar")!= null) e.Row.FCLinkButton("LnkCancelar").Visible = true;
//SOLO MOSTRAR SI LA FACTURA NUEVA ESTA EMITIDA
if (e.Row.DBCampo("CveEstatusRefacturacion") != "4" && e.Row.DBCampo("CveEstatusFacturaSustitucion") == "3")
{
- e.Row.FCLinkButton("LnkCancelarFolioSustitucion").Visible = true;
+ if (e.Row.FCLinkButton("LnkCancelarFolioSustitucion") != null) e.Row.FCLinkButton("LnkCancelarFolioSustitucion").Visible = true;
}
}
}
diff --git a/vwd.webinfo b/vwd.webinfo
index cd5a963ea..fdbdd590d 100644
--- a/vwd.webinfo
+++ b/vwd.webinfo
@@ -574,6 +574,8 @@
+
+