Clientes add cuenta sig, recibo de pago emd
This commit is contained in:
@@ -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,33 @@ 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
|
||||
If ObjContabilidad.AddCuenta(CvePadre, CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, "A", 2, 1, CveCliente:=CveCliente, IdCompaq:=IdCuentaAltaCompaq) > 0 Then
|
||||
Respuesta = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'If ObjContabilidad.GetCuentasAsignacionesSistema(UsuarioActual.CveEmpresa, 7, -1, 1) Then
|
||||
|
||||
|
||||
'End If
|
||||
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
End Function
|
||||
|
||||
Private Sub ActivarRegistroAutomatico()
|
||||
|
||||
'Clientes
|
||||
|
||||
@@ -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