diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index c2a581513..85a36307a 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2351,6 +2351,7 @@ Public Class ClsInventarios End With Try + SqlAdapter.SelectCommand.CommandTimeout = 0 SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception @@ -4565,7 +4566,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Integer, CveUM As Integer, CvePS As Integer, Precio As Decimal, Observaciones As String, + Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Decimal, CveUM As Integer, CvePS As Integer, Precio As Decimal, Observaciones As String, CveContratoDetalle As Integer, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Boolean Dim Retorno As Boolean = False Dim CveTraspasoSolicitud As Integer = 0 @@ -4573,7 +4574,7 @@ Public Class ClsInventarios With SqlAdapter.SelectCommand.Parameters .Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud - .Add("@Cantidad", SqlDbType.Int).Value = Cantidad + .Add("@Cantidad", SqlDbType.Money).Value = Cantidad .Add("@CveUM", SqlDbType.Int).Value = CveUM .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@Precio", SqlDbType.Float).Value = Precio @@ -4597,6 +4598,41 @@ Public Class ClsInventarios Return Retorno End Function + + Public Function UpdateTrasladoSolicitudDetalle(CveTrasladoSolicitudDetalle As Integer, CveEmpresa As Integer, CveTrasladoSolicitud As Integer, Cantidad As Decimal, CveUM As Integer, CvePS As Integer, Precio As Decimal, Observaciones As String, + CveContratoDetalle As Integer, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Boolean + Dim Retorno As Boolean = False + Dim CveTraspasoSolicitud As Integer = 0 + DataAdapter("PA_Inv_TraspasoSolicitudDetalleUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTrasladoSolicitudDetalle", SqlDbType.Int).Value = CveTrasladoSolicitudDetalle + .Add("@CveTrasladoSolicitud", SqlDbType.Int).Value = CveTrasladoSolicitud + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@Cantidad", SqlDbType.Money).Value = Cantidad + .Add("@CveUM", SqlDbType.Int).Value = CveUM + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Precio", SqlDbType.Float).Value = Precio + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle + .Add("@Serie", SqlDbType.NVarChar).Value = Serie + .Add("@Lote", SqlDbType.NVarChar).Value = Lote + .Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al actualizar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al actualizar los detalles del movimiento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function AddTrasladoSolicitudGet(CveTrasladoSolicitud As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False Dim CveTraspasoSolicitud As Integer = 0 diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 0039b43eb..3e722fbae 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5780,7 +5780,17 @@ Public Class ClsPaginas DR = TmpDTImpuestos.NewRow() If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR) DR = TmpDTImpuestos.NewRow() - If dtVentas(0)("IVA").ToString.ToDouble >= 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR) + If dtVentas(0)("IVA").ToString.ToDouble >= 0 Then + DR("ImpuestoLocal") = "IVA" + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + DR("ImpuestoLocal") = String.Format("IVA {0}%", dtVentas(0)("PorcentajeIVA").ToString.ToDouble * 100) + End If + + DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble + DR("Orden") = 50 + TmpDTImpuestos.Rows.Add(DR) + End If 'solo para eclipse, que muesre un subtotal debajo de IVA If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 96e987c23..3aee4f3d4 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -293,7 +293,7 @@ Public Class ClsVentas Public Function GetVentas(CveEmpresa As Integer, TipoDocto As String, Serie As String, Folio As Integer, Codigo As String, CveCliente As Integer, CveSubProyecto As Integer, CveEstatus As Integer, CveUsuario As Integer, FechaI As String, FechaF As String, FolioFiscal As String, Optional CveClienteSucursal As Integer = -1, Optional CvePS As Integer = -1, Optional PedidoContrato As String = "-1", Optional OrdenCompra As String = "-1", Optional CveUsuarioConsulta As Integer = -1, Optional ClienteRFC As String = "-1", - Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional TopSelect As Integer = 1000) As Boolean + Optional CveEmpresaCRM As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, Optional TopSelect As Integer = 1000, Optional CveVendedor As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasGetBuscar") @@ -319,6 +319,7 @@ Public Class ClsVentas .Add("@CveEmpresaCRM", SqlDbType.Int).Value = CveEmpresaCRM .Add("@CveAcercamientoCRM", SqlDbType.Int).Value = CveAcercamientoCRM .Add("@TopSelect", SqlDbType.Int).Value = TopSelect + .Add("@CveVendedorFiltro", SqlDbType.Int).Value = CveVendedor End With Try @@ -440,22 +441,22 @@ Public Class ClsVentas End Function Public Function AddVenta(TipoDocto As String, FolioFact As Integer, CveCliente As Integer, CveClienteSucursal As Integer, SubTotal As Decimal, Descuento As Decimal, Amortizacion As Decimal, IVA As Decimal, RetIVA As Decimal, RetISR As Decimal, Total As Decimal, - CveMoneda As Integer, TipoCambio As Double, CveMetodoPago As Integer, CondicionesPago As Integer, FormaPago As Integer, FechaVencimiento As DateTime, Fecha As DateTime, MotivoDescuento As String, Observaciones As String, FechaEjecucion As DateTime, - CveVendedor As Integer, Alfa1 As String, Alfa2 As String, Alfa3 As String, Num1 As Double, Num2 As Double, Num3 As Double, + CveMoneda As Integer, TipoCambio As Decimal, CveMetodoPago As Integer, CondicionesPago As Integer, FormaPago As Integer, FechaVencimiento As DateTime, Fecha As DateTime, MotivoDescuento As String, Observaciones As String, FechaEjecucion As DateTime, + CveVendedor As Integer, Alfa1 As String, Alfa2 As String, Alfa3 As String, Num1 As Decimal, Num2 As Decimal, Num3 As Decimal, Fech1 As Date, Fech2 As Date, Fech3 As Date, CveCorte As Integer, NumeroPersonas As Integer, CvePrePoliza As Integer, CveUsuario As Integer, CveEmpresa As Integer, - Optional Propina As Double = -1, Optional CveVentaTerminal As Integer = -1, Optional AtencionA As String = "-1", Optional CveContrato As Integer = -1, + Optional Propina As Decimal = -1, Optional CveVentaTerminal As Integer = -1, Optional AtencionA As String = "-1", Optional CveContrato As Integer = -1, Optional CveVentaPadre As Integer = -1, Optional Det_OrdenCompra As String = "", Optional Det_FechaOrdenCompra As String = "", Optional otros As Decimal = 0, Optional Entrega As String = "-1", Optional Vigencia As DateTime = MinFecha, Optional CveAlmacenTraspasoDestino As Integer = -1, Optional CveAlmacenTraspasoOrigen As Integer = -1, Optional CveDireccionEnvio As Integer = -1, - Optional CveOC As Integer = -1, Optional IEPS As Double = 0, Optional Serie As String = "-1", Optional TelefonoGenerico As String = "", Optional CveCondicionEntrega As Integer = -1, Optional PedidoContrato As String = "-1", + Optional CveOC As Integer = -1, Optional IEPS As Decimal = 0, Optional Serie As String = "-1", Optional TelefonoGenerico As String = "", Optional CveCondicionEntrega As Integer = -1, Optional PedidoContrato As String = "-1", Optional ObservacionesAlmacen As String = "", Optional CveSubProyecto As Integer = -1, Optional CveSubProyectoEjecucion As Integer = -1, Optional CveSubProyectoCobranza As Integer = -1, - Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Double = 0, + Optional CveFormaPago33 As Integer = -1, Optional CveMetodoPago33 As Integer = -1, Optional CveUsoCFDI As Integer = -1, Optional OrdenCompra As String = "-1", Optional CveCuentaTerminal As Integer = -1, Optional CveTipoRelacion As Integer = -1, Optional ImpuestoLocal As Decimal = 0, Optional CveTipoAmortizacionAnticipo As Integer = -1, Optional CveVentaRelacion As Integer = -1, Optional ImporteRelacion As Decimal = -1, Optional CveEmpresaCRM As Integer = -1, Optional EsInterno As Integer = -1, Optional CveAcercamientoCRM As Integer = -1, - Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Double = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0, + Optional DiasCredito As Integer = 0, Optional EsDiasCreditoFijo As Boolean = False, Optional AnticipoEspecial As Boolean = False, Optional Kilometraje As Decimal = 0, Optional EsAmortizacion As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoNotificacion As String = "", Optional FormaPaqueteria As Integer = 1, Optional FacturarSucursal As Boolean = False, Optional VentaDesglosaIEPS As Boolean = False, Optional ServicioDomicilio As Boolean = False, Optional RFCReceptor As String = "", Optional Adjunto As String = "-1", Optional DevolucionImportePagado As Decimal = 0, Optional EsGarantia As Boolean = False, Optional CveLineaAdicional As Integer = -1, Optional DescripcionVenta As String = "", Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveTipoVenta As Integer = -1, Optional RequiereOS As Boolean = False, Optional FechaParaSurtir As DateTime = MinFecha, Optional Paciente As String = "-1", Optional Episodio As String = "-1", Optional EsFacturaGlobal As Boolean = False, Optional CveSATPeriodicidad As Integer = -1, Optional CveSATMes As Integer = -1, Optional SATAnio As Integer = -1, Optional CveMotivoDevolucion As Integer = -1, - Optional CveCobranzaEstatusTurno As Integer = -1, Optional Addenda As String = "") As Boolean + Optional CveCobranzaEstatusTurno As Integer = -1, Optional Addenda As String = "", Optional Bloqueada As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasAdd") @@ -572,6 +573,7 @@ Public Class ClsVentas .Add("@CveMotivoDevolucion", SqlDbType.Int).Value = CveMotivoDevolucion .Add("@CveCobranzaEstatusTurno", SqlDbType.Int).Value = CveCobranzaEstatusTurno .Add("@Addenda", SqlDbType.VarChar).Value = Addenda + .Add("@Bloqueada", SqlDbType.Bit).Value = Bloqueada End With 'SqlTypes.SqlDateTime.Null Try @@ -2473,20 +2475,21 @@ Public Class ClsVentas 'End Function #Region " PROMOCIONES " - Public Function GetPromociones(CvePromocion As Integer, Fecha As String, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer, - CveSubProyecto As Integer, Optional CveMarca As Integer = -1) As Boolean + Public Function GetPromociones(CvePromocion As Integer, Fecha As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer, + CveSubProyecto As Integer, Optional CveMarca As Integer = -1, Optional CveUsuario As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesGet") With SqlAdapter.SelectCommand.Parameters .Add("@CvePromocion", SqlDbType.Int).Value = CvePromocion - .Add("@Fecha", SqlDbType.VarChar).Value = Fecha + .Add("@Fecha", SqlDbType.Date).Value = Fecha .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario End With Try @@ -5988,7 +5991,7 @@ Public Class ClsVentas #End Region - Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0, Optional Motivo As String = "", Optional PorcentajeDescuento As Decimal = 0) As Boolean + Public Function AddAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, Importe As Decimal, CveEstatus As Integer, CveUsuario As Integer, TipoAutorizacion As Integer, TipoDocumento As String, Optional DiasVencidos As Integer = 0, Optional Motivo As String = "", Optional PorcentajeDescuento As Decimal = 0, Optional CveVenta As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_AutorizacionLimitesAdd") With SqlAdapter.SelectCommand.Parameters @@ -6003,6 +6006,7 @@ Public Class ClsVentas .Add("@DiasVencidos", SqlDbType.Int).Value = DiasVencidos .Add("@PorcentajeDescuento", SqlDbType.Decimal).Value = PorcentajeDescuento .Add("@Motivo", SqlDbType.VarChar).Value = Motivo + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 283f93c50..80ac46373 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -8037,9 +8037,9 @@ Namespace Modelos Public Property Fech2 As Date Public Property Fech3 As Date - Public Property Num1 As Double = 0 - Public Property Num2 As Double = 0 - Public Property Num3 As Double = 0 + Public Property Num1 As Decimal = 0 + Public Property Num2 As Decimal = 0 + Public Property Num3 As Decimal = 0 Public Property DiasCredito As Integer Public Property EsDiasCreditoFijo As Boolean Public Property CveVentaTerminal As Integer = 0 @@ -8200,6 +8200,7 @@ Namespace Modelos Public Property CveMotivoCancelacion As Integer = -1 Public Property MotivoCancelacion As String = "" Public Property TipoContable As Integer = -1 + Public Property Bloqueada As Boolean = False Public Property Addenda As String = "" #End Region diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 148701a92..d81e49fd9 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -818,6 +818,80 @@ Namespace Extensiones Return Retorno End Function + Public Function EnviarNotificacionWhatsAppPlantilla(NumeroTelefono As String, NombrePlantilla As String, ParametrosBody As ArrayList, Optional LigaBoton As String = "") As Boolean + Dim RetornoObj As String = "{}" + Dim Retorno As Boolean = False + If NumeroTelefono = "" OrElse NombrePlantilla = "" Then Return False + + Try + Dim TokenAutorizacion As String = $"Bearer {WhatsAppToken}" + Using httpClient = New HttpClient() + Using request = New HttpRequestMessage(HttpMethod.Post, New Uri("https://graph.facebook.com/v20.0/425866980604901/messages")) + request.Headers.Add("Authorization", TokenAutorizacion) + Dim buttonComponent As Newtonsoft.Json.Linq.JObject = Nothing + ' Crear el array para "parameters" + Dim ArrayBody As Newtonsoft.Json.Linq.JArray = New Newtonsoft.Json.Linq.JArray() + If ParametrosBody.Count > 0 Then + For Each valor In ParametrosBody + Dim parametro As Newtonsoft.Json.Linq.JObject = New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("type", "text"), + New Newtonsoft.Json.Linq.JProperty("text", valor) + ) + ArrayBody.Add(parametro) + Next + End If + + If LigaBoton <> "" Then + ' Crear los parámetros del componente "button" + Dim buttonParameters As Newtonsoft.Json.Linq.JArray = New Newtonsoft.Json.Linq.JArray( + New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("type", "text"), + New Newtonsoft.Json.Linq.JProperty("text", "https://sig.adssistemas.mx.com/Clientes/Clientes.aspx?CveCliente=1") + ) + ) + ' Crear el componente "button" + buttonComponent = New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("type", "button"), + New Newtonsoft.Json.Linq.JProperty("sub_type", "url"), + New Newtonsoft.Json.Linq.JProperty("index", 0), + New Newtonsoft.Json.Linq.JProperty("parameters", buttonParameters) + ) + End If + ' Crear el componente "body" usando el array + Dim bodyComponent As Newtonsoft.Json.Linq.JObject = New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("type", "body"), + New Newtonsoft.Json.Linq.JProperty("parameters", ArrayBody) ' Usar el JArray directamente + ) + ' Construir el JSON principal + Dim bodyJson As Newtonsoft.Json.Linq.JObject = New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("messaging_product", "whatsapp"), + New Newtonsoft.Json.Linq.JProperty("to", NumeroTelefono), + New Newtonsoft.Json.Linq.JProperty("type", "template"), + New Newtonsoft.Json.Linq.JProperty("template", New Newtonsoft.Json.Linq.JObject( + New Newtonsoft.Json.Linq.JProperty("name", NombrePlantilla), + New Newtonsoft.Json.Linq.JProperty("language", New Newtonsoft.Json.Linq.JObject(New Newtonsoft.Json.Linq.JProperty("code", "es_MX"))), + New Newtonsoft.Json.Linq.JProperty("components", New Newtonsoft.Json.Linq.JArray(bodyComponent, buttonComponent)) + )) + ) + + ' Agregar el contenido a la solicitud + Using content = New StringContent(bodyJson.ToString(), Encoding.UTF8, "application/json") + request.Content = content + Dim response = httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).Result + + If response.StatusCode = Net.HttpStatusCode.OK Then + RetornoObj = response.Content.ReadAsStringAsync().Result + Retorno = True + End If + End Using + End Using + End Using + Catch ex As Exception + RetornoObj = New Newtonsoft.Json.Linq.JObject(New Newtonsoft.Json.Linq.JProperty("Error", ex.ToString())).ToString() + GuardaLog("Ocurrió un error al enviar la información por WhatsApp: " & ex.Message) + End Try + Return Retorno + End Function #End Region diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index bbc5e7a95..4f4952174 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -5171,7 +5171,7 @@
- -
-
- - -
+
+ +
+
+ + +
+
diff --git a/Ventas/CatPromociones.aspx b/Ventas/CatPromociones.aspx index 97dec0a5a..7e08eec13 100644 --- a/Ventas/CatPromociones.aspx +++ b/Ventas/CatPromociones.aspx @@ -57,16 +57,16 @@ - + - + - - - + + + @@ -82,25 +82,6 @@ - - + diff --git a/Ventas/CatPromociones.aspx.vb b/Ventas/CatPromociones.aspx.vb index 6c5e2393d..e5a6f525f 100644 --- a/Ventas/CatPromociones.aspx.vb +++ b/Ventas/CatPromociones.aspx.vb @@ -36,7 +36,7 @@ Partial Class Ventas_CatPromociones Private Sub CargaDatos() Dim ObjVentas As New ClsVentas - If ObjVentas.GetPromociones(-1, "-1", -1, -1, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero) Then + If ObjVentas.GetPromociones(-1, MinFecha, -1, -1, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, CveUsuario:=UsuarioActual.CveUsuario) Then DtDatos = ObjVentas.DtResultados Else DtDatos = Nothing @@ -58,12 +58,5 @@ Partial Class Ventas_CatPromociones Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) CargaDatos() End Sub - Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - - e.Row.FCHyperLink("HLPromocion").NavigateUrl = String.Format("/Ventas/Promociones.aspx?CvePromocion={0}", e.Row.DBCampo("CvePromocion")) - - End If - End Sub End Class \ No newline at end of file diff --git a/Ventas/PVCobranza.aspx b/Ventas/PVCobranza.aspx index 31f0620f8..eb932618b 100644 --- a/Ventas/PVCobranza.aspx +++ b/Ventas/PVCobranza.aspx @@ -371,7 +371,6 @@
-
@@ -399,9 +398,7 @@
-
- -   +
Nombre:
         
@@ -538,7 +535,8 @@
- + +
$ @@ -1108,7 +1106,7 @@
- +
@@ -217,23 +220,23 @@ <%--5--%> - - - - <%--6--%> - + <%--7--%> - + <%--8--%> - + <%--9--%> + + <%--10--%> + + <%--11--%> - <%--10--%> + <%--12--%> @@ -333,7 +336,7 @@
-
+
diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb index 745338230..82f584ad0 100644 --- a/Ventas/Promociones.aspx.vb +++ b/Ventas/Promociones.aspx.vb @@ -20,12 +20,12 @@ Partial Class Ventas_Promociones End Set End Property - Private Property TempDTOrigial As DataTable + Private Property TempDTOriginal As DataTable Get - Return CType(ViewState("TempDTOrigial"), DataTable) + Return CType(ViewState("TempDTOriginal"), DataTable) End Get Set(value As DataTable) - ViewState("TempDTOrigial") = value + ViewState("TempDTOriginal") = value End Set End Property @@ -146,8 +146,6 @@ Partial Class Ventas_Promociones End Set End Property - - #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load @@ -176,8 +174,7 @@ Partial Class Ventas_Promociones CargaDatos() LnkAgrgarPlantillaPS.Visible = False - - ValidaPromosiones(False) + 'ValidaPromociones(False) If EmpresaGrupoDiaz Then If ChkEstatus.Checked = False AndAlso BloqueadoPromocionPorcentaje AndAlso Not PermisoAutorizPromocionPorcentaje Then @@ -187,7 +184,6 @@ Partial Class Ventas_Promociones If ChkEstatus.Checked = True And Not PermisoAutorizPromocionPorcentaje Then BtnGuardar.Visible = False ButBtnEliminar.Visible = False - 'UpBotones.Update() End If End If @@ -198,6 +194,12 @@ Partial Class Ventas_Promociones CreaDT() End If + If EmpresaGrupoDiaz AndAlso Not PermisoAutorizPromocionPorcentaje Then + DVUltimoCostoCostoPromedio.Visible = False + GvDatos.Columns(6).Visible = False + GvDatos.Columns(7).Visible = False + End If + CargaGvBitacora() @@ -241,7 +243,7 @@ Partial Class Ventas_Promociones 'CLASIFICACIONES DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion") DdlClasificacion.DataBind() - If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If EmpresaGrupoDiaz Then DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) Else DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -346,7 +348,7 @@ Partial Class Ventas_Promociones TempDT.Columns.Add("UtilidadPorcentaje", GetType(Decimal)) - TempDTOrigial = TempDT.Copy + TempDTOriginal = TempDT.Copy '366 Estatus '367 CvePS @@ -419,7 +421,7 @@ Partial Class Ventas_Promociones Private Sub CargaDatos() Dim ObjVentas As New ClsVentas - If ObjVentas.GetPromociones(CvePromocion, "-1", -1, -1, -1, UsuarioActual.CveEmpresa, -1) AndAlso ObjVentas.DtResultados.Rows.Count = 1 Then + If ObjVentas.GetPromociones(CvePromocion, MinFecha, -1, -1, -1, UsuarioActual.CveEmpresa, -1) AndAlso ObjVentas.DtResultados.Rows.Count = 1 Then Dim Dr As DataRow = ObjVentas.DtResultados.Rows(0) TxtPromocion.Text = Dr("Promocion").ToString TxtFechaI.Text = Dr("FechaInicio").ToString.ToDate.ToShortDateString @@ -438,11 +440,6 @@ Partial Class Ventas_Promociones Else DdlClientes.SelectedValue = Dr("CveCliente").ToString End If - - - - - End If ChkEstatus.Checked = If(Dr("Estatus").ToString = "True", True, False) @@ -455,12 +452,12 @@ Partial Class Ventas_Promociones If ObjVentas.GetPromocionesDetalle(CvePromocion, UsuarioActual.CveEmpresa) Then TempDT = ObjVentas.DtResultados.Copy - TempDTOrigial = ObjVentas.DtResultados.Copy + TempDTOriginal = ObjVentas.DtResultados.Copy CargaGrid() Else Alert("Ocurrió un error al consultar los detalles de la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError) End If - + CargaGvBitacora() Else Alert("Ocurrió un error al consultar la promoción. Por favor vuelva a intentar.", TipoMensaje.MsgError) End If @@ -480,7 +477,6 @@ Partial Class Ventas_Promociones UpDatos.Update() End Sub - Private Sub CargaMonedas() DdlMoneda.DataSource = GlobalDTMonedas DdlMoneda.DataBind() @@ -540,11 +536,16 @@ Partial Class Ventas_Promociones End If ' validación de %minimo considerado 02580104V - If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If EmpresaGrupoDiaz Then Dim tuc As Decimal = LblUltimoCosto.Text.ToDecimal Dim tpu As Decimal = TxtPromocionConcepto.Text.ToDecimal If tuc <= 0 OrElse (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) + If PermisoAutorizPromocionPorcentaje Then + Alert("El producto está debajo de la utilidad permitida.", TipoMensaje.MsgAdvertencia.ToastAdventencia) + Else + Alert("El producto está debajo de la utilidad permitida, la promoción requerirá autorización.", TipoMensaje.MsgAdvertencia.ToastAdventencia) + End If + End If End If @@ -633,8 +634,6 @@ Partial Class Ventas_Promociones Dr("UltimoCosto") = UltimoCosto Dr("CostoPromedio") = CostoPromedio - - If UltimoCosto > 0 Then Dim Promocion As Decimal = TxtPromocionConcepto.Text.ToDecimal @@ -654,12 +653,6 @@ Partial Class Ventas_Promociones Dr("UtilidadPorcentaje") = 0.0D End If - - - - - - If CveConsecutivo >= 0 Then Dr.AcceptChanges() Else @@ -669,20 +662,18 @@ Partial Class Ventas_Promociones CargaGrid() RegistraScript("$('#DivAgregar').modal('hide')") - ValidaPromosiones(True) + ValidaPromociones(True) End Sub - Private Sub ValidaPromosiones(Bloquear As Boolean) - + Private Sub ValidaPromociones(Bloquear As Boolean) If Not EmpresaGrupoDiaz Then BloqueadoPromocionPorcentaje = False Exit Sub End If - Dim DTPSUltimoCosto = New DataTable Dim ObjInv As New ClsInventarios @@ -691,8 +682,6 @@ Partial Class Ventas_Promociones End If ObjInv.Dispose() - - If PorMinMasCostoVentaFnc129 > 0 Then For Each dRow As DataRow In TempDT.Rows @@ -724,19 +713,16 @@ Partial Class Ventas_Promociones Exit For End If End If - Else BloqueadoPromocionPorcentaje = True End If - Next End If - If BloqueadoPromocionPorcentaje AndAlso Bloquear Then + If (Not PermisoAutorizPromocionPorcentaje) AndAlso BloqueadoPromocionPorcentaje AndAlso Bloquear Then ChkEstatus.Checked = False ChkEstatus.Enabled = False End If - UpGenerales.Update() End Sub @@ -751,7 +737,6 @@ Partial Class Ventas_Promociones #End Region - #Region " GV PS " Private Sub GvDatos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvDatos.RowCommand @@ -835,7 +820,7 @@ Partial Class Ventas_Promociones End If - ValidaPromosiones(True) + ValidaPromociones(True) Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero) Dim ObjVentas As New ClsVentas @@ -950,7 +935,7 @@ Partial Class Ventas_Promociones - Dim Dr2 As DataRow = TempDTOrigial.FiltraParametros($"CvePromocionDetalle = {Dr("CvePromocionDetalle").ToString}").Rows(0) + Dim Dr2 As DataRow = TempDTOriginal.FiltraParametros($"CvePromocionDetalle = {Dr("CvePromocionDetalle").ToString}").Rows(0) If Not TieneError And Dr("CvePS").ToString <> Dr2("CvePS").ToString Then If Not ObjGral.AddHistorialBitacora(367, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Dr("CodigoPS").ToString, Dr2("CodigoPS").ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, "Se elimino " & Dr("CodigoPS").ToString, "PS", "", CvePromocion:=CvePromocion) Then @@ -1271,14 +1256,12 @@ Partial Class Ventas_Promociones Dim contenido As Byte() = System.IO.File.ReadAllBytes(rutaArchivoPlantilla) Response.BinaryWrite(contenido) - Response.Flush() Response.End() End Sub - Protected Sub BrnAgregarPlantilla_Click(sender As Object, e As EventArgs) If TxtExcel.getfiles().Archivos.Count > 0 Then @@ -1374,15 +1357,13 @@ Partial Class Ventas_Promociones CargaGrid() RegistraScript("$('#DivAgregarPlantilla').modal('hide')") - ValidaPromosiones(True) + ValidaPromociones(True) End Sub Private Function ValidaDTPlantilla(ByRef DTPlantilla As DataTable) As Boolean Dim Errores As New StringBuilder - - DTPlantilla.Columns.Add("CveClasificacion", GetType(Integer)) DTPlantilla.Columns.Add("CvePS", GetType(Integer)) DTPlantilla.Columns.Add("CveTipoPromosicion", GetType(Integer)) @@ -1396,13 +1377,13 @@ Partial Class Ventas_Promociones Dim DTPS As DataTable = New DataTable Dim DTRines As DataTable = New DataTable - Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then - DTPS = ObjPS.DtResultados - End If - ObjPS.Dispose() - + 'Dim ObjPS As New ClsProductosServicios + 'If ObjPS.GetPS(-1, -1, UsuarioActual.CveEmpresa) Then + ' DTPS = ObjPS.DtResultados + 'End If + 'ObjPS.Dispose() + DTPS = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) DTRines = GlobalDTPSRinTamaños(UsuarioActual.CveEmpresa) Dim RegistroActual As Integer = 1 @@ -1436,7 +1417,6 @@ Partial Class Ventas_Promociones If ClasificacionStr.Length > 0 And CodigoStr.Length > 0 Then SBErrorRegistro.Append($"No se puede agregar Clasificación y codigo en un mismo registro. ") Else - If ClasificacionStr.Length > 0 Then SBErrorRegistro.Append(If(CveClasificacion > 0, "", $"No se encontro Clasificación '{ClasificacionStr}'.
")) Else @@ -1513,9 +1493,7 @@ Partial Class Ventas_Promociones LblCostoPromedio.Text = DTPSUltimoCosto.FiltroPrimeroValor("CostoPromedio", "").FormatoNumero(4) LbPUActual.Text = DTPSUltimoCosto.FiltroPrimeroValor("Importe", "").FormatoNumero(4) - UpAgregar.Update() End Sub - End Class \ No newline at end of file diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 317269edc..b556ddb94 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -451,7 +451,7 @@ Nombre:  - Enviar Mail: + Envía Mail: @@ -578,6 +578,11 @@ + + + + + Médico: @@ -775,7 +780,7 @@ - + @@ -1215,13 +1220,16 @@
-
- +
+ +
+ +
@@ -1263,7 +1271,7 @@ <%--1--%> - +
@@ -1285,7 +1293,7 @@ - + @@ -1469,7 +1477,7 @@ <%--18--%> - +
@@ -1483,7 +1491,7 @@ <%--19--%> - + @@ -8207,7 +8215,7 @@