Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -76,7 +76,7 @@
|
||||
<asp:HiddenField ID="HiddenField2" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<div>
|
||||
<asp:GridView ID="GvDatos" runat="server" data-sort="true" AutoGenerateColumns="False"
|
||||
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">
|
||||
DataKeyNames="CveClasificacion, CveCategoria, Clasificacion, UsoClasificacion, CuentaGasto, CuentaCostos, CuentaIngresos, IdCuentaGasto, IdCuentaCostos, IdCuentaIngresos,RequiereSerieLote,CveSATPS,SATClaveProductoServicio, RequiereAFCompra, RequiereAFInsumo, RequierePersonal, Estatus,EsAcumulador,TopVentas,TopCompras,PrecioBaseCosto,CveCuentaAsignacionGasto" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Clasificación">
|
||||
<ItemTemplate>
|
||||
@@ -173,13 +173,10 @@
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Editar" ItemStyle-HorizontalAlign="Center">
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" OnClick="ActualizaClasificacion" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="80" />
|
||||
@@ -230,6 +227,7 @@
|
||||
|
||||
|
||||
<div class="form-group input-iconright" id="DivCuentaGasto" runat="server">
|
||||
<asp:HiddenField ID="HdnCveCuentaAsignacion" runat="server" />
|
||||
<label for="<%= DdlCuentaGasto.ClientID.ToString()%>" style="color: #888888; font-size: 13px;">Cuenta Gasto:</label>
|
||||
<asp:DropDownList ID="DdlCuentaGasto" CssClass="form-control input-sm js-cuenta-programmatic" runat="server" AppendDataBoundItems="true" DataTextField="CtaCodigo" DataValueField="Id" Width="340px"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
@@ -145,8 +145,8 @@ Partial Class CatClasificaciones
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If ObjClasificaciones.GetClasificaciones() 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)")
|
||||
If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
|
||||
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') 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)")
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
@@ -154,24 +154,10 @@ Partial Class CatClasificaciones
|
||||
CargaGrid()
|
||||
End Sub
|
||||
|
||||
'Public Sub CargaGlobal()
|
||||
|
||||
' Dim ObjClasificaciones As New ClsClasificaciones
|
||||
|
||||
' If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) 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)")
|
||||
' GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
|
||||
' Else
|
||||
' Me.GvDatos.DataSource = Nothing
|
||||
' Alert("Ocurrió un error al cargar las clasificaciones. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
' End If
|
||||
|
||||
' ObjClasificaciones.Dispose()
|
||||
'End Sub
|
||||
|
||||
|
||||
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
Dim objConta As New ClsContabilidad(ObjClasificaciones.IniciaTransacSQL)
|
||||
Dim RequireSerieLote As Integer = If(ChkRequiereSerieLote.Checked, 1, 0)
|
||||
|
||||
If HdnModalidadClasificacion.Value = "A" Then
|
||||
@@ -183,7 +169,11 @@ Partial Class CatClasificaciones
|
||||
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)")
|
||||
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
|
||||
If DdlCuentaGasto.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(6, UsuarioActual.CveEmpresa, DdlCuentaGasto.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion)
|
||||
If DdlCuentaCostos.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(69, UsuarioActual.CveEmpresa, DdlCuentaCostos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion)
|
||||
If DdlCuentaIngresos.SelectedValue.ToEntero > 0 Then objConta.AddCuentasAsignaciones(4, UsuarioActual.CveEmpresa, DdlCuentaIngresos.SelectedValue.ToEntero, CveClasificacion:=ObjClasificaciones.CveClasificacion)
|
||||
End If
|
||||
TxtClasificacion.Text = ""
|
||||
TxtPrecioBaseCosto.Text = ""
|
||||
DdlCuentaGasto.SelectedValueExist("0")
|
||||
@@ -206,11 +196,18 @@ Partial Class CatClasificaciones
|
||||
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, PrecioBaseCosto:=TxtPrecioBaseCosto.Text.ToDecimal) Then
|
||||
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
|
||||
If DdlCuentaGasto.SelectedValue.ToEntero > 0 Then objConta.UpdateCuentasAsignaciones(HdnCveCuentaAsignacion.Value.ToEntero, 6, DdlCuentaGasto.SelectedValue.ToEntero, CveClasificacion:=CveClasificacion)
|
||||
|
||||
End If
|
||||
|
||||
ObjClasificaciones.Commit()
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalClasificaciones"))
|
||||
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
|
||||
|
||||
Else
|
||||
Alert("Ocurrió un error al actualizar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
ObjClasificaciones.RollBack()
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -236,7 +233,7 @@ Partial Class CatClasificaciones
|
||||
DtCuentasContables.Columns("CtaCodigo").ColumnName = "Cuenta"
|
||||
End If
|
||||
ObjContabilidad.Dispose()
|
||||
ElseIf UsuarioActual.Empresa.TipoContabilizacion = 1 Then
|
||||
ElseIf UsuarioActual.Empresa.TipoContabilidad = 1 Then
|
||||
|
||||
Dim ObjEmpresa As New ClsSisEmpresas
|
||||
Dim Empresa As Empresa = Nothing
|
||||
@@ -249,11 +246,8 @@ Partial Class CatClasificaciones
|
||||
ObjContabilidad.Dispose()
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click
|
||||
@@ -421,6 +415,7 @@ Partial Class CatClasificaciones
|
||||
ChkRequiereAFCompra.Checked = If(GvRow.DataKey("RequiereAFCompra") = "True", True, False)
|
||||
ChkRequiereAFInsumo.Checked = If(GvRow.DataKey("RequiereAFInsumo") = "True", True, False)
|
||||
ChkRequierePersonal.Checked = If(GvRow.DataKey("RequierePersonal") = "True", True, False)
|
||||
HdnCveCuentaAsignacion.Value = GvRow.DataKey("CveCuentaAsignacionGasto")
|
||||
|
||||
If CuentaGasto.Length > 1 And CargaGastos Then
|
||||
DdlCuentaGasto.Items.Insert(0, New ListItem(CuentaGasto, CveCuentaGastoActual.ToString))
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
@@ -2663,9 +2664,13 @@ Partial Class Clientes
|
||||
ObjContaAC.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
Dim CodigoCuentaAltaCompaq As String = ""
|
||||
Dim NombreCuentaCuentaAltaCompaq As String = ""
|
||||
Dim IdCuentaAltaCompaq As Integer = -1
|
||||
'Si tiene contabilizacion automatica y la funcionalidad de carga cuenta automatica o UsaAC le agregamos automaticamente una cuenta al cliente
|
||||
If UsuarioActual.Empresa.Funcionalidad(211).ToEntero() > 0 AndAlso (UsuarioActual.Empresa.Funcionalidad(200).ToEntero() > 0 Or UsuarioActual.Empresa.UsaAC) AndAlso DdlCtaContableClientes.SelectedValue.ToEntero() < 1 Then
|
||||
If Not AgregarCuentaContable(BtnActivaRegistroClientes, DdlCtaContableClientes) Then
|
||||
If Not AgregarCuentaContable(BtnActivaRegistroClientes, DdlCtaContableClientes, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
End If
|
||||
@@ -2745,6 +2750,10 @@ Partial Class Clientes
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, ObjClientes.IniciaTransacSQL) Then
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
|
||||
If ErrorProceso Then
|
||||
ObjClientes.RollBack()
|
||||
@@ -3836,18 +3845,18 @@ Partial Class Clientes
|
||||
Dim Button = DirectCast(sender, Button)
|
||||
Select Case CuentaContable
|
||||
Case "Clientes"
|
||||
AgregarCuentaContable(Button, DdlCtaContableClientes)
|
||||
AgregarCuentaContable(Button, DdlCtaContableClientes, "", "", -1)
|
||||
Case "Anticipos"
|
||||
AgregarCuentaContable(Button, DdlCtaContableAnticipos)
|
||||
AgregarCuentaContable(Button, DdlCtaContableAnticipos, "", "", -1)
|
||||
Case "RetIVA"
|
||||
AgregarCuentaContable(Button, DdlCtaContableRetIVA)
|
||||
AgregarCuentaContable(Button, DdlCtaContableRetIVA, "", "", -1)
|
||||
Case "RetISR"
|
||||
AgregarCuentaContable(Button, DdlCtaContableRetISR)
|
||||
AgregarCuentaContable(Button, DdlCtaContableRetISR, "", "", -1)
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function AgregarCuentaContable(btn As Button, ddl As DropDownList) As Boolean
|
||||
Private Function AgregarCuentaContable(btn As Button, ddl As DropDownList, ByRef CodigoCuentaAltaCompaq As String, ByRef NombreCuentaCuentaAltaCompaq As String, ByRef IdCuentaAltaCompaq As Integer) As Boolean
|
||||
Dim IdCuentaContable As Integer = -1
|
||||
Dim CtaCodigo As String = ""
|
||||
Dim TieneError = False
|
||||
@@ -3856,6 +3865,8 @@ Partial Class Clientes
|
||||
|
||||
Dim ObjContaAC As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
|
||||
|
||||
|
||||
ObjContaAC.IniciaTransacSQL()
|
||||
|
||||
Dim CuentaPadre = -1
|
||||
@@ -3875,7 +3886,13 @@ Partial Class Clientes
|
||||
'SI EL NOMBRE DEL PROVEEDOR ES MAYOR DE 50 LO CORTAMOS
|
||||
Dim NombreCuenta = If(TxtNombreComercial.Text.Trim.Length > 50, TxtNombreComercial.Text.Trim.Substring(0, 50), TxtNombreComercial.Text.Trim)
|
||||
|
||||
|
||||
|
||||
IdCuentaContable = ObjContaAC.AddSiguienteCuentaHijo(CuentaPadre, NombreCuenta, Tipo:="A", CuentaMayor:=2)
|
||||
|
||||
NombreCuentaCuentaAltaCompaq = NombreCuenta
|
||||
IdCuentaAltaCompaq = IdCuentaContable
|
||||
|
||||
If IdCuentaContable > 0 Then
|
||||
|
||||
ObjContaAC.GetCuentas(IdCuentaContable, "-1", -1)
|
||||
@@ -3884,7 +3901,9 @@ Partial Class Clientes
|
||||
If dt.Rows.Count = 1 Then
|
||||
|
||||
Dim row As DataRow = dt.Rows(0)
|
||||
|
||||
CtaCodigo = CStr(row("CtaCodigo"))
|
||||
CodigoCuentaAltaCompaq = CStr(row("Codigo"))
|
||||
|
||||
Select Case btn.CommandArgument.ToString()
|
||||
Case "Clientes"
|
||||
@@ -3906,8 +3925,6 @@ Partial Class Clientes
|
||||
ObjClientes.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
@@ -3916,6 +3933,9 @@ Partial Class Clientes
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
ObjContaAC.Commit()
|
||||
Alert(String.Format("Se registo la Cuenta Contable: {0}", CtaCodigo, TipoMensaje.MsgInformacion))
|
||||
@@ -3937,6 +3957,35 @@ Partial Class Clientes
|
||||
Return ProcesoCorrecto
|
||||
End Function
|
||||
|
||||
Private Function AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq As String, NombreCuentaCuentaAltaCompaq As String, IdCuentaAltaCompaq As Integer, Transaccion As SqlTransaction) As Boolean
|
||||
|
||||
Dim ObjContabilidad As New ClsContabilidad(Transaccion)
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(7, 11, 145, 122) Then
|
||||
|
||||
|
||||
If ObjContabilidad.GetCuentasGlobales(UsuarioActual.CveEmpresa, 1) Then
|
||||
Dim CvePadre As Integer = ObjContabilidad.DtResultados.FiltroPrimeroValor("CveCuenta").ToEntero
|
||||
If CvePadre > 0 Then
|
||||
|
||||
Dim CvecuentaNueva As Integer = ObjContabilidad.AddCuenta(CvePadre, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, "A", 2, 1, CveCliente:=CveCliente, IdCompaq:=IdCuentaAltaCompaq)
|
||||
|
||||
If CvecuentaNueva > 0 Then
|
||||
If ObjContabilidad.AddCuentasAsignaciones(1, UsuarioActual.CveEmpresa, CvecuentaNueva, CveCliente:=CveCliente) Then
|
||||
Respuesta = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
End Function
|
||||
|
||||
Private Sub ActivarRegistroAutomatico()
|
||||
|
||||
'Clientes
|
||||
@@ -4809,6 +4858,7 @@ Partial Class Clientes
|
||||
|
||||
#Region "Cuentas/Equipos"
|
||||
Public Sub BtnAgregarCtaEquipo_Click(sender As Object, e As EventArgs)
|
||||
|
||||
HdnModalidad.Value = "I"
|
||||
DivCicloComercial.Visible = False
|
||||
TxtIdentificador.Text = ""
|
||||
|
||||
@@ -2514,7 +2514,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
End If
|
||||
|
||||
|
||||
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), PorcentajeImpuesto:=gr.DataKey("PorcetajeIVA").ToDecimal, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), PorcentajeImpuesto:=gr.DataKey("PorcentajeIVA").ToDecimal, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user