Merge branch 'master' of http://rpimienta@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -1087,4 +1087,77 @@ Public Class ClsCRM
|
|||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
#Region "METAS"
|
||||||
|
Public Function GetMetas(FechaI As DateTime, FechaF As DateTime, Estatus As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_CRM_MetasGet")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@FechaI", SqlDbType.DateTime).Value = FechaI
|
||||||
|
.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
|
||||||
|
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener las Metas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function AddMetas(CveVendedor As Integer, FechaI As DateTime, FechaF As DateTime, NumMeta As Integer, Importe As Decimal, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_CRM_MetasAdd")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||||
|
.Add("@FechaI", SqlDbType.DateTime).Value = FechaI
|
||||||
|
.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
|
||||||
|
.Add("@NumMeta", SqlDbType.Int).Value = NumMeta
|
||||||
|
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al agregar la Meta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function UpdateMetas(CveMeta As Integer, CveVendedor As Integer, FechaI As DateTime, FechaF As DateTime, NumMeta As Integer, Importe As Decimal, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_CRM_MetasUpdate")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveMeta", SqlDbType.Int).Value = CveMeta
|
||||||
|
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||||
|
.Add("@FechaI", SqlDbType.DateTime).Value = FechaI
|
||||||
|
.Add("@FechaF", SqlDbType.DateTime).Value = FechaF
|
||||||
|
.Add("@NumMeta", SqlDbType.Int).Value = NumMeta
|
||||||
|
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al actualizar la Meta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
Public Function RemoveMetas(CveMeta As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
Dim Retorno As Boolean = False
|
||||||
|
DataAdapter("PA_CRM_MetasRemove")
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CveMeta", SqlDbType.Int).Value = CveMeta
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = True
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al eliminar la Meta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
End Try
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -3904,6 +3904,7 @@ Public Class ClsPaginas
|
|||||||
PaginaDict.Add("/CRM/RepAcercamientosProcesos.aspx".ToUpper(), -1)
|
PaginaDict.Add("/CRM/RepAcercamientosProcesos.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/CRM/RepAcercamientosRechazos.aspx".ToUpper(), -1)
|
PaginaDict.Add("/CRM/RepAcercamientosRechazos.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/CRM/RepAcercamientosProcesosDetalle.aspx".ToUpper(), -1)
|
PaginaDict.Add("/CRM/RepAcercamientosProcesosDetalle.aspx".ToUpper(), -1)
|
||||||
|
PaginaDict.Add("/CRM/CatMetas.aspx".ToUpper(), 684)
|
||||||
#End Region
|
#End Region
|
||||||
#Region "CxC"
|
#Region "CxC"
|
||||||
|
|
||||||
|
|||||||
@@ -1816,10 +1816,10 @@ Namespace Modelos
|
|||||||
End Sub
|
End Sub
|
||||||
Private Function ProcesoPrepolizas(ObjFactura As Factura, ByRef ObjConta As ClsContabilidad, CveIE As Integer, TmpDTDetalle As DataTable, ByRef objContPaqi As ClsContPAQi,
|
Private Function ProcesoPrepolizas(ObjFactura As Factura, ByRef ObjConta As ClsContabilidad, CveIE As Integer, TmpDTDetalle As DataTable, ByRef objContPaqi As ClsContPAQi,
|
||||||
Optional ValorMultiplicador As Integer = 1, ByRef Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing,
|
Optional ValorMultiplicador As Integer = 1, ByRef Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing,
|
||||||
Optional ByRef DtRemisionesRelacionadas As DataTable = Nothing, Optional SeCancelaRemisionProceso As Boolean = False, Optional CancelarRemisiones As Boolean = False, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing) As Boolean
|
Optional ByRef DtRemisionesRelacionadas As DataTable = Nothing, Optional SeCancelaRemisionProceso As Boolean = False, Optional CancelarRemisiones As Boolean = False, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing,
|
||||||
|
Optional CveEstatusRefacturacion As Integer = 0) As Boolean
|
||||||
Dim ErrorPrepoliza As Boolean = False
|
Dim ErrorPrepoliza As Boolean = False
|
||||||
Try
|
Try
|
||||||
|
|
||||||
Dim DT As DataTable
|
Dim DT As DataTable
|
||||||
Dim CvePlantilaPoliza As Integer
|
Dim CvePlantilaPoliza As Integer
|
||||||
Dim PorcentajeAmortizacion As Decimal = 0
|
Dim PorcentajeAmortizacion As Decimal = 0
|
||||||
@@ -2426,10 +2426,6 @@ Namespace Modelos
|
|||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=row2.DataKey("CveVentaNC").ToString.ToEntero, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, CveSubProyecto:=CveSubProyectoContabilizar) Then
|
|
||||||
' ErrorPrepoliza = True
|
|
||||||
'End If
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -2488,8 +2484,6 @@ Namespace Modelos
|
|||||||
CveVentaAmortizacionAplicar = ObjFactura.CveVenta
|
CveVentaAmortizacionAplicar = ObjFactura.CveVenta
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' If UsuarioActual.CveEmpresa = 119 Then
|
|
||||||
|
|
||||||
'código fijo en base el porcentaje iva, que se afecten las clasificaciones
|
'código fijo en base el porcentaje iva, que se afecten las clasificaciones
|
||||||
For i = 0 To TmpDTDetalle.Rows.Count - 1
|
For i = 0 To TmpDTDetalle.Rows.Count - 1
|
||||||
|
|
||||||
@@ -2505,8 +2499,6 @@ Namespace Modelos
|
|||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
' End If
|
|
||||||
|
|
||||||
DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto"})
|
DT = TmpDTDetalle.FiltraParametros($"CvePS <> {ObjFactura.CvePSAmortizacion}", "", {"CveClasificacion", "CveSubProyecto"})
|
||||||
|
|
||||||
If DT.Rows.Count > 0 Then
|
If DT.Rows.Count > 0 Then
|
||||||
@@ -2893,26 +2885,31 @@ Namespace Modelos
|
|||||||
'Si es Facturacion de una remision cancelamos, traspasamos saldos y agregamos evento a la bitacora
|
'Si es Facturacion de una remision cancelamos, traspasamos saldos y agregamos evento a la bitacora
|
||||||
If (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) OrElse ObjFactura.RemisionesLista.Count > 0 Then
|
If (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) OrElse ObjFactura.RemisionesLista.Count > 0 Then
|
||||||
|
|
||||||
If ObjFactura.RemisionesLista.Count > 0 Then
|
If Not ObjFactura.TipoDocto.Contiene("Ing", "Ant") Then
|
||||||
For Each CveRemision As Integer In RemisionesLista
|
ErrorPrepoliza = True
|
||||||
If Not ObjConta.TraspasarSaldosRemision(CveRemision, ObjFactura.CvePrePoliza, ObjFactura.CveVenta) Then
|
ErrorList.Add("No se pueden facturar las remisiones, con ese tipo de comprobante seleccionado")
|
||||||
ErrorPrepoliza = True
|
Else
|
||||||
End If
|
If ObjFactura.RemisionesLista.Count > 0 Then
|
||||||
|
For Each CveRemision As Integer In RemisionesLista
|
||||||
|
If Not ObjConta.TraspasarSaldosRemision(CveRemision, ObjFactura.CvePrePoliza, ObjFactura.CveVenta) Then
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
|
||||||
'Factura
|
'Factura
|
||||||
If Not ObjEventos.AddEventoBitacora($"Sustituye a: <a href='/Ventas/Ventas.aspx?CveVenta={CveRemision}' target='_blank' class='Texto'>Folio Factura</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then
|
If Not ObjEventos.AddEventoBitacora($"Sustituye a: <a href='/Ventas/Ventas.aspx?CveVenta={CveRemision}' target='_blank' class='Texto'>Folio Factura</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then
|
||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Remision
|
'Remision
|
||||||
If Not ObjEventos.AddEventoBitacora($"Refacturacion en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then
|
If Not ObjEventos.AddEventoBitacora($"Refacturacion en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then
|
||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ErrorPrepoliza Then
|
If ErrorPrepoliza Then
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -2923,7 +2920,8 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO
|
'REGRESA SALDO A LAS REMISIONES QUE SE FACTURARON EN EL INGRESO QUE SE ESTA CANCELANDO
|
||||||
If ObjFactura.TipoDocto = "Ing" And ValorMultiplicador = -1 AndAlso NuevaFactura <> 1 AndAlso Not SeCancelaRemisionProceso AndAlso DtRemisionesRelacionadas IsNot Nothing Then ' se debe de excluir cuando es refacturación
|
'SE DEBE DE EXCLUIR CUANDO ES REFACTURACIÓN
|
||||||
|
If ObjFactura.TipoDocto = "Ing" And ValorMultiplicador = -1 AndAlso CveEstatusRefacturacion = 0 AndAlso Not SeCancelaRemisionProceso AndAlso DtRemisionesRelacionadas IsNot Nothing Then ' se debe de excluir cuando es refacturación
|
||||||
For Each Dr As DataRow In DtRemisionesRelacionadas.Rows
|
For Each Dr As DataRow In DtRemisionesRelacionadas.Rows
|
||||||
|
|
||||||
Dim DebeCancelar As Boolean = CancelarRemisiones AndAlso ListaRemisionesCancelar.Any(Function(CveRemision) CveRemision = Dr("CveVenta").ToString.ToEntero())
|
Dim DebeCancelar As Boolean = CancelarRemisiones AndAlso ListaRemisionesCancelar.Any(Function(CveRemision) CveRemision = Dr("CveVenta").ToString.ToEntero())
|
||||||
@@ -2943,23 +2941,40 @@ Namespace Modelos
|
|||||||
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2) Then
|
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
If ObjConta.ValorPolizaDescuadre = 2 Then
|
If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||||
|
ErrorList.Add(ObjConta.MensajePolizaDescuadre)
|
||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
Alert(ObjConta.MensajePolizaDescuadre, TipoMensaje.MsgError)
|
|
||||||
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Simplificacion de PrePolizas
|
'Simplificacion de PrePolizas
|
||||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||||
If Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
If Not ObjConta.PrePolizaSimplificacion(ObjFactura.CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||||
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
|
ErrorList.Add("No se pudo simplificar los movimientos")
|
||||||
|
ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'ContPAQ El movimiento 1 es el de Venta
|
||||||
|
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||||
|
|
||||||
|
If UsuarioActual.CveEmpresa = 119 AndAlso ObjFactura.TipoDocto.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "NC") Then
|
||||||
|
AutoConta = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
If AutoConta Then
|
||||||
|
If idCuentaContabilizacion > 0 Then
|
||||||
|
If Not ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=objContPaqi) Then
|
||||||
|
ErrorList.Add("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico")
|
||||||
|
'ErrorPrepoliza = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ErrorList.Add(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas))
|
||||||
|
'ErrorPrepoliza = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
GuardaLog(ex.ToString())
|
GuardaLog(ex.ToString())
|
||||||
ErrorPrepoliza = True
|
ErrorPrepoliza = True
|
||||||
@@ -3787,6 +3802,7 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion)
|
Dim CveEstatusRefacturacion As Integer = If(ObjFactura.CveEstatusRefacturacion <= 0, 0, ObjFactura.CveEstatusRefacturacion)
|
||||||
|
|
||||||
Dim CancelacionFecha As Date
|
Dim CancelacionFecha As Date
|
||||||
Dim FolioFiscal As String = ObjFactura.FolioFiscal
|
Dim FolioFiscal As String = ObjFactura.FolioFiscal
|
||||||
Dim CancelacionAcuse As String = ""
|
Dim CancelacionAcuse As String = ""
|
||||||
@@ -3925,6 +3941,15 @@ Namespace Modelos
|
|||||||
|
|
||||||
Retorno.CveEstatus = CveEstatus
|
Retorno.CveEstatus = CveEstatus
|
||||||
|
|
||||||
|
'0 Sin Refacturacion, 1 Refacturacion en Proceso, 3. Refacturación en proceso sin aceptación
|
||||||
|
If EsRefacturacion AndAlso CveEstatusRefacturacion = 0 Then
|
||||||
|
If CveEstatus = 5 Then
|
||||||
|
CveEstatusRefacturacion = 3 ' refacturación en proceso sin autorización de cancelación
|
||||||
|
Else
|
||||||
|
CveEstatusRefacturacion = 1 ' refacturación en proceso con autorización de cancelación
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
Dim ObjVentas As New ClsVentas() : ObjVentas.IniciaTransacSQL()
|
Dim ObjVentas As New ClsVentas() : ObjVentas.IniciaTransacSQL()
|
||||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||||
@@ -3932,11 +3957,11 @@ Namespace Modelos
|
|||||||
Dim ObjContrato As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
Dim ObjContrato As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL())
|
Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL())
|
||||||
Dim ObjAC As ClsContPAQi = Nothing
|
Dim ObjAC As ClsContPAQi = Nothing
|
||||||
If UsuarioActual.Empresa.UsaAC Then
|
|
||||||
|
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Try
|
Try
|
||||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||||
CvePlantillaPoliza = 7
|
CvePlantillaPoliza = 7
|
||||||
@@ -3965,8 +3990,8 @@ Namespace Modelos
|
|||||||
|
|
||||||
'CANCELA PREPOLIZA
|
'CANCELA PREPOLIZA
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
ErrorCancelar = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, -1, ObjBancos, ObjVentas, ObjEventos, DtRemisionesRelacionadas:=DtRemisionesRelacionadas,
|
ErrorCancelar = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, -1, ObjBancos, ObjVentas, ObjEventos, DtRemisionesRelacionadas:=DtRemisionesRelacionadas, SeCancelaRemisionProceso:=SeCancelaRemisionProceso,
|
||||||
SeCancelaRemisionProceso:=SeCancelaRemisionProceso, CancelarRemisiones:=CancelarRemisiones, ListaRemisionesCancelar:=ListaRemisionesCancelar)
|
CancelarRemisiones:=CancelarRemisiones, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveEstatusRefacturacion:=CveEstatusRefacturacion)
|
||||||
MensajeError = "Ocurrió un error al generar la prepoliza de cancelación."
|
MensajeError = "Ocurrió un error al generar la prepoliza de cancelación."
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -4095,15 +4120,14 @@ Namespace Modelos
|
|||||||
|
|
||||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 119 AndAlso ObjFactura.TipoDocto = "Ant" Then
|
If UsuarioActual.CveEmpresa = 119 AndAlso ObjFactura.TipoDocto.Contiene("Ant", "Rem", "RNC", "Cot", "Ped", "Pd2", "PA", "NC") Then
|
||||||
AutoConta = False
|
AutoConta = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If AutoConta And Not ErrorCancelar Then
|
If AutoConta And Not ErrorCancelar Then
|
||||||
Dim ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
|
|
||||||
|
|
||||||
If IdCtaContable > 0 Then
|
If IdCtaContable > 0 Then
|
||||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaDev, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
|
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaDev, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
|
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
|
||||||
End If
|
End If
|
||||||
@@ -4111,7 +4135,6 @@ Namespace Modelos
|
|||||||
Alert(String.Format("No se puede contabilizar ya que falta asignación de las cuentas contables"), TipoMensaje.MsgAdvertencia)
|
Alert(String.Format("No se puede contabilizar ya que falta asignación de las cuentas contables"), TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjContPaq.Dispose()
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -4241,17 +4264,16 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
End If
|
||||||
'MARCA LA VENTA PARA REALIZAR LA DEVOLUCION POSTERIORMENTE
|
|
||||||
If Not ErrorCancelar Then
|
'MARCA LA VENTA PARA REALIZAR LA DEVOLUCION POSTERIORMENTE
|
||||||
If RealizarDevolucionAlmacen AndAlso CveAlmacenDevolucion > 0 Then
|
If Not ErrorCancelar Then
|
||||||
If Not ObjVentas.UpdateVentaRealizarDevolucion(CveVenta, RealizarDevolucionAlmacen, CveAlmacenDevolucion) Then
|
If RealizarDevolucionAlmacen AndAlso CveAlmacenDevolucion > 0 Then
|
||||||
ErrorCancelar = True
|
If Not ObjVentas.UpdateVentaRealizarDevolucion(CveVenta, RealizarDevolucionAlmacen, CveAlmacenDevolucion) Then
|
||||||
MensajeError = "Ocurrió un error al marcar la venta para devolución"
|
ErrorCancelar = True
|
||||||
End If
|
MensajeError = "Ocurrió un error al marcar la venta para devolución"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'ACTUALIZA ESTATUS
|
'ACTUALIZA ESTATUS
|
||||||
@@ -4262,14 +4284,6 @@ Namespace Modelos
|
|||||||
Case "Com"
|
Case "Com"
|
||||||
CveEstatus = 9
|
CveEstatus = 9
|
||||||
End Select
|
End Select
|
||||||
'0 Sin Refacturacion, 1 Refacturacion en Proceso, 3. Refacturación en proceso sin aceptación
|
|
||||||
If EsRefacturacion Then
|
|
||||||
If CveEstatus = 5 Then
|
|
||||||
CveEstatusRefacturacion = 3 ' refacturación en proceso sin autorización de cancelación
|
|
||||||
Else
|
|
||||||
CveEstatusRefacturacion = 1 ' refacturación en proceso con autorización de cancelación
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If CveEstatus.Contiene(4, 5) Then
|
If CveEstatus.Contiene(4, 5) Then
|
||||||
If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion) Then
|
If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion) Then
|
||||||
|
|||||||
@@ -365,7 +365,15 @@ Public Class Timbrado
|
|||||||
If resultadoCancelacion.Exitoso Then
|
If resultadoCancelacion.Exitoso Then
|
||||||
CancelacionMensaje = resultadoCancelacion.Descripcion
|
CancelacionMensaje = resultadoCancelacion.Descripcion
|
||||||
Dim xmlDoc As New System.Xml.XmlDocument()
|
Dim xmlDoc As New System.Xml.XmlDocument()
|
||||||
xmlDoc.LoadXml(Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml)))
|
|
||||||
|
Try
|
||||||
|
xmlDoc.LoadXml(Encoding.UTF8.GetString(Convert.FromBase64String(resp.Xml)))
|
||||||
|
Catch ex As Exception
|
||||||
|
xmlDoc.LoadXml(resp.Xml)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim xpath As String = "Acuse/Folios"
|
Dim xpath As String = "Acuse/Folios"
|
||||||
Dim nodes = xmlDoc.SelectNodes(xpath)
|
Dim nodes = xmlDoc.SelectNodes(xpath)
|
||||||
CancelacionState = xmlDoc.GetElementsByTagName("EstatusUUID")(0).InnerText.ToEntero
|
CancelacionState = xmlDoc.GetElementsByTagName("EstatusUUID")(0).InnerText.ToEntero
|
||||||
|
|||||||
@@ -1185,12 +1185,19 @@
|
|||||||
|
|
||||||
<asp:TemplateField HeaderText="Cancelar" Visible="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%">
|
<asp:TemplateField HeaderText="Cancelar" Visible="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="LnkCancelarComplemetno" OnClick="LnkCancelarComplemetno_Click" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Regenerar"
|
<asp:LinkButton ID="LnkCancelarComplemetno" OnClick="LnkCancelarComplemetno_Click" runat="server" AlternateText="Editar" CausesValidation="False"
|
||||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el complemento?" data-btn-ok-label="si"
|
data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el complemento?" data-btn-ok-label="si"
|
||||||
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-minus'></i>" />
|
CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-minus'></i>" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<%-- <asp:TemplateField HeaderText="EstatusSAT" Visible="true" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="LnkEstatusSAT" OnClick="LnkEstatusSAT_Click" runat="server" AlternateText="Editar" CausesValidation="False"
|
||||||
|
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-question'></i>" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>--%>
|
||||||
|
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -501,6 +501,7 @@ Partial Class Bancos_IE
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
|
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
|
|
||||||
Folio = ""
|
Folio = ""
|
||||||
@@ -3916,9 +3917,10 @@ Partial Class Bancos_IE
|
|||||||
If CancelarComplemento Then
|
If CancelarComplemento Then
|
||||||
Dim ObjCancelacion As New Timbrado
|
Dim ObjCancelacion As New Timbrado
|
||||||
'Dim ObjBanco As New ClsBancos
|
'Dim ObjBanco As New ClsBancos
|
||||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
|
||||||
|
|
||||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
|
||||||
|
|
||||||
|
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
|
||||||
CargaComplementosPago()
|
CargaComplementosPago()
|
||||||
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
||||||
ErrorCancelarComplemento = False
|
ErrorCancelarComplemento = False
|
||||||
@@ -3926,8 +3928,22 @@ Partial Class Bancos_IE
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
|
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
||||||
|
|
||||||
|
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
||||||
|
CargaComplementosPago()
|
||||||
|
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
||||||
|
ErrorCancelarComplemento = False
|
||||||
|
Alert("El complemento se cancelo correctamente.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
ErrorCancelarComplemento = False
|
ErrorCancelarComplemento = False
|
||||||
End If
|
End If
|
||||||
@@ -5538,39 +5554,34 @@ Partial Class Bancos_IE
|
|||||||
RFCReceptorCancelar = GvRow.DataKey("RFCReceptor")
|
RFCReceptorCancelar = GvRow.DataKey("RFCReceptor")
|
||||||
CvePACCancelacion = GvRow.DataKey("CvePAC").ToEntero
|
CvePACCancelacion = GvRow.DataKey("CvePAC").ToEntero
|
||||||
|
|
||||||
|
|
||||||
Dim ObjCancelacion As New Timbrado
|
Dim ObjCancelacion As New Timbrado
|
||||||
Dim ObjBanco As New ClsBancos
|
Dim ObjBanco As New ClsBancos
|
||||||
|
|
||||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
|
||||||
|
|
||||||
If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
|
||||||
|
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
|
||||||
|
|
||||||
|
If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
|
||||||
CargaComplementosPago()
|
CargaComplementosPago()
|
||||||
|
|
||||||
' RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
|
||||||
Alert("El complemento se cancelo correctamente.")
|
Alert("El complemento se cancelo correctamente.")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert("Se presento un error al cancelar el complemento.")
|
|
||||||
|
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
||||||
|
|
||||||
|
If ObjBanco.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
||||||
|
|
||||||
|
Alert("El complemento se cancelo correctamente.")
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjBanco.Dispose()
|
ObjBanco.Dispose()
|
||||||
|
CargaComplementosPago()
|
||||||
|
|
||||||
'' INICIO Version 2
|
|
||||||
'CveComplementoPagoCancelar = GvRow.DataKey("CveComplementoPago").ToEntero
|
|
||||||
'FolioFiscalCancelar = GvRow.DataKey("FolioFiscal").ToString
|
|
||||||
'' Dim RFCEmisor As String = UsuarioActual.Empresa.RFC
|
|
||||||
'RFCReceptorCancelar = GvRow.DataKey("RFCReceptor")
|
|
||||||
'CvePACCancelacion = GvRow.DataKey("CvePAC").ToEntero
|
|
||||||
|
|
||||||
'RegistraScript("$('#ModalCancelarComplemetno').modal('show');")
|
|
||||||
|
|
||||||
'RdlCancelarComplemento.SelectedValue = "1"
|
|
||||||
'DivFechaCancelación.Visible = False
|
|
||||||
'UpModalCancelarComplemetno.Update()
|
|
||||||
'' FIN Version 2
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -5703,4 +5714,44 @@ Partial Class Bancos_IE
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
'Protected Sub LnkEstatusSAT_Click(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
' Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
|
||||||
|
|
||||||
|
' Dim FolioFiscal As String = GvRow.DataKey("FolioFiscal").ToString
|
||||||
|
' Dim RFCReceptor As String = GvRow.DataKey("RFCReceptor")
|
||||||
|
|
||||||
|
|
||||||
|
' EstatusSATCancelado(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor)
|
||||||
|
|
||||||
|
' 'Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, "0", True)
|
||||||
|
|
||||||
|
' 'If Vigencia IsNot Nothing Then
|
||||||
|
' ' Alert($"Estatus SAT: { Vigencia.Estado }")
|
||||||
|
' 'End If
|
||||||
|
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Function EstatusSATCancelado(FolioFiscal As String, RFCDe As String, RFCReceptor As String) As Boolean
|
||||||
|
|
||||||
|
Dim respuesta As Boolean = False
|
||||||
|
|
||||||
|
Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, RFCDe, RFCReceptor, "0", True)
|
||||||
|
|
||||||
|
If Vigencia IsNot Nothing Then
|
||||||
|
If Vigencia.Estado.ToUpper = "CANCELADO" Then
|
||||||
|
respuesta = True
|
||||||
|
Else
|
||||||
|
respuesta = False
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
respuesta = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Return respuesta
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
294
CRM/CatMetas.aspx
Normal file
294
CRM/CatMetas.aspx
Normal file
@@ -0,0 +1,294 @@
|
|||||||
|
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatMetas.aspx.vb" Inherits="CRM_CatMetas" %>
|
||||||
|
|
||||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
|
<style>
|
||||||
|
.Widthall {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_scrollHeadInner {
|
||||||
|
width: 100% !important;
|
||||||
|
background-color: #dddddd;
|
||||||
|
padding-left: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_scrollFoot {
|
||||||
|
display: none;
|
||||||
|
position: static;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-scrollable {
|
||||||
|
margin: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_scroll {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table.dataTable {
|
||||||
|
margin-top: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_scrollBody table th {
|
||||||
|
padding: 0px !important;
|
||||||
|
padding-right: 4px !important;
|
||||||
|
padding-left: 4px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sinlink td a {
|
||||||
|
pointer-events: none;
|
||||||
|
cursor: default;
|
||||||
|
color: black;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
||||||
|
.white a {
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||||
|
Catálogo de Metas
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
|
<asp:UpdatePanel runat="server" ID="UpAgregar">
|
||||||
|
<ContentTemplate>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton runat="server" ID="BtnAgregarMeta" data-toggle="tooltip" data-placement="left" title="Agregar Nueva Meta" Text="<i class='fa fa-plus'></i> Agregar Meta "></asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||||
|
<div class="portlet-title portlet-filterT smalltitle">
|
||||||
|
<div class="tools">
|
||||||
|
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="Valida"/>
|
||||||
|
<a href="javascript:;" class="expand"></a>
|
||||||
|
</div>
|
||||||
|
<div class="titlefiltros caption">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-1 ">Fecha Inicial:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
|
||||||
|
<asp:TextBox ID="txtFechaIF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="imgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtFechaIF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="txtFechaIF" PopupButtonID="ImgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:CompareValidator ID="cvFechaIF" runat="server" ControlToValidate="txtFechaIF" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoCvFIF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaIF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="rfvFechaIF" runat="server" ControlToValidate="txtFechaIF" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaIF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
<label class="col-md-1 ">Fecha Final:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80px !important; padding: 0px; margin-bottom: -10px;">
|
||||||
|
<asp:TextBox ID="txtFechaFF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||||
|
<span class="input-group-btn ">
|
||||||
|
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaFF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaFF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:CompareValidator ID="cvFechaFF" runat="server" ControlToValidate="txtFechaFF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaFF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaFF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
<label class="col-md-1 ">Estatus:</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<asp:DropDownList ID="DdlEstatus" DataTextField="DisplayText" DataValueField="CveZonaHoraria" runat="server" CssClass="form-control input-sm select2me">
|
||||||
|
<asp:ListItem Selected="True" Text="Activos" Value="1"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Inactivos" Value="0"></asp:ListItem>
|
||||||
|
<asp:ListItem Text="Ambos" Value="-1"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
|
||||||
|
<asp:UpdatePanel ID="UpGral" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="Widthall" style="text-align: right!important; margin-top: 20px!important; margin-bottom: 2px!important">
|
||||||
|
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvMeta.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvMeta.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row" style="margin: 5px">
|
||||||
|
<asp:UpdatePanel ID="UPGvMeta" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
|
<asp:GridView ID="GvMeta" runat="server" AutoGenerateColumns="False"
|
||||||
|
DataKeyNames="CveMeta,CveVendedor,FechaI,FechaF,NumMeta,Importe,Vendedor,NumAcercamientos,ImporteAcercamientos"
|
||||||
|
EmptyDataText="No se encontraron registros" ToolTip="Listado de Temas"
|
||||||
|
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||||
|
data-sort="true"
|
||||||
|
data-freezerows="1"
|
||||||
|
GridLines="None">
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField HeaderText="Vendedor">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LblVendedor" runat="server" Text='<%# Eval("Vendedor") %>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Número Meta" ItemStyle-Width="150px">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LblNumMeta" runat="server" Text='<%# Eval("NumMeta")%>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Núm. Acercamientos" ItemStyle-Width="150px">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LblNumAcercamientos" runat="server" Text='<%# Eval("NumAcercamientos")%>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="lblImporte" runat="server" Text='<%# Eval("Importe", "{0:N2}")%>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Importe Acercam." ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="lblImporteAcercamientos" runat="server" Text='<%# Eval("ImporteAcercamientos", "{0:N2}")%>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="ImgE" OnClick="Edit_ClickMeta" runat="server" AlternateText="Editar" CausesValidation="False"
|
||||||
|
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="40px">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="imgD" OnClick="Remove_ClickMeta" runat="server" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div id="DivAgregarMeta" class="modal ADS fade" role="dialog">
|
||||||
|
<div class="modal-dialog" style="width: 450px;">
|
||||||
|
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalMeta" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-header ">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<asp:Literal ID="LtlTituloModalMeta" runat="server">Agregar Meta</asp:Literal></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright" style="width: 170px!important">
|
||||||
|
<asp:DropDownList ID="DdlVendedor" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveVendedor" DataTextField="Vendedor" Class="table-group-action-input form-control input-inline input-small input-sm" Width="250px" AutoPostBack="true"></asp:DropDownList>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVVendedor" InitialValue="-1" runat="server" ControlToValidate="DdlVendedor" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vendedor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMeta"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEProducto2" runat="server" HighlightCssClass="vco" TargetControlID="RFVVendedor" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<label for="<%= DdlVendedor.ClientID.ToString()%>">Vendedor:</label>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div style="width: 150px; display: inline-block">
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtFechaF" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicial''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMeta"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= txtFechaI.ClientID.ToString()%>">Fecha Inicial:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
|
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpMeta"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpMeta"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div style="width: 150px; display: inline-block">
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtFechaF" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Final''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMeta"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= txtFechaF.ClientID.ToString()%>">Fecha Final:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<asp:LinkButton ID="imgCalendario2" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
|
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="txtFechaF" PopupButtonID="ImgCalendario2" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
|
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpMeta"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpMeta"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright" style="width: 200px!important">
|
||||||
|
<asp:TextBox ID="TxtNumMeta" CssClass="form-control " Width="150px" runat="server" MaxLength="10" CausesValidation="true" Style="text-align: right!important" OnKeyup="FormatoMoneda(this);"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvTxtNumMeta" runat="server" ControlToValidate="TxtNumMeta" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Número de Acercamientos Meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMeta"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= TxtNumMeta.ClientID.ToString()%>">Núm. Acercamientos Meta:</label>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright" style="width: 170px!important">
|
||||||
|
<asp:TextBox ID="TxtImporte" CssClass="form-control " Width="150px" runat="server" MaxLength="10" CausesValidation="true" Style="text-align: right!important" OnKeyup="FormatoMoneda(this);"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvTxtImporte" runat="server" ControlToValidate="TxtImporte" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMeta"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= TxtImporte.ClientID.ToString()%>">Importe:</label>
|
||||||
|
<i></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:Button ID="BtnAgregarMetaModal" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpMeta" />
|
||||||
|
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content9" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
|
||||||
169
CRM/CatMetas.aspx.vb
Normal file
169
CRM/CatMetas.aspx.vb
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
Imports System.Data
|
||||||
|
Imports Extensiones
|
||||||
|
|
||||||
|
|
||||||
|
Partial Class CRM_CatMetas
|
||||||
|
Inherits ClsPaginas
|
||||||
|
|
||||||
|
Private Property CveMeta As Integer
|
||||||
|
Get
|
||||||
|
If Not ViewState("CveMeta") Is Nothing Then
|
||||||
|
Return ViewState("CveMeta").ToString.ToEntero
|
||||||
|
Else
|
||||||
|
Return -1
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
ViewState("CveMeta") = value
|
||||||
|
End Set
|
||||||
|
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private Property Actualizar As Boolean
|
||||||
|
Get
|
||||||
|
If Not ViewState("Actualizar") Is Nothing Then
|
||||||
|
Return DirectCast(ViewState("Actualizar"), Boolean)
|
||||||
|
Else
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("Actualizar") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
|
|
||||||
|
If Not Page.IsPostBack Then
|
||||||
|
txtFechaIF.Text = Now.ToShortDateString
|
||||||
|
txtFechaFF.Text = Now.Day.ToString + "/" + (Now.Month + 1).ToString + "/" + Now.Year.ToString
|
||||||
|
CargadatosGvMeta()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargadatosGvMeta()
|
||||||
|
|
||||||
|
Dim ObjCRM As New ClsCRM
|
||||||
|
|
||||||
|
If ObjCRM.GetMetas(txtFechaIF.Text.ToDateTime, txtFechaFF.Text.ToDateTime, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
||||||
|
GvMeta.DataSource = ObjCRM.DtResultados
|
||||||
|
Else
|
||||||
|
GvMeta.DataSource = Nothing
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjCRM.Dispose()
|
||||||
|
|
||||||
|
UPGvMeta.DataBind()
|
||||||
|
UpGral.Update()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnAgregarMeta_Click(sender As Object, e As EventArgs) Handles BtnAgregarMeta.Click
|
||||||
|
LtlTituloModalMeta.Text = "Agregar Meta"
|
||||||
|
BtnAgregarMetaModal.Text = "Agregar"
|
||||||
|
|
||||||
|
CargaVendedores()
|
||||||
|
txtFechaI.Text = Now.ToShortDateString
|
||||||
|
txtFechaF.Text = (Now.Day + 1).ToString + "/" + Now.Month.ToString + "/" + Now.Year.ToString
|
||||||
|
|
||||||
|
Actualizar = False
|
||||||
|
UpGral.Update()
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarMeta"))
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaVendedores()
|
||||||
|
DdlVendedor.Items.Clear()
|
||||||
|
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, 1)
|
||||||
|
DdlVendedor.DataBind()
|
||||||
|
DdlVendedor.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnAgregarMetaModal_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaModal.Click
|
||||||
|
|
||||||
|
Dim ObjCRM As New ClsCRM
|
||||||
|
|
||||||
|
If Not Actualizar Then
|
||||||
|
If ObjCRM.AddMetas(DdlVendedor.SelectedValue.ToEntero, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, TxtNumMeta.Text.ToEntero, TxtImporte.Text.ToDecimal, UsuarioActual.CveEmpresa) Then
|
||||||
|
|
||||||
|
CargadatosGvMeta()
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarMeta"), "jsHideModalMeta")
|
||||||
|
Alert("Meta Agregada Correctamente", TipoMensaje.MsgInformacion)
|
||||||
|
Else
|
||||||
|
Alert("Ocurrió un error al guardar la Meta", TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If ObjCRM.UpdateMetas(CveMeta, DdlVendedor.SelectedValue.ToEntero, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, TxtNumMeta.Text.ToEntero, TxtImporte.Text.ToDecimal, UsuarioActual.CveEmpresa) Then
|
||||||
|
|
||||||
|
CargadatosGvMeta()
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarMeta"), "jsHideModalMeta")
|
||||||
|
Alert("Meta Actualizada Correctamente", TipoMensaje.MsgInformacion)
|
||||||
|
Else
|
||||||
|
Alert("Ocurrió un error al Actualizar la Meta", TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
CveMeta = -1
|
||||||
|
Actualizar = False
|
||||||
|
|
||||||
|
ObjCRM.Dispose()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Remove_ClickMeta(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim ObjCRM As New ClsCRM
|
||||||
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
|
CveMeta = GvRow.DataKey("CveMeta")
|
||||||
|
|
||||||
|
If ObjCRM.RemoveMetas(CveMeta, UsuarioActual.CveEmpresa) Then
|
||||||
|
CargadatosGvMeta()
|
||||||
|
|
||||||
|
Alert("Meta eliminada Correctamente ", TipoMensaje.MsgInformacion)
|
||||||
|
Else
|
||||||
|
Alert("Ocurrió un error al Eliminar la Meta", TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjCRM.Dispose()
|
||||||
|
|
||||||
|
CargadatosGvMeta()
|
||||||
|
|
||||||
|
CveMeta = -1
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Edit_ClickMeta(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
|
|
||||||
|
LtlTituloModalMeta.Text = "Editar Meta"
|
||||||
|
BtnAgregarMetaModal.Text = "Actualizar"
|
||||||
|
Actualizar = True
|
||||||
|
|
||||||
|
CveMeta = GvRow.DataKey("CveMeta")
|
||||||
|
|
||||||
|
|
||||||
|
DdlVendedor.Items.Clear()
|
||||||
|
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa, 1)
|
||||||
|
DdlVendedor.DataBind()
|
||||||
|
DdlVendedor.SelectedValueExist(GvRow.DataKey("CveVendedor").ToEntero)
|
||||||
|
|
||||||
|
txtFechaI.Text = GvRow.DataKey("FechaI")
|
||||||
|
txtFechaF.Text = GvRow.DataKey("FechaF")
|
||||||
|
|
||||||
|
TxtNumMeta.Text = GvRow.DataKey("NumMeta").ToEntero
|
||||||
|
|
||||||
|
TxtImporte.Text = GvRow.DataKey("Importe").ToDecimal.ToString("###,###,###.00")
|
||||||
|
|
||||||
|
UpModalMeta.Update()
|
||||||
|
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarMeta"))
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||||
|
CargadatosGvMeta()
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
@@ -1409,6 +1409,7 @@ Partial Class Compras_Compras
|
|||||||
ChkAplicaNotaCredito.Enabled = False
|
ChkAplicaNotaCredito.Enabled = False
|
||||||
RBLPago.Enabled = False
|
RBLPago.Enabled = False
|
||||||
BtnGuardar.Enabled = False
|
BtnGuardar.Enabled = False
|
||||||
|
BtnGuardar.ToolTip = "Obliga a seleccionar una Orden de compra para su registro."
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1498,9 +1498,11 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
'Registro la prepóliza
|
'Registro la prepóliza
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||||
Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUM("Total", "").ToDecimal.RoundSQL()
|
Dim tValorInventario As Decimal = ObjInventario.DtResultados.SUM("Total", "").ToDecimal.RoundSQL()
|
||||||
|
Dim tValorOtro As Decimal = tValorInventario
|
||||||
Dim idCtaContable As Integer = 0
|
Dim idCtaContable As Integer = 0
|
||||||
Dim IdCtaContableOtro As Integer = UsuarioActual.Empresa.IdCuentaOtrosIngresos
|
Dim IdCtaContableOtro As Integer = UsuarioActual.Empresa.IdCuentaOtrosIngresos
|
||||||
Dim TipoMovtoAlmacen As Boolean = False
|
Dim TipoMovtoAlmacen As Boolean = False
|
||||||
|
Dim TipoMovtoOtro As Boolean = True
|
||||||
Dim tCveSubProyecto As Integer = -1
|
Dim tCveSubProyecto As Integer = -1
|
||||||
|
|
||||||
Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", DdlAlmacen.SelectedValue))
|
Dim drA2 As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", DdlAlmacen.SelectedValue))
|
||||||
@@ -1530,6 +1532,8 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
End If
|
End If
|
||||||
Case 13, 29
|
Case 13, 29
|
||||||
CveConceptoContable = 69
|
CveConceptoContable = 69
|
||||||
|
TipoMovtoOtro = True
|
||||||
|
tValorOtro = -tValorOtro
|
||||||
Dim drr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero("")
|
Dim drr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimero("")
|
||||||
If drr IsNot Nothing Then
|
If drr IsNot Nothing Then
|
||||||
CveClasificacion = drr("CveClasificacion").ToString.ToEntero
|
CveClasificacion = drr("CveClasificacion").ToString.ToEntero
|
||||||
@@ -1556,7 +1560,7 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
' End If
|
' End If
|
||||||
'Next
|
'Next
|
||||||
'Case Else
|
'Case Else
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, tValorInventario, TxtObservaciones.Text.Trim, CveConceptoContable, TxtObservaciones.Text.Trim, TxtFecha.Text.ToDate, IdCtaContableOtro, -1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=tValorInventario, CveSubProyecto:=tCveSubProyecto, CveClasificacion:=CveClasificacion) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOtro, tValorOtro, TxtObservaciones.Text.Trim, CveConceptoContable, TxtObservaciones.Text.Trim, TxtFecha.Text.ToDate, IdCtaContableOtro, -1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=tValorOtro, CveSubProyecto:=tCveSubProyecto, CveClasificacion:=CveClasificacion) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
'End Select
|
'End Select
|
||||||
|
|||||||
@@ -1 +1,7 @@
|
|||||||
|
|
||||||
|
28/08/2019:04:44 p. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 79
|
||||||
|
|
||||||
|
28/08/2019:05:48 p. m. No se especifico a remitente - SIG - Se Genero una Recepción de Usados con el folio: 80
|
||||||
|
|
||||||
|
02/09/2019:11:00 a. m. From:'signotificaciones@adssistemas.mx' - Para:'x@x.com' - Asunto:'Entrega de Factura SUCURSAL NARANJO SN-22' - CCP: '' - Adjuntos: 1
|
||||||
|
|
||||||
@@ -6,3 +6,7 @@
|
|||||||
.. PAC: 2 - Verificado : (200) 200 Armado: (398) 598 Guardado: (564) 1162 Timbrado: (2342) 3504 Actualizado: (456) 3960 ..02/09/2019:11:00 a. m.
|
.. PAC: 2 - Verificado : (200) 200 Armado: (398) 598 Guardado: (564) 1162 Timbrado: (2342) 3504 Actualizado: (456) 3960 ..02/09/2019:11:00 a. m.
|
||||||
|
|
||||||
.. PAC: 2 - Verificado : (170) 170 Armado: (285) 455 Guardado: (333) 788 Timbrado: (1949) 2737 Actualizado: (20) 2757 ..02/09/2019:11:00 a. m.
|
.. PAC: 2 - Verificado : (170) 170 Armado: (285) 455 Guardado: (333) 788 Timbrado: (1949) 2737 Actualizado: (20) 2757 ..02/09/2019:11:00 a. m.
|
||||||
|
|
||||||
|
.. PAC: 3 - Verificado : (37) 37 Armado: (43) 80 Genera: (0) 80 Timbrado: (7893) 7973 Actualizado: (19) 7992 ..05/09/2019:11:02 a. m.
|
||||||
|
|
||||||
|
.. PAC: 3 - Verificado : (36) 36 Armado: (32) 68 Genera: (0) 68 Timbrado: (10604) 10672 Actualizado: (16) 10688 ..05/09/2019:12:31 p. m.
|
||||||
|
|||||||
Reference in New Issue
Block a user