+
+
+
diff --git a/Ventas/RepVentasUtilidadPadre.aspx.vb b/Ventas/RepVentasUtilidadPadre.aspx.vb
index ebf3144c8..2e58d4ef0 100644
--- a/Ventas/RepVentasUtilidadPadre.aspx.vb
+++ b/Ventas/RepVentasUtilidadPadre.aspx.vb
@@ -252,7 +252,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
e.Row.DBCampo("Grupo"), e.Row.DBCampo("GPO"), e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("CveMarca"), e.Row.DBCampo("CveCategoria"))
e.Row.Cells(0).Text = String.Format("{2}", Css, Liga, e.Row.Cells(0).Text)
Else
- e.Row.Cells(10).BackColor = Drawing.Color.LightGray
+ e.Row.Cells(12).BackColor = Drawing.Color.LightGray
End If
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 00999f431..2c702be69 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -758,12 +758,12 @@
| Fecha: |
-
+
-
+
-
+
@@ -1160,7 +1160,9 @@
-
+
+
+
@@ -6566,6 +6568,7 @@
+
<%--FLETES--%>
@@ -8925,7 +8928,71 @@
-
+ <%-- MODAL PS ADICIONALES --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%--
+ --%>
+
+
+
+
+
+
@@ -10218,6 +10285,7 @@
});
$('body').on('click', '.ChkAllClickAF input', function () { $(".ChkAllEvtAF input").not(this).prop('checked', $('.ChkAllClickAF input').is(':checked')); });
+ $('body').on('click', '.ChkAllClickPS input', function () { $(".ChkAllEvtPS input").not(this).prop('checked', $('.ChkAllClickPS input').is(':checked')); });
if(HdnCargarInventario.value == 'True'){
$("#TabAlmacen_tab .ajax__tab_inner").click(function () {
@@ -10566,6 +10634,10 @@
$('#BtnCargaAuxiliarConta').click();
}
+ function CargaPSAdicionalesSimilares() {
+ $('#BtnCargarPSAdicionales').click();
+ }
+
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
@@ -10597,6 +10669,8 @@
for (var key in item) {
if (idxHeader == 0 && '<%= UsuarioActual.Empresa.Funcionalidad(382) %>' == '1') {
tr.append(' | ');
+ tr.append(' | ');
+ tr.append(' | ');
}
if (!(key == "text" || key == "id")) {
td = $(' ' + key + ' | ');
@@ -10612,8 +10686,14 @@
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');" + '">  ';
+ tr.append(' ' + tdComplementarios + ' | ');
+
+ let tdSimilares = ' select').select2('close');" + '"> ';
+ tr.append(' ' + tdSimilares + ' | ');
}
if (!(key == "text" || key == "id")) {
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 2e3a6c215..d63a41e9e 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -3902,7 +3902,7 @@ Partial Class Ventas
ObjPVenta.Dispose()
End Sub
Private Sub CargaEntradasSalidas()
- Dim ObjPVenta As New ClsPuntoVenta
+ Dim ObjPVenta As New ClsVentas
'Salida
If ObjPVenta.GetVta_MovimientosCajas(CveCorte, 0) Then
@@ -8710,6 +8710,9 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
e.Row.FCLinkButton("LnkDescuentos").Visible = True
+ If e.Row.DBCampo("TipoDocto") = "Cot" AndAlso CveVenta > 0 AndAlso Not EsCreaApartirDe Then
+ e.Row.FCLinkButton("imgClone").Visible = False
+ End If
End If
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
@@ -16969,7 +16972,7 @@ Partial Class Ventas
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
- importeMN = importeMovimiento * gvr.DataKey("TipoCambio").ToString().ToDecimal
+ importeMN = importeMovimiento 'importeMovimiento * gvr.DataKey("TipoCambio").ToString().ToDecimal
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
@@ -23889,9 +23892,21 @@ Partial Class Ventas
UpPS.Update()
End If
+ If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 Then
+ Dim ImporteMaximo As Decimal = DtPagos.MAX("Importe").ToDecimal()
+ Dim RowPagoMaximo As DataRow = DtPagos.FiltroPrimero($"Importe >= {ImporteMaximo}")
+ If RowPagoMaximo IsNot Nothing Then
+ Dim CveTipoTransaccion As Integer = RowPagoMaximo("CveTipoMovimiento").ToString().ToEntero()
+ If CveTipoTransaccion > 0 Then
+ Dim CveFormaPago = GlobalDTTipoTransacciones.FiltroPrimeroValor("CveFormaPago", RowFilter:=$"CveTipoTransaccion = {CveTipoTransaccion} AND Estatus = 1")
+ DdlFormaPago33.SelectedValueExist(CveFormaPago)
+ End If
+ End If
+ End If
+
CargaGridContado()
UpContado.Update()
-
+ UPCondicionesPago.Update()
End Sub
Private Sub RBLPago_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLPago.SelectedIndexChanged
LimpiaEscondeContado()
@@ -23916,7 +23931,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
@@ -31522,6 +31537,10 @@ Partial Class Ventas
LnkDescuentosRNC.Visible = UsuarioActual.TienePermisoProceso(328)
End If
+ If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
+ GvPS.Columns(19).Visible = True
+ End If
+
UpPS.Update()
UPPDescuento.Update()
UPObservaciones.Update()
@@ -33635,12 +33654,129 @@ Partial Class Ventas
ObjVentas.Dispose()
ObjEventos.Dispose()
End Sub
+
+
+#End Region
+
Private Sub BtnRefrescarPagina_Click(sender As Object, e As EventArgs) Handles BtnRefrescarPagina.Click
Response.Redirect($"~/Ventas/Ventas.aspx?CveVenta={Me.CveVenta}")
End Sub
-#End Region
+ 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
+ DtPSAdicionales = ObjProductosServicios.DtResultados.FiltraParametros($"Tipo={HdnTipoPSComparar.Value}")
+ End If
+ ObjProductosServicios.Dispose()
+
+ 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 });")
+ End If
+
+ End Sub
+
+ Private Sub BtnAgregarPSSimilar_Click(sender As Object, e As EventArgs) Handles BtnAgregarPSSimilar.Click
+ If HdnTipoPSComparar.Value.ToEntero() > 0 Then
+
+ If GvPSAdicionales.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("chkPSAdicional").Checked) <= 0 Then
+ Alert($"Debe seleccionar al menos 1 producto", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ 'VALIDA
+ For Each Row As GridViewRow In GvPSAdicionales.Rows
+ If Row.RowType = DataControlRowType.DataRow Then
+ If Row.FCCheckBox("chkPSAdicional").Checked Then
+ If Row.FCTextBox("TxtCantidad").Text.ToDecimal() <= 0.00 Then
+ Alert($"La cantidad del producto y/o servicio {Row.DataKey("CodigoPS")} debe ser mayor a 0", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
+ End If
+ Next
+
+ 'AGREGA
+ For Each Row As GridViewRow In GvPSAdicionales.Rows
+ If Row.RowType = DataControlRowType.DataRow Then
+ If Row.FCCheckBox("chkPSAdicional").Checked Then
+ '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
+ DdlUnidadMedida.SelectedValueExistInsert(DrPS("CveUnidadMedida").ToString(), DrPS("UnidadMedida").ToString())
+ DdlPSIndexChange(DdlPS.SelectedValue.ToEntero(), DdlPS)
+
+ AgregarPS()
+ End If
+ End If
+
+ End If
+ Next
+
+ End If
+
+ 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"
diff --git a/asmx/WS_PuntoVenta.asmx b/asmx/WS_PuntoVenta.asmx
index 26f317894..1e0d53ca2 100644
--- a/asmx/WS_PuntoVenta.asmx
+++ b/asmx/WS_PuntoVenta.asmx
@@ -1149,21 +1149,21 @@ Public Class WS_PuntoVenta
Return objVtaCortes
End Function
-
- Public Function GetVta_MovimientosCajas(CveCorte As Integer, TipoMovimiento As Integer) As List(Of ClsMovimientosCajaWS)
- Dim objPV As New ClsPuntoVenta()
- Dim objMovimientosCaja As New List(Of ClsMovimientosCajaWS)
+ '
+ 'Public Function GetVta_MovimientosCajas(CveCorte As Integer, TipoMovimiento As Integer) As List(Of ClsMovimientosCajaWS)
+ ' Dim objPV As New ClsPuntoVenta()
+ ' Dim objMovimientosCaja As New List(Of ClsMovimientosCajaWS)
- If objPV.GetVta_MovimientosCajas(CveCorte, TipoMovimiento) Then
- For Each Row As DataRow In objPV.DtResultados.Rows
- objMovimientosCaja.Add(New ClsMovimientosCajaWS(Row("CveMovimiento").ToString.ToEntero, Row("CveCorte").ToString.ToEntero, Row("Importe").ToString.ToEntero, Row("Descripcion").ToString, Row("TipoMovimiento").ToString))
- Next
- End If
+ ' If objPV.GetVta_MovimientosCajas(CveCorte, TipoMovimiento) Then
+ ' For Each Row As DataRow In objPV.DtResultados.Rows
+ ' objMovimientosCaja.Add(New ClsMovimientosCajaWS(Row("CveMovimiento").ToString.ToEntero, Row("CveCorte").ToString.ToEntero, Row("Importe").ToString.ToEntero, Row("Descripcion").ToString, Row("TipoMovimiento").ToString))
+ ' Next
+ ' End If
- objPV.Dispose()
+ ' objPV.Dispose()
- Return objMovimientosCaja
- End Function
+ ' Return objMovimientosCaja
+ 'End Function
Public Function AddVta_MovimientosCajas(CveCorte As Integer, CveUsuario As Integer, Importe As Double, Descripcion As String, TipoMovimiento As Integer, Fecha As DateTime) As Integer
|