diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index b92c5eca9..f2142985f 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2562,15 +2562,13 @@ Partial Class Ventas thPoliza2.Visible = True End If - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso UsuarioActual.CveUsuario = 100 Then - DivPenalizacion.Visible = True - End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso UsuarioActual.CveUsuario = 100 Then DivPenalizacion.Visible = True + End If - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + If UsuarioActual.Empresa.Funcionalidad(595) = "2" Then LnkSolicitarCredito.Visible = True End If - DdlSATPS.setEsWebService(True) : DdlSATPS.Attributes.Add("data-metodo", "getpssat") DivPSSAT.Visible = True @@ -2881,8 +2879,6 @@ Partial Class Ventas BtnCrearApartirDe.Visible = True If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then BtnCrearApartirDe.Visible = False - - If DdlTipoComprobante.SelectedValue = "Ped" Then BtnPermisoEditarRemision.Text = "Editar Pedido" BtnEditarRemision.Text = "Actualizar Pedido" @@ -3969,7 +3965,7 @@ Partial Class Ventas Alert("Se ha cerrado el turno correctamente.", TipoMensaje.MsgInformacion, Liga) End If Else - Alert("Debe especificar el efectivo en caja", TipoMensaje.MsgAdvertencia) + Alert("Debe especificar el efectivo en caja", TipoMensaje.ToastAdventencia) RegistraScript("window.onload = function MuestraPantallaBloqueo() { document.getElementById(""C_btnShowBloqueo"").click(); }") End If ObjPVenta.Dispose() @@ -7208,7 +7204,6 @@ Partial Class Ventas Alert("Ocurrió un error al cargar los datos del cliente. Por favor vuelva a intentar.", TipoMensaje.MsgError) End If - CveAlmacenAsignado = ObjCliente.CveAlmacenAsignado End If @@ -7565,7 +7560,7 @@ Partial Class Ventas RBLPago.Items(0).Enabled = False RBLPago_SelectedIndexChanged(Nothing, Nothing) 'GENERAR UNA AUTORIZACIÓN SI EL CLIENTE NO PERMITE CREDITO - If UsuarioActual.Empresa.Funcionalidad(595) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(268) Then + If ValorAutorizacion = "1" AndAlso Not UsuarioActual.TienePermisoProceso(268) Then 'SI LLEGÓ POR LA OPCIÓN DE COTIZACIÓN NO DEBE DE RESTRINGUIR If IfNull(Request("Op"), "").ToString() = "Cot" OrElse (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then DdlTipoComprobante.SelectedValue = "Cot" @@ -7615,7 +7610,6 @@ Partial Class Ventas UPCondicionesPago.Update() End If - Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero()) If CreditoDispo > 0 Then @@ -7652,7 +7646,7 @@ Partial Class Ventas If IfNull(Request("Op"), "").ToString() = "Cot" OrElse (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then DdlTipoComprobante.SelectedValue = "Cot" 'quito remisión y factura - If UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then + If UsuarioActual.Empresa.Funcionalidad(595) <> "2" Then DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ing")) If Not UsuarioActual.TienePermisoProceso(325) Then DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant")) @@ -7671,7 +7665,7 @@ Partial Class Ventas Bloqueo = True End If - If Bloqueo AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + If Bloqueo AndAlso ValorAutorizacion = "2" Then Dim Autorizacion As Integer = 0 Dim ObjVentas As New ClsVentas @@ -7694,7 +7688,7 @@ Partial Class Ventas If Autorizacion > 0 Then Bloqueo = False TieneBloqueoPorCreditoVencimiento = 0 - Alert("El cliente tiene una autorización aprobada") + Alert("El cliente tiene una autorización aprobada", TipoMensaje.ToastInformacion) End If End If @@ -7713,10 +7707,8 @@ Partial Class Ventas If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then TieneBloqueoPorCreditoVencimiento = 1 End If - End If - Else ' el cliente tiene crédito disponible, no tiene bloqueo DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA")) @@ -7837,15 +7829,54 @@ Partial Class Ventas Case "2" 'Autorizacion desde una solicitud del catalogo de autorizaciones 'RMF. validacion temporal 'verifica si tiene autorizaciones de Nota de crédito autorizadas - Dim ObjVentas As New ClsVentas - If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, "Ing", CveEstatus:=1) Then - Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="TipoAutorizacion") - If RowAutorizacion IsNot Nothing Then - DdlTipoComprobante.SelectedValueExistInsert("Egs", "Egresos") - End If + 'Dim ObjVentas As New ClsVentas + 'If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, "Ing", CveEstatus:=1) Then + ' Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="TipoAutorizacion") + ' If RowAutorizacion IsNot Nothing Then + ' DdlTipoComprobante.SelectedValueExistInsert("Egs", "Egresos") + ' End If + 'End If + 'ObjVentas.Dispose() + Dim Vta As New ClsVentas + Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa) + Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón:

{0}", Vta.SerieVenta) + Vta.Dispose() + If Opcion > 0 Then + If Alertas Then Alert(OpcionMsg, TipoMensaje.MsgAdvertencia) + Else + If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia) End If - ObjVentas.Dispose() - Case Else 'SI NO TIENE NINGUN TIPO DE AUTORIZACION CONFIGURADO + LnkSolicitarCredito.Visible = True + DdlTipoAutorizacion.SelectedValueExist("1") + + If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then + Dim Autorizacion As Integer = 0 + + Dim ObjVentas As New ClsVentas + If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then + Dim RowAutorizacion As DataRow = Nothing + 'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO + If TieneDiasVencidos Then + RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") + Else + RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") + End If + + If RowAutorizacion IsNot Nothing Then + Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero() + End If + End If + ObjVentas.Dispose() + + 'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO + If Autorizacion <= 0 Then + BtnEmitirImprimir.Visible = False + TieneBloqueoPorCreditoVencimiento = 1 + End If + + End If + + Case Else 'SI NO TIENE NINGUN TIPO DE AUTORIZACION CONFIGURADO 'VERIFICAR CANDADOS DE VENTA If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 Then Dim Vta As New ClsVentas @@ -7871,37 +7902,6 @@ Partial Class Ventas 'este codigo no es temporal If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia) - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then - LnkSolicitarCredito.Visible = True - DdlTipoAutorizacion.SelectedValueExist("1") - - If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then - Dim Autorizacion As Integer = 0 - - Dim ObjVentas As New ClsVentas - If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero, "Ing", CveEstatus:=1) Then - Dim RowAutorizacion As DataRow = Nothing - 'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO - If TieneDiasVencidos Then - RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") - Else - RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") - End If - - If RowAutorizacion IsNot Nothing Then - Autorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero() - End If - End If - ObjVentas.Dispose() - - 'SI NO TIENE AUTORIZACION, MANTIENE EL BLOQUEO POR CONDICIONES DE CREDITO - If Autorizacion <= 0 Then - BtnEmitirImprimir.Visible = False - TieneBloqueoPorCreditoVencimiento = 1 - End If - - End If - End If End If End Select @@ -8063,25 +8063,19 @@ Partial Class Ventas End If End If - 'CUANDO SEA COTIZACION Y SEA COMPUPROVEEDORES (EMPRESA 72) NO DEBE ENVIAR CORREO AL CLIENTE - If UsuarioActual.CveEmpresa = 72 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then + If DdlTipoComprobante.SelectedValue.Contiene("Rem", "PeC", "PA", "Ped") Then + 'ENVIO DE FACTURA ChkEnviarFactura.Checked = False - ChkEnviarFactura.Visible = False - LblEnviarMail.Visible = False + ChkEnviarFactura.Visible = True + LblEnviarMail.Visible = True + If CveVenta > 0 AndAlso EnviarCorreoCliente Then ChkEnviarFactura.Checked = EnviarCorreoCliente Else - If DdlTipoComprobante.SelectedValue.Contiene("Rem", "PeC", "PA", "Ped") Then - 'ENVIO DE FACTURA - ChkEnviarFactura.Checked = False - ChkEnviarFactura.Visible = True - LblEnviarMail.Visible = True - If CveVenta > 0 AndAlso EnviarCorreoCliente Then ChkEnviarFactura.Checked = EnviarCorreoCliente - Else - ChkEnviarFactura.Checked = EnviarCorreoCliente - ChkEnviarFactura.Visible = True - LblEnviarMail.Visible = True - End If + ChkEnviarFactura.Checked = EnviarCorreoCliente + ChkEnviarFactura.Visible = True + LblEnviarMail.Visible = True End If + End Sub @@ -9711,46 +9705,38 @@ Partial Class Ventas Me.CveAutorizacion = -1 'SI ES A CREDITO DEBE VERIFICAR SI TIENE AUTORIZACIONES - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCliente > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing") AndAlso RBLPago.SelectedValue = "1" Then + If UsuarioActual.Empresa.Funcionalidad(595) = "2" AndAlso CveCliente > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing") AndAlso RBLPago.SelectedValue = "1" Then Dim TipoDocumentoAutorizacion As String = "" Dim ImporteAutorizacion As Decimal = 0 Dim TipoAutorizacion As Integer = 0 Dim DiasVencidosAutorizacion As Integer = 0 Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero() Dim ObjVentas As New ClsVentas - Try - If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, "Ing", CveEstatus:=1) Then - Dim RowAutorizacion As DataRow = Nothing - 'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO - If TieneDiasVencidos Then - RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") - Else - RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") - End If - - If RowAutorizacion IsNot Nothing Then - TipoDocumentoAutorizacion = RowAutorizacion("CveTipoDocumento").ToString() - ImporteAutorizacion = RowAutorizacion("Importe").ToString().ToDecimal() - CveAutorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero() - TipoAutorizacion = RowAutorizacion("TipoAutorizacion").ToString().ToEntero() - DiasVencidosAutorizacion = RowAutorizacion("DiasVencidos").ToString().ToEntero() - End If + If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, "Ing", CveEstatus:=1) Then + Dim RowAutorizacion As DataRow = Nothing + 'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO + If TieneDiasVencidos Then + RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion IN(1,2) AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") + Else + RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='Ing'", Orderby:="Importe DESC") End If - Catch ex As Exception - OnError("Ocurrió un error al obtener las autorizaciones", ex) - End Try + + If RowAutorizacion IsNot Nothing Then + TipoDocumentoAutorizacion = RowAutorizacion("CveTipoDocumento").ToString() + ImporteAutorizacion = RowAutorizacion("Importe").ToString().ToDecimal() + CveAutorizacion = RowAutorizacion("CveAutorizacion").ToString().ToEntero() + TipoAutorizacion = RowAutorizacion("TipoAutorizacion").ToString().ToEntero() + DiasVencidosAutorizacion = RowAutorizacion("DiasVencidos").ToString().ToEntero() + End If + + End If + ObjVentas.Dispose() If TipoDocumentoAutorizacion = "Ing" Then If TipoAutorizacion = 1 Then - 'If TieneDiasVencidos Then - ' CveAutorizacion = -1 - ' Alert($"El crédito no esta autorizado. El cliente tiene días vencidos", TipoMensaje.MsgAdvertencia) - ' Exit Sub - 'End If - If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then Dim BloquearCredito As Boolean = True CveAutorizacion = -1 @@ -9850,7 +9836,6 @@ Partial Class Ventas End If End If - 'VALIDA PRECIO AL AGREGAR A ALMACEN If Not UsuarioActual.TienePermisoProceso(169) Then If (DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing", "PA") AndAlso NuevaFactura <> 1) Or (DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar") Or (DdlTipoComprobante.SelectedValue.Contiene("Cot") And UsuarioActual.CveEmpresa.Contiene(119)) Then @@ -10781,10 +10766,10 @@ Partial Class Ventas OnError("Ocurrió un error al generar el directorio de xml", ex) End Try - Dim SeTimbro As Boolean = False Dim SeTimbroNC As Boolean = False Dim EstatusSMS As Integer = 0 + Dim MsgErrorTimbrado As String = "" Dim MsgCancelacionRefacturacion As Modelos.Factura.MCancelacionVentaMensaje = Nothing @@ -10808,8 +10793,6 @@ Partial Class Ventas DebeTimbrar = False End If - - If DebeTimbrar AndAlso ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant", "Dev") Then If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso (UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1) Then @@ -10842,7 +10825,7 @@ Partial Class Ventas End Try Dim FolioFiscalFactura As String = ObjTimbrado.UUID - Dim MsgErrorTimbrado As String = ObjTimbrado.MensajeErrorCFDI + MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI ObjTimbrado = Nothing 'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION @@ -10872,9 +10855,9 @@ Partial Class Ventas EstatusSMS = EnviarSMSTimbrado(ObjEventos) End If - If Not SeTimbro Then - Alert(MsgErrorTimbrado, TipoMensaje.MsgError) - End If + 'If Not SeTimbro Then + ' Alert(MsgErrorTimbrado, TipoMensaje.MsgError) + 'End If 'CANCELAR FACTURA ANTERIOR Try @@ -10955,6 +10938,12 @@ Partial Class Ventas OnError("Ocurrió un error al enviar el PDF", ex) End Try Else + + 'ERROR DE NO TIMBRADO + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs", "Dev") Then + Dim StrEr As String = $"
Comprobante no emitido : {MsgErrorTimbrado}
Por favor inténtelo de nuevo a través del botón Emitir.
" + MensajeAlert.Append(StrEr) + End If 'PARA PRUEBAS, GENERAR PDF AUNQUE NO ESTE TIMBRADA If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then Try @@ -11029,10 +11018,6 @@ Partial Class Ventas End If End If - 'ERROR DE NO TIMBRADO - If Not SeTimbro And (DdlTipoComprobante.SelectedValue = "Ing" Or DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Or DdlTipoComprobante.SelectedValue = "Ant") Then - MensajeAlert.AppendFormat("La factura no se pudo timbrar. Por favor intentelo de nuevo a traves del boton Emitir.") - End If 'ERROR DE NO TIMBRADO NC If Not IsNothing(ObjNC) AndAlso ObjNC.Count > 0 AndAlso Not SeTimbroNC Then @@ -13876,6 +13861,17 @@ Partial Class Ventas CveAlmacenTraspasoDestino = drr("CveAlmacenAsignado").ToString.ToEntero '' cuando Fuera de Línea End If End If + Else + Dim drr As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimero("") + If drr IsNot Nothing Then + If RBLTipoVenta.SelectedValue.Contiene("3") Then 'cuando es A-vista + CveAlmacenTraspasoDestino = drr("CveAlmacenAlterno").ToString.ToEntero + ElseIf RBLTipoVenta.SelectedValue.Contiene("4") Then 'cuando es Consignación + CveAlmacenTraspasoDestino = drr("CveAlmacenConsignacion").ToString.ToEntero + Else + CveAlmacenTraspasoDestino = drr("CveAlmacenAsignado").ToString.ToEntero '' cuando Fuera de Línea + End If + End If End If If Not CveAlmacenTraspasoDestino > 0 Then ' para consignación es salida directa @@ -14073,7 +14069,7 @@ Partial Class Ventas factura.Timbre.Comprobante.Serie = ObjVentas.Serie factura.Timbre.Comprobante.Folio = ObjVentas.Folio.ToString() - If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Me.CveAutorizacion > 0 Then + If UsuarioActual.Empresa.Funcionalidad(595) = "2" AndAlso Me.CveAutorizacion > 0 Then If Not ObjVentas.UpdateAutorizacionLimite(Me.CveAutorizacion, factura.CveCliente, factura.CveVenta) Then ErrorList.Add("Error al guardar los limites de la autorizacion") End If @@ -16794,7 +16790,6 @@ Partial Class Ventas End If End If - If e.Row.DBCampo("Tipo").ToString() = "NC" And e.Row.DataKey("CveVenta").ToEntero() > 0 OrElse (e.Row.DBCampo("Tipo").Contiene("Ant", "IxC") And e.Row.DataKey("CveMoneda").ToEntero() = 1 AndAlso DdlMoneda.SelectedValue.ToEntero() = 2) Then 'If e.Row.DBCampo("CveMoneda").ToString().ToEntero() = 2 Then ' tipoCambio = e.Row.DBCampo("TipoCambioHoy").ToString().ToDecimal @@ -18787,7 +18782,6 @@ Partial Class Ventas Dim Existencia As Decimal = 0D - ''CveAlamcenFiltroDdl If RBLTipoVenta.SelectedValue.ToEntero = 6 Then Existencia = ObjInventarios.GetExistenciasPS(CvePS, CveUM, UsuarioActual.CveEmpresa, CveAlamcenFiltroDdl, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=-1, @@ -22412,7 +22406,6 @@ Partial Class Ventas Private Sub ObtenerFechaVencimientoCER() Try - Dim CerFile As New FileStream(Ruta & "Certificados\" & UsuarioActual.Empresa.ArchivoCer, FileMode.Open, FileAccess.Read) Dim Size As Integer = CerFile.Length.ToString().ToEntero() Dim Data As Byte() = New Byte(Size - 1) {} @@ -22424,11 +22417,7 @@ Partial Class Ventas x509.Import(Data) If x509.NotAfter <= NowADS() Then - TrVistaPrevia.Visible = False - TrEmitir.Visible = False - BtnEmitirImprimir.Visible = False - BtnCrearApartirDe.Enabled = False - Alert("La fecha del certificado ha expirado", TipoMensaje.MsgAdvertencia) + Alert("La fecha del certificado ha expirado.", TipoMensaje.MsgAdvertencia) End If Catch ex As Exception @@ -36091,6 +36080,10 @@ Partial Class Ventas If ObjPS.AddAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedor.SelectedValue.ToEntero(), TxtImporteSolicitud.Text.ToDecimal(), CveEstatus, UsuarioActual.CveUsuario, CveTipoAutorizacion, TipoDocumento:=DdlTipoDocto.SelectedValue, DiasVencidos:=DiasVencidos, Motivo:=Motivo) Then RegistraScript("$('#DivModalSolicitarCredito').modal('hide')") Alert("La autorización se agregó correctamente.", TipoMensaje.MsgInformacion) + 'signal + Dim mensaje = "
La autorización se agregó correctamente." + ClsSisNotificaciones.EnviarAlerta("Autorización Crédito", mensaje, "100", Tipo:=TipoNotificacion.ToastInformacionB) + End If ObjPS.Dispose() UpModalSolicitud.Update() @@ -36100,18 +36093,6 @@ Partial Class Ventas DivDiasVencidos.Visible = DdlTipoAutorizacion.SelectedValue.ToEntero() = 2 UpModalSolicitud.Update() End Sub - 'Protected Sub DdlTipoDocto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoDocto.SelectedIndexChanged - ' Dim TipoDocto As String = DdlTipoDocto.SelectedValue.ToString() - ' Select Case TipoDocto - ' Case "Ing" - ' DivAutorizacion.Visible = True - ' DivImporteSolicitud.Visible = True - ' Case "Egs" - ' DivAutorizacion.Visible = False - ' DivImporteSolicitud.Visible = False - ' End Select - ' UpModalSolicitud.Update() - 'End Sub Protected Sub DdlTipoDocto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoDocto.SelectedIndexChanged Dim TipoDocto As String = DdlTipoDocto.SelectedValue.ToString() @@ -36129,30 +36110,6 @@ Partial Class Ventas UpModalSolicitud.Update() End Sub - 'Private Sub CargaVendedoresSubProyectos() - - ' DdlVendedor.Items.Clear() - ' DdlVendedor.SelectedValue = Nothing - - ' Dim DtVendedoresSucursales = GlobalDTClientesVendedoresSubProyectos(UsuarioActual.CveEmpresa, CveCliente:=Me.CveCliente, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero()) - - ' If DtVendedoresSucursales IsNot Nothing AndAlso DtVendedoresSucursales.Rows.Count > 0 Then - ' DdlVendedor.DataSource = DtVendedoresSucursales - ' DtVendedoresSucursales.Dispose() - ' Else - ' If UsuarioActual.Empresa.Funcionalidad(302) = "1" AndAlso DdlSubProyectoDatos.SelectedValue.ToEntero() > 0 Then - ' DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyectoDatos.SelectedValue)).FiltraParametros("VendedorTipo = 1") - ' Else - ' DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros("VendedorTipo = 1") - ' End If - ' End If - - ' DdlVendedor.DataBind() - ' DdlVendedor.Items.Insert(0, New ListItem("Sin Asignar", "0")) - - ' UpParametros.Update() - 'End Sub - Protected Sub LnkEditarDir_Click(sender As Object, e As EventArgs) DdlDireccionEnvio.Enabled = True ChkDireccionEnvio.Enabled = True @@ -38168,7 +38125,7 @@ Partial Class Ventas CveAlamcenFiltroDdl = -1 Dim tCveAlmacenExistencia As Integer = -1 - If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then If DdlSucursalCliente.SelectedValue.ToEntero > 0 Then Dim drr As DataRow = GlobalDTClientesSucursales(UsuarioActual.CveEmpresa, CveCliente).FiltroPrimero($"CveClienteSucursal={DdlSucursalCliente.SelectedValue}") If drr IsNot Nothing Then @@ -38180,18 +38137,28 @@ Partial Class Ventas tCveAlmacenExistencia = drr("CveAlmacenAsignado").ToString.ToEntero End If End If + Else + Dim drr As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=CveCliente).FiltroPrimero("") + If drr IsNot Nothing Then + If RBLTipoVenta.SelectedValue.Contiene("6") Then 'cuando es A-vista + tCveAlmacenExistencia = drr("CveAlmacenAlterno").ToString.ToEntero + ElseIf RBLTipoVenta.SelectedValue.Contiene("5") Then 'cuando es Consignación + tCveAlmacenExistencia = drr("CveAlmacenConsignacion").ToString.ToEntero + Else + tCveAlmacenExistencia = drr("CveAlmacenAsignado").ToString.ToEntero '' cuando Fuera de Línea + End If + End If End If + CveAlamcenFiltroDdl = tCveAlmacenExistencia If Not CveAlamcenFiltroDdl > 0 Then CveAlamcenFiltroDdl = If(CveAlmacenAsignado > 0, CveAlmacenAsignado, -1) End If DdlPS.ddlWS.Attributes.Remove("data-CveAlmacen") - DdlPS.ddlWS.Attributes.Add("data-CveAlmacen", tCveAlmacenExistencia.ToString) + DdlPS.ddlWS.Attributes.Add("data-CveAlmacen", CveAlamcenFiltroDdl.ToString) End If - End Sub - #End Region Protected Sub LnkCancelarSoloCFDI_Click(sender As Object, e As EventArgs)