This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2024-05-30 07:17:54 -07:00
57 changed files with 4086 additions and 3430 deletions

View File

@@ -161,6 +161,8 @@ Public Class ClsClientes
Public Property CveAlmacenAlterno As Integer = -1 Public Property CveAlmacenAlterno As Integer = -1
Public Property CveAlmacenConsignacion As Integer = -1 Public Property CveAlmacenConsignacion As Integer = -1
Public Property UsaProductoAlterno As Boolean = False Public Property UsaProductoAlterno As Boolean = False
Public Property EnDemanda As Boolean = False
Public Property EnQuebranto As Boolean = False
#End Region #End Region
@@ -413,6 +415,8 @@ Public Class ClsClientes
_CveAlmacenConsignacion = Data(0)("CveAlmacenConsignacion").ToString.ToEntero _CveAlmacenConsignacion = Data(0)("CveAlmacenConsignacion").ToString.ToEntero
_UsaProductoAlterno = CBool(Data(0)("UsaProductoAlterno")) _UsaProductoAlterno = CBool(Data(0)("UsaProductoAlterno"))
_EnDemanda = CBool(Data(0)("UsaProductoAlterno"))
_EnQuebranto = CBool(Data(0)("EnQuebranto"))
End If End If
Retorno = True Retorno = True
@@ -530,7 +534,8 @@ Public Class ClsClientes
Optional CveMotivoTraslado As Integer = 0, Optional NumRegIdTrib As String = "", Optional ComExtEstado As String = "-1", Optional ComExtMunicipio As String = "-1", Optional ComExtColonia As String = "-1", Optional RequiereOC As Boolean = False, Optional CveMotivoTraslado As Integer = 0, Optional NumRegIdTrib As String = "", Optional ComExtEstado As String = "-1", Optional ComExtMunicipio As String = "-1", Optional ComExtColonia As String = "-1", Optional RequiereOC As Boolean = False,
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0,
Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False,
Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False) As Boolean Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False,
Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -662,6 +667,8 @@ Public Class ClsClientes
.Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno .Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno
.Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion .Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion
.Add("@UsaProductoAlterno", SqlDbType.Bit).Value = UsaProductoAlterno .Add("@UsaProductoAlterno", SqlDbType.Bit).Value = UsaProductoAlterno
.Add("@EnDemanda", SqlDbType.Bit).Value = EnDemanda
.Add("@EnQuebranto", SqlDbType.Bit).Value = EnQuebranto
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
@@ -707,7 +714,8 @@ Public Class ClsClientes
Optional ApellidoPaternoPF As String = "-1", Optional ApellidoMaternoPF As String = "-1", Optional NombresPF As String = "-1", Optional RequiereOC As Boolean = False, Optional ApellidoPaternoPF As String = "-1", Optional ApellidoMaternoPF As String = "-1", Optional NombresPF As String = "-1", Optional RequiereOC As Boolean = False,
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1",
Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False, Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False,
Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False) As Boolean Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False,
Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -849,7 +857,8 @@ Public Class ClsClientes
.Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion .Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion
.Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno .Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno
.Add("@UsaProductoAlterno", SqlDbType.Bit).Value = UsaProductoAlterno .Add("@UsaProductoAlterno", SqlDbType.Bit).Value = UsaProductoAlterno
.Add("@EnDemanda", SqlDbType.Bit).Value = EnDemanda
.Add("@EnQuebranto", SqlDbType.Bit).Value = EnQuebranto
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -3201,7 +3201,7 @@ Public Class ClsContratos
End Function End Function
Public Function GetPresupuestosResumen(CveEmpresa As Integer, CveSubProyecto As Integer, Opcion As Integer) As Boolean Public Function GetPresupuestosResumen(CveEmpresa As Integer, CveSubProyecto As Integer, FechaInicio As Date, FechaFin As Date, Opcion As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Con_PresupuestosResumenGet") DataAdapter("PA_Con_PresupuestosResumenGet")
@@ -3209,6 +3209,8 @@ Public Class ClsContratos
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Opcion", SqlDbType.Int).Value = Opcion .Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
End With End With
Try Try

View File

@@ -3,8 +3,6 @@ Option Strict On
Imports System.Data Imports System.Data
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports Extensiones Imports Extensiones
Imports Microsoft.Web.XmlTransform
Imports Telerik.Web.UI.ComboBox.ComboBoxStyles
Public Class ClsInventarios Public Class ClsInventarios
Implements IDisposable Implements IDisposable
@@ -1357,7 +1355,7 @@ Public Class ClsInventarios
End If End If
Catch Ex1 As SqlException Catch Ex1 As SqlException
If Ex1.Message.Contains("50019") Then If Ex1.Message.Contains("50019") Then
Me.OnError(" El producto no tiene existencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Me.OnError(String.Format(" El producto '{0}' no tiene existencia.", Ex1.Message.GetTagValue("codigops")), Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
ElseIf Ex1.Message.Contains("CK_Inv_MovimientosDetalle_MetodoInventario") Then ElseIf Ex1.Message.Contains("CK_Inv_MovimientosDetalle_MetodoInventario") Then
Me.OnError("El movimiento debe de tener una Serie.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Me.OnError("El movimiento debe de tener una Serie.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else Else
@@ -3326,11 +3324,12 @@ Public Class ClsInventarios
#End Region #End Region
#Region " INVENTARIOS - VENTAS " #Region " INVENTARIOS - VENTAS "
Public Function EntregaAlmacenGet(CveVenta As Integer, Optional CveAlmacen As Integer = -1) As Boolean Public Function EntregaAlmacenGet(CveVenta As Integer, CveEmpresa As Integer, Optional CveAlmacen As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_EntregaAlmacenGet") DataAdapter("PA_Inv_EntregaAlmacenGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
End With End With
Try Try

View File

@@ -1952,12 +1952,18 @@ Public Class ClsPaginas
If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjInventarios.DtResultados If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjInventarios.DtResultados
ObjInventarios.Dispose() ObjInventarios.Dispose()
End If End If
Dim Str As New StringBuilder
If CveCamion > 0 Then Str.AppendFormat("CveCamion = {0}", CveCamion) Dim filtros As New List(Of String)
If CveTipoCamion > 0 Then Str.AppendFormat("CveTipoCamion = {0}", CveTipoCamion) If CveCamion >= 0 Then filtros.Add($"CveCamion = {CveCamion} ")
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) If CveTipoCamion >= 0 Then filtros.Add($"CveTipoCamion = {CveTipoCamion} ")
If filtros.Count > 0 Then
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
GlobalDTInvCamiones = Dv.ToTable GlobalDTInvCamiones = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else
GlobalDTInvCamiones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTInvCamiones-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTInvCamiones-{CveEmpresa}"
@@ -6984,6 +6990,15 @@ Public Class ClsPaginas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
params.Add(New ReportParameter("UsaProductoAlterno", If(Vta.Cliente.UsaProductoAlterno, "1", "0"))) params.Add(New ReportParameter("UsaProductoAlterno", If(Vta.Cliente.UsaProductoAlterno, "1", "0")))
params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion))
params.Add(New ReportParameter("Medico", Vta.Medico))
params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento))
params.Add(New ReportParameter("FechaCirugia", Vta.FechaParaSurtir.ToString("yyyy-MM-dd HH:mm")))
params.Add(New ReportParameter("Paciente", Vta.Paciente))
params.Add(New ReportParameter("Episodio", Vta.Episodio))
params.Add(New ReportParameter("Alfa1", Vta.Alfa1))
End If End If
'PARAMETROS SEGUN TIPO DOCUMENTO 'PARAMETROS SEGUN TIPO DOCUMENTO
@@ -7022,16 +7037,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("Ref", TipoDocumentoRef)) params.Add(New ReportParameter("Ref", TipoDocumentoRef))
params.Add(New ReportParameter("AplicaPagare", AplicaPagare)) params.Add(New ReportParameter("AplicaPagare", AplicaPagare))
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion))
params.Add(New ReportParameter("Medico", Vta.Medico))
params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento))
params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy HH:mm")))
params.Add(New ReportParameter("Paciente", Vta.Paciente))
params.Add(New ReportParameter("Episodio", Vta.Episodio))
params.Add(New ReportParameter("Alfa1", Vta.Alfa1))
End If
'VSH 'VSH
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122, 145) Then If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122, 145) Then
'DATOS CLIENTES 'DATOS CLIENTES
@@ -7081,15 +7087,6 @@ Public Class ClsPaginas
params.Add(New ReportParameter("Ref", TipoDocumentoRef)) params.Add(New ReportParameter("Ref", TipoDocumentoRef))
params.Add(New ReportParameter("AplicaPagare", AplicaPagare)) params.Add(New ReportParameter("AplicaPagare", AplicaPagare))
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion))
params.Add(New ReportParameter("Medico", Vta.Medico))
params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento))
params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy HH:mm")))
params.Add(New ReportParameter("Paciente", Vta.Paciente))
params.Add(New ReportParameter("Episodio", Vta.Episodio))
params.Add(New ReportParameter("Alfa1", Vta.Alfa1))
End If
RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo)
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
@@ -7115,11 +7112,11 @@ Public Class ClsPaginas
params.Add(New ReportParameter("CveVenta", Vta.CveVenta.ToString)) params.Add(New ReportParameter("CveVenta", Vta.CveVenta.ToString))
End If End If
'COMPU DN DIFUSA 'COMPU DN DIFUSA
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 137, 132, 144, 177, 186) Then If UsuarioActual.CveEmpresa.Contiene(1, 119, 137, 132, 144, 177, 186) Then
Dim FirmaVendedor As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", UsuarioActual.Empresa.Ruta, Vta.CveVendedor)) Dim FirmaVendedor As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", UsuarioActual.Empresa.Ruta, Vta.CveVendedor))
params.Add(New ReportParameter("FirmaVendedor", If(FirmaVendedor.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", UsuarioActual.CveEmpresa, Vta.CveVendedor))).AbsoluteUri, ""))) params.Add(New ReportParameter("FirmaVendedor", If(FirmaVendedor.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", UsuarioActual.CveEmpresa, Vta.CveVendedor))).AbsoluteUri, "")))
params.Add(New ReportParameter("Entrega", Vta.Entrega)) params.Add(New ReportParameter("Entrega", Vta.Entrega))
params.Add(New ReportParameter("Vigencia", Vta.Vigencia.ToString("dd/MMMM/yyyy"))) params.Add(New ReportParameter("Vigencia", Vta.Vigencia.ToString("yyyy-MM-dd")))
params.Add(New ReportParameter("Sucursal", Vta.SubProyecto.SubProyecto)) params.Add(New ReportParameter("Sucursal", Vta.SubProyecto.SubProyecto))
params.Add(New ReportParameter("SucursalCliente", If(Vta.ClienteSucursal.Sucursal Is Nothing, "", Vta.ClienteSucursal.Sucursal.ToString))) params.Add(New ReportParameter("SucursalCliente", If(Vta.ClienteSucursal.Sucursal Is Nothing, "", Vta.ClienteSucursal.Sucursal.ToString)))
params.Add(New ReportParameter("CveMoneda", Vta.CveMoneda.ToString)) params.Add(New ReportParameter("CveMoneda", Vta.CveMoneda.ToString))
@@ -7133,11 +7130,8 @@ Public Class ClsPaginas
RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo)
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
Case "Egs" Case "Egs"
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
NombreArchivo = "NotaCredito"
Else
NombreArchivo = "Factura" NombreArchivo = "Factura"
End If
NombreArchivoDescarga = "Nota de Crédito" NombreArchivoDescarga = "Nota de Crédito"
TipoDocumento = "EGRESO" TipoDocumento = "EGRESO"
TipoDocumentoRef = String.Format(": Ref.:{0}", Vta.RefDocto) TipoDocumentoRef = String.Format(": Ref.:{0}", Vta.RefDocto)
@@ -7163,22 +7157,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("Tipo", TipoDocumento)) params.Add(New ReportParameter("Tipo", TipoDocumento))
params.Add(New ReportParameter("Ref", TipoDocumentoRef)) params.Add(New ReportParameter("Ref", TipoDocumentoRef))
params.Add(New ReportParameter("AplicaPagare", AplicaPagare)) params.Add(New ReportParameter("AplicaPagare", AplicaPagare))
'INE COMPLEMENTOS
If UsuarioActual.CveEmpresa.Contiene(72) Then
Dim INETipoProceso As String = ""
Dim INETipoComite As String = ""
Dim INEIdContabilidad As Integer = 0
If Vta.ComplementoINE IsNot Nothing Then
INETipoProceso = Vta.ComplementoINE.INETipoProceso
INETipoComite = Vta.ComplementoINE.INETipoComite
INEIdContabilidad = Vta.ComplementoINE.INEIdContabilidad
End If
params.Add(New ReportParameter("INETipoProceso", INETipoProceso))
params.Add(New ReportParameter("INETipoComite", INETipoComite))
params.Add(New ReportParameter("INEIdContabilidad", INEIdContabilidad.ToString))
params.Add(New ReportParameter("Referencia", Vta.Cliente.ReferenciaFiscal))
params.Add(New ReportParameter("ClienteContacto", Vta.AtencionA))
End If
RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo)
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
Case "Ped" Case "Ped"
@@ -7192,14 +7171,6 @@ Public Class ClsPaginas
params.Add(New ReportParameter("AplicaPagare", AplicaPagare)) params.Add(New ReportParameter("AplicaPagare", AplicaPagare))
params.Add(New ReportParameter("CveAlmacenTraspasoOrigen", Vta.CveAlmacenTraspasoOrigen.ToString)) params.Add(New ReportParameter("CveAlmacenTraspasoOrigen", Vta.CveAlmacenTraspasoOrigen.ToString))
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
params.Add(New ReportParameter("Documentacion", Vta.Cliente.Documentacion))
params.Add(New ReportParameter("Medico", Vta.Medico))
params.Add(New ReportParameter("Procedimiento", Vta.Procedimiento))
params.Add(New ReportParameter("FechaCirugia", Vta.FechaEjecucion.ToString("dd/MM/yyyy HH:mm")))
params.Add(New ReportParameter("Paciente", Vta.Paciente))
params.Add(New ReportParameter("Episodio", Vta.Episodio))
End If
RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo) RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo)
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo) RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
@@ -7616,116 +7587,6 @@ Public Class ClsPaginas
Return o.Value Return o.Value
End If End If
End Function End Function
Public Sub GenerarFacturaVenta(CveVenta As Integer)
Dim ObjVentas As New ClsVentas
Dim Vta As Modelos.Factura = Nothing
Dim TmpDTImpuestos As DataTable = New DataTable
TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String))
TmpDTImpuestos.Columns.Add("Importe", GetType(Double))
TmpDTImpuestos.Columns.Add("Orden", GetType(Integer))
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa, False) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
Dim dtVentas As DataTable = ObjVentas.DtResultados
' se rellenan los campos de la factura
Vta = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.Factura)
Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
'se rellena la sucursal
Vta.SubProyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel)
Vta.Cliente = New Modelos.ClienteModel
Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString
Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString
Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString
Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString
Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString
Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString
Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString
Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString
Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString
Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString
Vta.AtencionA = dtVentas(0)("AtencionA").ToString
Vta.TelefonoGenerico = dtVentas(0)("TelefonoGenerico").ToString
Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString
Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString
Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString
Vta.Cliente.Mail = dtVentas(0)("Mail").ToString
Vta.RefDocto = dtVentas(0)("Ref").ToString
Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero
Vta.Version = dtVentas(0)("Version").ToString
Vta.ClienteSucursal = New Modelos.SucursalModel
Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString
Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString
Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString
Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString
Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString
Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString
Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString
Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString
Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString
Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString
Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString
Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString
Vta.EnviarA = New Modelos.EnviarAModel
Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero
Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString
Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString
Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString
Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString
Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString
Dim DR As DataRow = TmpDTImpuestos.NewRow()
If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("IVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR)
'solo para eclipse, que muesre un subtotal debajo de IVA
If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 1000 : TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
End If
If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra
Vta.DtDetalle = ObjVentas.DtResultados
End If
If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then
Dim dtImpuesto As DataTable = ObjVentas.DtResultados
If dtImpuesto.Rows.Count > 0 Then
For Each Row As DataRow In dtImpuesto.Rows
Dim Orden As Integer = 80
If Row("Importe").ToString.ToDouble <> 0 Then
DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString
DR("Importe") = Row("Importe").ToString.ToDouble
DR("Orden") = Orden
TmpDTImpuestos.Rows.Add(DR)
DR = TmpDTImpuestos.NewRow()
Orden = Orden + 1
End If
Next
End If
Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
Else
Vta.DtDeduccion = ObjVentas.DtResultados
End If
End If
If ObjVentas.GetVentasFirmas(CveVenta) Then
Vta.DtFirmas = ObjVentas.DtResultados
End If
End If
ObjVentas.Dispose()
If Not IsNothing(Vta) Then
PdfFactura(Vta)
Vta = Nothing
End If
End Sub
#End Region #End Region
Public Function RutaFormatoReporte(NombreReporte As String) As String Public Function RutaFormatoReporte(NombreReporte As String) As String
@@ -7745,7 +7606,6 @@ Public Class ClsPaginas
Public Function NewGeneraBytesOC(tCveOrdenCompra As Integer, Optional MR As ReportViewer = Nothing, Optional ConBitacora As Boolean = False) As Byte() Public Function NewGeneraBytesOC(tCveOrdenCompra As Integer, Optional MR As ReportViewer = Nothing, Optional ConBitacora As Boolean = False) As Byte()
Dim bytes As Byte() = Nothing Dim bytes As Byte() = Nothing
Dim CveEmpresaActual As Integer Dim CveEmpresaActual As Integer
Dim TmpDTEnvioDireccion As DataTable
Dim params As New List(Of ReportParameter) Dim params As New List(Of ReportParameter)
Try Try
Dim DtDetalle As DataTable = Nothing Dim DtDetalle As DataTable = Nothing
@@ -7774,68 +7634,6 @@ Public Class ClsPaginas
'Obtenemos la sucursal de la OC PARA COMPU PROVEEDORES 'Obtenemos la sucursal de la OC PARA COMPU PROVEEDORES
Dim DomicilioSucursal As String = "" Dim DomicilioSucursal As String = ""
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
Dim SBDomicilioSucursal As New StringBuilder()
Dim CiudadSucursal As String = ""
Dim ObjClientes As New ClsClientes
If ObjOC.GetSucursalOC(ObjOC.CveOrdenCompra) AndAlso ObjOC.DtResultados.Rows.Count > 0 Then
CiudadSucursal = String.Format("{0},{1}", ObjOC.SucMunicipio, ObjOC.SucEstado)
SBDomicilioSucursal.AppendFormat("{0}", ObjOC.SucCalle)
If ObjOC.SucNoExt.Length > 0 Then SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", ObjOC.SucNoExt)
If ObjOC.SucNoInt.Length > 0 Then SBDomicilioSucursal.AppendFormat(", No.Int: {0}", ObjOC.SucNoInt)
If ObjOC.SucColonia.Length > 0 Then SBDomicilioSucursal.AppendFormat(", Col: {0}", ObjOC.SucColonia)
If ObjOC.SucCP.Length > 0 Then SBDomicilioSucursal.AppendFormat(", CP: {0}", ObjOC.SucCP)
If CiudadSucursal.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal)
If ObjOC.SucPais.Length > 0 Then SBDomicilioSucursal.AppendFormat(", {0}", ObjOC.SucPais)
DomicilioSucursal = SBDomicilioSucursal.ToString
params.Add(New ReportParameter("Proyecto", ObjOC.SucSubProyecto.ToString))
params.Add(New ReportParameter("Telefono", ObjOC.SucTelefono.ToString))
'Obtenemos la direccion envio PARA COMPU PROVEEDORES
If ObjOC.CveDireccionEnvio > 0 Then
Dim StrEnvioDi As New StringBuilder
If ObjClientes.DireccionEnvioGet(ObjOC.CveDireccionEnvio, ObjOC.CveCliente, -1) Then
TmpDTEnvioDireccion = ObjClientes.DtResultados
Else
TmpDTEnvioDireccion = Nothing
End If
ObjClientes.Dispose()
If TmpDTEnvioDireccion IsNot Nothing AndAlso TmpDTEnvioDireccion.FiltraParametros(String.Format("CveDireccionEnvio = {0}", ObjOC.CveDireccionEnvio)).Rows.Count > 0 Then
StrEnvioDi.AppendFormat("{0}", TmpDTEnvioDireccion(0)("EnvioDireccion"))
If TmpDTEnvioDireccion(0)("EnvioNoExt") IsNot Nothing AndAlso TmpDTEnvioDireccion(0)("EnvioNoExt").ToString.Length > 0 Then StrEnvioDi.AppendFormat(", No.Ext: {0}", TmpDTEnvioDireccion(0)("EnvioNoExt"))
If TmpDTEnvioDireccion(0)("EnvioNoInt") IsNot Nothing AndAlso TmpDTEnvioDireccion(0)("EnvioNoInt").ToString.Length > 0 Then StrEnvioDi.AppendFormat(", No.Int: {0}", TmpDTEnvioDireccion(0)("EnvioNoInt"))
params.Add(New ReportParameter("EnvioDireccion", StrEnvioDi.ToString))
params.Add(New ReportParameter("EnvioNoExt", TmpDTEnvioDireccion(0)("EnvioNoExt").ToString))
params.Add(New ReportParameter("EnvioNoInt", TmpDTEnvioDireccion(0)("EnvioNoInt").ToString))
params.Add(New ReportParameter("EnvioColonia", TmpDTEnvioDireccion(0)("EnvioColonia").ToString))
params.Add(New ReportParameter("EnvioCiudad", TmpDTEnvioDireccion(0)("EnvioCiudad").ToString))
params.Add(New ReportParameter("EnvioEstado", TmpDTEnvioDireccion(0)("EnvioEstado").ToString))
params.Add(New ReportParameter("EnvioContacto", TmpDTEnvioDireccion(0)("EnvioContacto").ToString))
params.Add(New ReportParameter("EnvioDepartamento", TmpDTEnvioDireccion(0)("EnvioDepartamento").ToString))
params.Add(New ReportParameter("EnvioCP", TmpDTEnvioDireccion(0)("EnvioCP").ToString))
params.Add(New ReportParameter("EnvioTel", TmpDTEnvioDireccion(0)("EnvioTel").ToString))
End If
Else
If ObjOC.LugarEntrega.ToString IsNot Nothing AndAlso ObjOC.LugarEntrega.ToString = "" Then
Dim StrEnvioDi As New StringBuilder
StrEnvioDi.AppendFormat("{0}", ObjOC.SucCalle)
If ObjOC.SucNoExt.Length > 0 Then StrEnvioDi.AppendFormat(", No.Ext: {0}", ObjOC.SucNoExt)
If ObjOC.SucNoInt.Length > 0 Then StrEnvioDi.AppendFormat(", No.Int: {0}", ObjOC.SucNoInt)
params.Add(New ReportParameter("EnvioDireccion", StrEnvioDi.ToString))
params.Add(New ReportParameter("EnvioColonia", If(ObjOC.SucColonia.Length > 0, ObjOC.SucColonia, "")))
params.Add(New ReportParameter("EnvioCiudad", If(ObjOC.SucMunicipio.Length > 0, ObjOC.SucMunicipio, "")))
params.Add(New ReportParameter("EnvioEstado", If(ObjOC.SucEstado.Length > 0, ObjOC.SucEstado, "")))
params.Add(New ReportParameter("EnvioCP", If(ObjOC.SucCP.Length > 0, ObjOC.SucCP, "")))
Else
params.Add(New ReportParameter("EnvioDireccion", ObjOC.LugarEntrega))
params.Add(New ReportParameter("LugarEntrega", ObjOC.LugarEntrega))
End If
params.Add(New ReportParameter("EnvioTel", ObjOC.SucTelefono.ToString))
End If
End If
End If
Dim CveUsuarioSol As Integer = dtOC(0)("CveUsuarioSolicito").ToString.ToEntero Dim CveUsuarioSol As Integer = dtOC(0)("CveUsuarioSolicito").ToString.ToEntero
Dim CveUsuarioAut As Integer = dtOC(0)("CveUsuarioAutorizo").ToString.ToEntero Dim CveUsuarioAut As Integer = dtOC(0)("CveUsuarioAutorizo").ToString.ToEntero
Dim drSol As DataRow = GlobalDTUsuarios(CveUsuarioSol, EmpresaActual.CveEmpresa).FiltroPrimero("") 'DataRow (incluye el NOMBRE de quien SOLICITÓ la OC) Dim drSol As DataRow = GlobalDTUsuarios(CveUsuarioSol, EmpresaActual.CveEmpresa).FiltroPrimero("") 'DataRow (incluye el NOMBRE de quien SOLICITÓ la OC)
@@ -7846,10 +7644,10 @@ Public Class ClsPaginas
If drSol IsNot Nothing AndAlso drSol("CvePersonal").ToString.ToEntero > 0 Then CvePersonalSol = drSol("CvePersonal").ToString.ToEntero If drSol IsNot Nothing AndAlso drSol("CvePersonal").ToString.ToEntero > 0 Then CvePersonalSol = drSol("CvePersonal").ToString.ToEntero
If drAut IsNot Nothing AndAlso drAut("CvePersonal").ToString.ToEntero > 0 Then CvePersonalAut = drAut("CvePersonal").ToString.ToEntero If drAut IsNot Nothing AndAlso drAut("CvePersonal").ToString.ToEntero > 0 Then CvePersonalAut = drAut("CvePersonal").ToString.ToEntero
Dim ObjRH As New ClsRH() Dim ObjRH As New ClsRH()
If ObjRH.GetPersonal(CvePersonalSol, EmpresaActual.CveEmpresa) AndAlso ObjRH.DtResultados.Rows.Count > 0 Then If CvePersonalSol > 0 AndAlso ObjRH.GetPersonal(CvePersonalSol, EmpresaActual.CveEmpresa) AndAlso ObjRH.DtResultados.Rows.Count > 0 Then
PuestoSol = ObjRH.DtResultados(0)("Puesto").ToString PuestoSol = ObjRH.DtResultados(0)("Puesto").ToString
End If End If
If ObjRH.GetPersonal(CvePersonalAut, EmpresaActual.CveEmpresa) AndAlso ObjRH.DtResultados.Rows.Count > 0 Then If CvePersonalAut > 0 AndAlso ObjRH.GetPersonal(CvePersonalAut, EmpresaActual.CveEmpresa) AndAlso ObjRH.DtResultados.Rows.Count > 0 Then
PuestoAut = ObjRH.DtResultados(0)("Puesto").ToString PuestoAut = ObjRH.DtResultados(0)("Puesto").ToString
End If End If
ObjRH.Dispose() ObjRH.Dispose()
@@ -7861,9 +7659,6 @@ Public Class ClsPaginas
End If End If
Dim nombreautorizo As String = dtOC(0)("UsuarioAutorizo").ToString Dim nombreautorizo As String = dtOC(0)("UsuarioAutorizo").ToString
'If EmpresaActual = 48 Then
' nombreautorizo = "Lic. LUIS JORGE CONTRERAS LANDGRAVE"
'End If
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta)) Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos\OC.rdlc", EmpresaActual.Ruta))
If Not Archivo.Exists OrElse EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 13, 72, 80, 83, 122, 126, 158) Then If Not Archivo.Exists OrElse EmpresaActual.CveEmpresa.Contiene(4, 145, 7, 11, 12, 13, 72, 80, 83, 122, 126, 158) Then
params.Add(New ReportParameter("Descuento", DtDetalle.SUM("Descuento").ToString.FormatoNumero(2))) params.Add(New ReportParameter("Descuento", DtDetalle.SUM("Descuento").ToString.FormatoNumero(2)))

View File

@@ -150,6 +150,14 @@ Public Class ClsSisNotificaciones
#End Region #End Region
#Region "N O T I F I C A C I O N E S" #Region "N O T I F I C A C I O N E S"
Public Shared Sub EnviarAlerta(Titulo As String, Mensaje As String, CveUsuario As String, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar, Optional TimeOut As Integer = 0)
Dim hub = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)()
'VERIFICA SI EXISTE LA CONEXION DEL USUARIO
If Notificaciones.UsuariosConexiones.Keys.Any(Function(key) key = CveUsuario) Then
hub.Clients.Client(Notificaciones.UsuariosConexiones(CveUsuario)).alertaVentana(Titulo, Mensaje, DirectCast(Tipo, Integer), TimeOut)
End If
End Sub
Public Sub DispararNotificacion(CveNotificacion As Integer, CvesFiltro As List(Of Object), CveEmpresa As Integer) Public Sub DispararNotificacion(CveNotificacion As Integer, CvesFiltro As List(Of Object), CveEmpresa As Integer)
_CveNotificacion = CveNotificacion _CveNotificacion = CveNotificacion
@@ -1814,7 +1822,7 @@ Public Class ClsSisNotificaciones
'Next 'Next
Dim lista As New List(Of String) Dim lista As New List(Of String)
lista.Add(CveUsuario.ToString()) lista.Add(CveUsuario.ToString())
Notificaciones.AlertaVentana(Mensaje, lista, Titulo, timeoutseconds) 'Notificaciones.AlertaVentana(Mensaje, lista, Titulo, timeoutseconds)
End Sub End Sub
'Public Sub SendNotificacionGPS(context As IHubContext, CveUsuario As Integer, JsonParams As String) 'Public Sub SendNotificacionGPS(context As IHubContext, CveUsuario As Integer, JsonParams As String)
' context.Clients.All.DisparaNotificacionUsuario(CveUsuario,) ' context.Clients.All.DisparaNotificacionUsuario(CveUsuario,)

View File

@@ -209,6 +209,25 @@ Public Class ClsSisProcesos
Return OnError Return OnError
End Function End Function
Public Function GetUsuariosconProceso(CveProceso As Integer, CveEmpresa As Integer) As Boolean
Dim OnError As Boolean = False
DataAdapter("PA_Sis_UsuarioconProcesoGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveProceso", SqlDbType.Int).Value = CveProceso
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
OnError = True
Catch ex As Exception
Me.OnError("Ocurrió un error al obtener los usuarios con el Proceso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return OnError
End Function
' IDisposable ' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean) Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then If Not Me.disposedValue Then

View File

@@ -191,7 +191,7 @@ Public Class ClsSisUsuarios
End Try End Try
Return Retorno Return Retorno
End Function End Function
Public Function ValidaUsuario(Usuario As String, Password As String, Optional CveEmpresa As Integer = -1, Optional GrupoEmpresa As String = "") As Usuario Public Function ValidaUsuario(Usuario As String, Password As String, Optional CveEmpresa As Integer = -1, Optional GrupoEmpresa As String = "", Optional GenerarMenu As Boolean = True) As Usuario
Dim Retorno As Usuario = Nothing Dim Retorno As Usuario = Nothing
DataAdapter("PA_Sis_UsuarioValidacionGet") DataAdapter("PA_Sis_UsuarioValidacionGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -253,7 +253,7 @@ Public Class ClsSisUsuarios
'cargo los modulos del usuario y genero el menú 'cargo los modulos del usuario y genero el menú
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveEmpresa) Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveEmpresa)
GeneraMenu(Retorno.CveUsuario, dttmp, Retorno.CvePlataforma) If GenerarMenu Then GeneraMenu(Retorno.CveUsuario, dttmp, Retorno.CvePlataforma)
Dim UsuariosModulos As New HybridDictionary Dim UsuariosModulos As New HybridDictionary
For Each Row As DataRow In dttmp.Rows For Each Row As DataRow In dttmp.Rows
@@ -481,7 +481,7 @@ Public Class ClsSisUsuarios
Retorno.Portal = True Retorno.Portal = True
Retorno.Referencia = Data.Rows(0)("Referencia").ToString Retorno.Referencia = Data.Rows(0)("Referencia").ToString
Retorno.EsSupervisorRH = If(Data.Rows(0)("EsSupervisorRH").ToString = "1", True, False) Retorno.EsSupervisorRH = If(Data.Rows(0)("EsSupervisorRH").ToString = "1", True, False)
'Retorno.Liga = Data.Rows(0)("Liga").ToString Retorno.RutaDB = ConnStr
'cargo los modulos del usuario y genero el menú 'cargo los modulos del usuario y genero el menú
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveCliente) Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveCliente)
@@ -538,7 +538,7 @@ Public Class ClsSisUsuarios
Retorno.Portal = True Retorno.Portal = True
Retorno.Referencia = Data.Rows(0)("Referencia").ToString Retorno.Referencia = Data.Rows(0)("Referencia").ToString
Retorno.EsSupervisorRH = If(Data.Rows(0)("EsSupervisorRH").ToString = "1", True, False) Retorno.EsSupervisorRH = If(Data.Rows(0)("EsSupervisorRH").ToString = "1", True, False)
'Retorno.Liga = Data.Rows(0)("Liga").ToString Retorno.RutaDB = ConnStr
'cargo los modulos del usuario y genero el menú 'cargo los modulos del usuario y genero el menú
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveProveedor) Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveProveedor)

View File

@@ -751,6 +751,22 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function UpdateVentaAnticipoAutorizado(CveVenta As Integer, Autorizado As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaAnticipoAutorizadoUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@Autorizado", SqlDbType.Bit).Value = Autorizado
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el estatus del anticipo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date) As Boolean Public Function UpdateFechaVencimientoVenta(CveVenta As Integer, FechaVencimiento As Date) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasFechaVencimientoUpdate") DataAdapter("PA_Vta_VentasFechaVencimientoUpdate")
@@ -1961,14 +1977,14 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function GetRepPSEcono(CveSubProyecto As Integer, CvePS As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional GPO As Integer = -1, Public Function GetRepPSEcono(CveSubProyectos As String, CvePS As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional GPO As Integer = -1,
Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0, Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0,
Optional Clasificacion As String = "-1", Optional Linea As String = "-1", Optional Marca As String = "-1", Optional orden As Integer = -1) As Boolean Optional Clasificacion As String = "-1", Optional Linea As String = "-1", Optional Marca As String = "-1", Optional orden As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_RepPSEconoGet") DataAdapter("PA_Vta_RepPSEconoGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyectos", SqlDbType.VarChar).Value = CveSubProyectos
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@FechaF", SqlDbType.Date).Value = FechaF
@@ -6916,6 +6932,83 @@ Public Class ClsVentas
#End Region #End Region
#Region "VENTAS MEDICAS COMISIONES ESPECIALES"
Public Function GetComisionesMedicasEsPeciales(CveMedico As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasEspecialesGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.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 comisiones especiales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function AddComisionesMedicasEspeciales(CveMedico As Integer, CvePS As Integer, TipoComision As Integer, Comision As Decimal, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasEspecialesAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@TipoComision", SqlDbType.Int).Value = TipoComision
.Add("@Comision", SqlDbType.Money).Value = Comision
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
If ex.Message.Contains("2627") Then
Alert("Ya existe una comisión con el médico y producto especificados.", TipoMensaje.MsgAdvertencia)
Else
OnError("Ocurrió un error al agegar la comisión especial", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
End Try
Return Retorno
End Function
Public Function RemoveComisionesMedicasEspeciales(CveMedicoComision As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ComisionesMedicasEspecialesRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveMedicoComision", SqlDbType.Int).Value = CveMedicoComision
.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 comision especial.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
#Region "DEVOLUICON" #Region "DEVOLUICON"
Public Function UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle As Integer, CantidadDevolucion As Decimal) As Boolean Public Function UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle As Integer, CantidadDevolucion As Decimal) As Boolean

View File

@@ -5606,7 +5606,7 @@ Namespace Modelos
End If End If
'LA VALIDACION DE SALDOS CUANDO ES REFACTURACION SE HACE ANTES ASI QUE SI ES REFACTURACION IGNORAMOS ESTA CONDICION, SI ES ANTICIPO VERIFICA QUE NO ESTÉ APLICADO 'LA VALIDACION DE SALDOS CUANDO ES REFACTURACION SE HACE ANTES ASI QUE SI ES REFACTURACION IGNORAMOS ESTA CONDICION, SI ES ANTICIPO VERIFICA QUE NO ESTÉ APLICADO
If Not AplicaRefacturacionConPagos AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Rem") AndAlso ObjFactura.Pagado > 0 AndAlso DTDocumentosRelacionados.Rows.Count > 0 Then If Not AplicaRefacturacionConPagos AndAlso Not AplicaCancelacionConPagos AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Ant", "Rem") AndAlso ObjFactura.Pagado > 0 AndAlso DTDocumentosRelacionados.Rows.Count > 0 Then
Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados." Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados."
Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia
@@ -6446,7 +6446,7 @@ Namespace Modelos
'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO) 'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO)
If Not ErrorCancelar Then If Not ErrorCancelar Then
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen IN (10,4)") DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen IN (10)")
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen IN (1,4)").ToEntero() CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen IN (1,4)").ToEntero()
'SI ES SERVICIO A DOMICILIO DEBE REGRESAR A ESTE TIPO DE ALMACEN 'SI ES SERVICIO A DOMICILIO DEBE REGRESAR A ESTE TIPO DE ALMACEN
If Me.ServicioDomicilio Then If Me.ServicioDomicilio Then
@@ -6456,6 +6456,7 @@ Namespace Modelos
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToEntero() CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToEntero()
If CveAlmacenExA <= 0 Then If CveAlmacenExA <= 0 Then
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 4").ToEntero() CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 4").ToEntero()
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen IN (4)")
End If End If
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero() CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()

View File

@@ -1,4 +1,5 @@
Option Strict Off Option Strict Off
Imports System.Collections.Concurrent
Imports Extensiones Imports Extensiones
Imports Microsoft.AspNet.SignalR Imports Microsoft.AspNet.SignalR
@@ -14,35 +15,54 @@ Public Enum TipoNotificacion As Integer
End Enum End Enum
Public Class Notificaciones Public Class Notificaciones
Inherits Hub Inherits Hub
Public Shared UsuariosConexiones As ConcurrentDictionary(Of String, String) = New ConcurrentDictionary(Of String, String)
Public Overrides Function OnConnected() As System.Threading.Tasks.Task Public Overrides Function OnConnected() As System.Threading.Tasks.Task
NotificarConexion()
Return MyBase.OnConnected() Return MyBase.OnConnected()
End Function End Function
Public Overrides Function OnReconnected() As System.Threading.Tasks.Task Public Overrides Function OnReconnected() As System.Threading.Tasks.Task
NotificarConexion()
Return MyBase.OnReconnected() Return MyBase.OnReconnected()
End Function End Function
Public Overrides Function OnDisconnected(stopCalled As Boolean) As Threading.Tasks.Task Public Overrides Function OnDisconnected(stopCalled As Boolean) As Threading.Tasks.Task
Return MyBase.OnDisconnected(stopCalled) Return MyBase.OnDisconnected(stopCalled)
End Function End Function
Public Sub NotificarConexion()
If Context.User.Identity.IsAuthenticated Then
Dim ConnectionId As String = Context.ConnectionId
Dim CveUsuario As String = Context.User.Identity.Name
If UsuariosConexiones.ContainsKey(CveUsuario) Then
If UsuariosConexiones(CveUsuario) <> Context.ConnectionId Then
UsuariosConexiones.TryUpdate(CveUsuario, Context.ConnectionId, UsuariosConexiones(CveUsuario))
End If
Else
If CveUsuario.ToEntero > 0 Then
UsuariosConexiones.TryAdd(CveUsuario, ConnectionId)
End If
End If
End If
End Sub
Public Sub TestMessage(message As String)
Clients.All.testMessage(message)
End Sub
Public Shared Sub AlertaVentana(Message As String, Para As String, Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar) Public Sub AlertaVentana(Message As String, Para As String, Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar)
Dim lPara As New List(Of String) Dim lPara As New List(Of String)
lPara.Add(Para) lPara.Add(Para)
AlertaVentana(Message, lPara, Titulo, timeoutseconds, Tipo) AlertaVentana(Message, lPara, Titulo, timeoutseconds, Tipo)
End Sub End Sub
Public Shared Sub AlertaVentana(Message As String, Para As List(Of String), Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar) Public Sub AlertaVentana(Message As String, Para As List(Of String), Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar)
If (Para IsNot Nothing) AndAlso Para.Count > 0 Then If (Para IsNot Nothing) AndAlso Para.Count > 0 Then
Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients
Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds) Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds)
End If End If
End Sub End Sub
'Public Shared Sub AlertaVentana(Message As String, Para As List(Of String), Optional Titulo As String = "", Optional timeoutseconds As Integer = 5, Optional Tipo As TipoNotificacion = TipoNotificacion.AlertaVentanaNoOcultar)
' Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients
' Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds)
'End Sub
End Class End Class
Public Class MyhubUserIdProvider Public Class MyhubUserIdProvider
Implements IUserIdProvider Implements IUserIdProvider

View File

@@ -19,6 +19,7 @@ Public Class E119 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe
Private ReadOnly Property CveEmpresa As Integer = 119 Private ReadOnly Property CveEmpresa As Integer = 119
Private ReadOnly Property CveUsuario As Integer = 100 Private ReadOnly Property CveUsuario As Integer = 100
Private ReadOnly Property NombreCadena As String = "Conexion"
Public ReadOnly Property EsProduccion As Boolean Public ReadOnly Property EsProduccion As Boolean
Get Get
@@ -52,12 +53,12 @@ Public Class E119 : Implements IHttpHandler, System.Web.SessionState.IRequiresSe
#Region "V A L I D A - D A T O S" #Region "V A L I D A - D A T O S"
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
Dim UsuarioActual As Usuario = Nothing Dim UsuarioActual As Usuario = Nothing
Dim ObjUsuarios As New ClsSisUsuarios Dim ObjUsuarios As New ClsSisUsuarios(NombreCadena:=NombreCadena)
If ObjUsuarios.GetUsuarios(CveUsuario) Then If ObjUsuarios.GetUsuarios(CveUsuario) Then
If ObjUsuarios.DtResultados.Rows.Count > 0 Then If ObjUsuarios.DtResultados.Rows.Count > 0 Then
Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString() Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString()
Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString() Dim Contrasenia As String = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString()
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa) UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa:=CveEmpresa, GenerarMenu:=False)
UsuarioActual.CveEmpresa = CveEmpresa UsuarioActual.CveEmpresa = CveEmpresa
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
CreaObjetoEmpresa(UsuarioActual) CreaObjetoEmpresa(UsuarioActual)

View File

@@ -930,19 +930,23 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim CveAlmacen = IfNull(context.Request("cvealmacen"), "-1").ToString.ToEntero Dim CveAlmacen = IfNull(context.Request("cvealmacen"), "-1").ToString.ToEntero
Dim UsaGlobal As Boolean = True Dim UsaGlobal As Boolean = True
Dim MostrarTodosAlmacenes As Boolean = False Dim MostrarTodosAlmacenes As Boolean = True
'verifica existencias 'verifica existencias
If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso usuario.Empresa.Funcionalidad(141) = "1" Then If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso usuario.Empresa.Funcionalidad(141) = "1" Then
UsaGlobal = False UsaGlobal = False
If usuario.CveEmpresa = 119 Then MostrarTodosAlmacenes = False
'If (usuario.Empresa.Funcionalidad(558) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then
' MostrarTodosAlmacenes = True
'End If
If (usuario.Empresa.Funcionalidad(558) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then 'If (usuario.Empresa.Funcionalidad(578) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then 'sms
MostrarTodosAlmacenes = True ' MostrarTodosAlmacenes = True
End If 'End If
If (usuario.Empresa.Funcionalidad(578) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then 'sms 'If (usuario.Empresa.CveEmpresa.Contiene(189, 193, 195, 197)) AndAlso Pagina.Contiene("ventas/ventas") Then 'sms
MostrarTodosAlmacenes = True ' MostrarTodosAlmacenes = True
End If 'End If
Dim objInv As New ClsInventarios Dim objInv As New ClsInventarios
Try Try

View File

@@ -37,6 +37,9 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<li>
<asp:HyperLink ID="HplImprimirPDF" runat="server" Target="_blank" Visible="true" ><i class="fa fa-file-pdf-o" style="color:#686868;"></i> Imprimir Poliza</asp:HyperLink>
</li>
<%-- <li> <%-- <li>
<asp:LinkButton ID="LnkImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton> <asp:LinkButton ID="LnkImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>--%> </li>--%>
@@ -151,10 +154,14 @@
</div> </div>
<div class="col-md-2" runat="server"> <div class="col-md-2" runat="server">
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlCuentaDeposito" runat="server" ControlToValidate="DdlCuentaDeposito" InitialValue="-1" CssClass="help-block errorimput" Display="None"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida">
</asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRfvDdlCuentaDeposito" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlCuentaDeposito" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
<label style="width: 70px;">Fecha:</label> <label style="width: 50px;">Fecha:</label>
</div> </div>
<div class="col-md-2" runat="server" style="text-align: left;"> <div class="col-md-2" runat="server" style="text-align: left;">
@@ -172,16 +179,22 @@
</div> </div>
</div> </div>
<div class="col-md-1" runat="server" id="divTipoPago1"> <div class="col-md-1" runat="server" id="divTipoPago1">
<label style="width: 70px;">Forma:</label> <label style="width: 100px;">Forma de Pago:</label>
</div> </div>
<div class="col-md-1" runat="server" id="divTipoPago" > <div class="col-md-1" runat="server" id="divTipoPago" >
<asp:DropDownList ID="DdlTipoDeposito" runat="server" Width="75px" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" AutoPostBack="true" DataValueField="CveCuenta" OnSelectedIndexChanged="DdlTipoPago_SelectedIndexChanged" Class="table-group-action-input form-control input-inline input-small input-sm select2me"> <asp:DropDownList ID="DdlTipoDeposito" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" AutoPostBack="true" DataValueField="CveCuenta" OnSelectedIndexChanged="DdlTipoPago_SelectedIndexChanged" Class="table-group-action-input form-control input-inline input-small input-sm select2me" >
<asp:ListItem Value="13" Text="Efectivo" Selected="True"></asp:ListItem> <asp:ListItem Value="-1" Text="Seleccione" Selected="True"></asp:ListItem>
<asp:ListItem Value="13" Text="Efectivo"></asp:ListItem>
<asp:ListItem Value="3" Text="Cheque"></asp:ListItem> <asp:ListItem Value="3" Text="Cheque"></asp:ListItem>
<asp:ListItem Value="11" Text="Tarjeta de Débito"></asp:ListItem> <asp:ListItem Value="11" Text="Tarjeta de Débito"></asp:ListItem>
<asp:ListItem Value="12" Text="Tarjeta de Crédito"></asp:ListItem> <asp:ListItem Value="12" Text="Tarjeta de Crédito"></asp:ListItem>
<asp:ListItem Value="8" Text="Transferencia"></asp:ListItem> <asp:ListItem Value="8" Text="Transferencia"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlTipoDeposito" runat="server" ControlToValidate="DdlTipoDeposito" InitialValue="-1" CssClass="help-block errorimput" Display="None"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Forma de Pgo''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida">
</asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRfvDdlTipoDeposito" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlTipoDeposito" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<div class="col-md-1" runat="server" id="divFolio" visible="false"> <div class="col-md-1" runat="server" id="divFolio" visible="false">
<div class="row"> <div class="row">

View File

@@ -38,6 +38,9 @@ Partial Class Bancos_DepositosCaja
BtnConsultar.Attributes.Add("onclick", "Consultar(this);") BtnConsultar.Attributes.Add("onclick", "Consultar(this);")
BtnDepositar.Attributes.Add("onclick", "Depositar(this);") BtnDepositar.Attributes.Add("onclick", "Depositar(this);")
Dim StrEncriptPrueba As String = Encripta($"OP=DC&CveIE={2784391}&CuentaCaja={"TestCuantaCaja"}&CuentaDepo={"Test cuenta"}")
HplImprimirPDF.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={StrEncriptPrueba}"
End If End If
End Sub End Sub
@@ -286,8 +289,13 @@ Partial Class Bancos_DepositosCaja
End If End If
End If End If
Dim CveTransaccionBanco As Integer = DdlTipoDeposito.SelectedValue.ToEntero Dim CveTransaccionBanco As Integer = DdlTipoDeposito.SelectedValue.ToEntero
If CveTransaccionBanco = -1 Then
CveTransaccionBanco = 13
End If
If TotalImporte < 0 Then 'que es una devolución, entonces como es negativo, se cambia el concetpo de bancos, por condición de trigger If TotalImporte < 0 Then 'que es una devolución, entonces como es negativo, se cambia el concetpo de bancos, por condición de trigger
CveTransaccionBanco = 6 CveTransaccionBanco = 6
End If End If
@@ -350,9 +358,9 @@ Partial Class Bancos_DepositosCaja
If Not OcurrioError AndAlso ChkCuentaRetorno.Checked Then If Not OcurrioError AndAlso ChkCuentaRetorno.Checked Then
CveTransaccionBanco = 13 CveTransaccionBanco = 13
FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco) FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco)
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Retorno Depósito Bancario", CuentaRetorno, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim CveIEOrigenRetorno As Integer = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Retorno Depósito Bancario", CuentaRetorno, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, CuentaRetorno, CuentaRetorno * TipoCambio, 30, "", "Retorno", CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigen) Then If Not ObjConta.AddPrePolizasDetalle(NuevaCvePrePoliza, False, CuentaRetorno, CuentaRetorno * TipoCambio, 30, "", "Retorno", CveClasificacion:=CveClasificacionDescuento, CveSubProyecto:=CveSubProyecto, CveIE:=CveIEOrigenRetorno) Then
OcurrioError = True OcurrioError = True
End If End If
End If End If
@@ -403,6 +411,8 @@ Partial Class Bancos_DepositosCaja
documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/> ", StrEncript, "Depósito Bancario") documentos += String.Format("<a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir {1}</a> <br/> ", StrEncript, "Depósito Bancario")
End If End If
If Not OcurrioError AndAlso ObjConta.ValidacionesPrePoliza(NuevaCvePrePoliza, UsuarioActual, Opcion:=1) Then If Not OcurrioError AndAlso ObjConta.ValidacionesPrePoliza(NuevaCvePrePoliza, UsuarioActual, Opcion:=1) Then

View File

@@ -27,7 +27,7 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<li> <li>
<asp:HyperLink ID="HpLPrePoliza" NavigateUrl="#" runat="server" Visible="false" Style="color: #686868;"><i class="" style="color:#686868;"></i> PrePoliza</asp:HyperLink> <asp:HyperLink ID="HpLPrePoliza" NavigateUrl="#" runat="server" Visible="false" Style="color: #686868;"><i class="" style="color:#686868;"></i> Póliza</asp:HyperLink>
</li> </li>
<asp:UpdatePanel ID="UppEliminarIE" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UppEliminarIE" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>

View File

@@ -747,9 +747,7 @@ Partial Class Bancos_IE
RBL.Items.Add(New ListItem("Acreedores Diversos", "AC")) RBL.Items.Add(New ListItem("Acreedores Diversos", "AC"))
End If End If
If TabCancelacion.Visible Or TxtFolio.Text.Contains("_C") Then
If TabCancelacion.Visible Then
LnkCancelar.Visible = False LnkCancelar.Visible = False
End If End If
@@ -775,11 +773,7 @@ Partial Class Bancos_IE
' LnkCancelarComplemento.Visible = False ' LnkCancelarComplemento.Visible = False
' LnkCancelarComplementoImporte.Visible = False ' LnkCancelarComplementoImporte.Visible = False
' UppEliminarIE.Update() ' UppEliminarIE.Update()
'End If 'End If
DdlMotivoCancelacion.DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltraParametros("CveSATMotivoCancelacion IN (2,3)") DdlMotivoCancelacion.DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltraParametros("CveSATMotivoCancelacion IN (2,3)")

View File

@@ -67,7 +67,7 @@
</div> </div>
<div class="col-md-5" runat="server" id="DivTC" visible="false"> <div class="col-md-5" runat="server" id="DivTC" visible="false">
T.C.: T.C.:
<asp:TextBox ID="TxtTC" runat="server" Text="1" placeholder="Tipo de Cambio" CssClass="form-control input-sm" MaxLength="12" onblur="CambiaPesosDolares();" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" /> <asp:TextBox ID="TxtTC" runat="server" Text="1" placeholder="Tipo de Cambio" CssClass="form-control input-sm" MaxLength="12" onblur="CambiaDolaresPesos();" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" />
<asp:RequiredFieldValidator ID="RFVTC" Enabled="false" runat="server" ControlToValidate="TxtTC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Cambio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVTC" Enabled="false" runat="server" ControlToValidate="TxtTC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Cambio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETC" runat="server" HighlightCssClass="vco" TargetControlID="RFVTC" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCETC" runat="server" HighlightCssClass="vco" TargetControlID="RFVTC" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:Label ID="LbImporteME" Text="" ClientIDMode="Static" runat="server" /> <asp:Label ID="LbImporteME" Text="" ClientIDMode="Static" runat="server" />

View File

@@ -327,9 +327,21 @@ Partial Class Bancos_ProveedoresAbonar
Private Sub CambiaTipoMoneda() Private Sub CambiaTipoMoneda()
If DivTC.Visible Then If DivTC.Visible Then
TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4)
If ChkPagarDolares.Checked Then RegistraScript("CambiaPesosDolares();")
If ChkPagarPesos.Checked Then RegistraScript("CambiaDolaresPesos();") If ChkPagarDolares.Checked Then
'RegistraScript("CambiaPesosDolares();")
RegistraScript("CambiaDolaresPesos();")
End If
If ChkPagarPesos.Checked Then
'RegistraScript("CambiaDolaresPesos();")
RegistraScript("CambiaPesosDolares();")
End If
End If End If
UpDatos.Update() UpDatos.Update()
End Sub End Sub
@@ -1343,6 +1355,7 @@ Partial Class Bancos_ProveedoresAbonar
CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero)
TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);") TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);")
TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4)
TxtTC.Attributes.Add("onblur", "CambiaPesosDolares()")
Else Else
DivTC.Visible = False DivTC.Visible = False
CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero)
@@ -1362,6 +1375,7 @@ Partial Class Bancos_ProveedoresAbonar
CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero)
TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);") TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);")
TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4) TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4)
TxtTC.Attributes.Add("onblur", "CambiaDolaresPesos()")
Else Else
'DivDolaresDolares.Visible = False 'DivDolaresDolares.Visible = False
CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero) CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero)

View File

@@ -364,7 +364,7 @@
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<br /> <br />
<b>Detalles del pago</b> <b>Detalles de pago</b>
<asp:GridView ID="GvP" runat="server" AutoGenerateColumns="False" GridLines="None" CssClass="table table-striped table-advance table-hover" Width="100%"> <asp:GridView ID="GvP" runat="server" AutoGenerateColumns="False" GridLines="None" CssClass="table table-striped table-advance table-hover" Width="100%">
<Columns> <Columns>
<asp:BoundField HeaderText="Método Pago" DataField="MetodoPago" /> <asp:BoundField HeaderText="Método Pago" DataField="MetodoPago" />
@@ -385,7 +385,7 @@
</div> </div>
<div class="col-md-3" id="DivDep" runat="server" visible="false" style="max-height: 440px; overflow: auto"> <div class="col-md-3" id="DivDep" runat="server" visible="false" style="max-height: 440px; overflow: auto">
<br /> <br />
<b>Depósitos Caja</b> <b>Depósitos de caja</b>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvDep" runat="server" AutoGenerateColumns="False" GridLines="None" CssClass="table table-striped table-advance table-hover mysmallbtn "> <asp:GridView ID="GvDep" runat="server" AutoGenerateColumns="False" GridLines="None" CssClass="table table-striped table-advance table-hover mysmallbtn ">
@@ -406,7 +406,7 @@
</div> </div>
<div class="col-md-4" id="DivAnexo" runat="server" visible="false"> <div class="col-md-4" id="DivAnexo" runat="server" visible="false">
<br /> <br />
<b>Contabilidad</b> <b>Estado contable de la caja</b>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvAnexo" runat="server" AutoGenerateColumns="False" GridLines="None" CssClass="table table-striped table-advance table-hover" Width="100%"> <asp:GridView ID="GvAnexo" runat="server" AutoGenerateColumns="False" GridLines="None" CssClass="table table-striped table-advance table-hover" Width="100%">

View File

@@ -55,11 +55,10 @@
<asp:GridView ID="GvS" runat="server" AutoGenerateColumns="False" ShowFooter="True" EmptyDataText="No se encontraron Cuentas X Pagar Pendientes" CssClass="table table-striped table-hover Widthall" GridLines="None"> <asp:GridView ID="GvS" runat="server" AutoGenerateColumns="False" ShowFooter="True" EmptyDataText="No se encontraron Cuentas X Pagar Pendientes" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns> <Columns>
<asp:BoundField ItemStyle-Width="5%" ItemStyle-CssClass="Texto" DataField="NumCuenta" HeaderText="Cuenta" Visible="false"></asp:BoundField> <asp:BoundField ItemStyle-Width="5%" ItemStyle-CssClass="Texto" DataField="NumCuenta" HeaderText="Cuenta" Visible="false"></asp:BoundField>
<asp:HyperLinkField ItemStyle-Width="5%" ItemStyle-CssClass="Texto" DataTextField="TipoTransaccionAbrev" HeaderText="Tipo" DataNavigateUrlFormatString="IE.aspx?CveIE={0}" DataNavigateUrlFields="CveIE"></asp:HyperLinkField>
<asp:HyperLinkField ItemStyle-Width="5%" ItemStyle-CssClass="Texto" DataTextField="Folio" HeaderText="Folio" DataNavigateUrlFormatString="IE.aspx?CveIE={0}" DataNavigateUrlFields="CveIE"></asp:HyperLinkField> <asp:HyperLinkField ItemStyle-Width="5%" ItemStyle-CssClass="Texto" DataTextField="Folio" HeaderText="Folio" DataNavigateUrlFormatString="IE.aspx?CveIE={0}" DataNavigateUrlFields="CveIE"></asp:HyperLinkField>
<asp:BoundField ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" DataField="FechaDocumento" DataFormatString="{0:d}" HeaderText="Fecha"></asp:BoundField> <asp:BoundField ItemStyle-Width="15%" ItemStyle-CssClass="Texto" DataField="TipoTransaccion" HeaderText="Tipo" ></asp:BoundField>
<asp:BoundField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" DataField="FechaDocumento" DataFormatString="{0:d}" HeaderText="Fecha"></asp:BoundField>
<asp:BoundField ItemStyle-Width="15%" DataField="PagueseA" HeaderText="Beneficiario/Pagador" ItemStyle-HorizontalAlign="Left"></asp:BoundField> <asp:BoundField ItemStyle-Width="15%" DataField="PagueseA" HeaderText="Beneficiario/Pagador" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
<asp:BoundField ItemStyle-Width="15%" DataField="Observaciones" HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left"></asp:BoundField> <asp:BoundField ItemStyle-Width="15%" DataField="Observaciones" HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
<asp:BoundField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" DataField="EstatusIE" HeaderText="Estatus"></asp:BoundField> <asp:BoundField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" DataField="EstatusIE" HeaderText="Estatus"></asp:BoundField>

View File

@@ -5949,11 +5949,13 @@
txt.value = toFixed(ToDouble(DifSaldo * TCC), 2); txt.value = toFixed(ToDouble(DifSaldo * TCC), 2);
} }
let difFinal = (DifSaldo - importevalue) * TCC;
if (txtComision !== undefined && txtComision !== null) {
let difFinal = (DifSaldo - importevalue) * TCC;
if (difFinal > 0 && difFinal < 1) { if (difFinal > 0 && difFinal < 1) {
txtComision.value = toFixed(roundToTwo(difFinal), 2); txtComision.value = toFixed(roundToTwo(difFinal), 2);
} }
}
} else { } else {

View File

@@ -1790,7 +1790,7 @@ Partial Class Compras_Compras
Private Function CargaFactura(CveFactura As Integer) As String Private Function CargaFactura(CveFactura As Integer) As String
Dim ObjeFacturas As New ClsCompras Dim ObjeFacturas As New ClsCompras
Dim RFC As String = "" Dim RFC As String = ""
If ObjeFacturas.GetFacturas(CveFactura, "-1", NowADS().AddYears(-4), NowADS(), "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) AndAlso ObjeFacturas.DtResultados.Rows.Count > 0 Then If ObjeFacturas.GetFacturas(CveFactura, "-1", NowADS().AddYears(-6), NowADS(), "-1", "-1", -1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa) AndAlso ObjeFacturas.DtResultados.Rows.Count > 0 Then
Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador
ViewState("CveTipoProveedor") = dr("CveTipoProveedor").ToString.ToEntero ViewState("CveTipoProveedor") = dr("CveTipoProveedor").ToString.ToEntero
@@ -3549,10 +3549,21 @@ Partial Class Compras_Compras
ViewState("CveProveedor") = ObjProveedor.CveProveedor ViewState("CveProveedor") = ObjProveedor.CveProveedor
HdnCveProveedor.Value = ObjProveedor.CveProveedor.ToString HdnCveProveedor.Value = ObjProveedor.CveProveedor.ToString
TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString TxtFechaPago.Text = (TxtFecha.Text.ToDate.AddDays(LblDiasCredito.Text.ToEntero)).ToShortDateString
RFCProveedor = ObjProveedor.RFC 'comentado RMF.2024.05.21. en anticipos parciales, está bloquenado
'If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
CveRegimenFiscalProveedor = ObjProveedor.CveRegimenFiscal ' Dim ImporteAnticipoComision As Decimal = 0
If CveFactura > 0 Then ' If ArrAnticipos.Count > 0 Then
' For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
' ImporteAnticipoComision += Ant.ImporteComision
' Next
' End If
' If (LblSaldoFactura.Text.ToDecimal - ImporteAnticipoComision) > 0 Then
' Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
'End If
If RetIVAOriginal > 0 Then If RetIVAOriginal > 0 Then
Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal
@@ -3583,9 +3594,14 @@ Partial Class Compras_Compras
End If End If
End If End If
<<<<<<< HEAD
CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion) CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion) CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
CargaRetIVAConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
CargaRetISRConcepto(True, ObjProveedor.DIOTCveTipoOperacion)
>>>>>>> GDiaz 2024.05.21
LbAgregar.Enabled = True LbAgregar.Enabled = True
UpPSS.Update() UpPSS.Update()
UpPS.Update() UpPS.Update()
@@ -3631,13 +3647,21 @@ Partial Class Compras_Compras
PorcentajeProntoPago = ObjProveedor.PorcentajeProntoPago PorcentajeProntoPago = ObjProveedor.PorcentajeProntoPago
End If End If
<<<<<<< HEAD
=======
>>>>>>> GDiaz 2024.05.21
Else Else
Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia) Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia)
End If End If
Else
Alert("Ocurrió un error al consultar el proveedor.", TipoMensaje.MsgError)
End If
<<<<<<< HEAD
=======
>>>>>>> GDiaz 2024.05.21
If UsuarioActual.Empresa.Funcionalidad(560) = "1" Then If UsuarioActual.Empresa.Funcionalidad(560) = "1" Then
If ObjProveedor.GetProveedoresEvaluacionPediente(Me.CveProveedor, UsuarioActual.CveEmpresa) Then If ObjProveedor.GetProveedoresEvaluacionPediente(Me.CveProveedor, UsuarioActual.CveEmpresa) Then
If ObjProveedor.DtResultados.Rows.Count > 0 Then If ObjProveedor.DtResultados.Rows.Count > 0 Then
@@ -4193,26 +4217,11 @@ Partial Class Compras_Compras
'------------------ INICIA VALIDACIONES ------------------ '------------------ INICIA VALIDACIONES ------------------
If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 AndAlso LblSaldoFactura.Text.ToDecimal > 0 Then
If MetodoPagoOC = 0 AndAlso RBLPago.SelectedValue.ToEntero <> 2 Then
Dim ImporteAnticipoComision As Decimal = 0
If ArrAnticipos.Count > 0 Then
For Each Ant As Compras_Compras.Anticipos In ArrAnticipos
ImporteAnticipoComision += Ant.ImporteComision
Next
End If
If (LblSaldoFactura.Text.ToDecimal - ImporteAnticipoComision) > 0 Then
Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia) Alert("La orden de compra se definió de contado, favor de especificar la compra de contado.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
End If
Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal() Dim CveSubProyectoPrincipal As Integer = AsignarSubProyectoPrincipal()
If Not CveSubProyectoPrincipal > 0 Then If Not CveSubProyectoPrincipal > 0 Then
@@ -9780,6 +9789,12 @@ Partial Class Compras_Compras
Dim tTCFecha As Double = If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble) Dim tTCFecha As Double = If(Not e.Row.DBCampo("TCCompra").ToDouble > 1, GlobalTipoCambio(e.Row.DBCampo("Fecha").ToDate), e.Row.DBCampo("TCCompra").ToDouble)
If UsuarioActual.Empresa.CveEmpresa.Contiene(13, 83) Then
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6},{7});", e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6},{7});",
e.Row.FCTextBox("TxtAnticipo").ClientID, e.Row.FCTextBox("TxtAnticipo").ClientID,
e.Row.DBCampo("Saldo"), e.Row.DBCampo("Saldo"),
@@ -9793,8 +9808,6 @@ Partial Class Compras_Compras
If UsuarioActual.Empresa.CveEmpresa.Contiene(13, 83) Then
e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5},{6});", e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5},{6});",
e.Row.FCCheckBox("Chk").ClientID, e.Row.FCCheckBox("Chk").ClientID,
e.Row.DBCampo("Saldo"), e.Row.DBCampo("Saldo"),
@@ -9813,6 +9826,17 @@ Partial Class Compras_Compras
DdlMoneda.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero,
e.Row.FCTextBox("TxtAnticipo").ClientID)) e.Row.FCTextBox("TxtAnticipo").ClientID))
Else Else
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("chkAnt(this,{0},{1},{2},{3},{4},{5},{6});",
e.Row.FCTextBox("TxtAnticipo").ClientID,
e.Row.DBCampo("Saldo"),
If(CveCompra > 0, CompraSaldo, ImporteAmortizacion),
e.Row.DBCampo("CveMoneda"),
e.Row.DBCampo("TCCompra").ToDouble,
DdlMoneda.SelectedValue,
IIf(DdlMoneda.SelectedValue = "1", 1, TxtTC.Text)
)) 'SI ES UNA COMPRA NUEVA SE PONE EL TOTAL, SI NO EL SALDO
e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5});", e.Row.FCTextBox("TxtAnticipo").Attributes.Add("onKeyUp", String.Format("FnCambiaAnt({0},this,{1},{2},{3},{4},{5});",
e.Row.FCCheckBox("Chk").ClientID, e.Row.FCCheckBox("Chk").ClientID,
e.Row.DBCampo("Saldo"), e.Row.DBCampo("Saldo"),
@@ -13118,11 +13142,15 @@ Partial Class Compras_Compras
Dim objcompras As New ClsCompras() Dim objcompras As New ClsCompras()
If objcompras.GetCompraParaDevolucion(CveProveedor, UsuarioActual.CveEmpresa, SubTotal) Then If objcompras.GetCompraParaDevolucion(CveProveedor, UsuarioActual.CveEmpresa, SubTotal) Then
DDLDevolucion.Items.Clear() DDLDevolucion.Items.Clear()
DDLDevolucion.DataSource = objcompras.DtResultados Dim dtt As DataTable = objcompras.DtResultados
DDLDevolucion.DataBind() If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then 'solo los últimos 3 meses
dtt = dtt.FiltraParametros($"Fecha >= #{NowADS.AddMonths(-3).ToString("yyyy/MM/dd")}#")
End If
DDLDevolucion.DataSource = dtt
DDLDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1")) DDLDevolucion.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If End If
objcompras.Dispose() objcompras.Dispose()
DDLDevolucion.DataBind()
UPDevolucion.Update() UPDevolucion.Update()
End Sub End Sub
@@ -13135,9 +13163,9 @@ Partial Class Compras_Compras
Dim objcompras As New ClsCompras() Dim objcompras As New ClsCompras()
If objcompras.GetCompraDetalleAlmacen(UsuarioActual.CveEmpresa, DDLDevolucion.SelectedValue.ToEntero) Then If objcompras.GetCompraDetalleAlmacen(UsuarioActual.CveEmpresa, DDLDevolucion.SelectedValue.ToEntero) Then
GVDevolucion.DataSource = objcompras.DtResultados GVDevolucion.DataSource = objcompras.DtResultados
GVDevolucion.DataBind()
End If End If
objcompras.Dispose() objcompras.Dispose()
GVDevolucion.DataBind()
Dim CveAlmacen As Integer = -1 Dim CveAlmacen As Integer = -1
For Each GvRow As GridViewRow In GVDevolucion.Rows For Each GvRow As GridViewRow In GVDevolucion.Rows
If GvRow.RowType = DataControlRowType.DataRow Then If GvRow.RowType = DataControlRowType.DataRow Then
@@ -20700,8 +20728,6 @@ Partial Class Compras_Compras
Return True Return True
End If End If
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
Dim ObjCon As New ClsContratos Dim ObjCon As New ClsContratos
@@ -20709,7 +20735,7 @@ Partial Class Compras_Compras
Dim Autorizado As Double = 0 Dim Autorizado As Double = 0
Dim Ejercido As Double = 0 Dim Ejercido As Double = 0
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, 1) Then If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, TxtFecha.Text.ToDate.FirstDayOfMonth, TxtFecha.Text.ToDate.LastDayOfMonth, 1) Then
Dim FechaCompra As Date = TxtFecha.Text.ToDate Dim FechaCompra As Date = TxtFecha.Text.ToDate
@@ -20718,27 +20744,8 @@ Partial Class Compras_Compras
FechaCompra <= row.Field(Of Date)("FechaFin") FechaCompra <= row.Field(Of Date)("FechaFin")
Select row Select row
'Dim dataTable As New DataTable
'Dim rowFilter As String = ""
'Dim orderby As String = ""
'Dim groupByColumns As String()() = {New String() {"SubProyecto", "CveSubProyecto", "Clasificacion", "CveClasificacion", "TipoGasto", "CveTipoGasto"}}
'Dim sumColumns As String() = {"Total"}
'Dim resultDataTable As DataTable = GroupByDT(TmpDT, rowFilter, orderby, groupByColumns, sumColumns)
If resultadosFiltrados.Count > 0 Then If resultadosFiltrados.Count > 0 Then
''.TotalSum = Group.Sum(Function(r) r.Field(Of Decimal)("Total")) ''.TotalSum = Group.Sum(Function(r) r.Field(Of Decimal)("Total"))
If Opcion = 1 Then If Opcion = 1 Then
@@ -20771,29 +20778,8 @@ Partial Class Compras_Compras
Else Else
respuesta = True respuesta = True
End If End If
Else Else
'Dim EnumAgrupado = (From row In TmpDT.AsEnumerable()
' Group row By
' SubProyecto = row.Field(Of String)("SubProyecto"),
' CveSubProyecto = row.Field(Of Integer)("CveSubProyecto"),
' Clasificacion = row.Field(Of String)("Clasificacion"),
' CveClasificacion = row.Field(Of Integer)("CveClasificacion"),
' TipoGasto = row.Field(Of String)("TipoGasto"),
' CveTipoGasto = row.Field(Of Integer)("CveTipoGasto")
' Into Group
' Select New With {
' .SubProyecto = SubProyecto,
' .CveSubProyecto = CveSubProyecto,
' .Clasificacion = Clasificacion,
' .CveClasificacion = CveClasificacion,
' .CveTipoGasto = CveTipoGasto,
' .TipoGasto = TipoGasto,
' .TotalSum = Group.Sum(Function(r) If(IsDBNull(r("Total")), 0D, Convert.ToDecimal(r("Total"))))
' }).ToList()
Dim EnumAgrupado = ( Dim EnumAgrupado = (
From row In TmpDT.AsEnumerable() From row In TmpDT.AsEnumerable()
Group row By Group row By
@@ -20815,22 +20801,15 @@ Partial Class Compras_Compras
} }
).ToList() ).ToList()
For Each item In EnumAgrupado For Each item In EnumAgrupado
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto) Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto)
If tieneRegistrosConCveSubProyecto Then If tieneRegistrosConCveSubProyecto Then
'Dim saldoTotal As Decimal = (From row In resultadosFiltrados
' Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
' row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
' Select row.Field(Of Decimal)("Saldo")).Sum()
Dim saldoTotal As Decimal = (From row In resultadosFiltrados.AsEnumerable() Dim saldoTotal As Decimal = (From row In resultadosFiltrados.AsEnumerable()
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
If(row.IsNull("CveClasificacion"), If(row.IsNull("CveClasificacion"), 0,
0,
row.Field(Of Integer?)("CveClasificacion").GetValueOrDefault()) = item.CveClasificacion row.Field(Of Integer?)("CveClasificacion").GetValueOrDefault()) = item.CveClasificacion
Select row.Field(Of Decimal)("Saldo")).Sum() Select row.Field(Of Decimal)("Saldo")).Sum()
@@ -20857,29 +20836,18 @@ Partial Class Compras_Compras
Next Next
End If End If
Else Else
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia) 'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
respuesta = True respuesta = True
End If End If
Else Else
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia) 'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
respuesta = False respuesta = False
End If End If
ObjCon.Dispose() ObjCon.Dispose()
Else Else
respuesta = True respuesta = True
End If End If
Return respuesta Return respuesta
End Function End Function

View File

@@ -1610,7 +1610,9 @@ Partial Class PopUpVerFactura
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
DtMetodosPago = DtCortesVentasResumen.FiltraParametros("MetodoPago <> 'Crédito'") DtMetodosPago = DtCortesVentasResumen.FiltraParametros("MetodoPago <> 'Crédito'")
End If End If
Dim DirFormato As String = "Empresas/Grales/Formatos/RepCortes.rdlc" Dim DirFormato As String = "Empresas/Grales/Formatos/RepCortes.rdlc"
If File.Exists(UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc") Then If File.Exists(UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc") Then
DirFormato = UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc" DirFormato = UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc"
End If End If
@@ -3378,7 +3380,7 @@ Partial Class PopUpVerFactura
If UsuarioActual.CveEmpresa.Contiene(172, 173) Then If UsuarioActual.CveEmpresa.Contiene(172, 173) Then
ImprimirPDFStimul("Empresas/Grales/Formatos/EntradaSalida.mrt", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString)) ImprimirPDFStimul("Empresas/Grales/Formatos/EntradaSalida.mrt", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString))
Else Else
ImprimirPDF("Empresas/Grales/Formatos/EntradaSalida.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios") ImprimirPDF("Empresas/Grales/Formatos/Salida.rdlc", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
End If End If
End If End If
@@ -5380,6 +5382,15 @@ Partial Class PopUpVerFactura
If ObjIE.GetBancosIEMovimientosDepositos(CveIE, UsuarioActual.CveEmpresa) Then If ObjIE.GetBancosIEMovimientosDepositos(CveIE, UsuarioActual.CveEmpresa) Then
Tabla = ObjIE.DtResultados.Copy() Tabla = ObjIE.DtResultados.Copy()
End If End If
Dim TipoTransaccion As String = ""
Dim Observaciones As String = ""
If ObjIE.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) Then
TipoTransaccion = ObjIE.TipoTransaccion
Observaciones = ObjIE.Observaciones
End If
ObjIE.Dispose() ObjIE.Dispose()
If Tabla IsNot Nothing AndAlso Tabla.Rows.Count > 0 Then If Tabla IsNot Nothing AndAlso Tabla.Rows.Count > 0 Then
@@ -5390,6 +5401,8 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("CuentaCaja", CuentaCaja)) params.Add(New ReportParameter("CuentaCaja", CuentaCaja))
params.Add(New ReportParameter("CuentaDeposito", CuentaDeposito)) params.Add(New ReportParameter("CuentaDeposito", CuentaDeposito))
params.Add(New ReportParameter("TipoPago", TipoPago)) params.Add(New ReportParameter("TipoPago", TipoPago))
params.Add(New ReportParameter("TipoTransaccion", TipoTransaccion))
params.Add(New ReportParameter("Observaciones", Observaciones))
If Archivo.Exists Then If Archivo.Exists Then
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
@@ -5753,14 +5766,14 @@ Partial Class PopUpVerFactura
If ObjIE.DtResultados.Rows.Count > 0 Then If ObjIE.DtResultados.Rows.Count > 0 Then
Dim reportDataSetsList As New List(Of ReportDataSource) Dim reportDataSetsList As New List(Of ReportDataSource)
Dim CvePrePoliza As Integer = 0 Dim CvePrePoliza As Integer = ObjIE.DtResultados.Rows(0)("CvePrePoliza").ToString.ToEntero
Dim dtMovs As New DataTable Dim dtMovs As New DataTable
If ObjIE.GetBancosIEFacturasPagadas(CveIE, UsuarioActual.CveEmpresa) Then If ObjIE.GetBancosIEFacturasPagadas(CveIE, UsuarioActual.CveEmpresa) Then
dtMovs = ObjIE.DtResultados.FiltraParametros("CveConceptoContable IN (17,2,308,309,312,292 )") dtMovs = ObjIE.DtResultados.FiltraParametros("CveConceptoContable IN (17,2,308,309,312,292 )")
If dtMovs IsNot Nothing AndAlso dtMovs.Rows.Count > 0 Then If dtMovs IsNot Nothing AndAlso dtMovs.Rows.Count > 0 Then
CvePrePoliza = dtMovs.Rows(0)("CVePrePoliza").ToString.ToEntero 'CvePrePoliza = dtMovs.Rows(0)("CvePrePoliza").ToString.ToEntero
If Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then If Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then
'CONVIERTO A PESOS CUANDO SE PAGA CON PESOS FACTURAS DE DOLARES 'CONVIERTO A PESOS CUANDO SE PAGA CON PESOS FACTURAS DE DOLARES
@@ -5805,7 +5818,7 @@ Partial Class PopUpVerFactura
End With End With
dtMovs.Dispose() dtMovs.Dispose()
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 And CvePrePoliza > 0 Then If UsuarioActual.CveEmpresa.Contiene(189, 193, 195, 196, 197) And CvePrePoliza > 0 Then
Dim ObjContabilidad As New ClsContabilidad Dim ObjContabilidad As New ClsContabilidad

View File

@@ -155,7 +155,7 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtConcepto" runat="server" Width="100%" CssClass="form-control" ></asp:TextBox> <asp:TextBox ID="TxtConcepto" runat="server" Width="100%" CssClass="form-control" onkeyup="asignaConcepto()" ClientIDMode="Static"></asp:TextBox>
<label for="<%= TxtConcepto.ClientID.ToString()%>">Concepto:</label> <label for="<%= TxtConcepto.ClientID.ToString()%>">Concepto:</label>
<asp:RequiredFieldValidator ID="RFVConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="El campo <b>''Concepto''</b> es requerido, por favor ingrese uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVConcepto" runat="server" ControlToValidate="TxtConcepto" Display="None" ErrorMessage="El campo <b>''Concepto''</b> es requerido, por favor ingrese uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RFVConcepto" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEConcepto" runat="server" HighlightCssClass="vco" TargetControlID="RFVConcepto" Width="350px"></ajax:ValidatorCalloutExtender>
@@ -187,8 +187,8 @@
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtUsuarioElaboro" runat="server" MaxLength="15" Enabled="false"></asp:TextBox> <asp:Label CssClass="form-control" ID="LblUsuarioElaboro" runat="server" MaxLength="15" ></asp:Label>
<label for="<%= TxtUsuarioElaboro.ClientID.ToString()%>">Usuario Elaboró: </label> <label for="<%= LblUsuarioElaboro.ClientID.ToString()%>">Usuario Elaboró: </label>
</div> </div>
</div> </div>
</div> </div>
@@ -288,7 +288,7 @@
</div> </div>
<input id="HdnCveCuenta" runat="server" type="hidden" value="-1" clientidmode="Static" /> <input id="HdnCveCuenta" runat="server" type="hidden" value="-1" clientidmode="Static" />
<div style="width: 100%; min-height: 200px; overflow-scrolling: auto;"> <div style="width: 100%; min-height: 200px; -webkit-overflow-scrolling: auto;">
<div class="portlet light xspadding bordered " id="pnldl2" runat="server"> <div class="portlet light xspadding bordered " id="pnldl2" runat="server">
<div class="portlet-title"> <div class="portlet-title">
@@ -310,6 +310,7 @@
<a href="javascript:;" onclick="FiltrarTablaV2('.TxtBusqueda','.GvMov')" style="margin-top: -3px;" class="btn btn-circle btn-sm font-bold green"><i class="icon-magnifier" style="font-weight: bold;"></i></a> <a href="javascript:;" onclick="FiltrarTablaV2('.TxtBusqueda','.GvMov')" style="margin-top: -3px;" class="btn btn-circle btn-sm font-bold green"><i class="icon-magnifier" style="font-weight: bold;"></i></a>
</div> </div>
</div> </div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom "> <div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<asp:GridView ID="GvMov" runat="server" AutoGenerateColumns="False" ShowHeader="True" <asp:GridView ID="GvMov" runat="server" AutoGenerateColumns="False" ShowHeader="True"
DataKeyNames="IdMov,Cargo,Abono,TipoMovto,CveConceptoContable,CveProveedor,CvePersonal, CveCompra,CveClasificacion,CveCliente,CveVenta,CveCuenta, ContadoTipoTransaccion, ContadoCuenta, ContadoNumeroFolio, ContadoImporte, ContadoBeneficiario, ContadoObservaciones,EsComplementaria, EsMonedaExtranjera,ImporteME, PorcentajeImpuesto, TC" DataKeyNames="IdMov,Cargo,Abono,TipoMovto,CveConceptoContable,CveProveedor,CvePersonal, CveCompra,CveClasificacion,CveCliente,CveVenta,CveCuenta, ContadoTipoTransaccion, ContadoCuenta, ContadoNumeroFolio, ContadoImporte, ContadoBeneficiario, ContadoObservaciones,EsComplementaria, EsMonedaExtranjera,ImporteME, PorcentajeImpuesto, TC"
@@ -333,7 +334,8 @@
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Concepto</HeaderTemplate> <HeaderTemplate>Concepto</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtConcepto" runat="server" Text='<%# Eval("Concepto")%>' Width="100%"></asp:TextBox> <%--<asp:Literal ID="LrlConcepto" runat="server" Text='<%# Eval("Concepto")%>'></asp:Literal>--%>
<asp:TextBox ID="TxtConcepto" runat="server" Text='<%# Eval("Concepto")%>' Width="100%" CssClass="selTxtConcepto"></asp:TextBox>
</ItemTemplate> </ItemTemplate>
<ItemStyle /> <ItemStyle />
</asp:TemplateField> </asp:TemplateField>
@@ -622,8 +624,6 @@
<asp:Label ID="LblFolioDoc" runat="server" Text="Número:" class="col-md-2"></asp:Label> <asp:Label ID="LblFolioDoc" runat="server" Text="Número:" class="col-md-2"></asp:Label>
<div class="col-md-4"> <div class="col-md-4">
<asp:TextBox ID="TxtDocumentoFolio" CssClass="form-control input-sm" value="0" runat="server" MaxLength="12"></asp:TextBox> <asp:TextBox ID="TxtDocumentoFolio" CssClass="form-control input-sm" value="0" runat="server" MaxLength="12"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtDocumentoFolio" Display="None" ErrorMessage="El campo <b>''Folio''</b> es requerido por la aplicación, por favor ingrese uno." ValidationGroup="GrpContado"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender5" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
<label class="col-md-2">Importe</label> <label class="col-md-2">Importe</label>
<div class="col-md-4 input-icon"> <div class="col-md-4 input-icon">
@@ -646,6 +646,9 @@
<asp:TextBox ID="TxtDocumentoObservaciones" CssClass="form-control input-sm" runat="server" MaxLength="500" Rows="3" TextMode="MultiLine"></asp:TextBox> <asp:TextBox ID="TxtDocumentoObservaciones" CssClass="form-control input-sm" runat="server" MaxLength="500" Rows="3" TextMode="MultiLine"></asp:TextBox>
</div> </div>
</div> </div>
<div class="row">
<label class="col-md-12">sino se especifica el folio, se genera en automático:</label>
</div>
</div> </div>
</asp:Panel> </asp:Panel>
</div> </div>
@@ -1200,9 +1203,17 @@
} }
function valorIE() { function valorIE() {
} }
function asignaConcepto() {
let valor = $('#TxtConcepto').val();
$('input[type="text"].selTxtConcepto').val(valor);
}
</script> </script>
</asp:Content> </asp:Content>

View File

@@ -1,4 +1,7 @@
Imports System.Data Imports System.Data
Imports System.Runtime.CompilerServices
Imports System.Runtime.Remoting
'Imports DocumentFormat.OpenXml 'Imports DocumentFormat.OpenXml
Imports Extensiones Imports Extensiones
Imports GemBox.Spreadsheet Imports GemBox.Spreadsheet
@@ -321,7 +324,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy") TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy")
TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy") TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy")
TxtConcepto.Enabled = True TxtConcepto.Enabled = True
TxtUsuarioElaboro.Text = UsuarioActual.Nombre LblUsuarioElaboro.Text = UsuarioActual.Nombre
End If End If
@@ -349,7 +352,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy") TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy")
TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy") TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy")
TxtConcepto.Enabled = True TxtConcepto.Enabled = True
TxtUsuarioElaboro.Text = UsuarioActual.Usuario LblUsuarioElaboro.Text = UsuarioActual.Usuario
End If End If
@@ -409,6 +412,7 @@ Partial Class ContabilidadC_RegPrePolizaS
.Add("EsMonedaExtranjera", Type.GetType("System.Boolean")) .Add("EsMonedaExtranjera", Type.GetType("System.Boolean"))
.Add("TC", Type.GetType("System.Decimal")) .Add("TC", Type.GetType("System.Decimal"))
.Add("CvePrePoliza", Type.GetType("System.Int32")) .Add("CvePrePoliza", Type.GetType("System.Int32"))
.Add("CveMovimientoAlmacen", Type.GetType("System.Int32"))
End With End With
@@ -429,6 +433,7 @@ Partial Class ContabilidadC_RegPrePolizaS
DtMovimientosEliminar.AcceptChanges() DtMovimientosEliminar.AcceptChanges()
End Sub End Sub
Private Function CargaPrePoliza(tCvePrePoliza As Integer) As Boolean Private Function CargaPrePoliza(tCvePrePoliza As Integer) As Boolean
HplImprimirPDF.Visible = False
Dim retorno As Boolean = False Dim retorno As Boolean = False
Dim ObjContabilidad As New ClsContabilidad Dim ObjContabilidad As New ClsContabilidad
If ObjContabilidad.GetPrePoliza(tCvePrePoliza, UsuarioActual.CveEmpresa) Then If ObjContabilidad.GetPrePoliza(tCvePrePoliza, UsuarioActual.CveEmpresa) Then
@@ -448,14 +453,13 @@ Partial Class ContabilidadC_RegPrePolizaS
Folio = dr("FolioPoliza").ToString Folio = dr("FolioPoliza").ToString
TxtFolio.Text = dr("FolioPoliza").ToString TxtFolio.Text = dr("FolioPoliza").ToString
TxtUsuarioElaboro.Text = dr("UsuarioNombre").ToString LblUsuarioElaboro.Text = dr("UsuarioNombre").ToString
TxtFechaelaboracion.Text = dr("FechaIng").ToString.ToDate.ToString("dd/MM/yyyy") TxtFechaelaboracion.Text = dr("FechaIng").ToString.ToDate.ToString("dd/MM/yyyy")
TxtFechaelaboracion.ToolTip = dr("FechaIng").ToString.ToDate.ToString("HH:mm:ss") TxtFechaelaboracion.ToolTip = dr("FechaIng").ToString.ToDate.ToString("HH:mm:ss")
CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString.ToEntero CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString.ToEntero
DdlPlantilla.SelectedValueExist(CvePlantillaPoliza) DdlPlantilla.SelectedValueExist(CvePlantillaPoliza)
HplImprimirPDF.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={Encripta($"OP=PREPO&CvePrePoliza={CvePrePoliza}")}"
HplImprimirPDF.Visible = True LblUsuarioElaboro.ToolTip = dr("Modulo").ToString
If UsuarioActual.CveRol = 1 Then TxtUsuarioElaboro.ToolTip = dr("Modulo").ToString
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then
LnkAddConcepto.Visible = True LnkAddConcepto.Visible = True
@@ -528,6 +532,23 @@ Partial Class ContabilidadC_RegPrePolizaS
RegistraScript("comparar();") RegistraScript("comparar();")
LnkExcel.Visible = False LnkExcel.Visible = False
Dim CveIE As Integer = DtMovimientos.FiltroPrimeroValor("CveIE", " CveIE > 0 ").ToEntero
If UsuarioActual.Empresa.Funcionalidad(382).ToEntero = 1 AndAlso CveIE > 0 Then
Dim StrEncript As String = Encripta($"OP=ImprimeMov&CveIE={CveIE}")
'HplListaProveedores.NavigateUrl = String.Format($"/Compras/PopUpVerFactura.aspx?P={StrEncript}", )
HplImprimirPDF.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={StrEncript}"
HplImprimirPDF.Visible = True
Else
HplImprimirPDF.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={Encripta($"OP=PREPO&CvePrePoliza={CvePrePoliza}")}"
HplImprimirPDF.Visible = True
End If
Else Else
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia) Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
BtnEliminar.Visible = False BtnEliminar.Visible = False
@@ -792,7 +813,7 @@ Partial Class ContabilidadC_RegPrePolizaS
GvMov.DataSource = DtMovimientos GvMov.DataSource = DtMovimientos
GvMov.DataBind() GvMov.DataBind()
GvPrePoliza.DataBind() ''limpio el grid GvPrePoliza.DataBind()
UpPrePoliza.Update() UpPrePoliza.Update()
UPMovs.Update() UPMovs.Update()
@@ -813,7 +834,7 @@ Partial Class ContabilidadC_RegPrePolizaS
e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = "0", "", e.Row.DBCampo("Abono")) e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = "0", "", e.Row.DBCampo("Abono"))
e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = "0", "", e.Row.DBCampo("Cargo")) e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = "0", "", e.Row.DBCampo("Cargo"))
e.Row.FCTextBox("TxtConcepto").Text = e.Row.DBCampo("Descripcion") e.Row.FCTextBox("TxtConcepto").Text = e.Row.DBCampo("Concepto")
If CvePeriodo > 0 Then If CvePeriodo > 0 Then
e.Row.FCTextBox("TxtCargo").Enabled = False e.Row.FCTextBox("TxtCargo").Enabled = False
@@ -835,7 +856,8 @@ Partial Class ContabilidadC_RegPrePolizaS
e.Row.FCDropDownList("DdlSubProyecto").Enabled = True e.Row.FCDropDownList("DdlSubProyecto").Enabled = True
e.Row.FCLinkButton("imgD").Visible = True e.Row.FCLinkButton("imgD").Visible = True
Else Else
e.Row.FCDropDownList("DdlSubProyecto").Enabled = False '
'e.Row.FCDropDownList("DdlSubProyecto").Enabled = False
End If End If
If e.Row.DBCampo("MultipleSubProyecto") = "True" Then If e.Row.DBCampo("MultipleSubProyecto") = "True" Then
@@ -1012,7 +1034,7 @@ Partial Class ContabilidadC_RegPrePolizaS
End If End If
If Not gvr.DataKey("CveConceptoContable").Contiene("30", "10", "204") Then ' 30-bancos, 10-anticipos proveedores, 204- blancos complementaria If Not gvr.DataKey("CveConceptoContable").Contiene("30", "10", "204", "348", "350") Then ' 30-bancos, 10-anticipos proveedores, 204- blancos complementaria,348-350 - doc x pagar
If gvr.DataKey("CveConceptoContable").ToEntero = 41 Then If gvr.DataKey("CveConceptoContable").ToEntero = 41 Then
CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
Else Else
@@ -1667,6 +1689,35 @@ Partial Class ContabilidadC_RegPrePolizaS
End If End If
End If End If
If DdlPlantilla.SelectedValue.ToEntero <> 53 Then
Dim x As Integer = 0
For Each gvRow As GridViewRow In GvMov.Rows
DtMovimientos.Rows(x)("ContadoTipoTransaccion") = gvRow.DataKey("ContadoTipoTransaccion").ToEntero
DtMovimientos.Rows(x)("ContadoCuenta") = gvRow.DataKey("ContadoCuenta").ToEntero
DtMovimientos.Rows(x)("ContadoNumeroFolio") = gvRow.DataKey("ContadoNumeroFolio")
DtMovimientos.Rows(x)("ContadoImporte") = gvRow.DataKey("ContadoImporte").ToDecimal
DtMovimientos.Rows(x)("ContadoBeneficiario") = gvRow.DataKey("ContadoBeneficiario")
DtMovimientos.Rows(x)("ContadoObservaciones") = gvRow.DataKey("ContadoObservaciones")
DtMovimientos.Rows(x)("Concepto") = gvRow.FCTextBox("TxtConcepto").Text
DtMovimientos.Rows(x)("Cargo") = gvRow.FCTextBox("TxtCargo").Text.ToDecimal
DtMovimientos.Rows(x)("Abono") = gvRow.FCTextBox("TxtAbono").Text.ToDecimal
DtMovimientos.Rows(x)("TC") = gvRow.FCTextBox("TxtTC").Text.ToDecimal
DtMovimientos.Rows(x)("ImporteME") = gvRow.FCTextBox("TxtAbonoME").Text.ToDecimal
DtMovimientos.Rows(x)("CveSubProyecto") = gvRow.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero
x = x + 1
Next
DtMovimientos.AcceptChanges()
End If
dr("CveCuenta") = DdlCuentaContableE.SelectedValue dr("CveCuenta") = DdlCuentaContableE.SelectedValue
dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text
dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text
@@ -1717,11 +1768,22 @@ Partial Class ContabilidadC_RegPrePolizaS
End If End If
DtMovimientos.AcceptChanges() DtMovimientos.AcceptChanges()
If DdlPlantilla.SelectedValue.ToEntero <> 53 Then
GvMov.DataSource = DtMovimientos
GvMov.DataBind()
GvPrePoliza.DataBind()
UpPrePoliza.Update()
UPMovs.Update()
Else
GvPrePoliza.EditIndex = -1 GvPrePoliza.EditIndex = -1
GvPrePoliza.DataSource = DtMovimientos GvPrePoliza.DataSource = DtMovimientos
GvPrePoliza.DataBind() GvPrePoliza.DataBind()
UpPrePoliza.Update() UpPrePoliza.Update()
GvPrePoliza.Visible = True GvPrePoliza.Visible = True
End If
TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero
TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero
@@ -1964,7 +2026,7 @@ Partial Class ContabilidadC_RegPrePolizaS
'Folio = TxtDocumentoFolio.Text 'Folio = TxtDocumentoFolio.Text
'ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal 'ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal
'Observaciones = TxtDocumentoObservaciones.Text 'Observaciones = TxtDocumentoObservaciones.Text
'Beneficiario = TxtDocumentoBeneficiario.Text 'Beneficiario = TxtDocumentoBeneficiario.TextTxtReferenciaE
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal")) RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal"))
@@ -2606,7 +2668,7 @@ Partial Class ContabilidadC_RegPrePolizaS
divContabilizada.Visible = False divContabilizada.Visible = False
TxtFolio.Text = "" TxtFolio.Text = ""
TxtUsuarioElaboro.Text = UsuarioActual.Usuario LblUsuarioElaboro.Text = UsuarioActual.Usuario
End Sub End Sub

View File

@@ -310,8 +310,8 @@ Partial Class Contratos_RepPresupuestos
If UsaComprometido Then If UsaComprometido Then
Ejercido = DrPresupuesto("Comprometido").ToString.ToDecimal Ejercido = DrPresupuesto("Comprometido").ToString.ToDecimal
PorEjercer = Autorizado - Ejercido PorEjercer = Autorizado - Ejercido
EjercidoPorcentaje = Ejercido / Autorizado * 100 EjercidoPorcentaje = If(Autorizado > 0, Ejercido / Autorizado * 100, 0)
PorEjercerPorcentaje = PorEjercer / Autorizado * 100 PorEjercerPorcentaje = If(Autorizado > 0, PorEjercer / Autorizado * 100, 0)
thComprometido.Visible = True thComprometido.Visible = True
GvDatos.Columns(2).Visible = True GvDatos.Columns(2).Visible = True
End If End If
@@ -366,7 +366,7 @@ Partial Class Contratos_RepPresupuestos
e.Row.Cells(1).Text = "-" e.Row.Cells(1).Text = "-"
End If End If
If e.Row.DBCampo("Comprometido").ToDecimal = 0 Then If e.Row.DBCampo("Comprometido").ToDecimal = 0 Then
e.Row.Cells(1).Text = "-" e.Row.Cells(2).Text = "-"
End If End If
If e.Row.DBCampo("Ejercido").ToDecimal = 0 Then If e.Row.DBCampo("Ejercido").ToDecimal = 0 Then
e.Row.Cells(3).Text = "-" e.Row.Cells(3).Text = "-"

View File

@@ -1,5 +1,55 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"> <Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns:cl="http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition">
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="DataSet1">
<ConnectionProperties>
<DataProvider>System.Data.DataSet</DataProvider>
<ConnectString>/* Local Connection */</ConnectString>
</ConnectionProperties>
<rd:DataSourceID>c93e2c40-dee2-4fde-bb41-ac376bb8de88</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="DataSet1">
<Query>
<DataSourceName>DataSet1</DataSourceName>
<CommandText>/* Local Query */</CommandText>
</Query>
<Fields>
<Field Name="Referencia">
<DataField>Referencia</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Fecha">
<DataField>Fecha</DataField>
<rd:TypeName>System.Date</rd:TypeName>
</Field>
<Field Name="Cliente">
<DataField>Cliente</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TipoPago">
<DataField>TipoPago</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Importe">
<DataField>Importe</DataField>
<rd:TypeName>System.Double</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>DataSet1</rd:DataSetName>
<rd:SchemaPath>C:\inetpub\wwwroot\ADSistemas\Ventas.root\Reportes\DataSet1.xsd</rd:SchemaPath>
<rd:TableName>DataTable1</rd:TableName>
<rd:TableAdapterFillMethod />
<rd:TableAdapterGetDataMethod />
<rd:TableAdapterName />
</rd:DataSetInfo>
</DataSet>
</DataSets>
<ReportSections>
<ReportSection>
<Body> <Body>
<ReportItems> <ReportItems>
<Tablix Name="Tablix1"> <Tablix Name="Tablix1">
@@ -916,7 +966,7 @@
<rd:DefaultName>Textbox12</rd:DefaultName> <rd:DefaultName>Textbox12</rd:DefaultName>
<Top>2.15386cm</Top> <Top>2.15386cm</Top>
<Left>13.94971cm</Left> <Left>13.94971cm</Left>
<Height>0.70936cm</Height> <Height>0.53297cm</Height>
<Width>2.14313cm</Width> <Width>2.14313cm</Width>
<ZIndex>11</ZIndex> <ZIndex>11</ZIndex>
<Style> <Style>
@@ -937,7 +987,7 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>FECHA:</Value> <Value>Fecha:</Value>
<Style> <Style>
<FontStyle>Normal</FontStyle> <FontStyle>Normal</FontStyle>
<FontSize>9pt</FontSize> <FontSize>9pt</FontSize>
@@ -946,15 +996,15 @@
</TextRun> </TextRun>
</TextRuns> </TextRuns>
<Style> <Style>
<TextAlign>Center</TextAlign> <TextAlign>Left</TextAlign>
</Style> </Style>
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName> <rd:DefaultName>Textbox12</rd:DefaultName>
<Top>2.15386cm</Top> <Top>2.15386cm</Top>
<Left>12.49038cm</Left> <Left>12.24756cm</Left>
<Height>0.70936cm</Height> <Height>0.53297cm</Height>
<Width>1.45933cm</Width> <Width>1.70215cm</Width>
<ZIndex>12</ZIndex> <ZIndex>12</ZIndex>
<Style> <Style>
<Border> <Border>
@@ -1055,8 +1105,142 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </Textbox>
<Textbox Name="TipoTransaccion">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!TipoTransaccion.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>TipoTransaccion</rd:DefaultName>
<Top>2.86322cm</Top>
<Left>14.86693cm</Left>
<Height>0.53299cm</Height>
<Width>5.17258cm</Width>
<ZIndex>15</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox26">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Forma de pago:</Value>
<Style>
<FontStyle>Normal</FontStyle>
<FontSize>9pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName>
<Top>2.86322cm</Top>
<Left>12.24756cm</Left>
<Height>0.53299cm</Height>
<Width>2.76048cm</Width>
<ZIndex>16</ZIndex>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="TipoTransaccion2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Parameters!Observaciones.Value</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>TipoTransaccion</rd:DefaultName>
<Top>6.01944cm</Top>
<Left>2.83582cm</Left>
<Height>0.53299cm</Height>
<Width>12.56057cm</Width>
<ZIndex>17</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox27">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Observaciones:</Value>
<Style>
<FontStyle>Normal</FontStyle>
<FontSize>9pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox12</rd:DefaultName>
<Top>6.01944cm</Top>
<Left>0.14177cm</Left>
<Height>0.53299cm</Height>
<Width>2.58822cm</Width>
<ZIndex>18</ZIndex>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems> </ReportItems>
<Height>6.09cm</Height> <Height>6.75146cm</Height>
<Style /> <Style />
</Body> </Body>
<Width>20.05216cm</Width> <Width>20.05216cm</Width>
@@ -1084,54 +1268,8 @@
</Border> </Border>
</Style> </Style>
</Page> </Page>
<AutoRefresh>0</AutoRefresh> </ReportSection>
<DataSources> </ReportSections>
<DataSource Name="DataSet1">
<ConnectionProperties>
<DataProvider>System.Data.DataSet</DataProvider>
<ConnectString>/* Local Connection */</ConnectString>
</ConnectionProperties>
<rd:DataSourceID>c93e2c40-dee2-4fde-bb41-ac376bb8de88</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="DataSet1">
<Query>
<DataSourceName>DataSet1</DataSourceName>
<CommandText>/* Local Query */</CommandText>
</Query>
<Fields>
<Field Name="Referencia">
<DataField>Referencia</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Fecha">
<DataField>Fecha</DataField>
<rd:TypeName>System.Date</rd:TypeName>
</Field>
<Field Name="Cliente">
<DataField>Cliente</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TipoPago">
<DataField>TipoPago</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Importe">
<DataField>Importe</DataField>
<rd:TypeName>System.Double</rd:TypeName>
</Field>
</Fields>
<rd:DataSetInfo>
<rd:DataSetName>DataSet1</rd:DataSetName>
<rd:SchemaPath>C:\inetpub\wwwroot\ADSistemas\Ventas.root\Reportes\DataSet1.xsd</rd:SchemaPath>
<rd:TableName>DataTable1</rd:TableName>
<rd:TableAdapterFillMethod />
<rd:TableAdapterGetDataMethod />
<rd:TableAdapterName />
</rd:DataSetInfo>
</DataSet>
</DataSets>
<ReportParameters> <ReportParameters>
<ReportParameter Name="Empresa"> <ReportParameter Name="Empresa">
<DataType>String</DataType> <DataType>String</DataType>
@@ -1168,6 +1306,18 @@
<AllowBlank>true</AllowBlank> <AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt> <Prompt>ReportParameter1</Prompt>
</ReportParameter> </ReportParameter>
<ReportParameter Name="TipoTransaccion">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
<ReportParameter Name="Observaciones">
<DataType>String</DataType>
<Nullable>true</Nullable>
<AllowBlank>true</AllowBlank>
<Prompt>ReportParameter1</Prompt>
</ReportParameter>
</ReportParameters> </ReportParameters>
<rd:ReportUnitType>Cm</rd:ReportUnitType> <rd:ReportUnitType>Cm</rd:ReportUnitType>
<rd:ReportID>8ca56a24-e4cd-4986-9105-84383a48863b</rd:ReportID> <rd:ReportID>8ca56a24-e4cd-4986-9105-84383a48863b</rd:ReportID>

View File

@@ -658,7 +658,7 @@ Partial Class Inventarios_EntregaAlmacen
Dim ObjInventario As New ClsInventarios Dim ObjInventario As New ClsInventarios
If ObjInventario.EntregaAlmacenGet(CveVenta, CveAlmacen) Then If ObjInventario.EntregaAlmacenGet(CveVenta, UsuarioActual.CveEmpresa, CveAlmacen) Then
If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
ArchivoBitacora = String.Format("{0}Temp\EntregaDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta) ArchivoBitacora = String.Format("{0}Temp\EntregaDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta)
@@ -717,6 +717,11 @@ Partial Class Inventarios_EntregaAlmacen
LbObservacionesAlmacen.Text = drE("ObservacionesAlmacen").ToString() LbObservacionesAlmacen.Text = drE("ObservacionesAlmacen").ToString()
CveVentaSurtir = CveVenta CveVentaSurtir = CveVenta
CveOSSurtir = CveOS CveOSSurtir = CveOS
If TipoDocto = "Ped" And CveOSSurtir <= 0 Then
CveOSSurtir = drE("CveOS").ToString().ToEntero
End If
CveTipoVenta = drE("CveTipoVenta").ToString().ToEntero CveTipoVenta = drE("CveTipoVenta").ToString().ToEntero
CveAlmacenTraspasoDestino = drE(If(EsDevolucionVenta = 1 And TipoDocto <> "Rem" And TipoDocto <> "Ped", "CveAlmacenTraspasoOrigen", "CveAlmacenTraspasoDestino")).ToString().ToEntero() CveAlmacenTraspasoDestino = drE(If(EsDevolucionVenta = 1 And TipoDocto <> "Rem" And TipoDocto <> "Ped", "CveAlmacenTraspasoOrigen", "CveAlmacenTraspasoDestino")).ToString().ToEntero()
CveAlmacenTraspasoOrigen = drE(If(EsDevolucionVenta = 1 And TipoDocto <> "Rem" And TipoDocto <> "Ped", "CveAlmacenTraspasoDestino", "CveAlmacenTraspasoOrigen")).ToString().ToEntero() CveAlmacenTraspasoOrigen = drE(If(EsDevolucionVenta = 1 And TipoDocto <> "Rem" And TipoDocto <> "Ped", "CveAlmacenTraspasoDestino", "CveAlmacenTraspasoOrigen")).ToString().ToEntero()
@@ -1063,6 +1068,7 @@ Partial Class Inventarios_EntregaAlmacen
If CargaBitacora Then If CargaBitacora Then
CargaBitacoraSerie() CargaBitacoraSerie()
End If End If
Else
End If End If
End If End If
@@ -2167,15 +2173,13 @@ Partial Class Inventarios_EntregaAlmacen
DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text
End If End If
End If End If
Index += 1 Index += 1
Next Next
'VALIDA SI HUBO CAMBIOS EN LA EXISTENCIA 'VALIDA SI HUBO CAMBIOS EN LA EXISTENCIA
Dim DtDatosVenta As New DataTable Dim DtDatosVenta As New DataTable
If ObjInventario.EntregaAlmacenGet(CveVentaSurtir) Then If ObjInventario.EntregaAlmacenGet(CveVentaSurtir, UsuarioActual.CveEmpresa) Then
DtDatosVenta = ObjInventario.DtResultados DtDatosVenta = ObjInventario.DtResultados
End If End If
Dim CantidadGV As Decimal = GvDatos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal) Dim CantidadGV As Decimal = GvDatos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
@@ -3316,9 +3320,7 @@ Partial Class Inventarios_EntregaAlmacen
OnError("Ocurrió un error al guardar", ex) OnError("Ocurrió un error al guardar", ex)
End Try End Try
If Not ErrorMovInv AndAlso EsDevolucionVenta = 1 AndAlso CveOSSurtir > 0 AndAlso TipoMovimiento = 2 AndAlso TipoDocto = "Ped" Then
If EsDevolucionVenta = 1 AndAlso CveOSSurtir > 0 AndAlso TipoMovimiento = 2 AndAlso TipoDocto = "Ped" Then
If Not CierreOS(CveOSSurtir, CveMovimiento, ObjInventario.IniciaTransacSQL) Then If Not CierreOS(CveOSSurtir, CveMovimiento, ObjInventario.IniciaTransacSQL) Then
ErrorMovInv = True ErrorMovInv = True
Alert("Error al finalizar orden de servicio", TipoMensaje.MsgError) Alert("Error al finalizar orden de servicio", TipoMensaje.MsgError)
@@ -4352,8 +4354,14 @@ Partial Class Inventarios_EntregaAlmacen
Private Sub RecargaporAlmacenes() Private Sub RecargaporAlmacenes()
If DdlAlmacen.SelectedValue <> "-1" Then If DdlAlmacen.SelectedValue <> "-1" Then
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
CargaGvDatos(False)
Else
CargaGvDatos() CargaGvDatos()
End If End If
End If
End Sub End Sub
Protected Sub BtnImprimirSugerencias_Click(sender As Object, e As EventArgs) Protected Sub BtnImprimirSugerencias_Click(sender As Object, e As EventArgs)

View File

@@ -1,7 +1,6 @@
Imports System.Data Imports System.Data
Imports Extensiones Imports Extensiones
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Imports Stimulsoft.Report.QuickButtons.StiWpfQuickButtonAttribute
Partial Class RepNotasSinAlmacen Partial Class RepNotasSinAlmacen
Inherits ClsPaginas Inherits ClsPaginas
@@ -123,7 +122,7 @@ Partial Class RepNotasSinAlmacen
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
Dim Reporte As New ClsInventarios
Dim CveClienteProveedor As Integer = -1 Dim CveClienteProveedor As Integer = -1
Dim TipoDocumento As String = DdlTipoDocto1.SelectedValue Dim TipoDocumento As String = DdlTipoDocto1.SelectedValue
@@ -139,14 +138,18 @@ Partial Class RepNotasSinAlmacen
Else Else
CveClienteProveedor = DdlCliente.SelectedValue.ToEntero CveClienteProveedor = DdlCliente.SelectedValue.ToEntero
End If End If
Dim Reporte As New ClsInventarios
If Reporte.RepNotasSinAlmacen(Opcion, CveClienteProveedor, FechaInicial, FechaFinal, TipoDocumento, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then If Reporte.RepNotasSinAlmacen(Opcion, CveClienteProveedor, FechaInicial, FechaFinal, TipoDocumento, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then
Dim dtt As DataTable = Reporte.DtResultados
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then ' es empresa hospitalaria
dtt = dtt.fit
End If
GvVentas.DataSource = Reporte.DtResultados GvVentas.DataSource = Reporte.DtResultados
DtNotasSinAlmacenVentas = Reporte.DtResultados DtNotasSinAlmacenVentas = Reporte.DtResultados
Else Else
GvVentas.DataSource = Nothing GvVentas.DataSource = Nothing
End If End If
Reporte.Dispose()
GvVentas.DataBind() GvVentas.DataBind()
Else Else
@@ -156,14 +159,14 @@ Partial Class RepNotasSinAlmacen
Else Else
CveClienteProveedor = DdlProveedor.SelectedValue.ToEntero CveClienteProveedor = DdlProveedor.SelectedValue.ToEntero
End If End If
Dim Reporte As New ClsInventarios
If Reporte.RepNotasSinAlmacen(2, CveClienteProveedor, FechaInicial, FechaFinal, DdlTipoDocto2.SelectedValue, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then If Reporte.RepNotasSinAlmacen(2, CveClienteProveedor, FechaInicial, FechaFinal, DdlTipoDocto2.SelectedValue, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then
GvCompras.DataSource = Reporte.DtResultados GvCompras.DataSource = Reporte.DtResultados
DtNotasSinAlmacenCompras = Reporte.DtResultados DtNotasSinAlmacenCompras = Reporte.DtResultados
Else Else
GvCompras.DataSource = Nothing GvCompras.DataSource = Nothing
End If End If
Reporte.Dispose()
GvCompras.DataBind() GvCompras.DataBind()
'If (GvCompras.Rows.Count > 0) Then 'If (GvCompras.Rows.Count > 0) Then
@@ -175,7 +178,7 @@ Partial Class RepNotasSinAlmacen
UpDatosGvVentas.Update() UpDatosGvVentas.Update()
UpDatosGvCompras.Update() UpDatosGvCompras.Update()
Reporte.Dispose()
End Sub End Sub

View File

@@ -6,7 +6,6 @@ Imports System.Data.SqlClient
Imports System.IO Imports System.IO
Imports Extensiones Imports Extensiones
Imports GemBox.Spreadsheet Imports GemBox.Spreadsheet
Imports Microsoft.Owin.Security.Provider
Imports Newtonsoft.Json Imports Newtonsoft.Json
Partial Class OC_OC Partial Class OC_OC
@@ -926,13 +925,13 @@ Partial Class OC_OC
ChkEntregaDirecta.Checked = False ChkEntregaDirecta.Checked = False
End If End If
If UsuarioActual.CveEmpresa.Contiene(13, 73) AndAlso CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then 'If UsuarioActual.CveEmpresa.Contiene(13, 73) AndAlso CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then
If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then ' If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then
Alert("PrePoliza de Presupuesto Generada Correctamente") ' Alert("PrePoliza de Presupuesto Generada Correctamente")
Else ' Else
Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia) ' Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia)
End If ' End If
End If 'End If
End If End If
@@ -2218,51 +2217,11 @@ Partial Class OC_OC
Exit Sub Exit Sub
End If End If
Dim ValImporte As Decimal = (TxtCant.Text.ToDecimal * txtPrecioUnitario.Text.ToDecimal).RoundSQL(2) Dim ValImporte As Decimal = (TxtCant.Text.ToDecimal * txtPrecioUnitario.Text.ToDecimal).RoundSQL(2)
If Not ValidaPresupuesto(1, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, ValImporte) Then If Not ValidaPresupuesto(1, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, ValImporte) Then
Exit Sub Exit Sub
End If End If
'If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
'Dim ObjCon As New ClsContratos
'Dim CvePresupuesto As Integer = 0
'Dim Autorizado As Decimal = 0
'Dim Ejercido As Decimal = 0
'If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then
' If ObjCon.DtResultados.Rows.Count > 0 Then
' CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero
' If CvePresupuesto > 0 Then
' If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
' If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows.Count > 0 Then
' Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDecimal
' End If
' End If
' If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{NowADS().Year - 1}".ToDate, NowADS(), UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
' DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
' If ObjCon.DtResultados.Rows.Count > 0 Then
' Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDecimal
' End If
' End If
' End If
' End If
'End If
'ObjCon.Dispose()
'If CvePresupuesto > 0 And Autorizado > 0 Then
' Dim Diferencia As Decimal = (Ejercido + If(txtPrecioUnitario.Text.ToDecimal > 0, (txtPrecioUnitario.Text.ToDecimal * TxtCant.Text.ToDecimal) - TxtDescuentoAdd.Text.ToDecimal, 0)) - Autorizado
' If Diferencia > 0 Then
' Alert($"No hay presupuesto disponible en el subproyecto <b>{DdlSubProyecto.SelectedItem.Text}</b> y la clasificación <b>{DdlClasificacion.SelectedItem.Text}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
' Exit Sub
' End If
'End If
'End If
Dim RetISR As Decimal = DrPS("RetISR").ToString.ToDecimal Dim RetISR As Decimal = DrPS("RetISR").ToString.ToDecimal
Dim RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal Dim RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal
Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal
@@ -2642,10 +2601,17 @@ Partial Class OC_OC
End If End If
If Not ValidaTotales() Then
TieneError = True
End If
Return TieneError Return TieneError
End Function End Function
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
'VALIDACIONES PARA GUARDAR 'VALIDACIONES PARA GUARDAR
If ValidaGuardar() Then Exit Sub If ValidaGuardar() Then Exit Sub
@@ -2653,6 +2619,8 @@ Partial Class OC_OC
Exit Sub Exit Sub
End If End If
Dim MsgError As String = "Hubo un error al registrar" Dim MsgError As String = "Hubo un error al registrar"
'VARIABLES 'VARIABLES
Dim CveProveedorSucursal As Integer = -1 Dim CveProveedorSucursal As Integer = -1
@@ -3348,6 +3316,30 @@ Partial Class OC_OC
End Sub End Sub
Private Function ValidaTotales() As Boolean
Dim Subtotal As Decimal = DtDetalle.SUMD("Total", "Total > 0") + DtDetalle.SUMD("Descuento")
Dim Descuento As Decimal = DtDetalle.SUMD("Descuento").RoundSQL
Dim SubTotalIEPSIVA As Decimal = DtDetalle.SUMD("IEPSPSIVA")
Dim IVA As Decimal = DtDetalle.SUMD("IVA") + SubTotalIEPSIVA
Dim SubTotalIEPS As Decimal = DtDetalle.SUMD("IEPSPS")
Dim SubTotalRetIVA As Decimal = DtDetalle.SUMD("RetIVA")
Dim SubTotalRetISR As Decimal = DtDetalle.SUMD("RetISR")
Dim Total As Decimal = (Subtotal - Descuento + IVA + SubTotalIEPS - SubTotalRetIVA - SubTotalRetISR)
Dim Diferencia As Decimal = (Total - LblTotal.Text.ToDecimal).RoundSQL(2)
If Math.Abs(Diferencia) > 0 Then
Alert($"Existe una diferencia de {Diferencia.ToString("###,###,###.00")} entre el Total y las Partidas.", TipoMensaje.MsgAdvertencia)
Return False
Else
Return True
End If
End Function
Protected Function GeneraOrdenes(ByRef objOrdenCompra As ClsOC, Conta As ClsContPAQi, ByRef ObjInventarios As ClsInventarios) As Boolean Protected Function GeneraOrdenes(ByRef objOrdenCompra As ClsOC, Conta As ClsContPAQi, ByRef ObjInventarios As ClsInventarios) As Boolean
'If Ddlcliente.txtValue.Value.ToEntero > 0 And DdlVendedor.SelectedValue.ToEntero <= 0 Then 'If Ddlcliente.txtValue.Value.ToEntero > 0 And DdlVendedor.SelectedValue.ToEntero <= 0 Then
@@ -3521,8 +3513,7 @@ Partial Class OC_OC
End If End If
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
If UsuarioActual.CveEmpresa.Contiene(13, 73) Then
If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then
HuboError = True HuboError = True
@@ -3530,7 +3521,6 @@ Partial Class OC_OC
End If End If
Catch ex As Exception Catch ex As Exception
HuboError = True HuboError = True
End Try End Try
@@ -3687,6 +3677,10 @@ Partial Class OC_OC
TieneError = True TieneError = True
End If End If
If (UsuarioActual.Empresa.Funcionalidad(532) = "1") Then
GeneraPrePolizaPresupuesto(CveOrdenCompra, objOrdenCompra.IniciaTransacSQL, True)
End If
If IDPolizaPresupuestal > 0 AndAlso UsuarioActual.Empresa.UsaAC Then If IDPolizaPresupuestal > 0 AndAlso UsuarioActual.Empresa.UsaAC Then
PolizaCancelacion = CancelarAC(ObjAC) PolizaCancelacion = CancelarAC(ObjAC)
@@ -9051,59 +9045,50 @@ Partial Class OC_OC
Dim respuesta As Boolean = False Dim respuesta As Boolean = False
'If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
Dim ObjCon As New ClsContratos Dim ObjCon As New ClsContratos
Dim CvePresupuesto As Integer = 0 Dim CvePresupuesto As Integer = 0
Dim Autorizado As Double = 0 Dim Autorizado As Decimal = 0
Dim Ejercido As Double = 0 Dim Ejercido As Decimal = 0
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, 2) Then
Dim FechaCompra As Date = TxtFecha.Text.ToDate Dim FechaCompra As Date = TxtFecha.Text.ToDate
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, FechaCompra.FirstDayOfMonth, FechaCompra.LastDayOfMonth, 2) Then
Dim ColumnaSaldo As String = "Saldo"
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then ColumnaSaldo = "SaldoComprometido"
Dim resultadosFiltrados = From row In ObjCon.DtResultados.AsEnumerable() Dim resultadosFiltrados = From row In ObjCon.DtResultados.AsEnumerable()
Where FechaCompra >= row.Field(Of Date)("FechaInicio") AndAlso
FechaCompra <= row.Field(Of Date)("FechaFin")
Select row Select row
If ObjCon.DtResultados.Rows.Count > 0 Then
If resultadosFiltrados.Count > 0 Then
If Opcion = 1 Then If Opcion = 1 Then
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = ValCveSubProyecto) Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = ValCveSubProyecto)
If tieneRegistrosConCveSubProyecto Then If tieneRegistrosConCveSubProyecto Then
Dim saldoTotal As Decimal = (From row In resultadosFiltrados Dim saldoTotal As Decimal = (From row In resultadosFiltrados
Where row.Field(Of Integer)("CveSubProyecto") = ValCveSubProyecto AndAlso Where row.Field(Of Integer)("CveSubProyecto") = ValCveSubProyecto AndAlso
row.Field(Of Integer)("CveClasificacion") = ValCveClasificacion row.Field(Of Integer)("CveClasificacion") = ValCveClasificacion
Select row.Field(Of Decimal)("Saldo")).Sum() Select row.Field(Of Decimal)(ColumnaSaldo)).Sum()
If saldoTotal > 0 Then If saldoTotal > 0 Then
Dim TotalAcumuladoTabla As Decimal = (DtDetalle.SUM("Total", $" CveSubProyecto = {ValCveSubProyecto} AND CveClasificacion = {ValCveClasificacion} ")) Dim TotalAcumuladoTabla As Decimal = (DtDetalle.SUM("Total", $" CveSubProyecto = {ValCveSubProyecto} AND CveClasificacion = {ValCveClasificacion} "))
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
If (Diferencia) < 0 Then If (Diferencia) < 0 Then
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>. Se excede por <b>{ Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia) Alert($"No hay presupuesto disponible en: <br/> Subproyecto:<b> {ValSubProyecto}</b> Clasificación:<b> {ValClasificacion}</b>. Se excede por <b>{ Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
respuesta = False respuesta = False
Else Else
respuesta = True respuesta = True
End If End If
Else Else
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>.", TipoMensaje.MsgAdvertencia) Alert($"No hay presupuesto disponible en: <br/> Subproyecto:<b> {ValSubProyecto}</b> Clasificación:<b> {ValClasificacion}</b>.", TipoMensaje.MsgAdvertencia)
respuesta = False respuesta = False
End If End If
Else Else
respuesta = True respuesta = True
End If End If
Else Else
Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable() Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable()
Group row By Group row By
SubProyecto = row.Field(Of String)("SubProyecto"), SubProyecto = row.Field(Of String)("SubProyecto"),
@@ -9127,21 +9112,20 @@ Partial Class OC_OC
Dim saldoTotal As Decimal = (From row In resultadosFiltrados Dim saldoTotal As Decimal = (From row In resultadosFiltrados
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
Select row.Field(Of Decimal)("Saldo")).Sum() Select row.Field(Of Decimal)(ColumnaSaldo)).Sum()
If saldoTotal > 0 Then If saldoTotal > 0 Then
Dim Diferencia As Decimal = saldoTotal - item.TotalSum Dim Diferencia As Decimal = saldoTotal - item.TotalSum
If (Diferencia) < 0 Then If (Diferencia) < 0 Then
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia) Alert($"No hay presupuesto disponible en: <br/> Subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
respuesta = False respuesta = False
Exit For Exit For
Else Else
respuesta = True respuesta = True
End If End If
Else Else
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>.", TipoMensaje.MsgAdvertencia) Alert($"No hay presupuesto disponible en: <br/> Subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>.", TipoMensaje.MsgAdvertencia)
respuesta = False respuesta = False
Exit For Exit For
End If End If
@@ -9149,7 +9133,6 @@ Partial Class OC_OC
respuesta = True respuesta = True
End If End If
Next Next
End If End If
Else Else
@@ -9160,46 +9143,32 @@ Partial Class OC_OC
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia) 'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
respuesta = False respuesta = False
End If End If
ObjCon.Dispose() ObjCon.Dispose()
Else Else
respuesta = True respuesta = True
End If End If
Return respuesta Return respuesta
End Function End Function
Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPresupuesto As Integer, Optional ByRef transaccion As SqlTransaction = Nothing, Optional EsCancelacion As Boolean = False) As Boolean
Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPresupuesto As Integer, Optional ByRef transaccion As SqlTransaction = Nothing) As Boolean
Dim Respuesta As Boolean = True Dim Respuesta As Boolean = True
If UsuarioActual.CveEmpresa.Contiene(13, 73) Then If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero
Dim TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal) Dim TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal)
If CveMonedaPresupuesto > 1 AndAlso TC = 0 Then If CveMonedaPresupuesto > 1 AndAlso TC = 0 Then
Alert($"No se genero la prepoliza de presupuesto, no se pudo obtener el Tipo de Cambio de la fecha {TxtFecha.Text}", TipoMensaje.MsgAdvertencia) Alert($"No se genero la póliza de presupuesto, no se pudo obtener el Tipo de Cambio de la fecha {TxtFecha.Text}", TipoMensaje.MsgAdvertencia)
Return False Return False
End If End If
Dim ObjConta As New ClsContabilidad() Dim ObjConta As New ClsContabilidad(transaccion)
Dim CvePrePolizaPresupuesto = ObjConta.AddPrePolizas("OC/OC-(Presupuesto)", 53, LblTotal.Text.ToDecimal, LblTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If transaccion Is Nothing Then If CvePrePolizaPresupuesto > 0 Then
ObjConta = New ClsContabilidad()
Else
ObjConta = New ClsContabilidad(transaccion)
End If
Dim CvePrePolizaPreSuPuesto = ObjConta.AddPrePolizas("OC/OC-(Presupuesto)", 53, LblTotal.Text.ToDecimal, LblTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CvePrePolizaPreSuPuesto > 0 Then
Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable() Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable()
Group row By Group row By
@@ -9219,37 +9188,28 @@ Partial Class OC_OC
For Each item In EnumAgrupado For Each item In EnumAgrupado
Dim SerieFolio = $"OC: {Folio}, Clasificación: {item.Clasificacion}" Dim SerieFolio = $"OC: {Folio}, Clasificación: {item.Clasificacion}"
Dim Multiplicador As Decimal = If(EsCancelacion, -1, 1)
Dim Importe As Decimal = item.TotalSum Dim Importe As Decimal = Multiplicador * item.TotalSum
Dim ImporteME As Decimal = If(CveMonedaPresupuesto = 1, 0, item.TotalSum) Dim ImporteME As Decimal = Multiplicador * If(CveMonedaPresupuesto = 1, 0, item.TotalSum)
Dim ImporteMN As Decimal = If(CveMonedaPresupuesto = 1, item.TotalSum, item.TotalSum * TC) Dim ImporteMN As Decimal = Multiplicador * If(CveMonedaPresupuesto = 1, item.TotalSum, item.TotalSum * TC)
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, False, Importe, ImporteMN, 154, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPresupuesto, False, Importe, ImporteMN, 154, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then
Respuesta = False Respuesta = False : Exit For
Exit For
End If End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPresupuesto, True, Importe, ImporteMN, 152, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, True, Importe, ImporteMN, 152, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then Respuesta = False : Exit For
Respuesta = False
Exit For
End If End If
Next Next
Else Else
Respuesta = False Respuesta = False
End If End If
End If End If
Return Respuesta Return Respuesta
End Function End Function
#End Region #End Region

View File

@@ -302,21 +302,27 @@ Partial Class Portal_PortalProveedor
#Region "C A R G A - D A T O S" #Region "C A R G A - D A T O S"
Protected Sub CargaDatos() Protected Sub CargaDatos()
GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimero($"CveProveedor = {CveProveedor}") Dim drp As DataRow = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimero($"CveProveedor = {CveProveedor}")
Dim ObjProveedor As New ClsCompProveedores()
If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", 1, UsuarioActual.CveEmpresa) Then
If ObjProveedor.DtResultados.Rows.Count > 0 Then
'CxP If drp IsNot Nothing Then
LtlProveedor.Text = ObjProveedor.RazonSocial LtlProveedor.Text = drp("RazonSocial").ToString
lblLimiteCredito.Text = ObjProveedor.LimiteCredito.ToString lblLimiteCredito.Text = drp("LimiteCredito").ToString.ToDecimal.FormatoNumero
lblPlazoCobranza.Text = ObjProveedor.PlazoPago.ToString lblPlazoCobranza.Text = drp("PlazoPago").ToString
End If
'Dim ObjProveedor As New ClsCompProveedores()
'If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", "-1", "-1", "-1", 1, UsuarioActual.CveEmpresa) Then
' If ObjProveedor.DtResultados.Rows.Count > 0 Then
Else ' 'CxP
Alert("Ocurrió un error al cargar los datos.", TipoMensaje.MsgError) ' LtlProveedor.Text = ObjProveedor.RazonSocial
End If ' lblLimiteCredito.Text = ObjProveedor.LimiteCredito.ToString
End If ' lblPlazoCobranza.Text = ObjProveedor.PlazoPago.ToString
ObjProveedor.Dispose()
' Else
' Alert("Ocurrió un error al cargar los datos.", TipoMensaje.MsgError)
' End If
'End If
'ObjProveedor.Dispose()
End Sub End Sub

View File

@@ -14,16 +14,16 @@ var NotificacionesADS = function () {
if (Notification.permission !== 'denied') { if (Notification.permission !== 'denied') {
Notification.requestPermission(function (permission) { Notification.requestPermission(function (permission) {
// If the user accepts, let's create a notification // If the user accepts, let's create a notification
//if (permission === "granted") { if (permission === "granted") {
//} }
}); });
} }
} }
} }
//-------------------------------------------------------------------- Eventos ---------------------------------------------------------------------- //-------------------------------------------------------------------- Eventos ----------------------------------------------------------------------
var AlertaVentana = function (Titulo, Mensaje, Tipo, timeoutseconds, Opciones) { var AlertaVentana = function (Titulo, Mensaje, Tipo, timeoutseconds) {
console.log(Mensaje); console.log(Mensaje);
let obj = { metodo: "AlertaVentana", titulo: Titulo, mensaje: Mensaje, timeout: timeoutseconds, tipo: Tipo, opciones: Opciones, tick: (new Date()).getTime() }; let obj = { metodo: "AlertaVentana", titulo: Titulo, mensaje: Mensaje, timeout: timeoutseconds, tipo: Tipo, tick: (new Date()).getTime() };
let myjson = JSON.stringify(obj); let myjson = JSON.stringify(obj);
localStorage.setItem("ADSNotificaciones", myjson); localStorage.setItem("ADSNotificaciones", myjson);
execAlertaVentana(obj); execAlertaVentana(obj);
@@ -117,11 +117,11 @@ var NotificacionesADS = function () {
var proxy = $.connection.notificaciones; var proxy = $.connection.notificaciones;
/*$.connection.hub.url = '/signalr';*/ /*$.connection.hub.url = '/signalr';*/
$.connection.hub.disconnected(function () { $.connection.hub.disconnected(function () {
console.log(' (SignalR) diconnected'); console.log(' (SignalR) disconnected');
signalrconectionStar(1200); signalrconectionStar(1200);
}); });
proxy.client.AlertaVentana = AlertaVentana; proxy.client.alertaVentana = AlertaVentana;
proxy.client.Execstring = Execstring; proxy.client.Execstring = Execstring;
@@ -139,7 +139,7 @@ var NotificacionesADS = function () {
nointentos = nointentos + 1; nointentos = nointentos + 1;
if (nointentos < maxintentos) { if (nointentos < maxintentos) {
$.connection.hub.start().done(function () { console.log('(SignalR)Bienvenido'); nointentos = 0; }) $.connection.hub.start().done(function () { console.log('(SignalR)Bienvenido'); nointentos = 0; })
.fail(function () { console.log(' (SignalR) no conectado (Intento:' + nointentos + ')'); signalrconectionStar(12000); }); .fail(function () { console.log(' (SignalR) no conectado (Intento:' + nointentos + ')'); signalrconectionStar(1200); });
} }
}, TimeOut); }, TimeOut);
} }

View File

@@ -27,7 +27,7 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
'Dim DtEmp As DataTable = GlobalDTEmpresas.Copy 'Dim DtEmp As DataTable = GlobalDTEmpresas.Copy
Dim NombreEmp As String = UsuarioActual.Empresa.Empresa Dim NombreEmp As String = UsuarioActual.Empresa.Empresa
'''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)" ''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)"
''If UsuarioActual.CveUsuario = 100 Then ''If UsuarioActual.CveUsuario = 100 Then
'' Dim customerRow() As Data.DataRow '' Dim customerRow() As Data.DataRow
@@ -92,8 +92,25 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
tUsuario = gvr.DataKey("Usuario").ToString tUsuario = gvr.DataKey("Usuario").ToString
tContraseña = gvr.DataKey("Contraseña").ToString tContraseña = gvr.DataKey("Contraseña").ToString
tCveEmpresa = gvr.DataKey("CveEmpresa").ToString.ToEntero tCveEmpresa = gvr.DataKey("CveEmpresa").ToString.ToEntero
Dim tGrupoEmpresa As String = ""
Dim NombreCadena As String = "Conexion"
Dim ObjUsuario As New ClsSisUsuarios If Request.Url.Host.ToUpper().Contains("EMD".ToUpper()) Then tGrupoEmpresa = "EMD"
If Request.Url.Host.ToUpper().Contains("BDH".ToUpper()) Then tGrupoEmpresa = "BDH"
If Request.Url.Host.ToUpper().Contains("ECONOLLANTAS".ToUpper()) Then tGrupoEmpresa = "ECONOLLANTAS" : NombreCadena = "Conexion"
If Request.Url.Host.ToUpper().Contains("JAM".ToUpper()) Then tGrupoEmpresa = "JAM"
If Request.Url.Host.ToUpper().Contains("CITRUS".ToUpper()) Then tGrupoEmpresa = "CITRUS"
If Request.Url.Host.ToUpper().Contains("KINO".ToUpper()) Then tGrupoEmpresa = "KINO"
If Request.Url.Host.ToUpper().Contains("VSH".ToUpper()) Then tGrupoEmpresa = "VSH"
If Request.Url.Host.ToUpper().Contains("AJAM".ToUpper()) Then tGrupoEmpresa = "AJAM"
If Request.Url.Host.ToUpper().Contains("ALATEL".ToUpper()) Then tGrupoEmpresa = "ALATEL"
If Request.Url.Host.ToUpper().Contains("SERVEC".ToUpper()) Then tGrupoEmpresa = "SERVEC"
If Request.Url.Host.ToUpper().Contains("SMS".ToUpper()) Then tGrupoEmpresa = "SMS"
If Request.Url.Host.ToUpper().Contains("VYA".ToUpper()) Then tGrupoEmpresa = "VYA"
If Request.Url.Host.ToUpper().Contains("GRUPODIAZ".ToUpper()) Then tGrupoEmpresa = "GRUPODIAZ"
If Request.Url.Host.ToUpper().Contains("FERRETERA".ToUpper()) Then tGrupoEmpresa = "FERRETERA"
Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
Dim Usuario As Usuario Dim Usuario As Usuario
'Dim UsuarioAsignaciones As Usuario 'Dim UsuarioAsignaciones As Usuario

View File

@@ -60,9 +60,25 @@ Partial Class PopUpSeleccionarEmpresa
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow) Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
If gvr IsNot Nothing Then If gvr IsNot Nothing Then
Dim tGrupoEmpresa As String = ""
Dim ObjUsuario As New ClsSisUsuarios Dim NombreCadena As String = "Conexion"
Dim Usuario As Usuario = Nothing Dim Usuario As Usuario = Nothing
If Request.Url.Host.ToUpper().Contains("EMD".ToUpper()) Then tGrupoEmpresa = "EMD"
If Request.Url.Host.ToUpper().Contains("BDH".ToUpper()) Then tGrupoEmpresa = "BDH"
If Request.Url.Host.ToUpper().Contains("ECONOLLANTAS".ToUpper()) Then tGrupoEmpresa = "ECONOLLANTAS" : NombreCadena = "Conexion"
If Request.Url.Host.ToUpper().Contains("JAM".ToUpper()) Then tGrupoEmpresa = "JAM"
If Request.Url.Host.ToUpper().Contains("CITRUS".ToUpper()) Then tGrupoEmpresa = "CITRUS"
If Request.Url.Host.ToUpper().Contains("KINO".ToUpper()) Then tGrupoEmpresa = "KINO"
If Request.Url.Host.ToUpper().Contains("VSH".ToUpper()) Then tGrupoEmpresa = "VSH"
If Request.Url.Host.ToUpper().Contains("AJAM".ToUpper()) Then tGrupoEmpresa = "AJAM"
If Request.Url.Host.ToUpper().Contains("ALATEL".ToUpper()) Then tGrupoEmpresa = "ALATEL"
If Request.Url.Host.ToUpper().Contains("SERVEC".ToUpper()) Then tGrupoEmpresa = "SERVEC"
If Request.Url.Host.ToUpper().Contains("SMS".ToUpper()) Then tGrupoEmpresa = "SMS"
If Request.Url.Host.ToUpper().Contains("VYA".ToUpper()) Then tGrupoEmpresa = "VYA"
If Request.Url.Host.ToUpper().Contains("GRUPODIAZ".ToUpper()) Then tGrupoEmpresa = "GRUPODIAZ"
If Request.Url.Host.ToUpper().Contains("FERRETERA".ToUpper()) Then tGrupoEmpresa = "FERRETERA"
Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
Usuario = ObjUsuario.ValidaUsuario(gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"), CveEmpresa:=gvr.DataKey("CveEmpresa").ToEntero) Usuario = ObjUsuario.ValidaUsuario(gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"), CveEmpresa:=gvr.DataKey("CveEmpresa").ToEntero)
ObjUsuario.Dispose() ObjUsuario.Dispose()
@@ -138,9 +154,25 @@ Partial Class PopUpSeleccionarEmpresa
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow) Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
If gvr IsNot Nothing Then If gvr IsNot Nothing Then
Dim tGrupoEmpresa As String = ""
Dim ObjUsuario As New ClsSisUsuarios Dim NombreCadena As String = "Conexion"
Dim Usuario As Usuario = Nothing Dim Usuario As Usuario = Nothing
If Request.Url.Host.ToUpper().Contains("EMD".ToUpper()) Then tGrupoEmpresa = "EMD"
If Request.Url.Host.ToUpper().Contains("BDH".ToUpper()) Then tGrupoEmpresa = "BDH"
If Request.Url.Host.ToUpper().Contains("ECONOLLANTAS".ToUpper()) Then tGrupoEmpresa = "ECONOLLANTAS" : NombreCadena = "Conexion"
If Request.Url.Host.ToUpper().Contains("JAM".ToUpper()) Then tGrupoEmpresa = "JAM"
If Request.Url.Host.ToUpper().Contains("CITRUS".ToUpper()) Then tGrupoEmpresa = "CITRUS"
If Request.Url.Host.ToUpper().Contains("KINO".ToUpper()) Then tGrupoEmpresa = "KINO"
If Request.Url.Host.ToUpper().Contains("VSH".ToUpper()) Then tGrupoEmpresa = "VSH"
If Request.Url.Host.ToUpper().Contains("AJAM".ToUpper()) Then tGrupoEmpresa = "AJAM"
If Request.Url.Host.ToUpper().Contains("ALATEL".ToUpper()) Then tGrupoEmpresa = "ALATEL"
If Request.Url.Host.ToUpper().Contains("SERVEC".ToUpper()) Then tGrupoEmpresa = "SERVEC"
If Request.Url.Host.ToUpper().Contains("SMS".ToUpper()) Then tGrupoEmpresa = "SMS"
If Request.Url.Host.ToUpper().Contains("VYA".ToUpper()) Then tGrupoEmpresa = "VYA"
If Request.Url.Host.ToUpper().Contains("GRUPODIAZ".ToUpper()) Then tGrupoEmpresa = "GRUPODIAZ"
If Request.Url.Host.ToUpper().Contains("FERRETERA".ToUpper()) Then tGrupoEmpresa = "FERRETERA"
Dim ObjUsuario As New ClsSisUsuarios(NombreCadena:=NombreCadena)
Usuario = ObjUsuario.ValidaUsuarioPortalProveedor(gvr.DataKey("CveProveedor").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña")) Usuario = ObjUsuario.ValidaUsuarioPortalProveedor(gvr.DataKey("CveProveedor").ToEntero(), gvr.DataKey("Usuario"), gvr.DataKey("Contraseña"))
ObjUsuario.Dispose() ObjUsuario.Dispose()

View File

@@ -1,4 +1,4 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="SessionesActivas.aspx.vb" Inherits="SessionesActivas" %> <%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="SessionesActivas.aspx.vb" Inherits="SessionesActivas" EnableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -1,6 +1,7 @@
 
Imports System.Data Imports System.Data
Imports Extensiones Imports Extensiones
Imports Microsoft.AspNet.SignalR
Partial Class SessionesActivas Partial Class SessionesActivas
Inherits System.Web.UI.Page Inherits System.Web.UI.Page
@@ -190,10 +191,9 @@ Partial Class SessionesActivas
End Sub End Sub
Protected Sub LnkEnviar_Click(sender As Object, e As EventArgs) Protected Sub LnkEnviar_Click(sender As Object, e As EventArgs)
Dim lista As New List(Of String) Dim mensaje = TxtMensaje.Text.Trim() + "<br/> <a target='_blank' href='https://www.w3schools.com'>Liga</a>"
lista.Add(RCveUsuario) ClsSisNotificaciones.EnviarAlerta("Aviso", mensaje, RCveUsuario, Tipo:=TipoNotificacion.ToastInformacionB)
'Notificaciones.AlertaVentana(TxtMensaje.Text, lista)
Notificaciones.AlertaVentana(TxtMensaje.Text, lista, timeoutseconds:=0)
RegistraScript($"$(""#DivMensaje"").modal('hide');console.log('{Decripta(Context.User.Identity.Name)}')") RegistraScript($"$(""#DivMensaje"").modal('hide');console.log('{Decripta(Context.User.Identity.Name)}')")
End Sub End Sub

View File

@@ -1384,8 +1384,10 @@ Partial Class Sistemas_UsuarioDetalle
GlobalDTAlmacenUsuarios(-1, tCveEmpresa) = Nothing GlobalDTAlmacenUsuarios(-1, tCveEmpresa) = Nothing
GlobalDTUsuarioResponsable(tCveEmpresa) = Nothing GlobalDTUsuarioResponsable(tCveEmpresa) = Nothing
GlobalDTUsuarios(CveEmpresa:=tCveEmpresa) = Nothing GlobalDTUsuarios(CveEmpresa:=tCveEmpresa) = Nothing
GlobalDTUsuarios(CveEmpresa:=-1) = Nothing GlobalDTUsuarios(CveEmpresa:=tCveEmpresa) = Nothing
'si hay diferencia en la empresa asignada y la asociada.
If tCveEmpresa <> DdlEmpresa.SelectedValue.ToEntero Then GlobalDTUsuarios(CveEmpresa:=DdlEmpresa.SelectedValue.ToEntero) = Nothing
'If ObjUsuarios.GetUsuariosEmpresas(-1, UsuarioActual.CveEmpresa) Then 'If ObjUsuarios.GetUsuariosEmpresas(-1, UsuarioActual.CveEmpresa) Then
' Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados ' Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados
@@ -1733,7 +1735,14 @@ Partial Class Sistemas_UsuarioDetalle
Dim ClsUsuarios As New ClsSisUsuarios Dim ClsUsuarios As New ClsSisUsuarios
If ClsUsuarios.GetSubProyectos(CveUsuario) Then If ClsUsuarios.GetSubProyectos(CveUsuario) Then
DtSubProyectos = ClsUsuarios.DtResultados DtSubProyectos = ClsUsuarios.DtResultados
If Not CveUsuario > 0 Then
DtSubProyectos.Rows.Clear()
DtSubProyectos.AcceptChanges()
End If
Else Else
DtSubProyectos = Nothing DtSubProyectos = Nothing
Alert("Ocurrió un Error al cargar los SubProyectos del Usuario. Por favor vuelva a intentar", TipoMensaje.MsgError) Alert("Ocurrió un Error al cargar los SubProyectos del Usuario. Por favor vuelva a intentar", TipoMensaje.MsgError)
@@ -2255,7 +2264,14 @@ Partial Class Sistemas_UsuarioDetalle
DdlCuentasBancarias.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlCuentasBancarias.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub End Sub
Private Sub CargaDtCuentasBancarias() Private Sub CargaDtCuentasBancarias()
DtCuentasBancarias = GlobalDTBancosCuentas(CveUsuario, -1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}") DtCuentasBancarias = GlobalDTBancosCuentas(CveUsuario, -1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}")
If Not CveUsuario > 0 Then
DtCuentasBancarias.Rows.Clear()
DtCuentasBancarias.AcceptChanges()
End If
DtCuentasBancarias.Columns.Add("Accion", GetType(Integer)) DtCuentasBancarias.Columns.Add("Accion", GetType(Integer))
CargaGvCuentasBancarias() CargaGvCuentasBancarias()

View File

@@ -62,7 +62,7 @@ Partial Class RepContratosCalendario
Private Sub CargaCronograma(Optional TipoVista As Integer = -1) Private Sub CargaCronograma(Optional TipoVista As Integer = -1)
If DtAvance IsNot Nothing Then If DtAvance IsNot Nothing Then
Dim DtUnidades As DataTable = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> '' AND MedidaVehicular IN (2,3)", " SubTipoActivoFijo DESC ", {"Codigo", "CveActivoFijo"}) Dim DtUnidades As DataTable = GlobalDTActivoFijos(UsuarioActual.CveEmpresa).FiltraParametros("Codigo <> '' AND MedidaVehicular IN (2,3)", Orderby:=" SubTipoActivoFijo DESC, CodigoNumeroOrden ASC", DistinctColumns:={"Codigo", "CveActivoFijo"})
'For Each Row As DataRow In DtAvance.Rows 'For Each Row As DataRow In DtAvance.Rows
' If String.IsNullOrEmpty(Row("CodigoAF").ToString()) Then ' If String.IsNullOrEmpty(Row("CodigoAF").ToString()) Then

View File

@@ -147,11 +147,13 @@
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPeriodoPago" CssClass="form-control select2me" runat="server" Width="100%"> <asp:DropDownList ID="DdlPeriodoPago" CssClass="form-control select2me" runat="server" Width="100%">
<asp:ListItem Value="-1">-</asp:ListItem> <asp:ListItem Value="-1">-</asp:ListItem>
<asp:ListItem Value="1">Mensual</asp:ListItem> <asp:ListItem Value="1">15d próximo mes</asp:ListItem>
<asp:ListItem Value="2">Quincenal</asp:ListItem> <asp:ListItem Value="2">15d próxima quincena</asp:ListItem>
<asp:ListItem Value="3">Semanal</asp:ListItem> <asp:ListItem Value="3">7d pago inmediato 2d</asp:ListItem>
<asp:ListItem Value="4">15d pago inmediato</asp:ListItem>
<asp:ListItem Value="5">30d próxima quincena</asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<label for="<%= DdlPeriodoPago.ClientID.ToString()%>">Perido de Pago:</label> <label for="<%= DdlPeriodoPago.ClientID.ToString()%>">Periodo de Pago:</label>
</div> </div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">

View File

@@ -17,9 +17,7 @@
<li> <li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink> <asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink>
</li> </li>
<%--<li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivCorporativo" ID="HyperLink1" runat="server"> <i class="fa fa-building"></i> Agregar Corporativo</asp:HyperLink>
</li>--%>
<li> <li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivUnificarCliente" ID="ImgUnificar" runat="server" Visible="false"> <i class="fa fa-pencil"></i> Unificar Clientes</asp:HyperLink> <asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivUnificarCliente" ID="ImgUnificar" runat="server" Visible="false"> <i class="fa fa-pencil"></i> Unificar Clientes</asp:HyperLink>
</li> </li>
@@ -35,28 +33,27 @@
<ContentTemplate> <ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter"> <div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT portletfiltrostitlee"> <div class="portlet-title portlet-filterT smalltitle">
<div class="tools"> <div class="tools">
<asp:Button ID="LbFiltrar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Consultar" ValidationGroup="GrpFiltrar"></asp:Button> <asp:Button ID="LbFiltrar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Consultar" ValidationGroup="GrpFiltrar"></asp:Button>
<a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a> <a href="javascript;" data-idchekbox="<%= chkexpand.ClientID%>" class=" <%= IIf(chkexpand.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" /> <asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div> </div>
<div class="titlefiltros caption "> <div class="titlefiltros caption ">
<div class="row"> <div class="row" style="height: 32px;">
<div class="col-md-1" style="font-size: medium; max-width: 100px!important">Nombre:</div>
<div class="col-md-2 " style="max-width: 283px!important"> <div class="col-md-1 truncate" >Nombre:</div>
<div class="col-md-2 truncate" style="max-width: 283px!important">
<asp:TextBox ID="TxtNombre" runat="server" Style="display: inline-block;" CssClass=" form-control input-sm select2me" CausesValidation="true" MaxLength="30" ValidationGroup="GrpFiltrar" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtNombre" runat="server" Style="display: inline-block;" CssClass=" form-control input-sm select2me" CausesValidation="true" MaxLength="30" ValidationGroup="GrpFiltrar" Width="100%"></asp:TextBox>
</div> </div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">RFC:</div> <div class="col-md-1 truncate" >RFC:</div>
<div class=" col-md-2 " style="max-width: 283px!important"> <div class=" col-md-2 truncate" style="max-width: 283px!important">
<asp:TextBox ID="TxtRFC" runat="server" Style="display: inline-block;" CssClass=" form-control input-sm select2me" CausesValidation="true" MaxLength="40" ValidationGroup="GrpFiltrar" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtRFC" runat="server" Style="display: inline-block;" CssClass=" form-control input-sm select2me" CausesValidation="true" MaxLength="40" ValidationGroup="GrpFiltrar" Width="100%"></asp:TextBox>
</div> </div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Estatus:</div> <div class="col-md-1 truncate" >Estatus:</div>
<div class=" col-md-2 " style="max-width: 283px!important"> <div class=" col-md-1 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlEstatus" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%"> <asp:DropDownList ID="DdlEstatus" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
<asp:ListItem Value="-1">Todos</asp:ListItem> <asp:ListItem Value="-1">Todos</asp:ListItem>
<asp:ListItem Selected="True" Value="1">Activo</asp:ListItem> <asp:ListItem Selected="True" Value="1">Activo</asp:ListItem>
@@ -64,8 +61,19 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1"> <%--<div class="col-md-1">
<asp:CheckBox runat="server" ID ="ChkPermiteCredito" CssClass="md-checksd" Text="Permite Crédito" /> <asp:CheckBox runat="server" ID ="ChkPermiteCredito" CssClass="md-checksd" Text="Permite Crédito" />
</div>--%>
<div class="col-md-1 truncate">
Permite Crédito:
</div>
<div class="col-md-1 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlPermiteCredito" runat="server" CssClass=" form-control input-sm select2me" Width="100%">
<asp:ListItem Selected="True" Value="-1">Todos</asp:ListItem>
<asp:ListItem Value="1">Si</asp:ListItem>
<asp:ListItem Value="0">No</asp:ListItem>
</asp:DropDownList>
</div> </div>
</div> </div>
@@ -75,18 +83,18 @@
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>> <div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row"> <div class="row">
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Sucursal:</div> <div class="col-md-1 truncate" >Sucursal:</div>
<div class=" col-md-2 " style="max-width: 283px!important"> <div class=" col-md-2 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlSubProyecto" runat="server" DataValueField="CveSubProyecto" DataTextField="SubProyecto" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%"> <asp:DropDownList ID="DdlSubProyecto" runat="server" DataValueField="CveSubProyecto" DataTextField="SubProyecto" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Clasif:</div> <div class="col-md-1 truncate" >Clasificación:</div>
<div class=" col-md-2 " style="max-width: 283px!important"> <div class=" col-md-2 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlClasificaciones" runat="server" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%"> <asp:DropDownList ID="DdlClasificaciones" runat="server" DataValueField="CveClienteClasificacion" DataTextField="ClienteClasificacion" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Tipo:</div> <div class="col-md-1 truncate" >Tipo:</div>
<div class=" col-md-2 " style="max-width: 283px!important"> <div class=" col-md-1 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlTipoCliente" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%"> <asp:DropDownList ID="DdlTipoCliente" runat="server" CssClass=" form-control input-sm select2me" ValidationGroup="GrpFiltrar" Width="100%">
<asp:ListItem Value="-1">Todos</asp:ListItem> <asp:ListItem Value="-1">Todos</asp:ListItem>
<asp:ListItem Selected="True" Value="1">Frecuente</asp:ListItem> <asp:ListItem Selected="True" Value="1">Frecuente</asp:ListItem>
@@ -94,10 +102,10 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-1 truncate" style="font-size: medium; max-width: 100px!important"> <div class="col-md-1 truncate" >
Vendedor: Vendedor:
</div> </div>
<div class="col-md-2 " style="max-width: 283px!important"> <div class="col-md-2 truncate" style="max-width: 283px!important">
<asp:DropDownList ID="DdlVendedor" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" ValidationGroup="GrpFiltrar" CssClass=" form-control input-sm select2me" Width="100%"> <asp:DropDownList ID="DdlVendedor" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" ValidationGroup="GrpFiltrar" CssClass=" form-control input-sm select2me" Width="100%">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
@@ -105,6 +113,7 @@
</div> </div>
</div> </div>
</div> </div>
@@ -121,8 +130,9 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="portlet-body">
<table class="table table-striped" style="border: 1px solid #D3D3D3; min-width: 985px; width: 100%; display: none;">
<%-- <table class="table table-striped" style="border: 1px solid #D3D3D3; min-width: 985px; width: 100%; display: none;">
<thead> <thead>
<tr class="Titulos"> <tr class="Titulos">
<th width="100px"> <th width="100px">
@@ -175,12 +185,13 @@
</th> </th>
</tr> </tr>
</thead> </thead>
</table> </table>--%>
<div style=""> <div class="row">
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Clientes registrados" ShowHeader="true" <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Clientes registrados" ShowHeader="true"
DataKeyNames="FechaLimiteCredito" DataKeyNames="FechaLimiteCredito"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None"> CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None">
<Columns> <Columns>
<asp:TemplateField Visible="true" ItemStyle-Width="100" HeaderText="Código"> <asp:TemplateField Visible="true" ItemStyle-Width="100" HeaderText="Código">
<ItemTemplate> <ItemTemplate>
@@ -319,13 +330,6 @@
<ItemStyle HorizontalAlign="Right" /> <ItemStyle HorizontalAlign="Right" />
</asp:TemplateField> </asp:TemplateField>
<%--<asp:TemplateField Visible="false">
<HeaderTemplate>CIE</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCIE" runat="server" Text='<%# Eval("ConvenioCIE") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Calle</HeaderTemplate> <HeaderTemplate>Calle</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
@@ -350,22 +354,31 @@
<asp:Literal ID="LtlOtroTelefono" runat="server" Text='<%# Eval("TelefonoOtros") %>'></asp:Literal> <asp:Literal ID="LtlOtroTelefono" runat="server" Text='<%# Eval("TelefonoOtros") %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField Visible="true" ItemStyle-HorizontalAlign="center" ItemStyle-Width="100px">
<HeaderTemplate>Permite Crédito</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPermiteCredito" runat="server" Text='<%# Eval("PermiteCreditoStr") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="true" ItemStyle-HorizontalAlign="center" ItemStyle-Width="100px"> <asp:TemplateField Visible="true" ItemStyle-HorizontalAlign="center" ItemStyle-Width="100px">
<HeaderTemplate>F Limite Crédito</HeaderTemplate> <HeaderTemplate>F Limite Crédito</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlFechaLimiteCredito" runat="server"></asp:Literal> <asp:Literal ID="LtlFechaLimiteCredito" runat="server"></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView> </asp:GridView>
</div> </div>
</div>
<asp:UpdatePanel ID="UPPersonalizar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivPersonalizar" class="modal fade" role="dialog"> <div id="DivPersonalizar" class="modal fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
@@ -454,28 +467,43 @@
<asp:CheckBox ID="ChkOtroTelefono" runat="server" Text="Otro Telefono" /></td> <asp:CheckBox ID="ChkOtroTelefono" runat="server" Text="Otro Telefono" /></td>
</tr> </tr>
<tr> <tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkPermiteCredito" runat="server" Checked="true" Text="Permite Crédito" /></td>
<td style="text-align: left"> <td style="text-align: left">
<asp:CheckBox ID="chkFechaLimiteCredito" runat="server" Checked="true" Text="Fecha Limite Crédito" /></td> <asp:CheckBox ID="chkFechaLimiteCredito" runat="server" Checked="true" Text="Fecha Limite Crédito" /></td>
<td style="text-align: left">
</td> <td style="text-align: left"></td>
<td style="text-align: left"> <td style="text-align: left"></td>
</td>
<td style="text-align: left">
</td>
</tr> </tr>
</thead> </thead>
</table> </table>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<div class="row">
<div class="col-md-6" style="text-align: left">
<asp:CheckBox ID="ChkGuardarPersonalizacion" runat="server" Text=" Guarda Personalización" TextAlign="Right" />
</div>
<div class="col-md-6">
<%--<button type="button" class="btn btn-success" data-dismiss="modal" onclick="$('#BtnPersonalizar').click();">Personalizar</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>--%>
<asp:Button ID="BtnPersonalizar" runat="server" Text="Personalizar" class="btn btn-success" /> <asp:Button ID="BtnPersonalizar" runat="server" Text="Personalizar" class="btn btn-success" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivUnificarCliente" class="modal ADS fade" role="dialog"> <div id="DivUnificarCliente" class="modal ADS fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<asp:UpdatePanel ID="UpUnificar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpUnificar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
@@ -553,7 +581,7 @@
</asp:Panel> </asp:Panel>
<%-- FIN OC X SURTIR --%>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -41,6 +41,10 @@ Partial Class CatClientes
Me.Form.DefaultButton = LbFiltrar.UniqueID Me.Form.DefaultButton = LbFiltrar.UniqueID
CargaPersonalizacion()
End If End If
End Sub End Sub
@@ -55,7 +59,10 @@ Partial Class CatClientes
If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.Text.Trim If TxtRFC.Text.Trim <> String.Empty Then RFC = TxtRFC.Text.Trim
If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=If(ChkPermiteCredito.Checked, 1, -1)) Then 'If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=If(ChkPermiteCredito.Checked, 1, -1)) Then
If ObjClientes.GetClientes(-1, Nombre, "-1", "-1", RFC, "-1", "-1", DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Estatus:=DdlEstatus.SelectedValue.ToEntero, CveClienteClasificacion:=DdlClasificaciones.SelectedValue.ToEntero, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero, CveVendedor:=DdlVendedor.SelectedValue.ToEntero, PermiteCreditoFiltro:=DdlPermiteCredito.SelectedValue.ToEntero) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then If ObjClientes.DtResultados.Rows.Count > 0 Then
DTDatos = ObjClientes.DtResultados DTDatos = ObjClientes.DtResultados
Else Else
@@ -124,48 +131,7 @@ Partial Class CatClientes
End Sub End Sub
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
GvDatos.Columns(0).Visible = ChkCodigo.Checked
GvDatos.Columns(1).Visible = ChkNombre.Checked
GvDatos.Columns(2).Visible = ChkRFC.Checked
GvDatos.Columns(3).Visible = ChkSucursal.Checked
GvDatos.Columns(4).Visible = ChkTelefono.Checked
GvDatos.Columns(5).Visible = ChkVendedor.Checked
GvDatos.Columns(6).Visible = ChkEstadoSis.Checked
GvDatos.Columns(7).Visible = ChkFechaIng.Checked
GvDatos.Columns(8).Visible = ChkUsuario.Checked
GvDatos.Columns(9).Visible = ChkNombreCorto.Checked
' GvDatos.Columns(10).Visible = ChkVendedor.Checked
GvDatos.Columns(10).Visible = ChkNoExt.Checked
GvDatos.Columns(11).Visible = ChkNoInt.Checked
GvDatos.Columns(12).Visible = ChkColonia.Checked
GvDatos.Columns(13).Visible = ChkCiudad.Checked
GvDatos.Columns(14).Visible = ChkEstado.Checked
GvDatos.Columns(15).Visible = ChkPais.Checked
GvDatos.Columns(16).Visible = ChkCP.Checked
GvDatos.Columns(17).Visible = ChkContacto.Checked
GvDatos.Columns(18).Visible = ChkMail.Checked
GvDatos.Columns(19).Visible = ChkRecepcionFacturas.Checked
GvDatos.Columns(20).Visible = ChkRetIVA.Checked
GvDatos.Columns(21).Visible = ChkRetISR.Checked
GvDatos.Columns(22).Visible = ChkPlazoCobranza.Checked
GvDatos.Columns(23).Visible = ChkLimiteCredito.Checked
'GvDatos.Columns(24).Visible = ChkCIE.Checked
GvDatos.Columns(24).Visible = ChkCalle.Checked
GvDatos.Columns(25).Visible = ChkCelular.Checked
GvDatos.Columns(26).Visible = ChkCorreoCotizacion.Checked
GvDatos.Columns(27).Visible = ChkOtroTelefono.Checked
GvDatos.Columns(28).Visible = chkFechaLimiteCredito.Checked
CargaDatos()
UPDatos.Update()
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
@@ -302,7 +268,359 @@ Partial Class CatClientes
#Region "P E R S O N A L I Z A R"
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
If ChkGuardarPersonalizacion.Checked Then
GuardaPersonalizacion()
End If
Personaliza()
End Sub
Private Sub GuardaPersonalizacion()
Dim objUsuario As New ClsSisUsuarios
Dim ListPersonalizada As New List(Of String)
If ChkCodigo.Checked Then
ListPersonalizada.Add("Codigo")
End If
If ChkNombre.Checked Then
ListPersonalizada.Add("Nombre")
End If
If ChkRFC.Checked Then
ListPersonalizada.Add("RFC")
End If
If ChkSucursal.Checked Then
ListPersonalizada.Add("Sucursal")
End If
If ChkTelefono.Checked Then
ListPersonalizada.Add("Telefono")
End If
If ChkVendedor.Checked Then
ListPersonalizada.Add("Vendedor")
End If
If ChkEstadoSis.Checked Then
ListPersonalizada.Add("EstadoSis")
End If
If ChkFechaIng.Checked Then
ListPersonalizada.Add("FechaIng")
End If
If ChkUsuario.Checked Then
ListPersonalizada.Add("Usuario")
End If
If ChkNombreCorto.Checked Then
ListPersonalizada.Add("NombreCorto")
End If
If ChkNoExt.Checked Then
ListPersonalizada.Add("NoExt")
End If
If ChkNoInt.Checked Then
ListPersonalizada.Add("NoInt")
End If
If ChkColonia.Checked Then
ListPersonalizada.Add("Colonia")
End If
If ChkCiudad.Checked Then
ListPersonalizada.Add("Ciudad")
End If
If ChkEstado.Checked Then
ListPersonalizada.Add("Estado")
End If
If ChkPais.Checked Then
ListPersonalizada.Add("Pais")
End If
If ChkCP.Checked Then
ListPersonalizada.Add("CP")
End If
If ChkContacto.Checked Then
ListPersonalizada.Add("Contacto")
End If
If ChkMail.Checked Then
ListPersonalizada.Add("Mail")
End If
If ChkRecepcionFacturas.Checked Then
ListPersonalizada.Add("RecepcionFacturas")
End If
If ChkRetIVA.Checked Then
ListPersonalizada.Add("RetIVA")
End If
If ChkRetISR.Checked Then
ListPersonalizada.Add("RetISR")
End If
If ChkPlazoCobranza.Checked Then
ListPersonalizada.Add("PlazoCobranza")
End If
If ChkLimiteCredito.Checked Then
ListPersonalizada.Add("LimiteCredito")
End If
'If ChkCIE.Checked Then
' ListPersonalizada.Add("CIE")
'End If
If ChkCalle.Checked Then
ListPersonalizada.Add("Calle")
End If
If ChkCelular.Checked Then
ListPersonalizada.Add("Celular")
End If
If ChkCorreoCotizacion.Checked Then
ListPersonalizada.Add("CorreoCotizacion")
End If
If ChkOtroTelefono.Checked Then
ListPersonalizada.Add("OtroTelefono")
End If
If ChkPermiteCredito.Checked Then
ListPersonalizada.Add("PermiteCredito")
End If
If chkFechaLimiteCredito.Checked Then
ListPersonalizada.Add("FechaLimiteCredito")
End If
If objUsuario.AddUsuariosPersonalizaciones(UsuarioActual, "CatClientes.aspx", String.Join("|", ListPersonalizada)) Then
'Alert("Personalizacion guardada")
End If
objUsuario.Dispose()
End Sub
Private Sub CargaPersonalizacion()
Dim strBasePersonalizacion As String = UsuarioActual.Personalizaciones("CatClientes.aspx")
If strBasePersonalizacion.Trim.Length > 0 Then
ChkCodigo.Checked = False
ChkNombre.Checked = False
ChkRFC.Checked = False
ChkSucursal.Checked = False
ChkTelefono.Checked = False
ChkVendedor.Checked = False
ChkEstadoSis.Checked = False
ChkFechaIng.Checked = False
ChkUsuario.Checked = False
ChkNombreCorto.Checked = False
ChkVendedor.Checked = False
ChkNoExt.Checked = False
ChkNoInt.Checked = False
ChkColonia.Checked = False
ChkCiudad.Checked = False
ChkEstado.Checked = False
ChkPais.Checked = False
ChkCP.Checked = False
ChkContacto.Checked = False
ChkMail.Checked = False
ChkRecepcionFacturas.Checked = False
ChkRetIVA.Checked = False
ChkRetISR.Checked = False
ChkPlazoCobranza.Checked = False
ChkLimiteCredito.Checked = False
ChkCalle.Checked = False
ChkCelular.Checked = False
ChkCorreoCotizacion.Checked = False
ChkOtroTelefono.Checked = False
ChkPermiteCredito.Checked = False
chkFechaLimiteCredito.Checked = False
Dim Personalizaciones As String() = strBasePersonalizacion.Split("|"c)
For Each personalizacion As String In Personalizaciones
Select Case personalizacion
Case "Codigo"
ChkCodigo.Checked = True
Exit Select
Case "Nombre"
ChkNombre.Checked = True
Exit Select
Case "RFC"
ChkRFC.Checked = True
Exit Select
Case "Sucursal"
ChkSucursal.Checked = True
Exit Select
Case "Telefono"
ChkTelefono.Checked = True
Exit Select
Case "Vendedor"
ChkVendedor.Checked = True
Exit Select
Case "EstadoSis"
ChkEstadoSis.Checked = True
Exit Select
Case "FechaIng"
ChkFechaIng.Checked = True
Exit Select
Case "Usuario"
ChkUsuario.Checked = True
Exit Select
Case "NombreCorto"
ChkNombreCorto.Checked = True
Exit Select
Case "NoExt"
ChkNoExt.Checked = True
Exit Select
Case "NoInt"
ChkNoInt.Checked = True
Exit Select
Case "Colonia"
ChkColonia.Checked = True
Exit Select
Case "Ciudad"
ChkCiudad.Checked = True
Exit Select
Case "Estado"
ChkEstado.Checked = True
Exit Select
Case "Pais"
ChkPais.Checked = True
Exit Select
Case "CP"
ChkCP.Checked = True
Exit Select
Case "Contacto"
ChkContacto.Checked = True
Exit Select
Case "Mail"
ChkMail.Checked = True
Exit Select
Case "RecepcionFacturas"
ChkRecepcionFacturas.Checked = True
Exit Select
Case "RetIVA"
ChkRetIVA.Checked = True
Exit Select
Case "RetISR"
ChkRetISR.Checked = True
Exit Select
Case "PlazoCobranza"
ChkPlazoCobranza.Checked = True
Exit Select
Case "LimiteCredito"
ChkLimiteCredito.Checked = True
Exit Select
'Case "CIE"
' ChkCIE.Checked = True
' Exit Select
Case "Calle"
ChkCalle.Checked = True
Exit Select
Case "Celular"
ChkCelular.Checked = True
Exit Select
Case "CorreoCotizacion"
ChkCorreoCotizacion.Checked = True
Exit Select
Case "OtroTelefono"
ChkOtroTelefono.Checked = True
Exit Select
Case "PermiteCredito"
ChkPermiteCredito.Checked = True
Exit Select
Case "FechaLimiteCredito"
chkFechaLimiteCredito.Checked = True
Exit Select
Case Else
Exit Select
End Select
Next
Personaliza()
Else
PersonalizaDefault()
End If
UPPersonalizar.Update()
End Sub
Private Sub PersonalizaDefault()
End Sub
Private Sub Personaliza()
GvDatos.Columns(0).Visible = ChkCodigo.Checked
GvDatos.Columns(1).Visible = ChkNombre.Checked
GvDatos.Columns(2).Visible = ChkRFC.Checked
GvDatos.Columns(3).Visible = ChkSucursal.Checked
GvDatos.Columns(4).Visible = ChkTelefono.Checked
GvDatos.Columns(5).Visible = ChkVendedor.Checked
GvDatos.Columns(6).Visible = ChkEstadoSis.Checked
GvDatos.Columns(7).Visible = ChkFechaIng.Checked
GvDatos.Columns(8).Visible = ChkUsuario.Checked
GvDatos.Columns(9).Visible = ChkNombreCorto.Checked
' GvDatos.Columns(10).Visible = ChkVendedor.Checked
GvDatos.Columns(10).Visible = ChkNoExt.Checked
GvDatos.Columns(11).Visible = ChkNoInt.Checked
GvDatos.Columns(12).Visible = ChkColonia.Checked
GvDatos.Columns(13).Visible = ChkCiudad.Checked
GvDatos.Columns(14).Visible = ChkEstado.Checked
GvDatos.Columns(15).Visible = ChkPais.Checked
GvDatos.Columns(16).Visible = ChkCP.Checked
GvDatos.Columns(17).Visible = ChkContacto.Checked
GvDatos.Columns(18).Visible = ChkMail.Checked
GvDatos.Columns(19).Visible = ChkRecepcionFacturas.Checked
GvDatos.Columns(20).Visible = ChkRetIVA.Checked
GvDatos.Columns(21).Visible = ChkRetISR.Checked
GvDatos.Columns(22).Visible = ChkPlazoCobranza.Checked
GvDatos.Columns(23).Visible = ChkLimiteCredito.Checked
'GvDatos.Columns(24).Visible = ChkCIE.Checked
GvDatos.Columns(24).Visible = ChkCalle.Checked
GvDatos.Columns(25).Visible = ChkCelular.Checked
GvDatos.Columns(26).Visible = ChkCorreoCotizacion.Checked
GvDatos.Columns(27).Visible = ChkOtroTelefono.Checked
GvDatos.Columns(28).Visible = ChkPermiteCredito.Checked
GvDatos.Columns(29).Visible = chkFechaLimiteCredito.Checked
CargaDatos()
UPDatos.Update()
End Sub
#End Region
End Class End Class

View File

@@ -174,12 +174,6 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Utilidad" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="70px">
<ItemTemplate>
<asp:Literal ID="LtlUtilidad" runat="server" Text='<%# Eval("Utilidad", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Venta" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="70px"> <asp:TemplateField HeaderText="Venta" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="70px">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlSerieFolio" runat="server" Text='<%# Eval("SerieFolio") %>'></asp:Literal> <asp:Literal ID="LtlSerieFolio" runat="server" Text='<%# Eval("SerieFolio") %>'></asp:Literal>

View File

@@ -2301,6 +2301,12 @@
<asp:HyperLink ID="HLDevolverDinero" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-usd'></i>" runat="server" /> <asp:HyperLink ID="HLDevolverDinero" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-usd'></i>" runat="server" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Autorización" ItemStyle-HorizontalAlign="Center" Visible="false">
<ItemTemplate>
<asp:LinkButton ID="LnkAutorizar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" tooltip="Autorizar Anticipo" runat="server" OnClick="LnkAutorizarAnticipo_Click" />
<asp:LinkButton ID="LnkCancelar" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-ban'></i>" tooltip="Bloquear Anticipo" runat="server" OnClick="LnkCancelarAnticipo_Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>

View File

@@ -1874,6 +1874,11 @@ Partial Class Clientes
DtAnticipoHistorial = Nothing DtAnticipoHistorial = Nothing
End If End If
ObjMovtos.Dispose() ObjMovtos.Dispose()
If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) Then
GVAnticipos.Columns(7).Visible = True
End If
GVAnticipos.DataBind() GVAnticipos.DataBind()
GVAnticiposHistorial.DataBind() GVAnticiposHistorial.DataBind()
@@ -1889,7 +1894,6 @@ Partial Class Clientes
RegistraScript("OrdenarGVAnticiposHistorial();") RegistraScript("OrdenarGVAnticiposHistorial();")
End If End If
End Sub End Sub
Private Sub CargaOrdenesServiciosCliente() Private Sub CargaOrdenesServiciosCliente()
Dim ObjOS As New ClsOS Dim ObjOS As New ClsOS
@@ -2959,8 +2963,22 @@ Partial Class Clientes
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(185) = "1" AndAlso UsuarioActual.TienePermisoProceso(379) AndAlso CType(sender, GridView).ID = "GVAnticipos" Then
If e.Row.DBCampo("CveVenta").ToString().ToEntero() > 0 AndAlso e.Row.DBCampo("Tipo").ToString() = "Ant" Then
If Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
e.Row.FCLinkButton("LnkAutorizar").Visible = True
e.Row.FCLinkButton("LnkCancelar").Visible = False
Else
e.Row.FCLinkButton("LnkAutorizar").Visible = False
e.Row.FCLinkButton("LnkCancelar").Visible = True
End If
End If
End If
End If End If
End Sub End Sub
#End Region #End Region
#Region "R H" #Region "R H"
@@ -4234,7 +4252,8 @@ Partial Class Clientes
<b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA, FAVOR DE NO RESPONDERLO.</b>", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa) <b>ESTE CORREO SE GENERO EN FORMA AUTOMATICA, FAVOR DE NO RESPONDERLO.</b>", TxtNombreComercial.Text, UsuarioActual.Empresa.Empresa)
End If End If
Dim Hilo As New System.Threading.Thread(Sub() MandaCorreoEstadoCuenta(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Me.CveCliente, File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera en {UsuarioActual.Empresa.Empresa}", Cuerpo, GuardarBitacora:=True)) Dim tusuario As Usuario = UsuarioActual
Dim Hilo As New System.Threading.Thread(Sub() MandaCorreoEstadoCuenta(tusuario, UsuarioActual.CveEmpresa, Me.CveCliente, File, TxtCobranzaCorreo.Text, $"Estado Actual de Cartera en {UsuarioActual.Empresa.Empresa}", Cuerpo, GuardarBitacora:=True))
Hilo.Start() Hilo.Start()
Alert("El correo se envió con éxito", TipoMensaje.MsgInformacion) Alert("El correo se envió con éxito", TipoMensaje.MsgInformacion)
Catch ex As Exception Catch ex As Exception
@@ -4314,7 +4333,7 @@ Partial Class Clientes
End If End If
End If End If
End Sub End Sub
Private Sub MandaCorreoEstadoCuenta(CveUsuario As Integer, CveEmpresa As Integer, CveCliente As Integer, File As Byte(), Para As String, Asunto As String, Body As String, Optional GuardarBitacora As Boolean = False) Private Sub MandaCorreoEstadoCuenta(UsuarioActual As Usuario, CveEmpresa As Integer, CveCliente As Integer, File As Byte(), Para As String, Asunto As String, Body As String, Optional GuardarBitacora As Boolean = False)
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para) Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
'a.GuardaLog() 'a.GuardaLog()
@@ -4326,8 +4345,8 @@ Partial Class Clientes
Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail) Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
If Envio AndAlso GuardarBitacora Then If Envio AndAlso GuardarBitacora Then
Using ObjBitacora As New ClsOIEventos Using ObjBitacora As New ClsOIEventos(UsuarioActual:=UsuarioActual)
ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", CveUsuario, CveEmpresa, CveCliente:=CveCliente) ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, CveEmpresa, CveCliente:=CveCliente)
End Using End Using
End If End If
@@ -10691,6 +10710,31 @@ Partial Class Clientes
End Function End Function
Protected Sub LnkAutorizarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
If CveVenta > 0 Then
Using ObjVentas As New ClsVentas
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, True) Then
Alert("El anticipo se autorizó correctamente")
End If
End Using
CargaAnticipos()
End If
End Sub
Protected Sub LnkCancelarAnticipo_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveVenta As Integer = GvRow.DataKey("CveVenta").ToEntero()
If CveVenta > 0 Then
Using ObjVentas As New ClsVentas
If ObjVentas.UpdateVentaAnticipoAutorizado(CveVenta, False) Then
Alert("El anticipo se desautorizó correctamente")
End If
End Using
CargaAnticipos()
End If
End Sub
End Class End Class

View File

@@ -2057,8 +2057,8 @@ Partial Class Ventas_ClientesAbonar
Dim dtt As DataTable = Nothing Dim dtt As DataTable = Nothing
Dim Deudores As New ClsMovimientos Dim Deudores As New ClsMovimientos
If Deudores.GetDocumentosxPagarDetalle(CveCliente, tCveMoneda, 2, UsuarioActual.CveEmpresa) Then If Deudores.GetDocumentosxPagarDetalle(CveCliente, tCveMoneda, 2, UsuarioActual.CveEmpresa) Then
DdlPrestamo.DataSource = Deudores.DtResultados '.FiltraParametros("CveCliente > 0 AND Saldo > 0 AND CveIE > 0") dtt = Deudores.DtResultados.FiltraParametros("CveProveedor > 0 AND Saldo > 0 AND CveIE > 0", "FechaDocumento")
dtt = Deudores.DtResultados DdlPrestamo.DataSource = dtt
End If End If
Deudores.Dispose() Deudores.Dispose()

View File

@@ -200,6 +200,9 @@
<li> <li>
<asp:LinkButton ID="LkbRetiro" runat="server" OnClick="LkbRetiro_Click" Visible="false"> <i class="fa fa-ad-excel"></i> Retiro de Efectivo</asp:LinkButton> <asp:LinkButton ID="LkbRetiro" runat="server" OnClick="LkbRetiro_Click" Visible="false"> <i class="fa fa-ad-excel"></i> Retiro de Efectivo</asp:LinkButton>
</li> </li>
<li>
<asp:LinkButton ID="LnkCobrosEnTranscurso" runat="server" OnClick="LnkCobrosEnTranscurso_Click"><i class="fa fa-money"></i> Cobros en Transcurso</asp:LinkButton>
</li>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</asp:Content> </asp:Content>
@@ -952,6 +955,46 @@
</div> </div>
<div id="DVModalCobrosEnTranscurso" class="modal ADS fade" role="dialog">
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpDVModalCobrosEnTranscurso" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<h4 class="modal-title">
<asp:Label ID="Label1" runat="server">Cobros en Transcurso</asp:Label>
</h4>
</div>
<div class="modal-body">
<asp:GridView ID="GvModalCobrosEnTranscurso" runat="server" AutoGenerateColumns="False" Width="100%"
EmptyDataText="Cobros en Transcursos" data-sort="true" ToolTip="Cobros en Transcurso"
CssClass="ScrollAD table table-striped table-hover Widthall mysmallbtn" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None"
DataKeyNames="CveVenta,TipoDocto,Saldo,AtencionA,CveFormaPago33,SerieFolio">
<Columns>
<asp:BoundField HeaderText="Atención" DataField="AtencionA" />
<asp:HyperLinkField HeaderText="Folio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="SerieFolio" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Fecha/Hora" DataField="Fecha" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Importe" DataField="Saldo" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Usuario" DataField="UsuarioCobranza" />
</Columns>
</asp:GridView>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="/Scripts/PrintJS/print.min.js"></script> <script src="/Scripts/PrintJS/print.min.js"></script>

View File

@@ -1099,4 +1099,26 @@ Partial Class Ventas_PVCobranza
#End Region #End Region
Protected Sub LnkCobrosEnTranscurso_Click(sender As Object, e As EventArgs)
Dim ObjMovtos As New ClsMovimientos()
Dim FechaI, FechaF As Date
FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha)
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1)
If ObjMovtos.GetRemisionesCobranza(UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, FechaI, FechaF) Then
Dim dtt As DataTable = ObjMovtos.DtResultados.FiltraParametros($"CveVenta > 0 AND CveUsuarioCobranza > 0 ")
GvModalCobrosEnTranscurso.DataSource = dtt
End If
ObjMovtos.Dispose()
GvModalCobrosEnTranscurso.DataBind()
UpDVModalCobrosEnTranscurso.Update()
RegistraScript("$('#DVModalCobrosEnTranscurso').modal('show');")
End Sub
End Class End Class

View File

@@ -359,6 +359,7 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
Saldo = Gv.DataKey("Saldo").ToDecimal(); Saldo = Gv.DataKey("Saldo").ToDecimal();
SaldoAdmin = Saldo; SaldoAdmin = Saldo;
} }
Saldo = -Saldo; // invertimos el saldo para que se haga negativo para que sea ABono
ImporteTotalGasto += Saldo; ImporteTotalGasto += Saldo;
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, SaldoAdmin, Saldo, ConPreP.CveConcepto, Gv.DataKey("SerieFolio").ToString(), TxtConcepto.Text, CveIE: CveIE, CveVenta, CveCliente: Gv.DataKey("CveCliente").ToEntero())) if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, tMovto, SaldoAdmin, Saldo, ConPreP.CveConcepto, Gv.DataKey("SerieFolio").ToString(), TxtConcepto.Text, CveIE: CveIE, CveVenta, CveCliente: Gv.DataKey("CveCliente").ToEntero()))

View File

@@ -19,6 +19,9 @@
<ContentTemplate> <ContentTemplate>
<li> <li>
<asp:LinkButton runat="server" ID="LnkComisiones" OnClick="LnkComisiones_Click" data-toggle="tooltip" data-placement="left" title="Comisiones" Text="<i class='fa fa-money'></i> Comisiones"></asp:LinkButton> <asp:LinkButton runat="server" ID="LnkComisiones" OnClick="LnkComisiones_Click" data-toggle="tooltip" data-placement="left" title="Comisiones" Text="<i class='fa fa-money'></i> Comisiones"></asp:LinkButton>
</li>
<li>
<asp:LinkButton runat="server" ID="LnkComisionesEspeciales" OnClick="LnkComisionesEspeciales_Click" data-toggle="tooltip" data-placement="left" title="Comisiones" Text="<i class='fa fa-money'></i> Comisiones Especiales"></asp:LinkButton>
</li> </li>
<li> <li>
<asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton> <asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton>
@@ -113,11 +116,6 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<ajax:TabContainer runat="server" ID="Tabs">
<ajax:TabPanel ID="TabComisiones" runat="server" HeaderText="Comisiones" ClientIDMode="Static">
<ContentTemplate>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left"> <div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
@@ -138,21 +136,19 @@
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha Hora Cirugia" DataField="FechaCirugia" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:dd/MM/yyyy hh:mm}" /> <asp:BoundField HeaderText="Fecha Hora Cirugia" DataField="FechaCirugia" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:dd/MM/yyyy hh:mm}" />
<asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Procedimiento" DataField="Procedimiento" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Código Producto" DataField="Codigo" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Nombre Del Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Precio Unitario" DataField="PU" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="P Unitario" DataField="PU" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Cantidad Utilizada" DataField="Cantidad" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Monto Venta Total" DataField="Total" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="Venta Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Vendedor" DataField="Vendedor" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Comisión Vendedor" DataField="ComisionVendedor" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="$ Vendedor" DataField="ComisionVendedor" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Técnico" DataField="Nombre" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Técnico" DataField="Nombre" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Comisión Técnico" DataField="ComisionTecnico" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField HeaderText="$ Técnico" DataField="ComisionTecnico" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Educación Médica" DataField="ComisionMedico" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="$ E. Médica" DataField="ComisionMedico" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Fecha Pago" DataField="FechaPago" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}" ControlStyle-Width="100px" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
@@ -163,52 +159,6 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabEspeciales" runat="server" HeaderText="Especiales" ClientIDMode="Static">
<ContentTemplate>
<asp:UpdatePanel ID="UpDatosEspeciales" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
<div class="col-md-6">
<input type="text" id="TxtBusquedaEspecial" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaEspecial','{0}')", GvDatosEspeciales.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaEspecial','{0}')", GvDatosEspeciales.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<div class="row">
<div class="col-md-6">
<asp:GridView ID="GvDatosEspeciales" runat="server" AutoGenerateColumns="False"
DataKeyNames=""
data-sort="true"
EmptyDataText="No se encontraron Medicos Registrados" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Com. Médico" DataField="ComisionMedico" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" ControlStyle-Width="120px" />
<asp:BoundField HeaderText="Com. Gerente" DataField="ComisionGerente" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" ControlStyle-Width="120px" />
<asp:BoundField HeaderText="Com. Vendedor" DataField="ComisionVendedor" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" ControlStyle-Width="120px" />
<asp:BoundField HeaderText="Com. Técnico" DataField="ComisionTecnico" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" ControlStyle-Width="120px" />
<asp:BoundField HeaderText="Fecha de Pago" DataField="FechaPago" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}" ControlStyle-Width="80px" />
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
<div id="DvModalComisiones" class="modal ADS fade" role="dialog"> <div id="DvModalComisiones" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 900px;"> <div class="modal-dialog" style="width: 900px;">
@@ -232,7 +182,7 @@
<asp:GridView ID="GvComisiones" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvComisiones" runat="server" AutoGenerateColumns="False"
DataKeyNames="CvePS,ComisionMedico,ComisionGerente,ComisionVendedor,ComisionTecnico" DataKeyNames="CvePS,ComisionMedico,ComisionGerente,ComisionVendedor,ComisionTecnico"
data-sort="true" OnRowDataBound="GvComisiones_RowDataBound" data-sort="true" OnRowDataBound="GvComisiones_RowDataBound"
EmptyDataText="No se encontraron Comisiones" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None"> EmptyDataText="No se encontraron Comisiones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="Código/Producto" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField HeaderText="Código/Producto" ItemStyle-HorizontalAlign="Left">
@@ -283,6 +233,128 @@
</div> </div>
<div id="DvModalComisionesEspeciales" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 900px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalComisionesEspeciales" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="Literal2" runat="server">Comisiones Especiales</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlModalMedico" CssClass="form-control select2me" runat="server" AppendDataBoundItems="true" DataTextField="Medico" DataValueField="CveMedico" Width="100%">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModalMedico" InitialValue="-1" runat="server" ControlToValidate="DdlModalMedico" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Médico''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalComisionesEspeciales"></asp:RequiredFieldValidator>
<label for="<%= DdlModalMedico.ClientID.ToString()%>">Médico:</label>
</div>
</div>
<div class="col-md-3">
<div class="form-group form-md-line-input input-iconright">
<ADS:Dropdownlost runat="server" ID="DdlModalPS" CssStyle="width:100%" CssClass="form-control input-sm DdlPS" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" IncluyeTodos="false" style="margin-top:4px!important" />
<label for="<%= DdlModalPS.ClientID.ToString()%>">
Productos / Servicio:<label>
</div>
</div>
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlModalTipoComision" CssClass="form-control select2me" runat="server" Width="100%" OnSelectedIndexChanged="DdlModalTipoComision_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Value="-1" >Seleccione</asp:ListItem>
<asp:ListItem Value="1" >Fija</asp:ListItem>
<asp:ListItem Value="2">Porcentaje</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlModalTipoComision" InitialValue="-1" runat="server" ControlToValidate="DdlModalTipoComision" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Comisión''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalComisionesEspeciales"></asp:RequiredFieldValidator>
<label for="<%= DdlModalTipoComision.ClientID.ToString()%>">Tipo Comisión:</label>
</div>
</div>
<div class="col-md-2">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtModalComision" CssClass="form-control" runat="server" Width="100%" onkeyup="FormatoMoneda(this);" AutoComplete="off" CausesValidation="true" >
</asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtModalComision" runat="server" ControlToValidate="TxtModalComision" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Comisión''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalComisionesEspeciales"></asp:RequiredFieldValidator>
<label for="<%= TxtModalComision.ClientID.ToString()%>">Comisión:</label>
</div>
</div>
<div class="col-md-2">
<asp:Button runat="server" class="btn btn-primary" ID="LnkModalGuardarComisionEspecial" OnClick="LnkModalGuardarComisionEspecial_Click" Text="Guardar" ValidationGroup="GrpModalComisionesEspeciales" />
</div>
</div>
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
<input type="text" id="TxtBusquedaComicionesEspeciales" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaComiciones','{0}')", GvComisionesEspeciales.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaComicionesEspeciales','{0}')", GvComisionesEspeciales.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvComisionesEspeciales" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveMedicoComision,CveMedico,CvePS,TipoComision,Comision,CveUsuario"
data-sort="true"
EmptyDataText="No se encontraron Comisiones" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Médico" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlMedico" runat="server" Text='<%# Eval("Medico") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Código/Producto" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlCodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TipoComision" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlTipoComision" runat="server" Text='<%# Eval("TipoComisionStr") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Comision" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="LtlComision" runat="server" Text='<%# Eval("Comision", "{0:N2}") %>' ></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Opciones" ItemStyle-Width="60px">
<ItemTemplate>
<asp:LinkButton ID="LnkEliminarComisionEspecial" OnClick="LnkEliminarComisionEspecial_Click" runat="server" Visible="true" AlternateText="Eliminar" CausesValidation="False"
CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>"
data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
<div class="modal-footer">
<button id="Button2" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -2,7 +2,9 @@
Option Strict On Option Strict On
Imports System.Data Imports System.Data
Imports System.Data.Entity
Imports Extensiones Imports Extensiones
Imports Microsoft.EntityFrameworkCore
Partial Class Ventas_RepComisionesSMS Partial Class Ventas_RepComisionesSMS
@@ -59,8 +61,6 @@ Partial Class Ventas_RepComisionesSMS
Public Sub CargaDatos() Public Sub CargaDatos()
LnkExportar.Visible = False LnkExportar.Visible = False
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
@@ -83,39 +83,11 @@ Partial Class Ventas_RepComisionesSMS
End Sub End Sub
Public Sub CargaDatosEspeciales()
LnkExportar.Visible = False
Dim ObjVentas As New ClsVentas
If ObjVentas.GetComisionesMedicasRep(txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveEmpresa, -1, -1, DdlMedico.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuarioAtendio.SelectedValue.ToEntero, -1, 2) Then
GvDatosEspeciales.DataSource = ObjVentas.DtResultados
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
LnkExportar.Visible = True
End If
Else
GvDatosEspeciales.DataSource = Nothing
End If
ObjVentas.Dispose()
GvDatosEspeciales.DataBind()
UpDatosEspeciales.Update()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
If Tabs.ActiveTabIndex = 0 Then
CargaDatos() CargaDatos()
Else
CargaDatosEspeciales()
End If
End Sub End Sub
@@ -123,19 +95,12 @@ Partial Class Ventas_RepComisionesSMS
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Dim SbFiltros As New StringBuilder() Dim SbFiltros As New StringBuilder()
SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|") SbFiltros.AppendFormat($"Fecha Inicio: {txtFechaI.Text} Fecha Fin: {txtFechaF.Text}|")
If Tabs.ActiveTabIndex = 0 Then
GvDatos.Columns(10).Visible = False GvDatos.Columns(10).Visible = False
GvDatos.ExportToExcelGembox("Comisiones", UsuarioActual, "Comisiones", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString()) GvDatos.ExportToExcelGembox("Comisiones", UsuarioActual, "Comisiones", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
GvDatos.Columns(10).Visible = True GvDatos.Columns(10).Visible = True
Else
GvDatosEspeciales.ExportToExcelGembox("Comisiones", UsuarioActual, "Comisiones Especiales", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
End If
End Sub End Sub
@@ -248,4 +213,149 @@ Partial Class Ventas_RepComisionesSMS
End If End If
End Sub End Sub
#Region "COMISIONES ESPECIALES"
Protected Sub LnkComisionesEspeciales_Click(sender As Object, e As EventArgs)
ReiniciaModalComisionesEspeciales()
CargaComisionesEspeciales()
RegistraScript("$('#DvModalComisionesEspeciales').modal('show');")
End Sub
Private Sub ReiniciaModalComisionesEspeciales()
DdlModalTipoComision.SelectedValueExist(-1)
DdlModalMedico.SelectedValue = Nothing
DdlModalMedico.ClearSelection()
DdlModalMedico.Items.Clear()
DdlModalMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
DdlModalMedico.DataBind()
DdlModalMedico.Items.Insert(0, New ListItem("Todos", "-1"))
DdlModalPS.SelectedValue = "-1"
DdlModalPS.SelectedValue = ""
DdlModalPS.SelectedText = ""
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
If EsWS Then
DdlModalPS.setEsWebService(True)
Else
DdlModalPS.ddl.SelectedValue = Nothing
DdlModalPS.ddl.ClearSelection()
DdlModalPS.ddl.Items.Clear()
'Objeto.ddl.DataSource = GlobalDTProductosServicios(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, AplicaParaVenta:=1, Estatus:=1)
DdlModalPS.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, Estatus:=1)
DdlModalPS.ddl.DataBind()
DdlModalPS.ddl.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
DdlModalPS.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
DdlModalPS.setEsWebService(False)
End If
TxtModalComision.Text = ""
UpModalComisionesEspeciales.Update()
End Sub
Private Sub CargaComisionesEspeciales()
Dim ObjVentas As New ClsVentas
GvComisionesEspeciales.DataSource = Nothing
If ObjVentas.GetComisionesMedicasEsPeciales(-1, -1, UsuarioActual.CveEmpresa) Then
GvComisionesEspeciales.DataSource = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
GvComisionesEspeciales.DataBind()
UpModalComisionesEspeciales.Update()
End Sub
Protected Sub LnkEliminarComisionEspecial_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim CveMedicoComision As Integer = GvRow.DataKey("CveMedicoComision").ToEntero
If CveMedicoComision > 0 Then
Dim errorProceso As Boolean = False
Dim ObjVentas As New ClsVentas
If ObjVentas.RemoveComisionesMedicasEspeciales(CveMedicoComision, UsuarioActual.CveEmpresa) Then
Alert("Comisión eliminada correctamente")
Else
errorProceso = True
End If
ObjVentas.Dispose()
If Not errorProceso Then
CargaComisionesEspeciales()
End If
End If
End Sub
#End Region
Protected Sub DdlModalTipoComision_SelectedIndexChanged(sender As Object, e As EventArgs)
TxtModalComision.Text = ""
If DdlModalTipoComision.SelectedValue.ToEntero = 1 Then
TxtModalComision.Attributes.Add("onkeyup", "FormatoMoneda(this)")
Else
TxtModalComision.Attributes.Add("onkeyup", "FormatoMoneda(this);validaPorcentaje(this);")
End If
UpModalComisionesEspeciales.Update()
End Sub
Protected Sub LnkModalGuardarComisionEspecial_Click(sender As Object, e As EventArgs)
If DdlModalPS.SelectedValue.ToEntero <= 0 Then
Alert("Debe de seleccionar un producto.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If TxtModalComision.Text.ToDecimal = 0 Then
Alert("La comisión es requerida.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim errorProceso As Boolean = False
Dim Comision As Decimal = TxtModalComision.Text.ToDecimal
If DdlModalTipoComision.SelectedValue.ToEntero = 2 Then
Comision = TxtModalComision.Text.ToDecimal / 100
End If
Dim ObjVentas As New ClsVentas
If ObjVentas.AddComisionesMedicasEspeciales(DdlModalMedico.SelectedValue.ToEntero, DdlModalPS.SelectedValue.ToEntero, DdlModalTipoComision.SelectedValue.ToEntero, Comision, UsuarioActual.CveUsuario) Then
Alert("Comisión agregada correctamente")
Else
errorProceso = True
End If
ObjVentas.Dispose()
If Not errorProceso Then
CargaComisionesEspeciales()
ReiniciaModalComisionesEspeciales()
End If
End Sub
End Class End Class

View File

@@ -88,7 +88,7 @@
<div class="row"> <div class="row">
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label> <asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
<div runat="server" id="DivSubProyecto" class="col-md-2"> <div runat="server" id="DivSubProyecto" class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList> <asp:ListBox ID="DdlSubProyectos" CssClass="select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Style="width: 100%" data-text="Todos" SelectionMode="Multiple"></asp:ListBox>
</div> </div>
<div class="col-md-1 truncate"> <div class="col-md-1 truncate">
Fecha Inicio: Fecha Inicio:

View File

@@ -54,7 +54,7 @@ Partial Class Ventas_RepPS
End Sub End Sub
Private Sub CargaCombos() Private Sub CargaCombos()
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto)
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind() DdlClasificacion.DataBind()
@@ -77,12 +77,13 @@ Partial Class Ventas_RepPS
LblLinea.Visible = True LblLinea.Visible = True
DivLinea.Visible = True DivLinea.Visible = True
Using ObjMarcas As New ClsProductosServicios DdlMarcaPSDes.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then 'Using ObjMarcas As New ClsProductosServicios
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados ' If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarcaPSDes.DataBind() ' DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
End If ' DdlMarcaPSDes.DataBind()
End Using ' End If
'End Using
End If End If
DdlLinea.DataSource = GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa) DdlLinea.DataSource = GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa)
@@ -95,7 +96,8 @@ Partial Class Ventas_RepPS
Dim Clasificacion As String = If(DdlClasificacion.GetSelectedValuesM = "", "-1", DdlClasificacion.GetSelectedValuesM) Dim Clasificacion As String = If(DdlClasificacion.GetSelectedValuesM = "", "-1", DdlClasificacion.GetSelectedValuesM)
Dim Linea As String = If(DdlLinea.GetSelectedValuesM = "", "-1", DdlLinea.GetSelectedValuesM) Dim Linea As String = If(DdlLinea.GetSelectedValuesM = "", "-1", DdlLinea.GetSelectedValuesM)
Dim Marca As String = If(DdlMarcaPSDes.GetSelectedValuesM = "", "-1", DdlMarcaPSDes.GetSelectedValuesM) Dim Marca As String = If(DdlMarcaPSDes.GetSelectedValuesM = "", "-1", DdlMarcaPSDes.GetSelectedValuesM)
Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero() 'Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero()
Dim CveSubProyectos As String = If(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM)
Dim Grupo As Integer = DdlGrupo.SelectedValue.ToEntero() Dim Grupo As Integer = DdlGrupo.SelectedValue.ToEntero()
Dim CvePS As Integer = DdlPS.SelectedValue.ToEntero() Dim CvePS As Integer = DdlPS.SelectedValue.ToEntero()
Dim CveMoneda As Integer = -1 Dim CveMoneda As Integer = -1
@@ -106,7 +108,7 @@ Partial Class Ventas_RepPS
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha) FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
Dim ObjVentas As New ClsVentas() Dim ObjVentas As New ClsVentas()
If ObjVentas.GetRepPSEcono(CveSubProyecto, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico, Clasificacion:=Clasificacion, Linea:=Linea, Marca:=Marca, orden:=DdlOrden.SelectedValue.ToEntero()) Then If ObjVentas.GetRepPSEcono(CveSubProyectos, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico, Clasificacion:=Clasificacion, Linea:=Linea, Marca:=Marca, orden:=DdlOrden.SelectedValue.ToEntero()) Then
DtReporte = ObjVentas.DtResultados.Copy() DtReporte = ObjVentas.DtResultados.Copy()
GvDatos.DataSource = DtReporte GvDatos.DataSource = DtReporte
Else Else
@@ -167,7 +169,7 @@ Partial Class Ventas_RepPS
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha) FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
If DtReporte IsNot Nothing AndAlso DtReporte.Rows.Count > 0 Then If DtReporte IsNot Nothing AndAlso DtReporte.Rows.Count > 0 Then
Dim SbParametros As New StringBuilder Dim SbParametros As New StringBuilder
SbParametros.AppendFormat("Sucursal:{0}", DdlSubProyecto.SelectedItem.Text) SbParametros.AppendFormat("Sucursal:{0}", DdlSubProyectos.GetSelectedText)
SbParametros.AppendFormat(", Orden:{0}", DdlGrupo.SelectedItem.Text) SbParametros.AppendFormat(", Orden:{0}", DdlGrupo.SelectedItem.Text)
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")

View File

@@ -113,7 +113,6 @@
<asp:UpdatePanel ID="UpLineasAdicionales" runat="server" RenderMode="Inline" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpLineasAdicionales" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="row " runat="server" visible ="false" id="DvLinea"> <div class="row " runat="server" visible ="false" id="DvLinea">
<div class=" col-md-12" style="text-align: right!important"> <div class=" col-md-12" style="text-align: right!important">
<input type="text" id="TxtBuscarLineaAdicional" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvD.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBuscarLineaAdicional" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvD.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
@@ -121,135 +120,30 @@
</div> </div>
</div> </div>
<div class="row " runat="server" visible ="false" id="DvLineaPO">
<div class=" col-md-12" style="text-align: right!important">
<input type="text" id="TxtBuscarLineaAdicionalpo" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvLAPO.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvLAPO.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<div class="row "> <div class="row ">
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvD" Width="100%" runat="server" GridLines="None" Visible="false" <asp:GridView ID="GvD" Width="100%" runat="server" GridLines="None"
DataKeyNames="CveLineaAdicional,LineaAdicional,CveCliente,CveProveedor,TipoLinea,Importe,CveMoneda,FechaVencimiento,CveUsuario,CveCategoria,FechaIng,CveLineaAdicionalEstatus,Proveedor,LineaAdicionalComprobante,DiasVencimiento,CveVenta" DataKeyNames="CveLineaAdicional,LineaAdicional,CveCliente,CveProveedor,TipoLinea,Importe,CveMoneda,FechaVencimiento,CveUsuario,CveCategoria,FechaIng,Proveedor,DiasVencimiento"
CssClass="table table-striped table-advance table-hover ScrollAD input-sm " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true" CssClass="table table-striped table-advance table-hover ScrollAD input-sm " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False"> AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns> <Columns>
<asp:BoundField DataField="LineaAdicional" HeaderText="Linea Adicional" /> <asp:BoundField DataField="LineaAdicional" HeaderText="Linea Adicional" />
<asp:BoundField DataField="NombreCliente" HeaderText="Cliente" /> <asp:HyperLinkField DataTextField="NombreCliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" HeaderText="Cliente" />
<asp:BoundField DataField="Proveedor" HeaderText="Comercializador" /> <asp:BoundField DataField="Proveedor" HeaderText="Comercializador" />
<asp:BoundField DataField="TipoLineaSTR" HeaderText="Tipo Linea" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" /> <asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Abreviatura" HeaderText="Moneda" /> <asp:BoundField DataField="Abreviatura" HeaderText="Moneda" />
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" HeaderText="Serie Folio" />
<asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="DiasVencimiento" HeaderText="Dias de Venc." /> <asp:BoundField DataField="DiasVencimiento" HeaderText="Dias de Venc." />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" /> <asp:BoundField DataField="FechaVencimiento" HeaderText="F. Vencimiento" DataFormatString="{0:d}" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<asp:GridView ID="GvLAPO" Width="100%" runat="server" GridLines="None" Visible="false"
DataKeyNames="CveLineaAdicional,TipoLinea,Importe,CveMoneda,FechaVencimiento,CveLineaAdicionalEstatus,LineaAdicionalComprobante,CveVenta,CveCliente,CveProveedor"
CssClass="table table-striped table-advance table-hover ScrollAD input-sm mysmallbtn" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False"
OnRowCommand="GvLAPO_RowCommand"
OnRowDataBound="GvLAPO_RowDataBound">
<Columns>
<asp:BoundField DataField ="Agrupador" HeaderText="Agrupador" />
<asp:BoundField DataField="LineaAdicional" HeaderText="PO" />
<asp:BoundField DataField="Importe" HeaderText="Importe PO" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="Abreviatura" HeaderText="Mon" />
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" HeaderText="Serie Folio" />
<asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="DiasVencimiento" HeaderText="D.Plazo" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="DiasTranscurridos" HeaderText="D.Trans" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField DataField="FechaVenta" HeaderText="F. Venta" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="FechaVencimientoVenta" HeaderText="F. Venc. Venta" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="Estatus" HeaderText="Estatus" />
<asp:BoundField DataField="FechaEnvio" HeaderText="F. Envío" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Opciones" ItemStyle-Width="75px" HeaderStyle-Width="75px">
<ItemTemplate>
<div class="row" >
<div class="col-md-4" style="max-width:26px!important">
<asp:LinkButton ID="LnkCargarComprobante" Visible="false" runat="server" AlternateText="Editar" CausesValidation="False"
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-upload'></i>" OnClick="LnkCargarComprobante_Click"
ToolTip="Cargar Comprobante" />
<asp:LinkButton ID="LnkDescargaComprobante" Visible="false" runat="server" AlternateText="Descarga" CausesValidation="False"
CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-download'></i>" OnClick="LnkDescargaComprobante_Click"
ToolTip="Descargar Comprobante" />
</div>
<div class="col-md-4" style="max-width:26px!important" title="Cambiar estatus a Enviado">
<asp:LinkButton ID="LnkCambiarEstatus" runat="server" Visible="false" AlternateText="CambiarEstatus"
CommandName="Estatus" CommandArgument='<%# Eval("CveLineaAdicionalEstatus") %>' CausesValidation="False"
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-arrow-right'></i>"
data-toggle="confirmation" data-popout="true" data-original-title="¿Cambiar Estado?" data-btn-ok-label="si"
ToolTip="Cambiar estatus a Enviado" />
</div> </div>
</div> </div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<%-- MODAL COMPROBANTE --%>
<div id="ModalComprobante" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content" style="width: 700px;">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Agregar Comprbante</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UpAddComprobancte" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<div>
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnAddComprobante" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnAddComprobante_Click" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>
</div>
</div>
<%-- FIN MODAL COMPROBANTE --%>
</asp:Content> </asp:Content>

View File

@@ -89,11 +89,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
private void CargaDatos() private void CargaDatos()
{ {
DTDatosGvD = new DataTable(); DTDatosGvD = new DataTable();
LnkDescargaExcel.Visible = false; LnkDescargaExcel.Visible = false;
ClsVentas objVentas = new ClsVentas();
int CveProveedor = -1;
ClsVentas objVentas = new ClsVentas(); ClsVentas objVentas = new ClsVentas();
@@ -104,42 +100,8 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
if (objVentas.DtResultados.Rows.Count > 0) if (objVentas.DtResultados.Rows.Count > 0)
{ {
DTDatosGvD = objVentas.DtResultados; DTDatosGvD = objVentas.DtResultados;
LnkDescargaExcel.Visible = true;
UpAcciones.Update();
}
}
else
{
GvD.DataSource = null;
}
}
else
{
if (DdlAgrupador.SelectedValue.ToEntero()== 1){
GvLAPO.Columns[0].HeaderText = "Comercializador";
}
else
{
GvLAPO.Columns[0].HeaderText = "Cliente";
}
if (objVentas.RepLineasAdicionales(DdlAgrupador.SelectedValue.ToEntero(), -1, DdlClientes.SelectedValue.ToEntero(), CveProveedor, 2, -1, MinFecha, MaxFecha, DdlEstatus.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa))
{
GvLAPO.DataSource = objVentas.DtResultados;
if (objVentas.DtResultados.Rows.Count > 0)
{
DTDatosGvD = objVentas.DtResultados;
LnkDescargaExcel.Visible = true;
UpAcciones.Update();
}
}
else
{
LnkDescargaExcel.Visible = true; LnkDescargaExcel.Visible = true;
UpAcciones.Update(); UpAcciones.Update();
}
} }
} }
objVentas.Dispose(); objVentas.Dispose();
@@ -155,116 +117,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
CveLineaAdicional = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero(); CveLineaAdicional = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero();
CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero(); CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero();
LineaAdicionalComprobante = GvRow.DataKey("LineaAdicionalComprobante").ToString(); LineaAdicionalComprobante = GvRow.DataKey("LineaAdicionalComprobante").ToString();
RegistraScript("$('#ModalComprobante').modal('show');","");
}
protected void BtnAddComprobante_Click(object sender, EventArgs e)
{
bool errorCargaComprobante = false;
List<Archivo> filesgral = Anexo.getfiles().Archivos;
string filemove = "";
FileInfo fiNuevo;
DirectoryInfo df = new DirectoryInfo($@"{UsuarioActual.Empresa.Ruta}\LineasAdicionales\");
//Crea directorio si no existe
if (!df.Exists)
{
try
{
Directory.CreateDirectory(df.FullName);
}
catch
{
errorCargaComprobante = true;
}
}
//borrar archivo anterior
if((!errorCargaComprobante) && LineaAdicionalComprobante.Length > 0)
{
FileInfo fiAnterior = new FileInfo($@"{df.FullName}{LineaAdicionalComprobante}");
if (fiAnterior.Exists)
{
try
{
File.Delete(fiAnterior.FullName);
}
catch
{
errorCargaComprobante = true;
}
}
}
if(!errorCargaComprobante){
string RutaArchivoTemp = "";
foreach (Archivo fileItem in filesgral)
{
FileExtension = System.IO.Path.GetExtension(string.Format(@"{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "");
filemove = fileItem.filename;
RutaArchivoTemp = $@"{AppDomain.CurrentDomain.BaseDirectory}\Temp\{fileItem.filename}";
break;
}
if((!errorCargaComprobante) && RutaArchivoTemp.Length > 0)
{
fiNuevo = new FileInfo(RutaArchivoTemp);
if (fiNuevo.Exists)
{
try
{
if (File.Exists($@"{df.FullName}\{CveVenta}{fiNuevo.Extension}"))
{
File.Delete($@"{df.FullName}\{CveVenta}{fiNuevo.Extension}");
}
File.Move(fiNuevo.FullName, $@"{df.FullName}\{CveVenta}{fiNuevo.Extension}");
errorCargaComprobante = false;
}
catch
{
errorCargaComprobante = true;
}
if (!errorCargaComprobante)
{
ClsVentas objVentas = new ClsVentas();
if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicional, CveVenta, $@"{CveVenta}{fiNuevo.Extension}", -1, UsuarioActual.CveEmpresa))
{
errorCargaComprobante = true;
}
objVentas.Dispose();
}
}
}
}
if (!errorCargaComprobante)
{
CargaDatos();
Anexo.Text = "[]";
RegistraScript("$('#ModalComprobante').modal('hide');", "");
Alert("Comprobante actualizado correctamente.");
}
UpAddComprobancte.Update();
}
protected void LnkCambiarEstatus_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
int CveLineaAdicionalActualzarEstatus = GvRow.DataKey("CveLineaAdicional").ToEntero();
int CveVenta = GvRow.DataKey("CveVenta").ToEntero();
bool errorCambioEstatus = false;
ClsVentas objVentas = new ClsVentas();
if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicional, CveVenta, "", 2, UsuarioActual.CveEmpresa))
{
errorCambioEstatus = true;
}
if (!errorCambioEstatus)
{
RegistraScript("$('#ModalComprobante').modal('show');",""); RegistraScript("$('#ModalComprobante').modal('show');","");
} }
@@ -274,13 +127,6 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
{ {
if(TipoLinea == 1) if(TipoLinea == 1)
{ {
GridView gvTemp = GvD;
//gvTemp.ExportToExcelX("RepLineasAdicionales" + NowADS().ToShortDateString());
gvTemp.ExportToExcelGembox("RepLineasAdicionales", UsuarioActual, "Rep Lineas Adicionales", AnchoImagen: 150);
}
else if(TipoLinea == 2)
{
GridView gvTemp = GvLAPO;
GridView gvTemp = GvD; GridView gvTemp = GvD;
//gvTemp.ExportToExcelX("RepLineasAdicionales" + NowADS().ToShortDateString()); //gvTemp.ExportToExcelX("RepLineasAdicionales" + NowADS().ToShortDateString());
gvTemp.ExportToExcelGembox("RepLineasAdicionales", UsuarioActual, "Rep Lineas Adicionales", AnchoImagen: 150); gvTemp.ExportToExcelGembox("RepLineasAdicionales", UsuarioActual, "Rep Lineas Adicionales", AnchoImagen: 150);
@@ -351,28 +197,6 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
Response.ContentType = "text/octet-stream"; Response.ContentType = "text/octet-stream";
Response.Flush(); Response.Flush();
Response.TransmitFile(fi.FullName); Response.TransmitFile(fi.FullName);
Response.End();
}
}
protected void GvLAPO_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Estatus")
Response.End(); Response.End();
GridViewRow GvRow = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
int CveLineaAdicionalActualizarEstatus = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero();
int CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero();
bool errorCambioEstatus = false;
//int cveestatus = e.CommandArgument.ToEntero() + 2; //pasar al siguiente estatus
ClsVentas objVentas = new ClsVentas();
if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicionalActualizarEstatus, CveVenta,"", 2, UsuarioActual.CveEmpresa))
{
errorCambioEstatus = true;
}
objVentas.Dispose();
if (!errorCambioEstatus)
{
} }
} }

View File

@@ -125,6 +125,13 @@ Partial Class Ventas_RepVentas
LnkDescargaCartaPorte.Visible = True LnkDescargaCartaPorte.Visible = True
End If End If
If Opcion = "Cot" Then
DdlTipoComprobante.SelectedValuesIfExistM(Opcion)
DdlGrupo.SelectedValueExist("7")
DdlTipoComprobante_SelectedIndexChanged(DdlTipoComprobante, EventArgs.Empty)
DdlEstatus.ClearSelection()
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
LblServicioDomicilioFiltro.Visible = True LblServicioDomicilioFiltro.Visible = True
DVServicioDomicilio.Visible = True DVServicioDomicilio.Visible = True

View File

@@ -758,12 +758,12 @@
<td><b>Fecha:</b></td> <td><b>Fecha:</b></td>
<td> <td>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" runat="server" AutoPostBack="true" CssClass="form-control" CausesValidation="true" MaxLength="10" OnTextChanged="TxtFecha_TextChanged"></asp:TextBox> <asp:TextBox ID="TxtFecha" runat="server" Enabled="false" AutoPostBack="true" CssClass="form-control" CausesValidation="true" MaxLength="10" OnTextChanged="TxtFecha_TextChanged"></asp:TextBox>
<span class="input-group-btn "> <span class="input-group-btn ">
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server" ></asp:LinkButton> <asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server" ></asp:LinkButton>
</span> </span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender> <ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="false" ></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator> <asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
@@ -892,7 +892,7 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel ID="UpEstatus" runat="server" visible="false" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="margin-left: auto"> <asp:UpdatePanel ID="UpEstatus" runat="server" Visible="false" UpdateMode="Conditional" class="portlet light xspadding bordered whitoutcol" style="margin-left: auto">
<ContentTemplate> <ContentTemplate>
<div class="portlet-title"> <div class="portlet-title">
@@ -3491,7 +3491,7 @@
<div class="row" style="margin-bottom: 10px;"> <div class="row" style="margin-bottom: 10px;">
<div class="text-right col-md-offset-8 col-md-4"> <div class="text-right col-md-offset-8 col-md-4">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratoDetalles.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusquedaCon" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaCon','{0}')", GvContratoDetalles.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratoDetalles.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvContratoDetalles.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
</div> </div>
@@ -4536,10 +4536,11 @@
</div> </div>
</asp:Panel> </asp:Panel>
</div> </div>
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
<ContentTemplate>
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header "> <div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
@@ -4615,6 +4616,9 @@
<div style="max-height: 300px; overflow-y: auto;"> <div style="max-height: 300px; overflow-y: auto;">
<div class="row" style="margin-left: 0px; text-align: right" align="left"> <div class="row" style="margin-left: 0px; text-align: right" align="left">
<div class="col-md-2">
<asp:LinkButton ID="LnkRecargaAnticipos" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-refresh'></i> Actualizar" runat="server" OnClick="LnkRecargaAnticipos_Click" />
</div>
<div style="margin-right: 15px"> <div style="margin-right: 15px">
<input type="text" id="TxtBusquedaAnticipos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusquedaAnticipos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
@@ -4622,12 +4626,13 @@
</div> </div>
<br /> <br />
<asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente" <asp:GridView ID="GVAnticipos" runat="server" AutoGenerateColumns="False" ClientIDMode="Static" EmptyDataText="No se encontraron Anticipos del Cliente"
ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall" data-height="300" Style="text-align: center;" GridLines="None" ToolTip="Listado de Anticipos" CssClass="GVAnticipos table table-striped table-hover Widthall mysmallbtn" data-height="300" Style="text-align: center;" GridLines="None"
DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo,IEPS, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, FolioFiscal, CveClasificacionNC, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos,RegresarImpuesto,DevolucionImportePagado,CveCliente,Descuentos"> DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo,IEPS, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, FolioFiscal, CveClasificacionNC, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos,RegresarImpuesto,DevolucionImportePagado,CveCliente,Descuentos">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="Chk" runat="server" /> <asp:CheckBox ID="Chk" runat="server" />
<asp:LinkButton ID="LnkSolicitarActivarAnticipo" Visible="false" NavigateUrl="#" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-check'></i>" ToolTip="Solicitar activar anticipo" runat="server" OnClick="LnkSolicitarActivarAnticipo_Click" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
@@ -4692,6 +4697,7 @@
<asp:HiddenField ID="HdnTieneAnticiposVinculados" ClientIDMode="Static" Value="0" runat="server" /> <asp:HiddenField ID="HdnTieneAnticiposVinculados" ClientIDMode="Static" Value="0" runat="server" />
</div> </div>
</div> </div>
</div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
@@ -10587,26 +10593,44 @@
if (indexd == 0) { if (indexd == 0) {
var tr = $('<tr></tr>'); tbody.append(tr); var tr = $('<tr></tr>'); tbody.append(tr);
var td; var td;
let idxHeader = 0;
for (var key in item) { for (var key in item) {
if (!(key == "text" || key == "id")) { td = $('<td style="font-weight:bold;">' + key + '</td>'); tr.append(td); } if (idxHeader == 0 && '<%= UsuarioActual.Empresa.Funcionalidad(382) %>' == '1') {
tr.append('<td style="font-weight:bold;"> </td>');
}
if (!(key == "text" || key == "id")) {
td = $('<td style="font-weight:bold;">' + key + '</td>');
tr.append(td);
}
idxHeader += 1;
} }
} }
var tr = $('<tr></tr>'); tbody.append(tr); var tr = $('<tr></tr>'); tbody.append(tr);
var td; var td;
let idxColumn = 0;
for (var key in item) { for (var key in item) {
if (idxColumn == 0 && '<%= UsuarioActual.Empresa.Funcionalidad(382) %>' == '1') {
let tdExistencia = '<a href="javascript:void(0);" onclick="javascript:AbrirVentana(' + "'/Inventarios/PopUpExistenciasAlmacen.aspx?CvePS=" + item.id + "'" + ", 800, 547," + "'N'" + ",'PopUpBuscar');$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <i class="fa fa-eye" aria-hidden="true"></i> </a>';
tr.append('<td>' + tdExistencia + '</td>');
}
if (!(key == "text" || key == "id")) { if (!(key == "text" || key == "id")) {
if ((item[key] > 0)) { if ((item[key] > 0)) {
td = $('<td style = "font-weight:bold;" >' + item[key] + '</td>'); tr.append(td); td = $('<td style = "font-weight:bold;" >' + item[key] + '</td>'); tr.append(td);
} else { } else {
if ('<%= UsuarioActual.Empresa.Funcionalidad(566) %>' == '1') { if ('<%= UsuarioActual.Empresa.Funcionalidad(566) %>' == '1') {
var buscarAlmacenes = "CargaExistenciasSucursales(" + item.id + ",'" + item.text + "');" var buscarAlmacenes = "CargaExistenciasSucursales(" + item.id + ",'" + item.text + "');"
td = $('<td>' + item[key] + ' <button type="button" class="btn btn-xs btn-primary" onclick="' + buscarAlmacenes + '">Ver mas existencias</button></td>'); tr.append(td); td = $('<td>' + item[key] + ' <button type="button" class="btn btn-xs btn-primary" onclick="' + buscarAlmacenes + '">Ver mas existencias</button></td>');
tr.append(td);
} else { } else {
td = $('<td>' + item[key] + '</td>'); tr.append(td); td = $('<td>' + item[key] + '</td>'); tr.append(td);
} }
} }
} }
idxColumn += 1;
} }
indexd += 1; indexd += 1;
}); });

View File

@@ -2714,6 +2714,7 @@ Partial Class Ventas
ViewState("CveCliente") = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() ViewState("CveCliente") = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()
HdnCveCliente.Value = UsuarioActual.Empresa.Funcionalidad(714) HdnCveCliente.Value = UsuarioActual.Empresa.Funcionalidad(714)
RBLPago.SelectedValue = "2" RBLPago.SelectedValue = "2"
RBLPago_SelectedIndexChanged(RBLPago, EventArgs.Empty)
CargaCliente(CveCliente) CargaCliente(CveCliente)
End If End If
@@ -3227,12 +3228,11 @@ Partial Class Ventas
' End If ' End If
'End If 'End If
If UsuarioActual.Empresa.Funcionalidad(301).ToEntero() > 0 Then If UsuarioActual.Empresa.Funcionalidad(301) <> "" Then
TxtFecha.Enabled = False TxtFecha.Enabled = True
ImgFecha.Visible = False ImgFecha.Visible = True
End If End If
CargarCodigo() CargarCodigo()
InicializaImprimirNew() InicializaImprimirNew()
@@ -3496,13 +3496,6 @@ Partial Class Ventas
ImgFecha.Visible = False ImgFecha.Visible = False
End If End If
'condición temporal por implementación JAM. usuario FernandaRomo
If UsuarioActual.CveUsuario.Contiene(11703, 1719) Then
TxtFecha.Enabled = True
ImgFecha.Visible = True
End If
TxtFecha.Enabled = True
BloqueaCondicionesPago() BloqueaCondicionesPago()
BloqueaClasificaciones() BloqueaClasificaciones()
@@ -5576,7 +5569,6 @@ Partial Class Ventas
HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString()
End If End If
TxtOrdenCompra.Text = DbRowVenta("OrdenCompra").ToString() TxtOrdenCompra.Text = DbRowVenta("OrdenCompra").ToString()
TxtOrdenCompra.Enabled = False TxtOrdenCompra.Enabled = False
@@ -7194,7 +7186,13 @@ Partial Class Ventas
End If End If
ObjCliente.Dispose() ObjCliente.Dispose()
If CveCliente > 0 Then CargaAnticipos(CveCliente) : UpAnticipos.Update() If CveCliente > 0 Then
CargaAnticipos(CveCliente)
If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then
LnkRecargaAnticipos.Visible = True
End If
UpAnticipos.Update()
End If
If CveCliente > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveVenta <= 0 Then If CveCliente > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveVenta <= 0 Then
DivVentasUsados.Visible = True DivVentasUsados.Visible = True
@@ -10047,6 +10045,8 @@ Partial Class Ventas
'If (UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 81, 83) And UsuarioActual.CveUsuario = 100) Or UsuarioActual.CveEmpresa.Contiene(80, 83) Or UsuarioActual.CveUsuario = 100 Then 'If (UsuarioActual.CveEmpresa.Contiene(1, 4, 5, 7, 11, 12, 72, 80, 81, 83) And UsuarioActual.CveUsuario = 100) Or UsuarioActual.CveEmpresa.Contiene(80, 83) Or UsuarioActual.CveUsuario = 100 Then
If (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists Or ArchivoSti3.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then If (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists Or ArchivoSti3.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then
If Not UsuarioActual.TienePermisoProceso(380) Then
HplDownPDF.Visible = True HplDownPDF.Visible = True
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))) HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
@@ -10064,6 +10064,7 @@ Partial Class Ventas
HplImprimirTicket.Visible = True HplImprimirTicket.Visible = True
HplImprimirTicket.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta))) HplImprimirTicket.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1&REGENERAR=1", CveVenta)))
End If End If
End If
End If End If
@@ -10437,11 +10438,6 @@ Partial Class Ventas
' cambiar la condicion para saber si hay seleccionado ' cambiar la condicion para saber si hay seleccionado
If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse NCDescuento Then If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse NCDescuento Then
Try Try
'LIMPIA LOS ANTICIPOS RELACIONADOS QUE YA SE APLICARON
If ListaAnticiposAplicados IsNot Nothing Then
ListaAnticiposAplicados.Clear()
End If
Dim CveVentaRelacionada As Integer = -1 Dim CveVentaRelacionada As Integer = -1
If NuevaFactura = 1 Then If NuevaFactura = 1 Then
CveVentaRelacionada = ObjFactura.CveVenta CveVentaRelacionada = ObjFactura.CveVenta
@@ -10703,6 +10699,11 @@ Partial Class Ventas
ObjFactura.DtDetalle = TmpDT 'actualiza por cambios de pedimentos. ObjFactura.DtDetalle = TmpDT 'actualiza por cambios de pedimentos.
ObjFactura.Timbre = PreParaTimbre(ObjFactura) ObjFactura.Timbre = PreParaTimbre(ObjFactura)
'LIMPIA LOS ANTICIPOS RELACIONADOS QUE YA SE APLICARON
If ListaAnticiposAplicados IsNot Nothing Then
ListaAnticiposAplicados.Clear()
End If
'ENVIAR POLIZA VIRTUAL 'ENVIAR POLIZA VIRTUAL
If ErrorList.Count = 0 Then If ErrorList.Count = 0 Then
If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then
@@ -10890,10 +10891,12 @@ Partial Class Ventas
' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA ' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA
If SeTimbro Then If SeTimbro Then
If Not UsuarioActual.TienePermisoProceso(380) Then
Dim ArchivoXML As String = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio) Dim ArchivoXML As String = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
If File.Exists(ArchivoXML) Then If File.Exists(ArchivoXML) Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto))) MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
End If End If
End If
'MANDA CORREO 'MANDA CORREO
Try Try
Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False) Dim Factura As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
@@ -10923,6 +10926,7 @@ Partial Class Ventas
'DESCARGA PDF 'DESCARGA PDF
If Not UsuarioActual.TienePermisoProceso(380) Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Ped") Then If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Ped") Then
'If Not ImprimeAlert Then 'If Not ImprimeAlert Then
@@ -10937,6 +10941,8 @@ Partial Class Ventas
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ") MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
End If End If
End If End If
End If
'CRM 'CRM
If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then
@@ -11013,6 +11019,7 @@ Partial Class Ventas
' End If ' End If
'End If 'End If
If Not UsuarioActual.TienePermisoProceso(380) Then
If DdlTipoComprobante.SelectedValue = "Cot" Then If DdlTipoComprobante.SelectedValue = "Cot" Then
If Not CveEmpresaCRM > 0 Then If Not CveEmpresaCRM > 0 Then
@@ -11037,6 +11044,8 @@ Partial Class Ventas
GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO
End If End If
End If End If
End If
'ENVIA CORREO CON DETALLE DEL CONTRATO 'ENVIA CORREO CON DETALLE DEL CONTRATO
If DdlTipoComprobante.SelectedValue.Contiene("DPe", "Ped") Then If DdlTipoComprobante.SelectedValue.Contiene("DPe", "Ped") Then
@@ -11858,7 +11867,7 @@ Partial Class Ventas
End If End If
'SI LA APLICACION DE ANTICIPO SE HACE A NIVEL TOTAL, FORZAR EL AJUSTE POR REDONDEO 'SI LA APLICACION DE ANTICIPO SE HACE A NIVEL TOTAL, FORZAR EL AJUSTE POR REDONDEO
DtImpuestos = CargaDtImpuestosNC(gvrt.DataKey("CveVenta").ToString().ToEntero(), gvrt.FCTextBox(String.Format("TxtAnticipo{0}", gvrt.RowIndex)).Text.ToDecimal, AplicaImpuestosLocales:=True, NCDescuento:=False, NivelTotal:=tTipoAmortizacion, ForzarAjuste:=ForzarAjuste, AplicaDescuentos:=True) DtImpuestos = CargaDtImpuestosNC(gvrt.DataKey("CveVenta").ToString().ToEntero(), gvrt.FCTextBox(String.Format("TxtAnticipo{0}", gvrt.RowIndex)).Text.ToDecimal, AplicaImpuestosLocales:=True, NCDescuento:=False, NivelTotal:=tTipoAmortizacion, ForzarAjuste:=ForzarAjuste, AplicaDescuentos:=True, ReasignarTmpDT:=False)
Dim query = From ddr In DtImpuestos Dim query = From ddr In DtImpuestos
Group By PorcentajeIVA = ddr("PorcentajeIVA").ToString().ToDecimal, Group By PorcentajeIVA = ddr("PorcentajeIVA").ToString().ToDecimal,
@@ -11956,7 +11965,7 @@ Partial Class Ventas
DtVentasNC.Rows(0)("TCCambioValuacion") = factura.TipoCambio DtVentasNC.Rows(0)("TCCambioValuacion") = factura.TipoCambio
End If End If
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion) factura.Timbre = PreParaTimbre(factura)
'Registramos la venta 'Registramos la venta
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, factura, tmpcon, -1, ObjBancos, EsNCAmortizacion:=True) GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, factura, tmpcon, -1, ObjBancos, EsNCAmortizacion:=True)
@@ -12173,6 +12182,11 @@ Partial Class Ventas
ObjFactura.Alfa1 = TxtAlfa1.Text.Trim ObjFactura.Alfa1 = TxtAlfa1.Text.Trim
End If End If
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
ObjFactura.Medico = DdlMedico.SelectedItem.Text
ObjFactura.Procedimiento = DdlProcedimiento.SelectedItem.Text
End If
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS
If (ObjFactura.CveMoneda = 2 AndAlso ObjFactura.ConvertirPesos = True AndAlso ObjFactura.TipodeComprobante = "Ingresos" AndAlso RemisionesLista.Count > 0) Then If (ObjFactura.CveMoneda = 2 AndAlso ObjFactura.ConvertirPesos = True AndAlso ObjFactura.TipodeComprobante = "Ingresos" AndAlso RemisionesLista.Count > 0) Then
Dim TotalCalculableImpuestos, TotalCalculableImpuestosIVA As Decimal Dim TotalCalculableImpuestos, TotalCalculableImpuestosIVA As Decimal
@@ -13079,7 +13093,6 @@ Partial Class Ventas
End If End If
If HdnTipoDescuento.Value = "3" And DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero() > 0 Then If HdnTipoDescuento.Value = "3" And DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero() > 0 Then
Timbre.CFDIRelacionados.TipoRelacion = "07" Timbre.CFDIRelacionados.TipoRelacion = "07"
Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo" Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
Else Else
@@ -13111,21 +13124,32 @@ Partial Class Ventas
Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos" Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos"
End Select End Select
'SI ES NOTA DE CREDITO O REFACTURACION
If Obj.TipoDocto.Contiene("Egs", "Dev") OrElse (NuevaFactura = 1) Then
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
Timbre.CFDIRelacionados.UUID.Clear()
For Each Dr As DataRow In DtVentasNC.Rows For Each Dr As DataRow In DtVentasNC.Rows
Timbre.CFDIRelacionados.UUID.Add(Dr("FolioFiscal").ToString()) Timbre.CFDIRelacionados.UUID.Add(Dr("FolioFiscal").ToString())
Next Next
Else Else
If ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Count > 0 Then If Not String.IsNullOrEmpty(HdnFolioFiscalNC.Value.Trim()) AndAlso HdnFolioFiscalNC.Value <> "0" Then
Timbre.CFDIRelacionados.UUID.Clear()
Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
End If
End If
'ANTICIPO APLICADO A UNA FACTURA
ElseIf Obj.TipoDocto = "Ing" AndAlso ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Count > 0 Then
Timbre.CFDIRelacionados.UUID.Clear()
For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados
Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal) Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal)
Next Next
Else Else
If Not String.IsNullOrEmpty(HdnFolioFiscalNC.Value.Trim()) AndAlso HdnFolioFiscalNC.Value <> "0" Then If Not String.IsNullOrEmpty(HdnFolioFiscalNC.Value.Trim()) AndAlso HdnFolioFiscalNC.Value <> "0" Then
Timbre.CFDIRelacionados.UUID.Clear()
Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value) Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
End If End If
End If End If
End If
End If End If
End If End If
End If End If
@@ -16615,7 +16639,7 @@ Partial Class Ventas
End If End If
'AGREGAR LOS ANTICIPOS, DEV, IxC QUE ESTEN EN PUBLICO GENERAL 'AGREGAR LOS ANTICIPOS, DEV, IxC QUE ESTEN EN PUBLICO GENERAL
If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso UsuarioActual.CveEmpresa = 190 Then If Me.TmpDTAnticiposNCIxCCliente IsNot Nothing AndAlso UsuarioActual.CveEmpresa.Contiene(189, 190, 192, 195, 197) Then
Dim CveClientePublicoGeneral = UsuarioActual.Empresa.Funcionalidad(714).ToEntero() Dim CveClientePublicoGeneral = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()
If CveClientePublicoGeneral > 0 Then If CveClientePublicoGeneral > 0 Then
If CveCliente <> CveClientePublicoGeneral Then If CveCliente <> CveClientePublicoGeneral Then
@@ -16813,6 +16837,13 @@ Partial Class Ventas
GVAnticipos.Columns(8).Visible = True GVAnticipos.Columns(8).Visible = True
End If End If
If UsuarioActual.Empresa.Funcionalidad(185) = "1" Then
If e.Row.DBCampo("Tipo").ToString() = "Ant" AndAlso Not CBool(e.Row.DBCampo("AnticipoAutorizado")) Then
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).Enabled = False
e.Row.FCCheckBox("Chk" & e.Row.RowIndex).ToolTip = "Anticipo Bloqueado"
e.Row.FCLinkButton("LnkSolicitarActivarAnticipo").Visible = True
End If
End If
If e.Row.DBCampo("CveMoneda").ToString().ToEntero() = DdlMoneda.SelectedValue.ToEntero() Then If e.Row.DBCampo("CveMoneda").ToString().ToEntero() = DdlMoneda.SelectedValue.ToEntero() Then
e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Visible = False e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Visible = False
@@ -25604,7 +25635,7 @@ Partial Class Ventas
Dim AplicaCancelacionConPagos As Boolean = False Dim AplicaCancelacionConPagos As Boolean = False
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Rem") AndAlso Not EsRefacturacion AndAlso ObjFactura.Pagado > 0 Then If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Rem") AndAlso Not EsRefacturacion AndAlso ObjFacturaCancelacion.Pagado > 0 Then
AplicaCancelacionConPagos = True AplicaCancelacionConPagos = True
End If End If
@@ -25651,7 +25682,7 @@ Partial Class Ventas
Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000 Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000
SegundosRespuesta = SegundosRespuesta.ToEntero SegundosRespuesta = SegundosRespuesta.ToEntero
If SegundosRespuesta >= 5 Then If SegundosRespuesta >= 5 AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("Ing", "Ant", "Dev", "Egs") Then
Alert($"Los servicios de cancelación del SAT presentan lentitud en la respuesta [{ SegundosRespuesta } s].", TipoMensaje.ToastAdventencia, "") Alert($"Los servicios de cancelación del SAT presentan lentitud en la respuesta [{ SegundosRespuesta } s].", TipoMensaje.ToastAdventencia, "")
End If End If
@@ -30143,7 +30174,7 @@ Partial Class Ventas
Next Next
End Sub End Sub
Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal, Optional NCDescuento As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional NivelTotal As Integer = 1, Optional AplicaNCUsado As Boolean = False, Optional ForzarAjuste As Boolean = False, Optional AplicaDescuentos As Boolean = False) As DataTable Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal, Optional NCDescuento As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional NivelTotal As Integer = 1, Optional AplicaNCUsado As Boolean = False, Optional ForzarAjuste As Boolean = False, Optional AplicaDescuentos As Boolean = False, Optional ReasignarTmpDT As Boolean = True) As DataTable
Dim Total As Decimal = 0, SubTotal As Decimal = 0, Saldo As Decimal = 0 Dim Total As Decimal = 0, SubTotal As Decimal = 0, Saldo As Decimal = 0
Dim TmpDT As DataTable = Nothing Dim TmpDT As DataTable = Nothing
@@ -30305,7 +30336,7 @@ Partial Class Ventas
End If End If
End If End If
If Not NCDescuento Then If Not NCDescuento AndAlso ReasignarTmpDT Then
Me.TmpDT = TmpDT Me.TmpDT = TmpDT
End If End If
'CARGA FACTURA A LA CUAL SE APLICA LA NC 'CARGA FACTURA A LA CUAL SE APLICA LA NC
@@ -31324,7 +31355,7 @@ Partial Class Ventas
divAnticipoMsg.Visible = False divAnticipoMsg.Visible = False
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then
Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo IN('NC','RNC','IxC') ", "")}") Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo IN('NC','RNC','IxC') ", "")}")
divAmortizacionTipoRelacion.Visible = False divAmortizacionTipoRelacion.Visible = False
@@ -32513,11 +32544,11 @@ Partial Class Ventas
For Each Dr As DataRow In dtSeleccionadas.Rows For Each Dr As DataRow In dtSeleccionadas.Rows
If Dr("Medico").ToString.Length > 0 Then If Dr("Medico").ToString.Trim.Length > 0 Then
MensajeRemisionesMedicas.Append($"Dr. {Dr("MEdico").ToString}{vbCrLf}") MensajeRemisionesMedicas.Append($"Dr. {Dr("Medico").ToString}{vbCrLf}")
EsRemisionMedica = True EsRemisionMedica = True
End If End If
If Dr("Medico").ToString.Length > 0 Then If Dr("Procedimiento").ToString.Trim.Length > 0 Then
MensajeRemisionesMedicas.Append($"Procedimiento {Dr("Procedimiento")}{vbCrLf}") MensajeRemisionesMedicas.Append($"Procedimiento {Dr("Procedimiento")}{vbCrLf}")
EsRemisionMedica = True EsRemisionMedica = True
End If End If
@@ -32540,7 +32571,6 @@ Partial Class Ventas
TxtObsFact.Text = If(MensajeRemisiones.ToString().Length > 0, MensajeRemisiones.ToString().Substring(0, MensajeRemisiones.ToString().Length - 2), "") TxtObsFact.Text = If(MensajeRemisiones.ToString().Length > 0, MensajeRemisiones.ToString().Substring(0, MensajeRemisiones.ToString().Length - 2), "")
End If End If
TxtOrdenCompra.Text = If(ObsOC.ToString().Length > 0, ObsOC.ToString().Substring(0, ObsOC.ToString().Length - 2), "") TxtOrdenCompra.Text = If(ObsOC.ToString().Length > 0, ObsOC.ToString().Substring(0, ObsOC.ToString().Length - 2), "")
TxtPedidoContrato.Text = If(ObsPedido.ToString().Length > 0, ObsPedido.ToString().Substring(0, ObsPedido.ToString().Length - 2), "") TxtPedidoContrato.Text = If(ObsPedido.ToString().Length > 0, ObsPedido.ToString().Substring(0, ObsPedido.ToString().Length - 2), "")
TxtObsAlmacen.Text = If(ObsInv.ToString().Length > 0, ObsInv.ToString().Substring(0, ObsInv.ToString().Length - 2), "") TxtObsAlmacen.Text = If(ObsInv.ToString().Length > 0, ObsInv.ToString().Substring(0, ObsInv.ToString().Length - 2), "")
@@ -33512,6 +33542,13 @@ Partial Class Ventas
End If End If
Dim TipoDoctoViejo As String = DdlTipoComprobante.SelectedValue Dim TipoDoctoViejo As String = DdlTipoComprobante.SelectedValue
If TipoDoctoViejo = "PA" AndAlso TipoDoctoNuevo.Contiene("Rem") Then
If DdlTipoComprobante.Items.FindByValue("Rem") Is Nothing Then
DdlTipoComprobante.Items.Add(New ListItem("Remisión", "Rem"))
End If
End If
DdlTipoComprobante.SelectedValue = TipoDoctoNuevo DdlTipoComprobante.SelectedValue = TipoDoctoNuevo
If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then
TxtFecha.Text = NowADS().ToString() TxtFecha.Text = NowADS().ToString()
@@ -36001,39 +36038,20 @@ Partial Class Ventas
DdlChofer.DataSource = GlobalDTChoferes(UsuarioActual.CveEmpresa) DdlChofer.DataSource = GlobalDTChoferes(UsuarioActual.CveEmpresa)
DdlChofer.DataBind() DdlChofer.DataBind()
DdlChofer.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) DdlChofer.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa) DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=1)
DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa)
'Using ObjInv As New ClsInventarios
' If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then
' DdlUnidadCamion.DataSource = ObjInv.DtResultados
' End If
' If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
' DdlRemolque1.DataSource = ObjInv.DtResultados
' End If
'End Using
DdlUnidadCamion.DataBind() DdlUnidadCamion.DataBind()
DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
DdlRemolque1.DataBind() DdlConfigAuto.DataSource = GlobalDTGralCartaPorteConfigAutoTransportes
DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
Using ObjGrales As New ClsGenerales
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
DdlConfigAuto.DataSource = ObjGrales.DtResultados
End If
End Using
DdlConfigAuto.DataBind() DdlConfigAuto.DataBind()
DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1")) DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1"))
DdlRemolque1.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=2)
DdlRemolque1.DataBind()
DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
UpEmitirTransitorio.Update() UpEmitirTransitorio.Update()
End Sub End Sub
@@ -36047,13 +36065,11 @@ Partial Class Ventas
DdlRemolque2.SelectedValueExist(-1) DdlRemolque2.SelectedValueExist(-1)
If DdlUnidadCamion.SelectedValue.ToEntero > 0 Then If DdlUnidadCamion.SelectedValue.ToEntero > 0 Then
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(DdlUnidadCamion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1) Then Dim CveConfig As String = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveCamion:=DdlUnidadCamion.SelectedValue.ToEntero, CveTipoCamion:=1).FiltroPrimeroValor("CveConfigAutoTransporte")
DdlConfigAuto.SelectedValueExist(ObjInv.DtResultados.FiltroPrimeroValor("CveConfigAutoTransporte")) DdlConfigAuto.SelectedValueExist(CveConfig)
DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing) DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing)
End If End If
End Using
End If
UpEmitirTransitorio.Update() UpEmitirTransitorio.Update()
End Sub End Sub
@@ -36178,9 +36194,8 @@ Partial Class Ventas
If DdlConfigAuto.SelectedValue.ToEntero > 0 Then If DdlConfigAuto.SelectedValue.ToEntero > 0 Then
Using ObjGrales As New ClsGenerales Dim Remolque As String = GlobalDTGralCartaPorteConfigAutoTransportes.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'")
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then If Remolque <> "" Then
Dim Remolque As String = ObjGrales.DtResultados.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'")
If Remolque = "1" Then If Remolque = "1" Then
RequiereRemolque = True RequiereRemolque = True
@@ -36197,8 +36212,6 @@ Partial Class Ventas
MostrarRemolques = False MostrarRemolques = False
End If End If
End If End If
End Using
Else Else
RequiereRemolque = False RequiereRemolque = False
MostrarRemolques = False MostrarRemolques = False
@@ -36222,13 +36235,7 @@ Partial Class Ventas
If DdlRemolque1.SelectedValue.ToEntero > 0 Then If DdlRemolque1.SelectedValue.ToEntero > 0 Then
DvRemolque2.Visible = True DvRemolque2.Visible = True
DdlRemolque2.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=2)
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}")
End If
End Using
DdlRemolque2.DataBind() DdlRemolque2.DataBind()
Else Else
DvRemolque2.Visible = False DvRemolque2.Visible = False
@@ -36978,7 +36985,6 @@ Partial Class Ventas
If CveVenta <= 0 Then If CveVenta <= 0 Then
TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToString("dd/MM/yyyy") TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToString("dd/MM/yyyy")
TxtOrdenCompra.Text = ""
'SI SE HABILITO LA FACTURACION DESDE LA LINEA ADICIONAL DEBE QUITARLO 'SI SE HABILITO LA FACTURACION DESDE LA LINEA ADICIONAL DEBE QUITARLO
If HabilitoFacturacionIngresoLineaAdicional Then If HabilitoFacturacionIngresoLineaAdicional Then
@@ -38147,7 +38153,7 @@ Partial Class Ventas
' $get('HdnTipoDescuento').value = '3'; MuestraAnticipos(); ' $get('HdnTipoDescuento').value = '3'; MuestraAnticipos();
HdnTipoDescuento.Value = "3" HdnTipoDescuento.Value = "3"
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
If DdlTipoAmortizacionAnticipo.Items.FindByValue("4") Is Nothing Then If DdlTipoAmortizacionAnticipo.Items.FindByValue("4") Is Nothing Then
DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4")) DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4"))
End If End If
@@ -38391,6 +38397,36 @@ Partial Class Ventas
End Function End Function
#Region "Activa Anticipos"
Protected Sub LnkRecargaAnticipos_Click(sender As Object, e As EventArgs)
If CveCliente > 0 Then
CargaAnticipos(CveCliente)
End If
End Sub
Protected Sub LnkSolicitarActivarAnticipo_Click(sender As Object, e As EventArgs)
'falta sacar a los usuarios a notificar.
Dim gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).BindingContainer, GridViewRow)
Dim Folio As String = gvr.DataKey("Folio")
Dim ObjProceso As New ClsSisProcesos
Dim dtt As DataTable = Nothing
If ObjProceso.GetUsuariosconProceso(379, UsuarioActual.CveEmpresa) Then 'proceso para autorizar
dtt = ObjProceso.DtResultados
End If
ObjProceso.Dispose()
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
For Each dr As DataRow In dtt.Rows
ClsSisNotificaciones.EnviarAlerta("Solicitud de Anticipo", $"Solicitud de activación de anticipo Folio: {Folio} <br/><a href='/Ventas/Clientes.aspx?CveCliente={CveCliente}&op=ant'>Ir Activar</a>", dr("CveUsuario").ToString, Tipo:=TipoNotificacion.ToastInformacionB)
Next
End If
End Sub
#End Region
Public Function GeneraLigaExistencias() As String
Return "<a href='javascript:void(0);' class='Texto' onclick=''javascript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact', 800, 547, 'N', 'PopUpBuscar')''> ver </a>"
End Function
End Class End Class