diff --git a/App_Code/ClsClasificaciones.vb b/App_Code/ClsClasificaciones.vb index acbf3ef8c..3c8597b3a 100644 --- a/App_Code/ClsClasificaciones.vb +++ b/App_Code/ClsClasificaciones.vb @@ -339,19 +339,19 @@ Public Class ClsClasificaciones With SqlAdapter.SelectCommand.Parameters .Add("@Clasificacion", SqlDbType.VarChar).Value = Clasificacion.Clasificacion .Add("@Codigo", SqlDbType.VarChar).Value = Clasificacion.Codigo - .Add("@IdCuentaGasto", SqlDbType.Int).Value = Clasificacion.IdCuentaGasto - .Add("@IdCuentaCostos", SqlDbType.Int).Value = Clasificacion.IdCuentaCostos + '.Add("@IdCuentaGasto", SqlDbType.Int).Value = Clasificacion.IdCuentaGasto + '.Add("@IdCuentaCostos", SqlDbType.Int).Value = Clasificacion.IdCuentaCostos '.Add("@IdCuentaInventario", SqlDbType.Int).Value = IdCuentaInventario - .Add("@CuentaGasto", SqlDbType.VarChar).Value = Clasificacion.CuentaGasto - .Add("@CuentaCostos", SqlDbType.VarChar).Value = Clasificacion.CuentaCostos + '.Add("@CuentaGasto", SqlDbType.VarChar).Value = Clasificacion.CuentaGasto + '.Add("@CuentaCostos", SqlDbType.VarChar).Value = Clasificacion.CuentaCostos ' .Add("@CuentaInventario", SqlDbType.VarChar).Value = CuentaInventario .Add("@CveCategoria", SqlDbType.Int).Value = Clasificacion.CveCategoria .Add("@CveEmpresa", SqlDbType.Int).Value = Clasificacion.CveEmpresa .Add("@CveUsuario", SqlDbType.Int).Value = Clasificacion.CveUsuario 'Nuevo 10/06/2016 - .Add("@IdCuentaIngresos", SqlDbType.Int).Value = Clasificacion.IdCuentaIngresos - .Add("@CuentaIngresos", SqlDbType.VarChar).Value = Clasificacion.CuentaIngresos + '.Add("@IdCuentaIngresos", SqlDbType.Int).Value = Clasificacion.IdCuentaIngresos + '.Add("@CuentaIngresos", SqlDbType.VarChar).Value = Clasificacion.CuentaIngresos .Add("@RequiereSerieLote", SqlDbType.Int).Value = -1 .Add("@UsoClasificacion", SqlDbType.Int).Value = Clasificacion.UsoClasificacion diff --git a/App_Code/ClsCompProveedores.vb b/App_Code/ClsCompProveedores.vb index 7a990616c..df3a94b11 100644 --- a/App_Code/ClsCompProveedores.vb +++ b/App_Code/ClsCompProveedores.vb @@ -535,30 +535,7 @@ Public Class ClsCompProveedores Return Retorno End Function - Public Function UpdateProveedorIdCuentaAC(CveProveedor As Integer, IdCtaAC As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Comp_ProveedorUpdateCuentaAC") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - .Add("@IdCtaAC", SqlDbType.VarChar).Value = IdCtaAC - End With - - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch Ex1 As SqlException - If Ex1.Message.Contains("Número: 547;") Then - Alert("El Proveedor no se pudo Actualizar por que está siendo utilizado por un registro", TipoMensaje.MsgAdvertencia) - Else - Me.OnError("Ocurrió un error al Actualizar el Proveedor.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End If - Catch ex As Exception - OnError("Ocurrió un error al Actualizar el Proveedor.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - End Try - - Return Retorno - End Function Public Function UpdateProveedorNotificarA(CveProveedor As Integer, NotificarA As String) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Comp_ProveedorUpdateNotificarA") @@ -685,117 +662,6 @@ Public Class ClsCompProveedores #End Region - '#Region "P R O V E E D O R E S - C U E N T A S" - ' Public Function GetProveedoresCuentas() As Boolean - ' Dim Retorno As Boolean = False - ' DataAdapter("PA_Comp_ProveedoresCuentasGet") - ' Try - ' SqlAdapter.Fill(Data) - ' Retorno = True - ' Catch ex As Exception - ' OnError("Ocurrió un error al obtener el Catálogo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End Try - - ' Return Retorno - ' End Function - ' Public Function AddProveedoresCuentas(CveProveedor As Integer, BancoNombre As String, Plaza As String, Sucursal As String, Cuenta As String, CLABE As String, CIE As String, SWIFT As String, Referencia As String, CveUsuario As Integer) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_Comp_ProveedoresCuentasAdd") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - ' .Add("@BancoNombre", SqlDbType.VarChar).Value = BancoNombre - ' .Add("@Plaza", SqlDbType.VarChar).Value = Plaza - ' .Add("@Sucursal", SqlDbType.VarChar).Value = Sucursal - ' .Add("@Cuenta", SqlDbType.VarChar).Value = Cuenta - ' .Add("@CLABE", SqlDbType.VarChar).Value = CLABE - ' .Add("@CIE", SqlDbType.VarChar).Value = CIE - ' .Add("@SWIFT", SqlDbType.VarChar).Value = SWIFT - ' .Add("@Referencia", SqlDbType.VarChar).Value = Referencia - ' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario - - - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - ' Retorno = True - ' 'Catch Ex1 As SqlException - ' ' If Ex1.Message.Contains("Número: 2627;") Then - ' ' Alert("Ya existe un Registro con el mismo nombre: " & CveProveedor & ".", TipoMensaje.MsgAdvertencia) - ' ' Else - ' ' Me.OnError("Ocurrió un error al Guardar el registro.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' ' End If - ' Catch ex As Exception - ' OnError("Ocurrió un error al Guardar el registro", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ' End Try - - ' Return Retorno - ' End Function - ' Public Function RemoveProveedoresCuentas(CveProveedorCuenta As Integer) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_Comp_ProveedoresCuentasRemove") - - ' SqlAdapter.SelectCommand.Parameters.Add("@CveProveedorCuenta", SqlDbType.Int).Value = CveProveedorCuenta - - ' Try - ' SqlAdapter.Fill(Data) - ' Retorno = True - ' Catch Ex1 As SqlException - ' If Ex1.Message.Contains("Número: 547;") Then - ' Alert("El registro no se pudo eliminar porque está siendo usado.", TipoMensaje.MsgAdvertencia) - ' Else - ' Me.OnError("Ocurrió un error al eliminar el registro.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End If - ' Catch ex As Exception - ' Me.OnError("Ocurrió un error al eliminar el registro.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End Try - - ' Return Retorno - ' End Function - - ' Public Function UpdateProveedoresCuentas(CveProveedor As Integer, CveProveedorCuenta As Integer, BancoNombre As String, Plaza As String, Sucursal As String, Cuenta As String, CLABE As String, CIE As String, SWIFT As String, Referencia As String, Predeterminada As Boolean, Estatus As Boolean) As Boolean - ' Dim Retorno As Boolean = False - - ' DataAdapter("PA_Comp_ProveedoresCuentasUpdate") - - ' With SqlAdapter.SelectCommand.Parameters - ' .Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor - ' .Add("@BancoNombre", SqlDbType.VarChar).Value = BancoNombre - ' .Add("@Plaza", SqlDbType.VarChar).Value = Plaza - ' .Add("@Sucursal", SqlDbType.VarChar).Value = Sucursal - ' .Add("@Cuenta", SqlDbType.VarChar).Value = Cuenta - ' .Add("@CLABE", SqlDbType.VarChar).Value = CLABE - ' .Add("@CIE", SqlDbType.VarChar).Value = CIE - ' .Add("@SWIFT", SqlDbType.VarChar).Value = SWIFT - ' .Add("@Referencia", SqlDbType.VarChar).Value = Referencia - ' .Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada - ' .Add("@Estatus", SqlDbType.VarChar).Value = Estatus - ' .Add("@CveProveedorCuenta", SqlDbType.Int).Value = CveProveedorCuenta - ' .Add("@FechaIng", SqlDbType.Date).Value = Date.Now - ' End With - - ' Try - ' SqlAdapter.Fill(Data) - ' Retorno = True - ' Catch Ex1 As SqlException - ' If Ex1.Message.Contains("Número: 2627;") Then - ' Alert("Ya existe un registro con el mismo nombre", TipoMensaje.MsgAdvertencia) - ' Else - ' Me.OnError("Ocurrió un error al guardar los cambios", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - ' End If - ' Catch ex As Exception - ' OnError("Ocurrió un error al guardar los cambios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) - ' End Try - - ' Return Retorno - ' End Function - - '#End Region - - #Region "S U C U R S A L E S" Public Function GetSucursales(CveProveedor As Integer, CveEmpresa As Integer) As Boolean diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb index e860e2755..3157fd0a5 100644 --- a/App_Code/ClsGenerales.vb +++ b/App_Code/ClsGenerales.vb @@ -3344,93 +3344,12 @@ Public Class ClsGenerales End Try Return Retorno - End Function + End Function #End Region - -#Region "CLASIFICACIONES PORCENTAJE" - - Public Function GetClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasificacionPorcentaje As Integer = -1, - Optional CveClasificacion As Integer = -1, Optional PorcentajeIVA As Double = -1, - Optional Opcion As Integer = 1) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Gral_ClasificacionPorcentajeGet") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveClasificacionPorcentaje", SqlDbType.Int).Value = CveClasificacionPorcentaje - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@PorcentajeIVA", SqlDbType.Float).Value = PorcentajeIVA - .Add("@Opcion", SqlDbType.Int).Value = Opcion - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al obtener la clasificacion del porcentaje.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - Public Function AddClasificacionPorcentaje(CveClasificacion As Integer, PorcentajeIVA As Double, IdCtaIVAXAcreditar As Integer, IdCtaIVAAcreditable As Integer, - IdCtaIVAXTrasladar As Integer, IdCtaIVATrasladado As Integer, CveEmpresa As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Gral_ClasificacionPorcentajeAdd") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@PorcentajeIVA", SqlDbType.Float).Value = PorcentajeIVA - .Add("@IdCtaIVAXAcreditar", SqlDbType.Int).Value = IdCtaIVAXAcreditar - .Add("@IdCtaIVAAcreditable", SqlDbType.Int).Value = IdCtaIVAAcreditable - .Add("@IdCtaIVAXTrasladar", SqlDbType.Int).Value = IdCtaIVAXTrasladar - .Add("@IdCtaIVATrasladado", SqlDbType.Int).Value = IdCtaIVATrasladado - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al agregar la clasificacion del porcentaje.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - Public Function UpdateClasificacionPorcentaje(CveClasificacionPorcentaje As Integer, CveClasificacion As Integer, PorcentajeIVA As Double, IdCtaIVAXAcreditar As Integer, IdCtaIVAAcreditable As Integer, - IdCtaIVAXTrasladar As Integer, IdCtaIVATrasladado As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Gral_ClasificacionPorcentajeUpdate") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveClasificacionPorcentaje", SqlDbType.Int).Value = CveClasificacionPorcentaje - .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@PorcentajeIVA", SqlDbType.Float).Value = PorcentajeIVA - .Add("@IdCtaIVAXAcreditar", SqlDbType.Int).Value = IdCtaIVAXAcreditar - .Add("@IdCtaIVAAcreditable", SqlDbType.Int).Value = IdCtaIVAAcreditable - .Add("@IdCtaIVAXTrasladar", SqlDbType.Int).Value = IdCtaIVAXTrasladar - .Add("@IdCtaIVATrasladado", SqlDbType.Int).Value = IdCtaIVATrasladado - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al actualizar la clasificacion del porcentaje.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - Public Function RemoveClasificacionPorcentaje(CveClasificacionPorcentaje As Integer) As Boolean - Dim Retorno As Boolean = False - DataAdapter("PA_Gral_ClasificacionPorcentajeRemove") - With SqlAdapter.SelectCommand.Parameters - .Add("@CveClasificacionPorcentaje", SqlDbType.Int).Value = CveClasificacionPorcentaje - End With - Try - SqlAdapter.Fill(Data) - Retorno = True - Catch ex As Exception - OnError("Ocurrió un error al eliminar la clasificacion del porcentaje.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) - End Try - Return Retorno - End Function - -#End Region - - + + #Region "C A R T A P O R T E" - + Public Function GetMaterialPeligroso() As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Gral_CP_MaterialPeligrosoGet") @@ -3497,13 +3416,11 @@ Public Class ClsGenerales OnError("Ocurrió un error al obtener los tipos de remolque de carta porte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function - + End Function + #End Region - - - - + + #Region "CRUD_Edoc_DocumentacionTipo" Public Function GetEdoc_DocumentacionTipo(CveDocumentacionTipo As Integer, CveEmpresa As Integer, Optional Estatus As Integer = -1, Optional EsCatalogo As Integer = 0, Optional Modulo As Integer = 1) As Boolean @@ -3584,16 +3501,14 @@ Public Class ClsGenerales Return retorno - End Function - + End Function + #End Region - - - - + + #Region "" - - + + Public Function GetJAMCorveta(Opcion As Integer) As Boolean Dim Retorno As Boolean = False @@ -3612,17 +3527,14 @@ Public Class ClsGenerales Return Retorno - End Function - + End Function + #End Region - - - - - + + #Region "CULTIVOS" - - + + Public Function GetCultivosCuadro(CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -3706,16 +3618,12 @@ Public Class ClsGenerales Return Retorno - End Function - - + End Function + + #End Region - - - - - - + + #Region " P O L I Z A V I R T U A L " Public Function ModelosAutosGet(Estatus As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -3777,15 +3685,12 @@ Public Class ClsGenerales OnError("Ocurrió un error al obtener los BCI de Usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function + End Function #End Region - - - - + #Region "GRAL TIMBRES" - - + + Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0, Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False, Optional CveVenta As Integer = -1) As Integer @@ -4189,12 +4094,11 @@ Public Class ClsGenerales OnError("Ocurrió un error al obtener el detalle de recolección", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno - End Function - - + End Function + + #End Region - - + Public Function GetMediosTransporte(CveOrigen As Integer, Estatus As Boolean, CveEmpresa As Integer, CveTipoNomina As Integer, CveSubProyecto As Integer, Tipo As Integer, GPO As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 823f6d5c7..0697147af 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -374,7 +374,7 @@ Public Class ClsInventarios End Function - Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean + Public Function AddAlmacen(Almacen As String, CveTipoAlmacen As Integer, Modalidad As Integer, CveUsuario As Integer, CveEmpresa As Integer, Inventariable As Byte, CveSubProyecto As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_AlmacenesAdd") @@ -382,7 +382,6 @@ Public Class ClsInventarios With SqlAdapter.SelectCommand.Parameters .Add("@Almacen", SqlDbType.VarChar).Value = Almacen .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen - .Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable .Add("@Modalidad", SqlDbType.Int).Value = Modalidad .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -410,7 +409,7 @@ Public Class ClsInventarios Return Retorno End Function - Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, IdCtaContable As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, CveEmpresa As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean + Public Function UpdateAlmacen(Almacen As String, CveTipoAlmacen As Integer, Modalidad As Integer, Estatus As Boolean, CveAlmacen As Integer, Inventariable As Byte, CveSubProyecto As Integer, CveEmpresa As Integer, Optional Orden As Integer = -1, Optional CveCuenta As Integer = -1, Optional CveUsuarioAutoriza As Integer = -1, Optional CveAlmacenVirtual As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_AlmacenesUpdate") @@ -419,7 +418,6 @@ Public Class ClsInventarios .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen .Add("@Almacen", SqlDbType.VarChar).Value = Almacen .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen - .Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable .Add("@Modalidad", SqlDbType.Int).Value = Modalidad .Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@Inventariable", SqlDbType.Bit).Value = Inventariable diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 9d7a712ec..2161656b8 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -1403,9 +1403,9 @@ Public Class ClsNominas End Function Public Function AddConcepto(Codigo As String, Concepto As String, Tipo As String, Formula As String, Sistema As Boolean, Estado As Boolean, CveConceptoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, - EsRetencion As Boolean, CveClasificacion As Integer, IdCtaContable As Integer, CveTipoGasto As Integer, TipoCalculo As Boolean, CveConceptoContable As Integer, + EsRetencion As Boolean, CveClasificacion As Integer, CveTipoGasto As Integer, TipoCalculo As Boolean, CveConceptoContable As Integer, AplicaFiniquito As Integer, AutomaticoGlobal As Integer, Especie As Integer, Imprimir As Integer, CveSATConcepto As Integer, - ctaImporteNegativoProv As Integer, contabiliza As Integer, CargoOAbono As Integer, cveConceptoContableB As Integer, IdCtaContableB As Integer, CveCuentaB As Integer, CveConceptoContablePasivo As Integer) As Integer + ctaImporteNegativoProv As Integer, contabiliza As Integer, CargoOAbono As Integer, cveConceptoContableB As Integer, CveCuentaB As Integer, CveConceptoContablePasivo As Integer) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Nom_ConceptosAdd") @@ -1422,7 +1422,6 @@ Public Class ClsNominas .Add("CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("EsRetencion", SqlDbType.Bit).Value = EsRetencion .Add("CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("IdCtaContable", SqlDbType.Int).Value = IdCtaContable .Add("CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto .Add("TipoCalculo", SqlDbType.Bit).Value = TipoCalculo .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue @@ -1437,7 +1436,6 @@ Public Class ClsNominas .Add("Contabiliza", SqlDbType.Int).Value = contabiliza .Add("CargoOAbono", SqlDbType.Int).Value = CargoOAbono .Add("CveConceptoContableB", SqlDbType.Int).Value = cveConceptoContableB - .Add("IdCtaContableB", SqlDbType.Int).Value = IdCtaContableB .Add("CveCuentaB", SqlDbType.Int).Value = CveCuentaB .Add("CveConceptoContablePasivo", SqlDbType.Int).Value = CveConceptoContablePasivo @@ -1464,9 +1462,9 @@ Public Class ClsNominas End Function Public Function UpdateConcepto(Codigo As String, Concepto As String, Tipo As String, Formula As String, Sistema As Boolean, Estado As Boolean, CveConceptoPadre As Integer, CveConcepto As Integer, - EsRetencion As Boolean, CveClasificacion As Integer, IdCtaContable As Integer, CveTipoGasto As Integer, TipoCalculo As Boolean, CveConceptoContable As Integer, + EsRetencion As Boolean, CveClasificacion As Integer, CveTipoGasto As Integer, TipoCalculo As Boolean, CveConceptoContable As Integer, AplicaFiniquito As Integer, AutomaticoGlobal As Integer, Especie As Integer, Imprimir As Integer, CveSATConcepto As Integer, CveEmpresa As Integer, - ctaImporteNegativoProv As Integer, contabiliza As Integer, CargoOAbono As Integer, cveConceptoContableB As Integer, IdCtaContableB As Integer, CveCuentaB As Integer, CveConceptoContablePasivo As Integer) As Boolean + ctaImporteNegativoProv As Integer, contabiliza As Integer, CargoOAbono As Integer, cveConceptoContableB As Integer, CveCuentaB As Integer, CveConceptoContablePasivo As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_ConceptosUpdate") @@ -1482,7 +1480,6 @@ Public Class ClsNominas .Add("CveConcepto", SqlDbType.Int).Value = CveConcepto .Add("EsRetencion", SqlDbType.Bit).Value = EsRetencion .Add("CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("IdCtaContable", SqlDbType.Int).Value = IdCtaContable .Add("CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto .Add("TipoCalculo", SqlDbType.Bit).Value = TipoCalculo .Add("CveConceptoContable", SqlDbType.Int).Value = CveConceptoContable @@ -1497,7 +1494,6 @@ Public Class ClsNominas .Add("Contabiliza", SqlDbType.Int).Value = contabiliza .Add("CargoOAbono", SqlDbType.Int).Value = CargoOAbono .Add("CveConceptoContableB", SqlDbType.Int).Value = cveConceptoContableB - .Add("IdCtaContableB", SqlDbType.Int).Value = IdCtaContableB .Add("CveCuentaB", SqlDbType.Int).Value = CveCuentaB .Add("CveConceptoContablePasivo", SqlDbType.Int).Value = CveConceptoContablePasivo End With diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 1fc60db2d..2b0aaa728 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -1937,7 +1937,7 @@ Public Class ClsRH CveEstadoCivil As Integer, CveGenero As Integer, CveMotivoBaja As Integer, FechaBaja As String, CveEstatusPersonal As Integer, FechaNacimiento As Date, LugarNacimiento As String, Calle As String, NumExt As String, NumInt As String, Colonia As String, CP As String, Ciudad As String, CveEstado As Integer, Telefono As String, TelefonoEmergencia As String, Celular As String, RFC As String, CURP As String, CredencialElector As String, NombrePadre As String, NombreMadre As String, CveSATBanco As Integer, CveSATRiesgoPuesto As Integer, CveSATRegimenContratacion As Integer, CveClienteAsignado As Integer, CveSubProyecto As Integer, URL As String, CveSupervisor As Integer, CLABE As String, BancoNumCuenta As String, - CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveUsuario As Integer, CveEmpresa As Integer, CveUsuarioNomina As Integer, Beneficiario As String, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1, + CveJornada As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveUsuarioNomina As Integer, Beneficiario As String, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1, Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Boolean = False, Optional CvePais As Integer = -1, Optional Pensionado As Boolean = False, Optional CveMedioTransporte As Integer = -1, Optional CveRegistroPatronal As Integer = -1, Optional CveEmpresaAsignado As Integer = -1, Optional CveTipoTrabajador As Integer = -1, Optional NetoPeriodo As Decimal = -1) As Boolean @@ -2007,11 +2007,7 @@ Public Class ClsRH .Add("@CveSupervisor", SqlDbType.VarChar).Value = CveSupervisor .Add("@BancoNumCuenta", SqlDbType.VarChar).Value = BancoNumCuenta .Add("@CLABE", SqlDbType.VarChar).Value = CLABE - .Add("@CveJornada", SqlDbType.Int).Value = CveJornada - .Add("@IdCtaContPersonal", SqlDbType.Int).Value = IdCtaContPersonal - .Add("@CtaContPersonal", SqlDbType.VarChar).Value = CtaContPersonal - .Add("@IdCtaContPrestamos", SqlDbType.Int).Value = IdCtaContPrestamos - .Add("@CtaContPrestamos", SqlDbType.VarChar).Value = CtaContPrestamos + .Add("@CveJornada", SqlDbType.Int).Value = CveJornada .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Beneficiario", SqlDbType.VarChar).Value = Beneficiario @@ -2032,15 +2028,9 @@ Public Class ClsRH .Add("@CveTipoTrabajador", SqlDbType.Int).Value = CveTipoTrabajador .Add("@NetoPeriodo", SqlDbType.Money).Value = NetoPeriodo - - - .Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue End With - - - Try SqlAdapter.Fill(Data) _CvePersonal = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero @@ -2073,7 +2063,7 @@ Public Class ClsRH CveEstadoCivil As Integer, CveGenero As Integer, CveMotivoBaja As Integer, FechaBaja As String, CveEstatusPersonal As Integer, FechaNacimiento As Date, LugarNacimiento As String, Calle As String, NumExt As String, NumInt As String, Colonia As String, CP As String, Ciudad As String, CveEstado As Integer, Telefono As String, TelefonoEmergencia As String, Celular As String, RFC As String, CURP As String, CredencialElector As String, NombrePadre As String, NombreMadre As String, CveSATBanco As Integer, CveSATRiesgoPuesto As Integer, CveSATRegimenContratacion As Integer, CveClienteAsignado As Integer, CveSubProyecto As Integer, CvePersonal As Integer, URL As String, CveSupervisor As Integer, CLABE As String, BancoNumCuenta As String, - CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveEmpresa As Integer, CveUsuarioNomina As Integer, Beneficiario As String, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1, + CveJornada As Integer, CveEmpresa As Integer, CveUsuarioNomina As Integer, Beneficiario As String, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1, Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional FechaActivo As Date = MinFecha, Optional FechaReingreso As Date = MinFecha, Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Integer = -1, Optional CvePais As Integer = -1, Optional Pensionado As Boolean = False, Optional CveRegistroPatronal As Integer = -1, Optional CveEmpresaAsignado As Integer = -1, Optional CveMedioTransporte As Integer = -1, Optional EsReserva As Integer = -1, Optional Fiscalizable As Integer = -1, Optional CveTipoTrabajador As Integer = -1, Optional NetoPeriodo As Decimal = -1) As Boolean @@ -2146,11 +2136,7 @@ Public Class ClsRH .Add("@CveSupervisor", SqlDbType.VarChar).Value = CveSupervisor .Add("@BancoNumCuenta", SqlDbType.VarChar).Value = BancoNumCuenta .Add("@CLABE", SqlDbType.VarChar).Value = CLABE - .Add("@CveJornada", SqlDbType.Int).Value = CveJornada - .Add("@IdCtaContPersonal", SqlDbType.Int).Value = IdCtaContPersonal - .Add("@CtaContPersonal", SqlDbType.VarChar).Value = CtaContPersonal - .Add("@IdCtaContPrestamos", SqlDbType.Int).Value = IdCtaContPrestamos - .Add("@CtaContPrestamos", SqlDbType.VarChar).Value = CtaContPrestamos + .Add("@CveJornada", SqlDbType.Int).Value = CveJornada .Add("@CveUsuarioNomina", SqlDbType.VarChar).Value = CveUsuarioNomina .Add("@Beneficiario", SqlDbType.VarChar).Value = Beneficiario .Add("@CveSubProyectoZona", SqlDbType.Int).Value = CveSubProyectoZona diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb index 23669a7eb..6cce01769 100644 --- a/App_Code/ClsSisEmpresas.vb +++ b/App_Code/ClsSisEmpresas.vb @@ -421,7 +421,6 @@ Public Class ClsSisEmpresas _Empresa.CvePlataforma = Data.Rows(0)("CvePlataforma").ToString.ToEntero _Empresa.CveDistribuidor = Data.Rows(0)("CveDistribuidor").ToString.ToEntero _Empresa.DiasPermitidos = Data.Rows(0)("DiasPermitidos").ToString.ToEntero - _Empresa.AsientoContableComprasContado = If(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString = "", False, CBool(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString)) _Empresa.TipoContabilizacion = Data.Rows(0)("Conta_TipoContabilizacion").ToString.ToEntero _Empresa.TipoContabilidad = Data.Rows(0)("Conta_TipoContabilidad").ToString.ToEntero '0 - Sin Conta, 1- Contabilidad SIG, 2- Contabilidad Contpaq _Empresa.DefaultAsistencias = If(Data.Rows(0)("RH_DefaultAsistencias").ToString = "", False, CBool(Data.Rows(0)("RH_DefaultAsistencias").ToString)) @@ -464,7 +463,7 @@ Public Class ClsSisEmpresas Soporte_Server As String, Soporte_Puerto As Integer, Soporte_SSL As Boolean, Soporte_USR As String, Soporte_PWD As String, Soporte_Tipo As String, RegistroPatronal As String, AreaGeografica As String, NombreCorto As String, CURP As String, CveRegimenFiscal As Integer, Importe As Decimal, - CIEC As String, CvePlataforma As Integer, UsaAC As Boolean, PorDepreciacion As Decimal, Extension As String, Localidad As String, MetodoInventario As Integer, AsientoContableComprasContado As Boolean, + CIEC As String, CvePlataforma As Integer, UsaAC As Boolean, PorDepreciacion As Decimal, Extension As String, Localidad As String, MetodoInventario As Integer, PeriodoActual As Integer, EjercicioActual As Integer, RH_DefaultAsistencias As Boolean, DiasPermitidos As Integer, TipoCentroCosto As Integer, RequiereCentroCosto As Boolean, PV_TerminalTipo As Integer, Optional CveMetodoPago As Integer = 0, Optional CvePAC As Integer = 0, Optional RegistroCompleto As Boolean = False @@ -590,12 +589,10 @@ Public Class ClsSisEmpresas SendMail As String, SendMailPassword As String, SendMailServer As String, SendMailPuerto As Integer, SendMailSSL As Boolean, UsaContabilidad As Boolean, UsaBancos As Boolean, UsaVentas As Boolean, UsaCxC As Boolean, UsaCompras As Boolean, UsaInventarios As Boolean, UsaRH As Boolean, UsaNomina As Boolean, UsaOS As Boolean, BDContPAQi As String, ServerContPAQi As String, UsrContPAQi As String, PwdContPAQi As String, Buzon_Mail As String, Buzon_Server As String, Buzon_Puerto As Integer, Buzon_SSL As Boolean, Buzon_USR As String, Buzon_PWD As String, CveEmpresa As Integer, Buzon_Tipo As String, Soporte_Mail As String, - Soporte_Server As String, Soporte_Puerto As Integer, Soporte_SSL As Boolean, Soporte_USR As String, Soporte_PWD As String, Soporte_Tipo As String, IdCuentaIVAxAcreditar As Integer, IdCuentaIVAAcreditable As Integer, - IdCuentaIVAxTrasladar As Integer, IdCuentaIVATrasladado As Integer, IdCuentaRetIVACirculacion As Integer, IdCuentaRetISRCirculacion As Integer, IdCuentaOtrosIngresos As Integer, IdCuentaDescuentoVentas As Integer, RegistroPatronal As String, AreaGeografica As String, - Conta_IdCuentaPerdidaCambiaria As Integer, Conta_IdCuentaGananciaCambiaria As Integer, NombreCorto As String, CURP As String, CveRegimenFiscal As Integer, CvePAC As Integer, - Importe As Decimal, CIEC As String, CvePlataforma As Integer, UsaAC As Boolean, PorDepreciacion As Decimal, Extension As String, Localidad As String, MetodoInventario As Integer, AsientoContableComprasContado As Boolean, - PeriodoActual As Integer, EjercicioActual As Integer, RH_DefaultAsistencias As Boolean, DiasPermitidos As Integer, TipoCentroCosto As Integer, RequiereCentroCosto As Boolean, PV_TerminalTipo As Integer, Optional IdCuentaDSV As Integer = -1, Optional IdCuentaImpuestosLocales As Integer = -1, - Optional IdCuentaIEPSxAcreditar As Integer = -1, Optional IdCuentaIEPSAcreditable As Integer = -1, Optional IdCuentaIEPSxTrasladar As Integer = -1, Optional IdCuentaIEPSTrasladado As Integer = -1) As Boolean + Soporte_Server As String, Soporte_Puerto As Integer, Soporte_SSL As Boolean, Soporte_USR As String, Soporte_PWD As String, Soporte_Tipo As String, RegistroPatronal As String, AreaGeografica As String, + NombreCorto As String, CURP As String, CveRegimenFiscal As Integer, CvePAC As Integer, + Importe As Decimal, CIEC As String, CvePlataforma As Integer, UsaAC As Boolean, PorDepreciacion As Decimal, Extension As String, Localidad As String, MetodoInventario As Integer, + PeriodoActual As Integer, EjercicioActual As Integer, RH_DefaultAsistencias As Boolean, DiasPermitidos As Integer, TipoCentroCosto As Integer, RequiereCentroCosto As Boolean, PV_TerminalTipo As Integer) As Boolean Dim Retorno As Boolean = False @@ -659,25 +656,11 @@ Public Class ClsSisEmpresas 'Nuevos Datos .Add("@Buzon_Tipo", SqlDbType.VarChar).Value = Buzon_Tipo - .Add("@IdCuentaIVAxAcreditar", SqlDbType.VarChar).Value = IdCuentaIVAxAcreditar - .Add("@IdCuentaIVAAcreditable", SqlDbType.VarChar).Value = IdCuentaIVAAcreditable - .Add("@IdCuentaIVAxTrasladar", SqlDbType.VarChar).Value = IdCuentaIVAxTrasladar - .Add("@IdCuentaIVATrasladado", SqlDbType.VarChar).Value = IdCuentaIVATrasladado - .Add("@IdCuentaRetIVACirculacion", SqlDbType.VarChar).Value = IdCuentaRetIVACirculacion - .Add("@IdCuentaRetISRCirculacion", SqlDbType.VarChar).Value = IdCuentaRetISRCirculacion .Add("@RegistroPatronal", SqlDbType.VarChar).Value = RegistroPatronal .Add("@AreaGeografica", SqlDbType.VarChar).Value = AreaGeografica - .Add("@Conta_IdCuentaPerdidaCambiaria", SqlDbType.Int).Value = Conta_IdCuentaPerdidaCambiaria - .Add("@Conta_IdCuentaGananciaCambiaria", SqlDbType.Int).Value = Conta_IdCuentaGananciaCambiaria .Add("@NombreCorto", SqlDbType.VarChar).Value = NombreCorto .Add("@CvePAC", SqlDbType.Int).Value = CvePAC - .Add("@IdCuentaDSV", SqlDbType.Int).Value = IdCuentaDSV - .Add("@IdCuentaImpuestosLocales", SqlDbType.Int).Value = IdCuentaImpuestosLocales - .Add("@IdCuentaIEPSxAcreditar", SqlDbType.VarChar).Value = IdCuentaIEPSxAcreditar - .Add("@IdCuentaIEPSAcreditable", SqlDbType.VarChar).Value = IdCuentaIEPSAcreditable - .Add("@IdCuentaIEPSxTrasladar", SqlDbType.VarChar).Value = IdCuentaIEPSxTrasladar - .Add("@IdCuentaIEPSTrasladado", SqlDbType.VarChar).Value = IdCuentaIEPSTrasladado .Add("@Soporte_Tipo", SqlDbType.VarChar).Value = Soporte_Tipo .Add("@Soporte_SSL", SqlDbType.Bit).Value = Soporte_SSL .Add("@Soporte_USR", SqlDbType.VarChar).Value = Soporte_USR @@ -693,7 +676,6 @@ Public Class ClsSisEmpresas .Add("@Extension", SqlDbType.VarChar).Value = Extension .Add("@Localidad", SqlDbType.VarChar).Value = Localidad .Add("@MetodoInventario", SqlDbType.Int).Value = MetodoInventario - .Add("@AsientoContableComprasContado", SqlDbType.Bit).Value = AsientoContableComprasContado .Add("@PeriodoActual", SqlDbType.Int).Value = PeriodoActual .Add("@EjercicioActual", SqlDbType.Int).Value = EjercicioActual .Add("@RH_DefaultAsistencias", SqlDbType.Bit).Value = RH_DefaultAsistencias @@ -701,10 +683,7 @@ Public Class ClsSisEmpresas .Add("@TipoCentroCosto", SqlDbType.Int).Value = TipoCentroCosto .Add("@RequiereCentroCosto", SqlDbType.Bit).Value = RequiereCentroCosto .Add("@PV_TerminalTipo", SqlDbType.Int).Value = PV_TerminalTipo - .Add("@IdCuentaDescuentoVentas", SqlDbType.Int).Value = IdCuentaDescuentoVentas - .Add("@IdCuentaOtrosIngresos", SqlDbType.Int).Value = IdCuentaOtrosIngresos .Add("@Importe", SqlDbType.Decimal).Value = Importe - End With Try diff --git a/App_Code/ClsSubProyectos.vb b/App_Code/ClsSubProyectos.vb index 752b7cb0e..2215fda48 100644 --- a/App_Code/ClsSubProyectos.vb +++ b/App_Code/ClsSubProyectos.vb @@ -166,21 +166,14 @@ Public Class ClsSubProyectos Return Retorno End Function - Public Function UpdateSubProyectoExcel(CveEmpresa As Integer, CveClasificacion As Integer, CveSubProyecto As Integer, IdCuentaGasto As Integer, IdCuentaAnticipo As Integer, IdCuentaInventario As Integer, CuentaGasto As String, CuentaAnticipo As String, CuentaInventario As String) As Boolean + Public Function UpdateSubProyectoExcel(CveEmpresa As Integer, CveClasificacion As Integer, CveSubProyecto As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_SubProyectosExcelSetUp") With SqlAdapter.SelectCommand.Parameters .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto - .Add("@IdCuentaGasto", SqlDbType.Int).Value = IdCuentaGasto - .Add("@IdCuentaAnticipo", SqlDbType.Int).Value = IdCuentaAnticipo - .Add("@IdCuentaInventario", SqlDbType.Int).Value = IdCuentaInventario - .Add("@CuentaGasto", SqlDbType.VarChar).Value = CuentaGasto - .Add("@CuentaAnticipo", SqlDbType.VarChar).Value = CuentaAnticipo - .Add("@CuentaInventario", SqlDbType.VarChar).Value = CuentaInventario + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresas", SqlDbType.Int).Value = CveEmpresa - End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index fd66b4b7e..ae5dedf84 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2679,7 +2679,7 @@ Public Class ClsVentas #End Region #Region " I M P U E S T O S L O C A L E S" - Public Function AddImpuestosLocales(ImpuestoLocal As String, Porcentaje As Decimal, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CveClasificacion As Integer = -1) As Boolean + Public Function AddImpuestosLocales(ImpuestoLocal As String, Porcentaje As Decimal, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CveClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_ImpuestosLocalesAdd") @@ -2689,12 +2689,10 @@ Public Class ClsVentas .Add("@Orden", SqlDbType.Int).Value = Orden .Add("@TipoImpuesto", SqlDbType.Int).Value = TipoImpuesto .Add("@Estatus", SqlDbType.Bit).Value = Estatus - .Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - End With Try @@ -2724,7 +2722,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdateImpuestosLocales(CveImpuestoLocal As Integer, ImpuestoLocal As String, Porcentaje As Decimal, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, IdCtaContable As Integer, Optional CveClasificacion As Integer = -1) As Boolean + Public Function UpdateImpuestosLocales(CveImpuestoLocal As Integer, ImpuestoLocal As String, Porcentaje As Decimal, Orden As Integer, TipoImpuesto As Integer, Estatus As Integer, Optional CveClasificacion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_ImpuestosLocalesUpdate") @@ -2735,7 +2733,6 @@ Public Class ClsVentas .Add("@TipoImpuesto", SqlDbType.Int).Value = TipoImpuesto .Add("@Orden", SqlDbType.Int).Value = Orden .Add("@Estatus", SqlDbType.Bit).Value = Estatus - .Add("@IdCtaContable", SqlDbType.Int).Value = IdCtaContable .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion End With diff --git a/App_Code/Empresa.vb b/App_Code/Empresa.vb index 2508ad6f9..c0c231714 100644 --- a/App_Code/Empresa.vb +++ b/App_Code/Empresa.vb @@ -119,8 +119,7 @@ Public Class Empresa Public Property PorDepreciacion As Decimal Public Property CvePlataforma As Integer Public Property CveDistribuidor As Integer - Public Property DiasPermitidos As Integer - Public Property AsientoContableComprasContado As Boolean + Public Property DiasPermitidos As Integer Public Property TipoContabilizacion As Integer Public Property TipoContabilidad As Integer Public Property DefaultAsistencias As Boolean diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 7dcdac848..876b4dbb8 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -3416,17 +3416,6 @@ Namespace Extensiones End Function #Region "Contabilidad" - 'Public Function ObtenerCuentaDobleConta(IdCtaContable As Integer, CveEmpresa As Integer) As Integer - ' Dim Retorno As Integer = -1 - - ' Dim ObjContabilidad As New ClsContabilidad - ' If ObjContabilidad.GetCuentaDobleConta(IdCtaContable, CveEmpresa) Then - ' Retorno = ObjContabilidad.DtResultados(0)("CveCuenta").ToString.ToEntero - ' End If - ' ObjContabilidad.Dispose() - - ' Return Retorno - 'End Function Public Function ContabilizaMovimientoAlmacen(ByRef ObjConta As ClsContabilidad, Fecha As Date, Concepto As String, Modulo As String, CveMovimientoSalida As Integer, CveMovimientoEntrada As Integer, Importe As Decimal, CveUsuario As Integer, CveEmpresa As Integer, Contabilizable As Boolean) As Integer Dim Retorno As Integer = -1 diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx index 7428ce2a6..648919343 100644 --- a/Ashx/E141.ashx +++ b/Ashx/E141.ashx @@ -1236,8 +1236,7 @@ Public Class E141 : Implements IHttpHandler TmpDT.Columns.Add("TotalImporte", GetType(Decimal)) TmpDT.Columns.Add("Total", GetType(Decimal)) 'Para uso del módulo contable - TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer)) - TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer)) + TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer)) TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean)) TmpDT.Columns.Add("CveProyecto", GetType(Integer)) TmpDT.Columns.Add("Proyecto", GetType(String)) diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx index 1969d5f53..0c7bb3ea1 100644 --- a/Bancos/DepositosCaja.aspx +++ b/Bancos/DepositosCaja.aspx @@ -299,7 +299,7 @@
- + @@ -339,9 +339,7 @@ - - - +
diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx index 583d93be8..e675c9d97 100644 --- a/Bancos/FluctuacionCambiaria.aspx +++ b/Bancos/FluctuacionCambiaria.aspx @@ -260,7 +260,7 @@
@@ -363,7 +363,7 @@
@@ -475,7 +475,7 @@
@@ -586,7 +586,7 @@
@@ -640,7 +640,7 @@
@@ -691,7 +691,7 @@
@@ -850,7 +850,7 @@ @@ -897,7 +897,7 @@
diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index 8eb7c37e8..7a0eca2ca 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -869,7 +869,6 @@ Partial Class Bancos_FluctuacionCambiaria Dim cb As CheckBox = gvr.FCCheckBox("ChkGenerarBancos") If cb.Checked Then Total = gvr.DataKey("Fluctuacion").ToDecimal - ' Dim IdCtaComplementaria As Integer = gvr.DataKey("IdCtaAfectable").ToEntero Dim ConceptoReferencia As String = String.Format("{0} - {1} {2}", gvr.DataKey("Banco"), gvr.DataKey("NumCuenta"), MesTCtexto) 'MOVIMIENTO DE FLUCTUACION diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index aeda26840..e2fb8b45c 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -1517,7 +1517,6 @@ Partial Class Bancos_IE Folio = Banco.GetNextFolio(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero) Banco.Dispose() TxtFolio.Text = Folio.ToString - Dim drI As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If drI IsNot Nothing Then @@ -1525,11 +1524,12 @@ Partial Class Bancos_IE Else CargaNotas(-1) End If - - Else TxtFolio.Text = "" End If + If UsuarioActual.CveEmpresa = 140 AndAlso Request("Opcion").ToString = "INGPC" Then + CargaFolioAdicional() + End If Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) If dr IsNot Nothing Then @@ -1707,7 +1707,6 @@ Partial Class Bancos_IE If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT", "EGSCREDITO") Then dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs' AND Estatus = 1") LtlTitulo.Text = "Egreso Por Comprobar" - RBL.Items.Remove(RBL.Items.FindByValue("C")) ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "DEV" Then dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing' AND Estatus = 1 ") @@ -3809,7 +3808,6 @@ Partial Class Bancos_IE DdlPersonal.Visible = False DdlProveedores.Visible = True DdlCliente.Visible = False - CargaFolioAdicional() ElseIf RBL.SelectedValue = "C" Then DdlPersonal.Visible = False DdlProveedores.Visible = False diff --git a/Bancos/OtrosIE.aspx.vb b/Bancos/OtrosIE.aspx.vb index 60cbe0e6a..3dbbe20b7 100644 --- a/Bancos/OtrosIE.aspx.vb +++ b/Bancos/OtrosIE.aspx.vb @@ -214,7 +214,7 @@ Partial Class Bancos_OtrosIE 'SACO LA CLAVE DE LA CUENTA BANCARIA SELECCIONADO If DdlCuenta.SelectedValue.ToEntero > 0 And DRt("CveConcepto").ToString = "30" Then 'DTCuentasContables - Dim DRr As DataRow = DTCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero))) + ' Dim DRr As DataRow = DTCuentasContables.FiltroPrimero(String.Format("Id={0}", IdCuentaBancos(DdlCuenta.SelectedValue.ToEntero))) If DRr IsNot Nothing Then CodigoCuenta = DRr("CuentaFormato").ToString() EsComodin = 1 @@ -463,27 +463,15 @@ Partial Class Bancos_OtrosIE 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria If DdlCuenta.SelectedValue.ToEntero > 0 Then - Dim DR As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue) - If DR IsNot Nothing Then - TxtImporte.Text = DTMovimientos.SUM("Abono", "IdCuenta =" & DR("IdCtaContable").ToString).ToString - UPPDocumento.Update() - End If + 'Dim DR As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue) + 'If DR IsNot Nothing Then + ' TxtImporte.Text = DTMovimientos.SUM("Abono", "IdCuenta =" & DR("Id0CtaContable").ToString).ToString + ' UPPDocumento.Update() + 'End If End If End Sub - Private Function IdCuentaBancos(CveCuenta As Integer) As Integer - Dim Retorno As Integer = 0 - 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria - If CveCuenta > 0 Then - Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta=" & CveCuenta) - If drr IsNot Nothing Then - Retorno = drr("IdCtaContable").ToString.ToEntero - End If - End If - Return Retorno - End Function - Private Sub CargaCuentasDepositos(CveProveedor As Integer, CveCliente As Integer, CvePersonal As Integer, CveColectiva As Integer) DdlCuentaDeposito.Items.Clear() If DdlTipoTransaccion.SelectedValue = "2" Then diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index 9189f9129..0330a0c2e 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -249,8 +249,8 @@ public partial class Bancos_PagoDeudor : ClsPaginas } } - // DEUDORES - DEUDORES COMPLEMENTARIAIDCtaContableDeudorPrestamo - if (UsaComplementaria) //(IDCtaContableDeudorCompPrestamo > 0) + // DEUDORES - DEUDORES COMPLEMENTARIAI + if (UsaComplementaria) { // DEUDOR COMPLEMENTARIA if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, 0, (TxtImportePrestamo.Text.ToDecimal() * tipoCambio) - TxtImportePrestamo.Text.ToDecimal(), 256, Ref, Conc, CveIE: CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteME: TxtImportePrestamo.Text.ToDecimal(), TipoCambio: tipoCambio, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) diff --git a/Bancos/PolizaCheque.aspx.vb b/Bancos/PolizaCheque.aspx.vb index 2d4de193c..7e78911fd 100644 --- a/Bancos/PolizaCheque.aspx.vb +++ b/Bancos/PolizaCheque.aspx.vb @@ -431,7 +431,7 @@ Partial Class Bancos_PolizaCheque Dim dr As DataRow = DtMovimientos.NewRow If drt("CveNomina").ToString.ToEntero > 0 Then - Dim drr As DataRow = Nothing ' DtCuentasContables.FiltroPrimero(String.Format("Id={0}", If(ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa), ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero, -1))) + Dim drr As DataRow = Nothing ' DtCuentasContables.FiltroPrimero(String.Format("Id={0}", If(ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa), ObjConta.DtResultados.Rows(0)("Id0CtaContable").ToString.ToEntero, -1))) TipoMovto = 0 CveConcepto = 31 IdCuenta = If(drr IsNot Nothing, drr("Id").ToString.ToEntero, -1) diff --git a/Bancos/PopIECompras.aspx b/Bancos/PopIECompras.aspx index 3a5a0685d..80d0624c6 100644 --- a/Bancos/PopIECompras.aspx +++ b/Bancos/PopIECompras.aspx @@ -300,7 +300,7 @@
- @@ -371,7 +371,7 @@
- diff --git a/Bancos/PopIEVentas.aspx b/Bancos/PopIEVentas.aspx index f42d31759..2a93043a1 100644 --- a/Bancos/PopIEVentas.aspx +++ b/Bancos/PopIEVentas.aspx @@ -222,7 +222,7 @@
- @@ -293,7 +293,7 @@
- diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index ceafe70d7..12c5e546d 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -1325,20 +1325,6 @@ Partial Class Bancos_PopIEVentas MsgError = ObjMov.MensajePolizaDescuadre End If End If - - ''Conta ContPAQ - 'If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then - - ' If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - ' IdPoliza = ObjMov.ContaIdPoliza - ' ' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion) - ' Else - ' Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico") - ' End If - - 'End If - - Else MsgError = "No se pudo insertar la poliza detalle" End If @@ -1358,15 +1344,10 @@ Partial Class Bancos_PopIEVentas StrMsg.Append("El Documento se guardó correctamente.
") 'Alert("El Documento se guardó correctamente.", TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") If TipoTransaccion = "Egs" AndAlso CveIE > 0 Then GeneraChequePDF(CveIE, UsuarioActual.Empresa) - '07-05-2018 - Timbra Complemento de pago Dim TextoComplementoPago As String = "" - If UsuarioActual.CveEmpresa = 119 Then - - StrMsg.AppendFormat("Folio {0}
", ObjIE.Folio) - - End If + StrMsg.AppendFormat("Folio {0}
", ObjIE.Folio) If RBLContado.SelectedValue = "1" And ChkComplementoPago.Checked Then Dim SeriesPago As New List(Of String) @@ -1374,9 +1355,7 @@ Partial Class Bancos_PopIEVentas Dim CveVentas As New List(Of Integer) CveVentas.Add(CveVenta) - TextoComplementoPago = EmitirComplementoPago(CveIE, CveVentas, SeriesPago) - StrMsg.Append($"
{TextoComplementoPago}") End If @@ -1398,8 +1377,6 @@ Partial Class Bancos_PopIEVentas ObjMov.Dispose() ObjCliente.Dispose() - 'CargaVenta(CveVenta) - 'UpDatosVenta.Update() End Sub Private Sub LimpiarTodo() diff --git a/Bancos/PrestamoPersonal.aspx.cs b/Bancos/PrestamoPersonal.aspx.cs index a72cf7068..ab7330f98 100644 --- a/Bancos/PrestamoPersonal.aspx.cs +++ b/Bancos/PrestamoPersonal.aspx.cs @@ -329,9 +329,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas //CONTABILIZA if (UsuarioActual.Empresa.Funcionalidad(200).Equals("1") && MsgError.Equals("")) - { - //if (IDCtaContablePrestamo > 0 && IDCtaContableBancos > 0) - //{ + { if (ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa)) { IDPoliza = ObjMov.ContaIdPoliza; @@ -367,14 +365,6 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas { archivo = new System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero())); } - - //if (archivo.Length > 0) - //{ - // if (archivo.Exists) - // { - // Msg.AppendFormat(@"

{1} ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)), String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem)); - // } - //} ObjIE.Commit(); @@ -617,9 +607,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas //CONTABILIZA if (UsuarioActual.Empresa.Funcionalidad(200).Equals("1") && MsgError.Equals("")) - { - //if (IDCtaContablePrestamo > 0 && IDCtaContableBancosPrestamo > 0) - //{ + { if (ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa)) { IDPoliza = ObjMov.ContaIdPoliza; @@ -627,19 +615,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas else { Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError); - } - //} - //else - //{ - // if (IDCtaContablePrestamo < 1) - // { - // Alert("No se puede contabilizar la Prepoliza debido a que la cuenta de Acreedor es invalida", TipoMensaje.MsgAdvertencia); - // } - // if (IDCtaContableBancosPrestamo < 1) - // { - // Alert("No se puede contabilizar la Prepoliza debido a que la cuenta bancaria es invalida", TipoMensaje.MsgAdvertencia); - // } - //} + } } if (MsgError.Equals("")) diff --git a/Bancos/ProductosFinancieros.aspx b/Bancos/ProductosFinancieros.aspx index a1d9317e9..48312c21d 100644 --- a/Bancos/ProductosFinancieros.aspx +++ b/Bancos/ProductosFinancieros.aspx @@ -41,7 +41,7 @@
- +
diff --git a/Bancos/ProductosFinancieros.aspx.vb b/Bancos/ProductosFinancieros.aspx.vb index fe23aa5fe..a4ec195f6 100644 --- a/Bancos/ProductosFinancieros.aspx.vb +++ b/Bancos/ProductosFinancieros.aspx.vb @@ -317,7 +317,7 @@ Partial Class Bancos_ProductosFinancieros Dim CtaCuenta = -1 If DtCuentas.Rows.Count = 1 Then - CtaCuenta = DtCuentas.Rows(0)("IdCtaContable").ToString.ToEntero + CtaCuenta = DtCuentas.Rows(0)("Id0CtaContable").ToString.ToEntero Else ErrorTransaccion = True End If diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 60c465d59..e4442af47 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -135,7 +135,6 @@ Partial Class Bancos_ProveedoresAbonar ViewState("CveProveedorSucursal") = value End Set End Property - Private Property PermiteModificarImporte As Boolean Get Return CType(ViewState("PermiteModificarImporte").ToString, Boolean) @@ -144,11 +143,6 @@ Partial Class Bancos_ProveedoresAbonar ViewState("PermiteModificarImporte") = value End Set End Property - Private ReadOnly Property IdCtaContComplementaria As Integer - Get - Return ViewState("IdCtaContComplementaria").ToString.ToEntero - End Get - End Property Private Property ComprobanteIE As String Get Return ViewState("ComprobanteIE").ToString @@ -859,41 +853,7 @@ Partial Class Bancos_ProveedoresAbonar MsgError = "No se pudo insertar la póliza" End If End If - - 'If UsuarioActual.CveEmpresa.Contiene(119, 158) AndAlso CveMoneda = 2 AndAlso CveMonedaFiltro = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES - ' 'fluctuación. - ' Dim TCPago = TxtTCDolares.Text.ToDecimal - - ' Dim ImporteFluctuacion As Decimal = 0 '((ImporteSeleccionado / TCPago) - TxtImporte.Text.ToDecimal) - - ' Dim DtPrePoliza As DataTable = Nothing - ' If ObjMov.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa) Then - ' DtPrePoliza = ObjMov.DtResultados.Copy - ' End If - - ' Dim PagoProveedoresME = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 312 AND TipoMovto = 0") - ' Dim Bancos = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 30 AND TipoMovto = 1") - ' Dim BancosComplementaria = DtPrePoliza.SUMD("ImporteMN", "CveConceptoContable = 204 AND TipoMovto = 1") - - ' DtPrePoliza.Dispose() - - ' ImporteFluctuacion = PagoProveedoresME - (Bancos + BancosComplementaria) - - ' If MsgError = "" AndAlso ImporteFluctuacion.RoundSQL() <> 0 Then - ' 'SI EL PAGO DE PROVEEDORES ME ES MAYOR QUE BANCOS METER EL CONCEPTO DE GANANCIA - ' If ImporteFluctuacion > 0 Then - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Referencia, 64, ConceptoMovimiento, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=Me.CveProveedor, CveCompra:=-1, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TipoCambio, TipoCambioPago:=TCPago) Then - ' MsgError = "Ocurrio un error al saldar el movimiento" - ' End If - ' ElseIf ImporteFluctuacion < 0 Then - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), Referencia, 65, ConceptoMovimiento, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=Me.CveProveedor, CveCompra:=-1, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TipoCambio, TipoCambioPago:=TCPago) Then - ' MsgError = "Ocurrio un error al saldar el movimiento" - ' End If - ' End If - ' End If - 'End If - - End If + End If If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then If ObjMov.ValorPolizaDescuadre > 0 Then diff --git a/Bancos/Reembolsos.aspx b/Bancos/Reembolsos.aspx index 680105dca..52d8d61d9 100644 --- a/Bancos/Reembolsos.aspx +++ b/Bancos/Reembolsos.aspx @@ -481,7 +481,7 @@ - + @@ -565,13 +565,7 @@ - - - IdCtaContProveedores - - - - + diff --git a/Bancos/Reembolsos.aspx.vb b/Bancos/Reembolsos.aspx.vb index 8ff5bedad..abdcb9314 100644 --- a/Bancos/Reembolsos.aspx.vb +++ b/Bancos/Reembolsos.aspx.vb @@ -26,14 +26,6 @@ Partial Class Bancos_Reembolsos ViewState("CveMoneda") = value End Set End Property - Private Property IdCuentaBancaria As Integer - Get - Return ViewState("IdCuentaBancaria").ToString.ToEntero - End Get - Set(value As Integer) - ViewState("IdCuentaBancaria") = value - End Set - End Property Private Property Beneficiario As String Get Return ViewState("Beneficiario").ToString @@ -262,7 +254,6 @@ Partial Class Bancos_Reembolsos If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero - IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero End If If HdnTipoTransaccion.Value = "Egs" Then @@ -394,7 +385,6 @@ Partial Class Bancos_Reembolsos If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero - IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero End If ''AC - Poliza Vieja @@ -606,7 +596,7 @@ Partial Class Bancos_Reembolsos 'AFECTAR MATRIZ EGRESOS Total = gvr.FCTextBox("TxtAbonar").Text.ToDouble - If Not ObjAC.AddMovimiento(IDPolizaNueva, gvr.DataKey("IdCtaContProveedores").ToEntero, False, Total, FolioPolizaNueva, ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True : Exit For + If Not ObjAC.AddMovimiento(IDPolizaNueva, 0, False, Total, FolioPolizaNueva, ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True : Exit For Else ErrorAC = True @@ -651,7 +641,7 @@ Partial Class Bancos_Reembolsos 'registro el movimiento en bancos y su comprobacion If GeneroCheque Then If Not ObjAC.AddMovimiento(IDPolizaVieja, IdCuentaBeneficiario, False, TxtImporteVinculado.Text.ToDouble, FolioPolizaVieja, ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True - If Not ObjAC.AddMovimiento(IDPolizaVieja, IdCuentaBancaria, True, TxtImporteVinculado.Text.ToDouble, FolioPolizaVieja, ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True + If Not ObjAC.AddMovimiento(IDPolizaVieja, 0, True, TxtImporteVinculado.Text.ToDouble, FolioPolizaVieja, ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True End If End If @@ -667,7 +657,7 @@ Partial Class Bancos_Reembolsos 'Poliza NUEVA If Not ErrorAC And IDPolizaNueva > 0 Then ConceptoRenglon = String.Format("Comprobación: {0}", Beneficiario) - If Not ObjAC.AddMovimiento(IDPolizaNueva, IdCuentaBancaria, True, TxtImporte.Text.ToDouble, FolioPolizaNueva, ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True + If Not ObjAC.AddMovimiento(IDPolizaNueva, 0, True, TxtImporte.Text.ToDouble, FolioPolizaNueva, ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True End If If Not ErrorAC And IDPolizaNueva > 0 Then @@ -775,7 +765,6 @@ Partial Class Bancos_Reembolsos If dr IsNot Nothing Then CveMoneda = dr("CveMoneda").ToString.ToEntero - IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero End If Else CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.ToDate, TxtFolio.Text.Trim, TxtAboneA.Text, TxtImporte.Text.ToDouble, CveMoneda, 0.0, TxtObservaciones.Text, "", ChkAbonoCuenta.Checked, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) @@ -901,7 +890,7 @@ Partial Class Bancos_Reembolsos Next ConceptoRenglon = String.Format("Pagado: {0}", TxtAboneA.Text) - If Not ObjAC.AddMovimiento(IDPoliza, IdCuentaBancaria, True, TxtImporte.Text.ToDouble, Referencia, ConceptoRenglon, 0, Fecha, "") Then + If Not ObjAC.AddMovimiento(IDPoliza, 0, True, TxtImporte.Text.ToDouble, Referencia, ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True End If @@ -1142,11 +1131,6 @@ Partial Class Bancos_Reembolsos 'recargo la moneda con la que se va a pagar 'Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta = " & DdlCuentaDiferencia.SelectedValue) - 'If dr IsNot Nothing Then - ' CveMoneda = dr("CveMoneda").ToString.ToEntero - ' IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero - 'End If - 'If HdnTipoTransaccion.Value = "Egs" Then ' Dim Folio As Long ' Dim Banco As New ClsBancos diff --git a/Bancos/RepEgresosSinComprobante.aspx.vb b/Bancos/RepEgresosSinComprobante.aspx.vb index 1dbe8f95b..fbf30577c 100644 --- a/Bancos/RepEgresosSinComprobante.aspx.vb +++ b/Bancos/RepEgresosSinComprobante.aspx.vb @@ -300,7 +300,6 @@ Partial Class Bancos_RepEgresosSinComprobante Try For Each gr As GridViewRow In GvPersonal.Rows If gr.FCCheckBox("Chk").Checked Then - Dim IdCtaContPersonal As Integer = 0 Dim CveConceptoContable As Integer Dim TipoMovtoOtIngresos As Boolean = True Dim TipoMovtoConcepto As Boolean = False diff --git a/Bancos/Transferencias.aspx b/Bancos/Transferencias.aspx index 701a2ed2c..612e4b413 100644 --- a/Bancos/Transferencias.aspx +++ b/Bancos/Transferencias.aspx @@ -181,7 +181,7 @@
- + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 0e2e4d47f..34f47fa43 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -4735,13 +4735,6 @@ Partial Class Compras_Compras 'INVENTARIOS EN AC Dim ContadorInventario As Integer = GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) - Dim CtaAlmacen As Integer - If ContadorInventario > 0 Then - Dim drr As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveAlmacen = {0}", GvInv.HeaderRow.FCDropDownList("ddlAlmacen").SelectedValue.ToString.ToEntero)) - If drr IsNot Nothing Then - CtaAlmacen = drr("IdCtaContable").ToString.ToEntero - End If - End If Dim tTotalIVA, tTotalGral, tDiferenciaIVA, tIVA, tRetIVA, tRetISR As Decimal Dim ipresup As Integer = 0 @@ -5536,7 +5529,6 @@ Partial Class Compras_Compras Dim DT As DataTable = Nothing Dim CuentasContablesInvalidas As New StringBuilder Dim ConceptoPersonal As String = "" - Dim IdCtaIVAXAcreditar As Integer = 0 Dim GuardoConcepto18 As Boolean = False 'Bancos (30) @@ -9741,7 +9733,6 @@ Partial Class Compras_Compras TmpDT.Columns.Add("OtrosGastos", GetType(Decimal)) TmpDT.Columns.Add("Total", GetType(Decimal)) TmpDT.Columns.Add("AsientoContableCompras", GetType(Integer)) - TmpDT.Columns.Add("IdCtaContCompras", GetType(Integer)) TmpDT.Columns.Add("Proyecto", GetType(String)) TmpDT.Columns.Add("CveProyecto", GetType(Integer)) TmpDT.Columns.Add("CveSubProyecto", GetType(Integer)) @@ -19718,7 +19709,7 @@ Partial Class Compras_Compras SBEliminacionCompra.Append($"Capturó: {LblUsuarioCaptura.Text}, ") SBEliminacionCompra.Append($"F Captura: {LitFechCaptura.Text}, ") - SBEliminacionCompra.Append($"Dealles:
") + SBEliminacionCompra.Append($"Detalles:
") For Each dRow As DataRow In TmpDT.Rows SBEliminacionCompra.Append($"-Cantidad: {dRow("Cantidad").ToString.ToDecimal().ToString("###,###,###.00") }, PS: {dRow("PS")}, Obs: {dRow("Obs")}, Sub Proyecto: {dRow("SubProyecto")}, Tipo Gasto: {dRow("TipoGasto")}, IVA: {dRow("IVA").ToString.ToDecimal.ToString("###,###,###.00")}, IEPSPS: {dRow("IEPSPS").ToString.ToDecimal.ToString("###,###,###.00") }
") Next diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 9ecc4b10e..8f69103cf 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -4365,11 +4365,6 @@ Partial Class Compras_Proveedores Dim row As DataRow = dt.Rows(0) CtaCodigo = CStr(row("CtaCodigo")) Codigo = CStr(row("Codigo")) - - 'If Not ObjProveedores.VincularCuentasContables(IdCtaContableProveedores, CtaCodigoProveedores, IdCtaContableAcreedores, CtaCodigoAcreedores, IdCtaContableAnticipos, CtaCodigoAnticipos, IdCtaContableDeudor, CtaCodigoDeudor, IdCtaContableDocsXPagar, CtaCodigoDocsXPagar, CveProveedor) Then - ' TieneError = True - 'End If - Else TieneError = True End If diff --git a/Compras/Reembolsos.aspx b/Compras/Reembolsos.aspx index 21370c79f..05673e9e8 100644 --- a/Compras/Reembolsos.aspx +++ b/Compras/Reembolsos.aspx @@ -412,7 +412,7 @@ - + @@ -494,13 +494,7 @@ - - - IdCtaContProveedores - - - - + diff --git a/Compras/ReembolsosComprobaciones.aspx b/Compras/ReembolsosComprobaciones.aspx index 2aeabc214..ca26d32be 100644 --- a/Compras/ReembolsosComprobaciones.aspx +++ b/Compras/ReembolsosComprobaciones.aspx @@ -320,7 +320,7 @@ + DataKeyNames="CveCompra,FechaCompra,CveProveedor,CveMoneda,Proveedor,SerieFolio,SubTotal,IVA,RetIVA,RetISR,IEPS,Total,TipoCambio,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto,CveSubProyecto,IVAPorPagar,NoDeducible"> @@ -413,13 +413,7 @@ - - - IdCtaContProveedores - - - - + Ot. Ing. diff --git a/Compras/RembolsosSinAsignar.aspx b/Compras/RembolsosSinAsignar.aspx index 9046f41a6..5688091b8 100644 --- a/Compras/RembolsosSinAsignar.aspx +++ b/Compras/RembolsosSinAsignar.aspx @@ -106,7 +106,7 @@ - + diff --git a/Compras/RepCxPDetalle.aspx.vb b/Compras/RepCxPDetalle.aspx.vb index f0016d615..3d81da2ae 100644 --- a/Compras/RepCxPDetalle.aspx.vb +++ b/Compras/RepCxPDetalle.aspx.vb @@ -343,38 +343,8 @@ Partial Class RepCxPDetalle DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) UPFiltros.Update() - End Sub - - Private Function CargaCuentasContables(DT As DataTable) As DataTable - - Dim ObjConpaq As New ClsContPAQi(UsuarioActual.Empresa) - Try - If ObjConpaq.GetCuentas(-1, -1, -1) Then - DTCuentasContables = ObjConpaq.DtResultados - - For Each Proveedor As DataRow In DT.Rows - If Proveedor("IdCtaContProveedores").ToString.ToEntero > 0 Then - - If Not DTCuentasContables.FiltraParametros($"Id = {Proveedor("IdCtaContProveedores").ToString }") Is Nothing Then - Proveedor("Cuenta") = DTCuentasContables.FiltroPrimeroValor("CuentaFormato", $"id = {Proveedor("IdCtaContProveedores").ToString.ToEntero }") - End If - - End If - Next - - DT.AcceptChanges() - Else - DTCuentasContables = New DataTable - End If - Catch ex As Exception - OnError("Ocurrió un error al cargar las cuentas contables", ex) - End Try - ObjConpaq.Dispose() - - Return DT - - End Function - + End Sub + Private Sub CargaDatos() Dim ObjMovtos As New ClsMovimientos() Try @@ -406,15 +376,12 @@ Partial Class RepCxPDetalle TMP_DTDatos.Columns.Add("Cuenta") If DdlGrupo.SelectedValue.ToEntero = 5 And UsuarioActual.Empresa.TipoContabilidad = 2 Then 'cuando es grupo por proveedor, se muestra la cuneta contable - TMP_DTDatos = CargaCuentasContables(TMP_DTDatos) + 'TMP_DTDatos = CargaCuentasContables(TMP_DTDatos) GvDatos.Columns(13).Visible = True Else GvDatos.Columns(13).Visible = False End If - DtDatos = TMP_DTDatos - - GvDatos.DataSource = DtDatos HplProgramar.NavigateUrl = $"/Bancos/RepProgramarRecursos.aspx{HttpContext.Current.Request.Url.PathAndQuery.Replace("/Compras/RepCxPDetalle.aspx", "")}" diff --git a/Compras/RepNotasCredito.aspx b/Compras/RepNotasCredito.aspx index 5c8f0bec3..d7f55adc9 100644 --- a/Compras/RepNotasCredito.aspx +++ b/Compras/RepNotasCredito.aspx @@ -108,7 +108,7 @@ + DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,CveTipoConcepto,TipoCambio,CveSubProyecto,SerieFolio"> diff --git a/Compras/RepRembolsoComprobaciones.aspx b/Compras/RepRembolsoComprobaciones.aspx index b9fe26db5..3b0965312 100644 --- a/Compras/RepRembolsoComprobaciones.aspx +++ b/Compras/RepRembolsoComprobaciones.aspx @@ -159,7 +159,7 @@
- + Compra @@ -242,13 +242,7 @@ - - - IdCtaContProveedores - - - - + diff --git a/Contabilidad/OCDetalleAlmacen.aspx.vb b/Contabilidad/OCDetalleAlmacen.aspx.vb index d9de21e2b..ee6c8e9f5 100644 --- a/Contabilidad/OCDetalleAlmacen.aspx.vb +++ b/Contabilidad/OCDetalleAlmacen.aspx.vb @@ -30,11 +30,8 @@ Partial Class Contabilidad_OCDetalleAlmacen Private Sub CargaDatos() - Dim ObjConta As New ClsContabilidad - - If ObjConta.GetOCDetalleAlmacen(100000D, UsuarioActual.CveEmpresa) Then If ObjConta.DtResultados.Rows.Count > 0 Then @@ -57,10 +54,8 @@ Partial Class Contabilidad_OCDetalleAlmacen End Sub - Protected Sub BtnProcesarRegistros_Click(sender As Object, e As EventArgs) - Dim ObjConta As New ClsContabilidad ObjConta.IniciaTransacSQL() @@ -84,31 +79,20 @@ Partial Class Contabilidad_OCDetalleAlmacen Dim CveCompra As Integer = GvDrow.DataKey("CveCompra").ToString.ToEntero Dim Folio As String = GvDrow.DataKey("Folio").ToString - - Dim CveCuenta176 As Integer = 0 - Dim IdCtaCuenta176 As Integer = 1245 - Dim IdCtaCuenta228 As Integer = 1247 - Dim IdCtaCuenta229 As Integer = 1249 - - Dim CveCuenta177 As Integer = 55294 - Dim IdCtaCuenta177 As Integer = 1148 - Dim Chk As CheckBox = GvDrow.FCCheckBox("Chk") - If Chk IsNot Nothing AndAlso Chk.Checked Then CvePrePoliza = ObjConta.AddPrePolizas(modulo, 74, Diferencia, Diferencia, CveMoneda, Fecha, Referencia, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3) GvDrow.Cells(1).Text = CvePrePoliza.ToString mensaje = mensaje & $"CvePrePoliza {CvePrePoliza } OC: {Folio} Importe :{Diferencia}
" - If CvePrePoliza > 0 Then If Cargo > Abono Then - If (ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, Diferencia, Diferencia, 176, Referencia, Referencia, ImporteME:=Diferencia, CveCompra:=CveCompra, Contabilizable:=1, CveOC:=CveOC, CveOCDetalle:=CveOCDetalle, CveProveedor:=CveProveedor)) Then + If (ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, Diferencia, Diferencia, 176, Referencia, Referencia, ImporteME:=Diferencia, CveCompra:=CveCompra, CveOC:=CveOC, CveOCDetalle:=CveOCDetalle, CveProveedor:=CveProveedor)) Then - If (ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, -Diferencia, -Diferencia, 177, Referencia, Referencia, CveCompra:=CveCompra, Contabilizable:=1, CveOC:=CveOC, CveOCDetalle:=CveOCDetalle, CveProveedor:=CveProveedor)) Then + If (ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, -Diferencia, -Diferencia, 177, Referencia, Referencia, CveCompra:=CveCompra, CveOC:=CveOC, CveOCDetalle:=CveOCDetalle, CveProveedor:=CveProveedor)) Then ContadorProcesados = ContadorProcesados + 1 Else ErrorProcesamiento = True diff --git a/Contabilidad/RegPoliza.aspx.vb b/Contabilidad/RegPoliza.aspx.vb index 564ecad8c..735828ee6 100644 --- a/Contabilidad/RegPoliza.aspx.vb +++ b/Contabilidad/RegPoliza.aspx.vb @@ -1186,7 +1186,7 @@ Partial Class RegPoliza 'If tCveSub <= 0 AndAlso drt("IdSegNeg").ToString.ToEntero = 0 Then 'toma el primero ' tCveSub = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero 'End If - If ObjConta.AddPrePolizasDetalle(tCvePrePoliza, drt("TipoMovto").ToString = "True", + If ObjConta.AddPrePolizasDetalle2(tCvePrePoliza, drt("TipoMovto").ToString = "True", drt("Importe").ToString.ToDecimal, drt("Concepto").ToString, 299, drt("Concepto").ToString, Now, diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index 7ccb3487a..5dfdb2eac 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -1080,11 +1080,11 @@ Partial Class ContabilidadC_RegPrePoliza End If If Importe <> 0 Then - If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero(), gvr.FCTextBox("TxtConcepto").Text, + If ObjMov.AddPrePolizasDetalle2(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero(), gvr.FCTextBox("TxtConcepto").Text, TxtFecha.Text.ToDate(), IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), CveIE:=CveIE, CveProveedor:=CveProveedor, CveCompra:=CveCompra, CvePersonal:=gvr.DataKey("CvePersonal").ToEntero(), CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero(), - ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), + CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), CveCliente:=gvr.DataKey("CveCliente").ToEntero(), CveVenta:=gvr.DataKey("CveVenta").ToEntero(), TipoCambio:=If(gvr.DataKey("TC").ToString().ToDecimal() > 0, gvr.DataKey("TC").ToString().ToDecimal(), 1), ImporteME:=If(gvr.DataKey("TC").ToString().ToDecimal() > 0, (Importe / (gvr.DataKey("TC").ToString().ToDecimal() - 1)).RoundSQL, 0), PorcentajeImpuesto:=gvr.DataKey("PorcentajeImpuesto").ToDecimal(), CveCuenta:=gvr.DataKey("CveCuenta").ToEntero()) Then @@ -1221,8 +1221,7 @@ Partial Class ContabilidadC_RegPrePoliza row.DataKey("CveConceptoContable").ToEntero(), row.FCTextBox("TxtConcepto").Text, Now, row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero(), 0, CveSubProyecto:=row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), CveTipoGasto:=If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), row.DataKey("CveTipoGasto").ToEntero()), - ImporteMX:=If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, - row.FCTextBox("TxtCargo").Text.ToDecimal(), row.FCTextBox("TxtAbono").Text.ToDecimal()), CveProveedor:=DdlProveedores.SelectedValue.ToEntero()) Then + CveProveedor:=DdlProveedores.SelectedValue.ToEntero()) Then OcurrioError = True Exit For End If @@ -2260,7 +2259,7 @@ Partial Class ContabilidadC_RegPrePoliza If YaExiste = False Then If IdCuenta > 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate(), IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then + If Not ObjConta.AddPrePolizasDetalle2(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate(), IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then TieneError = True Exit For End If diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index 421e49bb0..51afa5fbe 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -440,7 +440,7 @@
+ DataKeyNames="CvePrePolizaDetalle,CvePrePoliza,IdMov, CveConceptoContable, CveSubProyecto, CveTipoGasto,Referencia,CveVenta,CveCompra, CveProveedor, CveCliente, CvePersonal, CveCuenta, PorcentajeImpuesto,TipoMovto,EsComplementaria,EsMonedaExtranjera,Concepto,CveClasificacion,ContadoCuenta,ContadoTipoTransaccion,ContadoNumeroFolio,ContadoBeneficiario,ContadoObservaciones,ContadoImporte,TC,ImporteME,Cargo,Abono,CveIE" Width="100%" > Movimiento diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 89f724e8c..e8af9813c 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -398,7 +398,6 @@ Partial Class ContabilidadC_RegPrePolizaS .Add("CveTipoGasto", Type.GetType("System.Int32")) .Add("CvePrePolizaDetalle", Type.GetType("System.Int32")) .Add("CveConceptoContable", Type.GetType("System.Int32")) - .Add("IdCtaContable", Type.GetType("System.Int32")) .Add("ConceptoContable", Type.GetType("System.String")) .Add("CveCuenta", Type.GetType("System.Int32")) .Add("CodigoNombreCuenta", Type.GetType("System.String")) @@ -555,13 +554,6 @@ Partial Class ContabilidadC_RegPrePolizaS If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DataKey("IdCtaContable") <> "" Then - Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", e.Row.DataKey("IdCtaContable"))) - If drr IsNot Nothing Then - e.Row.FCLiteral("DdlCtaContable").Text = drr("CuentaFormato").ToString() + " - " + drr("Nombre").ToString() - End If - End If - TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDecimal + e.Row.DBCampo("Cargo").ToDecimal).ToString.FormatoNumero TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDecimal + e.Row.DBCampo("Abono").ToDecimal).ToString.FormatoNumero @@ -685,18 +677,6 @@ Partial Class ContabilidadC_RegPrePolizaS DdlCuentaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0")) End Sub - Private Function CargaCuentasContpaq(CveCuenta As Integer) As Integer - Dim Retorno As Integer = -1 - If CveCuenta > 0 Then - Dim ObjConta As New ClsContabilidad - If ObjConta.GetCuentas(CveCuenta, "-1", 1, UsuarioActual.CveEmpresa) Then - Retorno = ObjConta.DtResultados.Rows(0)("IdCompaq").ToString.ToEntero - End If - ObjConta.Dispose() - End If - Return Retorno - - End Function Private Sub CargaTiposGasto() DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa) DdlTipoGasto.DataBind() @@ -1006,9 +986,6 @@ Partial Class ContabilidadC_RegPrePolizaS 'inserto las compras que voy a pagarDdlSaldos For Each gvr As GridViewRow In Gv.Rows - 'If gvr.DataKey("IDCuenta").ToEntero > 0 Then - ' IdCtaContable = gvr.DataKey("IDCuenta") - 'End If 'Registra movimieno bancario If gvr.DataKey("CveConceptoContable").ToEntero = 30 AndAlso (gvr.DataKey("ContadoImporte").ToDecimal <> 0 OrElse TipoGrid = 1) Then @@ -1219,7 +1196,7 @@ Partial Class ContabilidadC_RegPrePolizaS End If If Not ObjContabilidad.UpdatePrePolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero, - row.DataKey("IdCtaContable").ToEntero, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, + If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), CveConceptoContable:=row.DataKey("CveConceptoContable").ToEntero, CveProveedor:=row.DataKey("CveProveedor").ToEntero, CveCompra:=row.DataKey("CveCompra").ToEntero, CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, @@ -1723,9 +1700,7 @@ Partial Class ContabilidadC_RegPrePolizaS ChkSeguir.Visible = True If DtMovimientos Is Nothing Then CreaDT() - Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero) Dim dr As DataRow = DtMovimientos.NewRow - dr("IdCtaContable") = IdCtaContable dr("CveCuenta") = DdlCuentaContableE.SelectedValue dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text @@ -1791,8 +1766,6 @@ Partial Class ContabilidadC_RegPrePolizaS End If If Rows.Count > 0 Then Dim dr As DataRow = Rows(0) - Dim IdCtaContable As Integer = CargaCuentasContpaq(DdlCuentaContableE.SelectedValue.ToEntero) - dr("IdCtaContable") = IdCtaContable dr("CveCuenta") = DdlCuentaContableE.SelectedValue dr("CodigoNombreCuenta") = DdlCuentaContableE.SelectedItem.Text dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text @@ -1929,7 +1902,6 @@ Partial Class ContabilidadC_RegPrePolizaS If CvePrePoliza > 0 Then Dim dr As DataRow = DtMovimientos.NewRow - dr("IdCtaContable") = -1 'DdlCtaContable.SelectedValue dr("CveCuenta") = DdlCuentaContable.SelectedValue dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text dr("CveConceptoContable") = DdlConceptosContables.SelectedValue @@ -2307,7 +2279,6 @@ Partial Class ContabilidadC_RegPrePolizaS .TipoTransferencia = "", .CveConceptoContable = row.Item("CveConceptoContable"), .CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1), - .IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1), .CveCuenta = row.Item("CveCuenta") }).QueryToDataTable(True) @@ -2415,7 +2386,7 @@ Partial Class ContabilidadC_RegPrePolizaS Dim CveSubProyecto As Integer = -1 Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True) Dim CveConceptoContable As Integer = GlobalDTContaConceptosContables(-1).FiltroPrimeroValor("CveConceptoContable", String.Format("ConceptoContable ='{0}'", Row("ConceptoAdministrativo").ToString.Trim)).ToEntero ' Row("CveConceptoContable").ToString.ToEntero - 'Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero + Dim CveClasificacion As Integer = -1 Dim CveCuentaExcel As Integer = -1 Dim ObjConta2 As New ClsContabilidad diff --git a/Contratos/FacturacionMasiva.aspx.vb b/Contratos/FacturacionMasiva.aspx.vb index d8277b01f..a39bb1f7b 100644 --- a/Contratos/FacturacionMasiva.aspx.vb +++ b/Contratos/FacturacionMasiva.aspx.vb @@ -83,19 +83,8 @@ Partial Class Contratos_FacturacionMasiva Set(value As Integer) ViewState("CveCicloComercial") = value End Set - End Property - - Private ReadOnly Property IdCtaContRetIVA As Integer - Get - Return ViewState("IdCtaContRetIVA").ToString.ToEntero - End Get End Property - Private ReadOnly Property IdCtaContRetISR As Integer - Get - Return ViewState("IdCtaContRetISR").ToString.ToEntero - End Get - End Property #End Region @@ -358,7 +347,6 @@ Partial Class Contratos_FacturacionMasiva TmpDT.Columns.Add("Total", GetType(Decimal)) 'Para uso del módulo contable TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer)) - TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer)) TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean)) TmpDT.Columns.Add("CveProyecto", GetType(Integer)) TmpDT.Columns.Add("Proyecto", GetType(String)) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 9c22e336a..c714d911f 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -3135,25 +3135,7 @@ Partial Class Inventarios_EntregaAlmacen GuardaLogAD($"Inventario/EntregaAlmacen | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") ErrorMovInv = True End If - End If - - 'Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1" - - 'If AutoConta And Not ErrorMovInv Then - ' Dim ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa) - - ' If IdCtaContable > 0 Then - ' If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then - ' Alert("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico") - ' ErrorMovInv = True - ' TextoError.AppendFormat("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico") - ' End If - ' Else - ' Alert(String.Format("No se puede contabilizar ya que falta asignación de las cuentas contables"), TipoMensaje.MsgAdvertencia) - ' End If - - ' ObjContPaq.Dispose() - 'End If + End If Else ErrorMovInv = True TextoError.AppendFormat("Ocurrió un Error al ingresar la prepoliza.1") diff --git a/Inventarios/RecepcionDevolucion.aspx.vb b/Inventarios/RecepcionDevolucion.aspx.vb index bb687ac11..0772d3a0e 100644 --- a/Inventarios/RecepcionDevolucion.aspx.vb +++ b/Inventarios/RecepcionDevolucion.aspx.vb @@ -601,7 +601,6 @@ Partial Class Inventarios_RecepcionDevolucion TmpDT.Columns.Add("Total", GetType(Decimal)) 'Para uso del módulo contable TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer)) - TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer)) TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean)) TmpDT.Columns.Add("CveProyecto", GetType(Integer)) TmpDT.Columns.Add("Proyecto", GetType(String)) diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index 8f7c3e088..bd70633e0 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -2708,7 +2708,6 @@ Partial Class Inventarios_RecepcionUsados TmpDT.Columns.Add("Total", GetType(Decimal)) 'Para uso del módulo contable TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer)) - TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer)) TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean)) TmpDT.Columns.Add("CveProyecto", GetType(Integer)) TmpDT.Columns.Add("Proyecto", GetType(String)) diff --git a/Inventarios/Remanufactura.aspx.vb b/Inventarios/Remanufactura.aspx.vb index f6b5f5806..26cc9aa47 100644 --- a/Inventarios/Remanufactura.aspx.vb +++ b/Inventarios/Remanufactura.aspx.vb @@ -16,18 +16,6 @@ Partial Class Inventarios_Remanufactura ViewState("ErrorList") = value End Set End Property - - Private ReadOnly Property IdCtaContRetIVA As Integer - Get - Return ViewState("IdCtaContRetIVA").ToString.ToEntero - End Get - End Property - - Private ReadOnly Property IdCtaContRetISR As Integer - Get - Return ViewState("IdCtaContRetISR").ToString.ToEntero - End Get - End Property Private Property MensajeAlert As StringBuilder Get Return CType(ViewState("MensajeAlert"), StringBuilder) diff --git a/Nomina/CatConceptos.aspx.vb b/Nomina/CatConceptos.aspx.vb index 6b2659272..b3535e01e 100644 --- a/Nomina/CatConceptos.aspx.vb +++ b/Nomina/CatConceptos.aspx.vb @@ -273,7 +273,6 @@ Partial Class Nomina_CatConceptos Dim CveConceptoContable As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlConceptoContable"), DropDownList).SelectedValue Dim EsRetencion As Boolean = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("ChkRetencion"), CheckBox).Checked Dim CveClasificacion As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlClasificacion"), DropDownList).SelectedValue - Dim IdCtaContable As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlCtaContable"), DropDownList).SelectedValue If ObjNomina.UpdateConcepto(Codigo, Concepto, Tipo, Formula, Sistema, TipoCalculo, Estado, CveConceptoPadre, CveConcepto, UsuarioActual.CveEmpresa, CveConceptoContable, EsRetencion, CveClasificacion, IdCtaContable) Then GvDatos.EditIndex = -1 diff --git a/Nomina/ConceptoNomina.aspx.cs b/Nomina/ConceptoNomina.aspx.cs index b89504546..812c420ba 100644 --- a/Nomina/ConceptoNomina.aspx.cs +++ b/Nomina/ConceptoNomina.aspx.cs @@ -371,8 +371,8 @@ public partial class Nomina_CatConcepto : ClsPaginas if (EsEditar) { TieneError = !ObjNomina.UpdateConcepto(codigo, concepto, tipo, formula, sistema, estado, CveConceptoPadre, CveConcepto, retencion, CveClasificacion, - IdCtaContable, CveTipoGasto, tipoCalculo, CveConceptoContable, AplicaFiniquito, AutomaticoGlobal, Especie, Imprimir, CveSATConcepto, - UsuarioActual.CveEmpresa, ctaImporteNegativoProv, contabiliza, CargoOAbono, cveConceptoContableB , IdCtaContableB , CveCuentaB, CveConceptoContablePasivo); + CveTipoGasto, tipoCalculo, CveConceptoContable, AplicaFiniquito, AutomaticoGlobal, Especie, Imprimir, CveSATConcepto, + UsuarioActual.CveEmpresa, ctaImporteNegativoProv, contabiliza, CargoOAbono, cveConceptoContableB , CveCuentaB, CveConceptoContablePasivo); if (!TieneError) { @@ -403,8 +403,8 @@ public partial class Nomina_CatConcepto : ClsPaginas else { CveConcepto = ObjNomina.AddConcepto(codigo, concepto, tipo, formula, sistema, estado, CveConceptoPadre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, - retencion, CveClasificacion, IdCtaContable, CveTipoGasto, tipoCalculo, CveConceptoContable, AplicaFiniquito, AutomaticoGlobal, Especie, Imprimir, - CveSATConcepto, ctaImporteNegativoProv, contabiliza, CargoOAbono, cveConceptoContableB, IdCtaContableB, CveCuentaB, CveConceptoContablePasivo); + retencion, CveClasificacion, CveTipoGasto, tipoCalculo, CveConceptoContable, AplicaFiniquito, AutomaticoGlobal, Especie, Imprimir, + CveSATConcepto, ctaImporteNegativoProv, contabiliza, CargoOAbono, cveConceptoContableB, CveCuentaB, CveConceptoContablePasivo); diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index a5794bbb0..9e38ece92 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -1365,7 +1365,7 @@ + DataKeyNames="CveMovtoPermanente,CveConcepto,CveCuenta,CvePersonal,Descripcion,TipoDescuento,Valor,VecesAplicar,MontoLimite,FechaInicioAplicacion,Estatus,FechaRegistro"> diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 7f3deaf23..0bf1e6dc0 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -7111,8 +7111,7 @@ public partial class Nomina_Nomina2 : ClsPaginas CcveMovtoPermanente = gvRow.DataKey("CveMovtoPermanente").ToEntero(); int cveConcepto = gvRow.DataKey("CveConcepto").ToEntero(); int cvePersonal = gvRow.DataKey("CvePersonal").ToEntero(); - int CveCuenta = gvRow.DataKey("CveCuenta").ToEntero(); - int IdCtaContable = gvRow.DataKey("IdCtaContable").ToEntero(); + int CveCuenta = gvRow.DataKey("CveCuenta").ToEntero(); string descripcion = gvRow.DataKey("Descripcion"); int tipoDescuento = gvRow.DataKey("TipoDescuento").ToEntero(); double valor = gvRow.DataKey("Valor").ToDouble(); diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index d03538694..62ba9c921 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -3037,8 +3037,8 @@ Partial Class OC_OC ImporteMEComp = (DiferenciaInvOC - ImporteME).RoundSQL() 'COMPLEMENTARIA - 'If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteME, SerieFolio, 232, SerieFolio, Fecha, If(ConceptoSalida = 0, IdCtaContableAlmacen, IdCtaContableRecepcionOCERME), -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteME, ImporteME:=ImporteME, CveCuenta:=CveCuentaAlmacen, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then - ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMEComp, SerieFolio, 233, SerieFolio, Fecha, IdCtaContableRecepcionOCERComplementaria, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteMEComp, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then + 'If ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteME, SerieFolio, 232, SerieFolio, Fecha, If(ConceptoSalida = 0, 0, IdCtaContableRecepcionOCERME), -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteME, ImporteME:=ImporteME, CveCuenta:=CveCuentaAlmacen, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMEComp, SerieFolio, 233, SerieFolio, Fecha, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteMEComp, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then ' TieneError = True ' Exit For ' End If @@ -3102,7 +3102,6 @@ Partial Class OC_OC ' DiferenciaInvOC = DtInvOCDiferencias.SUMD("Diferencia", $"CveAlmacen = {CveAlmacen} And CveMovimiento = {CveMovimientoAlmacen} And ConceptoSalida = {ConceptoSalida}") ' TCInvOC = DtInvOCDiferencias.FiltroPrimeroValor("TipoCambioAjuste", $"CveAlmacen = {CveAlmacen} And CveMovimiento = {CveMovimientoAlmacen} And ConceptoSalida = {ConceptoSalida}").ToDecimal - ' IdCtaContableAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {DrDiferencias("CveAlmacen").ToString.ToEntero}").ToEntero ' 'MODIFICACIÓN CONCEPTO ' If ConceptoSalida = 0 Then @@ -8207,9 +8206,9 @@ Partial Class OC_OC 'DtInvOC.FiltraParametros($"CvePS > 0 AND CveOrdenCompraDetalle = {GvD.DataKeys("CveOrdenCompraDetalle").ToString}").Copy() 'If CveMonedaOC = 1 Then - ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteME, SerieFolio, 228, ConceptoPartida, Fecha, IdCtaContableRecepcionOCME, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteME, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then - ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMEComp, SerieFolio, 229, ConceptoPartida, Fecha, IdCtaContableRecepcionOCComplementaria, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteMEComp, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then - ' If DifImporte <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifImporte, SerieFolio, 69, ConceptoPartida, Fecha, IdCtaContable69, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DifImporte, ImporteME:=DifImporte, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle, CveClasificacion:=CveClasificacionCostoOC) Then + ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteME, SerieFolio, 228, ConceptoPartida, Fecha, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteME, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then + ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMEComp, SerieFolio, 229, ConceptoPartida, Fecha, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=ImporteMEComp, ImporteME:=ImporteME, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle) Then + ' If DifImporte <> 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DifImporte, SerieFolio, 69, ConceptoPartida, Fecha, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=DifImporte, ImporteME:=DifImporte, TipoCambio:=TCInvOC, CveOCDetalle:=CveOCDetalle, CveClasificacion:=CveClasificacionCostoOC) Then ' Retorno = False ' Exit For ' End If @@ -8247,22 +8246,6 @@ Partial Class OC_OC ' Dim TipoMoneda As String = ObjInv.DtResultados.FiltroPrimeroValor("CveMoneda") ' Dim ObjConta As New ClsContabilidad - ' Dim IdCtaContableOC As Integer = 0 - ' Dim IdCtaContableOCME As Integer = 0 - ' Dim IdCtaContableOCComplementaria As Integer = 0 - - ' If ObjConta.GetRetCuenta(176, UsuarioActual.CveEmpresa) Then - ' IdCtaContableOC = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero - ' End If - - ' If ObjConta.GetRetCuenta(228, UsuarioActual.CveEmpresa) Then - ' IdCtaContableOCME = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero - ' End If - - ' If ObjConta.GetRetCuenta(229, UsuarioActual.CveEmpresa) Then - ' IdCtaContableOCComplementaria = ObjConta.DtResultados.FiltroPrimeroValor("IdCtaContable").ToEntero - ' End If - ' Dim LugarEntrega = If(txtLugarEntrega.Text.Trim = "", "-1", txtLugarEntrega.Text.Trim) ' LugarEntrega = If(DivLugarEntrega1.Visible, LugarEntrega, If(TxtLugarEntregaDirecta.Visible, TxtLugarEntregaDirecta.Text.Trim, "")) @@ -8287,9 +8270,9 @@ Partial Class OC_OC ' Dim PrimerImporte As Integer = (0 - LblSubTotal.Text.ToDecimal) ' Dim SegundoImporte As Integer = (0 - LblSubTotal.Text.ToDecimal) - ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, PrimerImporte, lblFolio.Text, 228, lblFolio.Text, Now, IdCtaContableOCME, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then - ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SegundoImporte, lblFolio.Text, 229, lblFolio.Text, Now, IdCtaContableOCComplementaria, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then - ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, PrimerImporte + SegundoImporte, lblFolio.Text, 176, lblFolio.Text, Now, IdCtaContableOC, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then + ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, PrimerImporte, lblFolio.Text, 228, lblFolio.Text, Now, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then + ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SegundoImporte, lblFolio.Text, 229, lblFolio.Text, Now, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, PrimerImporte + SegundoImporte, lblFolio.Text, 176, lblFolio.Text, Now, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then ' Err = True ' Else ' If Not OC.UpdateOrdenCompra(-1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, ChkCotizacion.Checked, If(TxtFechaEstimadaEntrega.Text.Trim = "", "-1", TxtFechaEstimadaEntrega.Text.Trim), @@ -8324,9 +8307,9 @@ Partial Class OC_OC ' If CvePrePoliza > 0 Then ' Dim PrimerImporte As Decimal = Decimal.Round(((LblSubTotal.Text.ToDecimal) / TxtTCCambioMoneda.Text.ToDecimal), 2, MidpointRounding.AwayFromZero) ' Dim SegundoImporte As Decimal = LblSubTotal.Text.ToDecimal - ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, PrimerImporte, lblFolio.Text, 228, lblFolio.Text, Now, IdCtaContableOCME, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then - ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SegundoImporte, lblFolio.Text, 229, lblFolio.Text, Now, IdCtaContableOCComplementaria, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then - ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, (0 - (PrimerImporte + SegundoImporte)), lblFolio.Text, 176, lblFolio.Text, Now, IdCtaContableOC, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then + ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, PrimerImporte, lblFolio.Text, 228, lblFolio.Text, Now, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then + ' If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SegundoImporte, lblFolio.Text, 229, lblFolio.Text, Now, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, (0 - (PrimerImporte + SegundoImporte)), lblFolio.Text, 176, lblFolio.Text, Now, 0, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacenVenta, CveOC:=CveOrdenCompra) Then ' Err = True ' Else ' If Not OC.UpdateOrdenCompra(-1, TxtDescrip.Text, TxtJustificacion.Text, DdlPrioridad.SelectedValue.ToEntero, ChkCotizacion.Checked, If(TxtFechaEstimadaEntrega.Text.Trim = "", "-1", TxtFechaEstimadaEntrega.Text.Trim), diff --git a/OS/RecepcionEntrega.aspx.vb b/OS/RecepcionEntrega.aspx.vb deleted file mode 100644 index a5cfc9fc8..000000000 --- a/OS/RecepcionEntrega.aspx.vb +++ /dev/null @@ -1,1368 +0,0 @@ -Option Strict On -Option Explicit On - -Imports System.Data -Imports Extensiones - -Partial Class Inventarios_RecepcionEntrega - Inherits ClsPaginas - -#Region "PROPIEDADES" - Private Property DtDatos As DataTable - Get - Return CType(ViewState("DtDatos"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtDatos") = value - End Set - End Property - Private Property DtDatosDetalle As DataTable - Get - Return CType(ViewState("DtDatosDetalle"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtDatosDetalle") = value - End Set - End Property - Private Property PSSerieLote As String - Get - Return CType(ViewState("PSSerieLote"), String) - End Get - Set(value As String) - ViewState("PSSerieLote") = value - End Set - End Property - Private Property CveConsecSerieLote As Integer - Get - Return CType(ViewState("CveConsecSerieLote"), Integer) - End Get - Set(value As Integer) - ViewState("CveConsecSerieLote") = value - End Set - End Property - Private Property CvePSSerieLote As Integer - Get - Return CType(ViewState("CvePSSerieLote"), Integer) - End Get - Set(value As Integer) - ViewState("CvePSSerieLote") = value - End Set - End Property - Private Property CveUMSerieLote As Integer - Get - Return CType(ViewState("CveUMSerieLote"), Integer) - End Get - Set(value As Integer) - ViewState("CveUMSerieLote") = value - End Set - End Property - Private Property CveVentaSurtir As Integer - Get - Return CType(ViewState("CveVentaSurtir"), Integer) - End Get - Set(value As Integer) - ViewState("CveVentaSurtir") = value - End Set - End Property - Private Property CveContrato As Integer - Get - Return CType(ViewState("CveContrato"), Integer) - End Get - Set(value As Integer) - ViewState("CveContrato") = value - End Set - End Property - Private Property CveAlmacenTraspasoOrigen As Integer - Get - Return CType(ViewState("CveAlmacenTraspasoOrigen"), Integer) - End Get - Set(value As Integer) - ViewState("CveAlmacenTraspasoOrigen") = value - End Set - End Property - Private Property CveAlmacenTraspasoDestino As Integer - Get - Return CType(ViewState("CveAlmacenTraspasoDestino"), Integer) - End Get - Set(value As Integer) - ViewState("CveAlmacenTraspasoDestino") = value - End Set - End Property - Private Property TipoMovimiento As Integer - Get - Return CType(ViewState("TipoMovimiento"), Integer) - End Get - Set(value As Integer) - ViewState("TipoMovimiento") = value - End Set - End Property - Private Property TipoDocto As String - Get - Return CType(ViewState("TipoDocto"), String) - End Get - Set(value As String) - ViewState("TipoDocto") = value - End Set - End Property - Private Property DtExistencias As DataTable - Get - Return CType(ViewState("DtExistencias"), DataTable) - End Get - Set(value As DataTable) - ViewState("DtExistencias") = value - End Set - End Property - Private Property RowIndexCantidadEspecial As Integer - Get - Return CType(ViewState("RowIndexCantidadEspecial"), Integer) - End Get - Set(value As Integer) - ViewState("RowIndexCantidadEspecial") = value - End Set - End Property - Private Property CantidadEspecialTemp As Decimal - Get - Return CType(ViewState("CantidadEspecialTemp"), Decimal) - End Get - Set(value As Decimal) - ViewState("CantidadEspecialTemp") = value - End Set - End Property - Private Property EsDevolucionVenta As Integer - Get - Return CType(ViewState("EsDevolucionVenta"), Integer) - End Get - Set(value As Integer) - ViewState("EsDevolucionVenta") = value - End Set - End Property - Private Property CveVendedor As Integer - Get - Return CType(ViewState("CveVendedor"), Integer) - End Get - Set(value As Integer) - ViewState("CveVendedor") = value - End Set - End Property - Private Property CveCliente As Integer - Get - Return CType(ViewState("CveCliente"), Integer) - End Get - Set(value As Integer) - ViewState("CveCliente") = value - End Set - End Property - - Private Property CveMovimiento As Integer - Get - Return CType(ViewState("CveMovimiento"), Integer) - End Get - Set(value As Integer) - ViewState("CveMovimiento") = value - End Set - End Property -#End Region - - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not IsPostBack Then - - InicializaValores() - - End If - End Sub - - -#Region " Inicializa Valores " - Private Sub InicializaValores() - CveVendedor = -1 - CveCliente = -1 - - DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa) - DdlClientes.DataBind() - DdlClientes.Items.Insert(0, New ListItem("Seleccione", "-1")) - - DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) - DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1")) - DdlAlmacen.SelectedValue = "-1" - DdlAlmacen.DataBind() - DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen) - 'DdlAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1")) - - DdlFolio.Items.Insert(0, New ListItem("Seleccione", "-1")) - - TxtFechaPendientes.Text = Now.ToShortDateString - TxtFechaCaducidad.Text = Now.ToShortDateString - TxtFecha.Text = Now.ToShortDateString - - DdlSucursal.DataSource = GlobalDTSucursales.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - DdlSucursal.DataBind() - DdlSucursal.SelectedValueExist(UsuarioActual.CveSucursal.ToString) - If UsuarioActual.TienePermisoProceso(152) Then DdlSucursal.Enabled = False - - CreaDtDetalle() - CargaPendientes() - End Sub - -#End Region - - -#Region " CARGA PENDIENTES POR SURTIR " - Protected Sub DdlCliente_SelectedIndexChanged(sender As Object, e As EventArgs) - CargaFolios() - End Sub - Private Sub CargaFolios() - Dim ObjInventarios As New ClsInventarios - - DdlFolio.Items.Clear() - - If DdlClientes.SelectedValue.ToEntero > 0 Then - If ObjInventarios.VentasPendientesAlmacenGet(DdlClientes.SelectedValue.ToEntero, MinFecha, DdlSucursal.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then - DdlFolio.DataSource = ObjInventarios.DtResultados - Else - Alert("Ocurrió un error al obtener las Compras pendientes de recibir del proveedor. Por favor vuelva a intentar", TipoMensaje.MsgError) - End If - End If - - ObjInventarios.Dispose() - - DdlFolio.DataBind() - DdlFolio.Items.Insert(0, New ListItem("Seleccione", "-1")) - UpFiltros.Update() - End Sub - Protected Sub TimmerRefresh_Tick(sender As Object, e As EventArgs) - CargaPendientes() - End Sub - Protected Sub BtnConsultarPendientes_Click(sender As Object, e As EventArgs) - CargaPendientes() - End Sub - Private Sub CargaPendientes() - Dim ObjInventarios As New ClsInventarios - Dim DtPendientes As New DataTable - - If ObjInventarios.VentasPendientesAlmacenGet(-1, TxtFechaPendientes.Text.ToDate, DdlSucursal.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then - DtPendientes = ObjInventarios.DtResultados - 'If DtPendientes.Rows.Count > 0 Then - ' TipoMovimiento = If(DtPendientes.Rows(0)("TipoDocto").ToString.Contiene({"Rem", "Ing"}), 1, 2) - 'End If - Else - DtPendientes = Nothing - Alert("Ocurrió un error al obtener las Compras pendientes de recibir del proveedor. Por favor vuelva a intentar", TipoMensaje.MsgError) - End If - - ObjInventarios.Dispose() - - If DtPendientes IsNot Nothing Then - GVPendientes.DataSource = DtPendientes - End If - - LtActualizado.Text = String.Format("Actualizado: {0}", Now.ToString("H:mm")) - - GVPendientes.DataBind() - UpPendientes.Update() - End Sub - Protected Sub GVPendientes_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVPendientes.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - e.Row.FCLinkButton("BtnSurtir").CommandArgument = e.Row.DBCampo("CveVenta") - - If e.Row.DBCampo("TipoDocto").ToString.Contiene({"Rem", "Ing", "Ped"}) And e.Row.DBCampo("EsDevolucionVenta").ToString.ToEntero = 0 Then - e.Row.FCLinkButton("BtnSurtir").CssClass = "btn btn-primary " - e.Row.FCLinkButton("BtnSurtir").Text = " Surtir " - Else - e.Row.FCLinkButton("BtnSurtir").CssClass = "btn yellow-gold " - e.Row.FCLinkButton("BtnSurtir").Text = " Recibir" - End If - - End If - End Sub - -#End Region - - -#Region " CARGA VENTA POR SURTIR " - Protected Sub BtnSurtir_Click(sender As Object, e As EventArgs) - If CType(sender, LinkButton).CommandArgument.ToEntero > 0 Then - CargaVentaPorSurtir(CType(sender, LinkButton).CommandArgument.ToEntero) - TimmerRefresh.Enabled = False - End If - End Sub - Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs) - CargaVentaPorSurtir(DdlFolio.SelectedValue.ToEntero) - End Sub - Private Sub CargaVentaPorSurtir(CveVenta As Integer) - LbSurtida.Visible = False - CveContrato = -1 - - Dim ObjInventario As New ClsInventarios - - If ObjInventario.EntregaAlmacenGet(CveVenta) Then - If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then - - - DtDatos = ObjInventario.DtResultados - DtDatos.Columns.Add("Consec", GetType(Integer)) - DtDatos.Columns.Add("CantidadGV", GetType(Double)) - DtDatos.Columns.Add("CantidadTraspaso", GetType(Double)) - Dim Index = 1 - For Each Dr As DataRow In DtDatos.Rows - Dr("Consec") = Index - Index += 1 - Next - - DtDatosDetalle = Nothing - CreaDtDetalle() - - If DtDatos.Rows(0) IsNot Nothing Then - EsDevolucionVenta = DtDatos.Rows(0)("EsDevolucionVenta").ToString.ToEntero - TipoMovimiento = If(DtDatos.Rows(0)("TipoDocto").ToString.Contiene({"Rem", "Ing", "Ped"}) And EsDevolucionVenta = 0, 1, 2) - TipoDocto = DtDatos.Rows(0)("TipoDocto").ToString - LbCliente.Text = DtDatos.Rows(0)("Nombre").ToString - LbFolio.Text = DtDatos.Rows(0)("SerieFolio").ToString - LbOberservaciones.Text = DtDatos.Rows(0)("Observaciones").ToString - CveVentaSurtir = CveVenta - CveAlmacenTraspasoDestino = DtDatos.Rows(0)(If(EsDevolucionVenta = 1, "CveAlmacenTraspasoOrigen", "CveAlmacenTraspasoDestino")).ToString.ToEntero - CveAlmacenTraspasoOrigen = DtDatos.Rows(0)(If(EsDevolucionVenta = 1, "CveAlmacenTraspasoDestino", "CveAlmacenTraspasoOrigen")).ToString.ToEntero - CveContrato = DtDatos.Rows(0)("CveContrato").ToString.ToEntero - CveVendedor = DtDatos.Rows(0)("CveVendedor").ToString.ToEntero - CveCliente = DtDatos.Rows(0)("CveCliente").ToString.ToEntero - - - If DtDatos.SUM("CantidadS") <= 0 Then - GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario gvEscondeColumna" - Else - GvDatos.CssClass = "table table-striped table-hover Widthall ScrollAD gvInventario" - End If - - If CveAlmacenTraspasoDestino > 0 Then - DivTipoCambioAdvertencia.Visible = True - LtTipoCambioAdvertencia.Text = $"Los productos seran Trasladados al Almacen: {GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {CveAlmacenTraspasoDestino}")}" - Else - DivTipoCambioAdvertencia.Visible = False - End If - - DdlAlmacen.Items.Clear() - If CveAlmacenTraspasoOrigen > 0 Then - DdlAlmacen.Items.Insert(0, New ListItem(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {CveAlmacenTraspasoOrigen}"), CveAlmacenTraspasoOrigen.ToString)) - Else - DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen IN (1,2)") 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) - End If - DdlAlmacen.DataBind() - DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1")) - DdlAlmacen.SelectedValue = "-1" - DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen) - If CveAlmacenTraspasoOrigen > 0 Then - DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen) - End If - - - TxtFecha.Text = DtDatos.Rows(0)("Fecha").ToString - End If - - If UsuarioActual.Empresa.Funcionalidad(132) = "1" Then - DivCodigoSeriePS.Visible = True - Else - DivCodigoSeriePS.Visible = False - End If - - If TipoMovimiento = 2 Then - Dim Filtro = If(ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString.Contiene({"Ing", "Dev"}), "CveConcepto = 3", "CveConcepto = 9") - If ObjInventario.GetInv_Mov(ObjInventario.DtResultados.Rows(0)("CveVentaPadre").ToString.ToEntero, UsuarioActual.CveEmpresa) Then - DtExistencias = ObjInventario.DtResultados.FiltraParametros($"CvePS Is Not NULL AND {Filtro}") - - If Not DtExistencias.Rows.Count > 0 Then - Alert("La Venta original de la Devolución no tiene salida de Almacén.", TipoMensaje.MsgAdvertencia) - End If - - Else - Alert("Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar.", TipoMensaje.MsgError) - End If - End If - - - Else - Alert("No se encontraron productos pendientes por surtir. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - End If - Else - DtDatos = Nothing - End If - - ObjInventario.Dispose() - UpGenerales.Update() - CargaGvDatos() - End Sub - Private Sub CargaGvDatos() - If DtDatos IsNot Nothing Then - GvDatos.DataSource = DtDatos - End If - - GvDatos.DataBind() - UpDatos.Update() - UpVenta.Update() - End Sub - - Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - - If e.Row.DBCampo("Inv_CveMetodoInventario") = "5" Then - e.Row.FCButton("BtnSerieLote").Visible = True - e.Row.FCButton("BtnSerieLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec")) - e.Row.FCTextBox("TbCantidadF").Enabled = False - e.Row.FCCheckBox("cbInv").Enabled = False - Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DBCampo("Consec"))).Rows.Count - e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString - 'e.Row.FCTextBox("TbCantidadF").Text = "0" - Else - e.Row.FCButton("BtnSerieLote").Visible = False - e.Row.FCTextBox("TbCantidadF").Enabled = True - e.Row.FCTextBox("TbCantidadF").Attributes.Add("onblur", String.Format("ValidarCantidad(this, {0})", e.Row.DBCampo("CantidadF"))) - End If - - - 'FUNCIONALIDAD PISTOLA DE CODIGOS - If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then - e.Row.FCTextBox("TbCantidadF").Enabled = False - End If - - End If - End Sub -#End Region - - -#Region " AGREGA POR SERIE/LOTE " - Private Sub CreaDtDetalle() - If DtDatosDetalle Is Nothing Then - DtDatosDetalle = New DataTable - DtDatosDetalle.Columns.Add("CveVentaDetalle", GetType(Integer)) - DtDatosDetalle.Columns.Add("Consec", GetType(Integer)) - DtDatosDetalle.Columns.Add("ConsecId", GetType(Integer)) - DtDatosDetalle.Columns.Add("CvePS", GetType(Integer)) - DtDatosDetalle.Columns.Add("PS", GetType(String)) - DtDatosDetalle.Columns.Add("CveUM", GetType(Integer)) - DtDatosDetalle.Columns.Add("SerieLote", GetType(String)) - DtDatosDetalle.Columns.Add("FechaCaducidad", GetType(String)) - DtDatosDetalle.Columns.Add("FueTraspaso", GetType(Integer)) - End If - End Sub - - Private Sub CargaSerie() - - 'RegistraScript("document.getElementById(""TxtSerieLote"").focus();") - - Dim AplicaCaducidad = False - If GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS = {0}", CvePSSerieLote)).Rows(0) IsNot Nothing Then - AplicaCaducidad = If(GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS = {0}", CvePSSerieLote)).Rows(0)("AplicaCaducidad").ToString = "True", True, False) - End If - - If AplicaCaducidad Then - GvSerie.Columns(1).Visible = True - TdCaducidad1.Visible = True - TdCaducidad2.Visible = True - Else - GvSerie.Columns(1).Visible = False - TdCaducidad1.Visible = False - TdCaducidad2.Visible = False - End If - - GvSerie.DataSource = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerieLote), "Consec DESC") - GvSerie.DataBind() - - 'VALIDA QUE SIGA AGREGANDO - If DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerieLote)).Rows.Count = LbCantidad.Text.ToEntero Then - BtnAgregarPS.Enabled = False - Else - BtnAgregarPS.Enabled = True - End If - - 'SERIE LOTE RECOMENDADO - Dim DtSerieLote As New DataTable - If TipoMovimiento = 1 Then - Dim ObjInventarios As New ClsInventarios - If ObjInventarios.SerieLoteRecomendadoGet(CvePSSerieLote, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero) Then - DtSerieLote = ObjInventarios.DtResultados - End If - ObjInventarios.Dispose() - Else - DtSerieLote = DtExistencias.FiltraParametros("SerieLote <> ''") - End If - - Dim DrsRemove As New List(Of DataRow) - - If DtSerieLote.Rows.Count > 0 Then - 'CALCULA YA COMPLETADOS - DtSerieLote.Columns.Add("CantidadSeleccionada", GetType(Integer)) - For Each dr As DataRow In DtSerieLote.Rows - dr("CantidadSeleccionada") = DtDatosDetalle.FiltraParametros(String.Format("Consec = {0} AND SerieLote = '{1}'", CveConsecSerieLote, dr("SerieLote"))).Rows.Count - If dr("CantidadSeleccionada").ToString.ToDecimal = dr("Existencia").ToString.ToDecimal Then - DrsRemove.Add(dr) - End If - Next - - 'ELIMINA YA COMPLETADOS EN PAGINA - For Each dr As DataRow In DrsRemove - DtSerieLote.Rows.Remove(dr) - Next - - If DtSerieLote.Rows.Count > 0 Then - Dim Mensaje As New StringBuilder - Mensaje.AppendFormat("Serie / Lote Recomendado: {0}", DtSerieLote.Rows(0)("SerieLote")) - If AplicaCaducidad Then Mensaje.AppendFormat(", Caducicdad: {0}", DtSerieLote.Rows(0)("FechaCaducidad").ToString.ToDate.ToShortDateString) - LbSerieLoteRecomendado.Text = Mensaje.ToString 'String.Format("Serie / Lote Recomendado: {0}, Caducicdad: {1}", ObjInventarios.DtResultados.Rows(0)("SerieLote"), ObjInventarios.DtResultados.Rows(0)("FechaCaducidad").ToString.ToDate.ToShortDateString) - Else - LbSerieLoteRecomendado.Text = "No se encontro ningun Serie/Lote." - End If - Else - LbSerieLoteRecomendado.Text = "No se encontro ningun Serie/Lote." - End If - - - - 'SI TIENE SALIDA POR SERIE LOTE, BLOQUEAMOS CHECK Y TXTCANTIDAD - Dim Contador = 0 - For Each Gvr As GridViewRow In GvDatos.Rows - If Gvr.DataKey("CvePS").ToEntero = CvePSSerieLote Then - Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec"))).Rows.Count - Gvr.FCCheckBox("cbInv").Enabled = False - Gvr.FCCheckBox("cbInv").Checked = True - Gvr.FCTextBox("TbCantidadF").Text = Contador.ToString - End If - Next - - UpDatos.Update() - End Sub - Protected Sub BtnSerieLote_Click(sender As Object, e As EventArgs) - - Dim Argumentos = CType(sender, Button).CommandArgument.Split("°"c) - - LbProducto.Text = Argumentos(2) - LbCantidad.Text = Argumentos(3) - - CveConsecSerieLote = Argumentos(4).ToEntero - CvePSSerieLote = Argumentos(0).ToEntero - PSSerieLote = Argumentos(2).ToString - CveUMSerieLote = Argumentos(1).ToEntero - - DivSerie.Visible = True - RegistraScript(String.Format("$('#{0}').modal('show')", DivSerie.ClientID)) - CargaSerie() - UpSerie.Update() - End Sub - - Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs) - AgregaSerieLote(TxtSerieLote.Text.Trim, 1) - End Sub - Private Sub AgregaSerieLote(SerieLote As String, Tipo As Integer) - - If SerieLote.Trim = "" Then - Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - If DtDatosDetalle.FiltraParametros($"CvePS = {CvePSSerieLote} AND SerieLote = '{SerieLote}'").Rows.Count > 0 Then - Alert("La SerieLote indicada ya esta registrada. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - TxtSerieLote.Text = "" - Exit Sub - End If - - Dim AplicaCaducidad = False - If GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS = {0}", CvePSSerieLote)).Rows(0) IsNot Nothing Then - AplicaCaducidad = If(GlobalDTProductosServicios(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS = {0}", CvePSSerieLote)).Rows(0)("AplicaCaducidad").ToString = "True", True, False) - End If - - - 'Valida Existencia - If TipoMovimiento = 1 Then - Dim ObjInventarios As New ClsInventarios - Dim Existencia = ObjInventarios.GetExistenciasPS(CvePSSerieLote, CveUMSerieLote, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=SerieLote, CveVendedor:=CveVendedor, CveCliente:=CveCliente) - If Existencia < 1 Then - Alert($"No hay existencia suficiente del producto ""{PSSerieLote}"" con la SerieLote definida ""{SerieLote}"". Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia, If(Tipo = 2, "window.setTimeout(Focus,200);", "")) - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - ObjInventarios.Dispose() - If Tipo = 1 Then - DivSerie.Visible = True - RegistraScript(String.Format("$('#{0}').modal('show')", DivSerie.ClientID)) - End If - Exit Sub - End If - Else - If DtExistencias IsNot Nothing Then - Dim Existencia = DtExistencias.SUM("Cantidad", $"CvePS = {CvePSSerieLote} AND CveUM = {CveUMSerieLote} AND SerieLote = '{SerieLote}'") - If Existencia < 1 Then - Alert($"No hay existencia suficiente del producto ""{PSSerieLote}"" con la SerieLote definida ""{SerieLote}"". Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia, If(Tipo = 2, "window.setTimeout(Focus,200);", "")) - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - If Tipo = 1 Then - DivSerie.Visible = True - RegistraScript(String.Format("$('#{0}').modal('show')", DivSerie.ClientID)) - End If - Exit Sub - End If - End If - End If - - - Dim Row = DtDatosDetalle.NewRow - - Row("ConsecId") = CveConsecSerieLote - Row("Consec") = DtDatosDetalle.Rows.Count + 1 - Row("PS") = PSSerieLote - Row("CvePS") = CvePSSerieLote - Row("CveUM") = CveUMSerieLote - Row("SerieLote") = SerieLote - Row("FechaCaducidad") = If(AplicaCaducidad, TxtFechaCaducidad.Text, MinFecha.ToShortDateString) - - DtDatosDetalle.Rows.Add(Row) - RegistraScript("playsonidito('beep-07.wav')") - - If Tipo = 1 Then - TxtSerieLote.Text = "" - TxtFechaCaducidad.Text = Now.ToShortDateString - End If - - CargaSerie() - - End Sub - - Protected Sub GvSerie_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvSerie.RowDeleting - - Dim keySerieLote As String = e.Keys("SerieLote").ToString - Try - For Each dr As DataRow In DtDatosDetalle.Rows - If dr("SerieLote").ToString = keySerieLote Then - dr.Delete() - End If - Next - Catch ex As Exception - - End Try - - DtDatosDetalle.AcceptChanges() - CargaSerie() - - End Sub - -#End Region - - -#Region " AGREGA CON TXT | CODIGO - SERIE " - Protected Sub BtnCodigoPS_Click(sender As Object, e As EventArgs) - - If TxtCodigoPS.Text = "" Then - Exit Sub - End If - - TdSeriePS.Visible = False - Dim Existe = False - Dim PSTemp = "" - - For Each Gvr As GridViewRow In GvDatos.Rows - If Gvr.DataKey("CodigoBarras") = TxtCodigoPS.Text.Trim Then - Dim TxtCantidad = GvDatos.Rows(Gvr.RowIndex).FCTextBox("TbCantidadF") - If Gvr.DataKey("CantidadF").ToDecimal - TxtCantidad.Text.ToDecimal - 1 >= 0 Then - - - - ''VALIDA EXISTENCIA - If TipoMovimiento = 1 Then - Dim ObjInventario As New ClsInventarios - Dim Existencia = ObjInventario.GetExistenciasPS(Gvr.DataKey("CvePS").ToString.ToEntero, Gvr.DataKey("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveVendedor:=CveVendedor, CveCliente:=CveCliente) - ObjInventario.Dispose() - If Not Existencia >= TxtCantidad.Text.ToDecimal + 1 Then - TxtCodigoPS.Text = "" - Alert($"No hay existencias suficientes del producto: ""{Gvr.DataKey("PS")}"". Solo hay disponibles {Existencia.FormatoNumero} en Almacen. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);") - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - Exit Sub - End If - Else - If DtExistencias IsNot Nothing Then - Dim Existencia = DtExistencias.SUM("Cantidad", $"CvePS = {Gvr.DataKey("CvePS")} AND CveUM = {Gvr.DataKey("CveUM").ToString.ToEntero}") - If Not Existencia >= TxtCantidad.Text.ToDecimal + 1 Then - TxtCodigoPS.Text = "" - Alert($"No hay existencias suficientes del producto: ""{Gvr.DataKey("PS")}"". Solo hay disponibles {Existencia.FormatoNumero} en Almacen. Por favor Verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);") - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - Exit Sub - End If - End If - End If - - If Gvr.DataKey("AplicaSerieLote") = "True" Then - TdSeriePS.Visible = True - TxtSeriePS.Focus() - - CveConsecSerieLote = Gvr.DataKey("Consec").ToString.ToEntero - PSSerieLote = Gvr.DataKey("PS").ToString - CvePSSerieLote = Gvr.DataKey("CvePS").ToEntero - CveUMSerieLote = Gvr.DataKey("CveUM").ToEntero - Exit Sub - End If - - - Dim CantidadEspecial = If(Gvr.DataKey("CveClasificacion").ToString.ToEntero = 17601, True, False) - - If CantidadEspecial Then - RegistraScript("CantidadEspecial();window.setTimeout(FocusCantidadEspecial,200);") - LtlProductoCantidad.Text = $"{Gvr.DataKey("Codigo")}" - RowIndexCantidadEspecial = Gvr.RowIndex - CantidadEspecialTemp = Gvr.DataKey("CantidadF").ToDecimal - TxtCodigoPS.Text = "" - Exit Sub - Else - TxtCantidad.Text = (TxtCantidad.Text.ToDecimal + 1).ToString.FormatoNumero - TxtCodigoPS.Text = "" - UpDatos.Update() - Exit Sub - End If - - VerificaVentaSurtida() - Exit Sub - End If - - Existe = True - PSTemp = Gvr.DataKey("PS").ToString - 'Alert($"Ya se ha cargado la totalidad del Producto ""{Gvr.DataKey("PS").ToString}"" con el Codigo ""{TxtCodigoPS.Text}"".", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);") - 'VerificaVentaSurtida() - 'Exit Sub - End If - Next - - VerificaVentaSurtida() - If Existe Then - Alert($"Ya se ha cargado la totalidad del Producto ""{PSTemp}"" con el Codigo ""{TxtCodigoPS.Text}"".", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);") - Else - Alert($"No se ha encontrado un producto para surtir con el Codigo ""{TxtCodigoPS.Text}"". ", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);") - End If - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - TxtCodigoPS.Text = "" - - End Sub - Private Sub VerificaVentaSurtida() - Dim Surtida = True - - For Each Gvr As GridViewRow In GvDatos.Rows - If Gvr.DataKey("CantidadF").ToDecimal <> Gvr.FCTextBox("TbCantidadF").Text.ToDecimal Then - Surtida = False - Exit Sub - End If - Next - - If Surtida Then - LbSurtida.Visible = True - End If - End Sub - Protected Sub BtnSeriePS_Click(sender As Object, e As EventArgs) - AgregaSerieLote(TxtSeriePS.Text.Trim, 2) - - TdSeriePS.Visible = False - TxtSeriePS.Text = "" - TxtCodigoPS.Text = "" - TxtCodigoPS.Focus() - VerificaVentaSurtida() - - End Sub - Protected Sub BtnGuardarCantidadEspecial_Click(sender As Object, e As EventArgs) - AgregaCantidadEspecial() - End Sub - Private Sub AgregaCantidadEspecial() - Dim TxtCantidad = GvDatos.Rows(RowIndexCantidadEspecial).FCTextBox("TbCantidadF") - If CantidadEspecialTemp - TxtCantidadEspecialDiv.Text.ToDecimal - TxtCantidad.Text.ToDecimal >= 0 Then - TxtCantidad.Text = (TxtCantidad.Text.ToDecimal + TxtCantidadEspecialDiv.Text.ToDecimal).ToString.FormatoNumero - 'RegistraScript("$('#ModalCantidad').modal('hide');") - RegistraScript("$('#DivCantidadEspecial').hide(200);") - UpDatos.Update() - TxtCodigoPS.Focus() - Else - Alert("La cantidad excede la pendiente por surtir. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia, "window.setTimeout(Focus,200);") - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - End If - - TxtCantidadEspecialDiv.Text = "1" - End Sub -#End Region - - -#Region " GUARDAR " - Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) - - 'VALIDA CANTIDAD DE SALIDA - Dim Cantidad = 0.0D - For Each Gvr As GridViewRow In GvDatos.Rows - If Gvr.FCCheckBox("cbInv").Checked AndAlso Gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then - Cantidad = Gvr.FCTextBox("TbCantidadF").Text.ToDecimal - Exit For - End If - Next - - If Not Cantidad > 0 Then - Alert("No se detecto ningun movimiento por hacer. Por favor verifique e intente nuevamente.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - 'PROCESO , si tiene proceso "X" no lo valida - If Not UsuarioActual.TienePermisoProceso(176) Then - For Each Gvr As GridViewRow In GvDatos.Rows - If Gvr.DataKey("CantidadF").ToDecimal <> Gvr.FCTextBox("TbCantidadF").Text.ToDecimal Then - Alert("En la factura no se han especificado todos los productos a entregar, favor de especificarlos para poder dar salida.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - Next - End If - - If EsDevolucionVenta = 1 Or TipoDocto.Contiene({"Ped"}) Then - For Each Gvr As GridViewRow In GvDatos.Rows - If Not Gvr.FCCheckBox("cbInv").Checked Or (Gvr.FCCheckBox("cbInv").Checked AndAlso Gvr.FCTextBox("TbCantidadF").Text.ToDecimal <> Gvr.DataKey("CantidadC").ToString.ToDecimal) Then - Alert("Es necesario surtir todos los productos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - Exit Sub - End If - Next - End If - - Dim ObjInventario As New ClsInventarios - Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL()) - Dim ObjVentas As New ClsVentas(ObjInventario.IniciaTransacSQL()) - Dim ObjEventos As New ClsOIEventos(ObjInventario.IniciaTransacSQL()) - Dim CveMovimiento As Integer - Dim Folio As Integer - Dim ErrorMovInv As Boolean - Dim DtDetalle As New DataTable - Dim TextoError = "" - - - 'PASA DATOS DEL GV A DATATABLE PARA MANEJOR CON FOR EACH - Dim Index = 0 - For Each gvr As GridViewRow In GvDatos.Rows - If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then - DtDatos.Rows(Index)("CantidadGV") = gvr.FCTextBox("TbCantidadF").Text.ToDouble - End If - Index += 1 - Next - - - 'VALIDA EXISTENCIA 2 - If TipoMovimiento = 1 Then - For Each Dr As DataRow In DtDatos.Rows - If Dr("CantidadGV").ToString.ToDouble > 0 Then - If Dr("AplicaSerieLote").ToString = "True" Then - DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec"))) - For Each Dr1 As DataRow In DtDetalle.Rows - If Not ObjInventario.GetExistenciasPS(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=Dr1("SerieLote").ToString, CveVendedor:=CveVendedor, CveCliente:=CveCliente) >= 1 Then - TextoError += String.Format("No hay existencias suficientes del producto: {0}
", Dr("PS")) - End If - Next - Else - If Not ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveVendedor:=CveVendedor, CveCliente:=CveCliente) >= Dr("CantidadGV").ToString.ToDecimal Then - TextoError += String.Format("No hay existencias suficientes del producto: {0}
", Dr("PS")) - End If - End If - - End If - Next - If TextoError <> "" Then - Alert(TextoError, TipoMensaje.MsgAdvertencia) - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - ObjInventario.RollBack() - ObjInventario.Dispose() - Exit Sub - End If - Else - If DtExistencias IsNot Nothing Then - For Each Dr As DataRow In DtDatos.Rows - If Dr("CantidadGV").ToString.ToDouble > 0 Then - - If Dr("AplicaSerieLote").ToString = "True" Then - DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec"))) - For Each Dr1 As DataRow In DtDetalle.Rows - If Not DtExistencias.SUM("Cantidad", $"CvePS = {Dr1("CvePS").ToString.ToEntero} AND CveUM = {Dr1("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'") >= 1 Then - TextoError += String.Format(" - {0}
", Dr1("PS")) - End If - Next - Else - If Not DtExistencias.SUM("Cantidad", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}") >= Dr("CantidadGV").ToString.ToDouble Then - TextoError += String.Format(" - {0}
", Dr("PS")) - End If - End If - End If - Next - If TextoError <> "" Then - Alert($" Lo(s) siguiente(s) Productos no tienen existencia suficiente:

{TextoError}", TipoMensaje.MsgAdvertencia) - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - ObjInventario.RollBack() - ObjInventario.Dispose() - Exit Sub - End If - End If - End If - - - - '' COMIENZA: APARTADOS - Dim DtTraspasos As New DataTable - DtTraspasos.Columns.Add("CveAlmacen", GetType(Integer)) - DtTraspasos.Columns.Add("Almacen", GetType(String)) - DtTraspasos.Columns.Add("CveMovimientoSalida", GetType(Integer)) - DtTraspasos.Columns.Add("FolioSalida", GetType(Integer)) - DtTraspasos.Columns.Add("CveMovimientoEntrada", GetType(Integer)) - DtTraspasos.Columns.Add("FolioEntrada", GetType(Integer)) - - Dim DtMovtosDetalle As New DataTable - DtMovtosDetalle.Columns.Add("CveVentaDetalle", GetType(Integer)) - DtMovtosDetalle.Columns.Add("CveMovimientoDetalle1", GetType(Integer)) - DtMovtosDetalle.Columns.Add("CveMovimientoDetalle2", GetType(Integer)) - DtMovtosDetalle.Columns.Add("CveMovimientoDetalle3", GetType(Integer)) - - Dim CveMovimientoSalida = -1, FolioSalida = -1, CveMovimientoEntrada = -1, CveMovimientoEntradaApartado = -1, FolioEntrada = -1 - Dim CantidadPendiente = 0.0 - Dim CantidadSaldo = 0.0 - - - If TipoMovimiento = 1 Then ' SI ES DEVOLUCION NO APLICA APARTADO - ' SALIDA POR TRASPASO DE LOS ALMACENES DE APARTADO - For Each Dr As DataRow In DtDatos.Rows - If Dr("CantidadGV").ToString.ToDouble > 0 Then - - If Dr("AplicaSerieLote").ToString = "True" Then - - DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec"))) - For Each Dr1 As DataRow In DtDetalle.Rows - If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=Dr1("SerieLote").ToString, CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveCliente:=CveCliente) Then - For Each Dr2 As DataRow In ObjInventario.DtResultados.Rows - - 'BUSCA SI EXISTE YA UN TRASPASO DEL ALMACEN DE APARTADO - CveMovimientoSalida = DtTraspasos.FiltroPrimeroValor("CveMovimientoSalida", $"CveAlmacen = {Dr2("CveAlmacen")}").ToEntero - - If Not CveMovimientoSalida > 0 Then - CveMovimientoSalida = ObjInventario.AddMovimiento(Dr2("CveAlmacen").ToString.ToEntero, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero) - FolioSalida = ObjInventario.Folio - - If Not CveMovimientoSalida > 0 Then - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - - Dim DrMovto = DtTraspasos.NewRow - DrMovto("Almacen") = Dr2("Almacen").ToString.ToEntero - DrMovto("CveAlmacen") = Dr2("CveAlmacen").ToString.ToEntero - DrMovto("CveMovimientoSalida") = CveMovimientoSalida - DrMovto("FolioSalida") = FolioSalida - DtTraspasos.Rows.Add(DrMovto) - End If - - - CantidadPendiente = 1 - - If ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, SerieLote:=Dr1("SerieLote").ToString) Then - Dim Row = DtMovtosDetalle.NewRow - Row("CveVentaDetalle") = Dr("CveVentaDetalle").ToString.ToEntero - Row("CveMovimientoDetalle1") = ObjInventario.CveMovimientoDetalle - DtMovtosDetalle.Rows.Add(Row) - Else - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - - DtDatosDetalle.Select($"Consec = {Dr1("Consec")}")(0)("FueTraspaso") = 1 - DtDatosDetalle.Select($"Consec = {Dr1("Consec")}")(0)("CveVentaDetalle") = Dr("CveVentaDetalle") - Dr("CantidadTraspaso") = Dr("CantidadTraspaso").ToString.ToDouble + CantidadPendiente - Exit For - Next - End If - Next - - Else - - If ObjInventario.GetExistenciasProducto(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveCliente:=CveCliente) Then - - CantidadSaldo = Dr("CantidadGV").ToString.ToDouble - - For Each Dr1 As DataRow In ObjInventario.DtResultados.Rows - - 'BUSCA SI EXISTE YA UN TRASPASO DEL ALMACEN DE APARTADO - CveMovimientoSalida = DtTraspasos.FiltroPrimeroValor("CveMovimientoSalida", $"CveAlmacen = {Dr1("CveAlmacen")}").ToEntero - - If Not CveMovimientoSalida > 0 Then - CveMovimientoSalida = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString.ToEntero, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero) - FolioSalida = ObjInventario.Folio - - If Not CveMovimientoSalida > 0 Then - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - - Dim DrMovto = DtTraspasos.NewRow - DrMovto("CveAlmacen") = Dr1("CveAlmacen").ToString.ToEntero - DrMovto("CveMovimientoSalida") = CveMovimientoSalida - DrMovto("FolioSalida") = FolioSalida - DtTraspasos.Rows.Add(DrMovto) - End If - - - CantidadPendiente = If(Dr1("Existencia").ToString.ToDecimal > CantidadSaldo, CantidadSaldo, Dr1("Existencia").ToString.ToDecimal) - - If ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then - Dim Row = DtMovtosDetalle.NewRow - Row("CveVentaDetalle") = Dr("CveVentaDetalle").ToString.ToEntero - Row("CveMovimientoDetalle1") = ObjInventario.CveMovimientoDetalle - DtMovtosDetalle.Rows.Add(Row) - Else - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - - CantidadSaldo -= CantidadPendiente - Dr("CantidadTraspaso") = Dr("CantidadTraspaso").ToString.ToDouble + CantidadPendiente - If CantidadSaldo <= 0 Then Exit For - Next - - If ErrorMovInv Then Exit For - - End If - - End If - - End If - Next - - 'ENTRADA POR TRASPASO AL ALMACEN GENERAL - If Not ErrorMovInv Then - For Each Dr1 As DataRow In DtTraspasos.Rows - CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString.ToEntero - - CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente) - FolioEntrada = ObjInventario.Folio - - If Not CveMovimientoEntradaApartado > 0 Then - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - - Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado - Dr1("FolioEntrada") = FolioEntrada - - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then - DtMovtosDetalle.Select($"CveMovimientoDetalle1 = {Dr("CveMovimientoDetalle")}")(0)("CveMovimientoDetalle2") = ObjInventario.CveMovimientoDetalle - Else - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - Next - End If - - If ErrorMovInv Then Exit For - - Next - End If - End If - '' TERMINA: APARTADOS - - - - - Dim ConceptoMovimiento = 3 - ConceptoMovimiento = If(TipoMovimiento = 1, ConceptoMovimiento, 18) - ConceptoMovimiento = If(CveAlmacenTraspasoDestino > 0, 8, ConceptoMovimiento) - - CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, ConceptoMovimiento, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveAlmacenDestino:=CveAlmacenTraspasoDestino) - Folio = ObjInventario.Folio - - If CveMovimiento > 0 Then - - - 'SACA LO DE TRASPASOS - APARTADO - For Each Dr1 As DataRow In DtTraspasos.Rows - CveMovimientoSalida = Dr1("CveMovimientoEntrada").ToString.ToEntero - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=DtMovtosDetalle.Select($"CveMovimientoDetalle2 = {Dr("CveMovimientoDetalle")}")(0)("CveVentaDetalle").ToString.ToEntero) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - Next - End If - If ErrorMovInv Then Exit For - Next - - - CantidadPendiente = 0.0 - For Each Dr As DataRow In DtDatos.Rows - CantidadPendiente = Dr("CantidadGV").ToString.ToDouble - Dr("CantidadTraspaso").ToString.ToDouble - If CantidadPendiente > 0 Then - Dim PU = 0.0 - - 'SI FUE POR SERIE LOTE - DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec"))) - If DtDetalle.Rows.Count > 0 Then - For Each Dr1 As DataRow In DtDetalle.Rows - If TipoMovimiento = 2 Then - PU = DtExistencias.FiltroPrimero($"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'")("PU").ToString.ToDouble - End If - - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, SerieLote:=Dr1("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar." - Exit For - End If - Next - Else - If TipoMovimiento = 2 Then - PU = DtExistencias.FiltroPrimero($"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}")("PU").ToString.ToDouble - End If - - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar." - Exit For - End If - End If - - End If - Next - - - If Not ErrorMovInv Then - - - - If CveAlmacenTraspasoDestino > 0 Then ' TRASPASO CUANDO ES REMISION - CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestino, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero) - FolioEntrada = ObjInventario.Folio - - If CveMovimientoEntrada <= 0 Then - TextoError = "No se pudo generar el movimiento de entrada correctamente" - ErrorMovInv = True - Else - If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al guardar los movimientos de entrada" - Exit For - End If - Next - End If - End If - - Else 'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN - SALIDA ALMACEN - Dim DtCostos As DataTable = Nothing - Dim ValorInventario As Decimal = 0 - If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then - DtCostos = ObjInventario.DtResultados - - Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"}) - Dim IdCtaContable As Integer = 0 - If tmpCostos.Rows.Count > 0 Then - - - If ObjVentas.GetVenta(CveVentaSurtir, UsuarioActual.CveEmpresa) Then - Dim CvePrePoliza As Integer = ObjVentas.DtResultados(0)("CvePrePoliza").ToString.ToEntero - Dim Fecha As Date = ObjVentas.DtResultados(0)("Fecha").ToString.ToDate - Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero - Dim SerieFolio As String = ObjVentas.DtResultados(0)("SerieFolio").ToString - - 'Se agrega movimiento separado por la cuenta de ventas (ER) - For Each RowInv As DataRow In tmpCostos.Rows - ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal - - - 'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString, Row2("SubProyecto").ToString) - IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero - If ValorInventario <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, If(TipoMovimiento = 1, 1, -1) * ValorInventario, SerieFolio, 68, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVentaSurtir, CveCliente:=CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=If(TipoMovimiento = 1, 1, -1) * ValorInventario) Then - ErrorMovInv = True - End If - If Not ErrorMovInv Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, If(TipoMovimiento = 1, 1, -1) * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVentaSurtir, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=If(TipoMovimiento = 1, 1, -1) * ValorInventario) Then - ErrorMovInv = True - End If - End If - End If - Next - Else - ErrorMovInv = True - TextoError = "Ocurrió un Error al ingresar las prepolizas" - End If - - End If - End If - End If - - - 'DEVOLUCION - If TipoMovimiento = 2 Then - - 'APARTADOS - If ObjInventario.VentasAlmacenApartadosGet(CveVentaSurtir) Then - Dim DtTempApartados = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 9", "CveAlmacen") - Dim CveMovimientoSalidaApartado = -1 - Dim CveAlmacenApartado = -1 - Dim CveAlmacenOrigen = If(CveAlmacenTraspasoDestino > 0, CveAlmacenTraspasoDestino, DdlAlmacen.SelectedValue.ToEntero) - - For Each Dr As DataRow In DtTempApartados.Rows - - If CveMovimientoSalidaApartado = -1 Or CveAlmacenApartado <> Dr("CveAlmacen").ToString.ToEntero Then - CveMovimientoSalidaApartado = ObjInventario.AddMovimiento(CveAlmacenOrigen, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente, CveAlmacenDestino:=Dr("CveAlmacen").ToString.ToEntero) - FolioSalida = ObjInventario.Folio - CveAlmacenApartado = Dr("CveAlmacen").ToString.ToEntero - End If - - If CveMovimientoSalidaApartado > 0 Then - Dim DrMovto = DtTraspasos.NewRow - DrMovto("Almacen") = Dr("Almacen").ToString.ToEntero - DrMovto("CveAlmacen") = Dr("CveAlmacen").ToString.ToEntero - DrMovto("CveMovimientoSalida") = CveMovimientoSalidaApartado - DrMovto("FolioSalida") = FolioSalida - DtTraspasos.Rows.Add(DrMovto) - Else - ErrorMovInv = True - TextoError = "Ocurrió un error al guardar los movimientos de control de apartados" - Exit For - End If - - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al guardar los movimientos de control de apartados" - Exit For - End If - Next - - If Not ErrorMovInv Then - For Each Dr1 As DataRow In DtTraspasos.Rows - CveMovimientoSalida = Dr1("CveMovimientoSalida").ToString.ToEntero - - CveMovimientoEntradaApartado = ObjInventario.AddMovimiento(Dr1("CveAlmacen").ToString.ToEntero, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveVendedor:=CveVendedor, CveCliente:=CveCliente) - FolioEntrada = ObjInventario.Folio - - If Not CveMovimientoEntradaApartado > 0 Then - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los movimientos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - - Dr1("CveMovimientoEntrada") = CveMovimientoEntradaApartado - Dr1("FolioEntrada") = FolioEntrada - - If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar." - Exit For - End If - Next - End If - - If ErrorMovInv Then Exit For - - Next - End If - - End If - - End If - - End If - - - Else - ErrorMovInv = True - End If - - - If Not ErrorMovInv And EsDevolucionVenta = 1 Then - If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVentaSurtir) Then - TextoError = "Ocurrió un error al hacer la devolucion. Por favor vuelva a intentar." - ErrorMovInv = True - End If - End If - - If Not ErrorMovInv Then - If Not ObjEventos.AddEventoBitacora(String.Format("Venta Surtida en Folio: {1}", CveMovimiento, Folio), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaSurtir) Then - ErrorMovInv = True - End If - End If - - If Not ErrorMovInv Then - ObjInventario.Commit() - RegistraScript("playsonidito('beep-07.wav')") - Dim Msg As New StringBuilder - Msg.AppendFormat("Movimiento Salida: {1}", CveMovimiento, Folio) - Msg.AppendFormat("
Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento))) - - - 'Msg.AppendFormat("") - 'Dim script As String = "$('#TxtNumeroGuia').val($('#NumeroGuia').val());$('#BtnNumeroGuia').click();" - - If CveMovimientoEntrada > 0 Then - Msg.AppendFormat("

Movimiento Entrada (Traspaso): {1}", CveMovimientoEntrada, FolioEntrada) - Msg.AppendFormat("
Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) - End If - - - If DtTraspasos.Rows.Count > 0 Then - Msg.AppendFormat("

Movimientos de Control (Apartados):") - For Each Dr As DataRow In DtTraspasos.Rows - Msg.AppendFormat("
Almacén {0} | Salida por Traspaso: {2} | Entrada por Traspaso: {4} ", Dr("Almacen"), Dr("CveMovimientoSalida"), Dr("FolioSalida"), Dr("CveMovimientoEntrada"), Dr("FolioEntrada")) - Next - End If - - Alert(Msg.ToString, TipoMensaje.MsgInformacion) - - Limpia() - CargaPendientes() - Else - Alert(TextoError, TipoMensaje.MsgError) - RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") - ObjInventario.RollBack() - End If - - ObjInventario.Dispose() - End Sub - - Private Sub Limpia() - - 'DATOS DE LA VENTA - LbCantidad.Text = "" - LbCliente.Text = "" - LbOberservaciones.Text = "" - LbFolio.Text = "" - - 'DATOS DEL MOVIMINETO - TxtObservaciones.Text = "" - TxtFecha.Text = Now.ToShortDateString - DdlAlmacen.SelectedValueExist(-1) - CargaFolios() - - 'VARIABLES GENERALES - CveVentaSurtir = -1 - DtDatosDetalle = Nothing - DtDatos = Nothing - - DivTipoCambioAdvertencia.Visible = False - - LbSurtida.Visible = False - TimmerRefresh.Enabled = True - UpGenerales.Update() - CargaGvDatos() - End Sub - - Private Sub BtnNumeroGuia_Click(sender As Object, e As EventArgs) Handles BtnNumeroGuia.Click - Dim Objeto As New ClsInventarios - If Objeto.UpdateMovimientoGuia(TxtGuia.Text, CveMovimiento, UsuarioActual.CveEmpresa) Then - Alert("Se ha guardado correctamente la póliza", TipoMensaje.MsgConfirmacion) - End If - Objeto.Dispose() - End Sub - - -#End Region - - - - -End Class diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb index 6dedc434c..91d4523d9 100644 --- a/Planeacion/CatSubProyectos.aspx.vb +++ b/Planeacion/CatSubProyectos.aspx.vb @@ -616,12 +616,12 @@ Partial Class CatSubProyectos NEcuentaInventario = True End If End If - If (idcuentagasto > 0 Or idcuentaanticipo > 0 Or idcuentaInventario > 0) Then - If objsubproyectos.UpdateSubProyectoExcel(UsuarioActual.CveEmpresa, CveClasificacion, CveSubProyecto, idcuentagasto, idcuentaanticipo, idcuentaInventario, namecuentagasto, namecuentaanticipo, namecuentaInventario) Then - Else - resultado = True - End If - End If + 'If (idcuentagasto > 0 Or idcuentaanticipo > 0 Or idcuentaInventario > 0) Then + ' If objsubproyectos.UpdateSubProyectoExcel(UsuarioActual.CveEmpresa, CveClasificacion, CveSubProyecto, idcuentagasto, idcuentaanticipo, idcuentaInventario, namecuentagasto, namecuentaanticipo, namecuentaInventario) Then + ' Else + ' resultado = True + ' End If + 'End If If NEcuentagasto Or NEcuentaanticipo Or NEcuentaInventario Then hayerrorcol = True Dim Row As DataRow = Nothing diff --git a/PortalCliente/PortalCliente.aspx.vb b/PortalCliente/PortalCliente.aspx.vb index 8ed8139da..0e7514c8d 100644 --- a/PortalCliente/PortalCliente.aspx.vb +++ b/PortalCliente/PortalCliente.aspx.vb @@ -823,196 +823,196 @@ Partial Class Ventas_PortalCliente TCFluctuacion = If(UsuarioActual.Empresa.Funcionalidad(159) = "1", TCVenta, TCPago) - 'CONFIGURACION POR CONCEPTO DE PREPOLIZA - Select Case ConceptoContable - Case 2 'PAGO CLIENTE - ImporteMovimiento = ImportePago.RoundSQL() - importeMX = ImportePagoMX.RoundSQL() - TCGeneral = TCVenta + ''CONFIGURACION POR CONCEPTO DE PREPOLIZA + 'Select Case ConceptoContable + ' Case 2 'PAGO CLIENTE + ' ImporteMovimiento = ImportePago.RoundSQL() + ' importeMX = ImportePagoMX.RoundSQL() + ' TCGeneral = TCVenta - If CveMonedaVenta > 1 Then - ConceptoMovimiento += $" TC:{TCPago} ${ImporteMovimiento.FormatoNumero(2)}" + ' If CveMonedaVenta > 1 Then + ' ConceptoMovimiento += $" TC:{TCPago} ${ImporteMovimiento.FormatoNumero(2)}" - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, (importeMX - ImporteMovimiento).RoundSQL(), 207, Referencia, ConceptoMovimiento, CveSubProyecto:=CveSubProyecto, CveCliente:=CveCliente, ImporteME:=ImporteMovimiento, TipoCambio:=TCVenta) Then - TieneError = True - MensajeError.Append("No se pudo insertar el detalle de pago de la póliza
") - Exit For - End If + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, (importeMX - ImporteMovimiento).RoundSQL(), 207, Referencia, ConceptoMovimiento, CveSubProyecto:=CveSubProyecto, CveCliente:=CveCliente, ImporteME:=ImporteMovimiento, TipoCambio:=TCVenta) Then + ' TieneError = True + ' MensajeError.Append("No se pudo insertar el detalle de pago de la póliza
") + ' Exit For + ' End If - End If + ' End If - Case 134 'PAGO INTERMEDIARIO - ImporteMovimiento = ImportePago.RoundSQL() - importeMX = ImportePagoMX.RoundSQL() - CveProveedorContabilizar = CveProveedorIntermediario - If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" + ' Case 134 'PAGO INTERMEDIARIO + ' ImporteMovimiento = ImportePago.RoundSQL() + ' importeMX = ImportePagoMX.RoundSQL() + ' CveProveedorContabilizar = CveProveedorIntermediario + ' If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" - Case 13 'IVA X TRASLADAR - If CveMonedaVenta = 1 Then - ImporteMovimiento = IVAVenta * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMonedaVenta = 2 Then - ImporteMovimiento = IVAVenta * PorcentajePago - importeMX = ImporteMovimiento * TCVenta - End If - PorcentajeImpuesto = PorcentajeIVA + ' Case 13 'IVA X TRASLADAR + ' If CveMonedaVenta = 1 Then + ' ImporteMovimiento = IVAVenta * PorcentajePago + ' importeMX = ImporteMovimiento + ' ElseIf CveMonedaVenta = 2 Then + ' ImporteMovimiento = IVAVenta * PorcentajePago + ' importeMX = ImporteMovimiento * TCVenta + ' End If + ' PorcentajeImpuesto = PorcentajeIVA - ImporteMovimiento = ImporteMovimiento.RoundSQL() - importeMX = importeMX.RoundSQL() - TCGeneral = TCVenta + ' ImporteMovimiento = ImporteMovimiento.RoundSQL() + ' importeMX = importeMX.RoundSQL() + ' TCGeneral = TCVenta - If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" + ' If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" - Case 61 'IVA TRASLADADO - If CveMonedaVenta = 1 Then - ImporteMovimiento = IVAVenta * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMonedaVenta = 2 Then - ImporteMovimiento = IVAVenta * PorcentajePago - importeMX = ImporteMovimiento * TCFluctuacion - End If - PorcentajeImpuesto = PorcentajeIVA + ' Case 61 'IVA TRASLADADO + ' If CveMonedaVenta = 1 Then + ' ImporteMovimiento = IVAVenta * PorcentajePago + ' importeMX = ImporteMovimiento + ' ElseIf CveMonedaVenta = 2 Then + ' ImporteMovimiento = IVAVenta * PorcentajePago + ' importeMX = ImporteMovimiento * TCFluctuacion + ' End If + ' PorcentajeImpuesto = PorcentajeIVA - ImporteMovimiento = ImporteMovimiento.RoundSQL() - importeMX = importeMX.RoundSQL() - TCGeneral = TCFluctuacion + ' ImporteMovimiento = ImporteMovimiento.RoundSQL() + ' importeMX = importeMX.RoundSQL() + ' TCGeneral = TCFluctuacion - If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}" + ' If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}" - Case 8 'RETIVA X TRASLADAR - If CveMonedaVenta = 1 Then - ImporteMovimiento = RetIVAVenta * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMonedaVenta = 2 Then - ImporteMovimiento = RetIVAVenta * PorcentajePago - importeMX = ImporteMovimiento * TCVenta - End If - PorcentajeImpuesto = PorcentajeRetIVA + ' Case 8 'RETIVA X TRASLADAR + ' If CveMonedaVenta = 1 Then + ' ImporteMovimiento = RetIVAVenta * PorcentajePago + ' importeMX = ImporteMovimiento + ' ElseIf CveMonedaVenta = 2 Then + ' ImporteMovimiento = RetIVAVenta * PorcentajePago + ' importeMX = ImporteMovimiento * TCVenta + ' End If + ' PorcentajeImpuesto = PorcentajeRetIVA - ImporteMovimiento = ImporteMovimiento.RoundSQL() - importeMX = importeMX.RoundSQL() - TCGeneral = TCVenta + ' ImporteMovimiento = ImporteMovimiento.RoundSQL() + ' importeMX = importeMX.RoundSQL() + ' TCGeneral = TCVenta - If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" + ' If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" - Case 62 'RETIVA TRASLADADO - If CveMonedaVenta = 1 Then - ImporteMovimiento = RetIVAVenta * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMonedaVenta = 2 Then - ImporteMovimiento = RetIVAVenta * PorcentajePago - importeMX = ImporteMovimiento * TCFluctuacion - End If - PorcentajeImpuesto = PorcentajeRetIVA + ' Case 62 'RETIVA TRASLADADO + ' If CveMonedaVenta = 1 Then + ' ImporteMovimiento = RetIVAVenta * PorcentajePago + ' importeMX = ImporteMovimiento + ' ElseIf CveMonedaVenta = 2 Then + ' ImporteMovimiento = RetIVAVenta * PorcentajePago + ' importeMX = ImporteMovimiento * TCFluctuacion + ' End If + ' PorcentajeImpuesto = PorcentajeRetIVA - ImporteMovimiento = ImporteMovimiento.RoundSQL() - importeMX = importeMX.RoundSQL() - TCGeneral = TCFluctuacion + ' ImporteMovimiento = ImporteMovimiento.RoundSQL() + ' importeMX = importeMX.RoundSQL() + ' TCGeneral = TCFluctuacion - If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}" + ' If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}" - Case 9 'RETISR X TRASLADAR - If CveMonedaVenta = 1 Then - ImporteMovimiento = RetISRVenta * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMonedaVenta = 2 Then - ImporteMovimiento = RetISRVenta * PorcentajePago - importeMX = ImporteMovimiento * TCVenta - End If - PorcentajeImpuesto = PorcentajeRetISR + ' Case 9 'RETISR X TRASLADAR + ' If CveMonedaVenta = 1 Then + ' ImporteMovimiento = RetISRVenta * PorcentajePago + ' importeMX = ImporteMovimiento + ' ElseIf CveMonedaVenta = 2 Then + ' ImporteMovimiento = RetISRVenta * PorcentajePago + ' importeMX = ImporteMovimiento * TCVenta + ' End If + ' PorcentajeImpuesto = PorcentajeRetISR - ImporteMovimiento = ImporteMovimiento.RoundSQL() - importeMX = importeMX.RoundSQL() - TCGeneral = TCVenta + ' ImporteMovimiento = ImporteMovimiento.RoundSQL() + ' importeMX = importeMX.RoundSQL() + ' TCGeneral = TCVenta - If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" + ' If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" - Case 63 'RETISR TRASLADADO - If CveMonedaVenta = 1 Then - ImporteMovimiento = RetIVAVenta * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMonedaVenta = 2 Then - ImporteMovimiento = RetIVAVenta * PorcentajePago - importeMX = ImporteMovimiento * TCFluctuacion - End If - PorcentajeImpuesto = PorcentajeRetISR + ' Case 63 'RETISR TRASLADADO + ' If CveMonedaVenta = 1 Then + ' ImporteMovimiento = RetIVAVenta * PorcentajePago + ' importeMX = ImporteMovimiento + ' ElseIf CveMonedaVenta = 2 Then + ' ImporteMovimiento = RetIVAVenta * PorcentajePago + ' importeMX = ImporteMovimiento * TCFluctuacion + ' End If + ' PorcentajeImpuesto = PorcentajeRetISR - ImporteMovimiento = ImporteMovimiento.RoundSQL() - importeMX = importeMX.RoundSQL() - TCGeneral = TCFluctuacion + ' ImporteMovimiento = ImporteMovimiento.RoundSQL() + ' importeMX = importeMX.RoundSQL() + ' TCGeneral = TCFluctuacion - If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}" + ' If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}" - Case 38 'IEPS X TRASLADAR - If CveMonedaVenta = 1 Then - ImporteMovimiento = IEPSVenta * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMonedaVenta = 2 Then - ImporteMovimiento = IEPSVenta * PorcentajePago - importeMX = ImporteMovimiento * TCVenta - End If - PorcentajeImpuesto = PorcentajeIEPS + ' Case 38 'IEPS X TRASLADAR + ' If CveMonedaVenta = 1 Then + ' ImporteMovimiento = IEPSVenta * PorcentajePago + ' importeMX = ImporteMovimiento + ' ElseIf CveMonedaVenta = 2 Then + ' ImporteMovimiento = IEPSVenta * PorcentajePago + ' importeMX = ImporteMovimiento * TCVenta + ' End If + ' PorcentajeImpuesto = PorcentajeIEPS - ImporteMovimiento = ImporteMovimiento.RoundSQL() - importeMX = importeMX.RoundSQL() - TCGeneral = TCVenta + ' ImporteMovimiento = ImporteMovimiento.RoundSQL() + ' importeMX = importeMX.RoundSQL() + ' TCGeneral = TCVenta - If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" + ' If TCVenta > 1 Then ConceptoMovimiento += $" TC:{TCVenta} ${ImporteMovimiento.FormatoNumero(2)}" - Case 39 'IEPS TRASLADADO - If CveMonedaVenta = 1 Then - ImporteMovimiento = IEPSVenta * PorcentajePago - importeMX = ImporteMovimiento - ElseIf CveMonedaVenta = 2 Then - ImporteMovimiento = IEPSVenta * PorcentajePago - importeMX = ImporteMovimiento * TCFluctuacion - End If - PorcentajeImpuesto = PorcentajeIEPS + ' Case 39 'IEPS TRASLADADO + ' If CveMonedaVenta = 1 Then + ' ImporteMovimiento = IEPSVenta * PorcentajePago + ' importeMX = ImporteMovimiento + ' ElseIf CveMonedaVenta = 2 Then + ' ImporteMovimiento = IEPSVenta * PorcentajePago + ' importeMX = ImporteMovimiento * TCFluctuacion + ' End If + ' PorcentajeImpuesto = PorcentajeIEPS - ImporteMovimiento = ImporteMovimiento.RoundSQL() - importeMX = importeMX.RoundSQL() - TCGeneral = TCFluctuacion + ' ImporteMovimiento = ImporteMovimiento.RoundSQL() + ' importeMX = importeMX.RoundSQL() + ' TCGeneral = TCFluctuacion - If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}" + ' If TCFluctuacion > 1 Then ConceptoMovimiento += $" TC:{TCFluctuacion} ${ImporteMovimiento.FormatoNumero(2)}" - Case 64 'GANANCIA - Continue For 'SKIPEA - If CveMonedaVenta <> 1 Then - If TCPago > TCVenta AndAlso CveMonedaVenta = 2 Then - ImporteMovimiento = (ImportePago * TCPago) - (ImportePago * TCVenta) - ImporteMovimiento -= ((IVAVenta * PorcentajePago) * TCFluctuacion) - ((IVAVenta * PorcentajePago) * TCVenta) - ImporteMovimiento += ((RetIVAVenta * PorcentajePago) * TCFluctuacion) - ((RetIVAVenta * PorcentajePago) * TCVenta) - ImporteMovimiento += ((RetISRVenta * PorcentajePago) * TCFluctuacion) - ((RetISRVenta * PorcentajePago) * TCVenta) - ImporteMovimiento -= ((IEPSVenta * PorcentajePago) * TCFluctuacion) - ((IEPSVenta * PorcentajePago) * TCVenta) - ImporteMovimiento = ImporteMovimiento.RoundSQL().Abs() - importeMX = ImporteMovimiento - End If - End If + ' Case 64 'GANANCIA + ' Continue For 'SKIPEA + ' If CveMonedaVenta <> 1 Then + ' If TCPago > TCVenta AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = (ImportePago * TCPago) - (ImportePago * TCVenta) + ' ImporteMovimiento -= ((IVAVenta * PorcentajePago) * TCFluctuacion) - ((IVAVenta * PorcentajePago) * TCVenta) + ' ImporteMovimiento += ((RetIVAVenta * PorcentajePago) * TCFluctuacion) - ((RetIVAVenta * PorcentajePago) * TCVenta) + ' ImporteMovimiento += ((RetISRVenta * PorcentajePago) * TCFluctuacion) - ((RetISRVenta * PorcentajePago) * TCVenta) + ' ImporteMovimiento -= ((IEPSVenta * PorcentajePago) * TCFluctuacion) - ((IEPSVenta * PorcentajePago) * TCVenta) + ' ImporteMovimiento = ImporteMovimiento.RoundSQL().Abs() + ' importeMX = ImporteMovimiento + ' End If + ' End If - Case 65 'PERDIDA - Continue For 'SKIPEA - If CveMonedaVenta <> 1 Then - If TCPago < TCVenta AndAlso CveMonedaVenta = 2 Then - ImporteMovimiento = (ImportePago * TCPago) - (ImportePago * TCVenta) - ImporteMovimiento -= ((IVAVenta * PorcentajePago) * TCFluctuacion) - ((IVAVenta * PorcentajePago) * TCVenta) - ImporteMovimiento += ((RetIVAVenta * PorcentajePago) * TCFluctuacion) - ((RetIVAVenta * PorcentajePago) * TCVenta) - ImporteMovimiento += ((RetISRVenta * PorcentajePago) * TCFluctuacion) - ((RetISRVenta * PorcentajePago) * TCVenta) - ImporteMovimiento -= ((IEPSVenta * PorcentajePago) * TCFluctuacion) - ((IEPSVenta * PorcentajePago) * TCVenta) - ImporteMovimiento = ImporteMovimiento.RoundSQL().Abs() - importeMX = ImporteMovimiento - End If - End If + ' Case 65 'PERDIDA + ' Continue For 'SKIPEA + ' If CveMonedaVenta <> 1 Then + ' If TCPago < TCVenta AndAlso CveMonedaVenta = 2 Then + ' ImporteMovimiento = (ImportePago * TCPago) - (ImportePago * TCVenta) + ' ImporteMovimiento -= ((IVAVenta * PorcentajePago) * TCFluctuacion) - ((IVAVenta * PorcentajePago) * TCVenta) + ' ImporteMovimiento += ((RetIVAVenta * PorcentajePago) * TCFluctuacion) - ((RetIVAVenta * PorcentajePago) * TCVenta) + ' ImporteMovimiento += ((RetISRVenta * PorcentajePago) * TCFluctuacion) - ((RetISRVenta * PorcentajePago) * TCVenta) + ' ImporteMovimiento -= ((IEPSVenta * PorcentajePago) * TCFluctuacion) - ((IEPSVenta * PorcentajePago) * TCVenta) + ' ImporteMovimiento = ImporteMovimiento.RoundSQL().Abs() + ' importeMX = ImporteMovimiento + ' End If + ' End If - End Select + 'End Select - 'AGREGA PREPOLIZA DETALLE - If ImporteMovimiento <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, importeMX, ConceptoContable, Referencia, ConceptoMovimiento, CveVenta:=CveVenta, CveSubProyecto:=CveSubProyecto, CveCliente:=CveCliente, CveProveedor:=CveProveedorContabilizar, TipoCambio:=TCGeneral, PorcentajeImpuesto:=PorcentajeImpuesto) Then - TieneError = True - MensajeError.Append("No se pudo insertar el detalle de la póliza
") - Exit For - End If - End If + ''AGREGA PREPOLIZA DETALLE + 'If ImporteMovimiento <> 0 Then + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, importeMX, ConceptoContable, Referencia, ConceptoMovimiento, CveVenta:=CveVenta, CveSubProyecto:=CveSubProyecto, CveCliente:=CveCliente, CveProveedor:=CveProveedorContabilizar, TipoCambio:=TCGeneral, PorcentajeImpuesto:=PorcentajeImpuesto) Then + ' TieneError = True + ' MensajeError.Append("No se pudo insertar el detalle de la póliza
") + ' Exit For + ' End If + 'End If Next If TieneError Then Exit For @@ -1890,74 +1890,13 @@ Partial Class Ventas_PortalCliente 'El movimiento 1 es el de Venta - 'Conta ContPAQ - 'If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then - ' If IDCtaBeneficiario > 0 And IDCtaContable > 0 Then - ' If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then - ' IDPoliza = ObjMov.ContaIdPoliza - ' 'Alert(alertaContabilizacion & ObjMov.AlertaMensaje, ModExtensiones.TipoMensaje.MsgInformacion) - ' Else - ' Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError) - ' End If - ' Else - ' If IDCtaContable < 1 Then - ' Alert("No se puede contabilizar la Prepoliza debido a que la cuenta de Bancos es invalida", TipoMensaje.MsgAdvertencia) - ' End If - ' If IDCtaBeneficiario < 1 Then - ' Alert("No se puede contabilizar la Prepoliza debido a que las cuenta del Beneficiario es invalida", TipoMensaje.MsgAdvertencia) - ' End If - ' End If - 'End If - - 'If UsuarioActual.Empresa.UsaAC Then - ' Dim ConceptoRenglon, Referencia As String - ' Dim FolioPoliza As Integer - ' Dim Fecha As Date = FechaDoc - ' Dim TipoChq As String = "" - ' Dim Total As Double = TxtImporte.Text.ToDouble - - ' Dim Conta As New ClsContPAQi(UsuarioActual.Empresa) - ' Conta.IniciaTransacSQL() - - ' If CveTipoTransaccion = 1 Then TipoChq = "CHQ" - ' ConceptoRenglon = String.Format("Anticipo {0}", PagueseA) - - ' Dim IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, ObjIE.Folio, TipoChq) - - ' If IDPoliza > 0 Then - ' FolioPoliza = Conta.Folio - ' Referencia = ObjIE.Folio - ' ConceptoRenglon = String.Format("Anticipo {0} {1}", PagueseA, TxtObservaciones.Text) - - ' Total = TxtImporte.Text.ToDouble - - ' If Not Conta.AddMovimiento(IDPoliza, IDCtaContable, True, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" - - ' If Not Conta.AddMovimiento(IDPoliza, IDCtaBeneficiario, False, Total, Referencia, ConceptoRenglon, 0, Fecha, "") Then MsgError = "No se insertó el movimiento" - - ' Else - ' MsgError = "No se insertó el encabezado" - ' End If - - ' If MsgError = "" Then - ' Conta.Commit() - - ' Conta.AjustaPoliza(IDPoliza) - ' 'actualizar la conta del IE - ' ObjIE.UpdateIEPrePoliza(Fecha, FolioPoliza.ToString, IDPoliza, CvePrePoliza, CveIE, 0) - ' Else - ' Conta.RollBack() - ' IDPoliza = 0 - ' End If - - ' Conta.Dispose() - 'End If - - 'Notificación de Pago - 'If TxtNotificarA.Text.Trim <> "" And MsgError = "" Then - ' 'NotificacionPago(CveIE, TxtNotificarA.Text.Trim) - ' EnviarCorreoNotificacion(CveIE, TxtNotificarA.Text.Trim, "", UsuarioActual, False) - 'End If + + + 'Notificación de Pago + 'If TxtNotificarA.Text.Trim <> "" And MsgError = "" Then + ' 'NotificacionPago(CveIE, TxtNotificarA.Text.Trim) + ' EnviarCorreoNotificacion(CveIE, TxtNotificarA.Text.Trim, "", UsuarioActual, False) + 'End If Else MsgError = "No se pudo insertar la póliza" End If @@ -2590,8 +2529,7 @@ Partial Class Ventas_PortalCliente TmpDT.Columns.Add("TotalImporte", GetType(Decimal)) TmpDT.Columns.Add("Total", GetType(Decimal)) 'Para uso del módulo contable - TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer)) - TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer)) + TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer)) TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean)) TmpDT.Columns.Add("CveProyecto", GetType(Integer)) TmpDT.Columns.Add("Proyecto", GetType(String)) diff --git a/RH/Personal.aspx b/RH/Personal.aspx index f3d3682b6..016ed642c 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -1611,7 +1611,7 @@ + DataKeyNames="CveMovtoPermanente,CveConcepto,CveCuenta,CvePersonal,Descripcion,TipoDescuento,Valor,VecesAplicar,MontoLimite,FechaInicioAplicacion,Estatus,FechaRegistro"> diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index ecdf4d95e..cd7fea4c6 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -1753,7 +1753,6 @@ Partial Class RH_Personal DdlDepartamento.SelectedValue = ObjPersonal.CveDepartamento.ToString() DdlSubproyectoZona.SelectedValueExist(ObjPersonal.CveSubproyectoZona) DDLUsuarioNomina.SelectedValueExist(ObjPersonal.CveUsuarioNomina) - 'DdlViaticos.SelectedValue = ObjPersonal.IdCtaContViaticos.ToString() 'For i As Integer = DdlDepartamento.Items.Count - 1 To 1 Step -1 ' If DdlDepartamento.Items(i).Value.Contains(ObjPersonal.CveDepartamento.ToString()) Then @@ -2009,8 +2008,8 @@ Partial Class RH_Personal DdlEstados.SelectedValue.ToEntero(), TxtTelefono.Text.Trim, TxtTelefonoEmergencia.Text.Trim, TxtCelular.Text.Trim, TxtRFC.Text.Trim, TxtCURP.Text.Trim, TxtCredencialElector.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(), DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), URL, - DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text, - DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(), + DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), + UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(), TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=ChkSindicalizado.Checked, Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(), CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero, CveTipoTrabajador:=DdlTipoTrabajador.SelectedValue.ToEntero(), NetoPeriodo:=TxtNetoPeriodo.Text.ToDecimal) Then @@ -2094,8 +2093,8 @@ Partial Class RH_Personal TxtCURP.Text.Trim, TxtCredencialElector.Text.Trim, TxtNombrePadre.Text.Trim, TxtNombreMadre.Text.Trim, DdlBanco.SelectedValue.ToEntero(), DdlRiesgoPuesto.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero(), DdlClienteAsignado.SelectedValue.ToEntero(), DdlSubProyectoAsignado.SelectedValue.ToEntero(), CvePersonal, - URL, DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), DdlViaticos.SelectedValue.ToEntero(), DdlViaticos.SelectedItem.Text, - DdlPrestamos.SelectedValue.ToEntero(), DdlPrestamos.SelectedItem.Text, UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(), + URL, DdlSupervisor.SelectedValue.ToEntero(), TxtCLABE.Text.Trim, TxtBancoNumCuenta.Text.Trim, DdlJornada.SelectedValue.ToEntero(), + UsuarioActual.CveEmpresa, DDLUsuarioNomina.SelectedValue.ToEntero(), TxtBeneficiario.Text.Trim, DdlSubproyectoZona.SelectedValue.ToEntero(), CveUniforme:=DdlUniforme.SelectedValue.ToEntero(), TelefonoExtension:=TxtTelefonoExtension.Text, CelularPersonal:=TxtCelularPersonal.Text, TelefonoMarcadoRapido:=TxtTelefonoMarcadoRapido.Text, ContactoAlterno:="", CveUsuarioModifico:=UsuarioActual.CveUsuario, CveTipodeSalario:=DDlTipoSalario.SelectedValue.ToEntero(), Sindicalizado:=If(ChkSindicalizado.Checked, 1, 0), Pensionado:=ChkPensionado.Checked, CvePais:=DdlPais.SelectedValue.ToEntero(), CveRegistroPatronal:=DdlRegistroPatronal.SelectedValue.ToEntero(), CveEmpresaAsignado:=DdlEmpresaAsignada.SelectedValue.ToEntero(), EsReserva:=If(chkEsReserva.Checked, 1, 0), @@ -7297,7 +7296,6 @@ Partial Class RH_Personal Dim cveConcepto As Integer = gvRow.DataKey("CveConcepto").ToEntero() Dim cvePersonal As Integer = gvRow.DataKey("CvePersonal").ToEntero() Dim CveCuenta As Integer = gvRow.DataKey("CveCuenta").ToEntero() - Dim IdCtaContable As Integer = gvRow.DataKey("IdCtaContable").ToEntero() Dim descripcion As String = gvRow.DataKey("Descripcion") Dim tipoDescuento As Integer = gvRow.DataKey("TipoDescuento").ToEntero() Dim valor As Double = gvRow.DataKey("Valor").ToDouble() @@ -7326,12 +7324,6 @@ Partial Class RH_Personal TxtFechaAplicacion.Text = $"{fechaInicioAplicacion}" DdlCtaContable.SelectedValueExist("-1") - If DdlCtaContable.DataValueField = "Id" Then - DdlCtaContable.SelectedValueExist(IdCtaContable) - Else - DdlCtaContable.SelectedValueExist(CveCuenta) - End If - ChkEstatus.Checked = estatus RegistraScript("$('#ModalMovtoPermanente').modal()") pnlAddupMovto.Visible = True diff --git a/Sistemas/DefinicionEmpresa.aspx.vb b/Sistemas/DefinicionEmpresa.aspx.vb index 1ec831d97..a27f77352 100644 --- a/Sistemas/DefinicionEmpresa.aspx.vb +++ b/Sistemas/DefinicionEmpresa.aspx.vb @@ -801,28 +801,6 @@ Partial Class Sistemas_DefinicionEmpresa End If - 'CLASIFICACIONES DE IVAS - If DtClasificacionIVA IsNot Nothing OrElse DtClasificacionIVA.Rows.Count > 0 Then - For Each Dr As DataRow In DtClasificacionIVA.Rows - If Not Dr("CveClasificacion").ToString.ToEntero > 0 Then - If Not ObjGral.RemoveClasificacionPorcentaje(Dr("CveClasificacionPorcentaje").ToString.ToEntero) Then - TextoError = "Ocurrió un error al guardar los cambios de la empresa" - End If - 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("IdCtaIVAXTrasladar").ToString.ToEntero, Dr("IdCtaIVATrasladado").ToString.ToEntero, UsuarioActual.CveEmpresa) Then - TextoError = "Ocurrió un error al guardar los cambios de la empresa" - End If - ElseIf Dr("CveClasificacionPorcentaje").ToString.ToEntero > 0 Then - 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("IdCtaIVAXTrasladar").ToString.ToEntero, Dr("IdCtaIVATrasladado").ToString.ToEntero) Then - TextoError = "Ocurrió un error al guardar los cambios de la empresa" - End If - End If - Next - End If 'RECARGA EMPRESA If TextoError = "" Then @@ -837,79 +815,9 @@ Partial Class Sistemas_DefinicionEmpresa Next End If - ' GlobalDTClasificacionPorcentaje(CveEmpresa) = Nothing - End If - 'AGREGAR FUNCIONALIDADES - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 201, DdlProveedores) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 211, DdlClientes) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 208, DdlInventario) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 216, DdlGasto) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 209, DdlBancos) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 205, DdlDeudores) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 202, DdlAcreedores) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 203, DdlDocxPagar) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 212, DdlAnticipoCliente) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 204, DdlAnticipoProveedores) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 218, DdlCaja) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 215, DdlFyE) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 221, DdlActivoFijo) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 246, DdlClientes) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 237, DdlAnticipoCliente) - ''AGREGAR FUNCIONALIDADES - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 232, DdlProveedoresSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 233, DdlClientesSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 239, DdlInventarioSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 240, DdlGastoSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 241, DdlBancosSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 234, DdlDeudoresSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 235, DdlAcreedoresSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 236, DdlDocxPagarSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 237, DdlAnticipoClienteSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 238, DdlAnticipoProveedoresSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 242, DdlCajaSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 243, DdlFyESIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 244, DdlActivoFijoSIG) - - 'TRIGGER - 'If TextoError = "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" Then - - ' If UsuarioActual.Empresa.UsaContabilidad Then - - ' If UsuarioActual.Empresa.TipoContabilidad = 2 Then - ' 'CREA OBJETO EMPRESA - ' If ObjEmpresas.GetEmpresas(TxtCveEmpresa.Text.ToEntero, "-1", "-1", "-1", "-1") Then - ' Dim Empresa As New Empresa - ' Empresa = ObjEmpresas.Empresa - - ' ObjContPAQ = New ClsContPAQi(Empresa) - - ' If ObjContPAQ.Conectado Then - ' 'ADD - ' If BDContPAQ = "" Then - ' If Not ObjContPAQ.TRIGGER(TxtBDContPAQi.Text.Trim) Then - ' TextoError = "Los datos de conexion al servidor de contabilidad son incorrectos" - ' End If - ' End If - - ' 'UPDATE - ' If BDContPAQ <> "" And (BDContPAQ <> TxtBDContPAQi.Text.Trim Or ServerContPAQ <> TxtServerContPAQi.Text.Trim) Then - ' If Not ObjContPAQ.TRIGGER(TxtBDContPAQi.Text.Trim) Then - ' TextoError = "Los datos de conexion al servidor de contabilidad son incorrectos" - ' End If - ' End If - ' Else - ' TextoError = "Los datos de conexion al servidor de contabilidad son incorrectos" - ' End If - ' End If - ' End If - - ' Else - ' Alert("La empresa tiene la información para el uso de contabilidad pero no se tiene activada", TipoMensaje.MsgAdvertencia) - ' End If - 'End If If TextoError = "" Then ObjEmpresas.Commit() @@ -1504,354 +1412,7 @@ Partial Class Sistemas_DefinicionEmpresa #End Region -#Region "TAB CONTABILIDAD - CLASIFICACION DE IVA" - Private Sub ActualizaNombresCuentas() - - - For Each Dr As DataRow In DtClasificacionIVA.Rows - If Dr("IdCtaIVAXAcreditar").ToString.ToEntero > 0 Then - 'Dr("CuentaXAcreditar") = DtCuentas.FiltraParametros($"Id = {Dr("IdCtaIVAXAcreditar").ToString}").Rows(0)("CtaCodigo").ToString - Dr("CuentaXAcreditar") = DtCuentas.FiltroPrimeroValor("CtaCodigo", $"Id = {Dr("IdCtaIVAXAcreditar").ToString}").ToString.ToEntero - End If - If Dr("IdCtaIVAAcreditable").ToString.ToEntero > 0 Then - 'Dr("CuentaAcreditable") = DtCuentas.FiltraParametros($"Id = {Dr("IdCtaIVAAcreditable").ToString}").Rows(0)("CtaCodigo").ToString - Dr("CuentaAcreditable") = DtCuentas.FiltroPrimeroValor("CtaCodigo", $"Id = {Dr("IdCtaIVAAcreditable").ToString}").ToString.ToEntero - End If - If Dr("IdCtaIVAXTrasladar").ToString.ToEntero > 0 Then - 'Dr("CuentaXTrasladar") = DtCuentas.FiltraParametros($"Id = {Dr("IdCtaIVAXTrasladar").ToString}").Rows(0)("CtaCodigo").ToString - Dr("CuentaXTrasladar") = DtCuentas.FiltroPrimeroValor("CtaCodigo", $"Id = {Dr("IdCtaIVAXTrasladar").ToString}").ToString.ToEntero - End If - If Dr("IdCtaIVATrasladado").ToString.ToEntero > 0 Then - 'Dr("CuentaTrasladado") = DtCuentas.FiltraParametros($"Id = {Dr("IdCtaIVATrasladado").ToString}").Rows(0)("CtaCodigo").ToString - Dr("CuentaTrasladado") = DtCuentas.FiltroPrimeroValor("CtaCodigo", $"Id = {Dr("IdCtaIVATrasladado").ToString}").ToString.ToEntero - End If - Next - DtClasificacionIVA.AcceptChanges() - End Sub - 'Private Sub InicializaClasificacionIVA(ObjEmpresas As ClsSisEmpresas) - ' CreaDtClasificacionIVA() - ' CargaCuentasIVA(ObjEmpresas) - ' CargaClasificaciones() - ' CargaClasificacionesIVA() - 'End Sub - 'Private Sub CargaClasificacionesIVA() - ' Dim ObjGral As New ClsGenerales - ' If ObjGral.GetClasificacionPorcentaje(UsuarioActual.CveEmpresa, Opcion:=2) Then - ' DtClasificacionIVA = ObjGral.DtResultados.Copy - ' ActualizaNombresCuentas() - ' GvClasificacionIVA.DataSource = DtClasificacionIVA - ' End If - ' ObjGral.Dispose() - ' GvClasificacionIVA.DataBind() - ' UpClasificacionIVA.Update() - 'End Sub - 'Private Sub CargaClasificaciones() - ' DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) - ' DdlClasificacion.DataBind() - ' DdlClasificacion.Items.Insert(0, New ListItem("-", "-1")) - 'End Sub - 'Private Sub CreaDtClasificacionIVA() - ' DtClasificacionIVA = New DataTable - ' DtClasificacionIVA.Columns.Add("CveClasificacionPorcentaje", GetType(Integer)) - ' DtClasificacionIVA.Columns.Add("CveClasificacion", GetType(Integer)) - ' DtClasificacionIVA.Columns.Add("Clasificacion", GetType(String)) - ' DtClasificacionIVA.Columns.Add("PorcentajeIVA", GetType(Double)) - ' DtClasificacionIVA.Columns.Add("CuentaXAcreditar", GetType(String)) - ' DtClasificacionIVA.Columns.Add("IdCtaIVAXAcreditar", GetType(Integer)) - ' DtClasificacionIVA.Columns.Add("CuentaAcreditable", GetType(String)) - ' DtClasificacionIVA.Columns.Add("IdCtaIVAAcreditable", GetType(Integer)) - ' DtClasificacionIVA.Columns.Add("CuentaXTrasladar", GetType(String)) - ' DtClasificacionIVA.Columns.Add("IdCtaIVAXTrasladar", GetType(Integer)) - ' DtClasificacionIVA.Columns.Add("CuentaTrasladado", GetType(String)) - ' DtClasificacionIVA.Columns.Add("IdCtaIVATrasladado", GetType(Integer)) - 'End Sub - 'Private Sub CargaCuentasIVA(ByRef ObjEmpresas As ClsSisEmpresas) - - ' If ObjEmpresas.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then - ' If ObjEmpresas.Empresa.UsaContabilidad And ObjEmpresas.Empresa.TipoContabilidad = 2 Then - - ' 'If ObjEmpresas.Empresa.TipoContabilidad = 2 Then - ' Dim Cuenta As New ClsContPAQi(ObjEmpresas.Empresa) - ' If Cuenta.GetCuentas(-1, "-1", -1) Then - ' DtCuentas = Cuenta.DtResultados - ' End If - ' Cuenta.Dispose() - ' 'End If - - ' Try - ' DdlIVAXAcreditarModal.DataSource = DtCuentas : DdlIVAXAcreditarModal.DataBind() - ' Catch ex As Exception - ' End Try - ' Try - ' DdlIVAAcreditableModal.DataSource = DtCuentas : DdlIVAAcreditableModal.DataBind() - ' Catch ex As Exception - ' End Try - ' Try - ' DdlIVAXTrasladarModal.DataSource = DtCuentas : DdlIVAXTrasladarModal.DataBind() - ' Catch ex As Exception - ' End Try - ' Try - ' DdlIVATrasladadoModal.DataSource = DtCuentas : DdlIVATrasladadoModal.DataBind() - ' Catch ex As Exception - ' End Try - ' End If - - - ' End If - - ' 'ObjEmpresas.Dispose() - ' DdlIVAXAcreditarModal.Items.Insert(0, New ListItem("-", "-1")) - ' DdlIVAAcreditableModal.Items.Insert(0, New ListItem("-", "-1")) - ' DdlIVAXTrasladarModal.Items.Insert(0, New ListItem("-", "-1")) - ' DdlIVATrasladadoModal.Items.Insert(0, New ListItem("-", "-1")) - 'End Sub - 'Protected Sub LnkEliminarClasificacionIVA_Click(sender As Object, e As EventArgs) - ' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) - ' If DtClasificacionIVA.Rows(gvRow.RowIndex)("CveClasificacionPorcentaje").ToString.ToEntero = 0 Then - ' DtClasificacionIVA.Rows(gvRow.RowIndex).Delete() - ' Else - ' DtClasificacionIVA.Rows(gvRow.RowIndex)("CveClasificacion") = -1 - ' End If - ' DtClasificacionIVA.AcceptChanges() - ' GvClasificacionIVA.DataSource = DtClasificacionIVA - ' GvClasificacionIVA.DataBind() - ' UpClasificacionIVA.Update() - 'End Sub - 'Protected Sub LnkAgregarClasificacionIVA_Click(sender As Object, e As EventArgs) - ' LimpiaClasificacionIVA() - ' Modalidad = "A" - ' RegistraScript("$('#DModalClasificacionIVA').modal()") - ' UpModalClasificacionIVA.Update() - 'End Sub - 'Protected Sub LnkEditarClasificacionIVA_Click(sender As Object, e As EventArgs) - ' LimpiaClasificacionIVA() - ' Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) - ' Modalidad = "U" - ' Index = gvRow.RowIndex - ' CveClasificacionPorcentaje = gvRow.DataKey("CveClasificacionPorcentaje").ToEntero() - ' DdlClasificacion.SelectedValueExist(gvRow.DataKey("CveClasificacion")) - ' TxtPorcentajeIVA.Text = gvRow.DataKey("PorcentajeIVA") - ' DdlIVAXAcreditarModal.SelectedValueExist(gvRow.DataKey("IdCtaIVAXAcreditar")) - ' DdlIVAAcreditableModal.SelectedValueExist(gvRow.DataKey("IdCtaIVAAcreditable")) - ' DdlIVAXTrasladarModal.SelectedValueExist(gvRow.DataKey("IdCtaIVAXTrasladar")) - ' DdlIVATrasladadoModal.SelectedValueExist(gvRow.DataKey("IdCtaIVATrasladado")) - ' RegistraScript("$('#DModalClasificacionIVA').modal()") - ' UpModalClasificacionIVA.Update() - 'End Sub - - 'Private Sub LimpiaClasificacionIVA() - ' TxtPorcentajeIVA.Text = "" - ' DdlClasificacion.SelectedIndex = 0 - ' DdlIVAXAcreditarModal.SelectedIndex = 0 - ' DdlIVAAcreditableModal.SelectedIndex = 0 - ' DdlIVAXTrasladarModal.SelectedIndex = 0 - ' DdlIVATrasladadoModal.SelectedIndex = 0 - ' UpModalClasificacionIVA.Update() - 'End Sub - - 'Protected Sub BtnClasificacionIVA_Click(sender As Object, e As EventArgs) - ' If Modalidad = "A" Then - ' Dim Row As DataRow = DtClasificacionIVA.NewRow() - ' Row("CveClasificacionPorcentaje") = 0 - ' Row("CveClasificacion") = DdlClasificacion.SelectedValue.ToEntero - ' Row("Clasificacion") = DdlClasificacion.SelectedItem.Text - ' Row("PorcentajeIVA") = TxtPorcentajeIVA.Text.ToDouble - ' Row("CuentaXAcreditar") = DdlIVAXAcreditarModal.SelectedItem.Text - ' Row("IdCtaIVAXAcreditar") = DdlIVAXAcreditarModal.SelectedValue.ToEntero - ' Row("CuentaAcreditable") = DdlIVAAcreditableModal.SelectedItem.Text - ' Row("IdCtaIVAAcreditable") = DdlIVAAcreditableModal.SelectedValue.ToEntero - ' Row("CuentaXTrasladar") = DdlIVAXTrasladarModal.SelectedItem.Text - ' Row("IdCtaIVAXTrasladar") = DdlIVAXTrasladarModal.SelectedValue.ToEntero - ' Row("CuentaTrasladado") = DdlIVATrasladadoModal.SelectedItem.Text - ' Row("IdCtaIVATrasladado") = DdlIVATrasladadoModal.SelectedValue.ToEntero - ' DtClasificacionIVA.Rows.InsertAt(Row, DtClasificacionIVA.Rows.Count) - ' ElseIf Modalidad = "U" Then - ' DtClasificacionIVA.Rows(Index)("CveClasificacion") = DdlClasificacion.SelectedValue.ToEntero - ' DtClasificacionIVA.Rows(Index)("Clasificacion") = DdlClasificacion.SelectedItem.Text - ' DtClasificacionIVA.Rows(Index)("PorcentajeIVA") = TxtPorcentajeIVA.Text.ToDouble - ' DtClasificacionIVA.Rows(Index)("CuentaXAcreditar") = DdlIVAXAcreditarModal.SelectedItem.Text - ' DtClasificacionIVA.Rows(Index)("IdCtaIVAXAcreditar") = DdlIVAXAcreditarModal.SelectedValue.ToEntero - ' DtClasificacionIVA.Rows(Index)("CuentaAcreditable") = DdlIVAAcreditableModal.SelectedItem.Text - ' DtClasificacionIVA.Rows(Index)("IdCtaIVAAcreditable") = DdlIVAAcreditableModal.SelectedValue.ToEntero - ' DtClasificacionIVA.Rows(Index)("CuentaXTrasladar") = DdlIVAXTrasladarModal.SelectedItem.Text - ' DtClasificacionIVA.Rows(Index)("IdCtaIVAXTrasladar") = DdlIVAXTrasladarModal.SelectedValue.ToEntero - ' DtClasificacionIVA.Rows(Index)("CuentaTrasladado") = DdlIVATrasladadoModal.SelectedItem.Text - ' DtClasificacionIVA.Rows(Index)("IdCtaIVATrasladado") = DdlIVATrasladadoModal.SelectedValue.ToEntero - ' End If - ' DtClasificacionIVA.AcceptChanges() - ' ActualizaNombresCuentas() - ' GvClasificacionIVA.DataSource = DtClasificacionIVA - ' GvClasificacionIVA.DataBind() - ' UpClasificacionIVA.Update() - ' RegistraScript("$('#DModalClasificacionIVA').modal('hide')") - 'End Sub - - 'Protected Sub GvClasificacionIVA_RowDataBound(sender As Object, e As GridViewRowEventArgs) - ' If e.Row.RowType = DataControlRowType.DataRow Then - ' If Not e.Row.DBCampo("CveClasificacion").ToEntero > 0 Then - ' e.Row.Visible = False - ' End If - ' End If - 'End Sub - -#End Region - - - - - 'Protected Sub LnkOpenModalDatosFiel_Click(sender As Object, e As EventArgs) - ' TxtFielPass.Text = "" - ' TxtFielArchivoCER.Text = "" - ' TxtFielArchivoKey.Text = "" - ' RegistraScript("$('#ModalUpFiel').modal();") - 'End Sub - - 'Protected Sub LnkUpDatosFiel_Click(sender As Object, e As EventArgs) - ' Dim Password As String = TxtFielPass.Text - ' Dim akey As String - ' Dim acer As String - ' Dim pemkey As String - ' Dim pemcer As String - ' Dim pfxname As String - ' Dim Archivopfx As String - ' Dim Archivokey As Archivo = Nothing - ' Dim Archivocer As Archivo = Nothing - - ' Dim dirbase = "" - ' Dim dirbasepfx = "" - ' If EmpresaEditar IsNot Nothing Then - ' dirbase = String.Format("{0}Certificados\Fiel\", EmpresaEditar.Ruta) - ' dirbasepfx = String.Format("{0}Certificados\", EmpresaEditar.Ruta) - ' Else - ' dirbase = String.Format("{0}Empresas\{1}\Certificados\Fiel\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa) - ' dirbasepfx = String.Format("{0}Empresas\{1}\Certificados\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa) - ' End If - - ' If (Not Directory.Exists(dirbase)) Then - ' Directory.CreateDirectory(dirbase) - ' End If - - ' Dim Filesgral As List(Of Archivo) = TxtFielArchivoCER.getfiles().Archivos - ' If Filesgral.Count > 0 Then - ' Archivocer = Filesgral(0) - ' End If - ' Filesgral = TxtFielArchivoKey.getfiles().Archivos - ' If Filesgral.Count > 0 Then - ' Archivokey = Filesgral(0) - ' End If - ' If Not IsNothing(Archivokey) AndAlso Not IsNothing(Archivocer) And Password.Length > 0 Then - ' akey = String.Format("{0}{1}", dirbase, Archivokey.filenameO) - ' If File.Exists(akey) Then - ' File.Delete(akey) - ' End If - ' File.Copy(Archivokey.FileUrl, akey) - ' acer = String.Format("{0}{1}", dirbase, Archivocer.filenameO) - ' If File.Exists(acer) Then - ' File.Delete(acer) - ' End If - ' File.Copy(Archivocer.FileUrl, acer) - ' Archivopfx = Archivokey.filenameO.Substring(0, Archivokey.filenameO.Length - 4) - ' pemkey = String.Format("{0}{1}.pem", dirbase, Archivopfx) - ' pfxname = String.Format("{0}{1}.pfx", dirbasepfx, Archivopfx) - ' pemcer = String.Format("{0}{1}.pem", dirbase, Archivokey.filenameO.Substring(0, Archivocer.filenameO.Length - 4)) - - ' If File.Exists(pemkey) Then - ' File.Delete(pemkey) - ' End If - - ' If File.Exists(pfxname) Then - ' File.Delete(pfxname) - ' End If - - ' If File.Exists(pemcer) Then - ' File.Delete(pemcer) - ' End If - - ' Dim resultado As New StringBuilder - ' resultado.AppendLine("
PAso 1:
") - ' resultado.AppendLine(execCommand({"cd C:\Generar PFX\", String.Format("openssl.exe x509 -inform DER -in ""{0}"" -out ""{1}""", acer, pemcer)})) - ' resultado.AppendLine("
PAso 2:
") - ' resultado.AppendLine(execCommand({"cd C:\Generar PFX\", String.Format("openssl pkcs8 -inform DER -in ""{0}"" -passin pass:""{1}"" -out ""{2}""", akey, Password, pemkey)})) - ' resultado.AppendLine("
Paso 3:
") - ' resultado.AppendLine(execCommand({"cd C:\Generar PFX\", String.Format("openssl pkcs12 -export -out ""{0}"" -inkey ""{1}"" -in ""{2}"" -passout pass:""{3}""", pfxname, pemkey, pemcer, Password)})) - ' resultado.AppendLine("
") - ' 'Alert(resultado.ToString()) - - ' If File.Exists(pemkey) Then - ' File.Delete(pemkey) - ' End If - ' If File.Exists(pemcer) Then - ' File.Delete(pemcer) - ' End If - ' If File.Exists(acer) Then - ' File.Delete(acer) - ' End If - ' If File.Exists(akey) Then - ' File.Delete(akey) - ' End If - ' If File.Exists(Archivocer.FileUrl) Then - ' File.Delete(Archivocer.FileUrl) - ' End If - ' If File.Exists(Archivokey.FileUrl) Then - ' File.Delete(Archivokey.FileUrl) - ' End If - ' If Not File.Exists(pfxname) Then - ' Archivopfx = "" - ' Password = "" - ' End If - ' Dim objempresa As New ClsSisEmpresas - ' objempresa.UpEmpresaFiel(UsuarioActual.CveEmpresa, Password, $"{Archivopfx}.pfx") - ' objempresa.Dispose() - ' lblPassFiel.Text = Password - ' LblPfx.Text = $"{Archivopfx}.pfx" - ' Alert("La Fiel se ha actualizado") - ' UpmodalFiel.Update() - ' RegistraScript("$('#ModalUpFiel').modal('hide');") - ' Else - ' Alert("Favor de llenar todos los campos :
-Contraseña
-Archivo CER
-Archivo KEY", TipoMensaje.MsgAdvertencia) - ' End If - 'End Sub - 'Public Function execCommand(command As String()) As String - - ' Dim proceso As Diagnostics.Process = New Diagnostics.Process() - ' proceso.StartInfo.FileName = "cmd.exe" - ' proceso.StartInfo.CreateNoWindow = True - ' proceso.StartInfo.RedirectStandardInput = True - ' proceso.StartInfo.RedirectStandardOutput = True - ' proceso.StartInfo.UseShellExecute = False - ' proceso.Start() - ' For Each c As String In command - ' proceso.StandardInput.WriteLine(c) - - ' Next - ' proceso.StandardInput.Flush() - ' proceso.StandardInput.Close() - ' proceso.WaitForExit() - ' Return proceso.StandardOutput.ReadToEnd() - 'End Function - 'Private Sub CargaTareasProgramadas() - ' Dim objTP As New ClsTareasProgramadas() - ' ChkDescargaMasivaSat.Checked = False - ' If objTP.GetTareasProgramadas(UsuarioActual.CveEmpresa) AndAlso objTP.DtResultados.Rows.Count > 0 Then - ' ChkDescargaMasivaSat.Checked = (objTP.DtResultados.COUNT("CveTareaProgramada", "CveTareaProgramada=1") > 0) - ' End If - ' objTP.Dispose() - 'End Sub - 'Protected Sub ChkDescargaMasivaSat_CheckedChanged(sender As Object, e As EventArgs) - ' Dim objTP As New ClsTareasProgramadas() - ' If ChkDescargaMasivaSat.Checked Then - ' If objTP.AddTareasProgramadas(UsuarioActual.CveEmpresa, 1, DateTime.Now.ToString("yyyy/MM/dd"), "", 0, "", DateTime.Now.ToString("yyyy/MM/dd"), DateTime.Now.ToString("yyyy/MM/dd"), "", "", 0, 1) Then - ' Alert("La tarea programada de descarga masiva del sat a agregado satisfactoriamente") - ' End If - ' Else - ' If objTP.RemoveTareasProgramadas(1, UsuarioActual.CveEmpresa) Then - ' Alert("La tarea programada de descarga masiva del sat se ha removido satisfactoriamente") - ' End If - ' End If - - ' objTP.Dispose() - 'End Sub Protected Sub LnkRegistrarPAC3_Click(sender As Object, e As EventArgs) If UsuarioActual.CveEmpresa > 0 Then RegistrarPAC3() diff --git a/Sistemas/Empresa.aspx b/Sistemas/Empresa.aspx index 7326a7b7f..c622e5fc5 100644 --- a/Sistemas/Empresa.aspx +++ b/Sistemas/Empresa.aspx @@ -761,501 +761,26 @@
-
-
-
- - Cuentas Contables -
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - -
Cuenta Cambiaria: - - -
Cuenta Perdida Cambiaria: - - -
Cuenta Descuento Venta: - - -
Cuenta Otros Ingresos: - - -
Asiento Contable Compras Contado: -
-
-
+
-
-
-
- - IVAs -
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IVA por Acreditar: - - -
IVA Acreditable: - - -
IVA por Trasladar: - - -
IVA Trasladado - - -
IVA Retenciones: - - -
ISR Circulación: - - -
Dev Sobre Venta: - - -
Impuestos Locales: - - -
IEPS por Acreditar: - - -
IEPS Acreditable: - - -
IEPS por Trasladar: - - -
IEPS Trasladado: - - -
-
-
+
-
-
-
- - CUENTAS PADRES -
-
-
-
-
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Proveedores: - - -
Clientes: - - -
Inventario: - - -
Gasto: - - -
Bancos: - - -
Deudores: - - -
Acreedores: - - -
Doc. por Pagar: - - -
Anticipo Cliente: - - -
Anticipo Proveedores: - - -
Caja - - -
FyE: - - -
Activo Fijo: - - - -
-
-
- - <%-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Proveedores: - - -
Clientes: - - -
Inventario: - - -
Gasto: - - -
Bancos: - - -
Deudores: - - -
Acreedores: - - -
Doc. por Pagar: - - -
Anticipo Cliente: - - -
Anticipo Proveedores: - - -
Caja - - -
FyE: - - -
Activo Fijo: - - - -
-
-
--%> - - - -
- - -
-
+
-
-
-
- - CLASIFICACIONES DE IVAS -
-
-
-
-
-
- -
-
-
- - -
- -
-
-
- - - - - - - - - - - - - - - -
-
-
-
+
- +
diff --git a/Sistemas/Empresa.aspx.vb b/Sistemas/Empresa.aspx.vb index 79402048a..7fc28addf 100644 --- a/Sistemas/Empresa.aspx.vb +++ b/Sistemas/Empresa.aspx.vb @@ -1,1887 +1,995 @@ -Option Explicit On -Option Strict On - -Imports System.Data -Imports Extensiones -Imports System.Runtime.InteropServices -Imports System.IO -Imports Microsoft.Reporting.WebForms -Imports Microsoft.Owin.Security.Provider - -Partial Class Sistemas_Empresa - Inherits ClsPaginas - -#Region " PROPIEDADES " - Private ReadOnly Property CveEmpresa As Integer - Get - Return ViewState("CveEmpresa").ToString.ToEntero - End Get - End Property - Private Property DtCuentasContables As Data.DataTable - Get - Return CType(ViewState("DtCuentasContables"), DataTable) - End Get - Set(value As Data.DataTable) - ViewState("DtCuentasContables") = value - End Set - End Property - - Private Property EmpresaEditar As Empresa - Get - Return CType(ViewState("EmpresaEditar"), Empresa) - End Get - Set(value As Empresa) - ViewState("EmpresaEditar") = value - End Set - End Property - Private Property DtCuentasContablesSIG As Data.DataTable - Get - Return CType(ViewState("DtCuentasContablesSIG"), DataTable) - End Get - Set(value As Data.DataTable) - ViewState("DtCuentasContablesSIG") = value - End Set - End Property - - Private Property DtFuncionalidades As Data.DataTable - Get - Return CType(ViewState("DtFuncionalidades"), DataTable) - End Get - Set(value As Data.DataTable) - ViewState("DtFuncionalidades") = value - End Set - End Property - Private Property BDContPAQ As String - Get - BDContPAQ = ViewState("BDContPAQ").ToString - End Get - Set(value As String) - ViewState("BDContPAQ") = value - End Set - End Property - Private Property ServerContPAQ As String - Get - ServerContPAQ = ViewState("ServerContPAQ").ToString - End Get - Set(value As String) - ViewState("ServerContPAQ") = value - End Set - End Property - Public Property DtCuentas As DataTable - Get - Return CType((ViewState("DtCuentas")), DataTable) - End Get - Set(value As DataTable) - ViewState("DtCuentas") = value - End Set - End Property - Public Property DtClasificacionIVA As DataTable - Get - If ViewState("DtClasificacionIVA") Is Nothing Then - ViewState("DtClasificacionIVA") = New DataTable - End If - Return CType((ViewState("DtClasificacionIVA")), DataTable) - End Get - Set(value As DataTable) - ViewState("DtClasificacionIVA") = value - End Set - End Property - Public Property CveClasificacionPorcentaje As Integer - Get - Return CType((ViewState("CveClasificacionPorcentaje")), Integer) - End Get - Set(value As Integer) - ViewState("CveClasificacionPorcentaje") = value - End Set - End Property - Public Property Modalidad As String - Get - Return CType((ViewState("Modalidad")), String) - End Get - Set(value As String) - ViewState("Modalidad") = value - End Set - End Property - Public Property Index As Integer - Get - Return CType((ViewState("Index")), Integer) - End Get - Set(value As Integer) - ViewState("Index") = value - End Set - End Property - - - Public Property TipoContabilidad As Integer - Get - If ViewState("TipoContabilidad") Is Nothing Then - ViewState("TipoContabilidad") = -1 - End If - - Return CType((ViewState("TipoContabilidad")), Integer) - End Get - Set(value As Integer) - ViewState("TipoContabilidad") = value - End Set - End Property - - - - Enum EnumOpActualizaArchivosCer - SinOpcion - KEY - CER - PFX - End Enum - - - Property OpActualizaArchivosCer As EnumOpActualizaArchivosCer - - Get - If ViewState("OpActualizaArchivosCer") Is Nothing Then - ViewState("OpActualizaArchivosCer") = EnumOpActualizaArchivosCer.SinOpcion - End If - - Return DirectCast(ViewState("OpActualizaArchivosCer"), EnumOpActualizaArchivosCer) - - End Get - Set(value As EnumOpActualizaArchivosCer) - ViewState("OpActualizaArchivosCer") = value - End Set - - End Property - -#End Region - - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not IsPostBack Then - - If UsuarioActual.CveRol <> 1 AndAlso (Request("CveEmpresa") IsNot Nothing AndAlso Request("CveEmpresa").ToEntero > 0) Then - - If Not ValidaCveEmpresaUsaurio(UsuarioActual.CveUsuario, Request("CveEmpresa").ToEntero) Then - 'Response.Redirect("../Inicio.aspx") - Alert("No tiene acceso a esta empresa.", TipoMensaje.MsgAdvertencia, "document.location.href = ""../Inicio.aspx""") - Exit Sub - End If - - End If - - CargaDdlPac() - CargaRegimenFiscal() - CargaGridIndicadores() - DtCuentasContables = Nothing - DtFuncionalidades = Nothing - DtCuentas = Nothing - CveClasificacionPorcentaje = 0 - - If (Request("CveEmpresa") IsNot Nothing AndAlso IsNumeric(Request("CveEmpresa")) AndAlso Request("CveEmpresa").ToEntero > 0 AndAlso UsuarioActual.CveRol = 1) OrElse UsuarioActual.CveRol <> 1 Then - ViewState("CveEmpresa") = If(UsuarioActual.CveRol <> 1, UsuarioActual.Empresa.CveEmpresa.ToString, Request("CveEmpresa")) ' Request("CveEmpresa") - ' Session("FileUpload") = CveEmpresa - CargaTareasProgramadas() - CargaDatos() - - 'Configuración de Modalidad Update - TxtTimbres.Enabled = False - LbArchivoKeyDescarga.Visible = True - LbArchivoCerDescarga.Visible = True - LbArchivoPfxDescarga.Visible = True - - 'If LnkArchivoKey.InnerText = "" Then - ' LnkArchivoKey.InnerText = "Reemplazar Archivo Key" - 'End If - 'If LnkArchivoCer.InnerText = "" Then - ' LnkArchivoCer.InnerText = "Reemplazar Archivo Cer" - 'End If - - 'If LnkArchivoPfx.InnerText = "" Then - ' LnkArchivoPfx.InnerText = "Reemplazar Archivo Pfx" - 'End If - BtnGuardar.Text = "Guardar Cambios" - - 'Plantilla Correo - - - Else - 'Configuración de Modalidad Insert - ViewState("CveEmpresa") = -1 - 'TAB.ActiveTabIndex = 1 - BtnEliminar.Visible = False - - End If - ConfiguracionEmpresa() - - End If - End Sub - - Private Function ValidaCveEmpresaUsaurio(CveUsuario As Integer, CveEmpresaValidar As Integer) As Boolean - - Dim Respuesta As Boolean = False - Using ObjEmpresas As New ClsSisEmpresas() - If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1", UsuarioActual.CveUsuario) Then - If ObjEmpresas.DtResultados.FiltraParametros($"CveEmpresa = {CveEmpresaValidar}").Rows.Count = 1 Then - Respuesta = True - End If - End If - End Using - Return Respuesta - - End Function - - Private Sub CargaDatos() - - Dim ObjEmpresas As New ClsSisEmpresas() - If ObjEmpresas.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then - If ObjEmpresas.DtResultados.Rows.Count > 0 Then - Me.EmpresaEditar = ObjEmpresas.Empresa - With ObjEmpresas.Empresa - - 'Campos para Modificación - TxtCveEmpresa.Text = .CveEmpresa.ToString - TxtEmpresa.Text = .Empresa : LtlTitulo.Text = "Consulta de Empresa: " & .Empresa - TxtNombreCorto.Text = .NombreCorto - TxtDireccion.Text = .Direccion - TxtNoExt.Text = .NoExt - TxtNoInt.Text = .NoInt - TxtColonia.Text = .Colonia - TxtCiudad.Text = .Ciudad - TxtEstado.Text = .Estado - TxtCP.Text = .CP.ToString - TxtRFC.Text = .RFC - TxtTelefono.Text = .Telefono - TxtContacto.Text = .Contacto 'Representante legal - TxtMail.Text = .Mail - DdlTipoFacturacion.SelectedValue = .TipoFacturacion - TxtBIUsuario.Text = .BIUsuario - TxtBIContraseña.Text = .BIContraseña - TxtContraseñaKey.Text = .ContraseñaKey - TxtArchivoKey.Text = .ArchivoKey - TxtArchivoCer.Text = .ArchivoCer - TxtArchivoPfx.Text = .ArchivoPfx - ChkEstatus.Checked = .Estatus - TxtFecha.Text = .FechaIng.ToString - TxtCveUsuario.Text = .Usuario - ChkFacturaProduccion.Checked = .FacturaProduccion - TxtSendMail.Text = .SendMail - TxtSendMailPassword.Text = .SendMailPassword - TxtSendMailServer.Text = .SendMailServer - TxtSendMailPort.Text = .SendMailPuerto.ToString - ChkSendMailSSL.Checked = .SendMailSSL - ChkMostrarRetIVA.Checked = .MostrarRetIVA - ChkMostrarRetISR.Checked = .MostrarRetISR - 'TxtRegimen.Text = .Regimen - ChkEstatusFacturacion.Checked = .EstatusFacturacion - TxtTimbres.Text = .Timbres.ToString - ChkUsaContabilidad.Checked = .UsaContabilidad - ChkUsaBancos.Checked = .UsaBancos - ChkUsaVentas.Checked = .UsaVentas - ChkUsaCxC.Checked = .UsaCxC - ChkUsaCompras.Checked = .UsaCompras - ChkUsaInventarios.Checked = .UsaInventarios - ChkUsaRH.Checked = .UsaRH - ChkUsaNomina.Checked = .UsaNomina - ChkUsaOS.Checked = .UsaOS - TxtBDContPAQi.Text = .BDContPAQi - TxtServerContPAQi.Text = .ServerContPAQi - TxtUsrContPAQi.Text = .UsrContPAQi - TxtPwdContPAQi.Text = .PwdContPAQi - TxtBuzon_Mail.Text = .Buzon_Mail - TxtBuzon_Server.Text = .Buzon_Server - TxtBuzon_Puerto.Text = .Buzon_Puerto.ToString - ChkBuzon_SSL.Checked = .Buzon_SSL - TxtBuzon_USR.Text = .Buzon_USR - TxtBuzon_PWD.Text = .Buzon_PWD - TxtMailSoporte.Text = .Soporte_Mail - TxtServidorSoporte.Text = .Soporte_Server - TxtPuertoSoporte.Text = .Soporte_Puerto.ToString - ChkSSLSoporte.Checked = .Soporte_SSL - TxtUsuarioSoporte.Text = .Soporte_USR - DdlProtocoloSoporte.SelectedValue = .Soporte_Tipo - TxtContraseñaSoporte.Text = .Soporte_PWD - DdlCvePac.SelectedValueExist(.CvePAC.ToString) - DdlRegimen.SelectedValue = .CveRegimenFiscal.ToString - TxtCURP.Text = .CURP - TxtImporte.Text.ToDecimal - TxtCIEC.Text = .CIEC - DdlPlataforma.SelectedValue = .CvePlataforma.ToString - ChkUsaAC.Checked = .UsaAC - TxtPorDepreciacion.Text = .PorDepreciacion.ToString - TxtExtension.Text = .Extension - TxtLocalidad.Text = .Localidad - DdlMetodoInventario.SelectedValue = .CveMetodoInventario.ToString - ChkAsientoContable.Checked = .AsientoContableComprasContado - TxtPeriodoActual.Text = .PeriodoActual.ToString - TxtEjercicioActual.Text = .EjercicioActual.ToString - ChkDefaultAsistencias.Checked = .DefaultAsistencias - TxtDiasPermitidos.Text = .DiasPermitidos.ToString - DdlTipoCentroDeCostos.SelectedValue = .Tipo_CentroCosto.ToString - ChkReqCentroCostos.Checked = .RequiereCentroCostos - DdlTerminalTipo.SelectedValue = .PV_TerminalTipo.ToString - TxtImporte.Text = .Importe.ToString - TipoContabilidad = .TipoContabilidad - - TxtPlantillaVenta.Text = .PlantillaMailVenta - TxtAsunto.Text = .AsuntoPlantillaMailVenta - - TxtPlantillaCotizacion.Text = .AsuntoPlantillaMailVentaCotizacion - TxtAsuntoCotizacion.Text = .PlantillaMailVentaCotizacion - - 'NUEVOS - TxtAreaGeografica.Text = .AreaGeografica - DdlProtocolo.Text = .Buzon_Tipo - - 'Fiel - LblPfx.Text = .FielPFX - lblPassFiel.Text = .FielPassword - - 'PARA PROPIEDAD - TRIGGER - BDContPAQ = .BDContPAQi - ServerContPAQ = .ServerContPAQi - - If TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" Then - CargaCuentasContables() - CargaDDLs() - - 'Dim Row As DataRow - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxAcreditar.ToString)) - 'If Not IsNothing(Row) Then - ' DdlIVAxAcreditar.Items.Add(New ListItem(Row("CtaCodigo").ToString, .IdCuentaIVAxAcreditar.ToString)) - ' DdlIVAxAcreditar.SelectedValue = .IdCuentaIVAxAcreditar.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAAcreditable.ToString)) - 'If Not IsNothing(Row) Then - ' DdlIVAAcreditable.Items.Add(New ListItem(Row("CtaCodigo").ToString, .IdCuentaIVAAcreditable.ToString)) - ' ' DdlIVAAcreditable.SelectedValue = .IdCuentaIVAAcreditable.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxTrasladar.ToString)) - 'If Not IsNothing(Row) Then - ' DdlIVAxTrasladar.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVAxTrasladar.ToString))("CtaCodigo").ToString, .IdCuentaIVAxTrasladar.ToString)) - ' DdlIVAxTrasladar.SelectedValue = .IdCuentaIVAxTrasladar.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVATrasladado.ToString)) - 'If Not IsNothing(Row) Then - ' DdlIVATrasladado.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIVATrasladado.ToString))("CtaCodigo").ToString, .IdCuentaIVATrasladado.ToString)) - ' DdlIVATrasladado.SelectedValue = .IdCuentaIVATrasladado.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetIVACirculacion.ToString)) - 'If Not IsNothing(Row) Then - ' DdlIVARetenciones.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetIVACirculacion.ToString))("CtaCodigo").ToString, .IdCuentaRetIVACirculacion.ToString)) - ' DdlIVARetenciones.SelectedValue = .IdCuentaRetIVACirculacion.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetISRCirculacion.ToString)) - 'If Not IsNothing(Row) Then - ' DdlISRCirculacion.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaRetISRCirculacion.ToString))("CtaCodigo").ToString, .IdCuentaRetISRCirculacion.ToString)) - ' DdlISRCirculacion.SelectedValue = .IdCuentaRetISRCirculacion.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaPerdidaCambiaria.ToString)) - 'If Not IsNothing(Row) Then - ' DdlCuentaPerdidaCambiaria.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaPerdidaCambiaria.ToString))("CtaCodigo").ToString, .IdCuentaPerdidaCambiaria.ToString)) - ' DdlCuentaPerdidaCambiaria.SelectedValue = .IdCuentaPerdidaCambiaria.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaGananciaCambiaria.ToString)) - 'If Not IsNothing(Row) Then - ' DddlCuentaGananciaCambiaria.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaGananciaCambiaria.ToString))("CtaCodigo").ToString, .IdCuentaGananciaCambiaria.ToString)) - ' DddlCuentaGananciaCambiaria.SelectedValue = .IdCuentaGananciaCambiaria.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaDSV.ToString)) - 'If Not IsNothing(Row) Then - ' DdlDSV.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaDSV.ToString))("CtaCodigo").ToString, .IdCuentaDSV.ToString)) - ' DdlDSV.SelectedValue = .IdCuentaDSV.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaImpuestosLocales.ToString)) - 'If Not IsNothing(Row) Then - ' DdlImpuestosLocales.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaImpuestosLocales.ToString))("CtaCodigo").ToString, .IdCuentaImpuestosLocales.ToString)) - ' DdlImpuestosLocales.SelectedValue = .IdCuentaImpuestosLocales.ToString - 'End If - - - 'NUEVOS DATOS - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxAcreditar.ToString)) - 'If Not IsNothing(Row) Then - ' DdlIEPSxAcreditar.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxAcreditar.ToString))("CtaCodigo").ToString, .IdCuentaIEPSxAcreditar.ToString)) - ' DdlIEPSxAcreditar.SelectedValue = .IdCuentaIEPSxAcreditar.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSAcreditable.ToString)) - 'If Not IsNothing(Row) Then - ' DdlIEPSAcreditable.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSAcreditable.ToString))("CtaCodigo").ToString, .IdCuentaIEPSAcreditable.ToString)) - ' DdlIEPSAcreditable.SelectedValue = .IdCuentaIEPSAcreditable.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxTrasladar.ToString)) - 'If Not IsNothing(Row) Then - ' DdlIEPSxTrasladar.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSxTrasladar.ToString))("CtaCodigo").ToString, .IdCuentaIEPSxTrasladar.ToString)) - ' DdlIEPSxTrasladar.SelectedValue = .IdCuentaIEPSxTrasladar.ToString - 'End If - - 'Row = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSTrasladado.ToString)) - 'If Not IsNothing(Row) Then - ' DdlIEPSTrasladado.Items.Add(New ListItem(DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", .IdCuentaIEPSTrasladado.ToString))("CtaCodigo").ToString, .IdCuentaIEPSTrasladado.ToString)) - ' DdlIEPSTrasladado.SelectedValue = .IdCuentaIEPSTrasladado.ToString - 'End If - - End If - - 'CUENTAS PADRES - ObjEmpresas.GetEmpresasFuncionalidades(CveEmpresa) - DtFuncionalidades = ObjEmpresas.DtResultados - - CargaFuncionalidad(201, DdlProveedores) - CargaFuncionalidad(211, DdlClientes) - CargaFuncionalidad(205, DdlDeudores) - CargaFuncionalidad(202, DdlAcreedores) - CargaFuncionalidad(203, DdlDocxPagar) - CargaFuncionalidad(212, DdlAnticipoCliente) - CargaFuncionalidad(204, DdlAnticipoProveedores) - CargaFuncionalidad(208, DdlInventario) - CargaFuncionalidad(216, DdlGasto) - CargaFuncionalidad(209, DdlBancos) - CargaFuncionalidad(218, DdlCaja) - CargaFuncionalidad(215, DdlFyE) - CargaFuncionalidad(221, DdlActivoFijo) - - 'CargaFuncionalidad(232, DdlProveedoresSIG) - 'CargaFuncionalidad(233, DdlClientesSIG) - 'CargaFuncionalidad(234, DdlDeudoresSIG) - 'CargaFuncionalidad(235, DdlAcreedoresSIG) - 'CargaFuncionalidad(236, DdlDocxPagarSIG) - 'CargaFuncionalidad(237, DdlAnticipoClienteSIG) - 'CargaFuncionalidad(238, DdlAnticipoProveedoresSIG) - 'CargaFuncionalidad(239, DdlInventarioSIG) - 'CargaFuncionalidad(240, DdlGastoSIG) - 'CargaFuncionalidad(241, DdlBancosSIG) - 'CargaFuncionalidad(242, DdlCajaSIG) - 'CargaFuncionalidad(243, DdlFyESIG) - 'CargaFuncionalidad(244, DdlActivoFijoSIG) - - Session("FileUpload") = .Banner - Session("FileUpload") = .ArchivoKey - Session("FileUpload") = .ArchivoCer - Session("FileUpload") = .ArchivoPfx - End With - InicializaClasificacionIVA(ObjEmpresas) - Else - Alert("La Empresa Solicitada no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) - BtnGuardar.Enabled = False - - End If - End If - - ObjEmpresas.Dispose() - CargarGrupoEmpresas() - UpDatos.Update() - End Sub - Protected Sub CargarGrupoEmpresas() - Dim ObjEmpresas As New ClsSisEmpresas() - - 'Gridview - ObjEmpresas.GetEmpresasGrupos(CveEmpresa) - GVGrupoEmpresas.DataSource = ObjEmpresas.DtResultados - GVGrupoEmpresas.DataBind() - - 'DropdownList Empresas - ObjEmpresas.GetEmpresasGruposNot(CveEmpresa) - DdlEmpresas.Items.Clear() - DdlEmpresas.DataSource = ObjEmpresas.DtResultados - DdlEmpresas.DataBind() - - ObjEmpresas.Dispose() - - updategrupoempresa.Update() - End Sub - Protected Sub LinkButton1_Click(sender As Object, e As EventArgs) Handles AddGrupoEmpresa.Click - - Dim ObjEmpresas As New ClsSisEmpresas() - ObjEmpresas.AddEmpresasGrupos(CveEmpresa, DdlEmpresas.SelectedValue.ToEntero) - ObjEmpresas.Dispose() - CargarGrupoEmpresas() - End Sub - Protected Sub GrupoEmpresas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GVGrupoEmpresas.RowDeleting - Dim ObjEmpresas As New ClsSisEmpresas() - ObjEmpresas.RemoveEmpresasGrupos(CveEmpresa, CType(GVGrupoEmpresas.Rows(e.RowIndex).FindControl("GVColCVeEmpresa"), HiddenField).Value.ToEntero()) - ObjEmpresas.Dispose() - CargarGrupoEmpresas() - End Sub - Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click - Dim ObjEmpresas As New ClsSisEmpresas - Dim ObjGral As New ClsGenerales() - Dim ObjContPAQ As ClsContPAQi = Nothing - Dim Indicador As New ClsIndicadores(ObjEmpresas.IniciaTransacSQL()) - - Dim TextoError = "" - Dim TextoOK = "" - - If CveEmpresa = -1 Then - If ObjEmpresas.AddEmpresa(TxtCveEmpresa.Text.Trim.ToEntero, TxtEmpresa.Text.Trim, TxtDireccion.Text.Trim, TxtNoExt.Text.Trim, TxtNoInt.Text.Trim, TxtColonia.Text.Trim, - TxtCiudad.Text.Trim, TxtEstado.Text.Trim, TxtRFC.Text.Trim, TxtCP.Text.Trim.ToEntero, TxtTelefono.Text.Trim, TxtContacto.Text.Trim, TxtMail.Text.Trim, - DdlTipoFacturacion.SelectedValue, TxtBIUsuario.Text.Trim, TxtBIContraseña.Text.Trim, TxtContraseñaKey.Text.Trim, TxtArchivoKey.Text.Trim, - TxtArchivoCer.Text.Trim, TxtArchivoPfx.Text.Trim, "", UsuarioActual.CveUsuario, ChkFacturaProduccion.Checked, ChkMostrarRetIVA.Checked, - ChkMostrarRetISR.Checked, "-1", ChkEstatusFacturacion.Checked, TxtSendMail.Text.Trim, TxtSendMailPassword.Text.Trim, TxtSendMailServer.Text.Trim, - TxtSendMailPort.Text.Trim.ToEntero, ChkSendMailSSL.Checked, ChkUsaContabilidad.Checked, ChkUsaBancos.Checked, ChkUsaVentas.Checked, ChkUsaCxC.Checked, - ChkUsaCompras.Checked, ChkUsaInventarios.Checked, ChkUsaRH.Checked, ChkUsaNomina.Checked, ChkUsaOS.Checked, TxtBDContPAQi.Text.Trim, TxtServerContPAQi.Text.Trim, - TxtUsrContPAQi.Text.Trim, TxtPwdContPAQi.Text.Trim, TxtBuzon_Mail.Text.Trim, TxtBuzon_Server.Text.Trim, TxtBuzon_Puerto.Text.Trim.ToEntero, ChkBuzon_SSL.Checked, - TxtBuzon_USR.Text.Trim, TxtBuzon_PWD.Text.Trim, DdlProtocolo.SelectedValue, TxtMailSoporte.Text.Trim, TxtServidorSoporte.Text.Trim, TxtPuertoSoporte.Text.Trim.ToEntero, ChkSSLSoporte.Checked, - TxtUsuarioSoporte.Text.Trim, TxtContraseñaSoporte.Text.Trim, DdlProtocoloSoporte.SelectedValue, - "".Trim, TxtAreaGeografica.Text.Trim, - TxtNombreCorto.Text, TxtCURP.Text.Trim, DdlRegimen.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, TxtCIEC.Text, DdlPlataforma.SelectedValue.ToEntero, ChkUsaAC.Checked, - TxtPorDepreciacion.Text.ToDecimal, TxtExtension.Text, TxtLocalidad.Text, DdlMetodoInventario.SelectedValue.ToEntero, ChkAsientoContable.Checked, TxtPeriodoActual.Text.ToEntero, - TxtEjercicioActual.Text.ToEntero, ChkDefaultAsistencias.Checked, TxtDiasPermitidos.Text.ToEntero, DdlTipoCentroDeCostos.SelectedValue.ToEntero, ChkReqCentroCostos.Checked, DdlTerminalTipo.SelectedValue.ToEntero, CvePAC:=DdlCvePac.SelectedValue.ToEntero - ) Then - - 'Movemos el Archivo Fisicamente - If Session("FileUpload") IsNot Nothing AndAlso Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString) Then - Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString) - File.Move(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Banners\" & ObjEmpresas.CveEmpresa.ToString & Extension) - - End If - ViewState("CveEmpresa") = ObjEmpresas.CveEmpresa - 'InicializaClasificacionIVA(ObjEmpresas) - TextoOK = "La nueva Empresa se guardó correctamente." - Else - TextoError = "Ocurrió un error al agregar la empresa" - End If - - - - 'Agregar Indicadores - For Each Row As GridViewRow In GvIndicadores.Rows - If Row.DataKey("CveIndicador") <> "" And Row.DataKey("CveEmpresa") = "" Then - If Row.FCCheckBox("chkIndicador").Checked Then - If Not Indicador.AddIndicadorEmpresa(Row.DataKey("CveIndicador").ToEntero, UsuarioActual.CveEmpresa) Then - Exit For - End If - End If - End If - Next - - - - - Else - If ObjEmpresas.UpdateEmpresa(TxtEmpresa.Text.Trim, TxtDireccion.Text.Trim, TxtNoExt.Text.Trim, TxtNoInt.Text.Trim, TxtColonia.Text.Trim, TxtCiudad.Text.Trim, TxtEstado.Text.Trim, TxtRFC.Text.Trim, - TxtCP.Text.Trim.ToEntero, TxtTelefono.Text.Trim, TxtContacto.Text.Trim, TxtMail.Text.Trim, DdlTipoFacturacion.SelectedItem.ToString, TxtBIUsuario.Text.Trim, - TxtBIContraseña.Text.Trim, TxtContraseñaKey.Text.Trim, TxtArchivoKey.Text.Trim, TxtArchivoCer.Text.Trim, TxtArchivoPfx.Text.Trim, "", ChkEstatus.Checked, - ChkFacturaProduccion.Checked, ChkMostrarRetIVA.Checked, ChkMostrarRetISR.Checked, "-1", ChkEstatusFacturacion.Checked, TxtSendMail.Text.Trim, - TxtSendMailPassword.Text.Trim, TxtSendMailServer.Text.Trim, TxtSendMailPort.Text.Trim.ToEntero, ChkSendMailSSL.Checked, ChkUsaContabilidad.Checked, ChkUsaBancos.Checked, - ChkUsaVentas.Checked, ChkUsaCxC.Checked, ChkUsaCompras.Checked, ChkUsaInventarios.Checked, ChkUsaRH.Checked, ChkUsaNomina.Checked, ChkUsaOS.Checked, TxtBDContPAQi.Text.Trim, - TxtServerContPAQi.Text.Trim, TxtUsrContPAQi.Text.Trim, TxtPwdContPAQi.Text.Trim, TxtBuzon_Mail.Text.Trim, TxtBuzon_Server.Text.Trim, TxtBuzon_Puerto.Text.Trim.ToEntero, - ChkBuzon_SSL.Checked, TxtBuzon_USR.Text.Trim, TxtBuzon_PWD.Text.Trim, TxtCveEmpresa.Text.Trim.ToEntero, DdlProtocolo.SelectedValue, - TxtMailSoporte.Text.Trim, TxtServidorSoporte.Text.Trim, TxtPuertoSoporte.Text.Trim.ToEntero, ChkSSLSoporte.Checked, - TxtUsuarioSoporte.Text.Trim, TxtContraseñaSoporte.Text.Trim, DdlProtocoloSoporte.SelectedValue, DdlIVAxAcreditar.SelectedValue.ToEntero, - DdlIVAAcreditable.SelectedValue.ToEntero, DdlIVAxTrasladar.SelectedValue.ToEntero, DdlIVATrasladado.SelectedValue.ToEntero, DdlIVARetenciones.SelectedValue.ToEntero, - DdlISRCirculacion.SelectedValue.ToEntero, DdlCuentaOtrosIngresos.SelectedValue.ToEntero, DdlCuentaDescuentoVenta.SelectedValue.ToEntero, "", TxtAreaGeografica.Text.Trim, DdlCuentaPerdidaCambiaria.SelectedValue.ToEntero, - DddlCuentaGananciaCambiaria.SelectedValue.ToEntero, TxtNombreCorto.Text, TxtCURP.Text.Trim, DdlRegimen.SelectedValue.ToEntero, DdlCvePac.SelectedValue.ToEntero, - TxtImporte.Text.ToDecimal, TxtCIEC.Text, DdlPlataforma.SelectedValue.ToEntero, ChkUsaAC.Checked, - TxtPorDepreciacion.Text.ToDecimal, TxtExtension.Text, TxtLocalidad.Text, DdlMetodoInventario.SelectedValue.ToEntero, ChkAsientoContable.Checked, TxtPeriodoActual.Text.ToEntero, - TxtEjercicioActual.Text.ToEntero, ChkDefaultAsistencias.Checked, TxtDiasPermitidos.Text.ToEntero, DdlTipoCentroDeCostos.SelectedValue.ToEntero, ChkReqCentroCostos.Checked, DdlTerminalTipo.SelectedValue.ToEntero, IdCuentaDSV:=DdlDSV.SelectedValue.ToEntero, - IdCuentaImpuestosLocales:=DdlImpuestosLocales.SelectedValue.ToEntero, IdCuentaIEPSxAcreditar:=DdlIEPSxAcreditar.SelectedValue.ToEntero, IdCuentaIEPSAcreditable:=DdlIEPSAcreditable.SelectedValue.ToEntero, - IdCuentaIEPSxTrasladar:=DdlIEPSxTrasladar.SelectedValue.ToEntero, IdCuentaIEPSTrasladado:=DdlIEPSTrasladado.SelectedValue.ToEntero) Then - - 'Movemos el Archivo Fisicamente - If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString) Then - Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString) - If File.Exists(Request.PhysicalApplicationPath + "Banners\" & CveEmpresa & Extension) Then - File.Delete(Request.PhysicalApplicationPath + "Banners\" & CveEmpresa & Extension) - File.Move(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Banners\" & CveEmpresa & Extension) - Else - File.Move(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Banners\" & CveEmpresa & Extension) - End If - End If - - TextoOK = "Los cambios de guardaron correctamente." - Else - TextoError = "Ocurrió un error al guardar los cambios de la empresa" - End If - - 'Agregar Indicadores - For Each Row As GridViewRow In GvIndicadores.Rows - If Row.DataKey("CveIndicador") <> "" AndAlso Row.DataKey("CveEmpresa") <> "" And Row.FCCheckBox("chkIndicador").Checked = False Then - If Not Indicador.RemoveIndicadoresEmpresas(Row.DataKey("CveIndicador").ToEntero, UsuarioActual.CveEmpresa) Then - Exit For - End If - End If - - If Row.DataKey("CveIndicador") <> "" And Row.DataKey("CveEmpresa") = "" Then - If Row.FCCheckBox("chkIndicador").Checked Then - If Not Indicador.AddIndicadorEmpresa(Row.DataKey("CveIndicador").ToEntero, UsuarioActual.CveEmpresa) Then - Exit For - End If - End If - End If - Next - - End If - - 'CLASIFICACIONES DE IVAS - If DtClasificacionIVA IsNot Nothing OrElse DtClasificacionIVA.Rows.Count > 0 Then - For Each Dr As DataRow In DtClasificacionIVA.Rows - If Not Dr("CveClasificacion").ToString.ToEntero > 0 Then - If Not ObjGral.RemoveClasificacionPorcentaje(Dr("CveClasificacionPorcentaje").ToString.ToEntero) Then - TextoError = "Ocurrió un error al guardar los cambios de la empresa" - End If - 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("IdCtaIVAXTrasladar").ToString.ToEntero, Dr("IdCtaIVATrasladado").ToString.ToEntero, CveEmpresa) Then - TextoError = "Ocurrió un error al guardar los cambios de la empresa" - End If - ElseIf Dr("CveClasificacionPorcentaje").ToString.ToEntero > 0 Then - 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("IdCtaIVAXTrasladar").ToString.ToEntero, Dr("IdCtaIVATrasladado").ToString.ToEntero) Then - TextoError = "Ocurrió un error al guardar los cambios de la empresa" - End If - End If - Next - End If - - 'RECARGA EMPRESA - If TextoError = "" Then - If ObjEmpresas.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then - GlobalDTEmpresas(CveEmpresa) = Nothing - - 'verifico si existe la carpeta de la empresa, sino la crea - For Each dr As Data.DataRow In ObjEmpresas.DtResultados.Rows - If Not IO.Directory.Exists(String.Format("{0}\{1}", ModExtensiones.DirectorioBaseEmpresas, dr("CveEmpresa"))) Then - IO.Directory.CreateDirectory(String.Format("{0}Empresas\{1}", ModExtensiones.DirectorioBaseEmpresas, dr("CveEmpresa"))) - End If - Next - End If - - ' GlobalDTClasificacionPorcentaje(CveEmpresa) = Nothing - - End If - - 'AGREGAR FUNCIONALIDADES - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 201, DdlProveedores) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 211, DdlClientes) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 208, DdlInventario) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 216, DdlGasto) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 209, DdlBancos) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 205, DdlDeudores) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 202, DdlAcreedores) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 203, DdlDocxPagar) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 212, DdlAnticipoCliente) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 204, DdlAnticipoProveedores) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 218, DdlCaja) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 215, DdlFyE) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 221, DdlActivoFijo) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 246, DdlClientes) - If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 237, DdlAnticipoCliente) - - ''AGREGAR FUNCIONALIDADES - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 232, DdlProveedoresSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 233, DdlClientesSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 239, DdlInventarioSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 240, DdlGastoSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 241, DdlBancosSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 234, DdlDeudoresSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 235, DdlAcreedoresSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 236, DdlDocxPagarSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 237, DdlAnticipoClienteSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 238, DdlAnticipoProveedoresSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 242, DdlCajaSIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 243, DdlFyESIG) - 'If TextoError = "" Then TextoError = AgregarFuncionalidad(ObjEmpresas, 244, DdlActivoFijoSIG) - - 'TRIGGER - If TextoError = "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" Then - - If UsuarioActual.Empresa.UsaContabilidad Then - - If UsuarioActual.Empresa.TipoContabilidad = 2 Then - 'CREA OBJETO EMPRESA - If ObjEmpresas.GetEmpresas(TxtCveEmpresa.Text.ToEntero, "-1", "-1", "-1", "-1") Then - Dim Empresa As New Empresa - Empresa = ObjEmpresas.Empresa - - ObjContPAQ = New ClsContPAQi(Empresa) - - If ObjContPAQ.Conectado Then - 'ADD - If BDContPAQ = "" Then - If Not ObjContPAQ.TRIGGER(TxtBDContPAQi.Text.Trim) Then - TextoError = "Los datos de conexion al servidor de contabilidad son incorrectos" - End If - End If - - 'UPDATE - If BDContPAQ <> "" And (BDContPAQ <> TxtBDContPAQi.Text.Trim Or ServerContPAQ <> TxtServerContPAQi.Text.Trim) Then - If Not ObjContPAQ.TRIGGER(TxtBDContPAQi.Text.Trim) Then - TextoError = "Los datos de conexion al servidor de contabilidad son incorrectos" - End If - End If - Else - TextoError = "Los datos de conexion al servidor de contabilidad son incorrectos" - End If - End If - End If - - Else - Alert("La empresa tiene la información para el uso de contabilidad pero no se tiene activada", TipoMensaje.MsgAdvertencia) - End If - End If - - If TextoError = "" Then - ObjEmpresas.Commit() - If ObjContPAQ IsNot Nothing Then ObjContPAQ.Commit() - Alert(TextoOK, TipoMensaje.MsgInformacion, "document.location.href=""/Sistemas/Empresa.aspx?CveEmpresa=" & TxtCveEmpresa.Text.Trim & """;") - Session("FileUpload") = "" - CargaDatos() - UpDatos.Update() - Else - ObjEmpresas.RollBack() - If ObjContPAQ IsNot Nothing Then ObjContPAQ.RollBack() - Alert(TextoError, TipoMensaje.MsgError) - End If - - ObjEmpresas.Dispose() - ObjGral.Dispose() - If ObjContPAQ IsNot Nothing Then ObjContPAQ.Dispose() - End Sub - Private Function AgregarFuncionalidad(ObjEmpresas As ClsSisEmpresas, CveFuncionalidad As Integer, ByRef Ddl As DropDownList) As String - Dim Retorno = "" - - If Not ObjEmpresas.AddUpdateEmpresaFuncionalidades(TxtCveEmpresa.Text.Trim.ToEntero, CveFuncionalidad, Ddl.SelectedValue) Then - Retorno = "Ocurrió un error al vincular la cuenta contable" - End If - - Return Retorno - End Function - Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click - Dim ObjEmpresas As New ClsSisEmpresas - If ObjEmpresas.RemoveEmpresa(CveEmpresa) Then - GlobalDTEmpresas = ObjEmpresas.DtResultados - Alert("La Empresa se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Sistemas/Empresa.aspx"";") - End If - ObjEmpresas.Dispose() - End Sub - - 'Nuevo Código - Private Sub CargaCuentasContables(Optional IdCuentaPadre As Integer = -1) - DtCuentasContables = Nothing - - If UsuarioActual.Empresa.UsaContabilidad Then - Dim ObjEmpresa As New ClsSisEmpresas - Dim Empresa As Empresa = Nothing - If ObjEmpresa.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then - - Empresa = ObjEmpresa.Empresa - - If Empresa.TipoContabilidad = 2 Then - Dim ObjContabilidad As New ClsContPAQi(Empresa) - If ObjContabilidad.GetCuentas(-1, "-1", -1, IdPadre:=IdCuentaPadre) Then - DtCuentasContables = ObjContabilidad.DtResultados - End If - ObjContabilidad.Dispose() - End If - - - - End If - ObjEmpresa.Dispose() - End If - End Sub - - Private Sub CargaCuentasContablesSIG(Optional IdCuentaPadre As Integer = -1) - DtCuentasContablesSIG = Nothing - - Dim ObjEmpresa As New ClsSisEmpresas - Dim Empresa As Empresa = Nothing - If ObjEmpresa.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then - Empresa = ObjEmpresa.Empresa - Dim ObjContabilidad As New ClsContabilidad - If ObjContabilidad.GetCuentas(-1, "-1", -1, CveEmpresa, CvePadre:=IdCuentaPadre) Then - DtCuentasContablesSIG = ObjContabilidad.DtResultados - End If - ObjContabilidad.Dispose() - End If - ObjEmpresa.Dispose() - End Sub - - Protected Sub BtnCargarCuentas_Click(sender As Object, e As EventArgs) Handles BtnCargarCuentas.Click - If DtCuentasContables Is Nothing Then - - End If - Dim Seleccionado As String - Select Case HdnCuenta.Value - Case "1" - If DdlIVAxAcreditar.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlIVAxAcreditar.SelectedValue - DdlIVAxAcreditar.Items.Clear() : DdlIVAxAcreditar.Items.Add(New ListItem("Seleccione", "0")) - DdlIVAxAcreditar.DataSource = DtCuentasContables : DdlIVAxAcreditar.DataBind() : DdlIVAxAcreditar.SelectedValueExist(Seleccionado) - DdlIVAxAcreditar.AutoPostBack = False : DdlIVAxAcreditar.Attributes.Remove("onclick") : DdlIVAxAcreditar.CssClass &= " select2me" - Case "2" - If DdlIVAAcreditable.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlIVAAcreditable.SelectedValue - DdlIVAAcreditable.Items.Clear() : DdlIVAAcreditable.Items.Add(New ListItem("Seleccione", "0")) - DdlIVAAcreditable.DataSource = DtCuentasContables : DdlIVAAcreditable.DataBind() : DdlIVAAcreditable.SelectedValue = Seleccionado - DdlIVAAcreditable.AutoPostBack = False : DdlIVAAcreditable.Attributes.Remove("onclick") : DdlIVAAcreditable.CssClass &= " select2me" - Case "3" - If DdlIVAxTrasladar.Attributes("onclick") <> "" Then CargaCuentasContables(-1) - Seleccionado = DdlIVAxTrasladar.SelectedValue - DdlIVAxTrasladar.Items.Clear() : DdlIVAxTrasladar.Items.Add(New ListItem("Seleccione", "0")) - DdlIVAxTrasladar.DataSource = DtCuentasContables : DdlIVAxTrasladar.DataBind() : DdlIVAxTrasladar.SelectedValue = Seleccionado - DdlIVAxTrasladar.AutoPostBack = False : DdlIVAxTrasladar.Attributes.Remove("onclick") : DdlIVAxTrasladar.CssClass &= " select2me" - Case "4" - If DdlIVATrasladado.Attributes("onclick") <> "" Then CargaCuentasContables(-1) - Seleccionado = DdlIVATrasladado.SelectedValue - DdlIVATrasladado.Items.Clear() : DdlIVATrasladado.Items.Add(New ListItem("Seleccione", "0")) - DdlIVATrasladado.DataSource = DtCuentasContables : DdlIVATrasladado.DataBind() : DdlIVATrasladado.SelectedValue = Seleccionado - DdlIVATrasladado.AutoPostBack = False : DdlIVATrasladado.Attributes.Remove("onclick") : DdlIVATrasladado.CssClass &= " select2me" - Case "5" - If DdlIVARetenciones.Attributes("onclick") <> "" Then CargaCuentasContables(-1) - Seleccionado = DdlIVARetenciones.SelectedValue - DdlIVARetenciones.Items.Clear() : DdlIVARetenciones.Items.Add(New ListItem("Seleccione", "0")) - DdlIVARetenciones.DataSource = DtCuentasContables : DdlIVARetenciones.DataBind() : DdlIVARetenciones.SelectedValue = Seleccionado - DdlIVARetenciones.AutoPostBack = False : DdlIVARetenciones.Attributes.Remove("onclick") : DdlIVARetenciones.CssClass &= " select2me" - Case "6" - If DdlISRCirculacion.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlISRCirculacion.SelectedValue - DdlISRCirculacion.Items.Clear() : DdlISRCirculacion.Items.Add(New ListItem("Seleccione", "0")) - DdlISRCirculacion.DataSource = DtCuentasContables : DdlISRCirculacion.DataBind() : DdlISRCirculacion.SelectedValue = Seleccionado - DdlISRCirculacion.AutoPostBack = False : DdlISRCirculacion.Attributes.Remove("onclick") : DdlISRCirculacion.CssClass &= " select2me" - Case "7" - If DdlProveedores.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlProveedores.SelectedValue - DdlProveedores.Items.Clear() : DdlProveedores.Items.Add(New ListItem("Seleccione", "0")) - DdlProveedores.DataSource = DtCuentasContables : DdlProveedores.DataBind() : DdlProveedores.SelectedValueExist(Seleccionado) - DdlProveedores.AutoPostBack = False : DdlProveedores.Attributes.Remove("onclick") : DdlProveedores.CssClass &= " select2me" - Case "8" - If DdlClientes.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlClientes.SelectedValue - DdlClientes.Items.Clear() : DdlClientes.Items.Add(New ListItem("Seleccione", "0")) - DdlClientes.DataSource = DtCuentasContables : DdlClientes.DataBind() : DdlClientes.SelectedValueExist(Seleccionado) - DdlClientes.AutoPostBack = False : DdlClientes.Attributes.Remove("onclick") : DdlClientes.CssClass &= " select2me" - Case "9" - If DdlInventario.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlInventario.SelectedValue - DdlInventario.Items.Clear() : DdlInventario.Items.Add(New ListItem("Seleccione", "0")) - DdlInventario.DataSource = DtCuentasContables : DdlInventario.DataBind() : DdlInventario.SelectedValue = Seleccionado - DdlInventario.AutoPostBack = False : DdlInventario.Attributes.Remove("onclick") : DdlInventario.CssClass &= " select2me" - Case "10" - If DdlGasto.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlGasto.SelectedValue - DdlGasto.Items.Clear() : DdlGasto.Items.Add(New ListItem("Seleccione", "0")) - DdlGasto.DataSource = DtCuentasContables : DdlGasto.DataBind() : DdlGasto.SelectedValue = Seleccionado - DdlGasto.AutoPostBack = False : DdlGasto.Attributes.Remove("onclick") : DdlGasto.CssClass &= " select2me" - Case "11" - If DdlBancos.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlBancos.SelectedValue - DdlBancos.Items.Clear() : DdlBancos.Items.Add(New ListItem("Seleccione", "0")) - DdlBancos.DataSource = DtCuentasContables : DdlBancos.DataBind() : DdlBancos.SelectedValue = Seleccionado - DdlBancos.AutoPostBack = False : DdlBancos.Attributes.Remove("onclick") : DdlBancos.CssClass &= " select2me" - Case "12" - If DdlDeudores.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlDeudores.SelectedValue - DdlDeudores.Items.Clear() : DdlDeudores.Items.Add(New ListItem("Seleccione", "0")) - DdlDeudores.DataSource = DtCuentasContables : DdlDeudores.DataBind() : DdlDeudores.SelectedValue = Seleccionado - DdlDeudores.AutoPostBack = False : DdlDeudores.Attributes.Remove("onclick") : DdlDeudores.CssClass &= " select2me" - Case "13" - If DdlAcreedores.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlAcreedores.SelectedValue - DdlAcreedores.Items.Clear() : DdlAcreedores.Items.Add(New ListItem("Seleccione", "0")) - DdlAcreedores.DataSource = DtCuentasContables : DdlAcreedores.DataBind() : DdlAcreedores.SelectedValue = Seleccionado - DdlAcreedores.AutoPostBack = False : DdlAcreedores.Attributes.Remove("onclick") : DdlAcreedores.CssClass &= " select2me" - Case "14" - If DdlDocxPagar.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlDocxPagar.SelectedValue - DdlDocxPagar.Items.Clear() : DdlDocxPagar.Items.Add(New ListItem("Seleccione", "0")) - DdlDocxPagar.DataSource = DtCuentasContables : DdlDocxPagar.DataBind() : DdlDocxPagar.SelectedValue = Seleccionado - DdlDocxPagar.AutoPostBack = False : DdlDocxPagar.Attributes.Remove("onclick") : DdlDocxPagar.CssClass &= " select2me" - Case "15" - If DdlAnticipoCliente.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlAnticipoCliente.SelectedValue - DdlAnticipoCliente.Items.Clear() : DdlAnticipoCliente.Items.Add(New ListItem("Seleccione", "0")) - DdlAnticipoCliente.DataSource = DtCuentasContables : DdlAnticipoCliente.DataBind() : DdlAnticipoCliente.SelectedValue = Seleccionado - DdlAnticipoCliente.AutoPostBack = False : DdlAnticipoCliente.Attributes.Remove("onclick") : DdlAnticipoCliente.CssClass &= " select2me" - Case "16" - If DdlAnticipoProveedores.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlAnticipoProveedores.SelectedValue - DdlAnticipoProveedores.Items.Clear() : DdlAnticipoProveedores.Items.Add(New ListItem("Seleccione", "0")) - DdlAnticipoProveedores.DataSource = DtCuentasContables : DdlAnticipoProveedores.DataBind() : DdlAnticipoProveedores.SelectedValue = Seleccionado - DdlAnticipoProveedores.AutoPostBack = False : DdlAnticipoProveedores.Attributes.Remove("onclick") : DdlAnticipoProveedores.CssClass &= " select2me" - Case "17" - If DdlCaja.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlCaja.SelectedValue - DdlCaja.Items.Clear() : DdlCaja.Items.Add(New ListItem("Seleccione", "0")) - DdlCaja.DataSource = DtCuentasContables : DdlCaja.DataBind() : DdlCaja.SelectedValue = Seleccionado - DdlCaja.AutoPostBack = False : DdlCaja.Attributes.Remove("onclick") : DdlCaja.CssClass &= " select2me" - Case "18" - If DdlFyE.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlFyE.SelectedValue - DdlFyE.Items.Clear() : DdlFyE.Items.Add(New ListItem("Seleccione", "0")) - DdlFyE.DataSource = DtCuentasContables : DdlFyE.DataBind() : DdlFyE.SelectedValue = Seleccionado - DdlFyE.AutoPostBack = False : DdlFyE.Attributes.Remove("onclick") : DdlFyE.CssClass &= " select2me" - Case "19" - If DddlCuentaGananciaCambiaria.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DddlCuentaGananciaCambiaria.SelectedValue - DddlCuentaGananciaCambiaria.Items.Clear() : DddlCuentaGananciaCambiaria.Items.Add(New ListItem("Seleccione", "0")) - DddlCuentaGananciaCambiaria.DataSource = DtCuentasContables : DddlCuentaGananciaCambiaria.DataBind() : DddlCuentaGananciaCambiaria.SelectedValueExist(Seleccionado) - DddlCuentaGananciaCambiaria.AutoPostBack = False : DddlCuentaGananciaCambiaria.Attributes.Remove("onclick") : DddlCuentaGananciaCambiaria.CssClass &= " select2me" - Case "20" - If DdlCuentaPerdidaCambiaria.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlCuentaPerdidaCambiaria.SelectedValue - DdlCuentaPerdidaCambiaria.Items.Clear() : DdlCuentaPerdidaCambiaria.Items.Add(New ListItem("Seleccione", "0")) - DdlCuentaPerdidaCambiaria.DataSource = DtCuentasContables : DdlCuentaPerdidaCambiaria.DataBind() : DdlCuentaPerdidaCambiaria.SelectedValue = Seleccionado - DdlCuentaPerdidaCambiaria.AutoPostBack = False : DdlCuentaPerdidaCambiaria.Attributes.Remove("onclick") : DdlCuentaPerdidaCambiaria.CssClass &= " select2me" - - 'CUENTAS PADRES - - Case "21" - If DdlProveedores.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlProveedores.SelectedValue - DdlProveedores.Items.Clear() : DdlProveedores.Items.Add(New ListItem("Seleccione", "0")) - DdlProveedores.DataSource = DtCuentasContables : DdlProveedores.DataBind() : DdlProveedores.SelectedValue = Seleccionado - DdlProveedores.AutoPostBack = False : DdlProveedores.Attributes.Remove("onclick") : DdlProveedores.CssClass &= " select2me" - Case "22" - If DdlClientes.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlClientes.SelectedValue - DdlClientes.Items.Clear() : DdlClientes.Items.Add(New ListItem("Seleccione", "0")) - DdlClientes.DataSource = DtCuentasContables : DdlClientes.DataBind() : DdlClientes.SelectedValue = Seleccionado - DdlClientes.AutoPostBack = False : DdlClientes.Attributes.Remove("onclick") : DdlClientes.CssClass &= " select2me" - Case "23" - If DdlInventario.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlInventario.SelectedValue - DdlInventario.Items.Clear() : DdlInventario.Items.Add(New ListItem("Seleccione", "0")) - DdlInventario.DataSource = DtCuentasContables : DdlInventario.DataBind() : DdlInventario.SelectedValue = Seleccionado - DdlInventario.AutoPostBack = False : DdlInventario.Attributes.Remove("onclick") : DdlInventario.CssClass &= " select2me" - Case "24" - If DdlGasto.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlGasto.SelectedValue - DdlGasto.Items.Clear() : DdlGasto.Items.Add(New ListItem("Seleccione", "0")) - DdlGasto.DataSource = DtCuentasContables : DdlGasto.DataBind() : DdlGasto.SelectedValue = Seleccionado - DdlGasto.AutoPostBack = False : DdlGasto.Attributes.Remove("onclick") : DdlGasto.CssClass &= " select2me" - Case "25" - If DdlBancos.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlBancos.SelectedValue - DdlBancos.Items.Clear() : DdlBancos.Items.Add(New ListItem("Seleccione", "0")) - DdlBancos.DataSource = DtCuentasContables : DdlBancos.DataBind() : DdlBancos.SelectedValue = Seleccionado - DdlBancos.AutoPostBack = False : DdlBancos.Attributes.Remove("onclick") : DdlBancos.CssClass &= " select2me" - Case "26" - If DdlDeudores.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlDeudores.SelectedValue - DdlDeudores.Items.Clear() : DdlDeudores.Items.Add(New ListItem("Seleccione", "0")) - DdlDeudores.DataSource = DtCuentasContables : DdlDeudores.DataBind() : DdlDeudores.SelectedValue = Seleccionado - DdlDeudores.AutoPostBack = False : DdlDeudores.Attributes.Remove("onclick") : DdlDeudores.CssClass &= " select2me" - Case "27" - If DdlAcreedores.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlAcreedores.SelectedValue - DdlAcreedores.Items.Clear() : DdlAcreedores.Items.Add(New ListItem("Seleccione", "0")) - DdlAcreedores.DataSource = DtCuentasContables : DdlAcreedores.DataBind() : DdlAcreedores.SelectedValue = Seleccionado - DdlAcreedores.AutoPostBack = False : DdlAcreedores.Attributes.Remove("onclick") : DdlAcreedores.CssClass &= " select2me" - Case "28" - If DdlDocxPagar.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlDocxPagar.SelectedValue - DdlDocxPagar.Items.Clear() : DdlDocxPagar.Items.Add(New ListItem("Seleccione", "0")) - DdlDocxPagar.DataSource = DtCuentasContables : DdlDocxPagar.DataBind() : DdlDocxPagar.SelectedValue = Seleccionado - DdlDocxPagar.AutoPostBack = False : DdlDocxPagar.Attributes.Remove("onclick") : DdlDocxPagar.CssClass &= " select2me" - Case "29" - If DdlAnticipoCliente.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlAnticipoCliente.SelectedValue - DdlAnticipoCliente.Items.Clear() : DdlAnticipoCliente.Items.Add(New ListItem("Seleccione", "0")) - DdlAnticipoCliente.DataSource = DtCuentasContables : DdlAnticipoCliente.DataBind() : DdlAnticipoCliente.SelectedValue = Seleccionado - DdlAnticipoCliente.AutoPostBack = False : DdlAnticipoCliente.Attributes.Remove("onclick") : DdlAnticipoCliente.CssClass &= " select2me" - Case "30" - If DdlAnticipoProveedores.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlAnticipoProveedores.SelectedValue - DdlAnticipoProveedores.Items.Clear() : DdlAnticipoProveedores.Items.Add(New ListItem("Seleccione", "0")) - DdlAnticipoProveedores.DataSource = DtCuentasContables : DdlAnticipoProveedores.DataBind() : DdlAnticipoProveedores.SelectedValue = Seleccionado - DdlAnticipoProveedores.AutoPostBack = False : DdlAnticipoProveedores.Attributes.Remove("onclick") : DdlAnticipoProveedores.CssClass &= " select2me" - Case "31" - If DdlCaja.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlCaja.SelectedValue - DdlCaja.Items.Clear() : DdlCaja.Items.Add(New ListItem("Seleccione", "0")) - DdlCaja.DataSource = DtCuentasContables : DdlCaja.DataBind() : DdlCaja.SelectedValue = Seleccionado - DdlCaja.AutoPostBack = False : DdlCaja.Attributes.Remove("onclick") : DdlCaja.CssClass &= " select2me" - Case "32" - If DdlFyE.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlFyE.SelectedValue - DdlFyE.Items.Clear() : DdlFyE.Items.Add(New ListItem("Seleccione", "0")) - DdlFyE.DataSource = DtCuentasContables : DdlFyE.DataBind() : DdlFyE.SelectedValue = Seleccionado - DdlFyE.AutoPostBack = False : DdlFyE.Attributes.Remove("onclick") : DdlFyE.CssClass &= " select2me" - Case "33" - If DdlActivoFijo.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlActivoFijo.SelectedValue - DdlActivoFijo.Items.Clear() : DdlActivoFijo.Items.Add(New ListItem("Seleccione", "0")) - DdlActivoFijo.DataSource = DtCuentasContables : DdlActivoFijo.DataBind() : DdlActivoFijo.SelectedValue = Seleccionado - DdlActivoFijo.AutoPostBack = False : DdlActivoFijo.Attributes.Remove("onclick") : DdlActivoFijo.CssClass &= " select2me" - Case "34" - If DdlDSV.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlDSV.SelectedValue - DdlDSV.Items.Clear() : DdlDSV.Items.Add(New ListItem("Seleccione", "0")) - DdlDSV.DataSource = DtCuentasContables : DdlDSV.DataBind() : DdlDSV.SelectedValue = Seleccionado - DdlDSV.AutoPostBack = False : DdlDSV.Attributes.Remove("onclick") : DdlDSV.CssClass &= " select2me" - Case "35" - If DdlImpuestosLocales.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlImpuestosLocales.SelectedValue - DdlImpuestosLocales.Items.Clear() : DdlImpuestosLocales.Items.Add(New ListItem("Seleccione", "0")) - DdlImpuestosLocales.DataSource = DtCuentasContables : DdlImpuestosLocales.DataBind() : DdlImpuestosLocales.SelectedValue = Seleccionado - DdlImpuestosLocales.AutoPostBack = False : DdlImpuestosLocales.Attributes.Remove("onclick") : DdlImpuestosLocales.CssClass &= " select2me" - - - 'IEPS - Case "36" - If DdlIEPSxAcreditar.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlIEPSxAcreditar.SelectedValue - DdlIEPSxAcreditar.Items.Clear() : DdlIEPSxAcreditar.Items.Add(New ListItem("Seleccione", "0")) - DdlIEPSxAcreditar.DataSource = DtCuentasContables : DdlIEPSxAcreditar.DataBind() : DdlIEPSxAcreditar.SelectedValue = Seleccionado - DdlIEPSxAcreditar.AutoPostBack = False : DdlIEPSxAcreditar.Attributes.Remove("onclick") : DdlIEPSxAcreditar.CssClass &= " select2me" - - Case "37" - If DdlIEPSAcreditable.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlIEPSAcreditable.SelectedValue - DdlIEPSAcreditable.Items.Clear() : DdlIEPSAcreditable.Items.Add(New ListItem("Seleccione", "0")) - DdlIEPSAcreditable.DataSource = DtCuentasContables : DdlIEPSAcreditable.DataBind() : DdlIEPSAcreditable.SelectedValue = Seleccionado - DdlIEPSAcreditable.AutoPostBack = False : DdlIEPSAcreditable.Attributes.Remove("onclick") : DdlIEPSAcreditable.CssClass &= " select2me" - Case "38" - If DdlIEPSxTrasladar.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlIEPSxTrasladar.SelectedValue - DdlIEPSxTrasladar.Items.Clear() : DdlIEPSxTrasladar.Items.Add(New ListItem("Seleccione", "0")) - DdlIEPSxTrasladar.DataSource = DtCuentasContables : DdlIEPSxTrasladar.DataBind() : DdlIEPSxTrasladar.SelectedValue = Seleccionado - DdlIEPSxTrasladar.AutoPostBack = False : DdlIEPSxTrasladar.Attributes.Remove("onclick") : DdlIEPSxTrasladar.CssClass &= " select2me" - Case "39" - If DdlIEPSTrasladado.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlIEPSTrasladado.SelectedValue - DdlIEPSTrasladado.Items.Clear() : DdlIEPSTrasladado.Items.Add(New ListItem("Seleccione", "0")) - DdlIEPSTrasladado.DataSource = DtCuentasContables : DdlIEPSTrasladado.DataBind() : DdlIEPSTrasladado.SelectedValue = Seleccionado - DdlIEPSTrasladado.AutoPostBack = False : DdlIEPSTrasladado.Attributes.Remove("onclick") : DdlIEPSTrasladado.CssClass &= " select2me" - Case "40" - If DdlCuentaDescuentoVenta.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlCuentaDescuentoVenta.SelectedValue - DdlCuentaDescuentoVenta.Items.Clear() : DdlCuentaDescuentoVenta.Items.Add(New ListItem("Seleccione", "0")) - DdlCuentaDescuentoVenta.DataSource = DtCuentasContables : DdlCuentaDescuentoVenta.DataBind() : DdlCuentaDescuentoVenta.SelectedValue = Seleccionado - DdlCuentaDescuentoVenta.AutoPostBack = False : DdlCuentaDescuentoVenta.Attributes.Remove("onclick") : DdlCuentaDescuentoVenta.CssClass &= " select2me" - Case "41" - If DdlCuentaOtrosIngresos.Attributes("onclick") <> "" Then CargaCuentasContables() - Seleccionado = DdlCuentaOtrosIngresos.SelectedValue - DdlCuentaOtrosIngresos.Items.Clear() : DdlCuentaOtrosIngresos.Items.Add(New ListItem("Seleccione", "0")) - DdlCuentaOtrosIngresos.DataSource = DtCuentasContables : DdlCuentaOtrosIngresos.DataBind() : DdlCuentaOtrosIngresos.SelectedValue = Seleccionado - DdlCuentaOtrosIngresos.AutoPostBack = False : DdlCuentaOtrosIngresos.Attributes.Remove("onclick") : DdlCuentaOtrosIngresos.CssClass &= " select2me" - - - ' 'PADRES SIG - 'Case "42" - ' If DdlProveedoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlProveedoresSIG.SelectedValue - ' DdlProveedoresSIG.Items.Clear() : DdlProveedoresSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlProveedoresSIG.DataSource = DtCuentasContablesSIG : DdlProveedoresSIG.DataBind() : DdlProveedoresSIG.SelectedValue = Seleccionado - ' DdlProveedoresSIG.AutoPostBack = False : DdlProveedoresSIG.Attributes.Remove("onclick") : DdlProveedoresSIG.CssClass &= " select2me" - 'Case "43" - ' If DdlClientesSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlClientesSIG.SelectedValue - ' DdlClientesSIG.Items.Clear() : DdlClientesSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlClientesSIG.DataSource = DtCuentasContablesSIG : DdlClientesSIG.DataBind() : DdlClientesSIG.SelectedValue = Seleccionado - ' DdlClientesSIG.AutoPostBack = False : DdlClientesSIG.Attributes.Remove("onclick") : DdlClientesSIG.CssClass &= " select2me" - 'Case "44" - ' If DdlInventarioSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlInventarioSIG.SelectedValue - ' DdlInventarioSIG.Items.Clear() : DdlInventarioSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlInventarioSIG.DataSource = DtCuentasContablesSIG : DdlInventarioSIG.DataBind() : DdlInventarioSIG.SelectedValue = Seleccionado - ' DdlInventarioSIG.AutoPostBack = False : DdlInventarioSIG.Attributes.Remove("onclick") : DdlInventarioSIG.CssClass &= " select2me" - 'Case "45" - ' If DdlGastoSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlGasto.SelectedValue - ' DdlGastoSIG.Items.Clear() : DdlGastoSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlGastoSIG.DataSource = DtCuentasContablesSIG : DdlGastoSIG.DataBind() : DdlGastoSIG.SelectedValue = Seleccionado - ' DdlGastoSIG.AutoPostBack = False : DdlGastoSIG.Attributes.Remove("onclick") : DdlGastoSIG.CssClass &= " select2me" - 'Case "46" - ' If DdlBancosSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlBancosSIG.SelectedValue - ' DdlBancosSIG.Items.Clear() : DdlBancosSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlBancosSIG.DataSource = DtCuentasContablesSIG : DdlBancosSIG.DataBind() : DdlBancosSIG.SelectedValue = Seleccionado - ' DdlBancosSIG.AutoPostBack = False : DdlBancosSIG.Attributes.Remove("onclick") : DdlBancosSIG.CssClass &= " select2me" - 'Case "47" - ' If DdlDeudoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlDeudoresSIG.SelectedValue - ' DdlDeudoresSIG.Items.Clear() : DdlDeudoresSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlDeudoresSIG.DataSource = DtCuentasContablesSIG : DdlDeudoresSIG.DataBind() : DdlDeudoresSIG.SelectedValue = Seleccionado - ' DdlDeudoresSIG.AutoPostBack = False : DdlDeudoresSIG.Attributes.Remove("onclick") : DdlDeudoresSIG.CssClass &= " select2me" - 'Case "48" - ' If DdlAcreedoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlAcreedoresSIG.SelectedValue - ' DdlAcreedoresSIG.Items.Clear() : DdlAcreedoresSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlAcreedoresSIG.DataSource = DtCuentasContablesSIG : DdlAcreedoresSIG.DataBind() : DdlAcreedoresSIG.SelectedValue = Seleccionado - ' DdlAcreedoresSIG.AutoPostBack = False : DdlAcreedoresSIG.Attributes.Remove("onclick") : DdlAcreedoresSIG.CssClass &= " select2me" - 'Case "49" - ' If DdlDocxPagarSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlDocxPagarSIG.SelectedValue - ' DdlDocxPagarSIG.Items.Clear() : DdlDocxPagarSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlDocxPagarSIG.DataSource = DtCuentasContablesSIG : DdlDocxPagarSIG.DataBind() : DdlDocxPagarSIG.SelectedValue = Seleccionado - ' DdlDocxPagarSIG.AutoPostBack = False : DdlDocxPagarSIG.Attributes.Remove("onclick") : DdlDocxPagarSIG.CssClass &= " select2me" - 'Case "50" - ' If DdlAnticipoClienteSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlAnticipoClienteSIG.SelectedValue - ' DdlAnticipoClienteSIG.Items.Clear() : DdlAnticipoClienteSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlAnticipoClienteSIG.DataSource = DtCuentasContablesSIG : DdlAnticipoClienteSIG.DataBind() : DdlAnticipoClienteSIG.SelectedValue = Seleccionado - ' DdlAnticipoClienteSIG.AutoPostBack = False : DdlAnticipoClienteSIG.Attributes.Remove("onclick") : DdlAnticipoClienteSIG.CssClass &= " select2me" - 'Case "51" - ' If DdlAnticipoProveedoresSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlAnticipoProveedoresSIG.SelectedValue - ' DdlAnticipoProveedoresSIG.Items.Clear() : DdlAnticipoProveedoresSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlAnticipoProveedoresSIG.DataSource = DtCuentasContablesSIG : DdlAnticipoProveedoresSIG.DataBind() : DdlAnticipoProveedoresSIG.SelectedValue = Seleccionado - ' DdlAnticipoProveedoresSIG.AutoPostBack = False : DdlAnticipoProveedoresSIG.Attributes.Remove("onclick") : DdlAnticipoProveedoresSIG.CssClass &= " select2me" - 'Case "52" - ' If DdlCajaSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlCajaSIG.SelectedValue - ' DdlCajaSIG.Items.Clear() : DdlCajaSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlCajaSIG.DataSource = DtCuentasContablesSIG : DdlCajaSIG.DataBind() : DdlCajaSIG.SelectedValue = Seleccionado - ' DdlCajaSIG.AutoPostBack = False : DdlCajaSIG.Attributes.Remove("onclick") : DdlCajaSIG.CssClass &= " select2me" - 'Case "53" - ' If DdlFyESIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlFyESIG.SelectedValue - ' DdlFyESIG.Items.Clear() : DdlFyESIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlFyESIG.DataSource = DtCuentasContablesSIG : DdlFyESIG.DataBind() : DdlFyESIG.SelectedValue = Seleccionado - ' DdlFyESIG.AutoPostBack = False : DdlFyESIG.Attributes.Remove("onclick") : DdlFyESIG.CssClass &= " select2me" - 'Case "54" - ' If DdlActivoFijoSIG.Attributes("onclick") <> "" Then CargaCuentasContablesSIG() - ' Seleccionado = DdlActivoFijoSIG.SelectedValue - ' DdlActivoFijoSIG.Items.Clear() : DdlActivoFijoSIG.Items.Add(New ListItem("Seleccione", "0")) - ' DdlActivoFijoSIG.DataSource = DtCuentasContablesSIG : DdlActivoFijoSIG.DataBind() : DdlActivoFijoSIG.SelectedValue = Seleccionado - ' DdlActivoFijoSIG.AutoPostBack = False : DdlActivoFijoSIG.Attributes.Remove("onclick") : DdlActivoFijoSIG.CssClass &= " select2me" - - - End Select - - End Sub - Public Sub CargaDDLs() - DdlIVAxAcreditar.AutoPostBack = True - DdlIVAAcreditable.AutoPostBack = True - DdlIVAxTrasladar.AutoPostBack = True - DdlIVATrasladado.AutoPostBack = True - DdlIVARetenciones.AutoPostBack = True - DdlISRCirculacion.AutoPostBack = True - DdlProveedores.AutoPostBack = True - DdlClientes.AutoPostBack = True - DdlInventario.AutoPostBack = True - DdlGasto.AutoPostBack = True - DdlBancos.AutoPostBack = True - DdlDeudores.AutoPostBack = True - DdlAcreedores.AutoPostBack = True - DdlDocxPagar.AutoPostBack = True - DdlAnticipoCliente.AutoPostBack = True - DdlAnticipoProveedores.AutoPostBack = True - DdlCaja.AutoPostBack = True - DdlFyE.AutoPostBack = True - DddlCuentaGananciaCambiaria.AutoPostBack = True - DdlCuentaPerdidaCambiaria.AutoPostBack = True - DdlActivoFijo.AutoPostBack = True - DdlIEPSxAcreditar.AutoPostBack = True - DdlIEPSAcreditable.AutoPostBack = True - DdlIEPSxTrasladar.AutoPostBack = True - DdlIEPSTrasladado.AutoPostBack = True - DdlCuentaDescuentoVenta.AutoPostBack = True - DdlCuentaOtrosIngresos.AutoPostBack = True - - ''CUENTAS PADRES SIG - 'DdlProveedoresSIG.AutoPostBack = True - 'DdlClientesSIG.AutoPostBack = True - 'DdlInventarioSIG.AutoPostBack = True - 'DdlGastoSIG.AutoPostBack = True - 'DdlBancosSIG.AutoPostBack = True - 'DdlDeudoresSIG.AutoPostBack = True - 'DdlAcreedoresSIG.AutoPostBack = True - 'DdlDocxPagarSIG.AutoPostBack = True - 'DdlAnticipoClienteSIG.AutoPostBack = True - 'DdlAnticipoProveedoresSIG.AutoPostBack = True - 'DdlCajaSIG.AutoPostBack = True - 'DdlFyESIG.AutoPostBack = True - 'DdlActivoFijoSIG.AutoPostBack = True - - - DdlIVAxAcreditar.Attributes.Add("onclick", "CargaCuentas(1);") - DdlIVAAcreditable.Attributes.Add("onclick", "CargaCuentas(2);") - DdlIVAxTrasladar.Attributes.Add("onclick", "CargaCuentas(3);") - DdlIVATrasladado.Attributes.Add("onclick", "CargaCuentas(4);") - DdlIVARetenciones.Attributes.Add("onclick", "CargaCuentas(5);") - DdlISRCirculacion.Attributes.Add("onclick", "CargaCuentas(6);") - DdlProveedores.Attributes.Add("onclick", "CargaCuentas(7);") - DdlClientes.Attributes.Add("onclick", "CargaCuentas(8);") - DdlInventario.Attributes.Add("onclick", "CargaCuentas(9);") - DdlGasto.Attributes.Add("onclick", "CargaCuentas(10);") - DdlBancos.Attributes.Add("onclick", "CargaCuentas(11);") - DdlDeudores.Attributes.Add("onclick", "CargaCuentas(12);") - DdlAcreedores.Attributes.Add("onclick", "CargaCuentas(13);") - DdlDocxPagar.Attributes.Add("onclick", "CargaCuentas(14);") - DdlAnticipoCliente.Attributes.Add("onclick", "CargaCuentas(15);") - DdlAnticipoProveedores.Attributes.Add("onclick", "CargaCuentas(16);") - DdlCaja.Attributes.Add("onclick", "CargaCuentas(17);") - DdlFyE.Attributes.Add("onclick", "CargaCuentas(18);") - DddlCuentaGananciaCambiaria.Attributes.Add("onclick", "CargaCuentas(19);") - DdlCuentaPerdidaCambiaria.Attributes.Add("onclick", "CargaCuentas(20);") - DdlActivoFijo.Attributes.Add("onclick", "CargaCuentas(33);") - DdlDSV.Attributes.Add("onclick", "CargaCuentas(34);") - DdlImpuestosLocales.Attributes.Add("onclick", "CargaCuentas(35);") - DdlIEPSxAcreditar.Attributes.Add("onclick", "CargaCuentas(36);") - DdlIEPSAcreditable.Attributes.Add("onclick", "CargaCuentas(37);") - DdlIEPSxTrasladar.Attributes.Add("onclick", "CargaCuentas(38);") - DdlIEPSTrasladado.Attributes.Add("onclick", "CargaCuentas(39);") - DdlCuentaDescuentoVenta.Attributes.Add("onclick", "CargaCuentas(40);") - DdlCuentaOtrosIngresos.Attributes.Add("onclick", "CargaCuentas(41);") - - ''CUENTAS PADRES - 'DdlProveedoresSIG.Attributes.Add("onclick", "CargaCuentas(42);") - 'DdlClientesSIG.Attributes.Add("onclick", "CargaCuentas(43);") - 'DdlInventarioSIG.Attributes.Add("onclick", "CargaCuentas(44);") - 'DdlGastoSIG.Attributes.Add("onclick", "CargaCuentas(45);") - 'DdlBancosSIG.Attributes.Add("onclick", "CargaCuentas(46);") - 'DdlDeudoresSIG.Attributes.Add("onclick", "CargaCuentas(47);") - 'DdlAcreedoresSIG.Attributes.Add("onclick", "CargaCuentas(48);") - 'DdlDocxPagarSIG.Attributes.Add("onclick", "CargaCuentas(49);") - 'DdlAnticipoClienteSIG.Attributes.Add("onclick", "CargaCuentas(50);") - 'DdlAnticipoProveedoresSIG.Attributes.Add("onclick", "CargaCuentas(51);") - 'DdlCajaSIG.Attributes.Add("onclick", "CargaCuentas(52);") - 'DdlFyESIG.Attributes.Add("onclick", "CargaCuentas(53);") - 'DdlActivoFijoSIG.Attributes.Add("onclick", "CargaCuentas(54);") - - UpDatos.Update() - - End Sub - Public Sub CargaFuncionalidad(CveFuncionalidad As Integer, ByRef Ddl As DropDownList) - Dim Dr As DataRow = DtFuncionalidades.FiltroPrimero($"CveFuncionalidad = {CveFuncionalidad}") - If Dr IsNot Nothing Then - Dim DrC As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id = {0} ", Dr("Valor").ToString)) - If Not IsNothing(DrC) Then - Ddl.Items.Add(New ListItem(DrC("CtaCodigo").ToString, Dr("Valor").ToString)) - End If - Ddl.SelectedValue = Dr("Valor").ToString - End If - - - End Sub - Private Sub CargaDdlPac() - Dim Objeto As New ClsSisEmpresas - If Objeto.GetPacs() Then - DdlCvePac.DataSource = Objeto.DtResultados - DdlCvePac.DataBind() - DdlCvePac.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - Objeto.Dispose() - End Sub - Private Sub CargaRegimenFiscal() - Dim ObjSis As New ClsSisEmpresas - If ObjSis.GetRegimenFiscal(-1) Then - DdlRegimen.DataSource = ObjSis.DtResultados - DdlRegimen.DataBind() - DdlRegimen.Items.Insert(0, New ListItem("Seleccione", "-1")) - End If - ObjSis.Dispose() - End Sub - -#Region "CONFIGURACION EMPRESA" - Private Sub ConfiguracionEmpresa() - If UsuarioActual.CveRol <> 1 Then - TabSistema.Visible = False - BtnCancelar.Visible = False - BtnEliminar.Visible = False - BiInform.Visible = False - End If - If TipoContabilidad = 2 Then - TabContabilidad.Visible = True - End If - End Sub -#End Region - -#Region "TAB - INDICADORES " - Public Sub CargaGridIndicadores() - Dim Objeto As New ClsIndicadores - If Objeto.GetEmpresasIndicadores(UsuarioActual.CveEmpresa) Then - GvIndicadores.DataSource = Objeto.DtResultados - End If - GvIndicadores.DataBind() - Objeto.Dispose() - End Sub - - Private Sub GvIndicadores_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvIndicadores.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CveEmpresa") <> "" Then - e.Row.FCCheckBox("chkIndicador").Checked = True - End If - End If - End Sub - - - -#End Region - -#Region "P L A N T I L L A C O R R E O" - - Private Sub BtnGuardarPlantilla_Click(sender As Object, e As EventArgs) Handles BtnGuardarPlantilla.Click - If UsuarioActual.Empresa.PlantillaMailVenta.Length > 0 Then - - End If - Dim ObjEmpresa As New ClsSisEmpresas() - If ObjEmpresa.UpdatePlantillaMail("AsuntoPlantillaMailVenta", TxtAsunto.Text.Trim, "PlantillaMailVenta", TxtPlantillaVenta.Text.Trim, CveEmpresa) Then - - If ObjEmpresa.UpdatePlantillaMail("AsuntoPlantillaMailVentaCotizacion", TxtAsuntoCotizacion.Text.Trim, "PlantillaMailVentaCotizacion", TxtPlantillaCotizacion.Text.Trim, CveEmpresa) Then - - End If - Alert("La plantilla de mail de ventas se guardó correctamente.", TipoMensaje.MsgInformacion) - - UsuarioActual.Empresa.PlantillaMailVenta = TxtPlantillaVenta.Text.Trim - UsuarioActual.Empresa.AsuntoPlantillaMailVenta = TxtAsunto.Text.Trim - - UsuarioActual.Empresa.AsuntoPlantillaMailVentaCotizacion = TxtPlantillaCotizacion.Text.Trim - UsuarioActual.Empresa.PlantillaMailVentaCotizacion = TxtAsuntoCotizacion.Text.Trim - - 'TxtPlantillaVenta.Text = "" - 'TxtAsunto.Text = "" - End If - ObjEmpresa.Dispose() - Alert(TxtPlantillaVenta.Text.Trim, TipoMensaje.MsgInformacion) - End Sub - - -#End Region - -#Region "TAB CONTABILIDAD - CLASIFICACION DE IVA" - Private Sub ActualizaNombresCuentas() - - 'If Not DtClasificacionIVA.Columns.Contains("CuentaXAcreditar") Then - ' DtClasificacionIVA.Columns.Add("CuentaXAcreditar", GetType(Integer)) - 'End If - 'If Not DtClasificacionIVA.Columns.Contains("CuentaAcreditable") Then - ' DtClasificacionIVA.Columns.Add("CuentaAcreditable", GetType(Integer)) - 'End If - 'If Not DtClasificacionIVA.Columns.Contains("CuentaXTrasladar") Then - ' DtClasificacionIVA.Columns.Add("CuentaXTrasladar", GetType(Integer)) - 'End If - 'If Not DtClasificacionIVA.Columns.Contains("CuentaTrasladado") Then - ' DtClasificacionIVA.Columns.Add("CuentaTrasladado", GetType(Integer)) - 'End If - - For Each Dr As DataRow In DtClasificacionIVA.Rows - If Dr("IdCtaIVAXAcreditar").ToString.ToEntero > 0 Then - 'Dr("CuentaXAcreditar") = DtCuentas.FiltraParametros($"Id = {Dr("IdCtaIVAXAcreditar").ToString}").Rows(0)("CtaCodigo").ToString - Dr("CuentaXAcreditar") = DtCuentas.FiltroPrimeroValor("CtaCodigo", $"Id = {Dr("IdCtaIVAXAcreditar").ToString}").ToString.ToEntero - End If - If Dr("IdCtaIVAAcreditable").ToString.ToEntero > 0 Then - 'Dr("CuentaAcreditable") = DtCuentas.FiltraParametros($"Id = {Dr("IdCtaIVAAcreditable").ToString}").Rows(0)("CtaCodigo").ToString - Dr("CuentaAcreditable") = DtCuentas.FiltroPrimeroValor("CtaCodigo", $"Id = {Dr("IdCtaIVAAcreditable").ToString}").ToString.ToEntero - End If - If Dr("IdCtaIVAXTrasladar").ToString.ToEntero > 0 Then - 'Dr("CuentaXTrasladar") = DtCuentas.FiltraParametros($"Id = {Dr("IdCtaIVAXTrasladar").ToString}").Rows(0)("CtaCodigo").ToString - Dr("CuentaXTrasladar") = DtCuentas.FiltroPrimeroValor("CtaCodigo", $"Id = {Dr("IdCtaIVAXTrasladar").ToString}").ToString.ToEntero - End If - If Dr("IdCtaIVATrasladado").ToString.ToEntero > 0 Then - 'Dr("CuentaTrasladado") = DtCuentas.FiltraParametros($"Id = {Dr("IdCtaIVATrasladado").ToString}").Rows(0)("CtaCodigo").ToString - Dr("CuentaTrasladado") = DtCuentas.FiltroPrimeroValor("CtaCodigo", $"Id = {Dr("IdCtaIVATrasladado").ToString}").ToString.ToEntero - End If - Next - DtClasificacionIVA.AcceptChanges() - End Sub - Private Sub InicializaClasificacionIVA(ObjEmpresas As ClsSisEmpresas) - CreaDtClasificacionIVA() - CargaCuentasIVA(ObjEmpresas) - CargaClasificaciones() - CargaClasificacionesIVA() - End Sub - Private Sub CargaClasificacionesIVA() - Dim ObjGral As New ClsGenerales - If ObjGral.GetClasificacionPorcentaje(CveEmpresa, Opcion:=2) Then - DtClasificacionIVA = ObjGral.DtResultados.Copy - ActualizaNombresCuentas() - GvClasificacionIVA.DataSource = DtClasificacionIVA - End If - ObjGral.Dispose() - GvClasificacionIVA.DataBind() - UpClasificacionIVA.Update() - End Sub - Private Sub CargaClasificaciones() - DdlClasificacion.DataSource = GlobalDTClasificaciones(CveEmpresa) - DdlClasificacion.DataBind() - DdlClasificacion.Items.Insert(0, New ListItem("-", "-1")) - End Sub - Private Sub CreaDtClasificacionIVA() - DtClasificacionIVA = New DataTable - DtClasificacionIVA.Columns.Add("CveClasificacionPorcentaje", GetType(Integer)) - DtClasificacionIVA.Columns.Add("CveClasificacion", GetType(Integer)) - DtClasificacionIVA.Columns.Add("Clasificacion", GetType(String)) - DtClasificacionIVA.Columns.Add("PorcentajeIVA", GetType(Double)) - DtClasificacionIVA.Columns.Add("CuentaXAcreditar", GetType(String)) - DtClasificacionIVA.Columns.Add("IdCtaIVAXAcreditar", GetType(Integer)) - DtClasificacionIVA.Columns.Add("CuentaAcreditable", GetType(String)) - DtClasificacionIVA.Columns.Add("IdCtaIVAAcreditable", GetType(Integer)) - DtClasificacionIVA.Columns.Add("CuentaXTrasladar", GetType(String)) - DtClasificacionIVA.Columns.Add("IdCtaIVAXTrasladar", GetType(Integer)) - DtClasificacionIVA.Columns.Add("CuentaTrasladado", GetType(String)) - DtClasificacionIVA.Columns.Add("IdCtaIVATrasladado", GetType(Integer)) - End Sub - Private Sub CargaCuentasIVA(ByRef ObjEmpresas As ClsSisEmpresas) - - If ObjEmpresas.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then - If ObjEmpresas.Empresa.UsaContabilidad And ObjEmpresas.Empresa.TipoContabilidad = 2 Then - - 'If ObjEmpresas.Empresa.TipoContabilidad = 2 Then - Dim Cuenta As New ClsContPAQi(ObjEmpresas.Empresa) - If Cuenta.GetCuentas(-1, "-1", -1) Then - DtCuentas = Cuenta.DtResultados - End If - Cuenta.Dispose() - 'End If - - Try - DdlIVAXAcreditarModal.DataSource = DtCuentas : DdlIVAXAcreditarModal.DataBind() - Catch ex As Exception - End Try - Try - DdlIVAAcreditableModal.DataSource = DtCuentas : DdlIVAAcreditableModal.DataBind() - Catch ex As Exception - End Try - Try - DdlIVAXTrasladarModal.DataSource = DtCuentas : DdlIVAXTrasladarModal.DataBind() - Catch ex As Exception - End Try - Try - DdlIVATrasladadoModal.DataSource = DtCuentas : DdlIVATrasladadoModal.DataBind() - Catch ex As Exception - End Try - End If - - - End If - - 'ObjEmpresas.Dispose() - DdlIVAXAcreditarModal.Items.Insert(0, New ListItem("-", "-1")) - DdlIVAAcreditableModal.Items.Insert(0, New ListItem("-", "-1")) - DdlIVAXTrasladarModal.Items.Insert(0, New ListItem("-", "-1")) - DdlIVATrasladadoModal.Items.Insert(0, New ListItem("-", "-1")) - End Sub - Protected Sub LnkEliminarClasificacionIVA_Click(sender As Object, e As EventArgs) - Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) - If DtClasificacionIVA.Rows(gvRow.RowIndex)("CveClasificacionPorcentaje").ToString.ToEntero = 0 Then - DtClasificacionIVA.Rows(gvRow.RowIndex).Delete() - Else - DtClasificacionIVA.Rows(gvRow.RowIndex)("CveClasificacion") = -1 - End If - DtClasificacionIVA.AcceptChanges() - GvClasificacionIVA.DataSource = DtClasificacionIVA - GvClasificacionIVA.DataBind() - UpClasificacionIVA.Update() - End Sub - Protected Sub LnkAgregarClasificacionIVA_Click(sender As Object, e As EventArgs) - LimpiaClasificacionIVA() - Modalidad = "A" - RegistraScript("$('#DModalClasificacionIVA').modal()") UpModalClasificacionIVA.Update() - End Sub - Protected Sub LnkEditarClasificacionIVA_Click(sender As Object, e As EventArgs) - LimpiaClasificacionIVA() Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) - Modalidad = "U" - Index = gvRow.RowIndex - CveClasificacionPorcentaje = gvRow.DataKey("CveClasificacionPorcentaje").ToEntero() DdlClasificacion.SelectedValueExist(gvRow.DataKey("CveClasificacion")) TxtPorcentajeIVA.Text = gvRow.DataKey("PorcentajeIVA") DdlIVAXAcreditarModal.SelectedValueExist(gvRow.DataKey("IdCtaIVAXAcreditar")) DdlIVAAcreditableModal.SelectedValueExist(gvRow.DataKey("IdCtaIVAAcreditable")) DdlIVAXTrasladarModal.SelectedValueExist(gvRow.DataKey("IdCtaIVAXTrasladar")) DdlIVATrasladadoModal.SelectedValueExist(gvRow.DataKey("IdCtaIVATrasladado")) RegistraScript("$('#DModalClasificacionIVA').modal()") UpModalClasificacionIVA.Update() - End Sub - - Private Sub LimpiaClasificacionIVA() - TxtPorcentajeIVA.Text = "" - DdlClasificacion.SelectedIndex = 0 - DdlIVAXAcreditarModal.SelectedIndex = 0 - DdlIVAAcreditableModal.SelectedIndex = 0 - DdlIVAXTrasladarModal.SelectedIndex = 0 - DdlIVATrasladadoModal.SelectedIndex = 0 - UpModalClasificacionIVA.Update() - End Sub - - Protected Sub BtnClasificacionIVA_Click(sender As Object, e As EventArgs) - If Modalidad = "A" Then - Dim Row As DataRow = DtClasificacionIVA.NewRow() - Row("CveClasificacionPorcentaje") = 0 - Row("CveClasificacion") = DdlClasificacion.SelectedValue.ToEntero - Row("Clasificacion") = DdlClasificacion.SelectedItem.Text - Row("PorcentajeIVA") = TxtPorcentajeIVA.Text.ToDouble - Row("CuentaXAcreditar") = DdlIVAXAcreditarModal.SelectedItem.Text - Row("IdCtaIVAXAcreditar") = DdlIVAXAcreditarModal.SelectedValue.ToEntero - Row("CuentaAcreditable") = DdlIVAAcreditableModal.SelectedItem.Text - Row("IdCtaIVAAcreditable") = DdlIVAAcreditableModal.SelectedValue.ToEntero - Row("CuentaXTrasladar") = DdlIVAXTrasladarModal.SelectedItem.Text - Row("IdCtaIVAXTrasladar") = DdlIVAXTrasladarModal.SelectedValue.ToEntero - Row("CuentaTrasladado") = DdlIVATrasladadoModal.SelectedItem.Text - Row("IdCtaIVATrasladado") = DdlIVATrasladadoModal.SelectedValue.ToEntero - DtClasificacionIVA.Rows.InsertAt(Row, DtClasificacionIVA.Rows.Count) - ElseIf Modalidad = "U" Then - DtClasificacionIVA.Rows(Index)("CveClasificacion") = DdlClasificacion.SelectedValue.ToEntero - DtClasificacionIVA.Rows(Index)("Clasificacion") = DdlClasificacion.SelectedItem.Text - DtClasificacionIVA.Rows(Index)("PorcentajeIVA") = TxtPorcentajeIVA.Text.ToDouble - DtClasificacionIVA.Rows(Index)("CuentaXAcreditar") = DdlIVAXAcreditarModal.SelectedItem.Text - DtClasificacionIVA.Rows(Index)("IdCtaIVAXAcreditar") = DdlIVAXAcreditarModal.SelectedValue.ToEntero - DtClasificacionIVA.Rows(Index)("CuentaAcreditable") = DdlIVAAcreditableModal.SelectedItem.Text - DtClasificacionIVA.Rows(Index)("IdCtaIVAAcreditable") = DdlIVAAcreditableModal.SelectedValue.ToEntero - DtClasificacionIVA.Rows(Index)("CuentaXTrasladar") = DdlIVAXTrasladarModal.SelectedItem.Text - DtClasificacionIVA.Rows(Index)("IdCtaIVAXTrasladar") = DdlIVAXTrasladarModal.SelectedValue.ToEntero - DtClasificacionIVA.Rows(Index)("CuentaTrasladado") = DdlIVATrasladadoModal.SelectedItem.Text - DtClasificacionIVA.Rows(Index)("IdCtaIVATrasladado") = DdlIVATrasladadoModal.SelectedValue.ToEntero - End If - DtClasificacionIVA.AcceptChanges() - ActualizaNombresCuentas() - GvClasificacionIVA.DataSource = DtClasificacionIVA - GvClasificacionIVA.DataBind() - UpClasificacionIVA.Update() - RegistraScript("$('#DModalClasificacionIVA').modal('hide')") - End Sub - - Protected Sub GvClasificacionIVA_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.DataRow Then - If Not e.Row.DBCampo("CveClasificacion").ToEntero > 0 Then - e.Row.Visible = False - End If - End If - End Sub - -#End Region - - - - - Protected Sub LnkOpenModalDatosFiel_Click(sender As Object, e As EventArgs) - TxtFielPass.Text = "" - TxtFielArchivoCER.Text = "" - TxtFielArchivoKey.Text = "" - RegistraScript("$('#ModalUpFiel').modal();") - End Sub - Protected Sub LnkUpDatosFiel_Click(sender As Object, e As EventArgs) - Dim Password As String = TxtFielPass.Text - Dim akey As String - Dim acer As String - Dim pemkey As String - Dim pemcer As String - Dim pfxname As String - Dim Archivopfx As String - Dim Archivokey As Archivo = Nothing - Dim Archivocer As Archivo = Nothing - - Dim dirbase = "" ' String.Format("{0}Empresas\{1}\Certificados\Fiel\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) - Dim dirbasepfx = "" ' String.Format("{0}Empresas\{1}\Certificados\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) - If EmpresaEditar IsNot Nothing Then - dirbase = String.Format("{0}Certificados\Fiel\", EmpresaEditar.Ruta) - dirbasepfx = String.Format("{0}Certificados\", EmpresaEditar.Ruta) - Else - dirbase = String.Format("{0}Empresas\{1}\Certificados\Fiel\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) - dirbasepfx = String.Format("{0}Empresas\{1}\Certificados\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) - End If - - If (Not Directory.Exists(dirbase)) Then - Directory.CreateDirectory(dirbase) - End If - - Dim Filesgral As List(Of Archivo) = TxtFielArchivoCER.getfiles().Archivos - If Filesgral.Count > 0 Then - Archivocer = Filesgral(0) - End If - Filesgral = TxtFielArchivoKey.getfiles().Archivos - If Filesgral.Count > 0 Then - Archivokey = Filesgral(0) - End If - If Not IsNothing(Archivokey) AndAlso Not IsNothing(Archivocer) And Password.Length > 0 Then - akey = String.Format("{0}{1}", dirbase, Archivokey.filenameO) - If File.Exists(akey) Then - File.Delete(akey) - End If - File.Copy(Archivokey.FileUrl, akey) - acer = String.Format("{0}{1}", dirbase, Archivocer.filenameO) - If File.Exists(acer) Then - File.Delete(acer) - End If - File.Copy(Archivocer.FileUrl, acer) - Archivopfx = Archivokey.filenameO.Substring(0, Archivokey.filenameO.Length - 4) - pemkey = String.Format("{0}{1}.pem", dirbase, Archivopfx) - pfxname = String.Format("{0}{1}.pfx", dirbasepfx, Archivopfx) - pemcer = String.Format("{0}{1}.pem", dirbase, Archivokey.filenameO.Substring(0, Archivocer.filenameO.Length - 4)) - - If File.Exists(pemkey) Then - File.Delete(pemkey) - End If - - If File.Exists(pfxname) Then - File.Delete(pfxname) - End If - - If File.Exists(pemcer) Then - File.Delete(pemcer) - End If - - Dim resultado As New StringBuilder - resultado.AppendLine("
PAso 1:
") - resultado.AppendLine(execCommand({"cd C:\Generar PFX\", String.Format("openssl.exe x509 -inform DER -in ""{0}"" -out ""{1}""", acer, pemcer)})) - resultado.AppendLine("
PAso 2:
") - resultado.AppendLine(execCommand({"cd C:\Generar PFX\", String.Format("openssl pkcs8 -inform DER -in ""{0}"" -passin pass:""{1}"" -out ""{2}""", akey, Password, pemkey)})) - resultado.AppendLine("
Paso 3:
") - resultado.AppendLine(execCommand({"cd C:\Generar PFX\", String.Format("openssl pkcs12 -export -out ""{0}"" -inkey ""{1}"" -in ""{2}"" -passout pass:""{3}""", pfxname, pemkey, pemcer, Password)})) - resultado.AppendLine("
") - 'Alert(resultado.ToString()) - - If File.Exists(pemkey) Then - File.Delete(pemkey) - End If - If File.Exists(pemcer) Then - File.Delete(pemcer) - End If - If File.Exists(acer) Then - File.Delete(acer) - End If - If File.Exists(akey) Then - File.Delete(akey) - End If - If File.Exists(Archivocer.FileUrl) Then - File.Delete(Archivocer.FileUrl) - End If - If File.Exists(Archivokey.FileUrl) Then - File.Delete(Archivokey.FileUrl) - End If - If Not File.Exists(pfxname) Then - Archivopfx = "" - Password = "" - End If - Dim objempresa As New ClsSisEmpresas - objempresa.UpEmpresaFiel(ViewState("CveEmpresa").ToString().ToEntero(), Password, $"{Archivopfx}.pfx") - objempresa.Dispose() - lblPassFiel.Text = Password - LblPfx.Text = $"{Archivopfx}.pfx" - Alert("La Fiel se ha actualizado") - UpmodalFiel.Update() - RegistraScript("$('#ModalUpFiel').modal('hide');") - Else - Alert("Favor de llenar todos los campos :
-Contraseña
-Archivo CER
-Archivo KEY", TipoMensaje.MsgAdvertencia) - End If - End Sub - Public Function execCommand(command As String()) As String - - Dim proceso As Diagnostics.Process = New Diagnostics.Process() - proceso.StartInfo.FileName = "cmd.exe" - proceso.StartInfo.CreateNoWindow = True - proceso.StartInfo.RedirectStandardInput = True - proceso.StartInfo.RedirectStandardOutput = True - proceso.StartInfo.UseShellExecute = False - proceso.Start() - For Each c As String In command - proceso.StandardInput.WriteLine(c) - - Next - proceso.StandardInput.Flush() - proceso.StandardInput.Close() - proceso.WaitForExit() - Return proceso.StandardOutput.ReadToEnd() - End Function - Private Sub CargaTareasProgramadas() - Dim objTP As New ClsTareasProgramadas() - ChkDescargaMasivaSat.Checked = False - If objTP.GetTareasProgramadas(ViewState("CveEmpresa").ToString.ToEntero()) AndAlso objTP.DtResultados.Rows.Count > 0 Then - ChkDescargaMasivaSat.Checked = (objTP.DtResultados.COUNT("CveTareaProgramada", "CveTareaProgramada=1") > 0) - End If - objTP.Dispose() - End Sub - Protected Sub ChkDescargaMasivaSat_CheckedChanged(sender As Object, e As EventArgs) - Dim objTP As New ClsTareasProgramadas() - If ChkDescargaMasivaSat.Checked Then - If objTP.AddTareasProgramadas(ViewState("CveEmpresa").ToString.ToEntero(), 1, DateTime.Now.ToString("yyyy/MM/dd"), "", 0, "", DateTime.Now.ToString("yyyy/MM/dd"), DateTime.Now.ToString("yyyy/MM/dd"), "", "", 0, 1) Then - Alert("La tarea programada de descarga masiva del sat a agregado satisfactoriamente") - End If - Else - If objTP.RemoveTareasProgramadas(1, ViewState("CveEmpresa").ToString().ToEntero()) Then - Alert("La tarea programada de descarga masiva del sat se ha removido satisfactoriamente") - End If - End If - - objTP.Dispose() - End Sub - Protected Sub LnkRegistrarPAC3_Click(sender As Object, e As EventArgs) - If Me.CveEmpresa > 0 Then - RegistrarPAC3() - Else - Alert("Debe registrar la empresa para poder registrarla en el PAC", TipoMensaje.MsgAdvertencia) - End If - - End Sub - Private Sub RegistrarPAC3() - Try - - Dim Credenciales As String = "vSGxMFWnNRy/nDoowxqrqw==|Sia123654" - Dim ArchivoLLave As String = String.Format("{0}\Certificados\{1}", EmpresaEditar.Ruta, EmpresaEditar.ArchivoKey) - Dim ArchivoCertificado As String = String.Format("{0}\Certificados\{1}", EmpresaEditar.Ruta, EmpresaEditar.ArchivoCer) - - Dim llaveByte = System.IO.File.ReadAllBytes(ArchivoLLave) - Dim certByte = System.IO.File.ReadAllBytes(ArchivoCertificado) - - Dim RFCEmisor = TxtRFC.Text.Trim() - Dim contrasena = TxtContraseñaKey.Text.Trim() - - Dim conector As New Profact.TimbraCFDI33.Conector(EmpresaEditar.FacturaProduccion) - - If Not EmpresaEditar.FacturaProduccion OrElse EmpresaEditar.CveEmpresa = 1 Then - conector.EstableceCredenciales("mvpNUXmQfK8=") - Else - conector.EstableceCredenciales(Credenciales) - End If - - Dim result = conector.RegistraEmisor(RFCEmisor, certByte, llaveByte, contrasena) - - If result.Exitoso Then - Alert("El emisor se registró correctamente.
" & result.Descripcion) - Else - Alert("Ocurrió un error al registrar el emisor.
" & result.Descripcion & ".
Numero Error: " & result.NumeroError, TipoMensaje.MsgError) - End If - - Catch ex As Exception - OnError("Ocurrió un error al registrar el emisor", ex) - End Try - - End Sub - - - - - - - Protected Sub LnkArchivoKey_Click(sender As Object, e As EventArgs) Handles LnkArchivoKey.Click - TxtCargaImg.getfiles().Archivos = Nothing - TxtCargaImg.Text = "[]" - OpActualizaArchivosCer = EnumOpActualizaArchivosCer.KEY - LblModalCertificadosTitulo.Text = "Archivo KEY" - UpModalCertificados.Update() - RegistraScript(String.Format("$('#{0}').modal();", "ModalArchvivo")) - End Sub - - Protected Sub LnkArchivoCer_Click(sender As Object, e As EventArgs) Handles LnkArchivoCer.Click - TxtCargaImg.getfiles().Archivos = Nothing - TxtCargaImg.Text = "[]" - OpActualizaArchivosCer = EnumOpActualizaArchivosCer.CER - LblModalCertificadosTitulo.Text = "Archivo CER" - UpModalCertificados.Update() - RegistraScript(String.Format("$('#{0}').modal();", "ModalArchvivo")) - End Sub - - Protected Sub LnkArchivoPfx_Click(sender As Object, e As EventArgs) Handles LnkArchivoPfx.Click - TxtCargaImg.getfiles().Archivos = Nothing - TxtCargaImg.Text = "[]" - OpActualizaArchivosCer = EnumOpActualizaArchivosCer.PFX - LblModalCertificadosTitulo.Text = "Archivo PFX" - UpModalCertificados.Update() - RegistraScript(String.Format("$('#{0}').modal();", "ModalArchvivo")) - End Sub - - Protected Sub BtnGuardarArchivo_Click(sender As Object, e As EventArgs) +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports System.IO + + +Partial Class Sistemas_Empresa + Inherits ClsPaginas + +#Region " PROPIEDADES " + Private ReadOnly Property CveEmpresa As Integer + Get + Return ViewState("CveEmpresa").ToString.ToEntero + End Get + End Property + + Private Property EmpresaEditar As Empresa + Get + Return CType(ViewState("EmpresaEditar"), Empresa) + End Get + Set(value As Empresa) + ViewState("EmpresaEditar") = value + End Set + End Property + + + Private Property DtFuncionalidades As Data.DataTable + Get + Return CType(ViewState("DtFuncionalidades"), DataTable) + End Get + Set(value As Data.DataTable) + ViewState("DtFuncionalidades") = value + End Set + End Property + Private Property BDContPAQ As String + Get + BDContPAQ = ViewState("BDContPAQ").ToString + End Get + Set(value As String) + ViewState("BDContPAQ") = value + End Set + End Property + Private Property ServerContPAQ As String + Get + ServerContPAQ = ViewState("ServerContPAQ").ToString + End Get + Set(value As String) + ViewState("ServerContPAQ") = value + End Set + End Property + Public Property DtCuentas As DataTable + Get + Return CType((ViewState("DtCuentas")), DataTable) + End Get + Set(value As DataTable) + ViewState("DtCuentas") = value + End Set + End Property + Public Property DtClasificacionIVA As DataTable + Get + If ViewState("DtClasificacionIVA") Is Nothing Then + ViewState("DtClasificacionIVA") = New DataTable + End If + Return CType((ViewState("DtClasificacionIVA")), DataTable) + End Get + Set(value As DataTable) + ViewState("DtClasificacionIVA") = value + End Set + End Property + Public Property CveClasificacionPorcentaje As Integer + Get + Return CType((ViewState("CveClasificacionPorcentaje")), Integer) + End Get + Set(value As Integer) + ViewState("CveClasificacionPorcentaje") = value + End Set + End Property + Public Property Modalidad As String + Get + Return CType((ViewState("Modalidad")), String) + End Get + Set(value As String) + ViewState("Modalidad") = value + End Set + End Property + Public Property Index As Integer + Get + Return CType((ViewState("Index")), Integer) + End Get + Set(value As Integer) + ViewState("Index") = value + End Set + End Property + + + Public Property TipoContabilidad As Integer + Get + If ViewState("TipoContabilidad") Is Nothing Then + ViewState("TipoContabilidad") = -1 + End If + + Return CType((ViewState("TipoContabilidad")), Integer) + End Get + Set(value As Integer) + ViewState("TipoContabilidad") = value + End Set + End Property + + + + Enum EnumOpActualizaArchivosCer + SinOpcion + KEY + CER + PFX + End Enum + + + Property OpActualizaArchivosCer As EnumOpActualizaArchivosCer + + Get + If ViewState("OpActualizaArchivosCer") Is Nothing Then + ViewState("OpActualizaArchivosCer") = EnumOpActualizaArchivosCer.SinOpcion + End If + + Return DirectCast(ViewState("OpActualizaArchivosCer"), EnumOpActualizaArchivosCer) + + End Get + Set(value As EnumOpActualizaArchivosCer) + ViewState("OpActualizaArchivosCer") = value + End Set + + End Property + +#End Region + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then + + If UsuarioActual.CveRol <> 1 AndAlso (Request("CveEmpresa") IsNot Nothing AndAlso Request("CveEmpresa").ToEntero > 0) Then + + If Not ValidaCveEmpresaUsaurio(UsuarioActual.CveUsuario, Request("CveEmpresa").ToEntero) Then + 'Response.Redirect("../Inicio.aspx") + Alert("No tiene acceso a esta empresa.", TipoMensaje.MsgAdvertencia, "document.location.href = ""../Inicio.aspx""") + Exit Sub + End If + + End If + + CargaDdlPac() + CargaRegimenFiscal() + CargaGridIndicadores() + DtFuncionalidades = Nothing + DtCuentas = Nothing + CveClasificacionPorcentaje = 0 + + If (Request("CveEmpresa") IsNot Nothing AndAlso IsNumeric(Request("CveEmpresa")) AndAlso Request("CveEmpresa").ToEntero > 0 AndAlso UsuarioActual.CveRol = 1) OrElse UsuarioActual.CveRol <> 1 Then + ViewState("CveEmpresa") = If(UsuarioActual.CveRol <> 1, UsuarioActual.Empresa.CveEmpresa.ToString, Request("CveEmpresa")) ' Request("CveEmpresa") + ' Session("FileUpload") = CveEmpresa + CargaTareasProgramadas() + CargaDatos() + + 'Configuración de Modalidad Update + TxtTimbres.Enabled = False + LbArchivoKeyDescarga.Visible = True + LbArchivoCerDescarga.Visible = True + LbArchivoPfxDescarga.Visible = True + + 'If LnkArchivoKey.InnerText = "" Then + ' LnkArchivoKey.InnerText = "Reemplazar Archivo Key" + 'End If + 'If LnkArchivoCer.InnerText = "" Then + ' LnkArchivoCer.InnerText = "Reemplazar Archivo Cer" + 'End If + + 'If LnkArchivoPfx.InnerText = "" Then + ' LnkArchivoPfx.InnerText = "Reemplazar Archivo Pfx" + 'End If + BtnGuardar.Text = "Guardar Cambios" + + 'Plantilla Correo + + + Else + 'Configuración de Modalidad Insert + ViewState("CveEmpresa") = -1 + 'TAB.ActiveTabIndex = 1 + BtnEliminar.Visible = False + + End If + ConfiguracionEmpresa() + + End If + End Sub + + Private Function ValidaCveEmpresaUsaurio(CveUsuario As Integer, CveEmpresaValidar As Integer) As Boolean + + Dim Respuesta As Boolean = False + Using ObjEmpresas As New ClsSisEmpresas() + If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1", UsuarioActual.CveUsuario) Then + If ObjEmpresas.DtResultados.FiltraParametros($"CveEmpresa = {CveEmpresaValidar}").Rows.Count = 1 Then + Respuesta = True + End If + End If + End Using + Return Respuesta + + End Function + + Private Sub CargaDatos() + + Dim ObjEmpresas As New ClsSisEmpresas() + If ObjEmpresas.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then + If ObjEmpresas.DtResultados.Rows.Count > 0 Then + Me.EmpresaEditar = ObjEmpresas.Empresa + With ObjEmpresas.Empresa + + 'Campos para Modificación + TxtCveEmpresa.Text = .CveEmpresa.ToString + TxtEmpresa.Text = .Empresa : LtlTitulo.Text = "Consulta de Empresa: " & .Empresa + TxtNombreCorto.Text = .NombreCorto + TxtDireccion.Text = .Direccion + TxtNoExt.Text = .NoExt + TxtNoInt.Text = .NoInt + TxtColonia.Text = .Colonia + TxtCiudad.Text = .Ciudad + TxtEstado.Text = .Estado + TxtCP.Text = .CP.ToString + TxtRFC.Text = .RFC + TxtTelefono.Text = .Telefono + TxtContacto.Text = .Contacto 'Representante legal + TxtMail.Text = .Mail + DdlTipoFacturacion.SelectedValue = .TipoFacturacion + TxtBIUsuario.Text = .BIUsuario + TxtBIContraseña.Text = .BIContraseña + TxtContraseñaKey.Text = .ContraseñaKey + TxtArchivoKey.Text = .ArchivoKey + TxtArchivoCer.Text = .ArchivoCer + TxtArchivoPfx.Text = .ArchivoPfx + ChkEstatus.Checked = .Estatus + TxtFecha.Text = .FechaIng.ToString + TxtCveUsuario.Text = .Usuario + ChkFacturaProduccion.Checked = .FacturaProduccion + TxtSendMail.Text = .SendMail + TxtSendMailPassword.Text = .SendMailPassword + TxtSendMailServer.Text = .SendMailServer + TxtSendMailPort.Text = .SendMailPuerto.ToString + ChkSendMailSSL.Checked = .SendMailSSL + ChkMostrarRetIVA.Checked = .MostrarRetIVA + ChkMostrarRetISR.Checked = .MostrarRetISR + 'TxtRegimen.Text = .Regimen + ChkEstatusFacturacion.Checked = .EstatusFacturacion + TxtTimbres.Text = .Timbres.ToString + ChkUsaContabilidad.Checked = .UsaContabilidad + ChkUsaBancos.Checked = .UsaBancos + ChkUsaVentas.Checked = .UsaVentas + ChkUsaCxC.Checked = .UsaCxC + ChkUsaCompras.Checked = .UsaCompras + ChkUsaInventarios.Checked = .UsaInventarios + ChkUsaRH.Checked = .UsaRH + ChkUsaNomina.Checked = .UsaNomina + ChkUsaOS.Checked = .UsaOS + TxtBDContPAQi.Text = .BDContPAQi + TxtServerContPAQi.Text = .ServerContPAQi + TxtUsrContPAQi.Text = .UsrContPAQi + TxtPwdContPAQi.Text = .PwdContPAQi + TxtBuzon_Mail.Text = .Buzon_Mail + TxtBuzon_Server.Text = .Buzon_Server + TxtBuzon_Puerto.Text = .Buzon_Puerto.ToString + ChkBuzon_SSL.Checked = .Buzon_SSL + TxtBuzon_USR.Text = .Buzon_USR + TxtBuzon_PWD.Text = .Buzon_PWD + TxtMailSoporte.Text = .Soporte_Mail + TxtServidorSoporte.Text = .Soporte_Server + TxtPuertoSoporte.Text = .Soporte_Puerto.ToString + ChkSSLSoporte.Checked = .Soporte_SSL + TxtUsuarioSoporte.Text = .Soporte_USR + DdlProtocoloSoporte.SelectedValue = .Soporte_Tipo + TxtContraseñaSoporte.Text = .Soporte_PWD + DdlCvePac.SelectedValueExist(.CvePAC.ToString) + DdlRegimen.SelectedValue = .CveRegimenFiscal.ToString + TxtCURP.Text = .CURP + TxtImporte.Text.ToDecimal + TxtCIEC.Text = .CIEC + DdlPlataforma.SelectedValue = .CvePlataforma.ToString + ChkUsaAC.Checked = .UsaAC + TxtPorDepreciacion.Text = .PorDepreciacion.ToString + TxtExtension.Text = .Extension + TxtLocalidad.Text = .Localidad + DdlMetodoInventario.SelectedValue = .CveMetodoInventario.ToString + TxtPeriodoActual.Text = .PeriodoActual.ToString + TxtEjercicioActual.Text = .EjercicioActual.ToString + ChkDefaultAsistencias.Checked = .DefaultAsistencias + TxtDiasPermitidos.Text = .DiasPermitidos.ToString + DdlTipoCentroDeCostos.SelectedValue = .Tipo_CentroCosto.ToString + ChkReqCentroCostos.Checked = .RequiereCentroCostos + DdlTerminalTipo.SelectedValue = .PV_TerminalTipo.ToString + TxtImporte.Text = .Importe.ToString + TipoContabilidad = .TipoContabilidad + + TxtPlantillaVenta.Text = .PlantillaMailVenta + TxtAsunto.Text = .AsuntoPlantillaMailVenta + + TxtPlantillaCotizacion.Text = .AsuntoPlantillaMailVentaCotizacion + TxtAsuntoCotizacion.Text = .PlantillaMailVentaCotizacion + + 'NUEVOS + TxtAreaGeografica.Text = .AreaGeografica + DdlProtocolo.Text = .Buzon_Tipo + + 'Fiel + LblPfx.Text = .FielPFX + lblPassFiel.Text = .FielPassword + + 'PARA PROPIEDAD - TRIGGER + BDContPAQ = .BDContPAQi + ServerContPAQ = .ServerContPAQi + + 'CUENTAS PADRES + ObjEmpresas.GetEmpresasFuncionalidades(CveEmpresa) + DtFuncionalidades = ObjEmpresas.DtResultados + + + Session("FileUpload") = .Banner + Session("FileUpload") = .ArchivoKey + Session("FileUpload") = .ArchivoCer + Session("FileUpload") = .ArchivoPfx + End With + Else + Alert("La Empresa Solicitada no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) + BtnGuardar.Enabled = False + + End If + End If + + ObjEmpresas.Dispose() + CargarGrupoEmpresas() + UpDatos.Update() + End Sub + Protected Sub CargarGrupoEmpresas() + Dim ObjEmpresas As New ClsSisEmpresas() + + 'Gridview + ObjEmpresas.GetEmpresasGrupos(CveEmpresa) + GVGrupoEmpresas.DataSource = ObjEmpresas.DtResultados + GVGrupoEmpresas.DataBind() + + 'DropdownList Empresas + ObjEmpresas.GetEmpresasGruposNot(CveEmpresa) + DdlEmpresas.Items.Clear() + DdlEmpresas.DataSource = ObjEmpresas.DtResultados + DdlEmpresas.DataBind() + + ObjEmpresas.Dispose() + + updategrupoempresa.Update() + End Sub + Protected Sub LinkButton1_Click(sender As Object, e As EventArgs) Handles AddGrupoEmpresa.Click + + Dim ObjEmpresas As New ClsSisEmpresas() + ObjEmpresas.AddEmpresasGrupos(CveEmpresa, DdlEmpresas.SelectedValue.ToEntero) + ObjEmpresas.Dispose() + CargarGrupoEmpresas() + End Sub + Protected Sub GrupoEmpresas_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GVGrupoEmpresas.RowDeleting + Dim ObjEmpresas As New ClsSisEmpresas() + ObjEmpresas.RemoveEmpresasGrupos(CveEmpresa, CType(GVGrupoEmpresas.Rows(e.RowIndex).FindControl("GVColCVeEmpresa"), HiddenField).Value.ToEntero()) + ObjEmpresas.Dispose() + CargarGrupoEmpresas() + End Sub + Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click + Dim ObjEmpresas As New ClsSisEmpresas + Dim ObjGral As New ClsGenerales() + Dim ObjContPAQ As ClsContPAQi = Nothing + Dim Indicador As New ClsIndicadores(ObjEmpresas.IniciaTransacSQL()) + + Dim TextoError = "" + Dim TextoOK = "" + + If CveEmpresa = -1 Then + If ObjEmpresas.AddEmpresa(TxtCveEmpresa.Text.Trim.ToEntero, TxtEmpresa.Text.Trim, TxtDireccion.Text.Trim, TxtNoExt.Text.Trim, TxtNoInt.Text.Trim, TxtColonia.Text.Trim, + TxtCiudad.Text.Trim, TxtEstado.Text.Trim, TxtRFC.Text.Trim, TxtCP.Text.Trim.ToEntero, TxtTelefono.Text.Trim, TxtContacto.Text.Trim, TxtMail.Text.Trim, + DdlTipoFacturacion.SelectedValue, TxtBIUsuario.Text.Trim, TxtBIContraseña.Text.Trim, TxtContraseñaKey.Text.Trim, TxtArchivoKey.Text.Trim, + TxtArchivoCer.Text.Trim, TxtArchivoPfx.Text.Trim, "", UsuarioActual.CveUsuario, ChkFacturaProduccion.Checked, ChkMostrarRetIVA.Checked, + ChkMostrarRetISR.Checked, "-1", ChkEstatusFacturacion.Checked, TxtSendMail.Text.Trim, TxtSendMailPassword.Text.Trim, TxtSendMailServer.Text.Trim, + TxtSendMailPort.Text.Trim.ToEntero, ChkSendMailSSL.Checked, ChkUsaContabilidad.Checked, ChkUsaBancos.Checked, ChkUsaVentas.Checked, ChkUsaCxC.Checked, + ChkUsaCompras.Checked, ChkUsaInventarios.Checked, ChkUsaRH.Checked, ChkUsaNomina.Checked, ChkUsaOS.Checked, TxtBDContPAQi.Text.Trim, TxtServerContPAQi.Text.Trim, + TxtUsrContPAQi.Text.Trim, TxtPwdContPAQi.Text.Trim, TxtBuzon_Mail.Text.Trim, TxtBuzon_Server.Text.Trim, TxtBuzon_Puerto.Text.Trim.ToEntero, ChkBuzon_SSL.Checked, + TxtBuzon_USR.Text.Trim, TxtBuzon_PWD.Text.Trim, DdlProtocolo.SelectedValue, TxtMailSoporte.Text.Trim, TxtServidorSoporte.Text.Trim, TxtPuertoSoporte.Text.Trim.ToEntero, ChkSSLSoporte.Checked, + TxtUsuarioSoporte.Text.Trim, TxtContraseñaSoporte.Text.Trim, DdlProtocoloSoporte.SelectedValue, + "".Trim, TxtAreaGeografica.Text.Trim, + TxtNombreCorto.Text, TxtCURP.Text.Trim, DdlRegimen.SelectedValue.ToEntero, TxtImporte.Text.ToDecimal, TxtCIEC.Text, DdlPlataforma.SelectedValue.ToEntero, ChkUsaAC.Checked, + TxtPorDepreciacion.Text.ToDecimal, TxtExtension.Text, TxtLocalidad.Text, DdlMetodoInventario.SelectedValue.ToEntero, TxtPeriodoActual.Text.ToEntero, + TxtEjercicioActual.Text.ToEntero, ChkDefaultAsistencias.Checked, TxtDiasPermitidos.Text.ToEntero, DdlTipoCentroDeCostos.SelectedValue.ToEntero, ChkReqCentroCostos.Checked, DdlTerminalTipo.SelectedValue.ToEntero, CvePAC:=DdlCvePac.SelectedValue.ToEntero + ) Then + + 'Movemos el Archivo Fisicamente + If Session("FileUpload") IsNot Nothing AndAlso Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString) Then + Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString) + File.Move(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Banners\" & ObjEmpresas.CveEmpresa.ToString & Extension) + + End If + ViewState("CveEmpresa") = ObjEmpresas.CveEmpresa + 'InicializaClasificacionIVA(ObjEmpresas) + TextoOK = "La nueva Empresa se guardó correctamente." + Else + TextoError = "Ocurrió un error al agregar la empresa" + End If + + + + 'Agregar Indicadores + For Each Row As GridViewRow In GvIndicadores.Rows + If Row.DataKey("CveIndicador") <> "" And Row.DataKey("CveEmpresa") = "" Then + If Row.FCCheckBox("chkIndicador").Checked Then + If Not Indicador.AddIndicadorEmpresa(Row.DataKey("CveIndicador").ToEntero, UsuarioActual.CveEmpresa) Then + Exit For + End If + End If + End If + Next + + + + + Else + If ObjEmpresas.UpdateEmpresa(TxtEmpresa.Text.Trim, TxtDireccion.Text.Trim, TxtNoExt.Text.Trim, TxtNoInt.Text.Trim, TxtColonia.Text.Trim, TxtCiudad.Text.Trim, TxtEstado.Text.Trim, TxtRFC.Text.Trim, + TxtCP.Text.Trim.ToEntero, TxtTelefono.Text.Trim, TxtContacto.Text.Trim, TxtMail.Text.Trim, DdlTipoFacturacion.SelectedItem.ToString, TxtBIUsuario.Text.Trim, + TxtBIContraseña.Text.Trim, TxtContraseñaKey.Text.Trim, TxtArchivoKey.Text.Trim, TxtArchivoCer.Text.Trim, TxtArchivoPfx.Text.Trim, "", ChkEstatus.Checked, + ChkFacturaProduccion.Checked, ChkMostrarRetIVA.Checked, ChkMostrarRetISR.Checked, "", ChkEstatusFacturacion.Checked, TxtSendMail.Text.Trim, + TxtSendMailPassword.Text.Trim, TxtSendMailServer.Text.Trim, TxtSendMailPort.Text.Trim.ToEntero, ChkSendMailSSL.Checked, ChkUsaContabilidad.Checked, ChkUsaBancos.Checked, + ChkUsaVentas.Checked, ChkUsaCxC.Checked, ChkUsaCompras.Checked, ChkUsaInventarios.Checked, ChkUsaRH.Checked, ChkUsaNomina.Checked, ChkUsaOS.Checked, TxtBDContPAQi.Text.Trim, + TxtServerContPAQi.Text.Trim, TxtUsrContPAQi.Text.Trim, TxtPwdContPAQi.Text.Trim, TxtBuzon_Mail.Text.Trim, TxtBuzon_Server.Text.Trim, TxtBuzon_Puerto.Text.Trim.ToEntero, + ChkBuzon_SSL.Checked, TxtBuzon_USR.Text.Trim, TxtBuzon_PWD.Text.Trim, TxtCveEmpresa.Text.Trim.ToEntero, DdlProtocolo.SelectedValue, + TxtMailSoporte.Text.Trim, TxtServidorSoporte.Text.Trim, TxtPuertoSoporte.Text.Trim.ToEntero, ChkSSLSoporte.Checked, + TxtUsuarioSoporte.Text.Trim, TxtContraseñaSoporte.Text.Trim, DdlProtocoloSoporte.SelectedValue, "", TxtAreaGeografica.Text.Trim, + TxtNombreCorto.Text, TxtCURP.Text.Trim, DdlRegimen.SelectedValue.ToEntero, DdlCvePac.SelectedValue.ToEntero, + TxtImporte.Text.ToDecimal, TxtCIEC.Text, DdlPlataforma.SelectedValue.ToEntero, ChkUsaAC.Checked, + TxtPorDepreciacion.Text.ToDecimal, TxtExtension.Text, TxtLocalidad.Text, DdlMetodoInventario.SelectedValue.ToEntero, TxtPeriodoActual.Text.ToEntero, + TxtEjercicioActual.Text.ToEntero, ChkDefaultAsistencias.Checked, TxtDiasPermitidos.Text.ToEntero, DdlTipoCentroDeCostos.SelectedValue.ToEntero, ChkReqCentroCostos.Checked, DdlTerminalTipo.SelectedValue.ToEntero) Then + + 'Movemos el Archivo Fisicamente + If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString) Then + Dim Extension As String = Path.GetExtension(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString) + If File.Exists(Request.PhysicalApplicationPath + "Banners\" & CveEmpresa & Extension) Then + File.Delete(Request.PhysicalApplicationPath + "Banners\" & CveEmpresa & Extension) + File.Move(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Banners\" & CveEmpresa & Extension) + Else + File.Move(Request.PhysicalApplicationPath + "Banners\Temp\" & Session("FileUpload").ToString, Request.PhysicalApplicationPath + "Banners\" & CveEmpresa & Extension) + End If + End If + + TextoOK = "Los cambios de guardaron correctamente." + Else + TextoError = "Ocurrió un error al guardar los cambios de la empresa" + End If + + 'Agregar Indicadores + For Each Row As GridViewRow In GvIndicadores.Rows + If Row.DataKey("CveIndicador") <> "" AndAlso Row.DataKey("CveEmpresa") <> "" And Row.FCCheckBox("chkIndicador").Checked = False Then + If Not Indicador.RemoveIndicadoresEmpresas(Row.DataKey("CveIndicador").ToEntero, UsuarioActual.CveEmpresa) Then + Exit For + End If + End If + + If Row.DataKey("CveIndicador") <> "" And Row.DataKey("CveEmpresa") = "" Then + If Row.FCCheckBox("chkIndicador").Checked Then + If Not Indicador.AddIndicadorEmpresa(Row.DataKey("CveIndicador").ToEntero, UsuarioActual.CveEmpresa) Then + Exit For + End If + End If + End If + Next + + End If + + 'RECARGA EMPRESA + If TextoError = "" Then + If ObjEmpresas.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then + GlobalDTEmpresas(CveEmpresa) = Nothing + + 'verifico si existe la carpeta de la empresa, sino la crea + For Each dr As Data.DataRow In ObjEmpresas.DtResultados.Rows + If Not IO.Directory.Exists(String.Format("{0}\{1}", ModExtensiones.DirectorioBaseEmpresas, dr("CveEmpresa"))) Then + IO.Directory.CreateDirectory(String.Format("{0}Empresas\{1}", ModExtensiones.DirectorioBaseEmpresas, dr("CveEmpresa"))) + End If + Next + End If + End If + + 'TRIGGER + If TextoError = "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" And TxtBDContPAQi.Text.Trim <> "" Then + + If UsuarioActual.Empresa.UsaContabilidad Then + + If UsuarioActual.Empresa.TipoContabilidad = 2 Then + 'CREA OBJETO EMPRESA + If ObjEmpresas.GetEmpresas(TxtCveEmpresa.Text.ToEntero, "-1", "-1", "-1", "-1") Then + Dim Empresa As New Empresa + Empresa = ObjEmpresas.Empresa + + ObjContPAQ = New ClsContPAQi(Empresa) + + If ObjContPAQ.Conectado Then + 'ADD + If BDContPAQ = "" Then + If Not ObjContPAQ.TRIGGER(TxtBDContPAQi.Text.Trim) Then + TextoError = "Los datos de conexion al servidor de contabilidad son incorrectos" + End If + End If + + 'UPDATE + If BDContPAQ <> "" And (BDContPAQ <> TxtBDContPAQi.Text.Trim Or ServerContPAQ <> TxtServerContPAQi.Text.Trim) Then + If Not ObjContPAQ.TRIGGER(TxtBDContPAQi.Text.Trim) Then + TextoError = "Los datos de conexion al servidor de contabilidad son incorrectos" + End If + End If + Else + TextoError = "Los datos de conexion al servidor de contabilidad son incorrectos" + End If + End If + End If + + Else + Alert("La empresa tiene la información para el uso de contabilidad pero no se tiene activada", TipoMensaje.MsgAdvertencia) + End If + End If + + If TextoError = "" Then + ObjEmpresas.Commit() + If ObjContPAQ IsNot Nothing Then ObjContPAQ.Commit() + Alert(TextoOK, TipoMensaje.MsgInformacion, "document.location.href=""/Sistemas/Empresa.aspx?CveEmpresa=" & TxtCveEmpresa.Text.Trim & """;") + Session("FileUpload") = "" + CargaDatos() + UpDatos.Update() + Else + ObjEmpresas.RollBack() + If ObjContPAQ IsNot Nothing Then ObjContPAQ.RollBack() + Alert(TextoError, TipoMensaje.MsgError) + End If + + ObjEmpresas.Dispose() + ObjGral.Dispose() + If ObjContPAQ IsNot Nothing Then ObjContPAQ.Dispose() + End Sub + Private Function AgregarFuncionalidad(ObjEmpresas As ClsSisEmpresas, CveFuncionalidad As Integer, ByRef Ddl As DropDownList) As String + Dim Retorno = "" + + If Not ObjEmpresas.AddUpdateEmpresaFuncionalidades(TxtCveEmpresa.Text.Trim.ToEntero, CveFuncionalidad, Ddl.SelectedValue) Then + Retorno = "Ocurrió un error al vincular la cuenta contable" + End If + + Return Retorno + End Function + Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click + Dim ObjEmpresas As New ClsSisEmpresas + If ObjEmpresas.RemoveEmpresa(CveEmpresa) Then + GlobalDTEmpresas = ObjEmpresas.DtResultados + Alert("La Empresa se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Sistemas/Empresa.aspx"";") + End If + ObjEmpresas.Dispose() + End Sub + + Private Sub CargaDdlPac() + Dim Objeto As New ClsSisEmpresas + If Objeto.GetPacs() Then + DdlCvePac.DataSource = Objeto.DtResultados + DdlCvePac.DataBind() + DdlCvePac.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + Objeto.Dispose() + End Sub + Private Sub CargaRegimenFiscal() + Dim ObjSis As New ClsSisEmpresas + If ObjSis.GetRegimenFiscal(-1) Then + DdlRegimen.DataSource = ObjSis.DtResultados + DdlRegimen.DataBind() + DdlRegimen.Items.Insert(0, New ListItem("Seleccione", "-1")) + End If + ObjSis.Dispose() + End Sub + +#Region "CONFIGURACION EMPRESA" + Private Sub ConfiguracionEmpresa() + If UsuarioActual.CveRol <> 1 Then + TabSistema.Visible = False + BtnCancelar.Visible = False + BtnEliminar.Visible = False + BiInform.Visible = False + End If + If TipoContabilidad = 2 Then + TabContabilidad.Visible = True + End If + End Sub +#End Region + +#Region "TAB - INDICADORES " + Public Sub CargaGridIndicadores() + Dim Objeto As New ClsIndicadores + If Objeto.GetEmpresasIndicadores(UsuarioActual.CveEmpresa) Then + GvIndicadores.DataSource = Objeto.DtResultados + End If + GvIndicadores.DataBind() + Objeto.Dispose() + End Sub + + Private Sub GvIndicadores_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvIndicadores.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + If e.Row.DBCampo("CveEmpresa") <> "" Then + e.Row.FCCheckBox("chkIndicador").Checked = True + End If + End If + End Sub + + + +#End Region + +#Region "P L A N T I L L A C O R R E O" + + Private Sub BtnGuardarPlantilla_Click(sender As Object, e As EventArgs) Handles BtnGuardarPlantilla.Click + If UsuarioActual.Empresa.PlantillaMailVenta.Length > 0 Then + + End If + Dim ObjEmpresa As New ClsSisEmpresas() + If ObjEmpresa.UpdatePlantillaMail("AsuntoPlantillaMailVenta", TxtAsunto.Text.Trim, "PlantillaMailVenta", TxtPlantillaVenta.Text.Trim, CveEmpresa) Then + + If ObjEmpresa.UpdatePlantillaMail("AsuntoPlantillaMailVentaCotizacion", TxtAsuntoCotizacion.Text.Trim, "PlantillaMailVentaCotizacion", TxtPlantillaCotizacion.Text.Trim, CveEmpresa) Then + + End If + Alert("La plantilla de mail de ventas se guardó correctamente.", TipoMensaje.MsgInformacion) + + UsuarioActual.Empresa.PlantillaMailVenta = TxtPlantillaVenta.Text.Trim + UsuarioActual.Empresa.AsuntoPlantillaMailVenta = TxtAsunto.Text.Trim + + UsuarioActual.Empresa.AsuntoPlantillaMailVentaCotizacion = TxtPlantillaCotizacion.Text.Trim + UsuarioActual.Empresa.PlantillaMailVentaCotizacion = TxtAsuntoCotizacion.Text.Trim + + 'TxtPlantillaVenta.Text = "" + 'TxtAsunto.Text = "" + End If + ObjEmpresa.Dispose() + Alert(TxtPlantillaVenta.Text.Trim, TipoMensaje.MsgInformacion) + End Sub + + +#End Region + + Protected Sub LnkOpenModalDatosFiel_Click(sender As Object, e As EventArgs) + TxtFielPass.Text = "" + TxtFielArchivoCER.Text = "" + TxtFielArchivoKey.Text = "" + RegistraScript("$('#ModalUpFiel').modal();") + End Sub + Protected Sub LnkUpDatosFiel_Click(sender As Object, e As EventArgs) + Dim Password As String = TxtFielPass.Text + Dim akey As String + Dim acer As String + Dim pemkey As String + Dim pemcer As String + Dim pfxname As String + Dim Archivopfx As String + Dim Archivokey As Archivo = Nothing + Dim Archivocer As Archivo = Nothing + + Dim dirbase = "" ' String.Format("{0}Empresas\{1}\Certificados\Fiel\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) + Dim dirbasepfx = "" ' String.Format("{0}Empresas\{1}\Certificados\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) + If EmpresaEditar IsNot Nothing Then + dirbase = String.Format("{0}Certificados\Fiel\", EmpresaEditar.Ruta) + dirbasepfx = String.Format("{0}Certificados\", EmpresaEditar.Ruta) + Else + dirbase = String.Format("{0}Empresas\{1}\Certificados\Fiel\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) + dirbasepfx = String.Format("{0}Empresas\{1}\Certificados\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) + End If + + If (Not Directory.Exists(dirbase)) Then + Directory.CreateDirectory(dirbase) + End If + + Dim Filesgral As List(Of Archivo) = TxtFielArchivoCER.getfiles().Archivos + If Filesgral.Count > 0 Then + Archivocer = Filesgral(0) + End If + Filesgral = TxtFielArchivoKey.getfiles().Archivos + If Filesgral.Count > 0 Then + Archivokey = Filesgral(0) + End If + If Not IsNothing(Archivokey) AndAlso Not IsNothing(Archivocer) And Password.Length > 0 Then + akey = String.Format("{0}{1}", dirbase, Archivokey.filenameO) + If File.Exists(akey) Then + File.Delete(akey) + End If + File.Copy(Archivokey.FileUrl, akey) + acer = String.Format("{0}{1}", dirbase, Archivocer.filenameO) + If File.Exists(acer) Then + File.Delete(acer) + End If + File.Copy(Archivocer.FileUrl, acer) + Archivopfx = Archivokey.filenameO.Substring(0, Archivokey.filenameO.Length - 4) + pemkey = String.Format("{0}{1}.pem", dirbase, Archivopfx) + pfxname = String.Format("{0}{1}.pfx", dirbasepfx, Archivopfx) + pemcer = String.Format("{0}{1}.pem", dirbase, Archivokey.filenameO.Substring(0, Archivocer.filenameO.Length - 4)) + + If File.Exists(pemkey) Then + File.Delete(pemkey) + End If + + If File.Exists(pfxname) Then + File.Delete(pfxname) + End If + + If File.Exists(pemcer) Then + File.Delete(pemcer) + End If + + Dim resultado As New StringBuilder + resultado.AppendLine("
PAso 1:
") + resultado.AppendLine(execCommand({"cd C:\Generar PFX\", String.Format("openssl.exe x509 -inform DER -in ""{0}"" -out ""{1}""", acer, pemcer)})) + resultado.AppendLine("
PAso 2:
") + resultado.AppendLine(execCommand({"cd C:\Generar PFX\", String.Format("openssl pkcs8 -inform DER -in ""{0}"" -passin pass:""{1}"" -out ""{2}""", akey, Password, pemkey)})) + resultado.AppendLine("
Paso 3:
") + resultado.AppendLine(execCommand({"cd C:\Generar PFX\", String.Format("openssl pkcs12 -export -out ""{0}"" -inkey ""{1}"" -in ""{2}"" -passout pass:""{3}""", pfxname, pemkey, pemcer, Password)})) + resultado.AppendLine("
") + 'Alert(resultado.ToString()) + + If File.Exists(pemkey) Then + File.Delete(pemkey) + End If + If File.Exists(pemcer) Then + File.Delete(pemcer) + End If + If File.Exists(acer) Then + File.Delete(acer) + End If + If File.Exists(akey) Then + File.Delete(akey) + End If + If File.Exists(Archivocer.FileUrl) Then + File.Delete(Archivocer.FileUrl) + End If + If File.Exists(Archivokey.FileUrl) Then + File.Delete(Archivokey.FileUrl) + End If + If Not File.Exists(pfxname) Then + Archivopfx = "" + Password = "" + End If + Dim objempresa As New ClsSisEmpresas + objempresa.UpEmpresaFiel(ViewState("CveEmpresa").ToString().ToEntero(), Password, $"{Archivopfx}.pfx") + objempresa.Dispose() + lblPassFiel.Text = Password + LblPfx.Text = $"{Archivopfx}.pfx" + Alert("La Fiel se ha actualizado") + UpmodalFiel.Update() + RegistraScript("$('#ModalUpFiel').modal('hide');") + Else + Alert("Favor de llenar todos los campos :
-Contraseña
-Archivo CER
-Archivo KEY", TipoMensaje.MsgAdvertencia) + End If + End Sub + Public Function execCommand(command As String()) As String + + Dim proceso As Diagnostics.Process = New Diagnostics.Process() + proceso.StartInfo.FileName = "cmd.exe" + proceso.StartInfo.CreateNoWindow = True + proceso.StartInfo.RedirectStandardInput = True + proceso.StartInfo.RedirectStandardOutput = True + proceso.StartInfo.UseShellExecute = False + proceso.Start() + For Each c As String In command + proceso.StandardInput.WriteLine(c) + + Next + proceso.StandardInput.Flush() + proceso.StandardInput.Close() + proceso.WaitForExit() + Return proceso.StandardOutput.ReadToEnd() + End Function + Private Sub CargaTareasProgramadas() + Dim objTP As New ClsTareasProgramadas() + ChkDescargaMasivaSat.Checked = False + If objTP.GetTareasProgramadas(ViewState("CveEmpresa").ToString.ToEntero()) AndAlso objTP.DtResultados.Rows.Count > 0 Then + ChkDescargaMasivaSat.Checked = (objTP.DtResultados.COUNT("CveTareaProgramada", "CveTareaProgramada=1") > 0) + End If + objTP.Dispose() + End Sub + Protected Sub ChkDescargaMasivaSat_CheckedChanged(sender As Object, e As EventArgs) + Dim objTP As New ClsTareasProgramadas() + If ChkDescargaMasivaSat.Checked Then + If objTP.AddTareasProgramadas(ViewState("CveEmpresa").ToString.ToEntero(), 1, DateTime.Now.ToString("yyyy/MM/dd"), "", 0, "", DateTime.Now.ToString("yyyy/MM/dd"), DateTime.Now.ToString("yyyy/MM/dd"), "", "", 0, 1) Then + Alert("La tarea programada de descarga masiva del sat a agregado satisfactoriamente") + End If + Else + If objTP.RemoveTareasProgramadas(1, ViewState("CveEmpresa").ToString().ToEntero()) Then + Alert("La tarea programada de descarga masiva del sat se ha removido satisfactoriamente") + End If + End If + + objTP.Dispose() + End Sub + Protected Sub LnkRegistrarPAC3_Click(sender As Object, e As EventArgs) + If Me.CveEmpresa > 0 Then + RegistrarPAC3() + Else + Alert("Debe registrar la empresa para poder registrarla en el PAC", TipoMensaje.MsgAdvertencia) + End If + + End Sub + Private Sub RegistrarPAC3() + Try + + Dim Credenciales As String = "vSGxMFWnNRy/nDoowxqrqw==|Sia123654" + Dim ArchivoLLave As String = String.Format("{0}\Certificados\{1}", EmpresaEditar.Ruta, EmpresaEditar.ArchivoKey) + Dim ArchivoCertificado As String = String.Format("{0}\Certificados\{1}", EmpresaEditar.Ruta, EmpresaEditar.ArchivoCer) + + Dim llaveByte = System.IO.File.ReadAllBytes(ArchivoLLave) + Dim certByte = System.IO.File.ReadAllBytes(ArchivoCertificado) + + Dim RFCEmisor = TxtRFC.Text.Trim() + Dim contrasena = TxtContraseñaKey.Text.Trim() + + Dim conector As New Profact.TimbraCFDI33.Conector(EmpresaEditar.FacturaProduccion) + + If Not EmpresaEditar.FacturaProduccion OrElse EmpresaEditar.CveEmpresa = 1 Then + conector.EstableceCredenciales("mvpNUXmQfK8=") + Else + conector.EstableceCredenciales(Credenciales) + End If + + Dim result = conector.RegistraEmisor(RFCEmisor, certByte, llaveByte, contrasena) + + If result.Exitoso Then + Alert("El emisor se registró correctamente.
" & result.Descripcion) + Else + Alert("Ocurrió un error al registrar el emisor.
" & result.Descripcion & ".
Numero Error: " & result.NumeroError, TipoMensaje.MsgError) + End If + + Catch ex As Exception + OnError("Ocurrió un error al registrar el emisor", ex) + End Try + + End Sub + + + + + + + Protected Sub LnkArchivoKey_Click(sender As Object, e As EventArgs) Handles LnkArchivoKey.Click + TxtCargaImg.getfiles().Archivos = Nothing + TxtCargaImg.Text = "[]" + OpActualizaArchivosCer = EnumOpActualizaArchivosCer.KEY + LblModalCertificadosTitulo.Text = "Archivo KEY" + UpModalCertificados.Update() + RegistraScript(String.Format("$('#{0}').modal();", "ModalArchvivo")) + End Sub + + Protected Sub LnkArchivoCer_Click(sender As Object, e As EventArgs) Handles LnkArchivoCer.Click + TxtCargaImg.getfiles().Archivos = Nothing + TxtCargaImg.Text = "[]" + OpActualizaArchivosCer = EnumOpActualizaArchivosCer.CER + LblModalCertificadosTitulo.Text = "Archivo CER" + UpModalCertificados.Update() + RegistraScript(String.Format("$('#{0}').modal();", "ModalArchvivo")) + End Sub + + Protected Sub LnkArchivoPfx_Click(sender As Object, e As EventArgs) Handles LnkArchivoPfx.Click + TxtCargaImg.getfiles().Archivos = Nothing + TxtCargaImg.Text = "[]" + OpActualizaArchivosCer = EnumOpActualizaArchivosCer.PFX + LblModalCertificadosTitulo.Text = "Archivo PFX" + UpModalCertificados.Update() + RegistraScript(String.Format("$('#{0}').modal();", "ModalArchvivo")) + End Sub + + Protected Sub BtnGuardarArchivo_Click(sender As Object, e As EventArgs) Dim FileExtension As String = "-1" Dim filesgral As List(Of Archivo) = TxtCargaImg.getfiles().Archivos - Dim filemove As String = "" - Dim TieneError As Boolean = False - - For Each fileItem As Archivo In filesgral - + Dim filemove As String = "" + Dim TieneError As Boolean = False + + For Each fileItem As Archivo In filesgral + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") - filemove = fileItem.filename - - Dim Patron As String = "(^\d{1,}-)|(\.\w{1,}$)" - Dim NombreArchivo As String = Regex.Replace(filemove, Patron, "") - - Dim yaExistente As String = String.Format("{0}Empresas\{1}\Certificados\{2}.{3}", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa, NombreArchivo, FileExtension) - - Dim ArchivoCertificado As String = $"{NombreArchivo}.{FileExtension}" - + filemove = fileItem.filename + + Dim Patron As String = "(^\d{1,}-)|(\.\w{1,}$)" + Dim NombreArchivo As String = Regex.Replace(filemove, Patron, "") + + Dim yaExistente As String = String.Format("{0}Empresas\{1}\Certificados\{2}.{3}", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa, NombreArchivo, FileExtension) + + Dim ArchivoCertificado As String = $"{NombreArchivo}.{FileExtension}" + If File.Exists(yaExistente) Then - File.Delete(yaExistente) - End If - Try - If filemove <> "" Then - Dim Ruta As String = String.Format("Empresas\{0}\Certificados\", CveEmpresa) - filemove.FilesMove(NombreArchivo, Ruta) - End If - Catch ex As Exception - TieneError = True - End Try - - - If CveEmpresa > 0 AndAlso Not TieneError Then - - Dim ObjEmpresas As New ClsSisEmpresas - - - Dim ArchivoKey As String = "-1" - Dim ArchivoCer As String = "-1" - Dim ArchivoPfx As String = "-1" - - - If OpActualizaArchivosCer = EnumOpActualizaArchivosCer.KEY Then - ArchivoKey = ArchivoCertificado - TxtArchivoKey.Text = ArchivoKey - ElseIf OpActualizaArchivosCer = EnumOpActualizaArchivosCer.CER Then - ArchivoCer = ArchivoCertificado - TxtArchivoCer.Text = ArchivoCer - ElseIf OpActualizaArchivosCer = EnumOpActualizaArchivosCer.PFX Then - ArchivoPfx = ArchivoCertificado - TxtArchivoPfx.Text = ArchivoPfx - End If - - If Not ObjEmpresas.UpdateEmpresasCertificados(ArchivoKey, ArchivoCer, ArchivoPfx, CveEmpresa) Then - TieneError = True - End If - - - ObjEmpresas.Dispose() - - End If - - - - Next - - - - - - If Not TieneError Then - Alert("Certificado cargado con exito") - RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalArchvivo")) - End If - TxtCargaImg.getfiles().Archivos = Nothing - UpAddArchivo.Update() - - - - - - End Sub - - Protected Sub LbArchivoKeyDescarga_Download(sender As Object, e As EventArgs) Handles LbArchivoKeyDescarga.Click - - Dim NombreArchivo As String = TxtArchivoKey.Text - DescargarArchivo(NombreArchivo) - - End Sub - - Protected Sub LbArchivoCerDescarga_Download(sender As Object, e As EventArgs) Handles LbArchivoCerDescarga.Click - - Dim NombreArchivo As String = TxtArchivoCer.Text - DescargarArchivo(NombreArchivo) - - End Sub - - Protected Sub LbArchivoPfxDescarga_Download(sender As Object, e As EventArgs) Handles LbArchivoPfxDescarga.Click - - Dim NombreArchivo As String = TxtArchivoPfx.Text - DescargarArchivo(NombreArchivo) - - End Sub - - Private Sub DescargarArchivo(NombreArchivo As String) - - Dim FilePath As String = String.Format("{0}Empresas\{1}\Certificados\{2}", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa, NombreArchivo) - Dim byteArray As Byte() = File.ReadAllBytes(FilePath) - - HttpContext.Current.Response.Clear() - HttpContext.Current.Response.ClearContent() - HttpContext.Current.Response.ContentType = "application/octet-stream" - HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", NombreArchivo)) - HttpContext.Current.Response.AddHeader("Content-Length", byteArray.Length.ToString()) - HttpContext.Current.Response.OutputStream.Write(byteArray, 0, byteArray.Length) - HttpContext.Current.Response.End() - - End Sub - -End Class + File.Delete(yaExistente) + End If + Try + If filemove <> "" Then + Dim Ruta As String = String.Format("Empresas\{0}\Certificados\", CveEmpresa) + filemove.FilesMove(NombreArchivo, Ruta) + End If + Catch ex As Exception + TieneError = True + End Try + + + If CveEmpresa > 0 AndAlso Not TieneError Then + + Dim ObjEmpresas As New ClsSisEmpresas + + + Dim ArchivoKey As String = "-1" + Dim ArchivoCer As String = "-1" + Dim ArchivoPfx As String = "-1" + + + If OpActualizaArchivosCer = EnumOpActualizaArchivosCer.KEY Then + ArchivoKey = ArchivoCertificado + TxtArchivoKey.Text = ArchivoKey + ElseIf OpActualizaArchivosCer = EnumOpActualizaArchivosCer.CER Then + ArchivoCer = ArchivoCertificado + TxtArchivoCer.Text = ArchivoCer + ElseIf OpActualizaArchivosCer = EnumOpActualizaArchivosCer.PFX Then + ArchivoPfx = ArchivoCertificado + TxtArchivoPfx.Text = ArchivoPfx + End If + + If Not ObjEmpresas.UpdateEmpresasCertificados(ArchivoKey, ArchivoCer, ArchivoPfx, CveEmpresa) Then + TieneError = True + End If + + + ObjEmpresas.Dispose() + + End If + + + + Next + + + + + + If Not TieneError Then + Alert("Certificado cargado con exito") + RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalArchvivo")) + End If + TxtCargaImg.getfiles().Archivos = Nothing + UpAddArchivo.Update() + + + + + + End Sub + + Protected Sub LbArchivoKeyDescarga_Download(sender As Object, e As EventArgs) Handles LbArchivoKeyDescarga.Click + + Dim NombreArchivo As String = TxtArchivoKey.Text + DescargarArchivo(NombreArchivo) + + End Sub + + Protected Sub LbArchivoCerDescarga_Download(sender As Object, e As EventArgs) Handles LbArchivoCerDescarga.Click + + Dim NombreArchivo As String = TxtArchivoCer.Text + DescargarArchivo(NombreArchivo) + + End Sub + + Protected Sub LbArchivoPfxDescarga_Download(sender As Object, e As EventArgs) Handles LbArchivoPfxDescarga.Click + + Dim NombreArchivo As String = TxtArchivoPfx.Text + DescargarArchivo(NombreArchivo) + + End Sub + + Private Sub DescargarArchivo(NombreArchivo As String) + + Dim FilePath As String = String.Format("{0}Empresas\{1}\Certificados\{2}", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa, NombreArchivo) + Dim byteArray As Byte() = File.ReadAllBytes(FilePath) + + HttpContext.Current.Response.Clear() + HttpContext.Current.Response.ClearContent() + HttpContext.Current.Response.ContentType = "application/octet-stream" + HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", NombreArchivo)) + HttpContext.Current.Response.AddHeader("Content-Length", byteArray.Length.ToString()) + HttpContext.Current.Response.OutputStream.Write(byteArray, 0, byteArray.Length) + HttpContext.Current.Response.End() + + End Sub + +End Class diff --git a/Ventas/CatImpuestosLocales.aspx.vb b/Ventas/CatImpuestosLocales.aspx.vb index 90651bd66..9c236d2a6 100644 --- a/Ventas/CatImpuestosLocales.aspx.vb +++ b/Ventas/CatImpuestosLocales.aspx.vb @@ -160,7 +160,7 @@ Partial Class Ventas_CatImpuestosLocales If CveImpuestoLocal = -1 Then If ChkEstatus.Checked Then Estatus = 1 - If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDecimal, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, DdlCuentasContables.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero) Then + If ObjVentas.AddImpuestosLocales(TxtImpuesto.Text.Trim, TxtPorcentaje.Text.ToDecimal, TxtOrden.Text.ToEntero, DdlTipoImpuesto.SelectedValue.ToEntero, Estatus, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero) Then CargaDatos() End If TxtImpuesto.Text = "" @@ -174,10 +174,9 @@ Partial Class Ventas_CatImpuestosLocales Dim Porcentaje As Decimal = TxtPorcentaje.Text.ToDecimal Dim Orden = TxtOrden.Text.ToEntero Dim TipoImpuesto = DdlTipoImpuesto.SelectedValue.ToEntero - Dim IdCtaContable = DdlCuentasContables.SelectedValue.ToEntero If ChkEstatus.Checked Then Estatus = 1 - If Not ObjVentas.UpdateImpuestosLocales(CveImpuestoLocal, Impuesto, Porcentaje, Orden, TipoImpuesto, Estatus, IdCtaContable, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero) Then + If Not ObjVentas.UpdateImpuestosLocales(CveImpuestoLocal, Impuesto, Porcentaje, Orden, TipoImpuesto, Estatus, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero) Then TieneError = True End If ObjVentas.Dispose() diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx index fbd6f8e67..25dc5a555 100644 --- a/Ventas/Clientes.aspx +++ b/Ventas/Clientes.aspx @@ -2004,7 +2004,7 @@
- Pago múltiples facturas Pagar múltiples facturas + Pago múltiples facturas Pagar múltiples facturas   diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index da1f3cf15..01eda9474 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -110,15 +110,6 @@ Partial Class Clientes End Set End Property - Private Property IdCtaCompCliente As String - Get - Return If(IsNothing(ViewState("IdCtaCompCliente")), "", ViewState("IdCtaCompCliente").ToString()) - End Get - Set(value As String) - ViewState("IdCtaCompCliente") = value - End Set - End Property - Private Property ArrayDisp As String Get Return If(IsNothing(ViewState("ArrayDisp")), "", ViewState("ArrayDisp").ToString()) @@ -205,7 +196,6 @@ Partial Class Clientes End Set End Property - Private Property DTCobrosRealizados As DataTable Get If ViewState("DTCobrosRealizados") Is Nothing Then @@ -1355,8 +1345,7 @@ Partial Class Clientes DdlCorporativo.DataBind() End Sub Protected Sub CargaCuentasExistentes() - 'SELECTED VALUES - ActivarRegistroAutomatico() + 'SELECTED VALUES HeaderContable.Attributes.Remove("onclick") UpFiscalContable.Update() End Sub @@ -2317,17 +2306,6 @@ Partial Class Clientes End Try End Sub - Private Function AsignaCuentasAutomaticas(ObjClientes As ClsClientes) As Boolean - Dim IdCtaContableClientes As Integer = UsuarioActual.Empresa.Funcionalidad(246).ToEntero() - Dim IdCtaContableAnticipos As Integer = UsuarioActual.Empresa.Funcionalidad(319).ToEntero() - Dim IdCtaContableComplementaria As Integer = UsuarioActual.Empresa.Funcionalidad(320).ToEntero() - Dim IdCtaContMonedaExtranjera As Integer = UsuarioActual.Empresa.Funcionalidad(331).ToEntero() - Dim IdCtaContMonedaExtranjeraAnticipos As Integer = UsuarioActual.Empresa.Funcionalidad(332).ToEntero() - Dim IdCtaContCompAnticipos As Integer = UsuarioActual.Empresa.Funcionalidad(333).ToEntero() - - Return True - End Function - Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click If UsuarioActual.CveUsuario = 1465 And TxtCodigo.Text.Trim = "" Then Alert("El cliente no se puede registrar sin ingresar un Código.", TipoMensaje.MsgAdvertencia) @@ -2603,10 +2581,6 @@ Partial Class Clientes 'Next GuardarDocumentosClientes() - If Not AsignaCuentasAutomaticas(ObjClientes) Then - ErrorProceso = True - End If - For Each GVR As GridViewRow In GvImpuestosLocales.Rows If GVR.FCCheckBox("ChkDeduccion").Checked Then ObjClientes.AddClienteImpuestosLocales(CveCliente, GVR.DataKey("CveImpuestoLocal").ToEntero()) @@ -2645,8 +2619,6 @@ Partial Class Clientes End If End If - - If ErrorProceso Then ObjClientes.RollBack() Else @@ -3758,14 +3730,11 @@ Partial Class Clientes 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 - Dim IdCtaContableClientes As Integer = -1, IdCtaContableAnticipos As Integer = -1, IdCtaContableRetIVA As Integer = -1, IdCtaContableRetISR As Integer = -1 + Dim TieneError = False Dim ProcesoCorrecto As Boolean Dim ObjContaAC As New ClsContPAQi(UsuarioActual.Empresa) - - ObjContaAC.IniciaTransacSQL() Dim CuentaPadre = -1 @@ -3785,8 +3754,6 @@ 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 @@ -3800,21 +3767,8 @@ 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" - IdCtaContableClientes = IdCuentaContable - Case "Anticipos" - IdCtaContableAnticipos = IdCuentaContable - Case "RetIVA" - IdCtaContableRetIVA = IdCuentaContable - Case "RetISR" - IdCtaContableRetISR = IdCuentaContable - End Select - + CodigoCuentaAltaCompaq = CStr(row("Codigo")) Else TieneError = True End If @@ -3823,9 +3777,6 @@ 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)) @@ -3889,40 +3840,14 @@ Partial Class Clientes End If End If - - - - Return Respuesta - End Function - - Private Sub ActivarRegistroAutomatico() - - 'Clientes - If DdlCtaContableClientes.SelectedValue.ToEntero() <= 0 And UsuarioActual.Empresa.Funcionalidad(211).ToEntero() > 0 Then - BtnActivaRegistroClientes.Visible = True - End If - - 'Anticipos - If DdlCtaContableAnticipos.SelectedValue.ToEntero() <= 0 And UsuarioActual.Empresa.Funcionalidad(212).ToEntero() > 0 Then - BtnActivaRegistroAnticipos.Visible = True - End If - - 'Ret IVA - If DdlCtaContableRetIVA.SelectedValue.ToEntero() <= 0 And UsuarioActual.Empresa.Funcionalidad(213).ToEntero() > 0 Then - BtnActivaRegistroIVA.Visible = True - End If - - 'Ret ISR - If DdlCtaContableRetISR.SelectedValue.ToEntero() <= 0 And UsuarioActual.Empresa.Funcionalidad(214).ToEntero() > 0 Then - BtnActivaRegistroISR.Visible = True - End If - - End Sub + End Function + + #End Region - + #Region " I M P R I M I R P D F" - + Protected Sub ChkAntIXCNC_CheckedChanged(sender As Object, e As EventArgs) DdlTipoDocto.ClearSelection() If ChkAntIXCNC.Checked Then @@ -9411,15 +9336,10 @@ Partial Class Clientes Row("Descuento") = Math.Round(Descuento, NumeroDecimales) Row("TipoDescuento") = 0 Row("Total") = (Cantidad * PU) - Row("TotalImporte") = Math.Round(Cantidad * PU, NumeroDecimales) - 'Row("AsientoContableVentas") = DrPS("AsientoContableVentas") - ' Row("IdCtaContVentas") = IdCtaContable - ' Row("AplicaParaConcepto") = AplicaParaConcepto - + Row("TotalImporte") = Math.Round(Cantidad * PU, NumeroDecimales) Row("SATClaveProdServ") = DrPS("SATClavePS") Row("SATClaveUM") = DrPS("SATClaveUnidadMedida") - Row("EntregaDirecta") = EntregaDirecta 'Contratos Row("CveContratoDetalle") = CveContratoDetalle @@ -10421,9 +10341,7 @@ Partial Class Clientes Alert("Vendedor Cambiado Correctamente.", TipoMensaje.MsgInformacion, $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={CveCliente}""") End If - End Sub - - + End Sub Private Sub MuestraOcultaGenero() DvGenero.Visible = False diff --git a/Ventas/ClientesAbonar.aspx b/Ventas/ClientesAbonar.aspx index 429225312..afddeab53 100644 --- a/Ventas/ClientesAbonar.aspx +++ b/Ventas/ClientesAbonar.aspx @@ -15,14 +15,9 @@
  • Saldar Cuentas Incobrables
  • - <%--
  • - Vincular Intermediario -
  • --%> -
  • Cargar Layout
  • -
    @@ -47,7 +42,7 @@ Banco   Ingresos x Comprobar - Pago Intermediario + <%-- Pago Intermediario--%>
    @@ -264,7 +259,7 @@
    -
    +
    Vinculación de intermediarios @@ -297,7 +292,6 @@ -
    @@ -305,7 +299,7 @@ -
    +
    diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index e0b7474a8..1f6399768 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -189,9 +189,9 @@ Partial Class Ventas_ClientesAbonar Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, Now.Day - 1, Now.Day) Fecha = (dia.ToString + "/" + Now.Month.ToString + "/" + Now.Year.ToString).ToDate - If UsuarioActual.Empresa.Funcionalidad(712) = "1" Then - PorletIntermediario.Visible = True - End If + 'If UsuarioActual.Empresa.Funcionalidad(712) = "1" Then + ' PorletIntermediario.Visible = True + 'End If If CargaCliente(CveCliente, CveMonedaFiltro) Then @@ -441,10 +441,8 @@ Partial Class Ventas_ClientesAbonar Else TxtFolio.Text = "" - End If - End Sub Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged @@ -489,9 +487,6 @@ Partial Class Ventas_ClientesAbonar e.Row.Cells(6).Width = Unit.Pixel(50) e.Row.Cells(7).Width = Unit.Pixel(70) e.Row.Cells(8).Width = Unit.Pixel(50) - 'e.Row.Cells(9).Width = Unit.Pixel(90) - 'e.Row.Cells(10).Width = Unit.Pixel(80) - 'e.Row.Cells(11).Width = Unit.Pixel(60) End If e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Right @@ -920,21 +915,6 @@ Partial Class Ventas_ClientesAbonar If gvr.FCTextBox("TxtComision").Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = gvr.FCTextBox("TxtComision").Text.ToDecimal * If(Pago.CveMonedaPago = VentaActual.CveMoneda, 1, Pago.TCPago) - 'If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119, 158) Then - ' EsAnticipoEspecial = True - ' Pago.AplicaTraslado = False - ' Dim IdCtaContable As Integer = If(EsAnticipoEspecial, IdCtaAnticipo, IdCuentaCliente) - ' If VentaActual.CveMoneda = 2 Then IdCtaContable = If(EsAnticipoEspecial, IdCtaContMonedaExtranjeraAnticipo, IdCtaContMonedaExtranjera) - - ' If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 3, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then - ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, Pago.ImportePago, 95, VentaActual.SerieFolio, VentaActual.SerieFolio, IdCtaContable, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=TipoCambioGeneral, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, Contabilizable:=False) Then - ' MsgError = "No se pudo insertar la póliza" - ' End If - ' Else - ' MsgError = "No se pudo insertar la póliza" - ' End If - 'End If - If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso MsgError = "" Then '' si es empresa agrícola Dim FluctuacionAnticipo As Decimal = 0 Dim ImporteLiq1 As Decimal = gvr.FCTextBox("TxtLiqCol1").Text.ToDecimal @@ -1079,15 +1059,14 @@ Partial Class Ventas_ClientesAbonar End If ' Case 134 'Pago Intermediario - If RblTipoPago.SelectedValue = "2" Then - Dim ImporteMovimiento As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - gvr.FCTextBox("TxtComision").Text.ToDecimal - Dim ImporteMN As Decimal = (ImporteMovimiento * tipoCambioPago).RoundSQL - Dim IdCtaContable As Integer = 0 + 'If RblTipoPago.SelectedValue = "2" Then + ' Dim ImporteMovimiento As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal - gvr.FCTextBox("TxtComision").Text.ToDecimal + ' Dim ImporteMN As Decimal = (ImporteMovimiento * tipoCambioPago).RoundSQL - If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 134, VentaActual.SerieFolio, VentaActual.SerieFolio, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero) Then - MsgError = "No se pudo insertar la póliza" - End If - End If + ' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 134, VentaActual.SerieFolio, VentaActual.SerieFolio, 0, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoContabilizar, CveProveedor:=DdlProveedorPagoInt.SelectedValue.ToEntero) Then + ' MsgError = "No se pudo insertar la póliza" + ' End If + 'End If 'PARA EMITIR COMPLEMENTO PAGO CveVentasPago.Add(gvr.DataKey("CveVenta").ToEntero) @@ -1924,7 +1903,6 @@ Partial Class Ventas_ClientesAbonar TmpDT.Columns.Add("Total", GetType(Decimal)) 'Para uso del módulo contable TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer)) - TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer)) TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean)) TmpDT.Columns.Add("CveProyecto", GetType(Integer)) TmpDT.Columns.Add("Proyecto", GetType(String)) diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 1b1b48cfc..efaae63ff 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -832,7 +832,7 @@
    - + @@ -1752,7 +1752,7 @@ - + @@ -4369,7 +4369,7 @@
    + DataKeyNames="ISTotal,Saldo,CveIE,Folio,Tipo,CveVenta,CveConceptoContable,CveConceptoContableAmor, TotalAnticipo, SubTotalAnticipo, IVAAnticipo,IEPS, ImpuestosLocalesAnticipo, SubTotalAmortizacion, SubTotal, Original, IVA, RetIVA, RetISR, FolioFiscal, CveClasificacionNC, TipoCambio,TipoCambioPago,TipoCambioHoy, CveMoneda,Fecha,SaldoSubTotal,SaldoConImpuestos,RegresarImpuesto,DevolucionImportePagado,CveCliente,Descuentos"> @@ -4495,7 +4495,7 @@