From 0a96123c2db973d9749a47f0bf4fb864366abd66 Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Mon, 11 Nov 2019 14:41:25 -0700 Subject: [PATCH 1/2] Sugiere precio en base al Costo de la clasificacion --- App_Code/ClsClasificaciones.vb | 6 ++- Ventas/CatClasificaciones.aspx | 86 ++++++++++++++++++------------- Ventas/CatClasificaciones.aspx.vb | 8 ++- Ventas/Ventas.aspx.vb | 19 +++++++ 4 files changed, 78 insertions(+), 41 deletions(-) diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 0970a55d3..72436f388 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -192,7 +192,7 @@ Public Class ClsClasificaciones End Function Public Function AddClasificaciones(Clasificacion As String, Codigo As String, IdCuentaGasto As Integer, CuentaGasto As String, IdCuentaCostos As Integer, CuentaCostos As String, IdCuentaIngreso As Integer, CuentaIngreso As String, CveCategoria As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional RequiereSerieLote As Integer = 0, Optional UsoClasificacion As Integer = -1, Optional CveSATPS As Integer = -1, Optional RequiereAFCompra As Boolean = True, Optional RequiereAFInsumo As Boolean = True, Optional RequierePersonal As Boolean = True, - Optional EsAcumulador As Boolean = False, Optional TopVentas As Boolean = False, Optional TopCompras As Boolean = False) As Boolean + Optional EsAcumulador As Boolean = False, Optional TopVentas As Boolean = False, Optional TopCompras As Boolean = False, Optional PrecioBaseCosto As Decimal = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClasificacionesAdd") @@ -227,6 +227,7 @@ Public Class ClsClasificaciones .Add("@EsAcumulador", SqlDbType.Bit).Value = EsAcumulador .Add("@TopCompras", SqlDbType.Bit).Value = TopCompras .Add("@TopVentas", SqlDbType.Bit).Value = TopVentas + .Add("@PrecioBaseCosto", SqlDbType.Money).Value = PrecioBaseCosto End With @@ -300,7 +301,7 @@ Public Class ClsClasificaciones End Function Public Function UpdateClasificacion(Clasificacion As String, Codigo As String, IdCuentaGasto As Integer, CuentaGasto As String, IdCuentaCostos As Integer, CuentaCostos As String, IdCuentaIngresos As Integer, CuentaIngresos As String, Estatus As Boolean, Afectable As Boolean, CveCategoria As Integer, CveUsuario As Integer, CveClasificacion As Integer, Optional RequiereSerieLote As Integer = 0, Optional UsoClasificacion As Integer = -1, Optional CveSATPS As Integer = -1, Optional RequiereAFCompra As Boolean = True, Optional RequiereAFInsumo As Boolean = True, Optional RequierePersonal As Boolean = True, - Optional EsAcumulador As Boolean = False, Optional TopVentas As Boolean = False, Optional TopCompras As Boolean = False) As Boolean + Optional EsAcumulador As Boolean = False, Optional TopVentas As Boolean = False, Optional TopCompras As Boolean = False, Optional PrecioBaseCosto As Decimal = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClasificacionesUpdate") @@ -335,6 +336,7 @@ Public Class ClsClasificaciones .Add("@EsAcumulador", SqlDbType.Bit).Value = EsAcumulador .Add("@TopCompras", SqlDbType.Bit).Value = TopCompras .Add("@TopVentas", SqlDbType.Bit).Value = TopVentas + .Add("@PrecioBaseCosto", SqlDbType.Money).Value = PrecioBaseCosto End With diff --git a/Ventas/CatClasificaciones.aspx b/Ventas/CatClasificaciones.aspx index cfd24954e..d8fbfc59d 100644 --- a/Ventas/CatClasificaciones.aspx +++ b/Ventas/CatClasificaciones.aspx @@ -76,7 +76,7 @@
+ DataKeyNames="CveClasificacion, CveCategoria, Clasificacion, UsoClasificacion, CuentaGasto, CuentaCostos, CuentaIngresos, IdCuentaGasto, IdCuentaCostos, IdCuentaIngresos,RequiereSerieLote,CveSATPS,SATClaveProductoServicio, RequiereAFCompra, RequiereAFInsumo, RequierePersonal, Estatus,EsAcumulador,TopVentas,TopCompras,PrecioBaseCosto" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None"> @@ -210,41 +210,57 @@
-
- - +
+ +
+
+
+ + +
+ +
+ + + + + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ + +
+
+
+
+ + +
+
+
-
- - - - - - -
+
- -
- - -
- - -
- - -
- - -
- - -
-
- - -
@@ -281,10 +297,6 @@
-
- - -
diff --git a/Ventas/CatClasificaciones.aspx.vb b/Ventas/CatClasificaciones.aspx.vb index 518919900..0f1bd5b3e 100644 --- a/Ventas/CatClasificaciones.aspx.vb +++ b/Ventas/CatClasificaciones.aspx.vb @@ -178,11 +178,12 @@ Partial Class CatClasificaciones DdlCuentaCostos.SelectedValue.ToEntero, DdlCuentaCostos.SelectedItem.Text, DdlCuentaIngresos.SelectedValue.ToEntero, DdlCuentaIngresos.SelectedItem.Text, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, - RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked) Then + RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") TxtClasificacion.Text = "" + TxtPrecioBaseCosto.Text = "" DdlCuentaGasto.SelectedValueExist("0") DdlCuentaCostos.SelectedValueExist("0") DdlCuentaIngresos.SelectedValueExist("0") @@ -201,7 +202,7 @@ Partial Class CatClasificaciones If ObjClasificaciones.UpdateClasificacion(Clasificacion, "", DdlGasto.SelectedValue.ToEntero, DdlGasto.SelectedItem.Text, DdlCosto.SelectedValue.ToEntero, DdlCosto.SelectedItem.Text, DdlIngresos.SelectedValue.ToEntero, DdlIngresos.SelectedItem.Text, Estatus, False, DdlCategoria.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveClasificacion, RequiereSerieLote:=RequireSerieLote, UsoClasificacion:=DdlUsoClasificacion.SelectedValue.ToEntero, CveSATPS:=DdlSATPS.SelectedValue.ToEntero, - RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked) Then + RequiereAFCompra:=ChkRequiereAFCompra.Checked, RequiereAFInsumo:=ChkRequiereAFInsumo.Checked, RequierePersonal:=ChkRequierePersonal.Checked, EsAcumulador:=ChkEsAcumulador.Checked, TopVentas:=ChkTopVentas.Checked, TopCompras:=ChkTopCompras.Checked, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones")) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) @@ -346,6 +347,7 @@ Partial Class CatClasificaciones Limpiador() TxtClasificacion.Text = "" + TxtPrecioBaseCosto.Text = "" DdlCategoria.SelectedIndex = 0 DdlSATPS.SelectedValue = "" DdlSATPS.SelectedText = "" @@ -371,6 +373,7 @@ Partial Class CatClasificaciones Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim CveClasificacion As String = GvRow.DataKey("CveClasificacion").ToString Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString + Dim PrecioBaseCosto As String = GvRow.DataKey("PrecioBaseCosto").ToString Dim CveCategoria As String = GvRow.DataKey("CveCategoria").ToString Dim CuentaGasto As String = GvRow.DataKey("CuentaGasto").ToString Dim CuentaCostos As String = GvRow.DataKey("CuentaCostos").ToString @@ -421,6 +424,7 @@ Partial Class CatClasificaciones TxtClasificacion.Text = Clasificacion + TxtPrecioBaseCosto.Text = PrecioBaseCosto.FormatoNumero(2) DdlCategoria.SelectedValueExist(CveCategoria) DdlUsoClasificacion.SelectedValue = UsoClasificacion HdnIDClasificacion.Value = CveClasificacion diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index cf8524973..1e1c3dc49 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -12923,6 +12923,16 @@ Partial Class Ventas DdlUnidadMedida.DataBind() DdlUnidadMedida.SelectedValueExist(drPS("CveUnidadMedida").ToString) + If drPS("CveTipoPS").ToString = "1" Then 'Si es servicio + If UsuarioActual.Empresa.Funcionalidad(558).ToString = "1" Then 'Si es Empresa llantera + TxtPrecio.Enabled = True + Else + TxtPrecio.Enabled = False + End If + Else + TxtPrecio.Enabled = True + End If + If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count = 0 Then DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString) CambiaMoneda() @@ -12979,7 +12989,16 @@ Partial Class Ventas End If + Dim PrecioBaseCosto As Decimal = 0 + Dim ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones() Then + PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal + End If + If PrecioSugerido > 0 Then + If PrecioBaseCosto > 0 Then + PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1) + End If TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere End If From a996c7381200b45b8cfd9c32ee1a54d54a0e57f3 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 11 Nov 2019 16:53:43 -0700 Subject: [PATCH 2/2] log propio remisiones tsoft --- App_Code/ClsTSoft.vb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/App_Code/ClsTSoft.vb b/App_Code/ClsTSoft.vb index a32fc01e2..871ca8048 100644 --- a/App_Code/ClsTSoft.vb +++ b/App_Code/ClsTSoft.vb @@ -5,6 +5,7 @@ Imports System.Web Imports System.Data Imports System.Text Imports Extensiones +Imports System.Web.Configuration Public Class ClsTSoft Inherits ClsClaseBase @@ -181,4 +182,32 @@ Public Class ClsTSoft Return retorno End Function #End Region + + Protected Overloads Function RunQuery(msgOnError As String) As Boolean + Dim retorno As Boolean = False + + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + retorno = False + + setOnError(msgOnError, ex) + End Try + Return retorno + End Function + + Public Overloads Sub setOnError(Mensaje As String, Exeption As Exception) + Dim InfoAdicional As String = "" + If SqlAdapter IsNot Nothing AndAlso SqlAdapter.SelectCommand IsNot Nothing AndAlso SqlAdapter.SelectCommand.Parameters IsNot Nothing Then + InfoAdicional = SqlAdapter.SelectCommand.Parameters.ParametrosInfo() + End If + MyCurrentError = String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional) + OnError(Mensaje, Exeption, InfoAdicional) + End Sub + Public Sub OnError(Obj As Object, Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") + GuardaLogAD(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional), "LogClsTsoft") + Alert(Obj, Mensaje, TipoMensaje.MsgError) + 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) + End Sub End Class