diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index 42d03da4b..6d25100b9 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -32,6 +32,8 @@ Public Class ClsClasificaciones End Get End Property + Public Property CveClasificacion As Integer = -1 + #End Region Sub New(Optional TransaccionCompartida As SqlTransaction = Nothing) @@ -272,7 +274,8 @@ Public Class ClsClasificaciones 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 = False, Optional RequiereAFInsumo As Boolean = False, Optional RequierePersonal As Boolean = False, 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 + Dim Retorno As Boolean = False + Me.CveClasificacion = -1 DataAdapter("PA_ClasificacionesAdd") @@ -306,13 +309,15 @@ 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 - + .Add("@PrecioBaseCosto", SqlDbType.Money).Value = PrecioBaseCosto + + .Add("@CveClasificacion", SqlDbType.Int).Direction = ParameterDirection.Output End With Try SqlAdapter.Fill(Data) + Me.CveClasificacion = SqlAdapter.SelectCommand.Parameters("@CveClasificacion").Value.ToString.ToEntero Retorno = True Catch Ex1 As SqlException If Ex1.Message.Contains("Número: 2627;") Then diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 349be1126..d152d48e1 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -8591,19 +8591,18 @@ Partial Class Compras_Compras End If End If - - 'VALIDA IMPORTES If CveFactura > 0 Then 'SI NO VIENE DE FACTURA/XML NO VALIDA TOTALES - - - - If Not ValidaTotalesGuardar() Then Exit Sub End If End If + If DdlRembolsoCajaChica.SelectedValue.ToEntero() > 0 AndAlso DdlRembolsoPersonal.SelectedValue.ToEntero() > 0 Then + Alert("No se puede tener seleccionada una 'Caja Chica' y 'Personal/Empleado' a la vez", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + For Each Row As DataRow In TmpDT.Rows If Row("CveSubProyecto").ToString.ToEntero <= 0 Then Alert("No se ha completado la asignacion de proyectos en la compra. ", TipoMensaje.MsgAdvertencia) @@ -11968,13 +11967,15 @@ Partial Class Compras_Compras Protected Sub RblRembolso_SelectedIndexChanged(sender As Object, e As EventArgs) TrRembolsoCajaChica.Visible = False TrRembolsoPersonal.Visible = False - DdlRembolsoCajaChica.SelectedValueExist("-1") - DdlRembolsoPersonal.SelectedValueExist("-1") + DdlRembolsoCajaChica.SelectedValueExistInsert("-1", "Seleccione") + DdlRembolsoPersonal.SelectedValueExistInsert("-1", "Seleccione") If RblRembolso.SelectedValue.ToEntero = 1 Then TrRembolsoPersonal.Visible = True ElseIf RblRembolso.SelectedValue.ToEntero = 2 Then TrRembolsoCajaChica.Visible = True End If + + UPCondicionesPago.Update() End Sub #End Region diff --git a/CxC/RepCxC.aspx b/CxC/RepCxC.aspx index bfe73aab6..d574ce5a0 100644 --- a/CxC/RepCxC.aspx +++ b/CxC/RepCxC.aspx @@ -358,8 +358,8 @@
- - + +
diff --git a/CxC/RepCxCDetalle.aspx b/CxC/RepCxCDetalle.aspx index 3ad0774c7..60b7fda83 100644 --- a/CxC/RepCxCDetalle.aspx +++ b/CxC/RepCxCDetalle.aspx @@ -1,718 +1,736 @@ -<%@ Page Title="SIG: Reporte de Cuentas X Cobrar Detalle" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCxCDetalle.aspx.vb" Inherits="RepCxCDetalle" %> - -<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="cc1" %> -<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %> - - - - - - - - - -
  • - PDF -
  • -
  • - Excel -
  • -
  • - Generar Excel Personalizado -
  • -
  • - Personalizar Columnas -
  • - -
  • - Ver Dlls en pesos -
  • -
  • - Habilitar Cobranza -
  • -
  • - Ir a Gestión de Cobranza -
  • -
    - - - - - -
    - -
    - - Reporte de CxC - Detalle - - - - - - - -
    -
    -
    - - -
    -
    -
    -
    +<%@ Page Title="SIG: Reporte de Cuentas X Cobrar Detalle" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCxCDetalle.aspx.vb" Inherits="RepCxCDetalle" %> + +<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="cc1" %> +<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %> + + + + + + + + + +
  • + PDF +
  • +
  • + Excel +
  • +
  • + Generar Excel Personalizado +
  • +
  • + Personalizar Columnas +
  • + +
  • + Ver Dlls en pesos +
  • +
  • + Habilitar Cobranza +
  • +
  • + Ir a Gestión de Cobranza +
  • +
    + + + + + +
    + +
    + + Reporte de CxC - Detalle + + + + + + + +
    +
    +
    + + +
    +
    +
    +
    Cliente: -
    -
    - + +
    +
    + <%-- - --%> - - - - -
    - -
    + --%> + + + + +
    + +
    Sucursal: -
    -
    - - - -
    -
    + +
    +
    + + + +
    +
    Grupo: -
    -
    - - - - - - - - - - - - - - -
    -
    -
    -
    - +
    + -
    - - - - - +
    +
    +
    + Linea Adicional: + +
    +
    + + + + + +
    +
    + + +
    +
    + + + + +
    - - +
    -
    - - - -
    -
    - - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> - -
    -
    -
    -
    -
    - - Usuario Cobranza -
    -
    - -
    -
    -
    - -
    -
    -
    - - - -
    -
    -
    - - -
    -
    -
    - - - -
    -
    -
    - -
    -
    -
    - - - -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - - -
    - - - - - - -
    - -
    -
    - - -
    -
    - -
    - -
    - -
    -
    -
    -
    -
    -
    - -
    - - - - - - - + + + + +
    +
    + + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + +
    +
    +
    +
    +
    + + Usuario Cobranza +
    +
    + +
    +
    +
    + +
    +
    +
    + + + +
    +
    +
    + + +
    +
    +
    + + + +
    +
    +
    + +
    +
    +
    + + + +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + + +
    + + + + + + +
    + +
    +
    + + +
    +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    + + + + + + + - - <%----%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
    + + + + + +
    +
    + + +
    + - + + diff --git a/General/SaldosIniciales.aspx b/General/SaldosIniciales.aspx index 031168917..55ac5080c 100644 --- a/General/SaldosIniciales.aspx +++ b/General/SaldosIniciales.aspx @@ -29,7 +29,7 @@
    -
    +
    @@ -44,6 +44,7 @@ + <%----%> @@ -53,7 +54,7 @@ - +
    diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 6a39c6780..71ad7a0f1 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -628,6 +628,36 @@ Partial Class General_SaldosIniciales Exit Sub End If + ElseIf RblFormato.SelectedValue = "16" Then 'CLASIFICACIONES + + If Not dt.Columns(0).ColumnName = "Clasificacion" Then + Alert("El nombre de la primera columna debe ser 'Clasificacion'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + If Not dt.Columns(1).ColumnName = "Categoria" Then + Alert("El nombre de la segunda columna debe ser 'Categoria'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + If Not dt.Columns(2).ColumnName = "UsoClasificacion" Then + Alert("El nombre de la segunda columna debe ser 'UsoClasificacion'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + If Not dt.Columns(3).ColumnName = "CuentaContableIngreso" Then + Alert("El nombre de la segunda columna debe ser 'CuentaContableIngreso'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + If Not dt.Columns(4).ColumnName = "CuentaContableGasto" Then + Alert("El nombre de la cuarta columna debe ser 'CuentaContableGasto'. Favor de corregirlo", TipoMensaje.MsgError) + Exit Sub + End If + + + + End If @@ -2214,14 +2244,130 @@ Partial Class General_SaldosIniciales ProcesaAnticipoCliente(dt, DTCuentasContables) ElseIf RblFormato.SelectedValue = "15" Then ProcesaBancos(dt, DTCuentasContables) + ElseIf RblFormato.SelectedValue = "16" Then + ProcesaClasificaciones(dt, DTCuentasContables) End If End If End Sub + Private Sub ProcesaClasificaciones(dt As DataTable, dTCuentasContables As DataTable) + Dim ObjClasificaciones As New ClsClasificaciones + Dim ObjConta As New ClsContabilidad(ObjClasificaciones.IniciaTransacSQL) + Dim ErrorProceso As Boolean = False + Dim Contador As Integer = 0 + + + For Each dRow As DataRow In dt.Rows + + + Dim Clasificacion As String = dRow("Clasificacion").ToString.Trim + Dim Categoria As String = dRow("Categoria").ToString.Trim + Dim UsoClasificacion As String = dRow("UsoClasificacion").ToString.Trim.ToUpper + Dim CuentaContableIngreso As String = dRow("CuentaContableIngreso").ToString.Trim + Dim CuentaContableGasto As String = dRow("CuentaContableGasto").ToString.Trim + + Dim CveClasificacion As Integer = -1 + Dim CveUsoClasificacion As Integer = -1 + Dim CveCategoria As Integer = -1 + + + CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", $" Categoria = '{Categoria}' ").ToEntero + + If Not CveCategoria > 0 Then + CveCategoria = GlobalDTGralCategorias(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveCategoria", "").ToEntero + If Not CveCategoria > 0 Then + Alert($"Clasificación {Clasificacion} la categoria {Categoria} no es valida.", TipoMensaje.MsgAdvertencia) + ErrorProceso = True + Exit For + End If + + End If + + + If UsoClasificacion = "INGRESOS" Then + CveUsoClasificacion = 1 + ElseIf UsoClasificacion = "GASTO" Then + CveUsoClasificacion = 2 + ElseIf UsoClasificacion = "INGRESOS/GASTO" Then + CveUsoClasificacion = 3 + End If + + If Not CveUsoClasificacion > 0 Then + Alert($"Clasificación {Clasificacion} el uso {UsoClasificacion} no es valido.", TipoMensaje.MsgAdvertencia) + ErrorProceso = True + Exit For + End If + + Dim CveCuentaContableIngreso As Integer = dTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContableIngreso}'").ToEntero + Dim CveCuentaContableGasto As Integer = dTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContableGasto}'").ToEntero + + If CuentaContableIngreso.Trim.Length > 0 AndAlso CveCuentaContableIngreso <= 0 Then + Alert($"Clasificación {Clasificacion} no se encontro la cuenta de ingreso {CuentaContableIngreso}.", TipoMensaje.MsgAdvertencia) + ErrorProceso = True + End If + + If CuentaContableGasto.Trim.Length > 0 AndAlso CveCuentaContableGasto <= 0 Then + Alert($"Clasificación {Clasificacion} no se encontro la cuenta de gasto {CuentaContableGasto}.", TipoMensaje.MsgAdvertencia) + ErrorProceso = True + End If + + + + If ObjClasificaciones.AddClasificaciones(Clasificacion, "", -1, "-1", -1, "-1", -1, "-1", CveCategoria, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, RequiereSerieLote:=0, UsoClasificacion:=CveUsoClasificacion, + CveSATPS:=-1, RequiereAFCompra:=False, RequiereAFInsumo:=False, RequierePersonal:=False, EsAcumulador:=False, TopVentas:=False, TopCompras:=False, PrecioBaseCosto:=-1) Then + + CveClasificacion = ObjClasificaciones.CveClasificacion + + If Not CveClasificacion > 0 Then + ErrorProceso = True + End If + Else + ErrorProceso = True + End If + + + + If Not ErrorProceso Then + + If CveCuentaContableIngreso > 0 Then + If Not AsignacionCuenta(ObjConta, 4, CveCuentaContableIngreso, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion) Then + ErrorProceso = True + Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia) + Exit For + End If + End If + + If CveCuentaContableGasto > 0 Then + If Not AsignacionCuenta(ObjConta, 6, CveCuentaContableGasto, -1, -1, -1, -1, UsuarioActual.CveEmpresa, CveClasificacion) Then + ErrorProceso = True + Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia) + Exit For + End If + End If + + End If + + + Contador = Contador + 1 + Next + + + If Not ErrorProceso Then + ObjClasificaciones.Commit() + Alert($"Se agregaron {Contador} Clasificaciones.") + Else + ObjClasificaciones.RollBack() + End If + + + ObjClasificaciones.Dispose() + + End Sub + Private Sub ProcesaBancos(DTBancos As DataTable, DTCuentasContables As DataTable) Dim ErrorProceso As Boolean = False @@ -2312,7 +2458,7 @@ Partial Class General_SaldosIniciales End If - If Not AsignacionCuenta(ObjConta, 30, CveCuentaContable, CveCuentaBancaria, -1, -1, -1, UsuarioActual.CveEmpresa) Then + If Not AsignacionCuenta(ObjConta, 30, CveCuentaContable, CveCuentaBancaria, -1, -1, -1, UsuarioActual.CveEmpresa, -1) Then ErrorProceso = True Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia) Exit For @@ -2445,7 +2591,7 @@ Partial Class General_SaldosIniciales End If - If Not AsignacionCuenta(ObjConta, 10, CveCuentaContable, -1, CveProveedor, -1, -1, UsuarioActual.CveEmpresa) Then + If Not AsignacionCuenta(ObjConta, 10, CveCuentaContable, -1, CveProveedor, -1, -1, UsuarioActual.CveEmpresa, -1) Then ErrorProceso = True Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia) Exit For @@ -2576,7 +2722,7 @@ Partial Class General_SaldosIniciales End If - If Not AsignacionCuenta(ObjConta, 66, CveCuentaContable, -1, -1, CveCliente, -1, UsuarioActual.CveEmpresa) Then + If Not AsignacionCuenta(ObjConta, 66, CveCuentaContable, -1, -1, CveCliente, -1, UsuarioActual.CveEmpresa, -1) Then ErrorProceso = True Alert("Se presento un error al guardar en asignaciones", TipoMensaje.MsgAdvertencia) Exit For @@ -2619,19 +2765,14 @@ Partial Class General_SaldosIniciales Private Function AsignacionCuenta(ObjContabilidad As ClsContabilidad, CveConceptoContable As Integer, CveCuentaContable As Integer, CveBancoCuenta As Integer, CveProveedor As Integer, CveCliente As Integer, - CvePersonal As Integer, CveEmpresa As Integer) As Boolean + CvePersonal As Integer, CveEmpresa As Integer, CveClasificacion As Integer) As Boolean Dim Respuesta As Boolean = False - 'If Not ObjConta.AddCuentasAsignaciones(28, UsuarioActual.CveEmpresa, CveCuentaContable, -1, - ' -1, -1, ObjRH.CvePersonal, -1, -1, 0, CveBancoCuenta:=-1, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1, - ' CveTipoGasto:=-1, RegeneraCuenta:=False) Then - ' ErrorRH = True - ' Exit For - 'End If + If ObjContabilidad.AddCuentasAsignaciones(CveConceptoContable, CveEmpresa, CveCuentaContable, -1, - CveProveedor, CveCliente, CvePersonal, -1, -1, 0, CveBancoCuenta:=CveBancoCuenta, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1, + CveProveedor, CveCliente, CvePersonal, CveClasificacion, -1, 0, CveBancoCuenta:=CveBancoCuenta, CveConceptoNomina:=-1, CveSubProyecto:=-1, CveActivoFijo:=-1, CveTipoGasto:=-1, RegeneraCuenta:=False) Then Respuesta = True End If @@ -2673,6 +2814,8 @@ Partial Class General_SaldosIniciales Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoAnticipoCliente.xlsx" ElseIf RblFormato.SelectedValue = "15" Then Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoBancos.xlsx" + ElseIf RblFormato.SelectedValue = "16" Then + Directorio = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\SaldosIniciales\FormatoClasificaciones.xlsx" End If If Not (Directorio = "") Then diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index 8e1a53863..94dcafa7c 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -2037,7 +2037,13 @@ Partial Class Inventarios_RecepcionUsados End Sub Private Sub CambiaCliente(Optional CargaSucursales As Boolean = True, Optional CargaFacturas As Boolean = True) If DdlClientes.SelectedValue.ToEntero > 0 Then - Me.EsDistribuidor = CBool(GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=DdlClientes.SelectedValue.ToEntero(), Estatus:=-1).FiltroPrimeroValor("EsDistribuidor", "")) + Dim strDistribuidor = GlobalDTCliente(UsuarioActual.CveEmpresa, CveCliente:=DdlClientes.SelectedValue.ToEntero(), Estatus:=-1).FiltroPrimeroValor("EsDistribuidor", "") + If String.IsNullOrEmpty(strDistribuidor) Then + strDistribuidor = "False" + End If + + Me.EsDistribuidor = CBool(strDistribuidor) + If CargaSucursales Then DivClienteSucursal.Visible = False DdlClientesSucursales.Items.Clear() diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 9765f9698..ef79851d5 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -1818,6 +1818,29 @@ Partial Class PV imgCalendario.Enabled = True End Sub Private Sub BtnPermisoEditarRemision_Click(sender As Object, e As EventArgs) Handles BtnPermisoEditarRemision.Click + Dim TieneInventario As Boolean = False + Dim TieneErrorInv As Boolean = False + + Using ObjInv As New ClsInventarios + If ObjInv.GetInv_Mov(Me.CveVenta, UsuarioActual.CveEmpresa) Then + If ObjInv.DtResultados.Rows.Count > 0 Then + TieneInventario = True + End If + Else + TieneErrorInv = True + End If + End Using + + If TieneInventario Then + Alert("La remisión no se puede editar porque ya tiene un movimiento de almacen.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If TieneErrorInv Then + Alert("No se pudo comprobar el inventario de la remisión", TipoMensaje.MsgError) + Exit Sub + End If + HabilitarEdicion() BtnPermisoEditarRemision.Visible = False BtnEditarRemision.Visible = True diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 55fd94f2b..31832ce40 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -18062,7 +18062,7 @@ Partial Class Ventas End Sub Private Sub CalculaLineasAdicionales() - If DdlTipoComprobante.SelectedValue = "Ing" AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" Then + If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(705) = "1" Then DdlLineaAdicional.DataSource = Nothing Using ObjVentas As New ClsVentas