Cambios en lineas adicionales en ventas
This commit is contained in:
@@ -5603,7 +5603,7 @@ Public Class ClsVentas
|
||||
|
||||
End Function
|
||||
|
||||
Public Function GetLineasAdicionalesSaldo(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, Optional ConSaldo As Integer = -1) As Boolean
|
||||
Public Function GetLineasAdicionalesSaldo(CveLineaAdicional As Integer, CveCliente As Integer, CveProveedor As Integer, CveMoneda As Integer, CveEmpresa As Integer, Optional ConSaldo As Integer = -1, Optional FechaVencimientoConsulta As DateTime = MaxFecha) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_LineasAdicionalesSaldoGet")
|
||||
@@ -5615,6 +5615,7 @@ Public Class ClsVentas
|
||||
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@ConSaldo", SqlDbType.Int).Value = ConSaldo
|
||||
.Add("@FechaVencimientoConsulta", SqlDbType.Date).Value = FechaVencimientoConsulta
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
|
||||
@@ -713,6 +713,17 @@
|
||||
</asp:UpdatePanel>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="TrLineaAdicional" runat="server" visible="false">
|
||||
<td align="left">Linea Adicional:</td>
|
||||
<td align="left">
|
||||
<asp:DropDownList ID="DdlLineaAdicional" DataTextField="InfoGeneral" DataValueField="CveLineaAdicional" AutoPostBack="true" CssClass=" form-control input-sm select2me" runat="server" Width="200px" OnSelectedIndexChanged="DdlLineaAdicional_SelectedIndexChanged">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td align="left">
|
||||
<asp:LinkButton runat="server" Visible="false" ID="LnkUpdateLineaAdicional" OnClick="LnkUpdateLineaAdicional_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea actualizar la linea adicional de crédito de la factura?" data-btn-ok-label="si" Text="<i class='fa fa-check' style='color:green'></i>" CssClass="btn btn-default btn-circle btn-xs" ToolTip="Actualizar Linea adicional" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="left" id="TrAlmacenOrigen" runat="server" visible="False">
|
||||
<td>
|
||||
<asp:Label runat="server" ToolTip="Almacen Asignado" Font-Bold="true" Text="Almacen O:"></asp:Label>
|
||||
@@ -2406,7 +2417,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light xspadding bordered whitoutcol" style="width: 100%;">
|
||||
@@ -2417,12 +2429,12 @@
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
Emitir <asp:CheckBox ID="ChkEmitirComercioExterior" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkEmitirComercioExterior_CheckedChanged" AutoPostBack="true" />
|
||||
Emitir
|
||||
<asp:CheckBox ID="ChkEmitirComercioExterior" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkEmitirComercioExterior_CheckedChanged" AutoPostBack="true" />
|
||||
<a href="javascript:;" onclick="CargaComercioExterior()" class="expand"></a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2431,8 +2443,8 @@
|
||||
<ContentTemplate>
|
||||
<div class="form-body">
|
||||
|
||||
|
||||
<%-- <div class="row rowpadding">
|
||||
|
||||
<%-- <div class="row rowpadding">
|
||||
<label class="col-md-2">Emitir:</label>
|
||||
<div class="col-md-10">
|
||||
|
||||
@@ -3443,17 +3455,7 @@
|
||||
</div>
|
||||
<div class="portlet-body formnombottom">
|
||||
<table border="0" width="100%">
|
||||
<tr id="TrLineaAdicional" runat="server" visible="false">
|
||||
<td align="left">Linea Adicional:</td>
|
||||
<td align="left">
|
||||
<asp:DropDownList ID="DdlLineaAdicional" DataTextField="InfoGeneral" DataValueField="CveLineaAdicional" AutoPostBack="true" CssClass=" form-control input-sm select2me" runat="server" Width="200px" OnSelectedIndexChanged="DdlLineaAdicional_SelectedIndexChanged">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td align="left">
|
||||
<asp:LinkButton runat="server" Visible="false" ID="LnkUpdateLineaAdicional" OnClick="LnkUpdateLineaAdicional_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea actualizar la linea adicional de crédito de la factura?" data-btn-ok-label="si" Text="<i class='fa fa-check' style='color:green'></i>" CssClass="btn btn-default btn-circle btn-xs" ToolTip="Actualizar Linea adicional" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="TrFormaEntrega" runat="server" visible="false">
|
||||
<td align="left">Forma de entrega:</td>
|
||||
<td align="left">
|
||||
@@ -7825,7 +7827,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<%-- <a href="javascript:;" class="collapse"></a>--%>
|
||||
<%-- <a href="javascript:;" class="collapse"></a>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
|
||||
|
||||
@@ -2249,12 +2249,12 @@ Partial Class Ventas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveClasificacionLineaAdicional As Integer
|
||||
Private Property CveCategoriaLineaAdicional As Integer
|
||||
Get
|
||||
Return IfNull(ViewState("CveClasificacionLineaAdicional"), "-1", ViewState("CveClasificacionLineaAdicional")).ToString().ToEntero()
|
||||
Return IfNull(ViewState("CveCategoriaLineaAdicional"), "-1", ViewState("CveCategoriaLineaAdicional")).ToString().ToEntero()
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveClasificacionLineaAdicional") = value
|
||||
ViewState("CveCategoriaLineaAdicional") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -8844,11 +8844,21 @@ Partial Class Ventas
|
||||
|
||||
'VALIDAR LINEAS ADICIONALES
|
||||
If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
|
||||
'VERIFICA QUE LA CLASIFICACION DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
|
||||
If TmpDT IsNot Nothing AndAlso Me.CveClasificacionLineaAdicional > 0 Then
|
||||
For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).Rows
|
||||
If Me.CveClasificacionLineaAdicional <> Row("CveClasificacion").ToString().ToEntero() Then
|
||||
Alert($"La clasificación '{Row("Clasificacion")}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
|
||||
'VERIFICA QUE LA CATEGORIA DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
|
||||
If TmpDT IsNot Nothing AndAlso Me.CveCategoriaLineaAdicional > 0 Then
|
||||
For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion"}).Rows
|
||||
Dim RowClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=Row("CveClasificacion").ToString().ToEntero()).FiltroPrimero("")
|
||||
|
||||
If RowClasificacion IsNot Nothing Then
|
||||
Dim CveCategoria As Integer = Row("CveCategoria").ToString().ToEntero()
|
||||
Dim Categoria As String = Row("Categoria").ToString()
|
||||
|
||||
If Me.CveCategoriaLineaAdicional <> CveCategoria Then
|
||||
Alert($"La categoría '{Categoria}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
Alert($"No se encontro la clasificación.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Next
|
||||
@@ -14683,12 +14693,12 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'Factura
|
||||
If Not ObjEventos.AddEventoBitacora($"Remisión facturada : <a href='/Ventas/Ventas.aspx?CveVenta={CveRemision}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then
|
||||
If Not ObjEventos.AddEventoBitacora($"Venta facturada de Remisión: <a href='/Ventas/Ventas.aspx?CveVenta={CveRemision}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=ObjFactura.CveVenta) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
|
||||
'Remision
|
||||
If Not ObjEventos.AddEventoBitacora($"Facturación de remisión en: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then
|
||||
If Not ObjEventos.AddEventoBitacora($"Remisión facturada en Venta: <a href='/Ventas/Ventas.aspx?CveVenta={ObjFactura.CveVenta}' target='_blank' class='Texto'>{ObjFactura.Folio}</a>", "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveRemision) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
Next
|
||||
@@ -18079,11 +18089,11 @@ Partial Class Ventas
|
||||
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=-1) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
TrLineaAdicional.Visible = True
|
||||
DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"Saldo > 0 OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
|
||||
DdlLineaAdicional.DataSource = ObjVentas.DtResultados.FiltraParametros($"(Saldo > 0 AND FechaVencimiento <= {Now.ToString("dd/MM/yyyy")}) OR CveLineaAdicional = {Me.CveLineaAdicionalVenta}")
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=1) Then
|
||||
If ObjVentas.GetLineasAdicionalesSaldo(-1, CveCliente, -1, DdlMoneda.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa, ConSaldo:=1, FechaVencimientoConsulta:=Now) Then
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
TrLineaAdicional.Visible = True
|
||||
DdlLineaAdicional.DataSource = ObjVentas.DtResultados
|
||||
@@ -18104,7 +18114,7 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
|
||||
UPCondicionesPago.Update()
|
||||
UpParametros.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -35302,26 +35312,36 @@ Partial Class Ventas
|
||||
If ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
TxtFechaPago.Text = ObjVentas.DtResultados.Rows(0)("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy")
|
||||
Me.SaldoLineaAdicional = ObjVentas.DtResultados.Rows(0)("Saldo").ToString().ToDecimal()
|
||||
Me.CveClasificacionLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveClasificacionPS").ToString().ToEntero()
|
||||
Me.CveCategoriaLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveCategoria").ToString().ToEntero()
|
||||
Me.CveMonedaLineaAdicional = ObjVentas.DtResultados.Rows(0)("CveMoneda").ToString().ToEntero()
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
Else
|
||||
Me.SaldoLineaAdicional = 0
|
||||
Me.CveClasificacionLineaAdicional = 0
|
||||
Me.CveCategoriaLineaAdicional = 0
|
||||
End If
|
||||
|
||||
UPCondicionesPago.Update()
|
||||
UpParametros.Update()
|
||||
End Sub
|
||||
Protected Sub LnkUpdateLineaAdicional_Click(sender As Object, e As EventArgs)
|
||||
'VALIDAR LINEAS ADICIONALES
|
||||
If UsuarioActual.Empresa.Funcionalidad(705) = "1" AndAlso DdlLineaAdicional.SelectedValue.ToEntero() > 0 Then
|
||||
'VERIFICA QUE LA CLASIFICACION DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
|
||||
If TmpDT IsNot Nothing AndAlso Me.CveClasificacionLineaAdicional > 0 Then
|
||||
For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion", "Clasificacion"}).Rows
|
||||
If Me.CveClasificacionLineaAdicional <> Row("CveClasificacion").ToString().ToEntero() Then
|
||||
Alert($"La clasificación '{Row("Clasificacion")}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
|
||||
'VERIFICA QUE LA CATEGORIA DE LOS PRODUCTOS DEBE SER LA MISMA DE LA LINEA ADICIONAL
|
||||
If TmpDT IsNot Nothing AndAlso Me.CveCategoriaLineaAdicional > 0 Then
|
||||
For Each Row As DataRow In TmpDT.FiltraParametros("", DistinctColumns:={"CveClasificacion"}).Rows
|
||||
Dim RowClasificacion = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=Row("CveClasificacion").ToString().ToEntero()).FiltroPrimero("")
|
||||
|
||||
If RowClasificacion IsNot Nothing Then
|
||||
Dim CveCategoria As Integer = Row("CveCategoria").ToString().ToEntero()
|
||||
Dim Categoria As String = Row("Categoria").ToString()
|
||||
|
||||
If Me.CveCategoriaLineaAdicional <> CveCategoria Then
|
||||
Alert($"La categoría '{Categoria}' no pertenece a la linea adicional.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
Alert($"No se encontro la clasificación.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Next
|
||||
|
||||
Reference in New Issue
Block a user