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 CveAlmacenConsignacion As Integer = -1
Public Property UsaProductoAlterno As Boolean = False
Public Property EnDemanda As Boolean = False
Public Property EnQuebranto As Boolean = False
#End Region
@@ -413,6 +415,8 @@ Public Class ClsClientes
_CveAlmacenConsignacion = Data(0)("CveAlmacenConsignacion").ToString.ToEntero
_UsaProductoAlterno = CBool(Data(0)("UsaProductoAlterno"))
_EnDemanda = CBool(Data(0)("UsaProductoAlterno"))
_EnQuebranto = CBool(Data(0)("EnQuebranto"))
End If
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 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 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
@@ -662,6 +667,8 @@ Public Class ClsClientes
.Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno
.Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion
.Add("@UsaProductoAlterno", SqlDbType.Bit).Value = UsaProductoAlterno
.Add("@EnDemanda", SqlDbType.Bit).Value = EnDemanda
.Add("@EnQuebranto", SqlDbType.Bit).Value = EnQuebranto
End With
Try
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 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 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
@@ -849,7 +857,8 @@ Public Class ClsClientes
.Add("@CveAlmacenConsignacion", SqlDbType.Int).Value = CveAlmacenConsignacion
.Add("@CveAlmacenAlterno", SqlDbType.Int).Value = CveAlmacenAlterno
.Add("@UsaProductoAlterno", SqlDbType.Bit).Value = UsaProductoAlterno
.Add("@EnDemanda", SqlDbType.Bit).Value = EnDemanda
.Add("@EnQuebranto", SqlDbType.Bit).Value = EnQuebranto
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -3201,7 +3201,7 @@ Public Class ClsContratos
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
DataAdapter("PA_Con_PresupuestosResumenGet")
@@ -3209,6 +3209,8 @@ Public Class ClsContratos
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
End With
Try

View File

@@ -3,8 +3,6 @@ Option Strict On
Imports System.Data
Imports System.Data.SqlClient
Imports Extensiones
Imports Microsoft.Web.XmlTransform
Imports Telerik.Web.UI.ComboBox.ComboBoxStyles
Public Class ClsInventarios
Implements IDisposable
@@ -1357,7 +1355,7 @@ Public Class ClsInventarios
End If
Catch Ex1 As SqlException
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
Me.OnError("El movimiento debe de tener una Serie.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
@@ -3326,11 +3324,12 @@ Public Class ClsInventarios
#End Region
#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
DataAdapter("PA_Inv_EntregaAlmacenGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
End With
Try

View File

@@ -1952,12 +1952,18 @@ Public Class ClsPaginas
If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjInventarios.DtResultados
ObjInventarios.Dispose()
End If
Dim Str As New StringBuilder
If CveCamion > 0 Then Str.AppendFormat("CveCamion = {0}", CveCamion)
If CveTipoCamion > 0 Then Str.AppendFormat("CveTipoCamion = {0}", CveTipoCamion)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTInvCamiones = Dv.ToTable
Dv.Dispose()
Dim filtros As New List(Of String)
If CveCamion >= 0 Then filtros.Add($"CveCamion = {CveCamion} ")
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
Dv.Dispose()
Else
GlobalDTInvCamiones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTInvCamiones-{CveEmpresa}"
@@ -6984,6 +6990,15 @@ Public Class ClsPaginas
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
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
'PARAMETROS SEGUN TIPO DOCUMENTO
@@ -7022,16 +7037,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("Ref", TipoDocumentoRef))
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
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122, 145) Then
'DATOS CLIENTES
@@ -7081,15 +7087,6 @@ Public Class ClsPaginas
params.Add(New ReportParameter("Ref", TipoDocumentoRef))
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)
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
@@ -7115,11 +7112,11 @@ Public Class ClsPaginas
params.Add(New ReportParameter("CveVenta", Vta.CveVenta.ToString))
End If
'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))
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("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("SucursalCliente", If(Vta.ClienteSucursal.Sucursal Is Nothing, "", Vta.ClienteSucursal.Sucursal.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)
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
Case "Egs"
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
NombreArchivo = "NotaCredito"
Else
NombreArchivo = "Factura"
End If
NombreArchivo = "Factura"
NombreArchivoDescarga = "Nota de Crédito"
TipoDocumento = "EGRESO"
TipoDocumentoRef = String.Format(": Ref.:{0}", Vta.RefDocto)
@@ -7163,22 +7157,7 @@ Public Class ClsPaginas
params.Add(New ReportParameter("Tipo", TipoDocumento))
params.Add(New ReportParameter("Ref", TipoDocumentoRef))
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)
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
Case "Ped"
@@ -7192,14 +7171,6 @@ Public Class ClsPaginas
params.Add(New ReportParameter("AplicaPagare", AplicaPagare))
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)
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
@@ -7616,116 +7587,6 @@ Public Class ClsPaginas
Return o.Value
End If
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
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()
Dim bytes As Byte() = Nothing
Dim CveEmpresaActual As Integer
Dim TmpDTEnvioDireccion As DataTable
Dim params As New List(Of ReportParameter)
Try
Dim DtDetalle As DataTable = Nothing
@@ -7774,68 +7634,6 @@ Public Class ClsPaginas
'Obtenemos la sucursal de la OC PARA COMPU PROVEEDORES
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 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)
@@ -7846,10 +7644,10 @@ Public Class ClsPaginas
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
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
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
End If
ObjRH.Dispose()
@@ -7861,9 +7659,6 @@ Public Class ClsPaginas
End If
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))
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)))

View File

@@ -150,6 +150,14 @@ Public Class ClsSisNotificaciones
#End Region
#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)
_CveNotificacion = CveNotificacion
@@ -1814,7 +1822,7 @@ Public Class ClsSisNotificaciones
'Next
Dim lista As New List(Of String)
lista.Add(CveUsuario.ToString())
Notificaciones.AlertaVentana(Mensaje, lista, Titulo, timeoutseconds)
'Notificaciones.AlertaVentana(Mensaje, lista, Titulo, timeoutseconds)
End Sub
'Public Sub SendNotificacionGPS(context As IHubContext, CveUsuario As Integer, JsonParams As String)
' context.Clients.All.DisparaNotificacionUsuario(CveUsuario,)

View File

@@ -209,6 +209,25 @@ Public Class ClsSisProcesos
Return OnError
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
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then

View File

@@ -191,7 +191,7 @@ Public Class ClsSisUsuarios
End Try
Return Retorno
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
DataAdapter("PA_Sis_UsuarioValidacionGet")
With SqlAdapter.SelectCommand.Parameters
@@ -253,7 +253,7 @@ Public Class ClsSisUsuarios
'cargo los modulos del usuario y genero el menú
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
For Each Row As DataRow In dttmp.Rows
@@ -481,7 +481,7 @@ Public Class ClsSisUsuarios
Retorno.Portal = True
Retorno.Referencia = Data.Rows(0)("Referencia").ToString
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ú
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveCliente)
@@ -538,7 +538,7 @@ Public Class ClsSisUsuarios
Retorno.Portal = True
Retorno.Referencia = Data.Rows(0)("Referencia").ToString
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ú
Dim dttmp As DataTable = GetUsuariosRolesModulos(Retorno.CveUsuario, Retorno.CveProveedor)

View File

@@ -751,6 +751,22 @@ Public Class ClsVentas
Return Retorno
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
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasFechaVencimientoUpdate")
@@ -1961,14 +1977,14 @@ Public Class ClsVentas
Return Retorno
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 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
DataAdapter("PA_Vta_RepPSEconoGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveSubProyectos", SqlDbType.VarChar).Value = CveSubProyectos
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
@@ -6916,6 +6932,83 @@ Public Class ClsVentas
#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"
Public Function UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle As Integer, CantidadDevolucion As Decimal) As Boolean

View File

@@ -5606,7 +5606,7 @@ Namespace Modelos
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
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.TipoMensaje = TipoMensaje.MsgAdvertencia
@@ -6446,7 +6446,7 @@ Namespace Modelos
'VERIFICA LOS MOVIMIENTOS DE DEVOLUCION YA GENERADOS QUE TENGAN EXISTENCIA EN (ENTREGA POR ADELANTADO)
If Not ErrorCancelar 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()
'SI ES SERVICIO A DOMICILIO DEBE REGRESAR A ESTE TIPO DE ALMACEN
If Me.ServicioDomicilio Then
@@ -6456,6 +6456,7 @@ Namespace Modelos
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToEntero()
If CveAlmacenExA <= 0 Then
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 4").ToEntero()
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen IN (4)")
End If
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()

View File

@@ -1,55 +1,75 @@
Option Strict Off
Imports Extensiones
Imports Microsoft.AspNet.SignalR
Public Enum TipoNotificacion As Integer
ToastInformacion = 5 'succes
ToastInformacionB = 6 'info
ToastError = 7 'error
ToastAdventencia = 8 'Warning
AlertaVentana = 2
AlertaVentanaNoOcultar = 1
End Enum
Public Class Notificaciones
Inherits Hub
Public Overrides Function OnConnected() As System.Threading.Tasks.Task
Return MyBase.OnConnected()
End Function
Public Overrides Function OnReconnected() As System.Threading.Tasks.Task
Return MyBase.OnReconnected()
End Function
Public Overrides Function OnDisconnected(stopCalled As Boolean) As Threading.Tasks.Task
Return MyBase.OnDisconnected(stopCalled)
End Function
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)
Dim lPara As New List(Of String)
lPara.Add(Para)
AlertaVentana(Message, lPara, Titulo, timeoutseconds, Tipo)
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)
If (Para IsNot Nothing) AndAlso Para.Count > 0 Then
Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients
Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds)
End If
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
Public Class MyhubUserIdProvider
Implements IUserIdProvider
Private Function IUserIdProvider_GetUserId(request As IRequest) As String Implements IUserIdProvider.GetUserId
Dim userId = Decripta(request.User.Identity.Name) 'MyCustomUserClass.FindUserId(request.User.Identity.Name)
Return userId.ToString()
End Function
End Class
Option Strict Off
Imports System.Collections.Concurrent
Imports Extensiones
Imports Microsoft.AspNet.SignalR
Public Enum TipoNotificacion As Integer
ToastInformacion = 5 'succes
ToastInformacionB = 6 'info
ToastError = 7 'error
ToastAdventencia = 8 'Warning
AlertaVentana = 2
AlertaVentanaNoOcultar = 1
End Enum
Public Class Notificaciones
Inherits Hub
Public Shared UsuariosConexiones As ConcurrentDictionary(Of String, String) = New ConcurrentDictionary(Of String, String)
Public Overrides Function OnConnected() As System.Threading.Tasks.Task
NotificarConexion()
Return MyBase.OnConnected()
End Function
Public Overrides Function OnReconnected() As System.Threading.Tasks.Task
NotificarConexion()
Return MyBase.OnReconnected()
End Function
Public Overrides Function OnDisconnected(stopCalled As Boolean) As Threading.Tasks.Task
Return MyBase.OnDisconnected(stopCalled)
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 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)
lPara.Add(Para)
AlertaVentana(Message, lPara, Titulo, timeoutseconds, Tipo)
End Sub
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
Dim Clients As Hubs.IHubConnectionContext(Of Object) = GlobalHost.ConnectionManager.GetHubContext(Of Notificaciones)().Clients
Clients.Users(Para).AlertaVentana(Titulo, Message, DirectCast(Tipo, Integer), timeoutseconds)
End If
End Sub
End Class
Public Class MyhubUserIdProvider
Implements IUserIdProvider
Private Function IUserIdProvider_GetUserId(request As IRequest) As String Implements IUserIdProvider.GetUserId
Dim userId = Decripta(request.User.Identity.Name) 'MyCustomUserClass.FindUserId(request.User.Identity.Name)
Return userId.ToString()
End Function
End Class

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 CveUsuario As Integer = 100
Private ReadOnly Property NombreCadena As String = "Conexion"
Public ReadOnly Property EsProduccion As Boolean
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"
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
Dim UsuarioActual As Usuario = Nothing
Dim ObjUsuarios As New ClsSisUsuarios
Dim ObjUsuarios As New ClsSisUsuarios(NombreCadena:=NombreCadena)
If ObjUsuarios.GetUsuarios(CveUsuario) Then
If ObjUsuarios.DtResultados.Rows.Count > 0 Then
Dim Usuario As String = ObjUsuarios.DtResultados.Rows(0)("Usuario").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
HttpContext.Current.Session("UsuarioSIG") = 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 UsaGlobal As Boolean = True
Dim MostrarTodosAlmacenes As Boolean = False
Dim MostrarTodosAlmacenes As Boolean = True
'verifica existencias
If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso usuario.Empresa.Funcionalidad(141) = "1" Then
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
MostrarTodosAlmacenes = True
End If
'If (usuario.Empresa.Funcionalidad(578) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then 'sms
' MostrarTodosAlmacenes = True
'End If
If (usuario.Empresa.Funcionalidad(578) = "1") AndAlso Pagina.Contiene("ventas/ventas") Then 'sms
MostrarTodosAlmacenes = True
End If
'If (usuario.Empresa.CveEmpresa.Contiene(189, 193, 195, 197)) AndAlso Pagina.Contiene("ventas/ventas") Then 'sms
' MostrarTodosAlmacenes = True
'End If
Dim objInv As New ClsInventarios
Try

View File

@@ -37,6 +37,9 @@
</asp:Content>
<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>
<asp:LinkButton ID="LnkImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
</li>--%>
@@ -151,10 +154,14 @@
</div>
<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: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 class="col-md-1">
<label style="width: 70px;">Fecha:</label>
<label style="width: 50px;">Fecha:</label>
</div>
<div class="col-md-2" runat="server" style="text-align: left;">
@@ -172,16 +179,22 @@
</div>
</div>
<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 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:ListItem Value="13" Text="Efectivo" Selected="True"></asp:ListItem>
<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="-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="11" Text="Tarjeta de Débito"></asp:ListItem>
<asp:ListItem Value="12" Text="Tarjeta de Crédito"></asp:ListItem>
<asp:ListItem Value="8" Text="Transferencia"></asp:ListItem>
</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 class="col-md-1" runat="server" id="divFolio" visible="false">
<div class="row">

View File

@@ -38,6 +38,9 @@ Partial Class Bancos_DepositosCaja
BtnConsultar.Attributes.Add("onclick", "Consultar(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 Sub
@@ -286,8 +289,13 @@ Partial Class Bancos_DepositosCaja
End If
End If
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
CveTransaccionBanco = 6
End If
@@ -350,9 +358,9 @@ Partial Class Bancos_DepositosCaja
If Not OcurrioError AndAlso ChkCuentaRetorno.Checked Then
CveTransaccionBanco = 13
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
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")
End If
If Not OcurrioError AndAlso ObjConta.ValidacionesPrePoliza(NuevaCvePrePoliza, UsuarioActual, Opcion:=1) Then

View File

@@ -27,7 +27,7 @@
</ContentTemplate>
</asp:UpdatePanel>
<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>
<asp:UpdatePanel ID="UppEliminarIE" runat="server" UpdateMode="Conditional">
<ContentTemplate>

View File

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

View File

@@ -67,7 +67,7 @@
</div>
<div class="col-md-5" runat="server" id="DivTC" visible="false">
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>
<ajax:ValidatorCalloutExtender ID="VCETC" runat="server" HighlightCssClass="vco" TargetControlID="RFVTC" Width="350px"></ajax:ValidatorCalloutExtender>
<asp:Label ID="LbImporteME" Text="" ClientIDMode="Static" runat="server" />

View File

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

View File

@@ -364,7 +364,7 @@
<div class="row">
<div class="col-md-3">
<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%">
<Columns>
<asp:BoundField HeaderText="Método Pago" DataField="MetodoPago" />
@@ -385,7 +385,7 @@
</div>
<div class="col-md-3" id="DivDep" runat="server" visible="false" style="max-height: 440px; overflow: auto">
<br />
<b>Depósitos Caja</b>
<b>Depósitos de caja</b>
<div class="row">
<div class="col-md-12">
<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 class="col-md-4" id="DivAnexo" runat="server" visible="false">
<br />
<b>Contabilidad</b>
<b>Estado contable de la caja</b>
<div class="row">
<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%">

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">
<Columns>
<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: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="Observaciones" HeaderText="Observaciones" ItemStyle-HorizontalAlign="Left"></asp:BoundField>
<asp:BoundField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" DataField="EstatusIE" HeaderText="Estatus"></asp:BoundField>

View File

@@ -5918,56 +5918,58 @@
}
function chkAnt(t, txt, importe, TotalSaldoCompra, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, TCCompra, txtComision) {
var Total = ToDouble($get('TxtTotal').value);
debugger;
var txtvalue = ToDouble(txt.value);
var ImportePago, ImporteCompra;
function chkAnt(t, txt, importe, TotalSaldoCompra, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, TCCompra, txtComision) {
var Total = ToDouble($get('TxtTotal').value);
debugger;
var txtvalue = ToDouble(txt.value);
var ImportePago, ImporteCompra;
var TCC = TCCompra / TCAnticipo;
var importevalue = ToDouble(importe);
var TCC = TCCompra / TCAnticipo;
var importevalue = ToDouble(importe);
if (CveMonedaAnticipo != CveMonedaOriginal) {
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
txtvalue = ToDouble(txtvalue / TCAnticipo);
importevalue = ToDouble(importevalue / TCAnticipo);
} else if (CveMonedaAnticipo == 2 && CveMonedaOriginal == 1) {
txtvalue = ToDouble(txtvalue * TCAnticipo);
importevalue = ToDouble(importevalue * TCAnticipo);
if (CveMonedaAnticipo != CveMonedaOriginal) {
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
txtvalue = ToDouble(txtvalue / TCAnticipo);
importevalue = ToDouble(importevalue / TCAnticipo);
} else if (CveMonedaAnticipo == 2 && CveMonedaOriginal == 1) {
txtvalue = ToDouble(txtvalue * TCAnticipo);
importevalue = ToDouble(importevalue * TCAnticipo);
}
}
}
else { TCC = 1; }
var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt());//.toFixed(2); // le agrego lo del valor actual para validarlo
else { TCC = 1; }
var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt());//.toFixed(2); // le agrego lo del valor actual para validarlo
if (t.checked)
{
if (DifSaldo > importevalue) {
txt.value = toFixed(ToDouble(importevalue * TCC), 2);
} else {
txt.value = toFixed(ToDouble(DifSaldo * TCC), 2);
if (t.checked)
{
if (DifSaldo > importevalue) {
txt.value = toFixed(ToDouble(importevalue * TCC), 2);
} else {
txt.value = toFixed(ToDouble(DifSaldo * TCC), 2);
}
if (txtComision !== undefined && txtComision !== null) {
let difFinal = (DifSaldo - importevalue) * TCC;
if (difFinal > 0 && difFinal < 1) {
txtComision.value = toFixed(roundToTwo(difFinal), 2);
}
}
} else {
txt.value = "";
}
let difFinal = (DifSaldo - importevalue) * TCC;
if (difFinal > 0 && difFinal < 1) {
txtComision.value = toFixed(roundToTwo(difFinal), 2);
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2));
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldoCompra - FnSumaValoresAnt(), 2));
} else {
txt.value = "";
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2));
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldoCompra - FnSumaValoresAnt(), 2));
}
function roundToTwo(num) {
return Math.round(num * 100) / 100;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1610,7 +1610,9 @@ Partial Class PopUpVerFactura
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
DtMetodosPago = DtCortesVentasResumen.FiltraParametros("MetodoPago <> 'Crédito'")
End If
Dim DirFormato As String = "Empresas/Grales/Formatos/RepCortes.rdlc"
If File.Exists(UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc") Then
DirFormato = UsuarioActual.Empresa.Ruta + "\Formatos\RepCortes.rdlc"
End If
@@ -3378,7 +3380,7 @@ Partial Class PopUpVerFactura
If UsuarioActual.CveEmpresa.Contiene(172, 173) Then
ImprimirPDFStimul("Empresas/Grales/Formatos/EntradaSalida.mrt", DtMovimientos, params, String.Format("Salida de Almacen - {0}", Folio.ToString))
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
@@ -5380,6 +5382,15 @@ Partial Class PopUpVerFactura
If ObjIE.GetBancosIEMovimientosDepositos(CveIE, UsuarioActual.CveEmpresa) Then
Tabla = ObjIE.DtResultados.Copy()
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()
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("CuentaDeposito", CuentaDeposito))
params.Add(New ReportParameter("TipoPago", TipoPago))
params.Add(New ReportParameter("TipoTransaccion", TipoTransaccion))
params.Add(New ReportParameter("Observaciones", Observaciones))
If Archivo.Exists Then
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
@@ -5753,14 +5766,14 @@ Partial Class PopUpVerFactura
If ObjIE.DtResultados.Rows.Count > 0 Then
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
If ObjIE.GetBancosIEFacturasPagadas(CveIE, UsuarioActual.CveEmpresa) Then
dtMovs = ObjIE.DtResultados.FiltraParametros("CveConceptoContable IN (17,2,308,309,312,292 )")
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
'CONVIERTO A PESOS CUANDO SE PAGA CON PESOS FACTURAS DE DOLARES
@@ -5805,7 +5818,7 @@ Partial Class PopUpVerFactura
End With
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

View File

@@ -155,7 +155,7 @@
<div class="row">
<div class="col-md-12">
<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>
<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>
@@ -187,8 +187,8 @@
</div>
<div class="col-md-6">
<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>
<label for="<%= TxtUsuarioElaboro.ClientID.ToString()%>">Usuario Elaboró: </label>
<asp:Label CssClass="form-control" ID="LblUsuarioElaboro" runat="server" MaxLength="15" ></asp:Label>
<label for="<%= LblUsuarioElaboro.ClientID.ToString()%>">Usuario Elaboró: </label>
</div>
</div>
</div>
@@ -288,7 +288,7 @@
</div>
<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-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>
</div>
</div>
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
<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"
@@ -333,7 +334,8 @@
<asp:TemplateField>
<HeaderTemplate>Concepto</HeaderTemplate>
<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>
<ItemStyle />
</asp:TemplateField>
@@ -621,9 +623,7 @@
<div class="row">
<asp:Label ID="LblFolioDoc" runat="server" Text="Número:" class="col-md-2"></asp:Label>
<div class="col-md-4">
<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>
<asp:TextBox ID="TxtDocumentoFolio" CssClass="form-control input-sm" value="0" runat="server" MaxLength="12"></asp:TextBox>
</div>
<label class="col-md-2">Importe</label>
<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>
</div>
</div>
<div class="row">
<label class="col-md-12">sino se especifica el folio, se genera en automático:</label>
</div>
</div>
</asp:Panel>
</div>
@@ -1200,9 +1203,17 @@
}
function valorIE() {
}
function asignaConcepto() {
let valor = $('#TxtConcepto').val();
$('input[type="text"].selTxtConcepto').val(valor);
}
</script>
</asp:Content>

View File

@@ -1,4 +1,7 @@
Imports System.Data
Imports System.Runtime.CompilerServices
Imports System.Runtime.Remoting
'Imports DocumentFormat.OpenXml
Imports Extensiones
Imports GemBox.Spreadsheet
@@ -321,7 +324,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy")
TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy")
TxtConcepto.Enabled = True
TxtUsuarioElaboro.Text = UsuarioActual.Nombre
LblUsuarioElaboro.Text = UsuarioActual.Nombre
End If
@@ -349,7 +352,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy")
TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy")
TxtConcepto.Enabled = True
TxtUsuarioElaboro.Text = UsuarioActual.Usuario
LblUsuarioElaboro.Text = UsuarioActual.Usuario
End If
@@ -409,6 +412,7 @@ Partial Class ContabilidadC_RegPrePolizaS
.Add("EsMonedaExtranjera", Type.GetType("System.Boolean"))
.Add("TC", Type.GetType("System.Decimal"))
.Add("CvePrePoliza", Type.GetType("System.Int32"))
.Add("CveMovimientoAlmacen", Type.GetType("System.Int32"))
End With
@@ -429,6 +433,7 @@ Partial Class ContabilidadC_RegPrePolizaS
DtMovimientosEliminar.AcceptChanges()
End Sub
Private Function CargaPrePoliza(tCvePrePoliza As Integer) As Boolean
HplImprimirPDF.Visible = False
Dim retorno As Boolean = False
Dim ObjContabilidad As New ClsContabilidad
If ObjContabilidad.GetPrePoliza(tCvePrePoliza, UsuarioActual.CveEmpresa) Then
@@ -448,14 +453,13 @@ Partial Class ContabilidadC_RegPrePolizaS
Folio = 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.ToolTip = dr("FechaIng").ToString.ToDate.ToString("HH:mm:ss")
CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString.ToEntero
DdlPlantilla.SelectedValueExist(CvePlantillaPoliza)
HplImprimirPDF.NavigateUrl = $"/Compras/PopUpVerFactura.aspx?P={Encripta($"OP=PREPO&CvePrePoliza={CvePrePoliza}")}"
HplImprimirPDF.Visible = True
If UsuarioActual.CveRol = 1 Then TxtUsuarioElaboro.ToolTip = dr("Modulo").ToString
LblUsuarioElaboro.ToolTip = dr("Modulo").ToString
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then
LnkAddConcepto.Visible = True
@@ -528,6 +532,23 @@ Partial Class ContabilidadC_RegPrePolizaS
RegistraScript("comparar();")
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
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
BtnEliminar.Visible = False
@@ -792,7 +813,7 @@ Partial Class ContabilidadC_RegPrePolizaS
GvMov.DataSource = DtMovimientos
GvMov.DataBind()
GvPrePoliza.DataBind() ''limpio el grid
GvPrePoliza.DataBind()
UpPrePoliza.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("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
e.Row.FCTextBox("TxtCargo").Enabled = False
@@ -835,7 +856,8 @@ Partial Class ContabilidadC_RegPrePolizaS
e.Row.FCDropDownList("DdlSubProyecto").Enabled = True
e.Row.FCLinkButton("imgD").Visible = True
Else
e.Row.FCDropDownList("DdlSubProyecto").Enabled = False
'
'e.Row.FCDropDownList("DdlSubProyecto").Enabled = False
End If
If e.Row.DBCampo("MultipleSubProyecto") = "True" Then
@@ -1012,7 +1034,7 @@ Partial Class ContabilidadC_RegPrePolizaS
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
CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
Else
@@ -1667,6 +1689,35 @@ Partial Class ContabilidadC_RegPrePolizaS
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("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text
dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text
@@ -1717,11 +1768,22 @@ Partial Class ContabilidadC_RegPrePolizaS
End If
DtMovimientos.AcceptChanges()
GvPrePoliza.EditIndex = -1
GvPrePoliza.DataSource = DtMovimientos
GvPrePoliza.DataBind()
UpPrePoliza.Update()
GvPrePoliza.Visible = True
If DdlPlantilla.SelectedValue.ToEntero <> 53 Then
GvMov.DataSource = DtMovimientos
GvMov.DataBind()
GvPrePoliza.DataBind()
UpPrePoliza.Update()
UPMovs.Update()
Else
GvPrePoliza.EditIndex = -1
GvPrePoliza.DataSource = DtMovimientos
GvPrePoliza.DataBind()
UpPrePoliza.Update()
GvPrePoliza.Visible = True
End If
TxtTotalCargos.Text = DtMovimientos.SUMD("Cargo").ToString.FormatoNumero
TxtTotalAbonos.Text = DtMovimientos.SUMD("Abono").ToString.FormatoNumero
@@ -1964,7 +2026,7 @@ Partial Class ContabilidadC_RegPrePolizaS
'Folio = TxtDocumentoFolio.Text
'ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal
'Observaciones = TxtDocumentoObservaciones.Text
'Beneficiario = TxtDocumentoBeneficiario.Text
'Beneficiario = TxtDocumentoBeneficiario.TextTxtReferenciaE
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal"))
@@ -2606,7 +2668,7 @@ Partial Class ContabilidadC_RegPrePolizaS
divContabilizada.Visible = False
TxtFolio.Text = ""
TxtUsuarioElaboro.Text = UsuarioActual.Usuario
LblUsuarioElaboro.Text = UsuarioActual.Usuario
End Sub

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -658,7 +658,7 @@ Partial Class Inventarios_EntregaAlmacen
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
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()
CveVentaSurtir = CveVenta
CveOSSurtir = CveOS
If TipoDocto = "Ped" And CveOSSurtir <= 0 Then
CveOSSurtir = drE("CveOS").ToString().ToEntero
End If
CveTipoVenta = drE("CveTipoVenta").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()
@@ -1062,7 +1067,8 @@ Partial Class Inventarios_EntregaAlmacen
If CargaBitacora Then
CargaBitacoraSerie()
End If
End If
Else
End If
End If
@@ -2167,15 +2173,13 @@ Partial Class Inventarios_EntregaAlmacen
DtDatos.Rows(Index)("Lote") = gvr.FCTextBox("TxtLote").Text
End If
End If
Index += 1
Next
'VALIDA SI HUBO CAMBIOS EN LA EXISTENCIA
Dim DtDatosVenta As New DataTable
If ObjInventario.EntregaAlmacenGet(CveVentaSurtir) Then
If ObjInventario.EntregaAlmacenGet(CveVentaSurtir, UsuarioActual.CveEmpresa) Then
DtDatosVenta = ObjInventario.DtResultados
End If
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)
End Try
If EsDevolucionVenta = 1 AndAlso CveOSSurtir > 0 AndAlso TipoMovimiento = 2 AndAlso TipoDocto = "Ped" Then
If Not ErrorMovInv AndAlso EsDevolucionVenta = 1 AndAlso CveOSSurtir > 0 AndAlso TipoMovimiento = 2 AndAlso TipoDocto = "Ped" Then
If Not CierreOS(CveOSSurtir, CveMovimiento, ObjInventario.IniciaTransacSQL) Then
ErrorMovInv = True
Alert("Error al finalizar orden de servicio", TipoMensaje.MsgError)
@@ -4352,7 +4354,13 @@ Partial Class Inventarios_EntregaAlmacen
Private Sub RecargaporAlmacenes()
If DdlAlmacen.SelectedValue <> "-1" Then
CargaGvDatos()
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
CargaGvDatos(False)
Else
CargaGvDatos()
End If
End If
End Sub

View File

@@ -1,7 +1,6 @@
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports Stimulsoft.Report.QuickButtons.StiWpfQuickButtonAttribute
Partial Class RepNotasSinAlmacen
Inherits ClsPaginas
@@ -122,8 +121,8 @@ Partial Class RepNotasSinAlmacen
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim Reporte As New ClsInventarios
Private Sub CargaDatos()
Dim CveClienteProveedor As Integer = -1
Dim TipoDocumento As String = DdlTipoDocto1.SelectedValue
@@ -139,14 +138,18 @@ Partial Class RepNotasSinAlmacen
Else
CveClienteProveedor = DdlCliente.SelectedValue.ToEntero
End If
If Reporte.RepNotasSinAlmacen(Opcion, CveClienteProveedor, FechaInicial, FechaFinal, TipoDocumento, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then
Dim Reporte As New ClsInventarios
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
DtNotasSinAlmacenVentas = Reporte.DtResultados
Else
GvVentas.DataSource = Nothing
End If
End If
Reporte.Dispose()
GvVentas.DataBind()
Else
@@ -155,15 +158,15 @@ Partial Class RepNotasSinAlmacen
CveClienteProveedor = -1
Else
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
GvCompras.DataSource = Reporte.DtResultados
DtNotasSinAlmacenCompras = Reporte.DtResultados
Else
GvCompras.DataSource = Nothing
End If
End If
Reporte.Dispose()
GvCompras.DataBind()
'If (GvCompras.Rows.Count > 0) Then
@@ -174,8 +177,8 @@ Partial Class RepNotasSinAlmacen
End If
UpDatosGvVentas.Update()
UpDatosGvCompras.Update()
Reporte.Dispose()
UpDatosGvCompras.Update()
End Sub

View File

@@ -6,7 +6,6 @@ Imports System.Data.SqlClient
Imports System.IO
Imports Extensiones
Imports GemBox.Spreadsheet
Imports Microsoft.Owin.Security.Provider
Imports Newtonsoft.Json
Partial Class OC_OC
@@ -926,13 +925,13 @@ Partial Class OC_OC
ChkEntregaDirecta.Checked = False
End If
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
Alert("PrePoliza de Presupuesto Generada Correctamente")
Else
Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia)
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 GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then
' Alert("PrePoliza de Presupuesto Generada Correctamente")
' Else
' Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia)
' End If
'End If
End If
@@ -2218,51 +2217,11 @@ Partial Class OC_OC
Exit Sub
End If
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
Exit Sub
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 RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal
Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal
@@ -2642,10 +2601,17 @@ Partial Class OC_OC
End If
If Not ValidaTotales() Then
TieneError = True
End If
Return TieneError
End Function
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
'VALIDACIONES PARA GUARDAR
If ValidaGuardar() Then Exit Sub
@@ -2653,6 +2619,8 @@ Partial Class OC_OC
Exit Sub
End If
Dim MsgError As String = "Hubo un error al registrar"
'VARIABLES
Dim CveProveedorSucursal As Integer = -1
@@ -3348,6 +3316,30 @@ Partial Class OC_OC
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
'If Ddlcliente.txtValue.Value.ToEntero > 0 And DdlVendedor.SelectedValue.ToEntero <= 0 Then
@@ -3521,8 +3513,7 @@ Partial Class OC_OC
End If
If UsuarioActual.CveEmpresa.Contiene(13, 73) Then
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then
HuboError = True
@@ -3530,7 +3521,6 @@ Partial Class OC_OC
End If
Catch ex As Exception
HuboError = True
End Try
@@ -3687,6 +3677,10 @@ Partial Class OC_OC
TieneError = True
End If
If (UsuarioActual.Empresa.Funcionalidad(532) = "1") Then
GeneraPrePolizaPresupuesto(CveOrdenCompra, objOrdenCompra.IniciaTransacSQL, True)
End If
If IDPolizaPresupuestal > 0 AndAlso UsuarioActual.Empresa.UsaAC Then
PolizaCancelacion = CancelarAC(ObjAC)
@@ -9051,59 +9045,50 @@ Partial Class OC_OC
Dim respuesta As Boolean = False
'If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then
If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
Dim ObjCon As New ClsContratos
Dim CvePresupuesto As Integer = 0
Dim Autorizado As Double = 0
Dim Ejercido As Double = 0
If ObjCon.GetPresupuestosResumen(UsuarioActual.CveEmpresa, -1, 2) Then
Dim FechaCompra As Date = TxtFecha.Text.ToDate
Dim Autorizado As Decimal = 0
Dim Ejercido As Decimal = 0
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()
Where FechaCompra >= row.Field(Of Date)("FechaInicio") AndAlso
FechaCompra <= row.Field(Of Date)("FechaFin")
Select row
If resultadosFiltrados.Count > 0 Then
If ObjCon.DtResultados.Rows.Count > 0 Then
If Opcion = 1 Then
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = ValCveSubProyecto)
If tieneRegistrosConCveSubProyecto Then
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
Where row.Field(Of Integer)("CveSubProyecto") = ValCveSubProyecto AndAlso
row.Field(Of Integer)("CveClasificacion") = ValCveClasificacion
Select row.Field(Of Decimal)("Saldo")).Sum()
Select row.Field(Of Decimal)(ColumnaSaldo)).Sum()
If saldoTotal > 0 Then
Dim TotalAcumuladoTabla As Decimal = (DtDetalle.SUM("Total", $" CveSubProyecto = {ValCveSubProyecto} AND CveClasificacion = {ValCveClasificacion} "))
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
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
Else
respuesta = True
End If
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
End If
Else
respuesta = True
End If
Else
Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable()
Group row By
SubProyecto = row.Field(Of String)("SubProyecto"),
@@ -9127,21 +9112,20 @@ Partial Class OC_OC
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()
Select row.Field(Of Decimal)(ColumnaSaldo)).Sum()
If saldoTotal > 0 Then
Dim Diferencia As Decimal = saldoTotal - item.TotalSum
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
Exit For
Else
respuesta = True
End If
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
Exit For
End If
@@ -9149,7 +9133,6 @@ Partial Class OC_OC
respuesta = True
End If
Next
End If
Else
@@ -9160,46 +9143,32 @@ Partial Class OC_OC
'Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia)
respuesta = False
End If
ObjCon.Dispose()
Else
respuesta = True
End If
Return respuesta
End Function
Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPresupuesto As Integer, Optional ByRef transaccion As SqlTransaction = Nothing) As Boolean
Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPresupuesto As Integer, Optional ByRef transaccion As SqlTransaction = Nothing, Optional EsCancelacion As Boolean = False) As Boolean
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 TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal)
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
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
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
If CvePrePolizaPresupuesto > 0 Then
Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable()
Group row By
@@ -9219,37 +9188,28 @@ Partial Class OC_OC
For Each item In EnumAgrupado
Dim SerieFolio = $"OC: {Folio}, Clasificación: {item.Clasificacion}"
Dim Multiplicador As Decimal = If(EsCancelacion, -1, 1)
Dim Importe As Decimal = item.TotalSum
Dim ImporteME As Decimal = If(CveMonedaPresupuesto = 1, 0, item.TotalSum)
Dim ImporteMN As Decimal = If(CveMonedaPresupuesto = 1, item.TotalSum, item.TotalSum * TC)
Dim Importe As Decimal = Multiplicador * item.TotalSum
Dim ImporteME As Decimal = Multiplicador * If(CveMonedaPresupuesto = 1, 0, item.TotalSum)
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
Respuesta = False
Exit For
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 : Exit For
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
Respuesta = False
Exit For
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
End If
Next
Else
Respuesta = False
End If
End If
Return Respuesta
End Function
#End Region

View File

@@ -302,21 +302,27 @@ Partial Class Portal_PortalProveedor
#Region "C A R G A - D A T O S"
Protected Sub CargaDatos()
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
Dim drp As DataRow = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimero($"CveProveedor = {CveProveedor}")
'CxP
LtlProveedor.Text = ObjProveedor.RazonSocial
lblLimiteCredito.Text = ObjProveedor.LimiteCredito.ToString
lblPlazoCobranza.Text = ObjProveedor.PlazoPago.ToString
Else
Alert("Ocurrió un error al cargar los datos.", TipoMensaje.MsgError)
End If
If drp IsNot Nothing Then
LtlProveedor.Text = drp("RazonSocial").ToString
lblLimiteCredito.Text = drp("LimiteCredito").ToString.ToDecimal.FormatoNumero
lblPlazoCobranza.Text = drp("PlazoPago").ToString
End If
ObjProveedor.Dispose()
'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
' LtlProveedor.Text = ObjProveedor.RazonSocial
' lblLimiteCredito.Text = ObjProveedor.LimiteCredito.ToString
' lblPlazoCobranza.Text = ObjProveedor.PlazoPago.ToString
' Else
' Alert("Ocurrió un error al cargar los datos.", TipoMensaje.MsgError)
' End If
'End If
'ObjProveedor.Dispose()
End Sub
@@ -357,9 +363,9 @@ Partial Class Portal_PortalProveedor
If ObjMovtos.GetCxPProveedor(CveProveedor, "-1", "-1", -1, -1, -1, -1, -1, -1, DdlProveedorSucursalCxCSucursal.SelectedValue.ToEntero, -1) Then
GvCxP.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda,OrdenVencimiento, FechaVencimiento")
'solo tomo los 10 ultimos mas el totalizador general
GvCxP.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda,OrdenVencimiento, FechaVencimiento")
'solo tomo los 10 ultimos mas el totalizador general
Dim dt As DataTable = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'")
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then

View File

@@ -14,16 +14,16 @@ var NotificacionesADS = function () {
if (Notification.permission !== 'denied') {
Notification.requestPermission(function (permission) {
// If the user accepts, let's create a notification
//if (permission === "granted") {
//}
if (permission === "granted") {
}
});
}
}
}
//-------------------------------------------------------------------- Eventos ----------------------------------------------------------------------
var AlertaVentana = function (Titulo, Mensaje, Tipo, timeoutseconds, Opciones) {
var AlertaVentana = function (Titulo, Mensaje, Tipo, timeoutseconds) {
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);
localStorage.setItem("ADSNotificaciones", myjson);
execAlertaVentana(obj);
@@ -117,11 +117,11 @@ var NotificacionesADS = function () {
var proxy = $.connection.notificaciones;
/*$.connection.hub.url = '/signalr';*/
$.connection.hub.disconnected(function () {
console.log(' (SignalR) diconnected');
console.log(' (SignalR) disconnected');
signalrconectionStar(1200);
});
proxy.client.AlertaVentana = AlertaVentana;
proxy.client.alertaVentana = AlertaVentana;
proxy.client.Execstring = Execstring;
@@ -139,7 +139,7 @@ var NotificacionesADS = function () {
nointentos = nointentos + 1;
if (nointentos < maxintentos) {
$.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);
}

View File

@@ -27,7 +27,7 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
'Dim DtEmp As DataTable = GlobalDTEmpresas.Copy
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
'' Dim customerRow() As Data.DataRow
@@ -92,8 +92,25 @@ Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
tUsuario = gvr.DataKey("Usuario").ToString
tContraseña = gvr.DataKey("Contraseña").ToString
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 UsuarioAsignaciones As Usuario

View File

@@ -59,10 +59,26 @@ Partial Class PopUpSeleccionarEmpresa
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
If gvr IsNot Nothing Then
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario = Nothing
If gvr IsNot Nothing Then
Dim tGrupoEmpresa As String = ""
Dim NombreCadena As String = "Conexion"
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)
ObjUsuario.Dispose()
@@ -138,9 +154,25 @@ Partial Class PopUpSeleccionarEmpresa
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
If gvr IsNot Nothing Then
Dim ObjUsuario As New ClsSisUsuarios
Dim Usuario As Usuario = Nothing
Dim tGrupoEmpresa As String = ""
Dim NombreCadena As String = "Conexion"
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"))
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>

View File

@@ -1,6 +1,7 @@

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

View File

@@ -1384,8 +1384,10 @@ Partial Class Sistemas_UsuarioDetalle
GlobalDTAlmacenUsuarios(-1, tCveEmpresa) = Nothing
GlobalDTUsuarioResponsable(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
' Application("GlobalDTUsuarios") = ObjUsuarios.DtResultados
@@ -1732,8 +1734,15 @@ Partial Class Sistemas_UsuarioDetalle
Private Sub CargaDtSubProyectos()
Dim ClsUsuarios As New ClsSisUsuarios
If ClsUsuarios.GetSubProyectos(CveUsuario) Then
DtSubProyectos = ClsUsuarios.DtResultados
If ClsUsuarios.GetSubProyectos(CveUsuario) Then
DtSubProyectos = ClsUsuarios.DtResultados
If Not CveUsuario > 0 Then
DtSubProyectos.Rows.Clear()
DtSubProyectos.AcceptChanges()
End If
Else
DtSubProyectos = Nothing
Alert("Ocurrió un Error al cargar los SubProyectos del Usuario. Por favor vuelva a intentar", TipoMensaje.MsgError)
@@ -2254,8 +2263,15 @@ Partial Class Sistemas_UsuarioDetalle
DdlCuentasBancarias.DataBind()
DdlCuentasBancarias.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Private Sub CargaDtCuentasBancarias()
Private Sub CargaDtCuentasBancarias()
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))
CargaGvCuentasBancarias()

View File

@@ -62,7 +62,7 @@ Partial Class RepContratosCalendario
Private Sub CargaCronograma(Optional TipoVista As Integer = -1)
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
' If String.IsNullOrEmpty(Row("CodigoAF").ToString()) Then

View File

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

View File

@@ -17,9 +17,7 @@
<li>
<asp:HyperLink NavigateUrl="#" data-toggle="modal" data-target="#DivPersonalizar" ID="ImgPersonalizar" runat="server"> <i class="fa fa-pencil"></i> Personalizar</asp:HyperLink>
</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>
<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>
@@ -34,29 +32,28 @@
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT portletfiltrostitlee">
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<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>
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div>
<div class="titlefiltros caption ">
<div class="row">
<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="row" style="height: 32px;">
<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>
</div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">RFC:</div>
<div class=" col-md-2 " style="max-width: 283px!important">
<div class="col-md-1 truncate" >RFC:</div>
<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>
</div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Estatus:</div>
<div class=" col-md-2 " style="max-width: 283px!important">
<div class="col-md-1 truncate" >Estatus:</div>
<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:ListItem Value="-1">Todos</asp:ListItem>
<asp:ListItem Selected="True" Value="1">Activo</asp:ListItem>
@@ -64,9 +61,20 @@
</asp:DropDownList>
</div>
<div class="col-md-1">
<%--<div class="col-md-1">
<asp:CheckBox runat="server" ID ="ChkPermiteCredito" CssClass="md-checksd" Text="Permite Crédito" />
</div>
</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>
@@ -75,18 +83,18 @@
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row">
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Sucursal:</div>
<div class=" col-md-2 " style="max-width: 283px!important">
<div class="col-md-1 truncate" >Sucursal:</div>
<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>
</div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Clasif:</div>
<div class=" col-md-2 " style="max-width: 283px!important">
<div class="col-md-1 truncate" >Clasificación:</div>
<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>
</div>
<div class="col-md-1 " style="font-size: medium; max-width: 100px!important">Tipo:</div>
<div class=" col-md-2 " style="max-width: 283px!important">
<div class="col-md-1 truncate" >Tipo:</div>
<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:ListItem Value="-1">Todos</asp:ListItem>
<asp:ListItem Selected="True" Value="1">Frecuente</asp:ListItem>
@@ -94,10 +102,10 @@
</asp:DropDownList>
</div>
<div class="col-md-1 truncate" style="font-size: medium; max-width: 100px!important">
<div class="col-md-1 truncate" >
Vendedor:
</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>
</div>
@@ -105,6 +113,7 @@
</div>
</div>
</div>
@@ -121,8 +130,9 @@
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<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>
<tr class="Titulos">
<th width="100px">
@@ -175,347 +185,365 @@
</th>
</tr>
</thead>
</table>
</table>--%>
<div style="">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Clientes registrados" ShowHeader="true"
DataKeyNames="FechaLimiteCredito"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None">
<Columns>
<asp:TemplateField Visible="true" ItemStyle-Width="100" HeaderText="Código">
<ItemTemplate>
<asp:Literal ID="LtlCodigo" runat="server" Text='<%# Eval("Codigo") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" ItemStyle-Width="320px">
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC" ItemStyle-Width="100">
<ItemTemplate>
<asp:Literal ID="LtlRFC" runat="server" Text='<%# Eval("RFC") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sucursal" ItemStyle-Width="80">
<ItemTemplate>
<asp:Literal ID="LtlSucursal" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Teléfono" ItemStyle-Width="60">
<ItemTemplate>
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Vendedor" Visible="false" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Nombre Corto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombreCorto" runat="server" Text='<%# Eval("NombreCorto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>No Ext</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNoExt" runat="server" Text='<%# Eval("NoExt") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>No Int</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNoInt" runat="server" Text='<%# Eval("NoInt") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ciudad</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCiudad" runat="server" Text='<%# Eval("Ciudad") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Estado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>País</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPais" runat="server" Text='<%# Eval("Pais") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>CP</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCP" runat="server" Text='<%# Eval("CP") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Contacto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlContacto" runat="server" Text='<%# Eval("Contacto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Correo Env. Factura</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMail" runat="server" Text='<%# Eval("Mail") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Recepción Facturas</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRecepcionFacturas" runat="server" Text='<%# Eval("RecepcionPagos") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ret IVA</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRetIVA" runat="server" Text='<%# Eval("RetIVA") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ret ISR</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRetISR" runat="server" Text='<%# Eval("RetISR") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Plazo Cobranza</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPlazoCobranza" runat="server" Text='<%# Eval("PlazoCobranza") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Límite Crédito</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlLimiteCredito" runat="server" Text='<%# Eval("LimiteCredito", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Clientes registrados" ShowHeader="true"
DataKeyNames="FechaLimiteCredito"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" GridLines="None">
<Columns>
<asp:TemplateField Visible="true" ItemStyle-Width="100" HeaderText="Código">
<ItemTemplate>
<asp:Literal ID="LtlCodigo" runat="server" Text='<%# Eval("Codigo") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" ItemStyle-Width="320px">
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="RFC" ItemStyle-Width="100">
<ItemTemplate>
<asp:Literal ID="LtlRFC" runat="server" Text='<%# Eval("RFC") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sucursal" ItemStyle-Width="80">
<ItemTemplate>
<asp:Literal ID="LtlSucursal" runat="server" Text='<%# Eval("SubProyecto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Teléfono" ItemStyle-Width="60">
<ItemTemplate>
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Vendedor" Visible="false" ItemStyle-Width="150" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Estatus">
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha">
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Nombre Corto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombreCorto" runat="server" Text='<%# Eval("NombreCorto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>No Ext</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNoExt" runat="server" Text='<%# Eval("NoExt") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>No Int</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNoInt" runat="server" Text='<%# Eval("NoInt") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ciudad</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCiudad" runat="server" Text='<%# Eval("Ciudad") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Estado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>País</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPais" runat="server" Text='<%# Eval("Pais") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>CP</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCP" runat="server" Text='<%# Eval("CP") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Contacto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlContacto" runat="server" Text='<%# Eval("Contacto") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Correo Env. Factura</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMail" runat="server" Text='<%# Eval("Mail") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Recepción Facturas</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRecepcionFacturas" runat="server" Text='<%# Eval("RecepcionPagos") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ret IVA</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRetIVA" runat="server" Text='<%# Eval("RetIVA") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Ret ISR</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRetISR" runat="server" Text='<%# Eval("RetISR") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Plazo Cobranza</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPlazoCobranza" runat="server" Text='<%# Eval("PlazoCobranza") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Límite Crédito</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlLimiteCredito" runat="server" Text='<%# Eval("LimiteCredito", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</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">
<HeaderTemplate>Calle</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Direccion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Celular</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTelefonoOtro" runat="server" Text='<%# Eval("Celular") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Correo Env. Cotización</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCorreoCotizacion" runat="server" Text='<%# Eval("MailCotizacion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Otro Telefono</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlOtroTelefono" runat="server" Text='<%# Eval("TelefonoOtros") %>'></asp:Literal>
</ItemTemplate>
</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">
<HeaderTemplate>F Limite Crédito</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaLimiteCredito" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Calle</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Direccion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Celular</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTelefonoOtro" runat="server" Text='<%# Eval("Celular") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Correo Env. Cotización</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCorreoCotizacion" runat="server" Text='<%# Eval("MailCotizacion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false" ItemStyle-HorizontalAlign="Left">
<HeaderTemplate>Otro Telefono</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlOtroTelefono" runat="server" Text='<%# Eval("TelefonoOtros") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="true" ItemStyle-HorizontalAlign="center" ItemStyle-Width="100px">
<HeaderTemplate>F Limite Crédito</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaLimiteCredito" runat="server" ></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
<div id="DivPersonalizar" class="modal fade" role="dialog">
<asp:UpdatePanel ID="UPPersonalizar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivPersonalizar" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label1" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label></h4>
</div>
<div class="modal-body">
<table class="table table-striped table-advance table-hover">
<thead>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkNombre" runat="server" Text="Nombre" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRFC" runat="server" Text="RFC" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkSucursal" runat="server" Text="Sucursal" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkTelefono" runat="server" Text="Teléfono" Checked="true" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkEstadoSis" runat="server" Text="Estado (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkFechaIng" runat="server" Text="Fecha Captura (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkUsuario" runat="server" Text="Usuario Capturó (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCodigo" runat="server" Text="Código" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkNombreCorto" runat="server" Text="Nombre Corto" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkVendedor" runat="server" Text="Vendedor" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkNoExt" runat="server" Text="No Ext" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkNoInt" runat="server" Text="No Int" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkColonia" runat="server" Text="Colonia" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCiudad" runat="server" Text="Ciudad" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkEstado" runat="server" Text="Estado" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkPais" runat="server" Text="País" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkCP" runat="server" Text="C.P." /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkContacto" runat="server" Text="Contacto" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkMail" runat="server" Text="Correo Envió Facturación" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRecepcionFacturas" runat="server" Text="Recepción Facturas" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkRetIVA" runat="server" Text="Ret. IVA" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRetISR" runat="server" Text="Ret. ISR" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkPlazoCobranza" runat="server" Text="Plazo Cobranza" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkLimiteCredito" runat="server" Text="Límite Crédito" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkCalle" runat="server" Text="Calle" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCelular" runat="server" Text="Celular" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCorreoCotizacion" runat="server" Text="Correo Envió Cotización" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkOtroTelefono" runat="server" Text="Otro Telefono" /></td>
</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">
<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>
</tr>
</thead>
</table>
</div>
<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" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivUnificarCliente" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label ID="Label1" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label></h4>
</div>
<div class="modal-body">
<table class="table table-striped table-advance table-hover">
<thead>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkNombre" runat="server" Text="Nombre" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRFC" runat="server" Text="RFC" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkSucursal" runat="server" Text="Sucursal" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkTelefono" runat="server" Text="Teléfono" Checked="true" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkEstadoSis" runat="server" Text="Estado (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkFechaIng" runat="server" Text="Fecha Captura (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkUsuario" runat="server" Text="Usuario Capturó (Sis)" Checked="true" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCodigo" runat="server" Text="Código" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkNombreCorto" runat="server" Text="Nombre Corto" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkVendedor" runat="server" Text="Vendedor" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkNoExt" runat="server" Text="No Ext" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkNoInt" runat="server" Text="No Int" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkColonia" runat="server" Text="Colonia" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCiudad" runat="server" Text="Ciudad" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkEstado" runat="server" Text="Estado" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkPais" runat="server" Text="País" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkCP" runat="server" Text="C.P." /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkContacto" runat="server" Text="Contacto" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkMail" runat="server" Text="Correo Envió Facturación" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRecepcionFacturas" runat="server" Text="Recepción Facturas" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkRetIVA" runat="server" Text="Ret. IVA" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkRetISR" runat="server" Text="Ret. ISR" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkPlazoCobranza" runat="server" Text="Plazo Cobranza" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkLimiteCredito" runat="server" Text="Límite Crédito" /></td>
</tr>
<tr>
<td style="text-align: left">
<asp:CheckBox ID="ChkCalle" runat="server" Text="Calle" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCelular" runat="server" Text="Celular" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkCorreoCotizacion" runat="server" Text="Correo Envió Cotización" /></td>
<td style="text-align: left">
<asp:CheckBox ID="ChkOtroTelefono" runat="server" Text="Otro Telefono" /></td>
</tr>
<tr>
<td style="text-align: left">
<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>
</tr>
</thead>
</table>
</div>
<div class="modal-footer">
<asp:Button ID="BtnPersonalizar" runat="server" Text="Personalizar" class="btn btn-success" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</div>
</div>
</div>
<div id="DivUnificarCliente" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpUnificar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel4">Unificar Clientes</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyUnificar" runat="server" UpdateMode="Conditional">
<asp:UpdatePanel ID="UpUnificar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<label>Cliente a Unificar: </label>
<br />
<%--<asp:DropDownList ID="DdlClienteAUnificar" runat="server" CssClass="select2me" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="100%"></asp:DropDownList>--%>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteAUnificar" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width:150px;"></ADS:Dropdownlost>
</div>
<div class="col-md-6">
<label>En: </label>
<br />
<%--<asp:DropDownList ID="DdlClienteOriginal" runat="server" CssClass="select2me" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="100%"></asp:DropDownList>--%>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteOriginal" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width:150px;"></ADS:Dropdownlost>
</div>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel4">Unificar Clientes</h4>
</div>
<br />
<div class="text-center">
<asp:Button ID="BtnUnificar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Unificar"></asp:Button>
<div class="modal-body">
<asp:UpdatePanel ID="UpBodyUnificar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<label>Cliente a Unificar: </label>
<br />
<%--<asp:DropDownList ID="DdlClienteAUnificar" runat="server" CssClass="select2me" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="100%"></asp:DropDownList>--%>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteAUnificar" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width:150px;"></ADS:Dropdownlost>
</div>
<div class="col-md-6">
<label>En: </label>
<br />
<%--<asp:DropDownList ID="DdlClienteOriginal" runat="server" CssClass="select2me" DataTextField="CodigoNombre" DataValueField="CveCliente" Width="100%"></asp:DropDownList>--%>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteOriginal" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width:150px;"></ADS:Dropdownlost>
</div>
</div>
<br />
<div class="text-center">
<asp:Button ID="BtnUnificar" runat="server" CausesValidation="true" CssClass=" btn btn-primary " Text="Unificar"></asp:Button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
@@ -553,7 +581,7 @@
</asp:Panel>
<%-- FIN OC X SURTIR --%>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -41,6 +41,10 @@ Partial Class CatClientes
Me.Form.DefaultButton = LbFiltrar.UniqueID
CargaPersonalizacion()
End If
End Sub
@@ -55,7 +59,10 @@ Partial Class CatClientes
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
DTDatos = ObjClientes.DtResultados
Else
@@ -124,48 +131,7 @@ Partial Class CatClientes
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
@@ -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

View File

@@ -173,13 +173,7 @@
<asp:Literal ID="LtlnVentas" runat="server" Text='<%# Eval("nVentas") %>'></asp:Literal>
</ItemTemplate>
</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">
<ItemTemplate>
<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" />
</ItemTemplate>
</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>
</asp:GridView>
</div>

View File

@@ -1873,7 +1873,12 @@ Partial Class Clientes
GVAnticiposHistorial.DataSource = Nothing
DtAnticipoHistorial = Nothing
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()
GVAnticiposHistorial.DataBind()
@@ -1889,7 +1894,6 @@ Partial Class Clientes
RegistraScript("OrdenarGVAnticiposHistorial();")
End If
End Sub
Private Sub CargaOrdenesServiciosCliente()
Dim ObjOS As New ClsOS
@@ -2957,10 +2961,24 @@ Partial Class Clientes
e.Row.FCHyperLink("HLDevolverDinero").Visible = True
e.Row.FCHyperLink("HLDevolverDinero").NavigateUrl = $"/Bancos/IE.aspx?Opcion=DevDinV&P={Parametros}"
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 Sub
#End Region
#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)
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()
Alert("El correo se envió con éxito", TipoMensaje.MsgInformacion)
Catch ex As Exception
@@ -4314,7 +4333,7 @@ Partial Class Clientes
End If
End If
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)
'a.GuardaLog()
@@ -4326,8 +4345,8 @@ Partial Class Clientes
Dim Envio As Boolean = Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, Archivos:=LSRutasMail)
If Envio AndAlso GuardarBitacora Then
Using ObjBitacora As New ClsOIEventos
ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", CveUsuario, CveEmpresa, CveCliente:=CveCliente)
Using ObjBitacora As New ClsOIEventos(UsuarioActual:=UsuarioActual)
ObjBitacora.AddEventoBitacora("Se envió correo con el estado de cuenta del cliente", "", UsuarioActual.CveUsuario, CveEmpresa, CveCliente:=CveCliente)
End Using
End If
@@ -10691,6 +10710,31 @@ Partial Class Clientes
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

View File

@@ -2057,8 +2057,8 @@ Partial Class Ventas_ClientesAbonar
Dim dtt As DataTable = Nothing
Dim Deudores As New ClsMovimientos
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
dtt = Deudores.DtResultados.FiltraParametros("CveProveedor > 0 AND Saldo > 0 AND CveIE > 0", "FechaDocumento")
DdlPrestamo.DataSource = dtt
End If
Deudores.Dispose()

View File

@@ -200,6 +200,9 @@
<li>
<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>
<asp:LinkButton ID="LnkCobrosEnTranscurso" runat="server" OnClick="LnkCobrosEnTranscurso_Click"><i class="fa fa-money"></i> Cobros en Transcurso</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
@@ -315,7 +318,7 @@
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-print'></i>" ToolTip="Imprimir"
OnClick="LnkImprimir_Click" Visible="false" />
&nbsp;
<asp:LinkButton ID="BtnPagar" runat="server" CssClass="btn btn-xs btn-success" Text="Cobrar" CommandName="Cobrar" CommandArgument='<%# Eval("CveVenta") %>' />
<asp:LinkButton ID="BtnPagar" runat="server" CssClass="btn btn-xs btn-success" Text="Cobrar" CommandName="Cobrar" CommandArgument='<%# Eval("CveVenta") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -952,6 +955,46 @@
</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 ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script src="/Scripts/PrintJS/print.min.js"></script>

View File

@@ -1099,4 +1099,26 @@ Partial Class Ventas_PVCobranza
#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

View File

@@ -358,7 +358,8 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
CveIE = Gv.DataKey("CveIE").ToEntero();
Saldo = Gv.DataKey("Saldo").ToDecimal();
SaldoAdmin = Saldo;
}
}
Saldo = -Saldo; // invertimos el saldo para que se haga negativo para que sea ABono
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()))

View File

@@ -19,6 +19,9 @@
<ContentTemplate>
<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>
</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>
<asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton>
@@ -112,12 +115,7 @@
</div>
</ContentTemplate>
</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">
<ContentTemplate>
<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="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="Código Producto" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Nombre Del Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Precio Unitario" DataField="PU" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Cantidad Utilizada" DataField="Cantidad" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Monto Venta Total" DataField="Total" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="P Unitario" DataField="PU" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:N2}" 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="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="Comisión Técnico" DataField="ComisionTecnico" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Educación Médica" DataField="ComisionMedico" DataFormatString="{0:###,###,###,###.##}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="$ Técnico" DataField="ComisionTecnico" DataFormatString="{0:N2}" 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>
</asp:GridView>
@@ -162,53 +158,7 @@
</ContentTemplate>
</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 class="modal-dialog" style="width: 900px;">
@@ -232,7 +182,7 @@
<asp:GridView ID="GvComisiones" runat="server" AutoGenerateColumns="False"
DataKeyNames="CvePS,ComisionMedico,ComisionGerente,ComisionVendedor,ComisionTecnico"
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>
<asp:TemplateField HeaderText="Código/Producto" ItemStyle-HorizontalAlign="Left">
@@ -281,6 +231,128 @@
</asp:UpdatePanel>
</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>

View File

@@ -2,7 +2,9 @@
Option Strict On
Imports System.Data
Imports System.Data.Entity
Imports Extensiones
Imports Microsoft.EntityFrameworkCore
Partial Class Ventas_RepComisionesSMS
@@ -59,8 +61,6 @@ Partial Class Ventas_RepComisionesSMS
Public Sub CargaDatos()
LnkExportar.Visible = False
Dim ObjVentas As New ClsVentas
@@ -83,39 +83,11 @@ Partial Class Ventas_RepComisionesSMS
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)
If Tabs.ActiveTabIndex = 0 Then
CargaDatos()
Else
CargaDatosEspeciales()
End If
CargaDatos()
End Sub
@@ -123,19 +95,12 @@ Partial Class Ventas_RepComisionesSMS
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Dim SbFiltros As New StringBuilder()
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.Columns(10).Visible = True
Else
GvDatosEspeciales.ExportToExcelGembox("Comisiones", UsuarioActual, "Comisiones Especiales", DatoTituloExtra:=$"", DatosFiltros:=SbFiltros.ToString())
End If
GvDatos.Columns(10).Visible = True
End Sub
@@ -248,4 +213,149 @@ Partial Class Ventas_RepComisionesSMS
End If
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

View File

@@ -88,7 +88,7 @@
<div class="row">
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
<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 class="col-md-1 truncate">
Fecha Inicio:

View File

@@ -54,7 +54,7 @@ Partial Class Ventas_RepPS
End Sub
Private Sub CargaCombos()
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto)
CargarCentrosDeCosto(Nothing, DdlSubProyectos, Nothing, LblSubProyecto)
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
DdlClasificacion.DataBind()
@@ -75,14 +75,15 @@ Partial Class Ventas_RepPS
DivMarca.Visible = True
LblMarca.Visible = True
LblLinea.Visible = True
DivLinea.Visible = True
Using ObjMarcas As New ClsProductosServicios
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
DdlMarcaPSDes.DataBind()
End If
End Using
DivLinea.Visible = True
DdlMarcaPSDes.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
'Using ObjMarcas As New ClsProductosServicios
' If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
' DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
' DdlMarcaPSDes.DataBind()
' End If
'End Using
End If
DdlLinea.DataSource = GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa)
@@ -95,7 +96,8 @@ Partial Class Ventas_RepPS
Dim Clasificacion As String = If(DdlClasificacion.GetSelectedValuesM = "", "-1", DdlClasificacion.GetSelectedValuesM)
Dim Linea As String = If(DdlLinea.GetSelectedValuesM = "", "-1", DdlLinea.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 CvePS As Integer = DdlPS.SelectedValue.ToEntero()
Dim CveMoneda As Integer = -1
@@ -106,7 +108,7 @@ Partial Class Ventas_RepPS
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
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()
GvDatos.DataSource = DtReporte
Else
@@ -167,7 +169,7 @@ Partial Class Ventas_RepPS
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
If DtReporte IsNot Nothing AndAlso DtReporte.Rows.Count > 0 Then
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)
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png")

View File

@@ -113,144 +113,38 @@
<asp:UpdatePanel ID="UpLineasAdicionales" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="row " runat="server" visible ="false" id="DvLinea">
<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;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvD.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</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>
<div class="row ">
<div class="col-md-12">
<asp:GridView ID="GvD" Width="100%" runat="server" GridLines="None" Visible="false"
DataKeyNames="CveLineaAdicional,LineaAdicional,CveCliente,CveProveedor,TipoLinea,Importe,CveMoneda,FechaVencimiento,CveUsuario,CveCategoria,FechaIng,CveLineaAdicionalEstatus,Proveedor,LineaAdicionalComprobante,DiasVencimiento,CveVenta"
<asp:GridView ID="GvD" Width="100%" runat="server" GridLines="None"
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"
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
<Columns>
<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="TipoLineaSTR" HeaderText="Tipo Linea" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
<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="Estatus" HeaderText="Estatus" />
<asp:BoundField DataField="FechaVencimiento" HeaderText="F. Vencimiento" DataFormatString="{0:d}" />
</Columns>
</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>
</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>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<%-- FIN MODAL COMPROBANTE --%>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">

View File

@@ -88,58 +88,20 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
private void CargaDatos()
{
DTDatosGvD = new DataTable();
LnkDescargaExcel.Visible = false;
ClsVentas objVentas = new ClsVentas();
DTDatosGvD = new DataTable();
LnkDescargaExcel.Visible = false;
int CveProveedor = -1;
if(TipoLinea == 1)
ClsVentas objVentas = new ClsVentas();
if (objVentas.GetLineasAdicionalesVencimientos( DdlClientes.SelectedValue.ToEntero(), 1, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveEmpresa))
{
GvD.DataSource = objVentas.DtResultados;
if (objVentas.DtResultados.Rows.Count > 0)
{
DTDatosGvD = objVentas.DtResultados;
LnkDescargaExcel.Visible = true;
if (objVentas.GetLineasAdicionalesVencimientos( DdlClientes.SelectedValue.ToEntero(), -1, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveEmpresa))
{
}
GvD.DataSource = objVentas.DtResultados;
if (objVentas.DtResultados.Rows.Count > 0)
{
DTDatosGvD = objVentas.DtResultados;
{
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;
UpAcciones.Update();
}
}
}
objVentas.Dispose();
@@ -155,116 +117,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
CveLineaAdicional = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero();
CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero();
LineaAdicionalComprobante = GvRow.DataKey("LineaAdicionalComprobante").ToString();
RegistraScript("$('#ModalComprobante').modal('show');","");
}
protected void BtnAddComprobante_Click(object sender, EventArgs e)
{
bool errorCargaComprobante = false;
string FileExtension = "-1";
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');","");
}
@@ -273,14 +126,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
protected void LnkDescargaExcel_Click(object sender, EventArgs e)
{
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;
//gvTemp.ExportToExcelX("RepLineasAdicionales" + NowADS().ToShortDateString());
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.Flush();
Response.TransmitFile(fi.FullName);
Response.End();
}
}
protected void GvLAPO_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Estatus")
{
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)
{
Response.End();
}
}

View File

@@ -125,6 +125,13 @@ Partial Class Ventas_RepVentas
LnkDescargaCartaPorte.Visible = True
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
LblServicioDomicilioFiltro.Visible = True
DVServicioDomicilio.Visible = True

View File

@@ -1,4 +1,4 @@
<%@ Page Title="Ventas - Facturación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Ventas.aspx.vb" Inherits="Ventas" EnableEventValidation="false" %>
<%@ Page Title="Ventas - Facturación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Ventas.aspx.vb" Inherits="Ventas" EnableEventValidation="false" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControl/AddMedico.ascx" TagPrefix="UserControl" TagName="AddMedico" %>
@@ -391,7 +391,7 @@
<li>
<asp:LinkButton ID="LnkSolicitarCredito" Visible="false" runat="server"><i class="fa fa-plus"></i>Solicitar autorización de crédito</asp:LinkButton>
</li>
<li>
<li>
<asp:LinkButton ID="LnkCancelarSoloCFDI" Visible="false" runat="server" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea cancelar el CFDI?" data-btn-ok-label="si" OnClick="LnkCancelarSoloCFDI_Click"><i class="fa fa-plus"></i>Cancelar solo CFDI</asp:LinkButton>
</li>
@@ -614,29 +614,29 @@
<b>Paciente:</b>
</td>
<td runat="server">
<asp:TextBox ID="TxtPaciente" runat="server" Style="width: 130px" MaxLength="50"></asp:TextBox>
<asp:TextBox ID="TxtPaciente" runat="server" Style="width: 130px" MaxLength="50"></asp:TextBox>
</td>
<td runat="server" id="Td9" visible="true">
<b>Episodio:</b>
</td>
<td runat="server">
<asp:TextBox ID="TxtEpisodio" runat="server" Style="width: 130px" MaxLength="20"></asp:TextBox>
<asp:TextBox ID="TxtEpisodio" runat="server" Style="width: 130px" MaxLength="20"></asp:TextBox>
</td>
</tr>
<tr runat="server" id="TrVentasMedicas4" visible="false">
<td runat="server" id="Td8">
<b>Folio Remisión:</b>
</td>
<td runat="server">
<asp:TextBox ID="TxtFolioRemision" runat="server" Style="width: 130px" MaxLength="20" Enabled="false"></asp:TextBox>
</td>
<td runat="server" id="Td10">
<b>Tipo de Venta:</b>
</td>
<td runat="server">
<asp:Label runat="server" ID="LblTipoVenta"></asp:Label>
</td>
</tr>
<tr runat="server" id="TrVentasMedicas4" visible="false">
<td runat="server" id="Td8" >
<b>Folio Remisión:</b>
</td>
<td runat="server">
<asp:TextBox ID="TxtFolioRemision" runat="server" Style="width: 130px" MaxLength="20" Enabled="false"></asp:TextBox>
</td>
<td runat="server" id="Td10" >
<b>Tipo de Venta:</b>
</td>
<td runat="server">
<asp:Label runat="server" ID="LblTipoVenta"></asp:Label>
</td>
</tr>
</table>
</div>
</div>
@@ -758,12 +758,12 @@
<td><b>Fecha:</b></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;">
<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 ">
<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>
<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: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>
@@ -892,88 +892,88 @@
</ContentTemplate>
</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>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Estatus</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Estatus</span>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding-top: 0px; margin-top: -5px;">
<table border="0" width="240px">
<tr align="left" id="TrEstatusCaja" visible="false" runat="server">
<td><b>Corte:</b>&nbsp;</td>
<td>
<asp:Label ID="LblEstatusCaja" runat="server"></asp:Label>
</td>
</tr>
<tr align="left" id="Trsaldo" visible="false" runat="server">
<td><b>Saldo:</b>&nbsp;</td>
<td>
<%-- <asp:Label ID="LblSaldoVenta" runat="server"></asp:Label>&nbsp;&nbsp;--%>
<asp:HyperLink ID="HplSaldoAuxiliar" CssClass="Texto thickbox" runat="server"></asp:HyperLink><asp:HyperLink runat="server" CssClass="Texto thickbox" Visible="false" ID="HplPagado" Text="<b>PAGADO<b>"></asp:HyperLink>
<asp:HiddenField ID="HdnPagado" runat="server" />
</td>
</tr>
<tr align="left">
<td><b>Estatus:</b>&nbsp;</td>
<td>
<asp:Label ID="LbEstatus" Text="" runat="server" />
<%--<asp:DropDownList ID="DdlEstatus" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me" DataTextField="EstatusFactura" DataValueField="CveEstatusFactura" Width="128px">
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="padding-top: 0px; margin-top: -5px;">
<table border="0" width="240px">
<tr align="left" id="TrEstatusCaja" visible="false" runat="server">
<td><b>Corte:</b>&nbsp;</td>
<td>
<asp:Label ID="LblEstatusCaja" runat="server"></asp:Label>
</td>
</tr>
<tr align="left" id="Trsaldo" visible="false" runat="server">
<td><b>Saldo:</b>&nbsp;</td>
<td>
<%-- <asp:Label ID="LblSaldoVenta" runat="server"></asp:Label>&nbsp;&nbsp;--%>
<asp:HyperLink ID="HplSaldoAuxiliar" CssClass="Texto thickbox" runat="server"></asp:HyperLink><asp:HyperLink runat="server" CssClass="Texto thickbox" Visible="false" ID="HplPagado" Text="<b>PAGADO<b>"></asp:HyperLink>
<asp:HiddenField ID="HdnPagado" runat="server" />
</td>
</tr>
<tr align="left">
<td><b>Estatus:</b>&nbsp;</td>
<td>
<asp:Label ID="LbEstatus" Text="" runat="server" />
<%--<asp:DropDownList ID="DdlEstatus" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me" DataTextField="EstatusFactura" DataValueField="CveEstatusFactura" Width="128px">
</asp:DropDownList>
<a class="btn default" style="display: none;" data-toggle="modal" href="#Aceptar">Aceptada</a>
<asp:ImageButton ID="ImgGuardaEstatus" runat="server" ClientIDMode="Static" ImageUrl="/Imagenes/accept.png" Style="display: none;" />--%>
</td>
</tr>
<tr align="left" id="trContabilizada" runat="server" visible="False">
<td><b>Contabilizada:</b></td>
<td>
<asp:HyperLink ID="HLContabilizada" Target="_blank" runat="server" Text="No"></asp:HyperLink>
<asp:HyperLink ID="HPLContaCancelacion" Target="_blank" runat="server" Text=""></asp:HyperLink>
<%-- <asp:Button ID="BtnContabilizar" runat="server" Text="Contabilizar" Visible="false" CssClass="btn btn-success" />--%>
<%--<asp:Button ID="BtnDescontabilizar" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar la poliza?" data-btn-ok-label="si" Text="Descontabilizar" runat="server" OnClick="BtnDescontabilizar_Click" CssClass="btn btn-default" Style="margin-left: 20px;" Visible="false" />--%>
</td>
</tr>
<tr align="left">
<td><b>Se timbró:</b>&nbsp;</td>
<td>
<asp:Label ID="LblSeTimbro" runat="server" Text="No"></asp:Label></td>
</tr>
<tr align="left">
<td><b>Envió Mail:</b>&nbsp;</td>
<td>
<asp:Label ID="LblMail" runat="server" Text="No"></asp:Label></td>
</tr>
<tr align="left">
<td><b class="truncate">Usuario creó:</b>&nbsp;</td>
<td>
<asp:Label ID="LblUsuario" runat="server"></asp:Label></td>
</tr>
<tr align="left">
<td><b class="truncate">Fecha registró:</b>&nbsp;</td>
<td>
<asp:Label ID="LblFechaRegistro" runat="server"></asp:Label></td>
</tr>
<tr runat="server" id="trPresupuesto" visible="false">
<td colspan="2">
<asp:HyperLink runat="server" ID="HplPresupuesto" Target="_blank" Text="Ir a Presupuesto"></asp:HyperLink>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr align="left" id="trContabilizada" runat="server" visible="False">
<td><b>Contabilizada:</b></td>
<td>
<asp:HyperLink ID="HLContabilizada" Target="_blank" runat="server" Text="No"></asp:HyperLink>
<asp:HyperLink ID="HPLContaCancelacion" Target="_blank" runat="server" Text=""></asp:HyperLink>
<%-- <asp:Button ID="BtnContabilizar" runat="server" Text="Contabilizar" Visible="false" CssClass="btn btn-success" />--%>
<%--<asp:Button ID="BtnDescontabilizar" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar la poliza?" data-btn-ok-label="si" Text="Descontabilizar" runat="server" OnClick="BtnDescontabilizar_Click" CssClass="btn btn-default" Style="margin-left: 20px;" Visible="false" />--%>
</td>
</tr>
<tr align="left">
<td><b>Se timbró:</b>&nbsp;</td>
<td>
<asp:Label ID="LblSeTimbro" runat="server" Text="No"></asp:Label></td>
</tr>
<tr align="left">
<td><b>Envió Mail:</b>&nbsp;</td>
<td>
<asp:Label ID="LblMail" runat="server" Text="No"></asp:Label></td>
</tr>
<tr align="left">
<td><b class="truncate">Usuario creó:</b>&nbsp;</td>
<td>
<asp:Label ID="LblUsuario" runat="server"></asp:Label></td>
</tr>
<tr align="left">
<td><b class="truncate">Fecha registró:</b>&nbsp;</td>
<td>
<asp:Label ID="LblFechaRegistro" runat="server"></asp:Label></td>
</tr>
<tr runat="server" id="trPresupuesto" visible="false">
<td colspan="2">
<asp:HyperLink runat="server" ID="HplPresupuesto" Target="_blank" Text="Ir a Presupuesto"></asp:HyperLink>
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
@@ -3491,7 +3491,7 @@
<div class="row" style="margin-bottom: 10px;">
<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>
</div>
</div>
@@ -4485,7 +4485,7 @@
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" style="display:flex; justify-content:center;">
<div class="col-md-12" style="display: flex; justify-content: center;">
<asp:RadioButtonList ID="RblTipoAutorizacionDesc" runat="server" CssClass="rbl" RepeatDirection="Horizontal" RepeatLayout="Table" OnSelectedIndexChanged="RblTipoAutorizacionDesc_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="Usuario y contraseña" Value="1"></asp:ListItem>
<asp:ListItem Text="Código de acceso" Value="2"></asp:ListItem>
@@ -4536,160 +4536,166 @@
</div>
</asp:Panel>
</div>
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label runat="server">Anticipos/NC del Cliente:&nbsp;<asp:Literal ID="LtlCliente" runat="server"></asp:Literal></asp:Label>
</h4>
</div>
<div class="modal-body">
<asp:HiddenField ID="HdnAnticipos" runat="server" ClientIDMode="Static" Value="0" />
<div class="row" runat="server" id="divAmortizacionTipo" visible="false">
<div class="col-md-4">
Tipo Amortización:
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoAmortizacionAnticipo" runat="server" AutoPostBack="true" Width="250px" CssClass="select2me" CausesValidation="true">
<asp:ListItem Text="Seleccionar" Value="-1"></asp:ListItem>
<asp:ListItem Text="Amortización anticipo en descuento" Value="1"></asp:ListItem>
<asp:ListItem Text="Amortización anticipo con nota de crédito" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
<asp:RequiredFieldValidator ID="RfvDdlTipoAmortizacionAnticipo" runat="server" Display="None" ControlToValidate="DdlTipoAmortizacionAnticipo" InitialValue="-1" ErrorMessage="Debe Seleccionarse un tipo" ValidationGroup="VGAnticiposClientes"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CEDdlTipoAmortizacionAnticipo" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlTipoAmortizacionAnticipo" Width="300px"></ajax:ValidatorCalloutExtender>
<div class="row" style="text-align: center;" runat="server" id="divAnticipoMsg" visible="false">
<asp:Label ID="Label1" runat="server" Text="Se aplicará descuento por el total de las amortizaciones en los productos" CssClass="alert alert-warning" Style="padding: 5px; margin-bottom: 5px; padding-right: 25px;"></asp:Label>
</div>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label runat="server">Anticipos/NC del Cliente:&nbsp;<asp:Literal ID="LtlCliente" runat="server"></asp:Literal></asp:Label>
</h4>
</div>
<div class="modal-body">
<asp:HiddenField ID="HdnAnticipos" runat="server" ClientIDMode="Static" Value="0" />
<div class="row" id="divAmortizacionTipoRelacion" runat="server" visible="false">
<div class="col-md-4">
Tipo Relación:
</div>
<div class="row" runat="server" id="divAmortizacionTipo" visible="false">
<div class="col-md-4">
Tipo Amortización:
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoAmortizacionAnticipo" runat="server" AutoPostBack="true" Width="250px" CssClass="select2me" CausesValidation="true">
<asp:ListItem Text="Seleccionar" Value="-1"></asp:ListItem>
<asp:ListItem Text="Amortización anticipo en descuento" Value="1"></asp:ListItem>
<asp:ListItem Text="Amortización anticipo con nota de crédito" Value="2"></asp:ListItem>
</asp:DropDownList>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoRelacionAnticipo" runat="server" Width="250px" CssClass="select2me">
<asp:ListItem Text="-" Value="-1"></asp:ListItem>
<asp:ListItem Text="07 - CFDI por aplicación de anticipo" Value="7"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="row" id="DivConceptoNC" runat="server" visible="false">
<div class="col-md-4">
Concepto:
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlNCPSAnt" runat="server" DataTextField="PSCodigo" DataValueField="CvePS" Width="250px" CssClass="select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVNCPSAnt" runat="server" InitialValue="-1" ControlToValidate="DdlNCPSAnt" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VGAnticiposClientes"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERFVNCPSAnt" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPSAnt" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" id="DivFechaAnticipoCliente" runat="server" visible="false">
<b>
<label class="col-md-2">Fecha:</label></b>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAnticipoCliente" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10" AutoPostBack="true" OnTextChanged="TxtFechaAnticipoCliente_TextChanged"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaAnticipoCliente" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAnticipoCliente" runat="server" TargetControlID="TxtFechaAnticipoCliente" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaAnticipoCliente" TargetControlID="TxtFechaAnticipoCliente" PopupButtonID="ImgFechaAnticipoCliente" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaAnticipoCliente" runat="server" ControlToValidate="TxtFechaAnticipoCliente" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="VGAnticiposClientes" 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)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaAnticipoCliente" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaAnticipoCliente" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<asp:RequiredFieldValidator ID="RfvDdlTipoAmortizacionAnticipo" runat="server" Display="None" ControlToValidate="DdlTipoAmortizacionAnticipo" InitialValue="-1" ErrorMessage="Debe Seleccionarse un tipo" ValidationGroup="VGAnticiposClientes"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CEDdlTipoAmortizacionAnticipo" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlTipoAmortizacionAnticipo" Width="300px"></ajax:ValidatorCalloutExtender>
<div class="row" style="text-align: center;" runat="server" id="divAnticipoMsg" visible="false">
<asp:Label ID="Label1" runat="server" Text="Se aplicará descuento por el total de las amortizaciones en los productos" CssClass="alert alert-warning" Style="padding: 5px; margin-bottom: 5px; padding-right: 25px;"></asp:Label>
</div>
</div>
</div>
<br />
<div style="max-height: 300px; overflow-y: auto;">
<div class="row" style="margin-left: 0px; text-align: right" align="left">
<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;" />
<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>
<div class="row" id="divAmortizacionTipoRelacion" runat="server" visible="false">
<div class="col-md-4">
Tipo Relación:
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlTipoRelacionAnticipo" runat="server" Width="250px" CssClass="select2me">
<asp:ListItem Text="-" Value="-1"></asp:ListItem>
<asp:ListItem Text="07 - CFDI por aplicación de anticipo" Value="7"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
<div class="row" id="DivConceptoNC" runat="server" visible="false">
<div class="col-md-4">
Concepto:
</div>
<div class="col-md-8">
<asp:DropDownList ID="DdlNCPSAnt" runat="server" DataTextField="PSCodigo" DataValueField="CvePS" Width="250px" CssClass="select2me"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVNCPSAnt" runat="server" InitialValue="-1" ControlToValidate="DdlNCPSAnt" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="VGAnticiposClientes"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERFVNCPSAnt" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPSAnt" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row" id="DivFechaAnticipoCliente" runat="server" visible="false">
<b>
<label class="col-md-2">Fecha:</label></b>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 80% !important; padding: 0px;">
<asp:TextBox ID="TxtFechaAnticipoCliente" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true" MaxLength="10" AutoPostBack="true" OnTextChanged="TxtFechaAnticipoCliente_TextChanged"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaAnticipoCliente" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaAnticipoCliente" runat="server" TargetControlID="TxtFechaAnticipoCliente" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaAnticipoCliente" TargetControlID="TxtFechaAnticipoCliente" PopupButtonID="ImgFechaAnticipoCliente" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvFechaAnticipoCliente" runat="server" ControlToValidate="TxtFechaAnticipoCliente" Display="None" Operator="DataTypeCheck" Type="Date" ValidationGroup="VGAnticiposClientes" 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)."></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaAnticipoCliente" runat="server" Enabled="True" HighlightCssClass="vco" TargetControlID="CvFechaAnticipoCliente" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<br />
<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"
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>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="Chk" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Folio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Saldo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Moneda Venta</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="MonedaVenta" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Moneda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAbreviatura" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Atención A</HeaderTemplate>
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("AtencionA") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Amort. Ant.</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LblTotalAnticipos" runat="server" ClientIDMode="Static" Text="0.00" Visible="false"></asp:Label>
<asp:TextBox ID="TxtAnticipo" CssClass="CSGATxtAnticipo" runat="server" CausesValidation="true" MaxLength="12" Width="76px"></asp:TextBox>
<asp:CompareValidator ID="CVAmortAnti" runat="server" ControlToValidate="TxtAnticipo" Display="None" ErrorMessage="El campo <b>''Amortización de Anticipos''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="VGAnticiposClientes"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOAmortAnti" runat="server" HighlightCssClass="vco" TargetControlID="CVAmortAnti" Width="300px"></ajax:ValidatorCalloutExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="T.C." Visible="false">
<ItemTemplate>
<asp:TextBox ID="TxtTC" runat="server" Width="50px" Enabled="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAceptarAnticipos" runat="server" Text="Aceptar" class="btn btn-primary" ValidationGroup="VGAnticiposClientes" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
<asp:HiddenField ID="HdnTieneAnticipos" ClientIDMode="Static" Value="0" runat="server" />
<asp:HiddenField ID="HdnTieneAnticiposVinculados" ClientIDMode="Static" Value="0" runat="server" />
<div style="max-height: 300px; overflow-y: auto;">
<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">
<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>
</div>
</div>
<br />
<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 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">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<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>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Folio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Saldo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAnticipos" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Moneda Venta</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="MonedaVenta" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Moneda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAbreviatura" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Atención A</HeaderTemplate>
<ItemTemplate>
<asp:Literal runat="server" Text='<%# Eval("AtencionA") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Amort. Ant.</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="LblTotalAnticipos" runat="server" ClientIDMode="Static" Text="0.00" Visible="false"></asp:Label>
<asp:TextBox ID="TxtAnticipo" CssClass="CSGATxtAnticipo" runat="server" CausesValidation="true" MaxLength="12" Width="76px"></asp:TextBox>
<asp:CompareValidator ID="CVAmortAnti" runat="server" ControlToValidate="TxtAnticipo" Display="None" ErrorMessage="El campo <b>''Amortización de Anticipos''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="VGAnticiposClientes"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOAmortAnti" runat="server" HighlightCssClass="vco" TargetControlID="CVAmortAnti" Width="300px"></ajax:ValidatorCalloutExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="T.C." Visible="false">
<ItemTemplate>
<asp:TextBox ID="TxtTC" runat="server" Width="50px" Enabled="false"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAceptarAnticipos" runat="server" Text="Aceptar" class="btn btn-primary" ValidationGroup="VGAnticiposClientes" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
<asp:HiddenField ID="HdnTieneAnticipos" ClientIDMode="Static" Value="0" runat="server" />
<asp:HiddenField ID="HdnTieneAnticiposVinculados" ClientIDMode="Static" Value="0" runat="server" />
</div>
</div>
</div>
</ContentTemplate>
@@ -10587,26 +10593,44 @@
if (indexd == 0) {
var tr = $('<tr></tr>'); tbody.append(tr);
var td;
let idxHeader = 0;
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 td;
let idxColumn = 0;
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 ((item[key] > 0)) {
td = $('<td style = "font-weight:bold;" >' + item[key] + '</td>'); tr.append(td);
} else {
if ('<%= UsuarioActual.Empresa.Funcionalidad(566) %>' == '1') {
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 {
td = $('<td>' + item[key] + '</td>'); tr.append(td);
}
}
}
idxColumn += 1;
}
indexd += 1;
});

View File

@@ -2714,6 +2714,7 @@ Partial Class Ventas
ViewState("CveCliente") = UsuarioActual.Empresa.Funcionalidad(714).ToEntero()
HdnCveCliente.Value = UsuarioActual.Empresa.Funcionalidad(714)
RBLPago.SelectedValue = "2"
RBLPago_SelectedIndexChanged(RBLPago, EventArgs.Empty)
CargaCliente(CveCliente)
End If
@@ -3227,12 +3228,11 @@ Partial Class Ventas
' End If
'End If
If UsuarioActual.Empresa.Funcionalidad(301).ToEntero() > 0 Then
TxtFecha.Enabled = False
ImgFecha.Visible = False
If UsuarioActual.Empresa.Funcionalidad(301) <> "" Then
TxtFecha.Enabled = True
ImgFecha.Visible = True
End If
CargarCodigo()
InicializaImprimirNew()
@@ -3496,13 +3496,6 @@ Partial Class Ventas
ImgFecha.Visible = False
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()
BloqueaClasificaciones()
@@ -5576,7 +5569,6 @@ Partial Class Ventas
HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString()
End If
TxtOrdenCompra.Text = DbRowVenta("OrdenCompra").ToString()
TxtOrdenCompra.Enabled = False
@@ -7194,7 +7186,13 @@ Partial Class Ventas
End If
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
DivVentasUsados.Visible = True
@@ -10047,22 +10045,25 @@ 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 (Archivo.Exists Or Archivo2.Exists Or ArchivoSti.Exists Or ArchivoSti2.Exists Or ArchivoSti3.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then
HplDownPDF.Visible = True
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
If UsuarioActual.TienePermisoProceso(359) Then
HplRenerarPDF.Visible = True
HplRenerarPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&REGENERAR=1", CveVenta)))
End If
If Not UsuarioActual.TienePermisoProceso(380) Then
HplDownPDF.Visible = True
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
If UsuarioActual.CveRol = 1 Then
LnkDescargaDirecta.Visible = True
If UsuarioActual.TienePermisoProceso(359) Then
HplRenerarPDF.Visible = True
HplRenerarPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&REGENERAR=1", CveVenta)))
End If
HplImprimirPDFStimulsoft.Visible = True
HplImprimirPDFStimulsoft.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=0&STIMULSOFT=1", CveVenta)))
If UsuarioActual.CveRol = 1 Then
LnkDescargaDirecta.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)))
HplImprimirPDFStimulsoft.Visible = True
HplImprimirPDFStimulsoft.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=0&STIMULSOFT=1", CveVenta)))
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)))
End If
End If
End If
@@ -10437,11 +10438,6 @@ Partial Class Ventas
' cambiar la condicion para saber si hay seleccionado
If (TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2") OrElse NCDescuento Then
Try
'LIMPIA LOS ANTICIPOS RELACIONADOS QUE YA SE APLICARON
If ListaAnticiposAplicados IsNot Nothing Then
ListaAnticiposAplicados.Clear()
End If
Dim CveVentaRelacionada As Integer = -1
If NuevaFactura = 1 Then
CveVentaRelacionada = ObjFactura.CveVenta
@@ -10703,6 +10699,11 @@ Partial Class Ventas
ObjFactura.DtDetalle = TmpDT 'actualiza por cambios de pedimentos.
ObjFactura.Timbre = PreParaTimbre(ObjFactura)
'LIMPIA LOS ANTICIPOS RELACIONADOS QUE YA SE APLICARON
If ListaAnticiposAplicados IsNot Nothing Then
ListaAnticiposAplicados.Clear()
End If
'ENVIAR POLIZA VIRTUAL
If ErrorList.Count = 0 Then
If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then
@@ -10890,9 +10891,11 @@ Partial Class Ventas
' DESCARGA XML - SI SE TIMBRA MANDA CORREO CON FACTURA
If SeTimbro Then
Dim ArchivoXML As String = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
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)))
If Not UsuarioActual.TienePermisoProceso(380) Then
Dim ArchivoXML As String = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
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)))
End If
End If
'MANDA CORREO
Try
@@ -10923,21 +10926,24 @@ Partial Class Ventas
'DESCARGA PDF
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Ped") Then
'If Not ImprimeAlert Then
If Not UsuarioActual.TienePermisoProceso(380) Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant", "Egs", "Dev", "Ped") Then
'If Not ImprimeAlert Then
Dim ArchivoIngPyMe As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
Dim ArchivoIng As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta))
Dim ArchivoRem As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta))
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta))
Dim ArchivoIngPyMe As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.mrt", UsuarioActual.Empresa.Ruta))
Dim ArchivoIng As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta))
Dim ArchivoRem As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta))
Dim ArchivoEgs As New System.IO.FileInfo(String.Format("{0}Formatos/NotaCredito.rdlc", UsuarioActual.Empresa.Ruta))
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoIngPyMe.Exists Or ArchivoEgs.Exists Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
Else
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
If ArchivoIng.Exists Or ArchivoRem.Exists Or ArchivoIngPyMe.Exists Or ArchivoEgs.Exists Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
Else
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
'CRM
If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then
@@ -11013,31 +11019,34 @@ Partial Class Ventas
' End If
'End If
If DdlTipoComprobante.SelectedValue = "Cot" Then
If Not UsuarioActual.TienePermisoProceso(380) Then
If DdlTipoComprobante.SelectedValue = "Cot" Then
If Not CveEmpresaCRM > 0 Then
'EN EMPRESA DE ACUMULADORES NO DESCARGAR EL PDF
If UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then
If CveVenta > 0 Then MensajeAlert = New StringBuilder
If Not CveEmpresaCRM > 0 Then
'EN EMPRESA DE ACUMULADORES NO DESCARGAR EL PDF
If UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then
If CveVenta > 0 Then MensajeAlert = New StringBuilder
Dim ArchivoCotizacion As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
Dim ArchivoCotizacionMrt As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.mrt", UsuarioActual.Empresa.Ruta))
Dim ArchivoCotizacion As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
Dim ArchivoCotizacionMrt As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.mrt", UsuarioActual.Empresa.Ruta))
If Opcion = "Cot" And UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
MensajeAlert.AppendFormat("<b><a class='Texto' href=""Ventas.aspx?CveVenta={0}"">Facturar</a></b><br/><br/>", CveVenta)
If Opcion = "Cot" And UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
MensajeAlert.AppendFormat("<b><a class='Texto' href=""Ventas.aspx?CveVenta={0}"">Facturar</a></b><br/><br/>", CveVenta)
End If
If ArchivoCotizacion.Exists Or ArchivoCotizacionMrt.Exists Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=0&GUARDAR=1", CveVenta)))
Else
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
If ArchivoCotizacion.Exists Or ArchivoCotizacionMrt.Exists Then
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=0&GUARDAR=1", CveVenta)))
Else
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
End If
GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO
End If
GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO
End If
End If
'ENVIA CORREO CON DETALLE DEL CONTRATO
If DdlTipoComprobante.SelectedValue.Contiene("DPe", "Ped") Then
If Not String.IsNullOrEmpty(CorreoNotificacionPedDev) Then
@@ -11858,7 +11867,7 @@ Partial Class Ventas
End If
'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
Group By PorcentajeIVA = ddr("PorcentajeIVA").ToString().ToDecimal,
@@ -11956,7 +11965,7 @@ Partial Class Ventas
DtVentasNC.Rows(0)("TCCambioValuacion") = factura.TipoCambio
End If
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion)
factura.Timbre = PreParaTimbre(factura)
'Registramos la venta
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjAcum, ObjContr, factura, tmpcon, -1, ObjBancos, EsNCAmortizacion:=True)
@@ -12173,6 +12182,11 @@ Partial Class Ventas
ObjFactura.Alfa1 = TxtAlfa1.Text.Trim
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
If (ObjFactura.CveMoneda = 2 AndAlso ObjFactura.ConvertirPesos = True AndAlso ObjFactura.TipodeComprobante = "Ingresos" AndAlso RemisionesLista.Count > 0) Then
Dim TotalCalculableImpuestos, TotalCalculableImpuestosIVA As Decimal
@@ -13079,7 +13093,6 @@ Partial Class Ventas
End If
If HdnTipoDescuento.Value = "3" And DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero() > 0 Then
Timbre.CFDIRelacionados.TipoRelacion = "07"
Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
Else
@@ -13111,21 +13124,32 @@ Partial Class Ventas
Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos"
End Select
If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
For Each Dr As DataRow In DtVentasNC.Rows
Timbre.CFDIRelacionados.UUID.Add(Dr("FolioFiscal").ToString())
Next
Else
If ListaAnticiposAplicados IsNot Nothing AndAlso ListaAnticiposAplicados.Count > 0 Then
For Each Ant As Modelos.MAnticipoRelacionado In ListaAnticiposAplicados
Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal)
'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
Timbre.CFDIRelacionados.UUID.Clear()
For Each Dr As DataRow In DtVentasNC.Rows
Timbre.CFDIRelacionados.UUID.Add(Dr("FolioFiscal").ToString())
Next
Else
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
Timbre.CFDIRelacionados.UUID.Add(Ant.FolioFiscal)
Next
Else
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
End If
End If
End If
@@ -16615,7 +16639,7 @@ Partial Class Ventas
End If
'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()
If CveClientePublicoGeneral > 0 Then
If CveCliente <> CveClientePublicoGeneral Then
@@ -16813,6 +16837,13 @@ Partial Class Ventas
GVAnticipos.Columns(8).Visible = True
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
e.Row.FCTextBox("TxtTC" & e.Row.RowIndex).Visible = False
@@ -25604,7 +25635,7 @@ Partial Class Ventas
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
End If
@@ -25651,7 +25682,7 @@ Partial Class Ventas
Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000
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, "")
End If
@@ -30143,7 +30174,7 @@ Partial Class Ventas
Next
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 TmpDT As DataTable = Nothing
@@ -30305,7 +30336,7 @@ Partial Class Ventas
End If
End If
If Not NCDescuento Then
If Not NCDescuento AndAlso ReasignarTmpDT Then
Me.TmpDT = TmpDT
End If
'CARGA FACTURA A LA CUAL SE APLICA LA NC
@@ -31324,7 +31355,7 @@ Partial Class Ventas
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
Dim DtMovtos As DataTable = Me.TmpDTAnticiposNCIxCCliente.FiltraParametros($"Saldo > 0 And SaldoSubtotal > 0 {If(CveVenta < 0, $"AND Tipo IN('NC','RNC','IxC') ", "")}")
divAmortizacionTipoRelacion.Visible = False
@@ -32513,11 +32544,11 @@ Partial Class Ventas
For Each Dr As DataRow In dtSeleccionadas.Rows
If Dr("Medico").ToString.Length > 0 Then
MensajeRemisionesMedicas.Append($"Dr. {Dr("MEdico").ToString}{vbCrLf}")
If Dr("Medico").ToString.Trim.Length > 0 Then
MensajeRemisionesMedicas.Append($"Dr. {Dr("Medico").ToString}{vbCrLf}")
EsRemisionMedica = True
End If
If Dr("Medico").ToString.Length > 0 Then
If Dr("Procedimiento").ToString.Trim.Length > 0 Then
MensajeRemisionesMedicas.Append($"Procedimiento {Dr("Procedimiento")}{vbCrLf}")
EsRemisionMedica = True
End If
@@ -32540,7 +32571,6 @@ Partial Class Ventas
TxtObsFact.Text = If(MensajeRemisiones.ToString().Length > 0, MensajeRemisiones.ToString().Substring(0, MensajeRemisiones.ToString().Length - 2), "")
End If
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), "")
TxtObsAlmacen.Text = If(ObsInv.ToString().Length > 0, ObsInv.ToString().Substring(0, ObsInv.ToString().Length - 2), "")
@@ -33512,6 +33542,13 @@ Partial Class Ventas
End If
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
If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then
TxtFecha.Text = NowADS().ToString()
@@ -36001,39 +36038,20 @@ Partial Class Ventas
DdlChofer.DataSource = GlobalDTChoferes(UsuarioActual.CveEmpresa)
DdlChofer.DataBind()
DdlChofer.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa)
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.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=1)
DdlUnidadCamion.DataBind()
DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
DdlRemolque1.DataBind()
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.DataSource = GlobalDTGralCartaPorteConfigAutoTransportes
DdlConfigAuto.DataBind()
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()
End Sub
@@ -36047,12 +36065,10 @@ Partial Class Ventas
DdlRemolque2.SelectedValueExist(-1)
If DdlUnidadCamion.SelectedValue.ToEntero > 0 Then
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(DdlUnidadCamion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1) Then
DdlConfigAuto.SelectedValueExist(ObjInv.DtResultados.FiltroPrimeroValor("CveConfigAutoTransporte"))
DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing)
End If
End Using
Dim CveConfig As String = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveCamion:=DdlUnidadCamion.SelectedValue.ToEntero, CveTipoCamion:=1).FiltroPrimeroValor("CveConfigAutoTransporte")
DdlConfigAuto.SelectedValueExist(CveConfig)
DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing)
End If
UpEmitirTransitorio.Update()
@@ -36178,27 +36194,24 @@ Partial Class Ventas
If DdlConfigAuto.SelectedValue.ToEntero > 0 Then
Using ObjGrales As New ClsGenerales
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
Dim Remolque As String = ObjGrales.DtResultados.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'")
Dim Remolque As String = GlobalDTGralCartaPorteConfigAutoTransportes.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'")
If Remolque <> "" Then
If Remolque = "1" Then
RequiereRemolque = True
MostrarRemolques = True
End If
If Remolque = "0, 1" Then
RequiereRemolque = False
MostrarRemolques = True
End If
If Remolque = "0" Then
RequiereRemolque = False
MostrarRemolques = False
End If
If Remolque = "1" Then
RequiereRemolque = True
MostrarRemolques = True
End If
End Using
If Remolque = "0, 1" Then
RequiereRemolque = False
MostrarRemolques = True
End If
If Remolque = "0" Then
RequiereRemolque = False
MostrarRemolques = False
End If
End If
Else
RequiereRemolque = False
MostrarRemolques = False
@@ -36222,13 +36235,7 @@ Partial Class Ventas
If DdlRemolque1.SelectedValue.ToEntero > 0 Then
DvRemolque2.Visible = True
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.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=2)
DdlRemolque2.DataBind()
Else
DvRemolque2.Visible = False
@@ -36978,7 +36985,6 @@ Partial Class Ventas
If CveVenta <= 0 Then
TxtFechaPago.Text = NowADS().AddDays(PlazoCobranza).ToString("dd/MM/yyyy")
TxtOrdenCompra.Text = ""
'SI SE HABILITO LA FACTURACION DESDE LA LINEA ADICIONAL DEBE QUITARLO
If HabilitoFacturacionIngresoLineaAdicional Then
@@ -38147,7 +38153,7 @@ Partial Class Ventas
' $get('HdnTipoDescuento').value = '3'; MuestraAnticipos();
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
DdlTipoAmortizacionAnticipo.Items.Insert(1, New ListItem("Pago con devolución", "4"))
End If
@@ -38391,6 +38397,36 @@ Partial Class Ventas
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