From ca563db4a55d529233ff5232bd07be71bad29c9d Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Fri, 21 Feb 2020 19:22:43 -0700 Subject: [PATCH 1/8] . --- Acumuladores/EntradasUsadosResumenRep.aspx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Acumuladores/EntradasUsadosResumenRep.aspx b/Acumuladores/EntradasUsadosResumenRep.aspx index b840b5165..eb86ecdc5 100644 --- a/Acumuladores/EntradasUsadosResumenRep.aspx +++ b/Acumuladores/EntradasUsadosResumenRep.aspx @@ -78,16 +78,16 @@ + ShowFooter="False" DataKeyNames="CvePSCargo,CodigoPS,Inicial,E_Almacen,E_Pub,E_Traspaso,E_Compra,E_Otros,S_Almacen,S_Traspaso,S_Otros,Exist_Actual"> - + - + - + From f1812e797f4d92ee4b5ccc660d5f4efd5c99b497 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Sat, 22 Feb 2020 12:58:53 -0700 Subject: [PATCH 2/8] nuevos campos en la tabla de conta cuentas --- App_Code/ClsContabilidad.vb | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index e5a748ea3..2a863a930 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -4602,7 +4602,10 @@ Public Class ClsContabilidad Return Retorno End Function - Public Function UpdateCuenta(CveCuenta As Integer, Nombre As String, Tipo As String, CtaMayor As Integer, CveMoneda As Integer, Optional DigAgrupador As Integer = -1, Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "") As Boolean + Public Function UpdateCuenta(CveCuenta As Integer, Nombre As String, Tipo As String, CtaMayor As Integer, CveMoneda As Integer, Optional DigAgrupador As Integer = -1, + Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "", Optional CveConceptoAdmin As Integer = -1, Optional CveProveedor As Integer = -1, + Optional CveCliente As Integer = -1, Optional CveClasificacion As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1, + Optional CveBancoCuenta As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Conta_UpdateCuentas") @@ -4616,6 +4619,12 @@ Public Class ClsContabilidad .Add("@DigAgrupador", SqlDbType.Int).Value = DigAgrupador .Add("@NomIdioma", SqlDbType.VarChar).Value = NomIdioma .Add("@CveAgrupadorSAT", SqlDbType.Int).Value = CveAgrupadorSAT + .Add("@CveConceptoAdmin", SqlDbType.Int).Value = CveConceptoAdmin + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto + .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta End With Try @@ -4630,7 +4639,9 @@ Public Class ClsContabilidad Return Retorno End Function Public Function AddCuenta(CvePadre As Integer, Codigo As String, Nombre As String, Tipo As String, CtaMayor As Integer, CveMoneda As Integer, Optional DigAgrupador As Integer = -1, - Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "", Optional CveEmpresaParam As Integer = -1) As Integer + Optional CveAgrupadorSAT As Integer = -1, Optional NomIdioma As String = "", Optional CveEmpresaParam As Integer = -1, Optional CveConceptoAdmin As Integer = -1, + Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CveClasificacion As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1, + Optional CveBancoCuenta As Integer = -1) As Integer Dim Retorno As Integer = 0 DataAdapter("PA_Conta_AddCuentas") @@ -4645,6 +4656,12 @@ Public Class ClsContabilidad .Add("@NomIdioma", SqlDbType.VarChar).Value = NomIdioma .Add("@CveAgrupadorSAT", SqlDbType.Int).Value = CveAgrupadorSAT .Add("@CveEmpresaParam", SqlDbType.Int).Value = CveEmpresaParam + .Add("@CveConceptoAdmin", SqlDbType.Int).Value = CveConceptoAdmin + .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto + .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta '.Add("@CveCuenta", SqlDbType.Int).Value = 0 '.Add("@Error", SqlDbType.VarChar).Value = "" '.Add("@Error", SqlDbType.VarChar).Direction = ParameterDirection.Output From 1149b341684ae1efa6cf07d342bb7442a75f8832 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Sat, 22 Feb 2020 14:40:01 -0700 Subject: [PATCH 3/8] agregando las consultas de cuentas y conceptos --- App_Code/ClsContabilidad.vb | 17 +++++++++++++++++ Ventas/Clientes.aspx | 26 ++++++++++++++++++++++++++ Ventas/Clientes.aspx.vb | 11 ++++++++++- 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 2a863a930..ff6b8012f 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -4707,6 +4707,23 @@ Public Class ClsContabilidad Return Retorno End Function + Public Function GetCuentasyConceptos(CveCliente As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Conta_GetCuentasyConceptos") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al consultar las cuentas y conceptos", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function UpdateCuentaCompaq(CveCuenta As Integer, IdCompaq As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index ba8db1c2f..a5dc43c1e 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -1058,6 +1058,32 @@ +
+
+
+ + Cuentas y conceptos +
+
+
+
+
+
+
+
+ + + + + + + + + + +
+
+
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 384674203..2c9b38da2 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -778,7 +778,7 @@ Partial Class Clientes If Request("ATI") IsNot Nothing AndAlso IsNumeric(Request("ATI")) Then Tab.ActiveTabIndex = Request("ATI").ToEntero End If - + CargaCuentasyConceptos() Else 'Configuración de Modalidad Insert @@ -1037,6 +1037,15 @@ Partial Class Clientes DdlMonedaExtranjeraAnticipos.Attributes.Add("onclick", "CargaCuentas(9);") End Sub + Private Sub CargaCuentasyConceptos() + Dim ObjConta As New ClsContabilidad + If ObjConta.GetCuentasyConceptos(CveCliente) Then + GvCuentasContable.DataSource = ObjConta.DtResultados + End If + ObjConta.Dispose() + GvCuentasContable.DataBind() + UpCuentaConceptos.Update() + End Sub Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click If UsuarioActual.Empresa.ServerContPAQi = "" Then Exit Sub From 66d7965c3458584cf848329d4f9a2b96029228f0 Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Sat, 22 Feb 2020 14:42:38 -0700 Subject: [PATCH 4/8] cambio de redondeo --- Inventarios/TraspasoAlmacen.aspx.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 1f3700713..d06e548fa 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -915,7 +915,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim resultado As DataTable = ObjInventario.DtResultados - Dim importe As Decimal = resultado.SUMD("Total") + Dim importe As Decimal = resultado.SUMD("Total").RoundSQL Dim IdCtaContableSalida As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenOrigen.SelectedValue.ToEntero)).ToEntero Dim IdCtaContableEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenDestino.SelectedValue.ToEntero)).ToEntero Dim Contabilizable As Boolean = True @@ -940,7 +940,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim resultado As DataTable = ObjInventario.DtResultados - Dim importe As Decimal = resultado.SUM("Total").ToDecimal + Dim importe As Decimal = resultado.SUMD("Total").RoundSQL Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then @@ -1569,7 +1569,7 @@ Partial Class Inventarios_TraspasoAlmacen End If If Not ErrorMovInv Then - Dim ImporteDecimal As Decimal = importe.ToDecimal + Dim ImporteDecimal As Decimal = importe.ToDecimal.RoundSQL Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, @@ -1730,7 +1730,7 @@ Partial Class Inventarios_TraspasoAlmacen If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then Dim resultado As DataTable = ObjInventario.DtResultados - Dim importe As Decimal = resultado.SUM("Total").ToDecimal + Dim importe As Decimal = resultado.SUMD("Total").RoundSQL Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then From fdfe6c28e464000ad2b5cb9c9be68ccfbc506cac Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Sat, 22 Feb 2020 14:43:39 -0700 Subject: [PATCH 5/8] - cambio de fecha pago --- Ventas/Ventas.aspx.vb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 71c5d88eb..44c6a0b18 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -14037,6 +14037,8 @@ Partial Class Ventas Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D + Dim DiasPlazo As Integer = RowPorcentaje("Plazo").ToString().ToEntero + TxtFechaPago.Text = Now.AddDays(DiasPlazo).ToShortDateString Dim TotalInicial As Decimal = (Cantidad * (PU)) - Descuento Dim TotalFinal = TotalInicial From 6a19b9dd40e221fd6b646fa665ef8abc910bd6ba Mon Sep 17 00:00:00 2001 From: Rene Molina Date: Sat, 22 Feb 2020 14:44:23 -0700 Subject: [PATCH 6/8] position fecha --- Ventas/PV.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 07ff5a1dc..23139d865 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2913,7 +2913,7 @@ - + From 05367fda527edc0c1c2ed6c48d10b8d701b2fe8c Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 24 Feb 2020 13:05:19 -0700 Subject: [PATCH 7/8] se pueden seleccionar a todos los clientes en vez de solo a los distribuidores --- Inventarios/RecepcionUsados.aspx | 12 ++++++++---- Inventarios/RecepcionUsados.aspx.vb | 14 +++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx index 353a1cc8d..2a14c8eac 100644 --- a/Inventarios/RecepcionUsados.aspx +++ b/Inventarios/RecepcionUsados.aspx @@ -130,7 +130,11 @@
- + +
+
+ +
@@ -139,7 +143,7 @@
- +
@@ -968,7 +972,7 @@
-
+
@@ -977,7 +981,7 @@
-
+
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index c9dafd4a1..cef5c28f6 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -317,7 +317,6 @@ Partial Class Inventarios_RecepcionUsados ViewState("DtPorcentajeMarcas") = value End Set End Property - #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load @@ -346,7 +345,7 @@ Partial Class Inventarios_RecepcionUsados TxtFecha.Text = Now.ToShortDateString TxtFechaPendientes.Text = Now.ToShortDateString RVFecha.MaximumValue = Now.ToShortDateString - InicializaClientes() + InicializaClientes(False) 'si viene una parámetro para cargar un movimiento lo hacemos dentro del procedimiento cargadatos Select Case UsuarioActual.Empresa.Funcionalidad(103) @@ -1148,7 +1147,7 @@ Partial Class Inventarios_RecepcionUsados 'si es selectedvalue = 42, es entrada ,3 -salida Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 42, 1, 2) - If RBLOpcion.SelectedValue.ToEntero = 42 AndAlso EsDistribuidor AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then + If EsDistribuidor AndAlso RBLOpcion.SelectedValue.ToEntero = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then @@ -1706,9 +1705,9 @@ Partial Class Inventarios_RecepcionUsados #Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED" - Private Sub InicializaClientes() + Private Sub InicializaClientes(Todos As Boolean) - DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros("EsDistribuidor = 1") + DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros(If(Todos, "", "EsDistribuidor = 1")) DdlClientes.DataBind() DdlClientes.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlClientes.SelectedValue = "-1" @@ -2781,4 +2780,9 @@ Partial Class Inventarios_RecepcionUsados End Sub #End Region + Protected Sub SeleccionarTipoDeClientes(sender As Object, e As EventArgs) + DdlClientes.Items.Clear() + InicializaClientes(ChkClientesTodos.Checked) + End Sub + End Class From 8cdb17e2ea0fea9d7729330708310d3fa865a87d Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Mon, 24 Feb 2020 15:42:58 -0700 Subject: [PATCH 8/8] nueva columna de facturas en comp_compras --- App_Code/ClsCompras.vb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index f363d1dfe..fc78fae11 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -191,12 +191,12 @@ Public Class ClsCompras AplicaNotaCredito As Boolean, Observaciones As String, CveEstatusCompra As Integer, CvePrePoliza As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional IdPoliza As Integer = -1, Optional CveOC As Integer = -1, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional NumeroReembolso As String = "-1", Optional CveProveedorSucursal As Integer = -1, Optional AplicoPromocion As Boolean = False, Optional PorcentajeIVA As Double = 0, Optional CveMetodoPago As Integer = -1, Optional CveRetIVAConcepto As Integer = -1, Optional CveConceptoContableAlmacen As Integer = -1, - Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveTipoConcepto As Integer = 1) As Boolean + Optional CveRetISRConcepto As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveTipoCompra As Integer = -1, Optional TotalOriginal As Double = 0, Optional CveTipoConcepto As Integer = 1, Optional CveFactura As Integer = -1) As Boolean Dim Retorno As Boolean = False - DataAdapter("PA_Comp_CompraAdd") - + DataAdapter("PA_Comp_CompraAdd") + With SqlAdapter.SelectCommand.Parameters .Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto .Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion @@ -241,6 +241,7 @@ Public Class ClsCompras .Add("@CveTipoCompra", SqlDbType.Int).Value = CveTipoCompra .Add("@TotalOriginal", SqlDbType.Money).Value = TotalOriginal .Add("@CveTipoConcepto", SqlDbType.Int).Value = CveTipoConcepto + .Add("@CveFactura", SqlDbType.Int).Value = CveFactura End With Try @@ -265,7 +266,7 @@ Public Class ClsCompras Descuento As Double, SubTotal As Double, IVA As Double, Total As Double, CveUsuario As Integer, CveCompra As Integer, Optional CveCajaChica As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveProveedorSucursal As Integer = -1, Optional PorcentajeIVA As Double = 0, - Optional NumeroReembolso As String = "", Optional CveTipoCompra As Integer = -1, Optional NoDeducible As Boolean = False) As Boolean + Optional NumeroReembolso As String = "", Optional CveTipoCompra As Integer = -1, Optional NoDeducible As Boolean = False, Optional CveFactura As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -291,6 +292,7 @@ Public Class ClsCompras .Add("@NumeroReembolso", SqlDbType.VarChar).Value = NumeroReembolso .Add("@CveTipoCompra", SqlDbType.Int).Value = CveTipoCompra .Add("@NoDeducible", SqlDbType.Bit).Value = NoDeducible + .Add("@CveFactura", SqlDbType.Int).Value = CveFactura End With Try