diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index 0be6651c1..8e7c0f8a7 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -3267,13 +3267,18 @@ Public Class ClsBancos ' Return Retorno 'End Function - Public Function UpdateCuentaDepositoPagoElectronico(CveCuentaDeposito As Integer) As Boolean + Public Function UpdateCuentaDepositoPagoElectronico(CveCuentaDeposito As Integer, Optional Opcion As Integer = 1, Optional FechaEliminacion As Date = MinFecha) As Boolean + + 'Opcion 1: Bancomer, Opcion 2: Bajio, Opcion 3: Scotia + Dim Retorno As Boolean = False DataAdapter("PA_Banc_LayoutCuentaDepositoUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveCuentaDeposito", SqlDbType.Int).Value = CveCuentaDeposito + .Add("@Opcion", SqlDbType.Int).Value = Opcion + .Add("@FechaEliminacion", SqlDbType.Date).Value = FechaEliminacion End With Try diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index f6abba49c..68f28fc66 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -3431,7 +3431,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer) As Boolean + Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer, CveProveedorCompra As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUtilidadGet") @@ -3447,6 +3447,7 @@ Public Class ClsVentas .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia + .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra End With Try @@ -3461,7 +3462,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer) As Boolean + Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer, CveProveedorCompra As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasUtilidadDetalleGet") With SqlAdapter.SelectCommand.Parameters @@ -3477,6 +3478,7 @@ Public Class ClsVentas .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia + .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra End With Try @@ -3495,7 +3497,7 @@ Public Class ClsVentas Return Retorno End Function Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, - CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer, EsFilial As Integer) As Boolean + CvePS As Integer, CveCategoria As Integer, CveClasificacion As Integer, CveMarca As Integer, EsGarantia As Integer, EsFilial As Integer, CveProveedorCompra As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepVentasUtilidadGet") @@ -3513,6 +3515,7 @@ Public Class ClsVentas .Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@EsGarantia", SqlDbType.Int).Value = EsGarantia .Add("@EsFilial", SqlDbType.Int).Value = EsFilial + .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra End With Try SqlAdapter.SelectCommand.CommandTimeout = 0 diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index 0cd9c804a..f8f22edd8 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -60,15 +60,20 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState Dim CveClienteSucursal As Integer = -1 ' DdlClienteSucursalSucursal() Dim CveVendedor As Integer = If(context.Request("CveVendedor") IsNot Nothing, context.Request("CveVendedor").ToEntero, -1) Dim CveEstatus As Integer = -1 - Dim ObjOS As New ClsOS - + Dim ObjOS As New ClsOS + + If CveVendedor > 0 AndAlso CveUsuarioPara = -1 Then + Dim tcveu As Integer = ClsPaginas.GlobalDTUsuarios(-1, CveEmpresa).FiltroPrimeroValor("CveUsuario", $"CveVendedor = {CveVendedor}").ToEntero + CveUsuarioPara = tcveu + End If + If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, CveVendedor, CveEstatus, CveUsuarioPara, -1, CveEmpresa, CveMedico:=-1, CveProcedimiento:=-1, CveEspecialidad:=-1, CveClienteSucursal:=CveClienteSucursal, CveUsuario:=CveUsuario) Then If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then events = New List(Of CalendarEvent) - For Each dr As DataRow In ObjOS.DtResultados.Rows + For Each dr As DataRow In ObjOS.DtResultados.FiltraParametros("CveOS > 0").Rows Dim cevent As CalendarEvent = New CalendarEvent() cevent.id = dr("CveOS").ToString.ToEntero cevent.title = $" {dr("Tecnico")}-{dr("NombreCliente")}" diff --git a/Ashx/E140.ashx b/Ashx/E140.ashx index 2445fbc2c..6926a6820 100644 --- a/Ashx/E140.ashx +++ b/Ashx/E140.ashx @@ -178,7 +178,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState Dim TieneError As Boolean = False Dim CveSubProyecto As String = "11790" Dim JsonRequest As JObject = Nothing - + Dim Bitac As New StringBuilder If context.Request.InputStream IsNot Nothing Then Using reader As New StreamReader(context.Request.InputStream) Dim json = reader.ReadToEnd @@ -190,7 +190,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState End If End Using End If - + Bitac.AppendLine("Inicio Pago ") Dim UsuarioActual As Usuario = ValidaUsuarioSistema(100, CveEmpresa) Dim data As New JArray Dim dtt As New DataTable @@ -204,7 +204,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState Dim pCveVenta As Integer = JsonRequest("cveventa").ToString.ToEntero Dim Referencia As String = "" 'validaciones - + Bitac.AppendLine("Validaciones Pago 1.0") Dim ObjVenta As New ClsVentas() Dim ObjClientes As New ClsClientes If ObjVenta.GetVenta(pCveVenta, CveEmpresa) Then @@ -228,6 +228,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState VentaRemision.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal VentaRemision.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero + Bitac.AppendLine("Crear Nueva 1.0") Dim ObjFactura = Modelos.Factura.CrearVentaNueva(UsuarioActual, VentaRemision.CveSubProyecto, VentaRemision.CveCliente, VentaRemision.CveMoneda, "Ing") ObjFactura.CveMoneda = VentaRemision.CveMoneda ObjFactura.CveVendedor = dr("CveVendedor").ToString.ToEntero @@ -258,15 +259,15 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState If CvePrePoliza > 0 Then 'registro de venta y pago - + Bitac.AppendLine("Emitir 1.0") Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing - Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Cobranza/GuardarVenta", MostrarURL:=True) + Retorno = ObjFactura.EmitirFactura(False, Transac:=ObjVentas.IniciaTransacSQL(), Modulo:="Kiosko140/GuardarVenta", MostrarURL:=True) Retorno.Factura = ObjFactura If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then VentaRemision.CveVenta = ObjFactura.CveVenta 'Respuesta.data = Retorno.SerieFolio - + Bitac.AppendLine("Venta Registada") If TieneError Then Dim sb As New StringBuilder() For Each msg As String In Retorno.Mensajes @@ -274,6 +275,7 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState Next RespuestaError.message = sb.ToString() End If + Bitac.AppendLine("Inicia Registro IE") '11- tdd, 12-tdc Dim CveIE As Integer = ObjIE.AddBancos_IE(CveCuentaBancaria, CveTipoTransaccion, FechaPago, "-1", "", ImportePago, VentaRemision.CveMoneda, VentaRemision.TC, "", "", False, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) @@ -288,20 +290,25 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState Pago.ImportePago = ImportePago Pago.ImportePagoVenta = ImportePago Pago.Referencia = Referencia - + Bitac.AppendLine("IE Registrado") If MsgError = "" AndAlso ClsPaginas.AplicaPrePolizaPagoVenta(VentaRemision, Pago, CvePrePoliza, ObjConta) Then MsgError = "No se pudo insertar la póliza" End If Else MsgError = "No se pudo insertar el pago" + Bitac.AppendLine("IE NO Registrado") End If Else TieneError = True MsgError = "Falta información para completar la venta." + Bitac.AppendLine("Venta NO Registrado - ") + Bitac.AppendLine(Retorno.Mensajes(0)) End If End If + Bitac.AppendLine("Registrados") + If Not TieneError Then - Dim bytesPDF As Byte() = DescargarFactura(ObjFactura.SerieFolio, CveEmpresa, ObjFactura.CveVenta) 'ClsPaginas.PdfFactura(ObjFactura, AplicaPagare:="0", Guardar:=True, RegenerarQR:=True, EsTicket:=False) + Dim bytesPDF As Byte() = Nothing ' DescargarFactura(ObjFactura.SerieFolio, CveEmpresa, ObjFactura.CveVenta) 'ClsPaginas.PdfFactura(ObjFactura, AplicaPagare:="0", Guardar:=True, RegenerarQR:=True, EsTicket:=False) 'generar el pdf y mandarlo Dim objretorno As New JObject( @@ -313,12 +320,15 @@ Public Class E140 : Implements IHttpHandler, IRequiresSessionState Respuesta.data = data ObjConta.RollBack() 'ObjConta.Commit() + Bitac.AppendLine("Completado.") Else ObjConta.RollBack() + Bitac.AppendLine("NO Completado.") End If ObjConta.Dispose() ObjIE.Dispose() End If + Bitac.ToString.GuardaLog End If ObjVenta.Dispose() ObjClientes.Dispose() diff --git a/Bancos/PagoElectronico.aspx b/Bancos/PagoElectronico.aspx index 85d24ba79..453f22d68 100644 --- a/Bancos/PagoElectronico.aspx +++ b/Bancos/PagoElectronico.aspx @@ -105,11 +105,17 @@ - + Bancomer: + + + Scotia Bank: + + + @@ -157,7 +163,7 @@ - + @@ -619,6 +625,71 @@ + + +