From 30cb18ff30115f553bc1ee714c389a031b7341c0 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Sep 2024 08:09:35 -0700 Subject: [PATCH 1/8] - mejora en Pago con venta, en usd --- Bancos/PopIECompras.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 38f68f496..1190b4409 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -1456,7 +1456,7 @@ Partial Class Bancos_PopIECompras End If If MsgError = "" Then - Dim VentaActual As New Venta(UsuarioActual) With {.CveVenta = rw.DataKey("CveVenta").ToEntero, .ClienteNombre = NombreCliente, .SerieFolio = rw.DataKey("SerieFolio"), .CveCliente = rw.DataKey("CveCliente").ToEntero, .IVA = rw.DataKey("IVA").ToDecimal, .IEPS = rw.DataKey("IEPS").ToDecimal, .RetIVA = rw.DataKey("RetIVA").ToDecimal, .RetISR = rw.DataKey("RetISR").ToDecimal, .Total = rw.DataKey("Total").ToDecimal, .PorcentajeIVA = rw.DataKey("PorcentajeIVA").ToDecimal, .CveSubProyecto = rw.DataKey("CveSubProyecto").ToEntero, .CveMoneda = rw.DataKey("CveMoneda").ToEntero} + Dim VentaActual As New Venta(UsuarioActual) With {.CveVenta = rw.DataKey("CveVenta").ToEntero, .ClienteNombre = NombreCliente, .SerieFolio = rw.DataKey("SerieFolio"), .CveCliente = rw.DataKey("CveCliente").ToEntero, .IVA = rw.DataKey("IVA").ToDecimal, .IEPS = rw.DataKey("IEPS").ToDecimal, .RetIVA = rw.DataKey("RetIVA").ToDecimal, .RetISR = rw.DataKey("RetISR").ToDecimal, .Total = rw.DataKey("Total").ToDecimal, .PorcentajeIVA = rw.DataKey("PorcentajeIVA").ToDecimal, .CveSubProyecto = rw.DataKey("CveSubProyecto").ToEntero, .CveMoneda = rw.DataKey("CveMoneda").ToEntero, .TC = rw.DataKey("TipoCambio").ToDecimal} Dim PagoVenta As New VentaPago PagoVenta.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero PagoVenta.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal From b49c565587796248dd98a36bf4ab30937e655785 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Sep 2024 08:09:56 -0700 Subject: [PATCH 2/8] =?UTF-8?q?--=20correcci=C3=B3n,=20de=20asignaci=C3=B3?= =?UTF-8?q?n=20de=20cvum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntradasSalidas.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index cb43c4982..269552acb 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -2884,7 +2884,7 @@ Partial Class Inventarios_EntradasSalidas DdlProducto2.SelectedValue = GvRow.DataKey("CvePS") DdlProducto2.SelectedText = GvRow.DataKey("CodigoPS") ElProductoChange() - DdlUnidad.SelectedValue = GvRow.DataKey("CveUM") + DdlUnidad.SelectedValueExist(GvRow.DataKey("CveUM")) CveAFEdit = GvRow.DataKey("CveAF").ToEntero txtPrecio.Text = GvRow.DataKey("PU").ToDouble.ToString("0.00########") TxtnSerie.Text = GvRow.DataKey("Serie") From 2ba23a13323dced2face3134a1d318357f96b2a1 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Sep 2024 08:10:16 -0700 Subject: [PATCH 3/8] -- mejora en instancia --- Transportes/RepContratosCalendario.aspx.vb | 25 ++++++---------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/Transportes/RepContratosCalendario.aspx.vb b/Transportes/RepContratosCalendario.aspx.vb index 044453139..fb8d508e1 100644 --- a/Transportes/RepContratosCalendario.aspx.vb +++ b/Transportes/RepContratosCalendario.aspx.vb @@ -230,8 +230,7 @@ Partial Class RepContratosCalendario End If Dim ObjContratos As New ClsContratos - ObjContratos.IniciaTransacSQL() - + Dim objGenerales As New ClsGenerales(ObjContratos.IniciaTransacSQL()) Dim DTAgendadados As New DataTable If ObjContratos.GetContratosValUnidadesAgendadas(DdlAF.SelectedValue.ToEntero, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, UsuarioActual.CveEmpresa, CveContrato) Then @@ -248,13 +247,14 @@ Partial Class RepContratosCalendario DTAgendadados.Dispose() ObjContratos.Dispose() Exit Sub - End If - End If - - + If HidCveAF.Value.ToEntero <> DdlAF.SelectedValue.ToEntero Then + If Not objGenerales.AddHistorialBitacora(465, -1, -1, -1, -1, -1, -1, -1, DdlAF.SelectedItem.Text, HidCveAFDes.Value, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, TxtMotivoCambioUnidad.Text, "", "", CveContrato:=CveContrato) Then + TieneError = True + End If + End If If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", -1, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", DdlSubProyectoModal.SelectedValue.ToEntero, -1, -1, -1, -1, "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, TxtPesos.Text.ToDecimal, TxtDolares.Text.ToDecimal, -1, 0, CveContratoTipo:=34, @@ -266,25 +266,14 @@ Partial Class RepContratosCalendario TieneError = True End If - - If HidCveAF.Value.ToEntero <> DdlAF.SelectedValue.ToEntero Then - Dim objGenerales = New ClsGenerales(ObjContratos.IniciaTransacSQL()) - - If Not objGenerales.AddHistorialBitacora(465, -1, -1, -1, -1, -1, -1, -1, DdlAF.SelectedItem.Text, HidCveAFDes.Value, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, TxtMotivoCambioUnidad.Text, "", "", CveContrato:=CveContrato) Then - TieneError = True - End If - End If - If TieneError Then ObjContratos.RollBack() Else ObjContratos.Commit() End If - - ObjContratos.Dispose() - + objGenerales.Dispose() UpTitulos.Update() CargaDatos() From 1a9c5d164357f2312fd249cc1f7c8ba2240f2308 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 16 Sep 2024 17:26:41 -0700 Subject: [PATCH 4/8] =?UTF-8?q?-=20mejora=20en=20validaci=C3=B3n=20de=20pr?= =?UTF-8?q?esupuesto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OC/OC.aspx.vb | 171 ++++++++++++++++---------------------------------- 1 file changed, 54 insertions(+), 117 deletions(-) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 9a005fc21..eab349a5b 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -644,8 +644,8 @@ Partial Class OC_OC GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa) = Nothing CargaDatosAgregarPS() CveProveedorOriginal = -1 - EnviarNotificacionWhatsApp("526621430964", "hola34 https:/sig.adssistemas.mx/ventas/ventas.aspx") - EnviarNotificacionWhatsApp("526621430964", "", "hello_world") + 'EnviarNotificacionWhatsApp("526621430964", "hola34 https:/sig.adssistemas.mx/ventas/ventas.aspx") + 'EnviarNotificacionWhatsApp("526621430964", "", "hello_world") 'MODALIDAD MULTIEMPRESA CveEmpresaActual = UsuarioActual.CveEmpresa If CveEmpresaActual > 0 Then @@ -1647,7 +1647,7 @@ Partial Class OC_OC DdlProveedores.SelectedValue = objOC.CveProveedor.ToString If DdlProveedores.SelectedValue.ToEntero > 0 Then CveProveedorOriginal = objOC.CveProveedor - DdlProveedores.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltraParametros($"CveProveedor = {objOC.CveProveedor}").Rows(0)("RazonSocial").ToString + DdlProveedores.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, CveProveedor:=objOC.CveProveedor).FiltroPrimeroValor("RazonSocial") Else DdlProveedores.SelectedText = "-" End If @@ -1697,7 +1697,7 @@ Partial Class OC_OC ChkCotizacion.Visible = True DdlProveedores.SelectedValue = objOC.CveProveedor.ToString If DdlProveedores.SelectedValue.ToEntero > 0 Then - DdlProveedores.SelectedText = GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {objOC.CveProveedor}").Rows(0)("RazonSocial").ToString + DdlProveedores.SelectedText = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, CveProveedor:=objOC.CveProveedor).FiltroPrimeroValor("RazonSocial") Else DdlProveedores.SelectedText = "-" End If @@ -2756,8 +2756,6 @@ Partial Class OC_OC End Function Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click - - 'VALIDACIONES PARA GUARDAR If ValidaGuardar() Then Exit Sub @@ -2765,8 +2763,6 @@ Partial Class OC_OC Exit Sub End If - - Dim MsgError As String = "Hubo un error al registrar" 'VARIABLES Dim CveProveedorSucursal As Integer = -1 @@ -3740,7 +3736,7 @@ Partial Class OC_OC If CveProveedor > 0 Then 'CUANDO VIENE DE COTIZACION tTotalIVA = (DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)) * tPorIVA).ToString.ToDecimal - tPorIVA = GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)).Rows(0)("IVA").ToString.ToDecimal + tPorIVA = GlobalDTCompProveedores(CveEmpresaActual, CveProveedor:=CveProveedor).FiltroPrimeroValor("IVA").ToDecimal tTotalGral = DtDetalle.SUM("Total", String.Format("CveProveedor = {0}", CveProveedor)).ToString.ToDecimal Else 'CUANDO NO VIENE DE COTIZACION @@ -4260,7 +4256,6 @@ Partial Class OC_OC End If - 'SE TOMAN VALORES EN CASO DE QUE LA CvePS SEA DIFERENTE DE LA ANTERIOR Dim CvePSAnterior As Integer = gvr.DataKey("CvePS").ToEntero PS = gvr.DataKey("PS").ToString @@ -4306,7 +4301,6 @@ Partial Class OC_OC CveSubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedValue.ToEntero SubProyecto = gvr.FCDropDownList("DdlSubProyectoEdit").SelectedItem.Text - CveCultivoCuadroDetalle = gvr.FCDropDownList("DdlCultivosCuadroEdit").SelectedValue.ToEntero Cuadro = "" If CveCultivoCuadroDetalle > 0 Then @@ -4322,93 +4316,65 @@ Partial Class OC_OC End If If UsuarioActual.Empresa.Funcionalidad(532).Contiene("1", "2") Then - Dim ObjCon As New ClsContratos - Dim CvePresupuesto As Integer = 0 - Dim Autorizado As Decimal = 0 - Dim Ejercido As Decimal = 0 - If ObjCon.GetPresupuestos(-1, "-1", CveSubProyecto, 2, -1, UsuarioActual.CveEmpresa) Then - If ObjCon.DtResultados.Rows.Count > 0 Then - CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero - If CvePresupuesto > 0 Then - If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then - If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows.Count > 0 Then - Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {CveClasificacion} And Importe > 0").Rows(0)("Importe").ToString.ToDecimal - End If - End If - If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{NowADS().Year - 1}".ToDate, NowADS(), UsuarioActual.CveEmpresa, CveProyecto, - CveSubProyecto, UsuarioActual.CveUsuario, CveClasificacion) Then - If ObjCon.DtResultados.Rows.Count > 0 Then - Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDecimal - End If - End If - End If - End If + 'se envía el dato anterior, para restarlo y agregar el nuevo importe + If Not ValidaPresupuesto(1, CveSubProyecto, SubProyecto, CveClasificacion, Clasificacion, (Importe * Cantidad).RoundSQL, DdlMoneda.SelectedValue.ToEntero, (gvr.DataKey("Importe").ToDecimal * gvr.DataKey("Cantidad").ToDecimal).RoundSQL) Then + Exit Sub End If - ObjCon.Dispose() - - 'If CvePresupuesto > 0 And Autorizado > 0 Then - ' Dim Diferencia As Decimal = (Ejercido + Total) - Autorizado - ' If Diferencia > 0 Then - ' Alert($"No hay presupuesto disponible en el subproyecto {SubProyecto} y la clasificación {Clasificacion} se excede por {Diferencia.FormatoNumero}", TipoMensaje.MsgAdvertencia) - ' Exit Sub - ' End If - 'End If End If 'Agarra el nuevo AF si se modifico o deja el pasado CveActivoFijo = If(gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero > 0, gvr.FCHiddenField("HdnCveActivoFijo").Value.ToEntero, HdnEditCveActivoFijo.Value.ToEntero) Codigo = If(gvr.FCHiddenField("HdnCodigoAF").Value <> "-1", gvr.FCHiddenField("HdnCodigoAF").Value, HdnEditCodigo.Value) - HdnEditCveActivoFijo.Value = "" HdnEditCodigo.Value = "" Dim dr As DataRow() = DtDetalle.Select("CveOrdenCompraDetalle = " & gvr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero) + If dr.Count > 0 Then + dr(0)("Cantidad") = Cantidad + dr(0)("CveUnidadMedida") = CveUnidad + dr(0)("UM") = UM + dr(0)("CveClasificacion") = CveClasificacion + dr(0)("Clasificacion") = Clasificacion - dr(0)("Cantidad") = Cantidad - dr(0)("CveUnidadMedida") = CveUnidad - dr(0)("UM") = UM - dr(0)("CveClasificacion") = CveClasificacion - dr(0)("Clasificacion") = Clasificacion + If isWithFamily() Then + dr(0)("CveSubFamilia") = CveClasificacion + dr(0)("SubFamilia") = Clasificacion + End If - If isWithFamily() Then - dr(0)("CveSubFamilia") = CveClasificacion - dr(0)("SubFamilia") = Clasificacion + dr(0)("CvePS") = CvePS + dr(0)("PS") = PS + dr(0)("Observacion") = Obs + + dr(0)("CveSubProyecto") = CveSubProyecto + dr(0)("SubProyecto") = SubProyecto + dr(0)("CveProyecto") = CveProyecto + dr(0)("Proyecto") = Proyecto + dr(0)("Importe") = Importe + dr(0)("Descuento") = Descuento + dr(0)("Total") = Total + dr(0)("IEPSPS") = IEPSPS * Total + dr(0)("IEPSPSPorcentaje") = IEPSPS + dr(0)("IEPSPSIVA") = IEPSPSIVA * Total + dr(0)("IEPSPSIVAPorcentaje") = IEPSPSIVA + + 'If DdlIVA.SelectedValue.ToDecimal = 1 Then dr(0)("IVA") = 0 Else dr(0)("IVA") = IvaPS * Total + dr(0)("IVAPorcentaje") = If(IvaPS = -1, Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), 0) + Dim TotalGravado As Decimal = Total + If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS + dr(0)("IVA") = Math.Round(dr(0)("IVAPorcentaje").ToString.ToDecimal * TotalGravado, 2) + + dr(0)("RetIVA") = (RetIVA * Total).RoundSQL(6) + dr(0)("RetIVAPorcentaje") = RetIVA + dr(0)("RetISR") = (RetISR * Total).RoundSQL(6) + dr(0)("RetISRPorcentaje") = RetISR + + dr(0)("CveActivoFijo") = CveActivoFijo + dr(0)("CodigoAF") = Codigo + + dr(0)("CveCultivoCuadroDetalle") = CveCultivoCuadroDetalle + dr(0)("Cuadro") = Cuadro End If - dr(0)("CvePS") = CvePS - dr(0)("PS") = PS - dr(0)("Observacion") = Obs - - dr(0)("CveSubProyecto") = CveSubProyecto - dr(0)("SubProyecto") = SubProyecto - dr(0)("CveProyecto") = CveProyecto - dr(0)("Proyecto") = Proyecto - dr(0)("Importe") = Importe - dr(0)("Descuento") = Descuento - dr(0)("Total") = Total - dr(0)("IEPSPS") = IEPSPS * Total - dr(0)("IEPSPSPorcentaje") = IEPSPS - dr(0)("IEPSPSIVA") = IEPSPSIVA * Total - dr(0)("IEPSPSIVAPorcentaje") = IEPSPSIVA - - 'If DdlIVA.SelectedValue.ToDecimal = 1 Then dr(0)("IVA") = 0 Else dr(0)("IVA") = IvaPS * Total - dr(0)("IVAPorcentaje") = If(IvaPS = -1, Math.Round(DdlIVA.SelectedValue.ToDecimal - 1, 2), 0) - Dim TotalGravado As Decimal = Total - If IEPSPSIVA > 0 Then TotalGravado = Total * (1 + IEPSPSIVA) 'grava para iva, el importe del IEPS - dr(0)("IVA") = Math.Round(dr(0)("IVAPorcentaje").ToString.ToDecimal * TotalGravado, 2) - - dr(0)("RetIVA") = (RetIVA * Total).RoundSQL(6) - dr(0)("RetIVAPorcentaje") = RetIVA - dr(0)("RetISR") = (RetISR * Total).RoundSQL(6) - dr(0)("RetISRPorcentaje") = RetISR - - - dr(0)("CveActivoFijo") = CveActivoFijo - dr(0)("CodigoAF") = Codigo - - dr(0)("CveCultivoCuadroDetalle") = CveCultivoCuadroDetalle - dr(0)("Cuadro") = Cuadro - 'si el tipodato viene de la BD, entonces sufrió una actualización If dr(0)("TipoDato").ToString.ToEntero = 2 Then dr(0)("TipoDato") = 1 DtDetalle.AcceptChanges() @@ -9213,7 +9179,7 @@ Partial Class OC_OC ''' Usado al validar Presupuesto cuando se agrega un producto o servicio ''' Verdadero si hay presupuesto, Falso si no hay presupuesto. Public Function ValidaPresupuesto(Opcion As Integer, Optional ValCveSubProyecto As Integer = -1, Optional ValSubProyecto As String = "", Optional ValCveClasificacion As Integer = -1, Optional ValClasificacion As String = "", - Optional ValImporte As Decimal = 0, Optional CveMoneda As Integer = 1) As Boolean + Optional ValImporte As Decimal = 0, Optional CveMoneda As Integer = 1, Optional ImportePrevioGuardado As Decimal = 0) As Boolean Dim respuesta As Boolean = False @@ -9224,6 +9190,7 @@ Partial Class OC_OC Dim Autorizado As Decimal = 0 Dim Ejercido As Decimal = 0 Dim FechaCompra As Date = TxtFecha.Text.ToDate + ValImporte = (ValImporte - ImportePrevioGuardado) If CveMoneda > 1 Then ValImporte = ValImporte * GlobalTipoCambio(FechaCompra).ToDecimal @@ -9289,19 +9256,17 @@ Partial Class OC_OC row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion Select row.Field(Of Decimal)(ColumnaSaldo)).Sum() If saldoTotal > 0 Then - Dim Diferencia As Decimal = saldoTotal - item.TotalSum - If (Diferencia) < 0 Then Alert($"No hay presupuesto disponible en:
Subproyecto: {item.SubProyecto}
Clasificación {item.Clasificacion}. Se excede por {Math.Abs(Diferencia).FormatoNumero}", TipoMensaje.MsgAdvertencia) - respuesta = True + respuesta = False Exit For Else respuesta = True End If Else Alert($"No hay presupuesto disponible en:
Subproyecto: {item.SubProyecto}
Clasificación {item.Clasificacion}.", TipoMensaje.MsgAdvertencia) - respuesta = True + respuesta = False Exit For End If Else @@ -9309,7 +9274,6 @@ Partial Class OC_OC End If Next End If - Else ' Alert("No hay presupuestos.", TipoMensaje.MsgAdvertencia) respuesta = True @@ -9406,7 +9370,6 @@ Partial Class OC_OC Dim descuentoParts As String() = TxtDescuentoEscalonado.Text.Split("+"c) - For Each dRow As DataRow In DtDetalle.Rows Dim PU As Decimal = dRow("Importe").ToString.ToDecimal @@ -9452,12 +9415,6 @@ Partial Class OC_OC dRow("TipoDato") = 1 End If - - - - - - Next DtDetalle.AcceptChanges() @@ -9470,7 +9427,6 @@ Partial Class OC_OC UpIvas.Update() UPPDetalle.Update() - End Sub Protected Sub BtnEdicionMasiva_Click(sender As Object, e As EventArgs) @@ -9484,17 +9440,13 @@ Partial Class OC_OC End If ModoEdicionMasiva() - End Sub - - Private Sub ModoEdicionMasiva() If EstaEnmodiEdicionMasiva Then BtnEdicionMasiva.Text = "Aplicar Edición Masiva" For Each GvRow As GridViewRow In GvD.Rows - GvRow.FCTextBox("TxtEMObsPS").Visible = True GvRow.FCTextBox("TxtEMCantEdit").Visible = True GvRow.FCTextBox("TxtEMDescuentoEdit").Visible = True @@ -9505,15 +9457,11 @@ Partial Class OC_OC GvRow.FCLiteral("LtlDescuento").Visible = False GvRow.FCLabel("LtlImporte").Visible = False GvRow.FCLinkButton("imgE").Visible = False - - 'observación, PU, descuento, cantidad Next - Else 'GvD_RecalculaEdicionMasiva() - BtnEdicionMasiva.Text = "Edición Masiva" For Each GvRow As GridViewRow In GvD.Rows GvRow.FCTextBox("TxtEMObsPS").Visible = False @@ -9526,39 +9474,28 @@ Partial Class OC_OC GvRow.FCLiteral("LtlDescuento").Visible = True GvRow.FCLabel("LtlImporte").Visible = True GvRow.FCLinkButton("imgE").Visible = True - Next - - - End If RegistraScript("$(document).ready(function() {setTimeout(function() {document.getElementById('DVSeccionGVD').scrollIntoView({ behavior: 'smooth' }); }, 250);});", "100") - UPPDetalle.Update() uppOpciones.Update() - - End Sub Private Function GvD_RecalculaEdicionMasiva() As Boolean For Each gvr As GridViewRow In GvD.Rows - Dim Cantidad, Importe, Descuento As Decimal Cantidad = gvr.FCTextBox("TxtEMCantEdit").Text.Trim.ToDecimal Importe = gvr.FCTextBox("TxtEMImporteEdit").Text.Trim.ToDecimal Descuento = gvr.FCTextBox("TxtEMDescuentoEdit").Text.Trim.ToDecimal Dim PS As String = gvr.DataKey("PS").ToString Dim Total As Decimal = Importe * Cantidad - Descuento - 'VALIDA If Descuento > 0 AndAlso ((Cantidad * Importe) <= Descuento) Then Alert($"El producto {PS}, cantidad {Cantidad}, el campo 'Descuento' no debe ser mayor o igual al total({(Cantidad * Importe).ToString("###,###,###.00")}).", TipoMensaje.MsgAdvertencia) Return False End If - - Next For Each gvr As GridViewRow In GvD.Rows From d6fd89f6a2a04f981da47f6453a1c2d3f0964336 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 17 Sep 2024 09:21:35 -0700 Subject: [PATCH 5/8] -- ver el costo, por CvePS --- App_Code/ClsInventarios.vb | 3 ++- Ventas/Promociones.aspx.vb | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index f34c3b52e..70e923f48 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -6283,12 +6283,13 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetUltimoCosto(CveEmpresa As Integer) As Boolean + Public Function GetUltimoCosto(CveEmpresa As Integer, Optional CvePS As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_UltimoCostoGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePS", SqlDbType.Int).Value = CvePS End With Try diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb index 0d90fe29d..549ac61ee 100644 --- a/Ventas/Promociones.aspx.vb +++ b/Ventas/Promociones.aspx.vb @@ -513,6 +513,15 @@ Partial Class Ventas_Promociones End If End If + ' validación de %minimo considerado 02580104V + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + Dim tuc As Decimal = LblUltimoCosto.Text.ToDecimal + Dim tpu As Decimal = TxtPromocionConcepto.Text.ToDecimal + If (tpu - tuc) / tuc < UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100 Then + Alert("El producto está debajo de la utilidad permitida, la promoción requerirá autorización.", TipoMensaje.MsgAdvertencia.ToastAdventencia) + End If + End If + If TxtCantMinima.Text.ToEntero <= 0 Then Alert("La cantidad minima debe ser de 1", TipoMensaje.MsgAdvertencia) Exit Sub @@ -1416,13 +1425,13 @@ Partial Class Ventas_Promociones Dim DTPSUltimoCosto = New DataTable Dim ObjInv As New ClsInventarios - If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa) Then + If ObjInv.GetUltimoCosto(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero) Then DTPSUltimoCosto = ObjInv.DtResultados End If ObjInv.Dispose() - LblUltimoCosto.Text = DTPSUltimoCosto.FiltroPrimeroValor("UltimoCosto", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero - LblCostoPromedio.Text = DTPSUltimoCosto.FiltroPrimeroValor("CostoPromedio", $"CvePS = {DdlPS.SelectedValue}").FormatoNumero + LblUltimoCosto.Text = DTPSUltimoCosto.FiltroPrimeroValor("UltimoCosto", "").FormatoNumero(4) + LblCostoPromedio.Text = DTPSUltimoCosto.FiltroPrimeroValor("CostoPromedio", "").FormatoNumero(4) UpAgregar.Update() End Sub From d2207475af5268a7bb88780cf70807f3ec7b9fa1 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Tue, 17 Sep 2024 09:20:34 -0700 Subject: [PATCH 6/8] Promociones --- Transportes/RepContratoDetalle.aspx.vb | 29 ++++++++--- Ventas/Promociones.aspx | 20 ++++++-- Ventas/Promociones.aspx.vb | 70 ++++++++++++++++++++------ 3 files changed, 96 insertions(+), 23 deletions(-) diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb index b766777c9..d40cd7769 100644 --- a/Transportes/RepContratoDetalle.aspx.vb +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -350,19 +350,36 @@ Partial Class RepContratoDetalle New ReportParameter("Servicio", TxtDescripcion.Text), New ReportParameter("Observaciones", TxtObservaciones.Text), New ReportParameter("Ubicacion", TxtUbicacion.Text), - New ReportParameter("FechaSalida", TxtFechaSalida.Text.ToDate.ToString("dd/MM/yyyy")), - New ReportParameter("FechaRegreso", TxtFechaRegreso.Text.ToDate.ToString("dd/MM/yyyy")), + New ReportParameter("FechaSalida", TxtFechaSalida.Text.ToDate.ToString("dd/MM/yyyy HH:mm tt")), + New ReportParameter("FechaRegreso", TxtFechaRegreso.Text.ToDate.ToString("dd/MM/yyyy HH:mm tt")), New ReportParameter("CantidadPasajeros", TxtCantidadPasajeros.Text), New ReportParameter("TipoAF", DdlTipoAF.SelectedItem.ToString()), - New ReportParameter("Pesos", Math.Round(TxtImporte.Text.ToDecimal, 2).ToString), + New ReportParameter("Pesos", TxtImporte.Text.ToDecimal.ToString("###,###,###.00")), New ReportParameter("Moneda", DdlMoneda.SelectedItem.ToString), - New ReportParameter("Anticipo", Math.Round((TxtAnticipo.Text.ToDecimal * TxtImporte.Text.ToDecimal), 2).ToString), - New ReportParameter("Total", Math.Round((TxtImporte.Text.ToDecimal - (TxtAnticipo.Text.ToDecimal * TxtImporte.Text.ToDecimal)), 2).ToString), - New ReportParameter("DiaSalida", $"{TxtFechaSalida.Text.ToDate.Hour}:{TxtFechaSalida.Text.ToDate.Minute} "), + New ReportParameter("Anticipo", TxtAnticipo.Text.ToDecimal.ToString("###,###,###.00")), + New ReportParameter("Total", (TxtImporte.Text.ToDecimal - (TxtAnticipo.Text.ToDecimal)).ToString("###,###,###.00")), + New ReportParameter("DiaSalida", TxtFechaSalida.Text.ToDate.ToString("HH:mm tt")), New ReportParameter("TelefonoEmpresa", TelefonoEmpresa), New ReportParameter("FechaImpresion", Date.Now.ToString("dd/MM/yyyy HH:mm:ss")), New ReportParameter("Usuario", UsuarioActual.Nombre) } + 'New ReportParameter("Folio", TxtFolio.Text), + ' New ReportParameter("Cliente", DdlClientes.SelectedText), + ' New ReportParameter("Servicio", TxtDescripcion.Text), + ' New ReportParameter("Observaciones", TxtObservaciones.Text), + ' New ReportParameter("Ubicacion", TxtUbicacion.Text), + ' New ReportParameter("FechaSalida", TxtFechaSalida.Text.ToDate.ToString("dd/MM/yyyy")), + ' New ReportParameter("FechaRegreso", TxtFechaRegreso.Text.ToDate.ToString("dd/MM/yyyy")), + ' New ReportParameter("CantidadPasajeros", TxtCantidadPasajeros.Text), + ' New ReportParameter("TipoAF", DdlTipoAF.SelectedItem.ToString()), + ' New ReportParameter("Pesos", Math.Round(TxtImporte.Text.ToDecimal, 2).ToString), + ' New ReportParameter("Moneda", DdlMoneda.SelectedItem.ToString), + ' New ReportParameter("Anticipo", Math.Round((TxtAnticipo.Text.ToDecimal * TxtImporte.Text.ToDecimal), 2).ToString), + ' New ReportParameter("Total", Math.Round((TxtImporte.Text.ToDecimal - (TxtAnticipo.Text.ToDecimal * TxtImporte.Text.ToDecimal)), 2).ToString), + ' New ReportParameter("DiaSalida", $"{TxtFechaSalida.Text.ToDate.Hour}:{TxtFechaSalida.Text.ToDate.Minute} "), + ' New ReportParameter("TelefonoEmpresa", TelefonoEmpresa), + ' New ReportParameter("FechaImpresion", Date.Now.ToString("dd/MM/yyyy HH:mm:ss")), + ' New ReportParameter("Usuario", UsuarioActual.Nombre) ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Contrato.mrt", dtResult, params, NombreArchivo:=TxtFolio.Text) End Sub diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx index dd2461ac2..b3f400918 100644 --- a/Ventas/Promociones.aspx +++ b/Ventas/Promociones.aspx @@ -205,21 +205,35 @@ OnRowDataBound="GvDatos_RowDataBound" > - - <%----%> + <%--0--%> + + <%--1--%> + <%--2--%> + <%--3--%> + <%--4--%> + <%--5--%> + + + + + <%--6--%> + <%--7--%> + <%--8--%> + <%--9--%> + <%--10--%> @@ -301,7 +315,7 @@