Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -38,8 +38,7 @@
|
||||
</div>
|
||||
<div class="titlefiltros caption" style="margin-top: -8px;">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Estatus:
|
||||
|
||||
<li>Estatus:
|
||||
<asp:DropDownList AppendDataBoundItems="true" ID="DdlEstatus" runat="server" Width="200px" DataTextField="Nombre" DataValueField="CveDispositivosGrupos" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Value="-1" Text="Todos"></asp:ListItem>
|
||||
<asp:ListItem Value="0" Text="Solicitada"></asp:ListItem>
|
||||
@@ -48,6 +47,13 @@
|
||||
<asp:ListItem Value="3" Text="Rechazada"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
<li>Cliente:
|
||||
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteFiltro" Width="200px" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
|
||||
</li>
|
||||
<li>Vendedor:
|
||||
<asp:DropDownList ID="DdlVendedorFiltro" CssClass="form-control marginFixRow select2me" runat="server" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Width="200px">
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,21 +27,38 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
If Not IsPostBack Then
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "CARGAS"
|
||||
Private Sub CargaCombos()
|
||||
Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
If EsWS Then
|
||||
DdlCliente.setEsWebService(True)
|
||||
DdlClienteFiltro.setEsWebService(True)
|
||||
Else
|
||||
DdlCliente.setEsWebService(False)
|
||||
DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlCliente.DataBind()
|
||||
DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
DdlClienteFiltro.setEsWebService(False)
|
||||
DdlClienteFiltro.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClienteFiltro.DataBind()
|
||||
DdlClienteFiltro.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End If
|
||||
|
||||
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedor.DataBind()
|
||||
|
||||
DdlVendedorFiltro.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
|
||||
DdlVendedorFiltro.DataBind()
|
||||
DdlVendedorFiltro.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
UpModal.Update()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
|
||||
Dim CveCliente As Integer = -1
|
||||
If DdlClienteFiltro.SelectedValue.ToEntero() <= 0 Then
|
||||
CveCliente = -1
|
||||
Else
|
||||
@@ -78,24 +95,18 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs)
|
||||
LimpiaModal()
|
||||
Modalidad = "A"
|
||||
BtnGuardar.Text = "Agregar"
|
||||
ltlMotititulo.Text = "Agregar autorización"
|
||||
UpModal.Update()
|
||||
RegistraScript("$('#DModal').modal()")
|
||||
RegistraScript("$('#DModal').modal()")
|
||||
End Sub
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
If DdlTipoDocto.SelectedValue = "Ing" AndAlso DdlTipoAutorizacion.SelectedValue.ToEntero() <= 0 Then
|
||||
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
If DdlTipoAutorizacion.SelectedValue.ToEntero() <= 0 Then
|
||||
Dim CveTipoAutorizacion As Integer = -1
|
||||
Alert("Debe seleccionar un tipo de autorización", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -166,7 +177,6 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
Protected Sub LnkAutorizar_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
|
||||
Dim CveAutorizacion = gvRow.DataKey("CveAutorizacion").ToEntero()
|
||||
Dim CveAutorizacion = gvRow.DataKey("CveAutorizacion").ToEntero()
|
||||
Dim CveCliente = gvRow.DataKey("CveCliente").ToEntero()
|
||||
Dim CveVendedor = gvRow.DataKey("CveVendedor").ToEntero()
|
||||
@@ -204,11 +214,12 @@ Partial Class Ventas_CatAutorizacionLimites
|
||||
End Sub
|
||||
Protected Sub DdlCliente_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
Dim CveCliente As Integer = DdlCliente.SelectedValue.ToEntero()
|
||||
If CveCliente > 0 Then
|
||||
Using ObjClientes As New ClsClientes
|
||||
If CveCliente > 0 Then
|
||||
Using ObjClientes As New ClsClientes
|
||||
If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) AndAlso ObjClientes.DtResultados.Rows.Count > 0 Then
|
||||
DdlVendedor.SelectedValueExist(ObjClientes.DtResultados.Rows(0)("CveVendedor"))
|
||||
DdlVendedor.SelectedValueExist(ObjClientes.DtResultados.Rows(0)("CveVendedor"))
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
UpModal.Update()
|
||||
|
||||
@@ -3938,7 +3938,7 @@ Partial Class Clientes
|
||||
DtCxCFact = If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("", "TipoDocto").Copy, ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "TipoDocto"))
|
||||
'cargo los anticipos NC
|
||||
DtCxCFact.Columns.Add("SaldoAnticipo", GetType(Decimal))
|
||||
|
||||
DtCxCFact.Columns.Add("TipoRNC", GetType(String))
|
||||
Dim dtt As DataTable = Nothing
|
||||
If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, -1, -1) Then
|
||||
dtt = If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) OR (Tipo = 'RNC' AND CveVenta > 0) )"), ObjMovtos.DtResultados.FiltraParametros("Saldo > 0 AND SaldoVentaAnticipo = 0 AND ((Tipo = 'IxC' AND CveIE > 0) OR (Tipo = 'Ant' AND CveVenta > 0) OR (Tipo = 'NC' AND CveVenta > 0) OR (Tipo = 'Egs' AND CveVenta > 0) OR (Tipo = 'RNC' AND CveVenta > 0) )")) ' que tenga saldo de anticipo y no de cliente
|
||||
@@ -3954,7 +3954,8 @@ Partial Class Clientes
|
||||
drr("SaldoAnticipo") = drt("Saldo")
|
||||
drr("Fecha") = drt("Fecha")
|
||||
drr("Moneda") = drt("Moneda")
|
||||
drr("CveMoneda") = drt("CveMoneda")
|
||||
drr("CveMoneda") = drt("CveMoneda")
|
||||
drr("TipoRNC") = If(drt("Tipo").ToString() = "RNC", If(drt("TipoRNC").ToString() = "2", "Bonificación", "Cargo"), "")
|
||||
DtCxCFact.Rows.Add(drr)
|
||||
|
||||
Next
|
||||
|
||||
@@ -168,7 +168,7 @@ Partial Class PV
|
||||
|
||||
Private ReadOnly Property CveVenta As Integer
|
||||
Get
|
||||
Return ViewState("CveVenta").ToString.ToEntero
|
||||
Return If(IsNothing(ViewState("CveVenta")), -1, ViewState("CveVenta").ToString.ToEntero)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -1008,6 +1008,7 @@ Partial Class PV
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
ViewState("CveVenta") = -1
|
||||
'VERIFICAR SI LA SESION SE ENCUENTRA BLOQUEADA
|
||||
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
|
||||
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
|
||||
|
||||
1049
Ventas/RepPS.aspx.vb
1049
Ventas/RepPS.aspx.vb
File diff suppressed because it is too large
Load Diff
@@ -5295,13 +5295,7 @@ Partial Class Ventas
|
||||
Private Sub CargaMetodosPago()
|
||||
|
||||
'FACTURACION 3.3
|
||||
|
||||
'No puede asignar PUE como método de pago
|
||||
If UsuarioActual.TienePermisoProceso(326) Then
|
||||
DdlMetodoPago33.DataSource = GlobalDTVtaMetodoPago.FiltraParametros("CveMetodoPago <> 1")
|
||||
Else
|
||||
DdlMetodoPago33.DataSource = GlobalDTVtaMetodoPago
|
||||
End If
|
||||
DdlMetodoPago33.DataSource = GlobalDTVtaMetodoPago
|
||||
|
||||
DdlMetodoPago33.DataBind()
|
||||
DdlMetodoPago33.SelectedValueExist("3")
|
||||
@@ -5642,7 +5636,7 @@ Partial Class Ventas
|
||||
|
||||
Me.CveFormaPago33Cliente = ObjCliente.CveFormaPago33
|
||||
|
||||
If (CveVenta <= 0 AndAlso CveCotizacion <= 0) Or EsCreaApartirDe Or NuevaFactura = 1 Then
|
||||
If (CveVenta <= 0 AndAlso CveCotizacion <= 0) Or EsCreaApartirDe Or NuevaFactura = 1 OrElse ModalidadEdicion Then
|
||||
'CveMetodoPagoCliente = ObjCliente.CveMetodoPago
|
||||
|
||||
|
||||
@@ -5738,16 +5732,13 @@ Partial Class Ventas
|
||||
ViewState("AplicaFord") = ObjCliente.AplicaFord
|
||||
TxtFordGSDB.Text = ObjCliente.Ford_GSDB
|
||||
|
||||
'SELECIONAMOS VENDEDOR - SI ESTA EN MODO EDICIÓN SE QUEDA EL VENDEDOR ORIGINAL
|
||||
If Not ModalidadEdicion Then
|
||||
If ObjCliente.DtResultados(0)("CveVendedor").ToString().ToEntero() > 0 Then
|
||||
DdlVendedor.SelectedValueExist(ObjCliente.DtResultados(0)("CveVendedor").ToString().ToEntero())
|
||||
End If
|
||||
If ObjCliente.DtResultados(0)("CveVendedor").ToString().ToEntero() > 0 Then
|
||||
DdlVendedor.SelectedValueExist(ObjCliente.DtResultados(0)("CveVendedor").ToString().ToEntero())
|
||||
End If
|
||||
|
||||
'SI EL CLIENTE NO TIENE VENDEDOR SELECCIONAMOS EL DEL USUARIO
|
||||
If Not DdlVendedor.SelectedValue.ToEntero() > 0 Then
|
||||
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString())
|
||||
End If
|
||||
'SI EL CLIENTE NO TIENE VENDEDOR SELECCIONAMOS EL DEL USUARIO
|
||||
If Not DdlVendedor.SelectedValue.ToEntero() > 0 Then
|
||||
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString())
|
||||
End If
|
||||
|
||||
If DdlVendedor.SelectedValue.ToEntero() > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
|
||||
@@ -6158,6 +6149,7 @@ Partial Class Ventas
|
||||
ObjVentas.Dispose()
|
||||
End If
|
||||
|
||||
'OBLIGAR PAGO DE CONTADO SI EL CLIENTE NO PERMITE CREDITO
|
||||
If UsuarioActual.Empresa.Funcionalidad(570) = "1" AndAlso Me.PermiteCredito = False AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") AndAlso CveVenta < 1 Then
|
||||
RBLPago.SelectedValue = "2"
|
||||
RBLPago.Items(0).Enabled = False
|
||||
@@ -6294,17 +6286,27 @@ Partial Class Ventas
|
||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
'este codigo no es temporal
|
||||
If Alertas AndAlso UsuarioActual.Empresa.Funcionalidad(518) = "1" Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
|
||||
If UsuarioActual.CveEmpresa = 140 Then
|
||||
LnkSolicitarCredito.Visible = True
|
||||
DdlTipoAutorizacion.SelectedValueExist("1")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
RBLPago.SelectedValue = "2"
|
||||
RBLPago.Items(0).Enabled = False
|
||||
RBLPago_SelectedIndexChanged(Nothing, Nothing)
|
||||
UPCondicionesPago.Update()
|
||||
Else
|
||||
'este codigo no es temporal
|
||||
If Alertas AndAlso UsuarioActual.Empresa.Funcionalidad(518) = "1" Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
|
||||
If UsuarioActual.CveEmpresa = 140 Then
|
||||
LnkSolicitarCredito.Visible = True
|
||||
DdlTipoAutorizacion.SelectedValueExist("1")
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
UPPCreditoDisponible.Update()
|
||||
'Si tiene credito disponible, Verificar limites de (verificar candados de venta, remisiones sin facturar, facturas que no tengan vencidas)
|
||||
ElseIf UsuarioActual.Empresa.Funcionalidad(597) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(268) AndAlso CveVenta > 0 AndAlso (DdlTipoComprobante.SelectedValue.Contiene("Pd2", "Cot") Or (DdlTipoComprobante.SelectedValue = "Rem" And ModalidadEdicion And ViewState("CveClienteAnterior").ToString().ToEntero() > 0 And LblRFC.Text.Trim <> "XAXX010101000")) Then
|
||||
Dim CreditoDispo As Decimal = CargaCreditoDisponible(CveCliente, DdlSucursalCliente.SelectedValue.ToEntero())
|
||||
If CreditoDispo > 0 Then
|
||||
@@ -7882,7 +7884,13 @@ Partial Class Ventas
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Try
|
||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, CveEstatus:=1) Then
|
||||
Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL AND CveTipoDocumento='{DdlTipoComprobante.SelectedValue}'", Orderby:="TipoAutorizacion")
|
||||
Dim RowAutorizacion As DataRow = Nothing
|
||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||
If TieneDiasVencidos Then
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 2 AND CveVenta IS NULL AND CveTipoDocumento='{DdlTipoComprobante.SelectedValue}'")
|
||||
Else
|
||||
RowAutorizacion = ObjVentas.DtResultados.FiltroPrimero($"TipoAutorizacion = 1 AND CveVenta IS NULL AND CveTipoDocumento='{DdlTipoComprobante.SelectedValue}'", Orderby:="Importe DESC")
|
||||
End If
|
||||
|
||||
If RowAutorizacion IsNot Nothing Then
|
||||
TipoDocumentoAutorizacion = RowAutorizacion("CveTipoDocumento").ToString()
|
||||
@@ -7922,12 +7930,22 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Egs" AndAlso CveAutorizacion <= 0 Then
|
||||
If TieneDiasVencidos AndAlso DdlTipoComprobante.SelectedValue = "Egs" AndAlso CveAutorizacion <= 0 Then
|
||||
CveAutorizacion = -1
|
||||
Alert($"El crédito no esta autorizado. No tiene autorización para generar notas de crédito.", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"El crédito no esta autorizado. No tiene autorización para generar notas de crédito. El cliente tiene días vencidos", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If TipoDocumentoAutorizacion = "Egs" Then
|
||||
If TipoAutorizacion = 1 Then
|
||||
If ImporteAutorizacion < TxtTotal.Text.ToDecimal() Then
|
||||
CveAutorizacion = -1
|
||||
Alert($"El crédito autorizado es insuficiente. Crédito Disponible:{ImporteAutorizacion:N2}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
EmitirImprimirNew(TipoDoctoViejo)
|
||||
@@ -31636,15 +31654,29 @@ Partial Class Ventas
|
||||
DivImporteSolicitud.Visible = DdlTipoAutorizacion.SelectedValue.ToEntero() = 1
|
||||
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()
|
||||
Select Case TipoDocto
|
||||
Case "Ing"
|
||||
DivAutorizacion.Visible = True
|
||||
DivImporteSolicitud.Visible = True
|
||||
If DdlTipoAutorizacion.Items.FindByValue("2") Is Nothing Then
|
||||
DdlTipoAutorizacion.Items.Insert(0, New ListItem("Vencimiento", "2"))
|
||||
End If
|
||||
Case "Egs"
|
||||
DivAutorizacion.Visible = False
|
||||
DivImporteSolicitud.Visible = False
|
||||
'QUITAR LA DE VENCIMIENTO
|
||||
DdlTipoAutorizacion.Items.Remove(DdlTipoAutorizacion.Items.FindByValue("2"))
|
||||
End Select
|
||||
UpModalSolicitud.Update()
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user