-
+
@@ -8955,11 +8955,12 @@
-
+
-
+
+
@@ -10685,13 +10686,13 @@
for (var key in item) {
if (idxColumn == 0 && '<%= UsuarioActual.Empresa.Funcionalidad(382) %>' == '1') {
- let tdExistencia = '
select').select2('close');" + '">
';
+ let tdExistencia = '
select').select2('close');" + '">
';
tr.append('
' + tdExistencia + ' | ');
- let tdComplementarios = '
select').select2('close');" + '"> 
';
+ let tdComplementarios = '
select').select2('close');" + '"> 
';
tr.append('
' + tdComplementarios + ' | ');
- let tdSimilares = '
select').select2('close');" + '">
';
+ let tdSimilares = '
select').select2('close');" + '">
';
tr.append('
' + tdSimilares + ' | ');
}
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 8e3a9c230..ecce18717 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -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
'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 MostrarAlertas Then
@@ -33653,18 +33653,47 @@ Partial Class Ventas
Private Sub BtnCargarPSAdicionales_Click(sender As Object, e As EventArgs) Handles BtnCargarPSAdicionales.Click
Dim CvePS = HdnCvePSComparar.Value.ToEntero()
If CvePS > 0 Then
+ Dim DtPSAdicionales As DataTable = Nothing
+
Dim ObjProductosServicios As New ClsProductosServicios()
If ObjProductosServicios.GetPSAdicionales(CvePS, UsuarioActual.CveEmpresa) Then
- GvPSAdicionales.DataSource = ObjProductosServicios.DtResultados.FiltraParametros($"Tipo={HdnTipoPSComparar.Value}")
+ DtPSAdicionales = ObjProductosServicios.DtResultados.FiltraParametros($"Tipo={HdnTipoPSComparar.Value}")
End If
ObjProductosServicios.Dispose()
- If HdnTipoPSComparar.Value = "1" Then
- LtlNombreModalPS.Text = "Productos y/o servicios complementarios"
- ElseIf HdnTipoPSComparar.Value = "2" Then
- LtlNombreModalPS.Text = "Productos y/o servicios similares"
+ If DtPSAdicionales IsNot Nothing Then
+ DtPSAdicionales.Columns.Add(New DataColumn("Precio", GetType(String)))
+
+ 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
+ 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()
UpSimilares.Update()
RegistraScript("$('#DivSimilares').modal({backdrop: 'static', keyboard: false });")
@@ -33696,13 +33725,21 @@ Partial Class Ventas
For Each Row As GridViewRow In GvPSAdicionales.Rows
If Row.RowType = DataControlRowType.DataRow 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()
DdlPS.SelectedValue = CvePS.ToString()
DdlPS.SelectedText = Row.DataKey("CodigoPS")
TxtCantidad.Text = Row.FCTextBox("TxtCantidad").Text
+ TxtPrecio.Text = Row.DataKey("Precio")
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS IsNot Nothing Then
@@ -33720,6 +33757,13 @@ Partial Class Ventas
HdnTipoPSComparar.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
#Region "U S A D O S"