--FIX. productos adicionales/similares
This commit is contained in:
@@ -2350,7 +2350,7 @@
|
|||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<label style="top: 0;margin-bottom: 0; font-size: 13px; color: #888888;opacity: 1;">Tipo:</label>
|
<label style="top: 0;margin-bottom: 0; font-size: 13px; color: #888888;opacity: 1;">Tipo:</label>
|
||||||
<asp:RadioButtonList ID="RblTipoAdicional" runat="server" RepeatDirection="Horizontal">
|
<asp:RadioButtonList ID="RblTipoAdicional" runat="server" RepeatDirection="Horizontal">
|
||||||
<asp:ListItem Value="1" Selected="True">Complementario</asp:ListItem>
|
<asp:ListItem Value="1" Selected="True">Adicional</asp:ListItem>
|
||||||
<asp:ListItem Value="2">Similar</asp:ListItem>
|
<asp:ListItem Value="2">Similar</asp:ListItem>
|
||||||
</asp:RadioButtonList>
|
</asp:RadioButtonList>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8929,7 +8929,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%-- MODAL PS ADICIONALES --%>
|
<%-- MODAL PS ADICIONALES --%>
|
||||||
<div id="DivSimilares" class="modal ADS fade" role="dialog">
|
<div id="DivSimilares" class="modal ADS fade" role="dialog" style="z-index:9999;">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<asp:UpdatePanel ID="UpSimilares" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpSimilares" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
@@ -8943,7 +8943,7 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<asp:GridView ID="GvPSAdicionales" runat="server" GridLines="None" DataKeyNames="CvePS,CodigoPS" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" data-heighterror="600" EmptyDataText="No se encontraron registros">
|
<asp:GridView ID="GvPSAdicionales" runat="server" GridLines="None" DataKeyNames="CvePSAdicional,CodigoPS,Precio" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" data-heighterror="600" EmptyDataText="No se encontraron registros">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%" ItemStyle-CssClass="NoClick">
|
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%" ItemStyle-CssClass="NoClick">
|
||||||
<HeaderTemplate>
|
<HeaderTemplate>
|
||||||
@@ -8955,11 +8955,12 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" HeaderText="Cantidad">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" HeaderText="Cantidad">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TxtCantidad" runat="server" CausesValidation="true" lang="nb" Text="0.00" MaxLength="12" Width="100%" Height="24px" CssClass="form-control input-sm"></asp:TextBox>
|
<asp:TextBox ID="TxtCantidad" runat="server" CausesValidation="true" lang="nb" Text="1" MaxLength="12" Width="100%" Height="24px" CssClass="form-control input-sm"></asp:TextBox>
|
||||||
<ajax:FilteredTextBoxExtender ID="FTVCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
<ajax:FilteredTextBoxExtender ID="FTVCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:BoundField DataField="CodigoPS" ItemStyle-Width="85%" HeaderText="Producto y/o Servicio" ItemStyle-HorizontalAlign="Left"/>
|
<asp:BoundField DataField="CodigoPS" ItemStyle-Width="75%" HeaderText="Producto y/o Servicio" ItemStyle-HorizontalAlign="Left" />
|
||||||
|
<asp:BoundField DataField="Precio" ItemStyle-Width="10%" HeaderText="Precio" ItemStyle-HorizontalAlign="Right" />
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
@@ -10685,13 +10686,13 @@
|
|||||||
for (var key in item) {
|
for (var key in item) {
|
||||||
|
|
||||||
if (idxColumn == 0 && '<%= UsuarioActual.Empresa.Funcionalidad(382) %>' == '1') {
|
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');" + '"> <img style="width:15px; height: 13px;" src="../Content/CustomIcons/existencia_verde.svg" alt="Buscar existencias"></img > </a>';
|
let tdExistencia = '<a href="javascript:void(0);" title="Ver existencias" onclick="javascript:AbrirVentana(' + "'/Inventarios/PopUpExistenciasAlmacen.aspx?CvePS=" + item.id + "'" + ", 800, 547," + "'N'" + ",'PopUpBuscar');$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <img style="width:15px; height: 13px;" src="../Content/CustomIcons/existencia_verde.svg"></img > </a>';
|
||||||
tr.append('<td>' + tdExistencia + '</td>');
|
tr.append('<td>' + tdExistencia + '</td>');
|
||||||
|
|
||||||
let tdComplementarios = '<a href="javascript:void(0);" onclick="' + "javascript:$get('HdnCvePSComparar').value=" + item.id + ";$get('HdnTipoPSComparar').value=1;CargaPSAdicionalesSimilares();" + "$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <img style="width:15px; height: 13px;" src="../Content/CustomIcons/sustituir_azul.svg" alt="Productos complementarios"></img ></a>';
|
let tdComplementarios = '<a href="javascript:void(0);" title="Productos y/o servicios adicionales" onclick="' + "javascript:$get('HdnCvePSComparar').value=" + item.id + ";$get('HdnTipoPSComparar').value=1;CargaPSAdicionalesSimilares();" + "$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <img style="width:15px; height: 13px;" src="../Content/CustomIcons/sustituir_azul.svg"></img ></a>';
|
||||||
tr.append('<td>' + tdComplementarios + '</td>');
|
tr.append('<td>' + tdComplementarios + '</td>');
|
||||||
|
|
||||||
let tdSimilares = '<a href="javascript:void(0);" onclick="' + "javascript:$get('HdnCvePSComparar').value=" + item.id + ";$get('HdnTipoPSComparar').value=2;CargaPSAdicionalesSimilares();" + "$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <img style="width:15px; height: 13px;" src="../Content/CustomIcons/similar_verde.svg" alt="Productos similares"></img > </a>';
|
let tdSimilares = '<a href="javascript:void(0);" title="Productos y/o servicios similares" onclick="' + "javascript:$get('HdnCvePSComparar').value=" + item.id + ";$get('HdnTipoPSComparar').value=2;CargaPSAdicionalesSimilares();" + "$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <img style="width:15px; height: 13px;" src="../Content/CustomIcons/similar_verde.svg"></img > </a>';
|
||||||
tr.append('<td>' + tdSimilares + '</td>');
|
tr.append('<td>' + tdSimilares + '</td>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23919,7 +23919,7 @@ Partial Class Ventas
|
|||||||
Dim TienePagos As Boolean = ((Not (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0)) AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0)) OrElse AmortizacionNC > 0
|
Dim TienePagos As Boolean = ((Not (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0)) AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0)) OrElse AmortizacionNC > 0
|
||||||
|
|
||||||
'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO
|
'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO
|
||||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ((CveVenta <= 0 OrElse EsCreaApartirDe OrElse TipoDoctoViejo = "Cot") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant")) Then
|
If (UsuarioActual.Empresa.Funcionalidad(558) = "1" OrElse UsuarioActual.CveEmpresa = 197) AndAlso ((CveVenta <= 0 OrElse EsCreaApartirDe OrElse TipoDoctoViejo = "Cot") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant")) Then
|
||||||
|
|
||||||
If Not PermiteCredito AndAlso Not TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
|
If Not PermiteCredito AndAlso Not TienePagos AndAlso TxtTotal.Text.ToDecimal > 0 Then
|
||||||
If MostrarAlertas Then
|
If MostrarAlertas Then
|
||||||
@@ -33653,18 +33653,47 @@ Partial Class Ventas
|
|||||||
Private Sub BtnCargarPSAdicionales_Click(sender As Object, e As EventArgs) Handles BtnCargarPSAdicionales.Click
|
Private Sub BtnCargarPSAdicionales_Click(sender As Object, e As EventArgs) Handles BtnCargarPSAdicionales.Click
|
||||||
Dim CvePS = HdnCvePSComparar.Value.ToEntero()
|
Dim CvePS = HdnCvePSComparar.Value.ToEntero()
|
||||||
If CvePS > 0 Then
|
If CvePS > 0 Then
|
||||||
|
Dim DtPSAdicionales As DataTable = Nothing
|
||||||
|
|
||||||
Dim ObjProductosServicios As New ClsProductosServicios()
|
Dim ObjProductosServicios As New ClsProductosServicios()
|
||||||
If ObjProductosServicios.GetPSAdicionales(CvePS, UsuarioActual.CveEmpresa) Then
|
If ObjProductosServicios.GetPSAdicionales(CvePS, UsuarioActual.CveEmpresa) Then
|
||||||
GvPSAdicionales.DataSource = ObjProductosServicios.DtResultados.FiltraParametros($"Tipo={HdnTipoPSComparar.Value}")
|
DtPSAdicionales = ObjProductosServicios.DtResultados.FiltraParametros($"Tipo={HdnTipoPSComparar.Value}")
|
||||||
End If
|
End If
|
||||||
ObjProductosServicios.Dispose()
|
ObjProductosServicios.Dispose()
|
||||||
|
|
||||||
If HdnTipoPSComparar.Value = "1" Then
|
If DtPSAdicionales IsNot Nothing Then
|
||||||
LtlNombreModalPS.Text = "Productos y/o servicios complementarios"
|
DtPSAdicionales.Columns.Add(New DataColumn("Precio", GetType(String)))
|
||||||
ElseIf HdnTipoPSComparar.Value = "2" Then
|
|
||||||
LtlNombreModalPS.Text = "Productos y/o servicios similares"
|
For Each Row As DataRow In DtPSAdicionales.Rows
|
||||||
|
Dim DrPSAdicional As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=Row("CvePSAdicional").ToString().ToEntero()).FiltroPrimero("")
|
||||||
|
If DrPSAdicional IsNot Nothing Then
|
||||||
|
'SUGIERE PRECIO
|
||||||
|
Dim PrecioSugerido As Decimal = 0
|
||||||
|
Dim tPrecioSugerido As Decimal = 0
|
||||||
|
tPrecioSugerido = DrPSAdicional("Precio").ToString().ToDecimal
|
||||||
|
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(Row("CvePSAdicional").ToString().ToEntero(), DrPSAdicional("CveClasificacion").ToString().ToEntero())
|
||||||
|
|
||||||
|
PrecioSugerido = ObjPrecioSugerido.PrecioSugerido
|
||||||
|
|
||||||
|
If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido
|
||||||
|
|
||||||
|
Row("Precio") = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere
|
||||||
|
End If
|
||||||
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
GvPSAdicionales.DataSource = DtPSAdicionales
|
||||||
|
|
||||||
|
Dim DrPSPadre = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||||
|
If DrPSPadre IsNot Nothing Then
|
||||||
|
If HdnTipoPSComparar.Value = "1" Then
|
||||||
|
LtlNombreModalPS.Text = $"Productos y/o servicios adicionales. PS:{DrPSPadre("CodigoPS")}"
|
||||||
|
ElseIf HdnTipoPSComparar.Value = "2" Then
|
||||||
|
LtlNombreModalPS.Text = $"Productos y/o servicios similares PS:{DrPSPadre("CodigoPS")}"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
GvPSAdicionales.DataBind()
|
GvPSAdicionales.DataBind()
|
||||||
UpSimilares.Update()
|
UpSimilares.Update()
|
||||||
RegistraScript("$('#DivSimilares').modal({backdrop: 'static', keyboard: false });")
|
RegistraScript("$('#DivSimilares').modal({backdrop: 'static', keyboard: false });")
|
||||||
@@ -33696,13 +33725,21 @@ Partial Class Ventas
|
|||||||
For Each Row As GridViewRow In GvPSAdicionales.Rows
|
For Each Row As GridViewRow In GvPSAdicionales.Rows
|
||||||
If Row.RowType = DataControlRowType.DataRow Then
|
If Row.RowType = DataControlRowType.DataRow Then
|
||||||
If Row.FCCheckBox("chkPSAdicional").Checked Then
|
If Row.FCCheckBox("chkPSAdicional").Checked Then
|
||||||
Dim CvePS As Integer = Row.DataKey("CvePS").ToEntero()
|
'LIMPIAR LAS VARIABLES
|
||||||
|
TxtCantidad.Text = ""
|
||||||
|
TxtPrecio.Text = ""
|
||||||
|
HdnPS.Value = "-1"
|
||||||
|
DdlPS.SelectedValue = "-1"
|
||||||
|
DdlPS.SelectedText = "-"
|
||||||
|
|
||||||
|
Dim CvePS As Integer = Row.DataKey("CvePSAdicional").ToEntero()
|
||||||
|
|
||||||
HdnPS.Value = CvePS.ToString()
|
HdnPS.Value = CvePS.ToString()
|
||||||
DdlPS.SelectedValue = CvePS.ToString()
|
DdlPS.SelectedValue = CvePS.ToString()
|
||||||
DdlPS.SelectedText = Row.DataKey("CodigoPS")
|
DdlPS.SelectedText = Row.DataKey("CodigoPS")
|
||||||
|
|
||||||
TxtCantidad.Text = Row.FCTextBox("TxtCantidad").Text
|
TxtCantidad.Text = Row.FCTextBox("TxtCantidad").Text
|
||||||
|
TxtPrecio.Text = Row.DataKey("Precio")
|
||||||
|
|
||||||
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
|
||||||
If DrPS IsNot Nothing Then
|
If DrPS IsNot Nothing Then
|
||||||
@@ -33720,6 +33757,13 @@ Partial Class Ventas
|
|||||||
|
|
||||||
HdnTipoPSComparar.Value = "-1"
|
HdnTipoPSComparar.Value = "-1"
|
||||||
HdnCvePSComparar.Value = "-1"
|
HdnCvePSComparar.Value = "-1"
|
||||||
|
TxtCantidad.Text = ""
|
||||||
|
TxtPrecio.Text = ""
|
||||||
|
HdnPS.Value = "-1"
|
||||||
|
DdlPS.SelectedValue = "-1"
|
||||||
|
DdlPS.SelectedText = "-"
|
||||||
|
|
||||||
|
RegistraScript("$('#DivSimilares').modal('hide');abrirDdlPS();", "A2")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "U S A D O S"
|
#Region "U S A D O S"
|
||||||
|
|||||||
Reference in New Issue
Block a user