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"> - + - + - + 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 diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index e5a748ea3..ff6b8012f 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 @@ -4690,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/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 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 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