+
diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb
index 8dad34b1f..66b751121 100644
--- a/AF/AF.aspx.vb
+++ b/AF/AF.aspx.vb
@@ -245,6 +245,44 @@ Partial Class AF_AF
#End Region
+
+ Private Property CveProduccion As Integer
+ Get
+ If ViewState("CveProduccion") Is Nothing Then
+ ViewState("CveProduccion") = -1
+ End If
+ Return ViewState("CveProduccion").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CveProduccion") = value
+ End Set
+ End Property
+
+ Private Property CveMantenimiento As Integer
+ Get
+ If ViewState("CveMantenimiento") Is Nothing Then
+ ViewState("CveMantenimiento") = -1
+ End If
+ Return ViewState("CveMantenimiento").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CveMantenimiento") = value
+ End Set
+ End Property
+
+
+ Private Property CvePlagaEnfermedad As Integer
+ Get
+ If ViewState("CvePlagaEnfermedad") Is Nothing Then
+ ViewState("CvePlagaEnfermedad") = -1
+ End If
+ Return ViewState("CvePlagaEnfermedad").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CvePlagaEnfermedad") = value
+ End Set
+ End Property
+
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -260,9 +298,12 @@ Partial Class AF_AF
ViewState("CveActivoFijo") = Request("CveActivoFijo")
CargaDatos()
CargaEventos()
- CargaActividades()
-
- 'Configuración de Modalidad Update
+ CargaActividades()
+ CargaProduccion()
+ CargaMantenimento()
+ CargaPlagaEnfermedad()
+
+ 'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Activo Fijo:"
@@ -271,8 +312,9 @@ Partial Class AF_AF
HlEvento.NavigateUrl = String.Format("/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveActivoFijo=" & CveActivoFijo & "&TB_iframe=true&height=370&width=600;")
Else
ViewState("CveActivoFijo") = -1
- CargaCombos()
- 'Configuración de Modalidad Insert
+ CargaCombos()
+
+ 'Configuración de Modalidad Insert
ImgAddObs.Visible = False
LblFechaCaptura.Text = Now.ToShortDateString()
LblUsuarioCapturo.Text = UsuarioActual.Usuario
@@ -288,6 +330,13 @@ Partial Class AF_AF
CargaAFInv()
cargaOrdenesdeservicio()
+
+
+
+ If Request("Op") IsNot Nothing Then
+ ModalidadesPaginaAF(Request("Op").ToString)
+ End If
+
End If
End Sub
Private Sub cargaOrdenesdeservicio()
@@ -373,6 +422,20 @@ Partial Class AF_AF
CveEmpresaActual = UsuarioActual.CveEmpresa
End Sub
+ Private Sub ModalidadesPaginaAF(Op As String)
+
+ Select Case Op
+ Case "AR" 'Arbol Frutal etc
+ LblFechaCompra.Text = "Fecha de Nacimiento"
+ LblFechaBaja.Text = "Fecha de Muerte"
+ TabProduccion.Visible = True
+ Exit Select
+ Case Else
+ Exit Select
+ End Select
+
+
+ End Sub
#Region " CARGA COMBOS "
Private Sub CargaCombos()
@@ -398,6 +461,8 @@ Partial Class AF_AF
DdlResponsable.Enabled = False
End If
+ CargaCultivos()
+
End Sub
Private Sub CargaTipoActivoFijo()
DdlTipoActivoFijo.DataSource = GlobalDTTipoActivoFijo(CveEmpresaActual).FiltraParametros("", "TipoActivoFijo")
@@ -476,6 +541,11 @@ Partial Class AF_AF
' DdlClientes.DataBind()
'End Sub
+ Private Sub CargaCultivos()
+ DdlModalCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
+ DdlModalCultivosCuadro.DataBind()
+ DdlModalCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
+ End Sub
Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged
CargaSubProyecto()
End Sub
@@ -562,6 +632,13 @@ Partial Class AF_AF
DdlModelos.DataBind()
DdlModelos.Items.Insert(0, New ListItem("-", "-1"))
End Sub
+
+ Private Sub CargaProduccionCuadros()
+ DdlModalCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
+ DdlModalCultivosCuadro.DataBind()
+ DdlModalCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
+ End Sub
+
#End Region
Private Sub CargaDatos()
@@ -579,7 +656,13 @@ Partial Class AF_AF
TxtDescripcion.Text = ObjActivoFijo.Descripcion
TxtCodigo.Text = ObjActivoFijo.Codigo
TxtValorCompra.Text = ObjActivoFijo.ValorCompra.ToString.FormatoNumero
- TxtFechaCompra.Text = ObjActivoFijo.FechaCompra.ToShortDateString
+ TxtFechaCompra.Text = ObjActivoFijo.FechaCompra.ToShortDateString
+
+
+
+ TxtFechaBaja.Text = If(ObjActivoFijo.FechaBaja = New Date(1900, 1, 1), "", ObjActivoFijo.FechaBaja.ToString("dd/MM/yyyy"))
+
+
DdlTipoActivoFijo.SelectedValue = ObjActivoFijo.CveTipoActivoFijo.ToString
CargaSubTipoActivoFijo()
DdlSubTipoActivoFijo.SelectedValue = ObjActivoFijo.CveSubTipoActivoFijo.ToString
@@ -654,8 +737,8 @@ Partial Class AF_AF
CargaPlacas()
CargaLicencias()
- CargaSeguros()
- CargaServicios()
+ CargaSeguros()
+
CargaFallas()
CargaAccidentes()
@@ -1062,31 +1145,22 @@ Partial Class AF_AF
#End Region
#Region "S E R V I C I O S - M A N T E M I E N T O"
- Public Sub CargaServicios()
- Dim TmpServicios As New DataTable
- TmpServicios.Columns.Add("CveProveedor", GetType(Integer))
- TmpServicios.Columns.Add("CveCompra", GetType(Integer))
- TmpServicios.Columns.Add("Tipo", GetType(String))
- TmpServicios.Columns.Add("Fecha", GetType(Date))
- TmpServicios.Columns.Add("Proveedor", GetType(String))
- TmpServicios.Columns.Add("Factura", GetType(String))
- TmpServicios.Columns.Add("OdHorometro", GetType(Double))
- TmpServicios.Columns.Add("Observaciones", GetType(String))
-
- 'Dim Row As DataRow = TmpServicios.NewRow
- 'Row("CveProveedor") = 3100
- 'Row("CveCompra") = 181656
- 'Row("Tipo") = "Preventivo"
- 'Row("Fecha") = "01/02/2016"
- 'Row("Proveedor") = "EMPRESAS MATCO, S.A. DE C.V."
- 'Row("Factura") = "HERAA-158591"
- 'Row("OdHorometro") = "198,567"
- 'Row("Observaciones") = "Servicio Preventivo 200,000 Kilometros - Servicio Completo"
- 'TmpServicios.Rows.Add(Row)
-
- GvServiciosMant.DataSource = TmpServicios
- GvServiciosMant.DataBind()
- End Sub
+ 'Public Sub CargaServicios()
+ ' Dim TmpServicios As New DataTable
+ ' TmpServicios.Columns.Add("CveProveedor", GetType(Integer))
+ ' TmpServicios.Columns.Add("CveCompra", GetType(Integer))
+ ' TmpServicios.Columns.Add("Tipo", GetType(String))
+ ' TmpServicios.Columns.Add("Fecha", GetType(Date))
+ ' TmpServicios.Columns.Add("Proveedor", GetType(String))
+ ' TmpServicios.Columns.Add("Factura", GetType(String))
+ ' TmpServicios.Columns.Add("OdHorometro", GetType(Double))
+ ' TmpServicios.Columns.Add("Observaciones", GetType(String))
+
+
+
+ ' GvServiciosMant.DataSource = TmpServicios
+ ' GvServiciosMant.DataBind()
+ 'End Sub
#End Region
#Region "F A L L A S"
@@ -2106,6 +2180,8 @@ Partial Class AF_AF
Dim ObjContabilidad As New ClsContabilidad(ObjAF.IniciaTransacSQL())
Dim ErrorGuardar As Boolean = False
+ Dim FechaBaja As Date = If(TxtFechaBaja.Text = "", MinFecha, TxtFechaBaja.Text.ToDate)
+
If CveActivoFijo <= 0 Then
'SALIDA DE ALMACEN PARA IMPORTACION
@@ -2123,12 +2199,15 @@ Partial Class AF_AF
End If
+
+
If Not ErrorGuardar Then
If ObjAF.AddActivosFijos(TxtCodigo.Text.Trim, TxtDescripcion.Text.Trim, TxtValorCompra.Text.Trim.ToDouble, TxtFechaCompra.Text.Trim.ToDate, DdlSubTipoActivoFijo.SelectedValue.ToEntero,
DdlResponsable.SelectedValue.ToEntero, TxtNoSerie.Text.Trim, TxtAño.Text.Trim.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.Trim.ToEntero,
DdlEstadoActivoFijo.SelectedValue.ToEntero, DdlCtaContableDepreciacion.SelectedValue.ToEntero, TxtPorDepreciacion.Text.Trim.ToDouble,
- TxtObservaciones.Text.Trim, DdlClientes.SelectedValue.ToEntero, CveMovimientoSalidaInv, UsuarioActual.CveUsuario, CveEmpresaActual, CveMarca:=DdlMarcas.SelectedValue.ToEntero,
- CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero) > 0 Then
+ TxtObservaciones.Text.Trim, Ddlclientes.SelectedValue.ToEntero, CveMovimientoSalidaInv, UsuarioActual.CveUsuario, CveEmpresaActual, CveMarca:=DdlMarcas.SelectedValue.ToEntero,
+ CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero,
+ FechaBaja:=FechaBaja) > 0 Then
ViewState("CveActivoFijo") = ObjAF.CveActivoFijo
Else
ErrorGuardar = True
@@ -2155,8 +2234,9 @@ Partial Class AF_AF
If Not ObjAF.UpdateActivosFijos(CveActivoFijo.ToString.ToEntero, TxtCodigo.Text.Trim, TxtDescripcion.Text.Trim, TxtValorCompra.Text.Trim.ToDouble, TxtFechaCompra.Text.Trim.ToDate, DdlSubTipoActivoFijo.SelectedValue.ToEntero,
DdlResponsable.SelectedValue.ToEntero, TxtNoSerie.Text.Trim, TxtAño.Text.Trim.ToEntero,
DdlSubProyecto.SelectedValue.ToEntero, DdlCtaContable.SelectedValue.Trim.ToEntero, DdlEstadoActivoFijo.SelectedValue.ToEntero, DdlCtaContableDepreciacion.SelectedValue.ToEntero,
- TxtPorDepreciacion.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, DdlClientes.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveEmpresaActual,
- CveMarca:=DdlMarcas.SelectedValue.ToEntero, CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero) Then
+ TxtPorDepreciacion.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, Ddlclientes.SelectedValue.ToEntero, UsuarioActual.CveUsuario, CveEmpresaActual,
+ CveMarca:=DdlMarcas.SelectedValue.ToEntero, CveModelo:=DdlModelos.SelectedValue.ToEntero, CveGrupo:=DdlGrupo.SelectedValue.ToEntero, CveAFPadre:=DdlAFPadres.SelectedValue.ToEntero, CveDispositivo:=DdlDispositivo.SelectedValue.ToEntero,
+ FechaBaja:=FechaBaja) Then
'Comentado porque te redirecciona no se ocupa - 22 Enero 2016 - Israel Piña
'CargaDatos()
@@ -3097,7 +3177,8 @@ Partial Class AF_AF
TxtDescripcion.Text = DdlAFInvPS.SelectedText
TxtValorCompra.Text = Costo.FormatoNumero
- TxtFechaCompra.Text = Now.ToShortDateString
+ TxtFechaCompra.Text = Now.ToShortDateString
+ TxtFechaBaja.Text = ""
TxtNoSerie.Text = TxtAFInvSerie.Text.Trim
TxtValorCompra.Enabled = False
@@ -3727,5 +3808,491 @@ Partial Class AF_AF
ImprimirPDF("Empresas/Grales/Formatos/RepComprasInsumos.rdlc", DTCompras, params, "RepComprasInsumos", Formato)
- End Sub
+ End Sub
+
+
+#Region "Produccion"
+
+
+
+ Private Sub CargaProduccion()
+
+ Dim ObjAF As New ClsAF
+
+ If ObjAF.GetProduccion(CveActivoFijo, UsuarioActual.CveEmpresa) Then
+ GvProduccion.DataSource = ObjAF.DtResultados
+ Else
+ GvProduccion.DataSource = Nothing
+ End If
+
+ ObjAF.Dispose()
+ GvProduccion.DataBind()
+
+ UpProduccion.Update()
+
+ End Sub
+
+
+ Protected Sub LnkAgregarProduccion_Click(sender As Object, e As EventArgs)
+
+ LblModaProduccionTitulo.Text = "Agregar Producción"
+ LnkModalAgregarProduccion.Text = "Agregar"
+ CveProduccion = -1
+
+ DdlModalCultivosCuadro.SelectedValueExist(-1)
+ TxtModalProduccionCantidad.Text = ""
+ TxtModalProduccionFecha.Text = ""
+
+ RegistraScript("$('#DVModalProduccion').modal('show');")
+
+ UpModalProduccion.Update()
+ End Sub
+
+ Protected Sub LnkGvProduccionEdit_Click(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ CveProduccion = GvRow.DataKey("CveProduccion").ToEntero
+ Dim CveCultivoCuadroDetalle As Integer = GvRow.DataKey("CveCultivoCuadroDetalle").ToEntero
+ Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
+ Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate
+
+ DdlModalCultivosCuadro.SelectedValueExist(CveCultivoCuadroDetalle)
+ TxtModalProduccionCantidad.Text = Cantidad.ToString("###,###,###.00")
+ TxtModalProduccionFecha.Text = Fecha.ToString("dd/MM/yyyy")
+
+
+ LblModaProduccionTitulo.Text = "Actualizar Producción"
+ LnkModalAgregarProduccion.Text = "Actualizar"
+
+ UpModalProduccion.Update()
+
+
+ RegistraScript("$('#DVModalProduccion').modal('show');")
+ End Sub
+
+ Protected Sub LnkGvProduccionRemove_Click(sender As Object, e As EventArgs)
+
+ Dim ErrorProceso As Boolean = False
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim CveProduccionEliminar As Integer = GvRow.DataKey("CveProduccion").ToEntero
+
+ Dim ObjAF As New ClsAF
+
+ If ObjAF.RemoveProduccion(CveProduccionEliminar, UsuarioActual.CveEmpresa) Then
+ ErrorProceso = False
+ Else
+ ErrorProceso = True
+ End If
+
+
+ ObjAF.Dispose()
+
+
+ If Not ErrorProceso Then
+ Alert("Producción Eliminada Correctamente.")
+ CargaProduccion()
+ End If
+
+ End Sub
+
+
+
+ Protected Sub LnkModalAgregarProduccion_Click(sender As Object, e As EventArgs)
+ Dim ErrorProceso As Boolean = False
+ Dim ObjAF As New ClsAF
+
+ If CveProduccion > 0 Then
+ If ObjAF.UpdateProduccion(CveProduccion, CveActivoFijo, DdlModalCultivosCuadro.SelectedValue.ToEntero, TxtModalProduccionCantidad.Text.ToDecimal, TxtModalProduccionFecha.Text.ToDate, UsuarioActual.CveUsuario) Then
+ ErrorProceso = False
+ Else
+ ErrorProceso = True
+ End If
+ Else
+ If ObjAF.AddProduccion(CveActivoFijo, DdlModalCultivosCuadro.SelectedValue.ToEntero, TxtModalProduccionCantidad.Text.ToDecimal, TxtModalProduccionFecha.Text.ToDate, UsuarioActual.CveUsuario) Then
+ ErrorProceso = False
+ Else
+ ErrorProceso = True
+ End If
+ End If
+
+
+
+ ObjAF.Dispose()
+
+ If Not ErrorProceso Then
+ RegistraScript("$('#DVModalMantenimiento').modal('hide');")
+ Alert("Producción Agregada Correctamente.")
+ CargaProduccion()
+ End If
+
+ End Sub
+
+#End Region
+
+#Region "MANTENIMIENTO"
+
+
+
+
+ Private Sub CargaMantenimento()
+
+ Dim ObjAF As New ClsAF
+
+ If ObjAF.GetMantenimientos(CveActivoFijo, UsuarioActual.CveEmpresa) Then
+ GvMantenimientos.DataSource = ObjAF.DtResultados
+ Else
+ GvMantenimientos.DataSource = Nothing
+ End If
+
+ ObjAF.Dispose()
+ GvMantenimientos.DataBind()
+
+ UpMantenimientos.Update()
+
+ End Sub
+
+
+ Protected Sub LnkAgregarMantenimiento_Click(sender As Object, e As EventArgs)
+
+ LblModaMantenimientoTitulo.Text = "Agregar Mantenimiento"
+ LnkModalAgregarMantenimiento.Text = "Agregar"
+
+ CveMantenimiento = -1
+
+ TxtModalMantenimiento.Text = ""
+ TxtModalMantenimientoObservaciones.Text = ""
+ TxtModalMantenimientoFecha.Text = ""
+ TxtArchivoMantenimiento.Text = "[]"
+
+ RegistraScript("$('#DVModalMantenimiento').modal('show');")
+
+ UpModalMantenimiento.Update()
+ End Sub
+
+ Protected Sub LnkGvMantenimientoEdit_Click(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ 'CveMantenimiento, CveActivoFijo, Mantenimiento, Observaciones, Fecha, FechaIng, CveUsuario, Codigo, Descripcion, Usuario
+
+ CveMantenimiento = GvRow.DataKey("CveMantenimiento").ToEntero
+
+ Dim Mantenimiento As String = GvRow.DataKey("Mantenimiento")
+ Dim Observaciones As String = GvRow.DataKey("Observaciones")
+ Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate
+
+ TxtModalMantenimiento.Text = Mantenimiento
+ TxtModalMantenimientoObservaciones.Text = Observaciones
+ TxtModalMantenimientoFecha.Text = Fecha.ToString("dd/MM/yyyy")
+ TxtArchivoMantenimiento.Text = "[]"
+
+
+ LblModaMantenimientoTitulo.Text = "Actualizar Mantenimiento"
+ LnkModalAgregarMantenimiento.Text = "Actualizar"
+
+ UpModalMantenimiento.Update()
+
+
+ RegistraScript("$('#DVModalMantenimiento').modal('show');")
+ End Sub
+
+ Protected Sub LnkGvMantenimientoRemove_Click(sender As Object, e As EventArgs)
+
+ Dim ErrorProceso As Boolean = False
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim CveMantenimientoEliminar As Integer = GvRow.DataKey("CveMantenimiento").ToEntero
+
+ Dim ObjAF As New ClsAF
+
+ If ObjAF.RemoveMantenimientos(CveMantenimientoEliminar, UsuarioActual.CveEmpresa) Then
+ ErrorProceso = False
+ Else
+ ErrorProceso = True
+ End If
+
+
+ ObjAF.Dispose()
+
+
+ If Not ErrorProceso Then
+ Alert("Mantenimiento Eliminado Correctamente.")
+ CargaMantenimento()
+ End If
+
+ End Sub
+
+
+
+ Protected Sub LnkModalAgregarMantenimiento_Click(sender As Object, e As EventArgs)
+ Dim ErrorProceso As Boolean = False
+ Dim ObjAF As New ClsAF
+ ObjAF.IniciaTransacSQL()
+
+
+ If CveMantenimiento > 0 Then
+
+ Dim FileExtension As String = ""
+ Dim Filesgral As List(Of Archivo) = TxtArchivoMantenimiento.getfiles().Archivos
+ Dim Filename As String = "-1"
+
+ If Filesgral.Count > 0 Then
+
+ For Each fileItem As Archivo In Filesgral
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ Filename = fileItem.filename
+ Exit For
+ Next
+
+ Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Mantenimientos\{1}", UsuarioActual.Empresa.Ruta, $"{CveMantenimiento}.{FileExtension}"))
+ If Archivo.Exists() Then
+ Archivo.Delete()
+ End If
+
+
+ If Not Filename.FilesMove(String.Format("{0}", CveMantenimiento.ToString), String.Format("{0}AF\Mantenimientos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then
+ ErrorProceso = True
+ Alert("Error al mover Archivo", TipoMensaje.MsgError)
+ End If
+
+ End If
+
+ If Not ErrorProceso Then
+ If Not ObjAF.UpdateMantenimientos(CveMantenimiento, CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, $"{CveMantenimiento}.{FileExtension}") Then
+ ErrorProceso = True
+ End If
+ End If
+
+
+ Else
+
+
+ Dim CveMantenimientoTemp As Integer = -1
+
+
+ CveMantenimientoTemp = ObjAF.AddMantenimientos(CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, "-1")
+ If CveMantenimientoTemp > 0 Then
+ ErrorProceso = False
+ Else
+ ErrorProceso = True
+ End If
+
+ If Not ErrorProceso Then
+
+ Dim FileExtension As String = ""
+ Dim Filesgral As List(Of Archivo) = TxtArchivoMantenimiento.getfiles().Archivos
+ Dim Filename As String = ""
+
+ If Filesgral.Count > 0 Then
+
+ For Each fileItem As Archivo In Filesgral
+ FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
+ Filename = fileItem.filename
+ Exit For
+ Next
+
+ Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Mantenimientos\{1}", UsuarioActual.Empresa.Ruta, $"{CveMantenimientoTemp}.{FileExtension}"))
+ If Archivo.Exists() Then
+ Archivo.Delete()
+ End If
+
+
+ If Not Filename.FilesMove(String.Format("{0}", CveMantenimientoTemp.ToString), String.Format("{0}AF\Mantenimientos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then
+ ErrorProceso = True
+ Alert("Error al mover Archivo", TipoMensaje.MsgError)
+ End If
+
+ If Not ErrorProceso Then
+ If Not ObjAF.UpdateMantenimientos(CveMantenimientoTemp, CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, $"{CveMantenimientoTemp}.{FileExtension}") Then
+ ErrorProceso = True
+ End If
+ End If
+
+
+ End If
+
+
+ End If
+
+
+ End If
+
+
+
+
+
+
+ If Not ErrorProceso Then
+ ObjAF.Commit()
+ ObjAF.Dispose()
+
+ RegistraScript("$('#DVModalMantenimiento').modal('hide');")
+ Alert("Mantenimiento Guardado Correctamente.")
+ CargaMantenimento()
+ Else
+ ObjAF.RollBack()
+ ObjAF.Dispose()
+ End If
+
+ End Sub
+
+ Protected Sub LnkDescargaArcgivo_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim Archivo As String = GvRow.DataKey("Archivo")
+ Dim InfArchivo As New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}")
+
+ If InfArchivo.Exists Then
+ Response.Clear()
+ Response.AppendHeader("Content-Disposition", "attachment; filename=" + InfArchivo.Name)
+ Response.AppendHeader("Content-Length", InfArchivo.Length.ToString())
+ Response.ContentType = "application/octet-stream"
+ Response.WriteFile(InfArchivo.FullName)
+
+ Response.End()
+ End If
+
+
+
+ End Sub
+
+ Protected Sub GvMantenimientos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ Dim Archivo As String = e.Row.DataKey("Archivo")
+ Dim InfArchivo As New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}")
+
+ If InfArchivo.Exists Then
+ e.Row.FCLinkButton("LnkDescargaArcgivo").Visible = True
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LnkDescargaArcgivo"))
+ End If
+
+ End If
+
+ End Sub
+
+#End Region
+
+
+#Region "PLAGA ENFERMEDAD"
+
+
+
+ Private Sub CargaPlagaEnfermedad()
+
+ Dim ObjAF As New ClsAF
+
+ If ObjAF.GetPlagaEnfermedad(CveActivoFijo, UsuarioActual.CveEmpresa) Then
+ GvPlagaEnfermedad.DataSource = ObjAF.DtResultados
+ Else
+ GvPlagaEnfermedad.DataSource = Nothing
+ End If
+
+ ObjAF.Dispose()
+ GvPlagaEnfermedad.DataBind()
+
+ UpPlagaEnfermedad.Update()
+
+ End Sub
+
+
+ Protected Sub LnkAgregarPlagaEnfermedad_Click(sender As Object, e As EventArgs)
+
+ LblModalTituloPlagaEnfermedad.Text = "Agregar Plaga Enfermedad"
+ LnkModalAgregarProduccion.Text = "Agregar"
+
+ CvePlagaEnfermedad = -1
+
+ TxtModalPlagaEnfermedadObservaciones.Text = ""
+ TxtModalPlagaEnfermedadFecha.Text = ""
+
+ RegistraScript("$('#DVModalPlagaEnfermedad').modal('show');")
+
+ UpModalPlagaEnfermedad.Update()
+ End Sub
+
+ Protected Sub LnkGvPlagaEnfermedadEdit_Click(sender As Object, e As EventArgs)
+
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+ CvePlagaEnfermedad = GvRow.DataKey("CvePlagaEnfermedad").ToEntero
+
+ Dim Observaciones As String = GvRow.DataKey("Observaciones")
+ Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate
+
+
+ TxtModalPlagaEnfermedadObservaciones.Text = Observaciones
+ TxtModalPlagaEnfermedadFecha.Text = Fecha.ToString("dd/MM/yyyy")
+
+
+ LblModalTituloPlagaEnfermedad.Text = "Actualizar plaga enfermedad"
+ LnkModalAgregarPlagaEnfermedad.Text = "Actualizar"
+
+ UpModalPlagaEnfermedad.Update()
+
+
+ RegistraScript("$('#DVModalPlagaEnfermedad').modal('show');")
+ End Sub
+
+ Protected Sub LnkGvPlagaEnfermedadRemove_Click(sender As Object, e As EventArgs)
+
+ Dim ErrorProceso As Boolean = False
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim CvePlagaEnfermedadEliminar As Integer = GvRow.DataKey("CvePlagaEnfermedad").ToEntero
+
+ Dim ObjAF As New ClsAF
+
+ If ObjAF.RemovePlagaEnfermedad(CvePlagaEnfermedadEliminar, UsuarioActual.CveEmpresa) Then
+ ErrorProceso = False
+ Else
+ ErrorProceso = True
+ End If
+
+
+ ObjAF.Dispose()
+
+
+ If Not ErrorProceso Then
+ Alert("Plaga Enfermedad Eliminada Correctamente.")
+ CargaPlagaEnfermedad()
+ End If
+
+ End Sub
+
+
+
+ Protected Sub LnkModalAgregarPlagaEnfermedad_Click(sender As Object, e As EventArgs)
+ Dim ErrorProceso As Boolean = False
+ Dim ObjAF As New ClsAF
+
+ If CvePlagaEnfermedad > 0 Then
+ If ObjAF.UpdatePlagaEnfermedad(CvePlagaEnfermedad, CveActivoFijo, TxtModalPlagaEnfermedadObservaciones.Text, TxtModalPlagaEnfermedadFecha.Text.ToDate, UsuarioActual.CveUsuario) Then
+ ErrorProceso = False
+ Else
+ ErrorProceso = True
+ End If
+ Else
+ If ObjAF.AddPlagaEnfermedad(CveActivoFijo, TxtModalPlagaEnfermedadObservaciones.Text, TxtModalPlagaEnfermedadFecha.Text.ToDate, UsuarioActual.CveUsuario) Then
+ ErrorProceso = False
+ Else
+ ErrorProceso = True
+ End If
+ End If
+
+
+
+ ObjAF.Dispose()
+
+ If Not ErrorProceso Then
+ RegistraScript("$('#DVModalPlagaEnfermedad').modal('hide');")
+ Alert("Plaga Enfermedad guardada Correctamente.")
+ CargaPlagaEnfermedad()
+ End If
+
+ End Sub
+
+#End Region
+
+
+
+
End Class
\ No newline at end of file
diff --git a/Acumuladores/RepPolizasVirtuales.aspx b/Acumuladores/RepPolizasVirtuales.aspx
index 12906ffc6..845677f19 100644
--- a/Acumuladores/RepPolizasVirtuales.aspx
+++ b/Acumuladores/RepPolizasVirtuales.aspx
@@ -44,10 +44,7 @@
diff --git a/Acumuladores/RepPolizasVirtuales.aspx.vb b/Acumuladores/RepPolizasVirtuales.aspx.vb
index bcc51a9dd..4ce6c4895 100644
--- a/Acumuladores/RepPolizasVirtuales.aspx.vb
+++ b/Acumuladores/RepPolizasVirtuales.aspx.vb
@@ -3,8 +3,6 @@ Imports Extensiones
Partial Class Acumuladores_RepPolizasVirtuales
Inherits ClsPaginas
-
-
Private Sub Acumuladores_RepPolizasVirtuales_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaCombos()
@@ -15,7 +13,7 @@ Partial Class Acumuladores_RepPolizasVirtuales
Private Sub CargaCombos()
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto:=LblSubProyecto)
-
+ txtFechaI.Text = DateTime.Now.FirstDayOfMonth.ToShortDateString()
End Sub
@@ -47,9 +45,6 @@ Partial Class Acumuladores_RepPolizasVirtuales
End Sub
-
-
-
Protected Sub BtnBuscar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb
index ad8c046c4..fd6191f40 100644
--- a/App_Code/ClsAF.vb
+++ b/App_Code/ClsAF.vb
@@ -47,6 +47,7 @@ Public Class ClsAF
Public Property CveCompra As Integer
Public Property ValorCompra As Double
Public Property FechaCompra As Date
+ Public Property FechaBaja As Date
Public Property CuentaInicial As Integer
Public Property CveTipoActivoFijo As Integer
Public Property TipoActivoFijo As String
@@ -230,6 +231,7 @@ Public Class ClsAF
Me.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero
Me.Usuario = Data.Rows(0)("Usuario").ToString
Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
+ Me.FechaBaja = Data.Rows(0)("FechaBaja").ToString.ToDate
End If
Retorno = True
Catch ex As Exception
@@ -344,6 +346,9 @@ Public Class ClsAF
Me.CveGrupoAF = Data.Rows(0)("CveGrupo").ToString.ToEntero
Me.CveAFPadre = Data.Rows(0)("CveAFPadre").ToString.ToEntero
Me.CveDispositivo = Data.Rows(0)("CveDispositivo").ToString.ToEntero
+ Me.FechaBaja = Data.Rows(0)("FechaBaja").ToString.ToDate
+
+
End If
Retorno = True
Catch ex As Exception
@@ -397,7 +402,7 @@ Public Class ClsAF
Public Function AddActivosFijos(Codigo As String, Descripcion As String, ValorCompra As Double, FechaCompra As Date, CveSubTipoActivoFijo As Integer, CvePersonalResponsable As Integer, NoSerie As String, Año As Integer,
CveSubProyecto As Integer, Cuenta As Integer, CveEstadoActivoFijo As Integer, IdCtaContDepreciacion As Integer, PorDepreciacion As Double, Observaciones As String, CveCliente As Integer,
CveMovimiento As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveModelo As Integer = -1, Optional CveGrupo As Integer = -1,
- Optional CveAFPadre As Integer = -1, Optional CveDispositivo As Integer = -1) As Integer
+ Optional CveAFPadre As Integer = -1, Optional CveDispositivo As Integer = -1, Optional FechaBaja As Date = MinFecha) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_AF_ActivosFijosAdd")
@@ -427,6 +432,7 @@ Public Class ClsAF
.Add("@CveGrupo", SqlDbType.Int).Value = CveGrupo
.Add("@CveAFPadre", SqlDbType.Int).Value = CveAFPadre
.Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo
+ .Add("@FechaBaja", SqlDbType.Date).Value = FechaBaja
.Add("@CveActivoFijo", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
@@ -458,7 +464,7 @@ Public Class ClsAF
CvePersonalResponsable As Integer, NoSerie As String, Año As Integer, CveSubProyecto As Integer, IdCtaContActivoFijo As Integer,
CveEstadoActivoFijo As Integer, IdCtaContDepreciacion As Integer, PorDepreciacion As Double, Observaciones As String, CveCliente As Integer,
CveUsuarioModifico As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1, Optional CveModelo As Integer = -1, Optional CveGrupo As Integer = -1,
- Optional CveAFPadre As Integer = -1, Optional CveDispositivo As Integer = -1) As Boolean
+ Optional CveAFPadre As Integer = -1, Optional CveDispositivo As Integer = -1, Optional FechaBaja As Date = MinFecha) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_AF_ActivosFijosUpdate")
@@ -490,6 +496,7 @@ Public Class ClsAF
.Add("@CveGrupo", SqlDbType.Int).Value = CveGrupo
.Add("@CveAFPadre", SqlDbType.Int).Value = CveAFPadre
.Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo
+ .Add("@FechaBaja", SqlDbType.Date).Value = FechaBaja
End With
Try
@@ -4514,6 +4521,339 @@ Public Class ClsAF
#End Region
+#Region " P R O D U C C C I Ó N "
+
+ Public Function AddProduccion(CveActivoFijo As Integer, CveCultivoCuadroDetalle As Integer, Cantidad As Decimal, Fecha As Date, CveUsuario As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_ProduccionAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
+ .Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
+ .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar la producción", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function UpdateProduccion(CveProduccion As Integer, CveActivoFijo As Integer, CveCultivoCuadroDetalle As Integer, Cantidad As Decimal, Fecha As Date, CveUsuario As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_ProduccionUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveProduccion", SqlDbType.Int).Value = CveProduccion
+ .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
+ .Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
+ .Add("@Cantidad", SqlDbType.Money).Value = Cantidad
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar la producción", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+
+ Public Function GetProduccion(CveActivoFijo As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_ProduccionGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
+ .Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al consultar la producción", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function RemoveProduccion(CveProduccion As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_ProduccionRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveProduccion", SqlDbType.Int).Value = CveProduccion
+ .Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar la producción", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+#End Region
+
+#Region " M A N T E N I M I E N T O S "
+
+
+ Public Function AddMantenimientos(CveActivoFijo As Integer, Mantenimiento As String, Observaciones As String, Fecha As Date, CveUsuario As Integer, Archivo As String) As Integer
+
+ Dim Retorno As Integer = -1
+
+ DataAdapter("PA_AF_MantenimientosAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
+ .Add("@Mantenimiento", SqlDbType.VarChar).Value = Mantenimiento
+ .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@Archivo", SqlDbType.VarChar).Value = Archivo
+ .Add("@CveMantenimiento", SqlDbType.Int).Direction = ParameterDirection.Output
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = SqlAdapter.SelectCommand.Parameters("@CveMantenimiento").Value.ToString.ToEntero
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar el mantenimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function UpdateMantenimientos(CveMantenimiento As Integer, CveActivoFijo As Integer, Mantenimiento As String, Observaciones As String, Fecha As Date, CveUsuario As Integer, Archivo As String) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_MantenimientosUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveMantenimiento", SqlDbType.Int).Value = CveMantenimiento
+ .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
+ .Add("@Mantenimiento", SqlDbType.VarChar).Value = Mantenimiento
+ .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@Archivo", SqlDbType.VarChar).Value = Archivo
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar el mantenimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+
+ Public Function GetMantenimientos(CveActivoFijo As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_MantenimientosGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
+ .Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al consultar los mantenimientos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function RemoveMantenimientos(CveMantenimiento As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_MantenimientosRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMantenimiento", SqlDbType.Int).Value = CveMantenimiento
+ .Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar el mantenimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+
+
+#End Region
+
+
+
+#Region " PLAGAS ENFERMEDADES "
+
+
+ Public Function AddPlagaEnfermedad(CveActivoFijo As Integer, Observaciones As String, Fecha As Date, CveUsuario As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_PlagaEnfermedadAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
+ .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agregar la enfermedad/plaga.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function UpdatePlagaEnfermedad(CvePlagaEnfermedad As Integer, CveActivoFijo As Integer, Observaciones As String, Fecha As Date, CveUsuario As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_PlagaEnfermedadUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CvePlagaEnfermedad", SqlDbType.Int).Value = CvePlagaEnfermedad
+ .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
+ .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
+ .Add("@Fecha", SqlDbType.Date).Value = Fecha
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al actualizar la enfermedad/plaga.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+
+ Public Function GetPlagaEnfermedad(CveActivoFijo As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_PlagaEnfermedadGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
+ .Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al consultar la enfermedad/plaga.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function RemovePlagaEnfermedad(CvePlagaEnfermedad As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+
+ DataAdapter("PA_AF_PlagaEnfermedadRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePlagaEnfermedad", SqlDbType.Int).Value = CvePlagaEnfermedad
+ .Add("@CveEmpresa", SqlDbType.VarChar).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar la enfermedad/plaga.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+
+ End Function
+
+
+
+#End Region
+
+
#Region " IDisposable Support "
' IDisposable
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index 55ee851fb..d416a98bb 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -141,6 +141,7 @@ Public Class ClsBancos
Public Property UsaLayoutGrupos As Boolean
Public Property UsaTarjeta As Boolean
+ Public Property TieneTerminal As Boolean
#End Region
@@ -428,6 +429,7 @@ Public Class ClsBancos
Me.UsaLayout = If(Data.Rows(0)("UsaLayout").ToString = "True", True, False)
Me.UsaLayoutGrupos = If(Data.Rows(0)("UsaLayoutGrupos").ToString = "True", True, False)
Me.UsaTarjeta = If(Data.Rows(0)("UsaTarjeta").ToString = "True", True, False)
+ Me.TieneTerminal = If(Data.Rows(0)("TieneTerminal").ToString = "True", True, False)
End If
@@ -462,7 +464,7 @@ Public Class ClsBancos
Public Function AddBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer,
LimiteCredito As Double, IdCtaContable As Integer, IdCtaContableComplementaria As Integer, FormatoCheque As String, CveUsuario As Integer, CveEmpresa As Integer, ConvenioPagoElectronico As String,
- UsaLayout As Boolean, UsaTarjeta As Boolean, Optional SaldoInicial As Double = 0, Optional UsaLayoutGrupos As Boolean = False) As Boolean
+ UsaLayout As Boolean, UsaTarjeta As Boolean, Optional SaldoInicial As Double = 0, Optional UsaLayoutGrupos As Boolean = False, Optional TieneTerminal As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Banc_BancosCuentasAdd")
@@ -489,6 +491,7 @@ Public Class ClsBancos
.Add("@UsaTarjeta", SqlDbType.Bit).Value = UsaTarjeta
.Add("@SaldoInicial", SqlDbType.Money).Value = SaldoInicial
.Add("@UsaLayoutGrupos", SqlDbType.Bit).Value = UsaLayoutGrupos
+ .Add("@TieneTerminal", SqlDbType.Bit).Value = TieneTerminal
@@ -513,7 +516,7 @@ Public Class ClsBancos
Public Function UpdateBancosCuentas(CveBanco As Integer, CveTipoCuenta As Integer, NumCuenta As String, CLABE As String, CveMoneda As Integer, DiaCorte As Integer, FInicial As Integer, FActual As Integer, FFinal As Integer,
LimiteCredito As Double, IdCtaContable As Integer, IdCtaContableComplementaria As Integer, FormatoCheque As String, Estatus As Boolean, CveCuenta As Integer, ConvenioPagoElectronico As String,
- UsaLayout As Boolean, UsaTarjeta As Boolean, Optional UsaLayoutGrupos As Boolean = False) As Boolean
+ UsaLayout As Boolean, UsaTarjeta As Boolean, Optional UsaLayoutGrupos As Boolean = False, Optional TieneTerminal As Boolean = False) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Banc_BancosCuentasUpdate")
@@ -538,6 +541,7 @@ Public Class ClsBancos
.Add("@UsaLayout", SqlDbType.Bit).Value = UsaLayout
.Add("@UsaTarjeta", SqlDbType.Bit).Value = UsaTarjeta
.Add("@UsaLayoutGrupos", SqlDbType.Bit).Value = UsaLayoutGrupos
+ .Add("@TieneTerminal", SqlDbType.Bit).Value = TieneTerminal
End With
diff --git a/App_Code/ClsCRM.vb b/App_Code/ClsCRM.vb
index cdad985da..b212c9403 100644
--- a/App_Code/ClsCRM.vb
+++ b/App_Code/ClsCRM.vb
@@ -130,7 +130,9 @@ Public Class ClsCRM
Return Retorno
End Function
- Public Function AddTipoProceso(TipoProceso As String, Descripcion As String, CveEmpresa As Integer, CveUsuarioIng As Integer) As Boolean
+ Public Function AddTipoProceso(TipoProceso As String, Descripcion As String, CveEmpresa As Integer, CveUsuarioIng As Integer,
+ RequiereMedioCaptacion As Boolean, RequiereImporte As Boolean, RequiereProbabilidadAcercamiento As Boolean,
+ RequierePS As Boolean, RequiereComision As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_CRM_TipoProcesoAdd")
With SqlAdapter.SelectCommand.Parameters
@@ -138,6 +140,11 @@ Public Class ClsCRM
.Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuarioIng", SqlDbType.Int).Value = CveUsuarioIng
+ .Add("@RequiereMedioCaptacion", SqlDbType.Bit).Value = RequiereMedioCaptacion
+ .Add("@RequiereImporte", SqlDbType.Bit).Value = RequiereImporte
+ .Add("@RequiereProbabilidadAcercamiento", SqlDbType.Bit).Value = RequiereProbabilidadAcercamiento
+ .Add("@RequierePS", SqlDbType.Bit).Value = RequierePS
+ .Add("@RequiereComision", SqlDbType.Bit).Value = RequiereComision
End With
Try
SqlAdapter.Fill(Data)
@@ -148,7 +155,9 @@ Public Class ClsCRM
Return Retorno
End Function
- Public Function UpdateTipoProceso(TipoProceso As String, Descripcion As String, CveEstatus As Boolean, CveTipoProceso As Integer) As Boolean
+ Public Function UpdateTipoProceso(TipoProceso As String, Descripcion As String, CveEstatus As Boolean, CveTipoProceso As Integer,
+ RequiereMedioCaptacion As Boolean, RequiereImporte As Boolean, RequiereProbabilidadAcercamiento As Boolean,
+ RequierePS As Boolean, RequiereComision As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_CRM_TipoProcesoUpdate")
With SqlAdapter.SelectCommand.Parameters
@@ -156,6 +165,11 @@ Public Class ClsCRM
.Add("@Descripcion", SqlDbType.VarChar).Value = Descripcion
.Add("@CveEstatus", SqlDbType.Bit).Value = CveEstatus
.Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso
+ .Add("@RequiereMedioCaptacion", SqlDbType.Bit).Value = RequiereMedioCaptacion
+ .Add("@RequiereImporte", SqlDbType.Bit).Value = RequiereImporte
+ .Add("@RequiereProbabilidadAcercamiento", SqlDbType.Bit).Value = RequiereProbabilidadAcercamiento
+ .Add("@RequierePS", SqlDbType.Bit).Value = RequierePS
+ .Add("@RequiereComision", SqlDbType.Bit).Value = RequiereComision
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb
index e9826f77e..3a0ec3593 100644
--- a/App_Code/ClsClientes.vb
+++ b/App_Code/ClsClientes.vb
@@ -32,6 +32,8 @@ Public Class ClsClientes
Public Property CveCliente As Integer
Public Property Nombre As String
+ Public Property TipoPersona As Boolean
+ Public Property RegimenSociedad As String
Public Property NombreComercial As String
Public Property Direccion As String
Public Property NoExt As String
@@ -289,6 +291,8 @@ Public Class ClsClientes
If Data.Rows.Count > 0 Then
_CveCliente = Data.Rows(0)("CveCliente").ToString.ToEntero
_Nombre = Data.Rows(0)("Nombre").ToString
+ _TipoPersona = Boolean.Parse(Data.Rows(0)("TipoPersona").ToString)
+ _RegimenSociedad = Data.Rows(0)("RegimenSociedad").ToString
_NombreComercial = Data.Rows(0)("NombreComercial").ToString
_Codigo = Data.Rows(0)("Codigo").ToString
_Direccion = Data.Rows(0)("Direccion").ToString
@@ -576,7 +580,7 @@ Public Class ClsClientes
Optional AplicaComercioExterior As Boolean = False, Optional CveTipoOperacion As Integer = -1, Optional CvePedimento As Integer = -1, Optional CveIncoterm As Integer = -1, Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveColonia As Integer = -1,
Optional CveMotivoTraslado As Integer = 0, Optional NumRegIdTrib As String = "", Optional ComExtEstado As String = "-1", Optional ComExtMunicipio As String = "-1", Optional ComExtColonia As String = "-1", Optional RequiereOC As Boolean = False,
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0,
- Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0) As Boolean
+ Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False) As Boolean
Dim Retorno As Boolean = False
@@ -719,6 +723,12 @@ Public Class ClsClientes
.Add("@CveAdminTrayecto", SqlDbType.TinyInt).Value = CveAdminTrayecto
.Add("@CveRegimenFiscal", SqlDbType.TinyInt).Value = CveRegimenFiscal
+ .Add("@RegimenSociedad", SqlDbType.VarChar).Value = RegimenSociedad
+ .Add("@TipoPersona", SqlDbType.Bit).Value = TipoPersona
+
+
+
+
End With
Try
SqlAdapter.Fill(Data)
@@ -766,7 +776,7 @@ Public Class ClsClientes
Optional CveMotivoTraslado As Integer = 0, Optional NumRegIdTrib As String = "-1", Optional ComExtEstado As String = "-1", Optional ComExtMunicipio As String = "-1", Optional ComExtColonia As String = "-1",
Optional ApellidoPaternoPF As String = "-1", Optional ApellidoMaternoPF As String = "-1", Optional NombresPF As String = "-1", Optional RequiereOC As Boolean = False,
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1",
- Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0) As Boolean
+ Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False) As Boolean
Dim Retorno As Boolean = False
@@ -925,6 +935,12 @@ Public Class ClsClientes
.Add("@CveAdminTrayecto", SqlDbType.TinyInt).Value = CveAdminTrayecto
.Add("@CveRegimenFiscal", SqlDbType.TinyInt).Value = CveRegimenFiscal
+ .Add("@RegimenSociedad", SqlDbType.VarChar).Value = RegimenSociedad
+ .Add("@TipoPersona", SqlDbType.Bit).Value = TipoPersona
+
+
+
+
End With
Try
SqlAdapter.Fill(Data)
@@ -1467,7 +1483,7 @@ Public Class ClsClientes
#Region "D I R E C C I O N D E E N V I O "
Public Function DireccionEnvioAdd(CveCliente As Integer, EnvioDireccion As String, EnvioNoExt As String, EnvioNoInt As String, EnvioColonia As String, EnvioCiudad As String, EnvioEstado As String,
EnvioCP As Integer, EnvioContacto As String, CveUsuario As Integer, Estatus As Integer, Optional CveClienteSucursal As Integer = -1, Optional EnvioDepartamento As String = "-1", Optional EnvioTel As String = "-1",
- Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveLocalidad As Integer = -1, Optional CveColonia As Integer = -1, Optional CveEmpresa As Integer = -1) As Integer
+ Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveLocalidad As Integer = -1, Optional CveColonia As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Vta_ClientesDireccionesEnvioAdd")
@@ -1486,6 +1502,7 @@ Public Class ClsClientes
.Add("@EnvioTel", SqlDbType.VarChar).Value = EnvioTel
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Estatus", SqlDbType.Int).Value = Estatus
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CvePais", SqlDbType.Int).Value = CvePais
.Add("@CveEstado", SqlDbType.Int).Value = CveEstado
@@ -1528,7 +1545,7 @@ Public Class ClsClientes
Public Function DireccionEnvioUpdate(CveCliente As Integer, EnvioDireccion As String, EnvioNoExt As String, EnvioNoInt As String, EnvioColonia As String, EnvioCiudad As String, EnvioEstado As String,
EnvioCP As Integer, EnvioContacto As String, CveUsuario As Integer, Estatus As Integer, CveDireccionEnvio As Integer, Optional EnvioDepartamento As String = "-1", Optional CveClienteSucursal As Integer = -1, Optional EnvioTel As String = "-1",
- Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveLocalidad As Integer = -1, Optional CveColonia As Integer = -1) As Boolean
+ Optional CvePais As Integer = -1, Optional CveEstado As Integer = -1, Optional CveMunicipio As Integer = -1, Optional CveLocalidad As Integer = -1, Optional CveColonia As Integer = -1, Optional CveSubProyecto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClientesDireccionesEnvioUpdate")
@@ -1548,6 +1565,7 @@ Public Class ClsClientes
.Add("@EnvioTel", SqlDbType.VarChar).Value = EnvioTel
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Estatus", SqlDbType.Int).Value = Estatus
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CvePais", SqlDbType.Int).Value = CvePais
.Add("@CveEstado", SqlDbType.Int).Value = CveEstado
diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb
index 97ce501d7..cbbcfb90e 100644
--- a/App_Code/ClsContPAQi.vb
+++ b/App_Code/ClsContPAQi.vb
@@ -6603,18 +6603,18 @@ Public Class ClsContPAQi
#End Region
#Region "M O V I M I E N T O S - A U X I L I A R E S - C A T A L O G O"
- Public Function GetMovimientosAuxiliaresCatalogo(IdCuenta As Integer, FechaI As Date, FechaF As Date, CveMoneda As Integer) As Boolean
+ Public Function GetMovimientosAuxiliaresCatalogo(IdCuenta As Integer, FechaI As Date, FechaF As Date, CveMoneda As Integer, Optional IdSegNeg As Integer = -1) As Boolean
Dim Retorno = False
- If Not FNC_Total() Then
+ If Not FNC_Total_Segmento() Then
Return Retorno
End If
- If Not FNC_Cargos() Then
+ If Not FNC_Cargos_Segmento() Then
Return Retorno
End If
- If Not FNC_Abonos() Then
+ If Not FNC_Abonos_Segmento() Then
Return Retorno
End If
@@ -6659,12 +6659,12 @@ Public Class ClsContPAQi
StrSQL.Append(" ) ")
StrSQL.Append(" INSERT INTO #TEMP ")
'StrSQL.AppendLine(" -- SE LLENA LA TABLA TEMPORAL CON EL ARBOL DEL WITH CON JOINS DE CUENTAS SUPERIORES ")
- StrSQL.Append(" SELECT T.*, ISNULL (dbo.FNC_Total(T.Id, CAST('1900-01-01' AS DATE),@FechaF,@CveMoneda), 0) AS SaldoActual ") '-- CASE WHEN Tipo IN ('A','B') THEN ISNULL(T.SaldoInicial + T.Cargos - T.Abonos,0) ELSE ISNULL(T.SaldoInicial + T.Abonos - T.Cargos,0) END AS SaldoActual
+ StrSQL.Append(" SELECT T.*, ISNULL (dbo.FNC_Total_Segmento(T.Id, CAST('1900-01-01' AS DATE),@FechaF,@CveMoneda,@IdSegNeg), 0) As SaldoActual ") '-- CASE WHEN Tipo IN ('A','B') THEN ISNULL(T.SaldoInicial + T.Cargos - T.Abonos,0) ELSE ISNULL(T.SaldoInicial + T.Abonos - T.Cargos,0) END AS SaldoActual
StrSQL.Append(" FROM (")
- StrSQL.Append(" SELECT C.Id, C.Nombre, C.Tipo, C.CtaMayor, '' AS Clasificacion, Orden,")
- StrSQL.Append(" ISNULL (dbo.FNC_Total(c.Id, CAST('1900-01-01' AS DATE),EOMONTH(@FechaI, -1 ),@CveMoneda), 0) AS SaldoInicial,")
- StrSQL.Append(" ISNULL (dbo.FNC_Cargos(c.Id, @FechaI, @FechaF,@CveMoneda), 0) AS Cargos,")
- StrSQL.Append(" ISNULL (dbo.FNC_Abonos(c.Id, @FechaI, @FechaF,@CveMoneda), 0) AS Abonos,")
+ StrSQL.Append(" Select C.Id, C.Nombre, C.Tipo, C.CtaMayor, '' AS Clasificacion, Orden,")
+ StrSQL.Append(" ISNULL (dbo.FNC_Total_Segmento(c.Id, CAST('1900-01-01' AS DATE),EOMONTH(@FechaI, -1 ),@CveMoneda,@IdSegNeg), 0) AS SaldoInicial,")
+ StrSQL.Append(" ISNULL (dbo.FNC_Cargos_Segmento(c.Id, @FechaI, @FechaF,@CveMoneda,@IdSegNeg), 0) AS Cargos,")
+ StrSQL.Append(" ISNULL (dbo.FNC_Abonos_Segmento(c.Id, @FechaI, @FechaF,@CveMoneda,@IdSegNeg), 0) AS Abonos,")
StrSQL.Append(" Level as Nivel,")
StrSQL.Append(" CASE WHEN ISNUMERIC (C.Codigo) = 1 THEN FORMAT (CAST (C.Codigo AS FLOAT), (SELECT REPLACE (Mascarilla, 'X', '0') FROM Parametros)) ELSE C.Codigo END AS Codigo,")
StrSQL.Append(" CASE WHEN ISNUMERIC (CT.Codigo) = 1 THEN FORMAT (CAST (CT.Codigo AS FLOAT), (SELECT REPLACE (Mascarilla, 'X', '0') FROM Parametros)) ELSE CT.Codigo END AS CodigoSup, Ct.Nombre as Sup,")
@@ -6743,12 +6743,18 @@ Public Class ClsContPAQi
StrSQL.Append(" LEFT JOIN MovimientosPoliza MP ON T.ID = MP.IdCuenta AND MP.Fecha < CAST('0001-01-01' AS DATE)")
StrSQL.Append(" LEFT JOIN TiposPolizas TP ON MP.TipoPol = TP.Codigo")
StrSQL.Append(" LEFT JOIN Polizas P ON MP.IdPoliza = P.Id")
+ StrSQL.Append(" WHERE (MP.IdSegNeg = @IdSegNeg OR ( @IdSegNeg =-1 OR MP.IdSegNeg IS NULL)) ")
+
+
StrSQL.Append(" UNION")
StrSQL.AppendFormat(" SELECT T.*, MP.Concepto, MP.Fecha, TP.Nombre AS TipoPoliza, MP.Folio, MP.Id AS IdMovimientoPoliza, MP.Referencia, CASE WHEN MP.TipoMovto = 0 THEN MP.{0} ELSE 0 END, CASE WHEN MP.TipoMovto = 1 THEN MP.{0} ELSE 0 END, MP.IdPoliza, P.Concepto AS ConceptoPadre", If(CveMoneda = 1, "Importe", "ImporteME"))
StrSQL.Append(" FROM #TEMP T")
StrSQL.Append(" LEFT JOIN MovimientosPoliza MP ON T.ID = MP.IdCuenta AND CAST(MP.Fecha AS DATE) BETWEEN @FechaI AND @FechaF")
StrSQL.Append(" LEFT JOIN TiposPolizas TP ON MP.TipoPol = TP.Codigo")
StrSQL.Append(" LEFT JOIN Polizas P ON MP.IdPoliza = P.Id")
+ StrSQL.Append(" WHERE (MP.IdSegNeg = @IdSegNeg OR ( @IdSegNeg =-1 OR MP.IdSegNeg IS NULL)) ")
+
+
StrSQL.Append(" ) AS T")
StrSQL.Append(" ) TT")
'StrSQL.AppendLine(" --PRIMER GROUPING SON LAS CABECERAS Y TOTALES DE LAS CUENTAS, SEGUNDO GROUPING SON LOS MOVIMIENTOS DE LAS CUENTAS")
@@ -6777,6 +6783,7 @@ Public Class ClsContPAQi
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@IdCuentaPadre", SqlDbType.Int).Value = IdCuenta
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
+ .Add("@IdSegNeg", SqlDbType.Int).Value = IdSegNeg
End With
Try
@@ -11035,7 +11042,7 @@ Public Class ClsContPAQi
StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = a.IdSubCtade ")
StrSQL.Append(" INNER JOIN MovimientosPoliza p ON IdCuenta = c.Id ")
StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON p.IdSegNeg = s.Id ")
- StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF; ")
+ StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF; ")
StrSQL.Append(" RETURN @Total; ")
StrSQL.Append(" END; ")
@@ -11104,7 +11111,7 @@ Public Class ClsContPAQi
StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = a.IdSubCtade ")
StrSQL.Append(" INNER JOIN MovimientosPoliza p ON IdCuenta = c.Id ")
StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON p.IdSegNeg = s.Id ")
- StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF; ")
+ StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF; ")
StrSQL.Append(" RETURN @Total; ")
StrSQL.Append(" END; ")
@@ -11198,6 +11205,233 @@ Public Class ClsContPAQi
#End Region
+#Region "Funciones con Segmento"
+
+
+ Public Function FNC_Total_Segmento() As Boolean
+
+ Dim Retorno = False
+ StrSQL.Clear()
+ StrSQL.Append(" IF OBJECT_ID ('FNC_Total_Segmento') IS NOT NULL DROP FUNCTION FNC_Total_Segmento")
+ SqlDataAdapter(StrSQL.ToString, CommandType.Text)
+
+ Try
+ SqlAdapter.SelectCommand.ExecuteNonQuery()
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al eliminar la funcion FNC_Total_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+
+ StrSQL.Clear()
+ StrSQL.Append(" CREATE FUNCTION [dbo].[FNC_Total_Segmento] ")
+ StrSQL.Append(" ( ")
+ StrSQL.Append(" @IdCtaSup INT, ")
+ StrSQL.Append(" @FechaI DATE, ")
+ StrSQL.Append(" @FechaF DATE, ")
+ StrSQL.Append(" @CveMoneda INT = 1, ")
+ StrSQL.Append(" @IdSegNeg INT =-1 ")
+ StrSQL.Append(" ) ")
+ StrSQL.Append(" RETURNS FLOAT ")
+ StrSQL.Append(" AS ")
+ StrSQL.Append(" BEGIN ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" DECLARE ")
+ StrSQL.Append(" @Total FLOAT, ")
+ StrSQL.Append(" @TipoCuenta VARCHAR(1), ")
+ StrSQL.Append(" @FechaFF DATE; ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" SET @TipoCuenta = (SELECT Tipo FROM Cuentas WHERE id = @IdCtaSup); ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" WITH Estructura(IdCtaSup, IdSubCtade) AS ")
+ StrSQL.Append(" ( ")
+ StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ")
+ StrSQL.Append(" FROM Asociaciones a ")
+ StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ")
+ StrSQL.Append(" WHERE a.IdSubCtade = @IdCtaSup ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" UNION ALL ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ")
+ StrSQL.Append(" FROM Asociaciones a ")
+ StrSQL.Append(" INNER JOIN Estructura e ON a.IdCtaSup = e.IdSubCtade ")
+ StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ")
+ StrSQL.Append(" ) ")
+ StrSQL.Append(" SELECT @Total = SUM (CASE ")
+ StrSQL.Append(" WHEN @TipoCuenta IN ('A', 'B', 'E', 'G') THEN CASE WHEN p.TipoMovto = 1 THEN CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY) * -1 ELSE CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY) END ")
+ StrSQL.Append(" WHEN @TipoCuenta IN ('B', 'D', 'F', 'H', 'C') THEN CASE WHEN p.TipoMovto = 0 THEN CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY) * -1 ELSE CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY) END ")
+ StrSQL.Append(" ELSE 0 ")
+ StrSQL.Append(" END ")
+ StrSQL.Append(" ) ")
+ StrSQL.Append(" FROM Estructura e ")
+ StrSQL.Append(" INNER JOIN Asociaciones a ON e.IdSubCtade = a.IdSubCtade ")
+ StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = a.IdSubCtade ")
+ StrSQL.Append(" INNER JOIN MovimientosPoliza p ON IdCuenta = c.Id ")
+ StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON p.IdSegNeg = s.Id ")
+ StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF AND (@IdSegNeg = -1 OR p.IdSegNeg = @IdSegNeg); ")
+ StrSQL.Append(" RETURN @Total; ")
+ StrSQL.Append(" END; ")
+
+
+
+ SqlDataAdapter(StrSQL.ToString, CommandType.Text)
+
+ Try
+ SqlAdapter.SelectCommand.ExecuteNonQuery()
+ Retorno = True
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al crear la funcion FNC_Total_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function FNC_Cargos_Segmento() As Boolean
+
+ Dim Retorno = False
+ StrSQL.Clear()
+ StrSQL.Append(" IF OBJECT_ID ('FNC_Cargos_Segmento') IS NOT NULL DROP FUNCTION FNC_Cargos_Segmento")
+ SqlDataAdapter(StrSQL.ToString, CommandType.Text)
+
+ Try
+ SqlAdapter.SelectCommand.ExecuteNonQuery()
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al eliminar la funcion FNC_Cargos_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+
+ StrSQL.Clear()
+ StrSQL.Append(" CREATE FUNCTION [dbo].[FNC_Cargos_Segmento] ")
+ StrSQL.Append(" ( ")
+ StrSQL.Append(" @IdCtaSup INT, ")
+ StrSQL.Append(" @FechaI DATE, ")
+ StrSQL.Append(" @FechaF DATE, ")
+ StrSQL.Append(" @CveMoneda INT = 1, ")
+ StrSQL.Append(" @IdSegNeg INT =-1 ")
+ StrSQL.Append(" ) ")
+ StrSQL.Append(" RETURNS FLOAT ")
+ StrSQL.Append(" AS ")
+ StrSQL.Append(" BEGIN ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" DECLARE @Total FLOAT; ")
+ StrSQL.Append(" DECLARE @TipoCuenta VARCHAR(1); ")
+ StrSQL.Append(" SET @TipoCuenta = (SELECT Tipo FROM Cuentas WHERE id = @IdCtaSup); ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" WITH Estructura(IdCtaSup, IdSubCtade) AS ")
+ StrSQL.Append(" ( ")
+ StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ")
+ StrSQL.Append(" FROM Asociaciones a ")
+ StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ")
+ StrSQL.Append(" WHERE a.IdSubCtade = @IdCtaSup ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" UNION ALL ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ")
+ StrSQL.Append(" FROM Asociaciones a ")
+ StrSQL.Append(" INNER JOIN Estructura e ON a.IdCtaSup = e.IdSubCtade ")
+ StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ")
+ StrSQL.Append(" ) ")
+ StrSQL.Append(" SELECT @Total = SUM (CASE WHEN p.TipoMovto = 0 THEN CAST (ISNULL (CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY), 0)AS MONEY) ELSE 0 END) ")
+ StrSQL.Append(" FROM Estructura e ")
+ StrSQL.Append(" INNER JOIN Asociaciones a ON e.IdSubCtade = a.IdSubCtade ")
+ StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = a.IdSubCtade ")
+ StrSQL.Append(" INNER JOIN MovimientosPoliza p ON IdCuenta = c.Id ")
+ StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON p.IdSegNeg = s.Id ")
+ StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF AND (@IdSegNeg = -1 OR p.IdSegNeg = @IdSegNeg); ")
+ StrSQL.Append(" RETURN @Total; ")
+ StrSQL.Append(" END; ")
+
+
+
+
+ SqlDataAdapter(StrSQL.ToString, CommandType.Text)
+
+ Try
+ SqlAdapter.SelectCommand.ExecuteNonQuery()
+ Retorno = True
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al crear la funcion FNC_Cargos_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function FNC_Abonos_Segmento() As Boolean
+
+ Dim Retorno = False
+ StrSQL.Clear()
+ StrSQL.Append(" IF OBJECT_ID ('FNC_Abonos_Segmento') IS NOT NULL DROP FUNCTION FNC_Abonos_Segmento")
+ SqlDataAdapter(StrSQL.ToString, CommandType.Text)
+
+ Try
+ SqlAdapter.SelectCommand.ExecuteNonQuery()
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al eliminar la funcion FNC_Abonos_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+
+ StrSQL.Clear()
+ StrSQL.Append(" CREATE FUNCTION [dbo].[FNC_Abonos_Segmento] ")
+ StrSQL.Append(" ( ")
+ StrSQL.Append(" @IdCtaSup INT, ")
+ StrSQL.Append(" @FechaI DATE, ")
+ StrSQL.Append(" @FechaF DATETIME, ")
+ StrSQL.Append(" @CveMoneda INT = 1 , ")
+ StrSQL.Append(" @IdSegNeg INT =-1 ")
+ StrSQL.Append(" ) ")
+ StrSQL.Append(" RETURNS FLOAT ")
+ StrSQL.Append(" AS ")
+ StrSQL.Append(" BEGIN ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" DECLARE @Total FLOAT; ")
+ StrSQL.Append(" DECLARE @TipoCuenta VARCHAR(1); ")
+ StrSQL.Append(" SET @TipoCuenta = (SELECT Tipo FROM Cuentas WHERE id = @IdCtaSup); ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" WITH Estructura(IdCtaSup, IdSubCtade) AS ")
+ StrSQL.Append(" ( ")
+ StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ")
+ StrSQL.Append(" FROM Asociaciones a ")
+ StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ")
+ StrSQL.Append(" WHERE a.IdSubCtade = @IdCtaSup ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" UNION ALL ")
+ StrSQL.Append(" ")
+ StrSQL.Append(" SELECT a.IdCtaSup, a.IdSubCtade ")
+ StrSQL.Append(" FROM Asociaciones a ")
+ StrSQL.Append(" INNER JOIN Estructura e ON a.IdCtaSup = e.IdSubCtade ")
+ StrSQL.Append(" INNER JOIN Cuentas c ON a.IdSubCtade = c.Id ")
+ StrSQL.Append(" ) ")
+ StrSQL.Append(" SELECT @Total = SUM (CASE WHEN p.TipoMovto = 1 THEN CAST (ISNULL (CAST (CASE WHEN @CveMoneda = 1 THEN p.Importe ELSE p.ImporteME END AS MONEY), 0)AS MONEY) ELSE 0 END) ")
+ StrSQL.Append(" FROM Estructura e ")
+ StrSQL.Append(" INNER JOIN Asociaciones a ON e.IdSubCtade = a.IdSubCtade ")
+ StrSQL.Append(" INNER JOIN Cuentas c ON c.Id = a.IdSubCtade ")
+ StrSQL.Append(" INNER JOIN MovimientosPoliza p ON IdCuenta = c.Id ")
+ StrSQL.Append(" LEFT JOIN SegmentosNegocio s ON p.IdSegNeg = s.Id ")
+ StrSQL.Append(" WHERE CAST (p.Fecha AS DATE)>= @FechaI AND CAST (p.Fecha AS DATE) <= @FechaF AND (@IdSegNeg = -1 OR p.IdSegNeg = @IdSegNeg); ")
+ StrSQL.Append(" RETURN @Total; ")
+ StrSQL.Append(" END; ")
+
+
+
+
+
+ SqlDataAdapter(StrSQL.ToString, CommandType.Text)
+
+ Try
+ SqlAdapter.SelectCommand.ExecuteNonQuery()
+ Retorno = True
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al crear la funcion FNC_Abonos_Segmento", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+#End Region
+
+
#Region " IDisposable Support "
' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index d5cf5e840..6b6fce855 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -992,6 +992,9 @@ Public Class ClsContabilidad
ElseIf ex1.Message.Contains("Vw_Val_Conta_CuentasResultados_SubProyectos") Then
Dim Concepto2 As String = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("ConceptoContable", String.Format("CveConceptoContable = {0}", CveConceptoContable))
OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ ElseIf ex1.Message.Contains("UK_Vw_Val_Conta_CuentasResultados_SubProyectos") Then
+ Dim Concepto3 As String = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("ConceptoContable", String.Format("CveConceptoContable = {0}", CveConceptoContable))
+ OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto3), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
Else
OnError("Ocurrió un error al Guardar", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End If '
@@ -3814,6 +3817,30 @@ Public Class ClsContabilidad
Return Retorno
End Function
+
+
+ Public Function GetFlujoEfectivo2(FechaF As Date, Tipo As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno = False
+
+ DataAdapter("PA_Conta_RepFlujoEfectivo2")
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@FechaF", SqlDbType.Date).Value = FechaF
+ .Add("@TipoReporte", SqlDbType.Int).Value = Tipo
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ Me.OnError("Ocurrió un error al obtener el Estado de Flujo de Efectivo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
Public Function GetOrigenAplicacion(FechaI As String, FechaF As String, TipoReporte As Integer, CveSubProyecto As String, CveEmpresa As Integer) As Boolean
Dim Retorno = False
@@ -5785,7 +5812,7 @@ Public Class ClsContabilidad
Return Retorno
End Function
- Public Function GetCuentasAsignacionesSistema(CveEmpresa As Integer, Tipo As Integer, Opcion As Integer) As Boolean
+ Public Function GetCuentasAsignacionesSistema(CveEmpresa As Integer, Tipo As Integer, Opcion As Integer, CveConcepto As Integer) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_CuentasAsignacionesSistemaGet")
@@ -5794,6 +5821,7 @@ Public Class ClsContabilidad
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Tipo", SqlDbType.Int).Value = Tipo
.Add("@Opcion", SqlDbType.Int).Value = Opcion
+ .Add("@CveConcepto", SqlDbType.Int).Value = CveConcepto
End With
Try
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index e5d8cb414..2d7da6a41 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -869,7 +869,7 @@ Public Class ClsInventarios
Return Retorno
End Function
- Public Function GetMovimientosDetallePorPersonal(CvePersonal As Integer, CveAlmacen As Integer, CveCliente As Integer, CveProveedor As Integer) As Boolean
+ Public Function GetMovimientosDetallePorPersonal(CvePersonal As Integer, CveAlmacen As Integer, CveCliente As Integer, CveProveedor As Integer, Optional Tipo As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosPorPersonalGet")
@@ -879,6 +879,7 @@ Public Class ClsInventarios
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
+ .Add("@Tipo", SqlDbType.Int).Value = Tipo
End With
Try
SqlAdapter.Fill(Data)
@@ -1286,7 +1287,8 @@ Public Class ClsInventarios
Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha,
Optional Observaciones As String = "", Optional CveMovimientoDetalleEntrada As Integer = -1, Optional PUTC As Decimal = -1,
Optional CostoIndirecto As Decimal = 0, Optional CveCompraDetalle As Integer = -1, Optional CveOrdenCompraDetalle As Integer = -1, Optional CveVentaDetalle As Integer = -1,
- Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1, Optional CveVentaDetalleRemision As Integer = -1) As Boolean
+ Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1, Optional CveVentaDetalleRemision As Integer = -1,
+ Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleAdd")
@@ -1313,6 +1315,7 @@ Public Class ClsInventarios
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@EsInterno", SqlDbType.Int).Value = EsInterno
.Add("@CveVentaDetalleRemision", SqlDbType.Int).Value = CveVentaDetalleRemision
+ .Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
.Add("@CveMovimientoDetalle", SqlDbType.Int).Direction = ParameterDirection.Output
End With
@@ -1348,7 +1351,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function UpdateMovimientoDetalle(Cantidad As Double, CveUM As Integer, CvePS As Integer, PU As Double, CveAF As Integer, CveMovimientoDetalle As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "",
- Optional Observaciones As String = "-1", Optional PUTC As Double = -1, Optional CveUsuarioModifico As Integer = -1) As Boolean
+ Optional Observaciones As String = "-1", Optional PUTC As Double = -1, Optional CveUsuarioModifico As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleUpdate")
@@ -1365,6 +1368,7 @@ Public Class ClsInventarios
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
+ .Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
End With
Try
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 90bb8784f..156eaff82 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -4515,11 +4515,7 @@ Public Class ClsPaginas
PaginaDict.Add("/AF/CatCombustibles.aspx".ToUpper(), -1)
PaginaDict.Add("/AF/CatCargasCombustible.aspx".ToUpper(), -1)
PaginaDict.Add("/AF/RepFlotillas.aspx".ToUpper(), -1)
- PaginaDict.Add("/AF/RepPlacas.aspx".ToUpper(), -1)
- PaginaDict.Add("/AF/RepIncidentes.aspx".ToUpper(), -1)
- PaginaDict.Add("/AF/RepPolizaSeguro.aspx".ToUpper(), -1)
- PaginaDict.Add("/AF/RepLicencias.aspx".ToUpper(), -1)
- PaginaDict.Add("/AF/RepServicios.aspx".ToUpper(), -1)
+
PaginaDict.Add("/AF/RepDepreciacion.aspx".ToUpper(), -1)
PaginaDict.Add("/AF/RepEventosProgramados.aspx".ToUpper(), 656)
PaginaDict.Add("/AF/RegistroRevision.aspx".ToUpper(), 1251)
@@ -4834,6 +4830,8 @@ Public Class ClsPaginas
PaginaDict.Add("/Contabilidad/RepIEPS.aspx".ToUpper(), 714)
PaginaDict.Add("/Contabilidad/CatPeriodosBloqueo.aspx".ToUpper(), 677)
PaginaDict.Add("/Contabilidad/CatClasificacionPorcentaje.aspx".ToUpper(), 752)
+ PaginaDict.Add("/Contabilidad/RepFlujoEfectivo.aspx".ToUpper(), 783)
+
#End Region
'CONTABILIDAD2
diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb
index 225d0ba99..4363a44e2 100644
--- a/App_Code/ClsProductosServicios.vb
+++ b/App_Code/ClsProductosServicios.vb
@@ -246,7 +246,7 @@ Public Class ClsProductosServicios
CveUnidadMedida = Data.Rows(0)("CveUnidadMedida").ToString.ToEntero
CveSATPS = Data.Rows(0)("CveSATPS").ToString.ToEntero
Me.SATClavePS = Data.Rows(0)("SATClavePS").ToString
- 'SATDescripcion = Data.Rows(0)("SATDescripcion").ToString
+ SATDescripcion = Data.Rows(0)("SATDescripcion").ToString
Me.CveTipoPS = Data.Rows(0)("CveTipoPS").ToString.ToEntero
Me.Codigo = Data.Rows(0)("Codigo").ToString
Me.Codigo2 = Data.Rows(0)("Codigo2").ToString
diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb
index ba5cd008c..3668afa90 100644
--- a/App_Code/ClsRH.vb
+++ b/App_Code/ClsRH.vb
@@ -1925,7 +1925,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
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, 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) As Boolean
+ Optional Pensionado As Boolean = False, Optional CveMedioTransporte As Integer = -1, Optional CveRegistroPatronal As Integer = -1, Optional CveEmpresaAsignado As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -2011,6 +2011,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@CvePais", SqlDbType.Int).Value = CvePais
.Add("@CveMedioTransporte", SqlDbType.Int).Value = CveMedioTransporte
.Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal
+ .Add("@CveEmpresaAsignado", SqlDbType.Int).Value = CveEmpresaAsignado
+
@@ -2052,7 +2054,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
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, 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) As Boolean
+ 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) As Boolean
Dim Retorno As Boolean = False
@@ -2141,6 +2144,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
.Add("@Pensionado", SqlDbType.Bit).Value = Pensionado
.Add("@CvePais", SqlDbType.Int).Value = CvePais
.Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal
+ .Add("@CveEmpresaAsignado", SqlDbType.Int).Value = CveEmpresaAsignado
+
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index c46c6b549..290ab5615 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -6862,7 +6862,7 @@ Namespace Modelos
Public Property TiempoEntrega As String = ""
Public Property Vigencia As Date
Public Property TipoEstatus As Integer
- Public Property CveCondicionEntrega As Integer
+ Public Property CveCondicionEntrega As Integer = -1
Public Property CondicionEntrega As String = ""
Public Property TipoRelacion As String
diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb
index fc320f55f..2499c1de1 100644
--- a/App_Code/Timbrado.vb
+++ b/App_Code/Timbrado.vb
@@ -3425,10 +3425,11 @@ Public Class Timbrado
swmili = sw.ElapsedMilliseconds
sw.Start()
+ Me.UUID = FolioFiscal
If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then
'Actualiza Estatus Factura
- If Ventas.CveVenta > 0 Then
+ If Ventas.CveVenta > 0 Then
Using ObjVentas As New ClsVentas()
diff --git a/App_Code/Timbres.vb b/App_Code/Timbres.vb
index 654f5ae7f..4f8d15dc4 100644
--- a/App_Code/Timbres.vb
+++ b/App_Code/Timbres.vb
@@ -124,6 +124,8 @@ Public Class Timbres
Timbre.Receptor.RFC = drT("DestinatarioRFC").ToString
Timbre.Receptor.Nombre = drT("DestinatarioNombre").ToString
+ Timbre.Receptor.DomicilioFiscalReceptor = drT("DirDesCP").ToString
+ Timbre.Receptor.RegimenFiscalReceptor = drT("CodigoRegimenFiscalReceptor").ToString
CveMovimiento = drT("CveMovimientoAlmacen").ToString.ToEntero
FechaSalida = drT("FechaEntrega").ToString.ToDateTime
@@ -182,18 +184,6 @@ Public Class Timbres
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
End If
-
- If drT("ClaveTipoRemolque1").ToString <> "" Then
- Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
- CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
- End If
-
- If drT("ClaveTipoRemolque2").ToString <> "" Then
- Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
- CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
- End If
-
-
Dim DomOrigen As CFDICartaPorteDomicilio = Nothing
DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString,
.Colonia = drT("DirOriClaveSATColonia").ToString,
@@ -252,7 +242,7 @@ Public Class Timbres
'concepto único
Dim concepto As New CFDIConceptos With {.Cantidad = 1,
- .Descripcion = "Flete",
+ .Descripcion = "Traslado",
.ValorUnitario = 0,
.Importe = 0,
.Descuento = 0,
@@ -283,7 +273,7 @@ Public Class Timbres
.ClaveUnidad = drr("SATClaveUM").ToString,
.Unidad = drr("UM").ToString,
.Dimensiones = drr("Dimensiones").ToString,
- .PesoenKg = drr("PesoKg").ToString.ToDecimal,
+ .PesoenKg = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal,
.MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""),
.ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString,
.Embalaje = drr("ClaveEmbalaje").ToString,
@@ -294,7 +284,7 @@ Public Class Timbres
.UUIDComercioExt = ""
}
- Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal}
+ Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal}
conceptoCarta.DetalleMercancia = DetalleMercancia
Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"}
diff --git a/Bancos/CuentasBancariasDetalle.aspx b/Bancos/CuentasBancariasDetalle.aspx
index d2a0f9b05..dc51da521 100644
--- a/Bancos/CuentasBancariasDetalle.aspx
+++ b/Bancos/CuentasBancariasDetalle.aspx
@@ -95,6 +95,11 @@
diff --git a/CRM/EmpresaCRM.aspx.cs b/CRM/EmpresaCRM.aspx.cs
index 9e913932a..59d6f5833 100644
--- a/CRM/EmpresaCRM.aspx.cs
+++ b/CRM/EmpresaCRM.aspx.cs
@@ -238,6 +238,19 @@ public partial class CRM_EmpresaCRM : ClsPaginas
ViewState["CveGiroClasificacion"] = value;
}
}
+
+ private List ListTipoProceso
+ {
+ get
+ {
+ return (List)ViewState["ListTipoProceso"];
+ }
+
+ set
+ {
+ ViewState["ListTipoProceso"] = value;
+ }
+ }
#endregion
protected void Page_Load(object sender, EventArgs e)
@@ -794,6 +807,20 @@ public partial class CRM_EmpresaCRM : ClsPaginas
protected void DdlTipoProceso_Change(object sender, EventArgs e)
{
+
+ var tipoProceso = ListTipoProceso.Where(x => x.CveTipoProceso == DdlTipoProceso.SelectedValue.ToEntero()).FirstOrDefault();
+ if (tipoProceso != null)
+ {
+ DivComision.Visible = tipoProceso.RequiereComision;
+ DivMedioCaptacion.Visible = tipoProceso.RequiereMedioCaptacion;
+ DivImporte.Visible = tipoProceso.RequiereImporte;
+ DivProbabilidadAcercamiento.Visible = tipoProceso.RequiereProbabilidadAcercamiento;
+ DivPS.Visible = tipoProceso.RequierePS;
+ }
+
+ RfvMedioCaptacionAcercamiento.Enabled = DivMedioCaptacion.Visible;
+ RFVProbabilidad.Enabled = DivProbabilidadAcercamiento.Visible;
+
DdlMedioCaptacionAcercamiento.Items.Clear();
DdlMedioCaptacionAcercamiento.DataSource = DtMedioCaptacion.FiltraParametros(String.Format("CveTipoProceso = {0}", DdlTipoProceso.SelectedValue.ToEntero()));
DdlMedioCaptacionAcercamiento.DataBind();
@@ -1520,6 +1547,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
DdlMedioCaptacionAcercamiento.Enabled = false;
DdlTipoProceso.DataBind();
}
+ ListTipoProceso = ObjTipoProceso.Result;
if (ObjProbalidadAcercamiento.Result.Count > 0)
{
@@ -1794,7 +1822,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
protected void DdlTipoProcesos_Change(Object sender, EventArgs e)
{
DdlMedioCaptacion.Items.Clear();
- CargaMetodosCaptacion();
+ CargaMetodosCaptacion();
UpDatos.Update();
}
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 641e09fab..c4e0fa5cd 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -8690,6 +8690,8 @@ Partial Class Compras_Compras
Dim DTConsultaIEPSPS As New DataTable
DTConsultaIEPSPS = TmpDT.FiltraParametros(" AplicaIEPS = 'True'")
+
+
Dim IndiceContador As Integer = 0
Dim IndicePrimero As Integer = 0
@@ -8703,17 +8705,14 @@ Partial Class Compras_Compras
If DiferenciaIEPSPS.RoundAD(2) <> 0 Then
- If DTConsultaIEPSPS.Rows.Count > 0 Then
- 'Ajusta IPES en primer registro que aplique IEPS
- TmpDT.Rows(IndicePrimero)("IEPSPS") = TmpDT.Rows(IndicePrimero)("IEPSPS").ToString.ToDecimal + DiferenciaIEPSPS
- TmpDT.AcceptChanges()
- Else
- Respuesta = False
- Alert(String.Format("Los productos especificados en el listado no tienen asigando impuesto IEPS, favor de realizar la corrección en el producto que aplique el impuesto. ({0}-{1})", IEPSPSDetalles, TxtIEPS.Text.ToDecimal), TipoMensaje.MsgAdvertencia)
- End If
+
+ TmpDT.Rows(IndicePrimero)("IEPSPS") = TmpDT.Rows(IndicePrimero)("IEPSPS").ToString.ToDecimal + DiferenciaIEPSPS
+ TmpDT.AcceptChanges()
+
End If
+
For Each dRow As DataRow In TmpDT.Rows
If dRow("IEPSPSPorcentaje").ToString.ToDecimal > 0 AndAlso dRow("IEPSPS").ToString.ToDecimal = 0 Then
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 35c9b14ff..61ecb326a 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -1271,6 +1271,11 @@ Partial Class PopUpVerFactura
DtOperadores.Columns.Add(New DataColumn("NumLicencia", GetType(String)))
DtOperadores.Columns.Add(New DataColumn("NombreOperador", GetType(String)))
+ Dim DTRelacionados As New DataTable()
+ DTRelacionados.Columns.Add(New DataColumn("Relacion", GetType(String)))
+ DTRelacionados.Columns.Add(New DataColumn("UUID", GetType(String)))
+
+
Dim XMLDoc As New XmlDocument
Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, "XML", TipoDocto, String.Format("{0}", SerieFolio), "xml")
Dim Archivo As New System.IO.FileInfo(Path)
@@ -1449,10 +1454,59 @@ Partial Class PopUpVerFactura
End If
-
DtUbicaciones.Rows.Add(Row)
Next
+
+
+ Dim nodeRelacion = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces)
+
+ If nodeRelacion IsNot Nothing Then
+ Dim RelacionCodigo As String = ValorXML(nodeRelacion, "TipoRelacion")
+ Dim Relacion As String = ""
+
+ Select Case RelacionCodigo
+ Case "01"
+ Relacion = "01 - Nota de crédito de los documentos relacionados"
+ Case "02"
+ Relacion = "02 - Nota de débito de los documentos relacionados"
+ Case "03"
+ Relacion = "03 - Devolución de mercancía sobre facturas o traslados previos"
+ Case "04"
+ Relacion = "04 - Sustitución de los CFDI previos"
+ Case "05"
+ Relacion = "05 - Traslados de mercancias facturados previamente"
+ Case "06"
+ Relacion = "06 - Factura generada por los traslados previos"
+ Case "07"
+ Relacion = "07 - CFDI por aplicación de anticipo"
+ Case "08"
+ Relacion = "08 - Factura generada por pagos en parcialidades"
+ Case "09"
+ Relacion = "09 - Factura generada por pagos diferidos"
+
+ End Select
+
+ Dim nodoDocumentosRealcionados = XMLDoc.SelectNodes(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces)
+ For Each node As XmlNode In nodoDocumentosRealcionados
+
+ Dim nRow As DataRow = DTRelacionados.NewRow
+ nRow("Relacion") = Relacion
+
+ Try
+ Dim nodoUUID = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cfdi:CfdiRelacionado")
+ nRow("UUID") = ValorXML(nodoUUID, "UUID", "")
+ Catch ex As Exception
+ nRow("UUID") = ""
+ End Try
+
+ DTRelacionados.Rows.Add(nRow)
+ Next
+ End If
+
+
+
+
Dim nodeTFD As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces)
If nodeTFD IsNot Nothing Then
FolioFiscal = ValorXML(nodeTFD, "UUID", "")
@@ -1567,6 +1621,12 @@ Partial Class PopUpVerFactura
rds4.Value = DtOperadores
lrds.Add(rds4)
+
+ Dim rds5 As New ReportDataSource
+ rds5.Name = "DataSet5"
+ rds5.Value = DTRelacionados
+ lrds.Add(rds5)
+
ImprimirPDF("Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc", lrds, params, SerieFolio)
End If
End If
diff --git a/Compras/ReembolsosComprobaciones.aspx.vb b/Compras/ReembolsosComprobaciones.aspx.vb
index d035cbd6d..e3370d62a 100644
--- a/Compras/ReembolsosComprobaciones.aspx.vb
+++ b/Compras/ReembolsosComprobaciones.aspx.vb
@@ -25,6 +25,15 @@ Partial Class Compras_ReembolsosComprobaciones
ViewState("CveMoneda") = value
End Set
End Property
+
+ Private Property CvePrePolizaComprobacion As Integer
+ Get
+ Return ViewState("CvePrePolizaComprobacion").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("CvePrePolizaComprobacion") = value
+ End Set
+ End Property
Private Property IdCuentaBancaria As Integer
Get
Return ViewState("IdCuentaBancaria").ToString.ToEntero
@@ -316,7 +325,6 @@ Partial Class Compras_ReembolsosComprobaciones
If dr IsNot Nothing Then
CveMoneda = dr("CveMoneda").ToString.ToEntero
IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
- If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero
End If
If HdnTipoTransaccion.Value = "Egs" Then
@@ -383,9 +391,6 @@ Partial Class Compras_ReembolsosComprobaciones
Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click
-
-
-
Dim ValFechaDocumento As Boolean = False
Dim FoliosFechasValFechaDocumento As New StringBuilder
@@ -408,16 +413,11 @@ Partial Class Compras_ReembolsosComprobaciones
FechaDocumento = TxtFechaPrePoliza.Text.ToDate
End If
-
-
Dim AnioFactura As Integer = FechaFactura.Year
Dim MesFactura As Integer = FechaFactura.Month
-
-
Dim AnioDocumento As Integer = FechaDocumento.Year
Dim MesDocumento As Integer = FechaDocumento.Month
-
If AnioFactura > AnioDocumento Then
FoliosFechasValFechaDocumento.AppendLine($"Folio: { gvRowVal.DataKey("SerieFolio") } fecha: {gvRowVal.DataKey("FechaCompra").ToDate.ToString("dd/MM/yyyy") } ")
@@ -441,8 +441,6 @@ Partial Class Compras_ReembolsosComprobaciones
Exit Sub
End If
-
-
If HdnCheque.Value.ToEntero > 0 And ChkChequeExcedente.Checked And TxtImporte.Text.ToDecimal = 0 Then
Alert("El importe del cheque excedente debe ser mayor a cero", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -488,8 +486,6 @@ Partial Class Compras_ReembolsosComprobaciones
Dim UsaSimplificacionCajaChica As Boolean = False
If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaSimplificacionCajaChica = True
-
-
Dim concepto As String = "Compras: "
For Each Gvr As GridViewRow In GvCxP.Rows
@@ -502,7 +498,6 @@ Partial Class Compras_ReembolsosComprobaciones
Next
-
If HdnCheque.Value.ToEntero > 0 AndAlso Not ChkReembolsarSinBancos.Checked Then
CveIERegistrado = DDlCheques.SelectedValue.ToEntero
@@ -514,7 +509,6 @@ Partial Class Compras_ReembolsosComprobaciones
If ObjMov.GetRetCuenta(30, CveCajaChica) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
- If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero
End If
End If
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
@@ -535,7 +529,11 @@ Partial Class Compras_ReembolsosComprobaciones
CvePrePolizaIERegistrado = ObjMov.AddPrePolizas("Compras/Comprobaciones2", 9, TxtImporteVinculado.Text.ToDecimal, TxtImporteVinculado.Text.ToDecimal, CveMoneda, TxtFechaPrePoliza.Text.ToDate, If(TxtObservaciones.Text.Trim = "", concepto, TxtObservaciones.Text.Trim), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
IdPoliza = drp("IdPoliza").ToString.ToEntero
Else
- CvePrePolizaIERegistrado = drp("CvePrePoliza").ToString.ToEntero
+ If UsuarioActual.CveEmpresa = 141 Then
+ CvePrePolizaIERegistrado = CvePrePolizaComprobacion
+ Else
+ CvePrePolizaIERegistrado = drp("CvePrePoliza").ToString.ToEntero
+ End If
End If
End If
End If
@@ -544,7 +542,6 @@ Partial Class Compras_ReembolsosComprobaciones
If dr IsNot Nothing Then
CveMoneda = dr("CveMoneda").ToString.ToEntero
IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
- If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero
End If
If ChkChequeExcedente.Checked Then
@@ -568,7 +565,6 @@ Partial Class Compras_ReembolsosComprobaciones
If ObjMov.GetRetCuenta(30, CveCajaChica) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
- If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero
End If
End If
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
@@ -597,7 +593,6 @@ Partial Class Compras_ReembolsosComprobaciones
If ObjMov.GetRetCuenta(30, CveCajaChica) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
- If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero
End If
End If
Dim FolioIENew = ObjIE.GetNextFolio(If(CveCajaChica > 0, CveCajaChica, CvePersonal), 8).ToString
@@ -646,14 +641,12 @@ Partial Class Compras_ReembolsosComprobaciones
If ObjMov.GetRetCuenta(30, CveCajaChica) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
- If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaBancaria = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero
End If
End If
Else
If ObjMov.GetRetCuenta(29, CvePersonal) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaPersonal = ObjMov.DtResultados.Rows(0)("IdCtaContPersonal").ToString.ToEntero
- If UsuarioActual.Empresa.UsaContabilidadSIG Then CveCuentaPersonal = ObjMov.DtResultados.Rows(0)("IdCtaContableSIG").ToString.ToEntero
End If
End If
End If
@@ -933,6 +926,31 @@ Partial Class Compras_ReembolsosComprobaciones
End If
End If
End If
+ Case 5
+ ConceptoContableRetIVAXAcreditar = 285
+ ConceptoContableRetIVAAcreditable = 286
+ If IdCtaRetIVA > 0 Then
+ IdCtaContableRetIVAXAcreditar = IdCtaRetIVA
+ ElseIf UsuarioActual.Empresa.Funcionalidad(577).ToEntero > 0 Then
+ IdCtaContableRetIVAXAcreditar = UsuarioActual.Empresa.Funcionalidad(577).ToEntero
+ Else
+ If ObjMov.GetRetCuenta(ConceptoContableRetIVAXAcreditar, UsuarioActual.CveEmpresa) Then
+ If ObjMov.DtResultados.Rows.Count > 0 Then
+ IdCtaContableRetIVAXAcreditar = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
+ End If
+ End If
+ End If
+ If IdCtaRetIVA > 0 Then
+ IdCtaContableRetIVAAcreditable = IdCtaRetIVA
+ ElseIf UsuarioActual.Empresa.Funcionalidad(578).ToEntero > 0 Then
+ IdCtaContableRetIVAAcreditable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
+ Else
+ If ObjMov.GetRetCuenta(ConceptoContableRetIVAAcreditable, UsuarioActual.CveEmpresa) Then
+ If ObjMov.DtResultados.Rows.Count > 0 Then
+ IdCtaContableRetIVAAcreditable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
+ End If
+ End If
+ End If
End Select
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
If ImporteMovto = gvr.FCLiteral("LtlSaldo").Text.ToDouble Then
@@ -959,84 +977,7 @@ Partial Class Compras_ReembolsosComprobaciones
End If
End If
- 'If MsgError = "" AndAlso gvr.DataKey("RetISR").ToDecimal > 0 Then
- ' Dim ConceptoContableRetISRXAcreditar = 0, ConceptoContableRetISRAcreditable = 0, IdCtaContableRetISRXAcreditar = 0, IdCtaContableRetISRAcreditable = 0
- ' Select Case gvr.DataKey("CveRetISRConcepto").ToEntero
- ' Case 1
- ' ConceptoContableRetISRXAcreditar = 16
- ' ConceptoContableRetISRAcreditable = 23
- ' If IdCtaRetISR > 0 Then
- ' IdCtaContableRetISRXAcreditar = IdCtaRetISR
- ' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then
- ' IdCtaContableRetISRXAcreditar = UsuarioActual.Empresa.Funcionalidad(315).ToEntero
- ' Else
- ' If ObjMov.GetRetCuenta(ConceptoContableRetISRXAcreditar, UsuarioActual.CveEmpresa) Then
- ' If ObjMov.DtResultados.Rows.Count > 0 Then
- ' IdCtaContableRetISRXAcreditar = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
- ' End If
- ' End If
- ' End If
- ' If IdCtaRetISR > 0 Then
- ' IdCtaContableRetISRAcreditable = IdCtaRetISR
- ' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then
- ' IdCtaContableRetISRAcreditable = UsuarioActual.Empresa.Funcionalidad(308).ToEntero
- ' Else
- ' If ObjMov.GetRetCuenta(ConceptoContableRetISRAcreditable, UsuarioActual.CveEmpresa) Then
- ' If ObjMov.DtResultados.Rows.Count > 0 Then
- ' IdCtaContableRetISRAcreditable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
- ' End If
- ' End If
- ' End If
- ' Case 2
- ' ConceptoContableRetISRXAcreditar = 243
- ' ConceptoContableRetISRAcreditable = 244
- ' If IdCtaRetISR > 0 Then
- ' IdCtaContableRetISRXAcreditar = IdCtaRetISR
- ' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then
- ' IdCtaContableRetISRXAcreditar = UsuarioActual.Empresa.Funcionalidad(317).ToEntero
- ' Else
- ' If ObjMov.GetRetCuenta(ConceptoContableRetISRXAcreditar, UsuarioActual.CveEmpresa) Then
- ' If ObjMov.DtResultados.Rows.Count > 0 Then
- ' IdCtaContableRetISRXAcreditar = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
- ' End If
- ' End If
- ' End If
- ' If IdCtaRetISR > 0 Then
- ' IdCtaContableRetISRAcreditable = IdCtaRetISR
- ' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then
- ' IdCtaContableRetISRAcreditable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero
- ' Else
- ' If ObjMov.GetRetCuenta(ConceptoContableRetISRAcreditable, UsuarioActual.CveEmpresa) Then
- ' If ObjMov.DtResultados.Rows.Count > 0 Then
- ' IdCtaContableRetISRAcreditable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
- ' End If
- ' End If
- ' End If
- ' End Select
- ' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
- ' If ImporteMovto = gvr.FCLiteral("LtlSaldo").Text.ToDouble Then
- ' 'Agrego el RetISR
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("RetISR").ToDecimal, Referencia, ConceptoContableRetISRXAcreditar, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRXAcreditar, -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal) Then
- ' MsgError = "Detalle"
- ' End If
- ' 'Agrego el RetISR
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("RetISR").ToDecimal, Referencia, ConceptoContableRetISRAcreditable, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRAcreditable, -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal) Then
- ' MsgError = "Detalle"
- ' End If
- ' End If
- ' Else
- ' 'Agrego el RetISR
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("RetISR").ToDecimal * PorcentajePago, Referencia, ConceptoContableRetISRXAcreditar, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRXAcreditar, -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal) Then
- ' MsgError = "Detalle"
- ' End If
-
- ' 'Agrego el RetISR
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("RetISR").ToDecimal * PorcentajePago, Referencia, ConceptoContableRetISRAcreditable, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRAcreditable, -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal) Then
- ' MsgError = "Detalle"
- ' End If
- ' End If
- 'End If
Dim SaldoExcedente As Double = gvr.FCTextBox("TxtSaldoExcedente").Text.ToDecimal
@@ -1282,71 +1223,6 @@ Partial Class Compras_ReembolsosComprobaciones
End If
End If
- 'If MsgError = "" AndAlso gvr.DataKey("RetISR").ToDecimal > 0 Then
- ' Dim ConceptoContableRetISRXAcreditar = 0, ConceptoContableRetISRAcreditable = 0, IdCtaContableRetISRXAcreditar = 0, IdCtaContableRetISRAcreditable = 0
- ' Select Case gvr.DataKey("CveRetISRConcepto").ToEntero
- ' Case 1
- ' ConceptoContableRetISRXAcreditar = 16
- ' ConceptoContableRetISRAcreditable = 23
- ' If IdCtaRetISR > 0 Then
- ' IdCtaContableRetISRXAcreditar = IdCtaRetISR
- ' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then
- ' IdCtaContableRetISRXAcreditar = UsuarioActual.Empresa.Funcionalidad(315).ToEntero
- ' Else
- ' If ObjMov.GetRetCuenta(ConceptoContableRetISRXAcreditar, UsuarioActual.CveEmpresa) Then
- ' If ObjMov.DtResultados.Rows.Count > 0 Then
- ' IdCtaContableRetISRXAcreditar = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
- ' End If
- ' End If
- ' End If
- ' If IdCtaRetISR > 0 Then
- ' IdCtaContableRetISRAcreditable = IdCtaRetISR
- ' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then
- ' IdCtaContableRetISRAcreditable = UsuarioActual.Empresa.Funcionalidad(308).ToEntero
- ' Else
- ' If ObjMov.GetRetCuenta(ConceptoContableRetISRAcreditable, UsuarioActual.CveEmpresa) Then
- ' If ObjMov.DtResultados.Rows.Count > 0 Then
- ' IdCtaContableRetISRAcreditable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
- ' End If
- ' End If
- ' End If
- ' Case 2
- ' ConceptoContableRetISRXAcreditar = 243
- ' ConceptoContableRetISRAcreditable = 244
- ' If IdCtaRetISR > 0 Then
- ' IdCtaContableRetISRXAcreditar = IdCtaRetISR
- ' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then
- ' IdCtaContableRetISRXAcreditar = UsuarioActual.Empresa.Funcionalidad(317).ToEntero
- ' Else
- ' If ObjMov.GetRetCuenta(ConceptoContableRetISRXAcreditar, UsuarioActual.CveEmpresa) Then
- ' If ObjMov.DtResultados.Rows.Count > 0 Then
- ' IdCtaContableRetISRXAcreditar = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
- ' End If
- ' End If
- ' End If
- ' If IdCtaRetISR > 0 Then
- ' IdCtaContableRetISRAcreditable = IdCtaRetISR
- ' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then
- ' IdCtaContableRetISRAcreditable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero
- ' Else
- ' If ObjMov.GetRetCuenta(ConceptoContableRetISRAcreditable, UsuarioActual.CveEmpresa) Then
- ' If ObjMov.DtResultados.Rows.Count > 0 Then
- ' IdCtaContableRetISRAcreditable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
- ' End If
- ' End If
- ' End If
- ' End Select
-
- ' 'Agrego el RetISR
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, False, gvr.DataKey("RetISR").ToDecimal * PorcentajePago, Referencia, ConceptoContableRetISRXAcreditar, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRXAcreditar, -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaExcedente, CvePersonal:=CvePersonal) Then
- ' MsgError = "Detalle"
- ' End If
-
- ' 'Agrego el RetISR
- ' If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, True, gvr.DataKey("RetISR").ToDecimal * PorcentajePago, Referencia, ConceptoContableRetISRAcreditable, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaContableRetISRAcreditable, -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("RetISR").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaExcedente, CvePersonal:=CvePersonal) Then
- ' MsgError = "Detalle"
- ' End If
- 'End If
End If
@@ -1408,31 +1284,6 @@ Partial Class Compras_ReembolsosComprobaciones
AutoConta = False
End If
- If AutoConta And MsgError.Trim = "" AndAlso UsuarioActual.Empresa.UsaContabilidadSIG Then
- If CvePrePolizaIERegistrado > 0 Then
- If UsuarioActual.Empresa.UsaContabilidadSIG AndAlso CveCuentaPersonal > 0 Then
- If UsuarioActual.Empresa.UsaContabilidadSIG AndAlso CveCuentaProveedor > 0 Then
-
- Else
- MsgError = "No tiene cuenta contable SIG de proveedor"
- End If
- Else
- MsgError = "No tiene cuenta contable SIG de personal"
- End If
- End If
-
- If ChkChequeExcedente.Checked Then
- If UsuarioActual.Empresa.UsaContabilidadSIG AndAlso CveCuentaBancaria > 0 Then
- If UsuarioActual.Empresa.UsaContabilidadSIG AndAlso CveCuentaProveedor > 0 Then
-
- Else
- MsgError = "No tiene cuenta contable SIG de proveedor"
- End If
- Else
- MsgError = "No tiene Cuenta contable SIG Bancaria"
- End If
- End If
- End If
'Conta ContPAQ AUTOMATICA
If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError.Trim = "" Then
@@ -1626,6 +1477,7 @@ Partial Class Compras_ReembolsosComprobaciones
ObjMovtos.GetCxPPersonalCajaChica(UsuarioActual.CveEmpresa, CvePersonal, CveCajaChica, If(TxtNumeroReembolso.Text.Trim = "", "-1", TxtNumeroReembolso.Text.Trim))
DtDatos = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0")
GvCxP.DataSource = DtDatos
+ CvePrePolizaComprobacion = DtDatos.MAX("CvePrePolizaComprobacion").ToEntero
'Limpia Ddl Chequesventas
DDlCheques.Items.Clear()
diff --git a/Compras/RepCxP.aspx b/Compras/RepCxP.aspx
index 666f8cd15..bb70141e5 100644
--- a/Compras/RepCxP.aspx
+++ b/Compras/RepCxP.aspx
@@ -253,13 +253,6 @@
-
-
Ver por meses:
-
-
-
-
-
@@ -269,11 +262,16 @@
-
- Moneda:
+
+
Ver por meses:
+
+
+
-
-
+
+ Moneda:
+
+
diff --git a/Contabilidad/FiltraPolizas.aspx.vb b/Contabilidad/FiltraPolizas.aspx.vb
index b1477c7c3..5c37015df 100644
--- a/Contabilidad/FiltraPolizas.aspx.vb
+++ b/Contabilidad/FiltraPolizas.aspx.vb
@@ -26,33 +26,18 @@ Partial Class Contabilidad_FiltraPolizas
End Property
- Public Property ContabilidadSIG As Boolean
- Get
- If ViewState("ContabilidadSIG") Is Nothing Then
- ViewState("ContabilidadSIG") = False
- End If
-
- Return Boolean.Parse(ViewState("ContabilidadSIG").ToString)
-
- End Get
- Set(value As Boolean)
- ViewState("ContabilidadSIG") = value
- End Set
- End Property
-
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
- ContabilidadSIG = UsuarioActual.Empresa.UsaContabilidadSIG
ViewState("Orden") = ""
DdlPeriodo.SelectedValue = Now.Month.ToString
TxtFechaICredito.Text = Now.FirstDayOfMonth.ToShortDateString
TxtFechaFCredito.Text = Now.LastDayOfMonth.ToShortDateString
- If UsuarioActual.Empresa.UsaContabilidad Or ContabilidadSIG Then
+ If UsuarioActual.Empresa.UsaContabilidad OrElse UsuarioActual.Empresa.TipoContabilidad > 0 Then
CargaSegmentoNeg()
CargaEjercicios()
@@ -81,7 +66,7 @@ Partial Class Contabilidad_FiltraPolizas
Dim Ejercicio As Integer = DdlEjercicio.SelectedValue.ToString().ToEntero()
Dim Periodo As Integer = DdlPeriodo.SelectedValue.ToString().ToEntero()
- If ContabilidadSIG Then
+ If UsuarioActual.Empresa.TipoContabilidad = 1 Then
Dim ObjConta As New ClsContabilidad
@@ -123,7 +108,7 @@ Partial Class Contabilidad_FiltraPolizas
DdlSegmentoNeg.Items.Clear()
- If ContabilidadSIG Then
+ If UsuarioActual.Empresa.TipoContabilidad = 1 Then
DdlSegmentoNeg.DataValueField = "CveSubProyecto"
DdlSegmentoNeg.DataTextField = "SubProyecto"
DdlSegmentoNeg.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
@@ -148,7 +133,7 @@ Partial Class Contabilidad_FiltraPolizas
DdlEjercicio.Items.Clear()
- If ContabilidadSIG Then
+ If UsuarioActual.Empresa.TipoContabilidad = 1 Then
Dim ObjConta As New ClsContabilidad
@@ -603,7 +588,7 @@ Partial Class Contabilidad_FiltraPolizas
If e.Row.RowType = DataControlRowType.DataRow Then
- If ContabilidadSIG Then
+ If UsuarioActual.Empresa.TipoContabilidad = 1 Then
e.Row.Cells(2).Text = $"{e.Row.DataKey("Folio")}"
e.Row.Cells(6).Text = $""
diff --git a/Contabilidad/PolizasImpresion.aspx.vb b/Contabilidad/PolizasImpresion.aspx.vb
index ad1f7f81f..cc9a97589 100644
--- a/Contabilidad/PolizasImpresion.aspx.vb
+++ b/Contabilidad/PolizasImpresion.aspx.vb
@@ -28,7 +28,7 @@ Partial Class Contabilidad_PolizasImpresion
If Not IsPostBack Then
- ContabilidadSIG = UsuarioActual.Empresa.UsaContabilidadSIG
+ ContabilidadSIG = UsuarioActual.Empresa.TipoContabilidad = 1
TxtFechaInicio.Text = Now.AddDays(-1).ToShortDateString
TxtFechaFin.Text = Now.ToShortDateString
diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx
index 218ddd031..f53ec254c 100644
--- a/Contabilidad/RegPrePolizaS.aspx
+++ b/Contabilidad/RegPrePolizaS.aspx
@@ -606,8 +606,7 @@
<%----%>
<%-- --%>
-
-
+
TipoGasto
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb
index b0404e0a8..979dc9b22 100644
--- a/Contabilidad/RegPrePolizaS.aspx.vb
+++ b/Contabilidad/RegPrePolizaS.aspx.vb
@@ -2399,7 +2399,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"))).ToEntero ' Row("CveConceptoContable").ToString.ToEntero
+ 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
diff --git a/Contabilidad/RepAnexoCatalogo.aspx.vb b/Contabilidad/RepAnexoCatalogo.aspx.vb
index bb8aba1fe..3cd3a76cd 100644
--- a/Contabilidad/RepAnexoCatalogo.aspx.vb
+++ b/Contabilidad/RepAnexoCatalogo.aspx.vb
@@ -282,7 +282,7 @@ Partial Class AC_RepAnexoCatalogo
e.Row.FCHyperLink("HLSaldoActual").ForeColor = Drawing.Color.Red
End If
- e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?ID={0}&FI={1}&FF={2}", e.Row.DBCampo("ID"), FechaInicio.ToShortDateString, FechaFin.ToShortDateString)
+ e.Row.FCHyperLink("HLSaldoActual").NavigateUrl = String.Format("/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx?ID={0}&FI={1}&FF={2}&IdSegNeg={3}", e.Row.DBCampo("ID"), FechaInicio.ToShortDateString, FechaFin.ToShortDateString, DdlSegmentoNegocio.SelectedValue.ToEntero)
End If
End Sub
#End Region
diff --git a/Contabilidad/RepAnexoCatalogoSegmento.aspx.vb b/Contabilidad/RepAnexoCatalogoSegmento.aspx.vb
index 30f7d6f89..2e02836e7 100644
--- a/Contabilidad/RepAnexoCatalogoSegmento.aspx.vb
+++ b/Contabilidad/RepAnexoCatalogoSegmento.aspx.vb
@@ -18,6 +18,20 @@ Partial Class AC_RepAnexoCatalogoSegmento
ViewState("DtDatos") = value
End Set
End Property
+
+ Private Property DTCabeceras As DataTable
+ Get
+ DTCabeceras = DirectCast(ViewState("DTCabeceras"), DataTable)
+ End Get
+
+ Set(ByVal value As DataTable)
+ ViewState("DTCabeceras") = value
+ End Set
+ End Property
+
+
+
+
Private Property FechaInicio As Date
Get
FechaInicio = ViewState("FechaInicio").ToString.ToDate
@@ -225,7 +239,7 @@ Partial Class AC_RepAnexoCatalogoSegmento
Private Sub CargaDatos()
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
- Dim DTCabeceras As New DataTable
+ 'Dim DTCabeceras As New DataTable
TipoReporte = If(TipoReporte = -1, -1, DdlTipoReporte.SelectedValue.ToEntero)
If ObjConta.GetEstadoActividadesSegmentoDetalle(FechaInicio, FechaFin, IdCuenta, Segmentos) Then
@@ -250,17 +264,15 @@ Partial Class AC_RepAnexoCatalogoSegmento
CType(GvDatos.Columns(IndexGV), BoundField).DataField = Dr("id").ToString
GvDatos.Columns(IndexGV).HeaderText = Dr("Nombre").ToString
-
GvDatos.Columns(IndexGV).Visible = True
CType(GvDatos.Columns(IndexGV), BoundField).DataField = Dr("id").ToString
GvDatos.Columns(IndexGV).HeaderText = Dr("Nombre").ToString
-
-
IndexActual = IndexActual + 1
If IndexGV >= 200 Then
Exit For
End If
+
Next
@@ -292,6 +304,25 @@ Partial Class AC_RepAnexoCatalogoSegmento
End If
+ Dim IndexActual As Integer = 0
+ For Each Dr As DataRow In DTCabeceras.Rows
+
+ Dim IndexGV As Integer = 3 + IndexActual
+
+
+
+ e.Row.Cells(IndexGV).Text = $"{e.Row.Cells(IndexGV).Text }"
+
+
+
+ IndexActual = IndexActual + 1
+ If IndexGV >= 200 Then
+ Exit For
+ End If
+
+ Next
+
+
End If
End Sub
#End Region
diff --git a/Contabilidad/RepFlujoEfectivo.aspx b/Contabilidad/RepFlujoEfectivo.aspx
new file mode 100644
index 000000000..71572a776
--- /dev/null
+++ b/Contabilidad/RepFlujoEfectivo.aspx
@@ -0,0 +1,115 @@
+<%@ Page Title="Reporte Flujo de Efectivo" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepFlujoEfectivo.aspx.vb" Inherits="Contabilidad_RepFlujoEfectivo" %>
+
+
+
+
+
+
+
+
+ Reporte Flujo de Efectivo
+
+
+
+
+ Exporta Excel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%--
Fecha Inicio:
+
+
+
+
+
+
+
+
+
+
--%>
+
Fecha Fin:
+
+
+
+
+
+
+
+
+
+
+
Tipo:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Contabilidad/RepFlujoEfectivo.aspx.vb b/Contabilidad/RepFlujoEfectivo.aspx.vb
new file mode 100644
index 000000000..eaa2fd164
--- /dev/null
+++ b/Contabilidad/RepFlujoEfectivo.aspx.vb
@@ -0,0 +1,178 @@
+Option Explicit On
+Option Strict On
+
+Imports System.Data
+Imports Extensiones
+Imports Microsoft.Reporting.WebForms
+Imports System.IO
+Imports iTextSharp.text
+Imports iTextSharp.text.html.simpleparser
+Imports iTextSharp.text.pdf
+
+Partial Class Contabilidad_RepFlujoEfectivo
+ Inherits ClsPaginas
+
+#Region "PROPIEDADES"
+ Private Property DtDatos As DataTable
+ Get
+ DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
+ End Get
+
+ Set(ByVal value As DataTable)
+ ViewState("DtDatos") = value
+ End Set
+ End Property
+ Private Property TotalActual As Double
+ Get
+ TotalActual = ViewState("TotalActual").ToString.ToDouble
+ End Get
+ Set(value As Double)
+ ViewState("TotalActual") = value
+ End Set
+ End Property
+ Private Property TotalAnterior As Double
+ Get
+ TotalAnterior = ViewState("TotalAnterior").ToString.ToDouble
+ End Get
+ Set(value As Double)
+ ViewState("TotalAnterior") = value
+ End Set
+ End Property
+
+ Private Property FechaAl As String
+ Get
+ FechaAl = ViewState("FechaAl").ToString
+ End Get
+ Set(value As String)
+ ViewState("FechaAl") = value
+ End Set
+ End Property
+#End Region
+
+ Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
+ If Not Page.IsPostBack Then
+
+
+ 'TxtFechaDel.Text = DateSerial(Year(Now), Month(Now), 1).ToShortDateString
+ TxtFechaAl.Text = Date.Now.ToShortDateString
+
+ CargaDatos()
+
+ BtnConsultar.Enabled = True
+
+ End If
+
+ End Sub
+
+#Region "CARGA DATOS Y GRID"
+ Private Sub CargaDatos()
+ Dim ObjConta As New ClsContabilidad
+
+ 'Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate)
+ Dim FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate)
+
+ FechaAl = TxtFechaAl.Text
+
+ If ObjConta.GetFlujoEfectivo2(FechaFin, DdlTipo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
+ DtDatos = ObjConta.DtResultados
+ Else
+ DtDatos = Nothing
+ Alert("Ocurrio un error al cargar los datos del Estado de Flujo de Efectivo", TipoMensaje.MsgError)
+ End If
+
+ ObjConta.Dispose()
+
+ GvDatos.DataSource = DtDatos
+ GvDatos.DataBind()
+ UpDatos.Update()
+
+ End Sub
+
+#End Region
+
+ Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
+ CargaDatos()
+ End Sub
+
+
+ Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ 'PARA PONER AÑO EN HEADER
+ If e.Row.RowIndex = 0 Then
+ GvDatos.HeaderRow.FCLabel("LbPeriodoActual").Text = e.Row.DBCampo("Actual")
+ GvDatos.HeaderRow.FCLabel("LbPeriodoAnterior").Text = e.Row.DBCampo("Anterior")
+ End If
+
+ 'TITULO DE BLOQUE (CABECERAS Y TOTALES)
+ If e.Row.DBCampo("Level") = "-1" Then
+ CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-top:20px; ")
+ e.Row.Font.Bold = True
+
+ 'CABCERA
+ If e.Row.DBCampo("Id") = "12" Then
+ e.Row.FCLabel("LbActual").Text = ""
+ e.Row.FCLabel("LbAnterior").Text = ""
+ End If
+
+ 'TOTAL OPERACIONES
+ If e.Row.DBCampo("Id") = "123" Then
+ e.Row.FCLabel("LbActual").Text = TotalActual.ToString.FormatoNumero
+ e.Row.FCLabel("LbAnterior").Text = TotalAnterior.ToString.FormatoNumero
+ End If
+
+ End If
+
+ 'ORIGEN Y APLICACION
+ If e.Row.DBCampo("Level") = "0" Then
+ CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-left:30px; margin-top:15px")
+ e.Row.Font.Bold = True
+ End If
+
+ 'PAPAS
+ If e.Row.DBCampo("Level") = "2" Then
+ CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-left: 60px; margin-top:5px;")
+ End If
+
+ 'HIJOS
+ If e.Row.DBCampo("Level") = "3" Then
+ CType(e.Row.FindControl("Concepto"), HtmlControl).Attributes.Add("style", "margin-left:90px;")
+ End If
+
+ 'INGRESOS -> ORIGEN
+ If e.Row.DBCampo("Codigo").ToString.Substring(0, 5) = "00004" Then e.Row.FCLiteral("LtNombre").Text = "ORIGEN"
+
+ 'GASTOS -> APLICACION
+ If e.Row.DBCampo("Codigo").ToString.Substring(0, 5) = "00005" Then e.Row.FCLiteral("LtNombre").Text = "APLICACION"
+
+
+
+ 'ACTIVIDADES DE OPERACION
+ If e.Row.DBCampo("Sup").ToString <> "" Then
+ If e.Row.DBCampo("ImporteAnterior").ToString.ToDecimal = 0 Then
+ e.Row.FCLabel("LbAnterior").Text = ""
+ End If
+ If e.Row.DBCampo("ImporteActual").ToString.ToDecimal = 0 Then
+ e.Row.FCLabel("LbActual").Text = ""
+ End If
+ End If
+
+
+ End If
+ End Sub
+
+
+ Public Overrides Sub VerifyRenderingInServerForm(control As Control)
+
+ End Sub
+
+
+
+ Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
+
+ GvDatos.ExportToExcel2("RepFlujosDeEfectivo.xlsx")
+ End Sub
+
+
+
+End Class
diff --git a/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx b/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx
index 8dec8d81c..eb419142f 100644
--- a/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx
+++ b/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx
@@ -83,9 +83,15 @@
>
-
+
-
+
+
+
+
+
+
+
diff --git a/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx.vb b/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx.vb
index e9dbdeb0f..937506849 100644
--- a/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx.vb
+++ b/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx.vb
@@ -52,6 +52,21 @@ Partial Class AC_RepMovimientosAuxiliaresCatalogo
ViewState("IdCuenta") = value
End Set
End Property
+
+ Private Property IdSegNeg As Integer
+ Get
+ If ViewState("IdSegNeg") Is Nothing Then
+ ViewState("IdSegNeg") = -1
+ End If
+
+ Return ViewState("IdSegNeg").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("IdSegNeg") = value
+ End Set
+ End Property
+
+
Private Property TotalPadre As Boolean
Get
TotalPadre = CBool(ViewState("TotalPadre"))
@@ -78,14 +93,19 @@ Partial Class AC_RepMovimientosAuxiliaresCatalogo
Dim ErrorParametros = True
CargaTipoCuentas()
+ CargaMoneda()
+ CargaSegmentosNegocio()
+
TxtCuenta.Enabled = False
- DdlMoneda.DataSource = GlobalDTMonedas
- DdlMoneda.DataBind()
If Request("ID") IsNot Nothing AndAlso IsNumeric(Request("ID")) AndAlso Request("ID").ToEntero > 0 Then
If Request("FF") IsNot Nothing AndAlso Request("FF").ToString.Length = 10 AndAlso Request("FF").ToDate > "01/01/1000".ToDate Then
+
IdCuenta = Request("ID").ToEntero
+
+ IdSegNeg = If(Request("IdSegNeg") IsNot Nothing AndAlso Request("IdSegNeg").ToString.ToEntero > 0, Request("IdSegNeg").ToString.ToEntero, -1)
+
HdnCveCuenta.Value = IdCuenta.ToString
FechaFin = Request("FF").ToDate
@@ -113,6 +133,8 @@ Partial Class AC_RepMovimientosAuxiliaresCatalogo
End If
End If
+ DdlSegmentoNegocio.SelectedValueExist(IdSegNeg)
+
End If
End If
@@ -128,6 +150,27 @@ Partial Class AC_RepMovimientosAuxiliaresCatalogo
End If
End Sub
+
+ Private Sub CargaSegmentosNegocio()
+ Dim ObjContpaq As New ClsContPAQi(UsuarioActual.Empresa)
+ Dim strGlobal As String = ""
+
+ If ObjContpaq.GetSegmentosNegocio(-1, "-1") Then
+ DdlSegmentoNegocio.DataSource = ObjContpaq.DtResultados
+ DdlSegmentoNegocio.DataBind()
+ End If
+ ObjContpaq.Dispose()
+ DdlSegmentoNegocio.Items.Insert(0, New ListItem("Todos", "-1"))
+ DdlSegmentoNegocio.SelectedValue = "-1"
+ End Sub
+
+
+ Private Sub CargaMoneda()
+ DdlMoneda.DataSource = GlobalDTMonedas
+ DdlMoneda.DataBind()
+
+ End Sub
+
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate)
@@ -178,7 +221,7 @@ Partial Class AC_RepMovimientosAuxiliaresCatalogo
Private Sub CargaDatos()
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa, 60)
- If ObjConta.GetMovimientosAuxiliaresCatalogo(IdCuenta, FechaInicio, FechaFin, DdlMoneda.SelectedValue.ToEntero) Then
+ If ObjConta.GetMovimientosAuxiliaresCatalogo(IdCuenta, FechaInicio, FechaFin, DdlMoneda.SelectedValue.ToEntero, DdlSegmentoNegocio.SelectedValue.ToEntero) Then
'DtTotales = DtDatos.Clone
DtDatos = ObjConta.DtResultados
CargaGrid()
diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx
index c48771d03..da44a42c5 100644
--- a/Contabilidad2/CatCuentasAsignaciones.aspx
+++ b/Contabilidad2/CatCuentasAsignaciones.aspx
@@ -57,6 +57,11 @@