Sistema/Empresa : Fix Guardar Empresa
-CAMBIOS EN BD: PA_Sis_EmpresasGet en SIG_Resp_MLR y Ventas Faltaba un Case en WHERE Un INNER a LEFT JOIN
This commit is contained in:
@@ -77,6 +77,9 @@ Partial Class Sistemas_Empresa
|
|||||||
End Property
|
End Property
|
||||||
Public Property DtClasificacionIVA As DataTable
|
Public Property DtClasificacionIVA As DataTable
|
||||||
Get
|
Get
|
||||||
|
If ViewState("DtClasificacionIVA") Is Nothing Then
|
||||||
|
ViewState("DtClasificacionIVA") = New DataTable
|
||||||
|
End If
|
||||||
Return CType((ViewState("DtClasificacionIVA")), DataTable)
|
Return CType((ViewState("DtClasificacionIVA")), DataTable)
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
@@ -150,7 +153,6 @@ Partial Class Sistemas_Empresa
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
|
|
||||||
@@ -162,7 +164,6 @@ Partial Class Sistemas_Empresa
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
CargaDdlPac()
|
CargaDdlPac()
|
||||||
@@ -204,8 +205,6 @@ Partial Class Sistemas_Empresa
|
|||||||
TxtPlantillaVenta.Text = UsuarioActual.Empresa.PlantillaMailVenta
|
TxtPlantillaVenta.Text = UsuarioActual.Empresa.PlantillaMailVenta
|
||||||
TxtAsunto.Text = UsuarioActual.Empresa.AsuntoPlantillaMailVenta
|
TxtAsunto.Text = UsuarioActual.Empresa.AsuntoPlantillaMailVenta
|
||||||
|
|
||||||
InicializaClasificacionIVA()
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
'Configuración de Modalidad Insert
|
'Configuración de Modalidad Insert
|
||||||
ViewState("CveEmpresa") = -1
|
ViewState("CveEmpresa") = -1
|
||||||
@@ -215,9 +214,6 @@ Partial Class Sistemas_Empresa
|
|||||||
End If
|
End If
|
||||||
ConfiguracionEmpresa()
|
ConfiguracionEmpresa()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -235,8 +231,6 @@ Partial Class Sistemas_Empresa
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub CargaDatos()
|
Private Sub CargaDatos()
|
||||||
|
|
||||||
Dim ObjEmpresas As New ClsSisEmpresas()
|
Dim ObjEmpresas As New ClsSisEmpresas()
|
||||||
@@ -346,7 +340,6 @@ Partial Class Sistemas_Empresa
|
|||||||
CargaCuentasContables()
|
CargaCuentasContables()
|
||||||
CargaDDLs()
|
CargaDDLs()
|
||||||
|
|
||||||
|
|
||||||
Dim Row As DataRow
|
Dim Row As DataRow
|
||||||
Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxAcreditar.ToString))
|
Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxAcreditar.ToString))
|
||||||
If Not IsNothing(Row) Then
|
If Not IsNothing(Row) Then
|
||||||
@@ -455,7 +448,6 @@ Partial Class Sistemas_Empresa
|
|||||||
CargaFuncionalidad(215, DdlFyE)
|
CargaFuncionalidad(215, DdlFyE)
|
||||||
CargaFuncionalidad(221, DdlActivoFijo)
|
CargaFuncionalidad(221, DdlActivoFijo)
|
||||||
|
|
||||||
|
|
||||||
'CargaFuncionalidad(232, DdlProveedoresSIG)
|
'CargaFuncionalidad(232, DdlProveedoresSIG)
|
||||||
'CargaFuncionalidad(233, DdlClientesSIG)
|
'CargaFuncionalidad(233, DdlClientesSIG)
|
||||||
'CargaFuncionalidad(234, DdlDeudoresSIG)
|
'CargaFuncionalidad(234, DdlDeudoresSIG)
|
||||||
@@ -482,7 +474,7 @@ Partial Class Sistemas_Empresa
|
|||||||
|
|
||||||
Session("FileUpload") = .ArchivoPfx
|
Session("FileUpload") = .ArchivoPfx
|
||||||
End With
|
End With
|
||||||
|
InicializaClasificacionIVA(ObjEmpresas)
|
||||||
Else
|
Else
|
||||||
Alert("La Empresa Solicitada no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
Alert("La Empresa Solicitada no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
|
||||||
BtnGuardar.Enabled = False
|
BtnGuardar.Enabled = False
|
||||||
@@ -560,7 +552,7 @@ Partial Class Sistemas_Empresa
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
ViewState("CveEmpresa") = ObjEmpresas.CveEmpresa
|
ViewState("CveEmpresa") = ObjEmpresas.CveEmpresa
|
||||||
InicializaClasificacionIVA()
|
'InicializaClasificacionIVA(ObjEmpresas)
|
||||||
TextoOK = "La nueva Empresa se guardó correctamente."
|
TextoOK = "La nueva Empresa se guardó correctamente."
|
||||||
Else
|
Else
|
||||||
TextoError = "Ocurrió un error al agregar la empresa"
|
TextoError = "Ocurrió un error al agregar la empresa"
|
||||||
@@ -638,30 +630,32 @@ Partial Class Sistemas_Empresa
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
'CLASIFICACIONES DE IVAS
|
'CLASIFICACIONES DE IVAS
|
||||||
For Each Dr As DataRow In DtClasificacionIVA.Rows
|
If DtClasificacionIVA IsNot Nothing OrElse DtClasificacionIVA.Rows.Count > 0 Then
|
||||||
If Not Dr("CveClasificacion").ToString.ToEntero > 0 Then
|
For Each Dr As DataRow In DtClasificacionIVA.Rows
|
||||||
If Not ObjGral.RemoveClasificacionPorcentaje(Dr("CveClasificacionPorcentaje").ToString.ToEntero) Then
|
If Not Dr("CveClasificacion").ToString.ToEntero > 0 Then
|
||||||
TextoError = "Ocurrió un error al guardar los cambios de la empresa"
|
If Not ObjGral.RemoveClasificacionPorcentaje(Dr("CveClasificacionPorcentaje").ToString.ToEntero) Then
|
||||||
End If
|
TextoError = "Ocurrió un error al guardar los cambios de la empresa"
|
||||||
ElseIf Dr("CveClasificacionPorcentaje").ToString.ToEntero = 0 Then
|
End If
|
||||||
If Not ObjGral.AddClasificacionPorcentaje(Dr("CveClasificacion").ToString.ToEntero, Dr("PorcentajeIVA").ToString.ToDouble,
|
ElseIf Dr("CveClasificacionPorcentaje").ToString.ToEntero = 0 Then
|
||||||
|
If Not ObjGral.AddClasificacionPorcentaje(Dr("CveClasificacion").ToString.ToEntero, Dr("PorcentajeIVA").ToString.ToDouble,
|
||||||
Dr("IdCtaIVAXAcreditar").ToString.ToEntero, Dr("IdCtaIVAAcreditable").ToString.ToEntero,
|
Dr("IdCtaIVAXAcreditar").ToString.ToEntero, Dr("IdCtaIVAAcreditable").ToString.ToEntero,
|
||||||
Dr("IdCtaIVAXTrasladar").ToString.ToEntero, Dr("IdCtaIVATrasladado").ToString.ToEntero, CveEmpresa) Then
|
Dr("IdCtaIVAXTrasladar").ToString.ToEntero, Dr("IdCtaIVATrasladado").ToString.ToEntero, CveEmpresa) Then
|
||||||
TextoError = "Ocurrió un error al guardar los cambios de la empresa"
|
TextoError = "Ocurrió un error al guardar los cambios de la empresa"
|
||||||
End If
|
End If
|
||||||
ElseIf Dr("CveClasificacionPorcentaje").ToString.ToEntero > 0 Then
|
ElseIf Dr("CveClasificacionPorcentaje").ToString.ToEntero > 0 Then
|
||||||
If Not ObjGral.UpdateClasificacionPorcentaje(Dr("CveClasificacionPorcentaje").ToString.ToEntero, Dr("CveClasificacion").ToString.ToEntero, Dr("PorcentajeIVA").ToString.ToDouble,
|
If Not ObjGral.UpdateClasificacionPorcentaje(Dr("CveClasificacionPorcentaje").ToString.ToEntero, Dr("CveClasificacion").ToString.ToEntero, Dr("PorcentajeIVA").ToString.ToDouble,
|
||||||
Dr("IdCtaIVAXAcreditar").ToString.ToEntero, Dr("IdCtaIVAAcreditable").ToString.ToEntero,
|
Dr("IdCtaIVAXAcreditar").ToString.ToEntero, Dr("IdCtaIVAAcreditable").ToString.ToEntero,
|
||||||
Dr("IdCtaIVAXTrasladar").ToString.ToEntero, Dr("IdCtaIVATrasladado").ToString.ToEntero) Then
|
Dr("IdCtaIVAXTrasladar").ToString.ToEntero, Dr("IdCtaIVATrasladado").ToString.ToEntero) Then
|
||||||
TextoError = "Ocurrió un error al guardar los cambios de la empresa"
|
TextoError = "Ocurrió un error al guardar los cambios de la empresa"
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
Next
|
||||||
Next
|
End If
|
||||||
|
|
||||||
'RECARGA GLOBAL
|
'RECARGA EMPRESA
|
||||||
If TextoError = "" Then
|
If TextoError = "" Then
|
||||||
If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
|
If ObjEmpresas.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
GlobalDTEmpresas = ObjEmpresas.DtResultados
|
GlobalDTEmpresas(CveEmpresa) = ObjEmpresas.DtResultados
|
||||||
|
|
||||||
'verifico si existe la carpeta de la empresa, sino la crea
|
'verifico si existe la carpeta de la empresa, sino la crea
|
||||||
For Each dr As Data.DataRow In ObjEmpresas.DtResultados.Rows
|
For Each dr As Data.DataRow In ObjEmpresas.DtResultados.Rows
|
||||||
@@ -671,12 +665,11 @@ Partial Class Sistemas_Empresa
|
|||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjGral.GetClasificacionPorcentaje(-1) Then
|
If ObjGral.GetClasificacionPorcentaje(CveEmpresa) Then
|
||||||
GlobalDTClasificacionPorcentaje(-1) = ObjGral.DtResultados
|
GlobalDTClasificacionPorcentaje(CveEmpresa) = ObjGral.DtResultados
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
'AGREGAR FUNCIONALIDADES
|
'AGREGAR FUNCIONALIDADES
|
||||||
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 201, DdlProveedores)
|
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 201, DdlProveedores)
|
||||||
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 211, DdlClientes)
|
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 211, DdlClientes)
|
||||||
@@ -691,7 +684,6 @@ Partial Class Sistemas_Empresa
|
|||||||
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 218, DdlCaja)
|
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 218, DdlCaja)
|
||||||
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 215, DdlFyE)
|
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 215, DdlFyE)
|
||||||
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 221, DdlActivoFijo)
|
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 221, DdlActivoFijo)
|
||||||
|
|
||||||
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 246, DdlClientes)
|
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 246, DdlClientes)
|
||||||
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 237, DdlAnticipoCliente)
|
If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 237, DdlAnticipoCliente)
|
||||||
|
|
||||||
@@ -710,7 +702,6 @@ Partial Class Sistemas_Empresa
|
|||||||
'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 243, DdlFyESIG)
|
'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 243, DdlFyESIG)
|
||||||
'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 244, DdlActivoFijoSIG)
|
'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 244, DdlActivoFijoSIG)
|
||||||
|
|
||||||
|
|
||||||
'TRIGGER
|
'TRIGGER
|
||||||
If TextoError = "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" Then
|
If TextoError = "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" Then
|
||||||
|
|
||||||
@@ -743,10 +734,8 @@ Partial Class Sistemas_Empresa
|
|||||||
Else
|
Else
|
||||||
Alert("La empresa tiene la información para el uso de contabilidad pero no se tiene activada", TipoMensaje.MsgAdvertencia)
|
Alert("La empresa tiene la información para el uso de contabilidad pero no se tiene activada", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If TextoError = "" Then
|
If TextoError = "" Then
|
||||||
ObjEmpresas.Commit()
|
ObjEmpresas.Commit()
|
||||||
If ObjContPAQ IsNot Nothing Then ObjContPAQ.Commit()
|
If ObjContPAQ IsNot Nothing Then ObjContPAQ.Commit()
|
||||||
@@ -777,8 +766,7 @@ Partial Class Sistemas_Empresa
|
|||||||
Dim ObjEmpresas As New ClsSisEmpresas
|
Dim ObjEmpresas As New ClsSisEmpresas
|
||||||
If ObjEmpresas.RemoveEmpresa(CveEmpresa) Then
|
If ObjEmpresas.RemoveEmpresa(CveEmpresa) Then
|
||||||
GlobalDTEmpresas = ObjEmpresas.DtResultados
|
GlobalDTEmpresas = ObjEmpresas.DtResultados
|
||||||
|
Alert("La Empresa se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Sistemas/Empresa.aspx"";")
|
||||||
Alert("La Empresa se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Sistemas/Empresas.aspx"";")
|
|
||||||
End If
|
End If
|
||||||
ObjEmpresas.Dispose()
|
ObjEmpresas.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -802,9 +790,6 @@ Partial Class Sistemas_Empresa
|
|||||||
End If
|
End If
|
||||||
ObjEmpresa.Dispose()
|
ObjEmpresa.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaCuentasContablesSIG(Optional IdCuentaPadre As Integer = -1)
|
Private Sub CargaCuentasContablesSIG(Optional IdCuentaPadre As Integer = -1)
|
||||||
@@ -950,9 +935,6 @@ Partial Class Sistemas_Empresa
|
|||||||
DdlCuentaPerdidaCambiaria.DataSource = DtCuentasContables : DdlCuentaPerdidaCambiaria.DataBind() : DdlCuentaPerdidaCambiaria.SelectedValue = Seleccionado
|
DdlCuentaPerdidaCambiaria.DataSource = DtCuentasContables : DdlCuentaPerdidaCambiaria.DataBind() : DdlCuentaPerdidaCambiaria.SelectedValue = Seleccionado
|
||||||
DdlCuentaPerdidaCambiaria.AutoPostBack = False : DdlCuentaPerdidaCambiaria.Attributes.Remove("onclick") : DdlCuentaPerdidaCambiaria.CssClass &= " select2me"
|
DdlCuentaPerdidaCambiaria.AutoPostBack = False : DdlCuentaPerdidaCambiaria.Attributes.Remove("onclick") : DdlCuentaPerdidaCambiaria.CssClass &= " select2me"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'CUENTAS PADRES
|
'CUENTAS PADRES
|
||||||
|
|
||||||
Case "21"
|
Case "21"
|
||||||
@@ -1172,8 +1154,6 @@ Partial Class Sistemas_Empresa
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Public Sub CargaDDLs()
|
Public Sub CargaDDLs()
|
||||||
|
|
||||||
|
|
||||||
DdlIVAxAcreditar.AutoPostBack = True
|
DdlIVAxAcreditar.AutoPostBack = True
|
||||||
DdlIVAAcreditable.AutoPostBack = True
|
DdlIVAAcreditable.AutoPostBack = True
|
||||||
DdlIVAxTrasladar.AutoPostBack = True
|
DdlIVAxTrasladar.AutoPostBack = True
|
||||||
@@ -1390,9 +1370,9 @@ Partial Class Sistemas_Empresa
|
|||||||
Next
|
Next
|
||||||
DtClasificacionIVA.AcceptChanges()
|
DtClasificacionIVA.AcceptChanges()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub InicializaClasificacionIVA()
|
Private Sub InicializaClasificacionIVA(ObjEmpresas As ClsSisEmpresas)
|
||||||
CreaDtClasificacionIVA()
|
CreaDtClasificacionIVA()
|
||||||
CargaCuentasIVA()
|
CargaCuentasIVA(ObjEmpresas)
|
||||||
CargaClasificaciones()
|
CargaClasificaciones()
|
||||||
CargaClasificacionesIVA()
|
CargaClasificacionesIVA()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1427,21 +1407,20 @@ Partial Class Sistemas_Empresa
|
|||||||
DtClasificacionIVA.Columns.Add("CuentaTrasladado", GetType(String))
|
DtClasificacionIVA.Columns.Add("CuentaTrasladado", GetType(String))
|
||||||
DtClasificacionIVA.Columns.Add("IdCtaIVATrasladado", GetType(Integer))
|
DtClasificacionIVA.Columns.Add("IdCtaIVATrasladado", GetType(Integer))
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaCuentasIVA()
|
Private Sub CargaCuentasIVA(ByRef ObjEmpresas As ClsSisEmpresas)
|
||||||
|
|
||||||
Dim ObjEmpresas As New ClsSisEmpresas()
|
|
||||||
If ObjEmpresas.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then
|
If ObjEmpresas.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
If ObjEmpresas.Empresa.UsaContabilidad Then
|
If ObjEmpresas.Empresa.UsaContabilidad Then
|
||||||
|
|
||||||
'If ObjEmpresas.Empresa.TipoContabilidad = 2 Then
|
'If ObjEmpresas.Empresa.TipoContabilidad = 2 Then
|
||||||
Dim Cuenta As New ClsContPAQi(ObjEmpresas.Empresa)
|
Dim Cuenta As New ClsContPAQi(ObjEmpresas.Empresa)
|
||||||
If Cuenta.GetCuentas(-1, "-1", -1) Then
|
If Cuenta.GetCuentas(-1, "-1", -1) Then
|
||||||
DtCuentas = Cuenta.DtResultados
|
DtCuentas = Cuenta.DtResultados
|
||||||
End If
|
End If
|
||||||
Cuenta.Dispose()
|
Cuenta.Dispose()
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
Try
|
Try
|
||||||
DdlIVAXAcreditarModal.DataSource = DtCuentas : DdlIVAXAcreditarModal.DataBind()
|
DdlIVAXAcreditarModal.DataSource = DtCuentas : DdlIVAXAcreditarModal.DataBind()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
End Try
|
End Try
|
||||||
@@ -1460,7 +1439,7 @@ Partial Class Sistemas_Empresa
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjEmpresas.Dispose()
|
'ObjEmpresas.Dispose()
|
||||||
DdlIVAXAcreditarModal.Items.Insert(0, New ListItem("-", "-1"))
|
DdlIVAXAcreditarModal.Items.Insert(0, New ListItem("-", "-1"))
|
||||||
DdlIVAAcreditableModal.Items.Insert(0, New ListItem("-", "-1"))
|
DdlIVAAcreditableModal.Items.Insert(0, New ListItem("-", "-1"))
|
||||||
DdlIVAXTrasladarModal.Items.Insert(0, New ListItem("-", "-1"))
|
DdlIVAXTrasladarModal.Items.Insert(0, New ListItem("-", "-1"))
|
||||||
|
|||||||
Reference in New Issue
Block a user