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/Acumuladores/EntradasUsadosResumenRep.aspx.vb b/Acumuladores/EntradasUsadosResumenRep.aspx.vb index 799484355..ced8542ab 100644 --- a/Acumuladores/EntradasUsadosResumenRep.aspx.vb +++ b/Acumuladores/EntradasUsadosResumenRep.aspx.vb @@ -26,7 +26,7 @@ Partial Class Acumuladores_RepEntradasUsados End Sub Protected Sub CargarDatos() - DdlAlmacenes.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1) + DdlAlmacenes.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen = 22") DdlAlmacenes.DataBind() End Sub diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx b/Acumuladores/RepEntradasUsadosClientes.aspx index 2a92b403e..f1fe85c14 100644 --- a/Acumuladores/RepEntradasUsadosClientes.aspx +++ b/Acumuladores/RepEntradasUsadosClientes.aspx @@ -82,7 +82,6 @@ - <%--OnClick="CargarVentasGrupo"--%> diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx.vb b/Acumuladores/RepEntradasUsadosClientes.aspx.vb index b21eba707..9d266557c 100644 --- a/Acumuladores/RepEntradasUsadosClientes.aspx.vb +++ b/Acumuladores/RepEntradasUsadosClientes.aspx.vb @@ -94,9 +94,9 @@ Partial Class Acumuladores_RepEntradasUsadosClientes Dim renglon As GridViewRow = CType(tempLink.NamingContainer, GridViewRow) LbCliente.Text = renglon.DataKey("NombreComercial") - LbTam.Text = renglon.DataKey("Codigo") + LbTam.Text = renglon.DataKey("Codigo_Clientes") Dim ObjAcum As New ClsAcumuladores - If ObjAcum.GetUsadosClasificacionVentas(renglon.DataKey("CveCliente"), renglon.DataKey("Codigo"), TxtFechaI.Text, TxtFechaF.Text) Then + If ObjAcum.GetUsadosClasificacionVentas(renglon.DataKey("CveCliente"), renglon.DataKey("Codigo_Clientes"), TxtFechaI.Text, TxtFechaF.Text) Then GvVentas.DataSource = ObjAcum.DtResultados End If ObjAcum.Dispose() 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/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index c848d70b9..835abc0c4 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4396,7 +4396,7 @@ Partial Class Compras_Compras 'End If 'METODO DE PREPOLIZA DE ALMACEN - If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then + If UsuarioActual.CveEmpresa.Contiene(1, 119, 72, 80, 140) And UsuarioActual.Empresa.UsaInventarios And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then Dim ImporteAlmacen = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal If ImporteAlmacen > 0 Then If Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then @@ -4412,8 +4412,6 @@ Partial Class Compras_Compras CveConceptoContableAlmacen = 205 End If Else - - CveConceptoContableAlmacen = 225 End If @@ -6237,7 +6235,7 @@ Partial Class Compras_Compras End If Case 6 'Compra - Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" + Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Dim RegistraConcepto225 As Boolean = UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" If RBLPago.SelectedValue.ToEntero = 4 Then diff --git a/Compras/RepRembolsoComprobaciones.aspx b/Compras/RepRembolsoComprobaciones.aspx index 854a49898..7d3509703 100644 --- a/Compras/RepRembolsoComprobaciones.aspx +++ b/Compras/RepRembolsoComprobaciones.aspx @@ -187,7 +187,7 @@ Excedente   - + diff --git a/Compras/RepRembolsoComprobaciones.aspx.vb b/Compras/RepRembolsoComprobaciones.aspx.vb index 33994b2a3..77316d8e8 100644 --- a/Compras/RepRembolsoComprobaciones.aspx.vb +++ b/Compras/RepRembolsoComprobaciones.aspx.vb @@ -161,64 +161,64 @@ Partial Class Compras_RepRembolsoComprobaciones Dim ObjComp As New ClsCompras() Dim ObjMov As New ClsContabilidad(ObjComp.IniciaTransacSQL) Dim ObjAC As ClsContPAQi = Nothing - If UsuarioActual.Empresa.UsaContabilidad Then - ObjAC = New ClsContPAQi(UsuarioActual.Empresa) - ObjAC.IniciaTransacSQL() - End If + Dim TieneError = False Dim CvePrePoliza As Integer = 0 Dim IdPoliza As Integer = 0 Dim Msg As New StringBuilder - CvePrePoliza = ObjMov.AddPrePolizas("Compras/Registrar", 1, DtDatos(0)("Original").ToString.ToDecimal, DtDatos(0)("Original").ToString.ToDecimal, CveMoneda, TxtFechaUnificacion.Text.Trim.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) + Try + CvePrePoliza = ObjMov.AddPrePolizas("Compras/Registrar", 1, DtDatos(0)("Original").ToString.ToDecimal, DtDatos(0)("Original").ToString.ToDecimal, CveMoneda, TxtFechaUnificacion.Text.Trim.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) - If CvePrePoliza > 0 AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then - If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, DdlPersonal.SelectedValue.ToEntero, -1, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then - TieneError = True - End If - Else - If CvePrePoliza > 0 AndAlso DdlCajaChica.SelectedValue.ToEntero > 0 Then - If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, -1, DdlCajaChica.SelectedValue.ToEntero, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then + If CvePrePoliza > 0 AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then + If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, DdlPersonal.SelectedValue.ToEntero, -1, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then TieneError = True End If Else - TieneError = True - End If - - End If - - If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then - If ObjMov.ValorPolizaDescuadre > 0 Then - GuardaLogAD($"Compras/RepRembolsoComprobaciones - Unificar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") - Alert(ObjMov.MensajePolizaDescuadre, TipoMensaje.MsgError) - TieneError = True - End If - End If - - If Not TieneError Then - Msg.AppendFormat("Se unificaron todas las compras con éxito") - End If - - If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" AndAlso Not TieneError Then - If ObjAC Is Nothing Then - TieneError = True - End If - - If Not TieneError Then - If Not ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then - TieneError = True - Alert($"Ocurrio un error al contabilizar {ObjMov.AlertaMensaje}", TipoMensaje.MsgAdvertencia) + If CvePrePoliza > 0 AndAlso DdlCajaChica.SelectedValue.ToEntero > 0 Then + If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, -1, DdlCajaChica.SelectedValue.ToEntero, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then + TieneError = True + End If Else - IdPoliza = ObjMov.ContaIdPoliza + TieneError = True + End If + + End If + + If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then + If ObjMov.ValorPolizaDescuadre > 0 Then + GuardaLogAD($"Compras/RepRembolsoComprobaciones - Unificar | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") + Alert(ObjMov.MensajePolizaDescuadre, TipoMensaje.MsgError) + TieneError = True End If End If - If IdPoliza > 0 AndAlso Not TieneError Then - Msg.AppendFormat("

Ver Póliza", IdPoliza) + If Not TieneError Then + Msg.AppendFormat("Se unificaron todas las compras con éxito") End If - End If + If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" AndAlso Not TieneError Then + ObjAC = New ClsContPAQi(UsuarioActual.Empresa) + ObjAC.IniciaTransacSQL() + If Not TieneError Then + If Not ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then + TieneError = True + Alert($"Ocurrio un error al contabilizar {ObjMov.AlertaMensaje}", TipoMensaje.MsgAdvertencia) + Else + IdPoliza = ObjMov.ContaIdPoliza + End If + End If + + If IdPoliza > 0 AndAlso Not TieneError Then + Msg.AppendFormat("

Ver Póliza", IdPoliza) + End If + + End If + Catch ex As Exception + TieneError = True + OnError("Ocurrió un error al unificar las compras", ex) + End Try If Not TieneError Then ObjComp.Commit() diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index dd79a2a08..44105439a 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1051,15 +1051,14 @@ Partial Class General_SaldosIniciales Dim BonificacionUsado As Boolean = If(Row("EmitirBon Usado").ToString.ToUpper = "SI", True, False) Dim LimiteCredito As Decimal = Row("Limite Credito").ToString.ToDecimal - Dim CobranzaCorreo As String = Row("CorreoPago").ToString + Dim CobranzaCorreo As String = Row("CorreoPagos").ToString Dim PlazoCobranza As Integer = Row("Plazo Cobranza").ToString.ToEntero Dim DìaVisita As String = Row("Dia Pago").ToString Dim DiasPagoEspecifico As String = Row("Dìa Visita").ToString Dim CobranzaContacto As String = Row("Encargado Pago").ToString Dim CobranzaTelefono As String = Row("Celular Contacto").ToString.Replace("-", "").Replace(" ", "").Replace("(", "").Replace(")", "") - - + Dim CveUsoCFDI As Integer = If(Row("UsoCFDI").ToString = "", -1, GlobalDTSATUsosCFDI().FiltroPrimeroValor("CveUsoCFDI", String.Format("UsoCFDI = '{0}'", Row("UsoCFDI").ToString)).ToEntero) ' CobranzaContacto = Regex.Replace(CobranzaContacto, "[^0-9]", "") 'Telefono @@ -1169,7 +1168,7 @@ Partial Class General_SaldosIniciales If Not ObjClientes.AddCliente(RazonSocial, RazonSocial, Calle, NumExt.ToString, "", Colonia, Poblacion, Poblacion, Estado, Pais, RFC, CodigoPostal, Telefono, Contacto, "", "", "", "", "", -1, False, 0, 0, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", CveVendedor, PlazoCobranza, -1, "-1", "-1", -1, "-1", -1, "0", -1, "0", 0, "", 0, "", 0, "", 0, "", "", "", Codigo, LimiteCredito, "", 1, False, "", "", "", False, "", "", "", "", "", False, "", "", "", False, 0, -1, EsDistribuidor:=EsDistribuidor, CveClienteClasificacion:=CveClasificación, CargoUsado:=CargoUsado, - BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33) Then + BonificacionUsado:=BonificacionUsado, CobranzaContacto:=CobranzaContacto, CobranzaCorreo:=CobranzaCorreo, DiasEspecifico:=DiasPagoEspecifico, DiasRevision:=DìaVisita, CobranzaTelefono:=CobranzaTelefono, CveFormaPago33:=CveFormaPago33, CveUsoCFDI:=CveUsoCFDI) Then ErrorClientes = True RFC.GuardaLog 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 d37ad69e5..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 @@ -1862,8 +1871,9 @@ Partial Class Clientes Private Sub CargaComboCFDI() DdlUsoCFDI.Items.Clear() DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica) - DdlUsoCFDI.DataBind() - + DdlUsoCFDI.DataBind() + DdlUsoCFDI.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlSucursalUsoCFDI.Items.Clear() DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica) DdlSucursalUsoCFDI.DataBind() diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 23139d865..71004d7e2 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="Ventas - Facturación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PV.aspx.vb" Inherits="PV" EnableEventValidation="false" %> +<%@ Page Title="Ventas - Facturación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PV.aspx.vb" Inherits="PV" EnableEventValidation="false"%> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <%--Necesario para el modal que no se cierra--%> @@ -2576,7 +2576,7 @@ -