diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 46a58a11a..6ffc5438a 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -1552,7 +1552,7 @@ Public Class ClsClientes Return Retorno End Function - Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, Estado As String, Pais As String, RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer, NumCuentaPago As String) As Boolean + Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, Estado As String, Pais As String, RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer, NumCuentaPago As String, Optional CvePrecioLista As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClientesNoFrecuenteAdd") @@ -1574,6 +1574,7 @@ Public Class ClsClientes .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago + .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista End With diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index af57333b1..aac53b30f 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1700,10 +1700,32 @@ Public Class ClsInventarios End Try Return Retorno - End Function + End Function + + Public Function RepTraspasoAlmacen(FechaI As Date, FechaF As Date, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, Recibido As Boolean, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_RepTraspasoAlmacen") + With SqlAdapter.SelectCommand.Parameters + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF + .Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen + .Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino + .Add("@Recibido", SqlDbType.Bit).Value = Recibido + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el Reporte de Traspaso de Almacén.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function #End Region - + #Region " INVENTARIOS - EXISTENCIAS " Public Function GetExistenciasPS(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, CveAlmacen As Integer, Optional CveSeccionAlmacen As Integer = -1, Optional CveTipoAlmacen As Integer = -1, Optional CveSubProyecto As Integer = -1, @@ -1889,8 +1911,8 @@ Public Class ClsInventarios Catch ex As Exception OnError("Ocurrió un error al obtener las existencias del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try - Return Retorno + End Function Public Function GetExistenciasPSEmpaque(CvePS As Integer, CveUnidadMedida As Integer, CveEmpresa As Integer, @@ -1965,11 +1987,11 @@ Public Class ClsInventarios End Try Return Retorno - End Function + End Function #End Region - + #Region " INVENTARIOS - INVENTARIO FISICO " - + Public Function AddInventarioFisico(CveEmpresa As Integer, InventarioFisico As String, Observaciones As String, Estatus As Integer, CveSubProyecto As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 44c68fdc5..39e5d6f62 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4091,6 +4091,7 @@ Public Class ClsPaginas ' PaginaDict.Add("/Inventarios/RecepcionUsados.aspx".ToUpper(), 1202) PaginaDict.Add("/Inventarios/RepTraspasoEmitido.aspx".ToUpper(), 891) PaginaDict.Add("/Inventarios/KardexSeccionAlmacen.aspx".ToUpper(), 892) + PaginaDict.Add("/Inventarios/RepTraspasoAlmacen.aspx".ToUpper(), 688) #End Region #Region "MF" PaginaDict.Add("/MF/BitacoraDiaria.aspx".ToUpper(), 801) diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 7aa66e67c..022ef5ff0 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -3299,7 +3299,8 @@ Public Class ClsRH .Add("@CveTurno", SqlDbType.Int).Value = RHRequerido.CveTurno .Add("@Cantidad", SqlDbType.Int).Value = RHRequerido.Cantidad .Add("@CveUsuario", SqlDbType.Int).Value = RHRequerido.CveUsuario - .Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa + .Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa + .Add("@CveDepartamento", SqlDbType.Int).Value = RHRequerido.CveDepartamento End With Try @@ -3320,7 +3321,9 @@ Public Class ClsRH .Add("@CveRequerimiento", SqlDbType.Int).Value = RHRequerido.CveRequerimiento .Add("@CveSubProyecto", SqlDbType.Int).Value = RHRequerido.CveSubProyecto .Add("@CveTurno", SqlDbType.Int).Value = RHRequerido.CveTurno - .Add("@Cantidad", SqlDbType.Int).Value = RHRequerido.Cantidad + .Add("@Cantidad", SqlDbType.Int).Value = RHRequerido.Cantidad + .Add("@CveEmpresa", SqlDbType.Int).Value = RHRequerido.CveEmpresa + .Add("@CveDepartamento", SqlDbType.Int).Value = RHRequerido.CveDepartamento End With Try @@ -3332,12 +3335,16 @@ Public Class ClsRH Return Retorno End Function - Public Function RemovePersonalRequerido(CveRequerimiento As Integer) As Boolean + Public Function RemovePersonalRequerido(CveRequerimiento As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False - - DataAdapter("PA_RH_PersonalRequeridoRemove") - - SqlAdapter.SelectCommand.Parameters.Add("@CveRequerimiento", SqlDbType.Int).Value = CveRequerimiento + + DataAdapter("PA_RH_PersonalRequeridoRemove") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveRequerimiento", SqlDbType.Int).Value = CveRequerimiento + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + End With Try @@ -3354,12 +3361,12 @@ Public Class ClsRH End Try Return Retorno - End Function - + End Function + #End Region - + #Region "ClsRHReportePersonalNecesidades" - Public Function GetReportePersonalNecesidades(CveTurno As Integer, CveProyecto As Integer, tCveSubProyeto As Integer, Estatus As Integer, CveEmpresa As Integer) As Boolean + Public Function GetReportePersonalNecesidades(CveTurno As Integer, CveProyecto As Integer, tCveSubProyeto As Integer, Estatus As Integer, CveEmpresa As Integer, CveDepartamento As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_Rep_NecesidadesPersonal") @@ -3369,6 +3376,7 @@ Public Class ClsRH .Add("@CveSubProyecto", SqlDbType.Int).Value = tCveSubProyeto .Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveDepartamento", SqlDbType.Int).Value = CveDepartamento End With Try @@ -3378,9 +3386,9 @@ Public Class ClsRH OnError("Ocurrió un error al obtener el Reporte de Necesidades de Personal", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return Retorno - End Function + End Function #End Region - + #Region "ClsRHReporteRotacionPersonal" Public Function GetReporteRotacionPersonal(FechaInicio As Date, FechaFin As Date, CveTurno As Integer, CveProyecto As Integer, CveSubProyeto As Integer, CveEmpresa As Integer) As Boolean @@ -4287,7 +4295,7 @@ Public Class ClsRH End Function - Public Function PersonalFamiliaresAdd(CvePersonal As Integer, Parentestco As Integer, Nombre As String, Domicilio As String, Edad As Integer, Ocupacion As String, CveUsuario As Integer, CveEmpresa As Integer, Telefono As String, Observaciones As String) As Boolean + Public Function PersonalFamiliaresAdd(CvePersonal As Integer, Parentestco As Integer, Nombre As String, Domicilio As String, Edad As Integer, Ocupacion As String, CveUsuario As Integer, CveEmpresa As Integer, Telefono As String, Observaciones As String, Optional Beneficiario As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_PersonalFamiliaresAdd") @@ -4302,7 +4310,9 @@ Public Class ClsRH .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Telefono", SqlDbType.VarChar).Value = Telefono - .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@Beneficiario", SqlDbType.Bit).Value = Beneficiario + End With Try @@ -4318,7 +4328,7 @@ Public Class ClsRH End Function - Public Function PersonalFamiliaresUpdate(CveFamiliar As Integer, CvePersonal As Integer, Parentestco As Integer, Nombre As String, Domicilio As String, Edad As Integer, Ocupacion As String, CveUsuario As Integer, CveEmpresa As Integer, Telefono As String, Observaciones As String) As Boolean + Public Function PersonalFamiliaresUpdate(CveFamiliar As Integer, CvePersonal As Integer, Parentestco As Integer, Nombre As String, Domicilio As String, Edad As Integer, Ocupacion As String, CveUsuario As Integer, CveEmpresa As Integer, Telefono As String, Observaciones As String, Optional Beneficiario As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_PersonalFamiliaresUpdate") @@ -4335,6 +4345,9 @@ Public Class ClsRH .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@Telefono", SqlDbType.VarChar).Value = Telefono .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones + .Add("@Beneficiario", SqlDbType.Int).Value = Beneficiario + + End With Try diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 60dea2804..34e8e1235 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2452,13 +2452,13 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetRepCotizacionesSinFacturar(FechaI As String, FechaF As String, CveSubProyecto As String, CveCliente As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1) As Boolean + Public Function GetRepCotizacionesSinFacturar(FechaI As Date, FechaF As Date, CveSubProyecto As String, CveCliente As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepCotizacionesSinFacturarGet") With SqlAdapter.SelectCommand.Parameters - .Add("@FechaI", SqlDbType.VarChar).Value = FechaI - .Add("@FechaF", SqlDbType.VarChar).Value = FechaF + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -2474,13 +2474,13 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetRepRemisionesNCSinFacturar(FechaI As String, FechaF As String, CveSubProyecto As String, CveCliente As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1) As Boolean + Public Function GetRepRemisionesNCSinFacturar(FechaI As Date, FechaF As Date, CveSubProyecto As String, CveCliente As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepRemisionesNCGet") With SqlAdapter.SelectCommand.Parameters - .Add("@FechaI", SqlDbType.VarChar).Value = FechaI - .Add("@FechaF", SqlDbType.VarChar).Value = FechaF + .Add("@FechaI", SqlDbType.Date).Value = FechaI + .Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@CveSubProyecto", SqlDbType.VarChar).Value = CveSubProyecto .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa @@ -3973,6 +3973,92 @@ Public Class ClsVentas Return retorno End Function #End Region + +#Region " U S A D O S " + + Public Function AddVentaUsado(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_VentasUsadosAdd", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Cantidad", SqlDbType.Float).Value = Cantidad + .Add("@PU", SqlDbType.Money).Value = PU + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al relacionar las ventas con los usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetVentasUsados(CveVenta As Integer, CveSubProyecto As Integer, Fecha As DateTime, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_VentasUsadosGet", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las ventas con usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetVentasUsadosDetalle(CveVenta As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_VentasUsadosDetalleGet", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las ventas con usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function UpdateVentaUsadoRecibido(CveVenta As Integer, CvePS As Integer, Recibido As Boolean) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_VentasUsadosRecibidoUpdate", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@Recibido", SqlDbType.Bit).Value = Recibido + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar el recibo de los usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + +#End Region #Region "IDisposable Support" diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index f77aa9e8d..06f6f4033 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1230,7 +1230,7 @@ Namespace Modelos End If - If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta) Then + If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta, ObjVentas) Then ErrorList.Add("Error al guardar usados") End If @@ -1408,7 +1408,7 @@ Namespace Modelos End If End If - If ErrorList.Count = 0 Then + If ErrorList.Count = 0 AndAlso factura.TipoDocto.Contiene("Ing", "Ant") Then 'Agregamos las remisiones a la tabla If factura.DtRemisionesPS IsNot Nothing AndAlso factura.DtRemisionesPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then Dim CveVentaDetalle As Integer = 0 @@ -1480,7 +1480,7 @@ Namespace Modelos 'inventarios GuardarVentaInventarios(factura, ObjInventario, ObjConta) - GuardaRecepcionUsados(factura, ObjInventario, ObjConta) + 'GuardaRecepcionUsados(factura, ObjInventario, ObjConta) If ErrorList.Count = 0 Then 'estimaciones @@ -1755,36 +1755,50 @@ Namespace Modelos DtVentasNC.Rows.Add(Dr) End If End Sub - Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer) As Boolean - Dim Resultado As Boolean = True - - If ClienteEsDistribuidor Then - If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 Then - Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero - - Dim ObjAcum As New ClsAcumuladores(SqlTransaccion) - - - For Each drow As DataRow In DtDetalle.Rows - If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then - If ObjAcum.DistribuidorMovtosAdd(CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, 2, CveVenta, UsuarioActual.CveUsuario, - UsuarioActual.CveEmpresa, 0D, "") Then - Else - Resultado = False - Exit For - End If - Else - Resultado = True - End If - Next - Else - ErrorList.Add("El cliente es Distribuidor y no se tiene un producto o servicio asigando como PS Acumulador") - Resultado = False - End If - Else - Resultado = True - End If - + Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer, ByRef ObjVentas As ClsVentas) As Boolean + Dim Resultado As Boolean = True + + 'If ClienteEsDistribuidor Then + If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 Then + Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero + + Dim ObjAcum As New ClsAcumuladores(SqlTransaccion) + + For Each drow As DataRow In DtDetalle.Rows + If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then + If ObjAcum.DistribuidorMovtosAdd(CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, 2, CveVenta, UsuarioActual.CveUsuario, + UsuarioActual.CveEmpresa, 0D, "") Then + Else + Resultado = False + Exit For + End If + Else + Resultado = True + End If + Next + + If TipoDocto.Contiene("Rem") Then + If DtRecepcionUsados IsNot Nothing Then + For Each drow As DataRow In DtRecepcionUsados.Rows + If Not ObjVentas.AddVentaUsado(CveVenta, drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal) Then + Resultado = False + Exit For + End If + Next + Else + Resultado = False + End If + End If + + + Else + ErrorList.Add("El cliente es Distribuidor y no se tiene un producto o servicio asigando como PS Acumulador") + Resultado = False + End If + 'Else + ' Resultado = True + 'End If + Return Resultado End Function @@ -8585,6 +8599,7 @@ Namespace Modelos CveTurno = -1 CveUsuario = -1 CveEmpresa = -1 + CveDepartamento = -1 End Sub Public Property CveRequerimiento As Integer Public Property CveProyecto As Integer @@ -8598,7 +8613,8 @@ Namespace Modelos Public Property FechaActualizacion As DateTime Public Property CveUsuario As Integer Public Property Usuario As String - Public Property CveEmpresa As Integer + Public Property CveEmpresa As Integer + Public Property CveDepartamento As Integer End Class #End Region diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 3c9640274..667d73fac 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6235,7 +6235,7 @@ Partial Class Compras_Compras CostoIndirectoAcum176 += ImporteCI176 'se considera costoindirecto, para que la factura tiene en un concepto tipo servicio SumatoriaOCINV += (Dr(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total")).ToString.ToDecimal * tipoCambioActual) - (ImporteMN176 - ImporteCI176) - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe176, Referencia, ConceptoContabilizacion, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=ImporteMN176, ImporteME:=ImporteME176, CveCuenta:=CveCuenta, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, CveMovimientoAlmacen:=Dr("CveMovimientoAlmacen").ToString.ToEntero, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, Importe176, Referencia, ConceptoContabilizacion, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=ImporteMN176, ImporteME:=ImporteME176, CveCuenta:=CveCuenta, CveOCDetalle:=Dr("CveOrdenCompraDetalle").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoAlmacen, Contabilizable:=SeContabiliza) Then ErrorPrepoliza = True Exit For End If @@ -6278,10 +6278,10 @@ Partial Class Compras_Compras End If - + 'falta el registro de la NC cuando es Dim RegistroCuentaPuente As Boolean = False 'NC CON PRODUCTOS - CUENTA PUENTE - If UsuarioActual.CveEmpresa.Contiene(119) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then + If UsuarioActual.Empresa.UsaInventarios AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND ISNULL(CveTipoPS,0) = 2").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador @@ -6315,27 +6315,31 @@ Partial Class Compras_Compras End If - Dim ContienePSNeteoBonif As Boolean = False - For Each Dr As DataRow In TmpDT.Rows - If Dr("CveClasificacion").ToString.ToEntero.Contiene(20319) Then 'clasificación de Bonificación, no se incluirá en el neteo - ContienePSNeteoBonif = True - Exit For - End If - Next - If ContienePSNeteoBonif Then - importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 ").ToString.ToDecimal - importeMN = importeMovimiento * tipoCambioActual * Multiplicador - Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero - If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then + If UsuarioActual.CveEmpresa.Contiene(119) Then + Dim ContienePSNeteoBonif As Boolean = False + For Each Dr As DataRow In TmpDT.Rows + If Dr("CveClasificacion").ToString.ToEntero.Contiene(20319) Then 'clasificación de Bonificación, no se incluirá en el neteo + ContienePSNeteoBonif = True + Exit For + End If + Next + + If ContienePSNeteoBonif Then + importeMovimiento = TmpDT.SUM(If(ListaDocumentos IsNot Nothing AndAlso ListaDocumentos.Count > 0 AndAlso ArrAnticipos IsNot Nothing AndAlso ArrAnticipos.Count > 0 AndAlso TxtTotal.Text.ToDecimal = 0, "ImporteSinImpuestos", "Total"), $"ISNULL(TipoAF,0) <> 2 AND ISNULL(CveAlmacen,0) = 0 AND ISNULL(AplicaCostoIndirecto,0) <> 1 ").ToString.ToDecimal + importeMN = importeMovimiento * tipoCambioActual * Multiplicador + Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero + If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then + ErrorPrepoliza = True + End If + Else ErrorPrepoliza = True End If - Else - ErrorPrepoliza = True End If End If + End If @@ -6593,8 +6597,8 @@ Partial Class Compras_Compras If Gvr.FCCheckBox("ChkFacturaNC").Checked Then Dim CvePrePolizaTemp = ObjConta.AddPrePolizas("Compras/Registrar-NC", If(EsContado And CvePlantillaPrePoliza = 1, 2, CvePlantillaPrePoliza), ImporteCompra, TxtTotal.Text.ToDouble, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjCompras.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjConta.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, DdlTipoTransaccionCaja.SelectedValue, UsuarioActual.CveEmpresa)) Dim importeMovimientoNC = Gvr.FCTextBox("TxtImporte").Text.ToDecimal - Dim importeMNNC = importeMovimientoNC * tipoCambioActual * Multiplicador Dim TipoCambioFactura = Gvr.DataKey("TipoCambio").ToDecimal + Dim importeMNNC = importeMovimientoNC * TipoCambioFactura * Multiplicador IdCtaContable = CtaProveedorExtranjera CveCuenta = CveCuentaProveedorExtranjera @@ -6611,7 +6615,7 @@ Partial Class Compras_Compras End If - importeMNNC = importeMovimientoNC * TipoCambioFactura * Multiplicador + importeMNNC = importeMovimientoNC * tipoCambioActual * Multiplicador IdCtaContable = CtaProveedorExtranjera CveCuenta = CveCuentaProveedorExtranjera If ObjConta.AddPrePolizasDetalle(CvePrePolizaTemp, True, importeMovimientoNC, Referencia, 60, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=importeMovimientoNC, ImporteME:=importeMovimientoNC, TipoCambio:=tipoCambioActual, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then @@ -9514,6 +9518,15 @@ Partial Class Compras_Compras Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation Select Case ConceptoContable + 'Case 5 + ' IdCtaContable = 1244 + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 5, Referencia, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=DdlProveedor.SelectedValue.ToEntero, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TxtTotal.Text.ToDecimal, ImporteME:=If(tipoCambioActual = 1, 0, TxtTotal.Text.ToDecimal), CveCuenta:=CveCuenta) Then + ' ErrorPrepoliza = True + ' End If + ' IdCtaContable = 1243 + ' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimiento, Referencia, 205, Referencia, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=DdlProveedor.SelectedValue.ToEntero, CvePersonal:=CvePersonal, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TxtTotal.Text.ToDecimal, ImporteME:=If(tipoCambioActual = 1, 0, TxtTotal.Text.ToDecimal), CveCuenta:=CveCuenta) Then + ' ErrorPrepoliza = True + ' End If Case 6 Dim CveProveedorConcepto As Integer = 0, CveAcreedor As Integer = 0, CveIE As Integer = 0, CveColectiva As Integer = 0, CveCreditoDetalle As Integer = 0 Dim ConceptoPersonal As String = "", Concepto As String = "" @@ -9617,7 +9630,7 @@ Partial Class Compras_Compras CveCuenta = 0 'INV [MERCANCIA RECIBIDA POR ADELANTADO (OC) | MERCANCIA PENDIENTE POR RECIBIR (COMPRA) ] - If UsuarioActual.CveEmpresa.Contiene(119) And UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(176, 205) Then + If UsuarioActual.Empresa.UsaInventarios And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" And ConceptoContabilizacionAlmacen.Contiene(176, 205) Then importeMovimiento = TmpDT.SUM("Total", $"ISNULL(TipoAF,0) <> 2 AND ISNULL(AplicaCostoIndirecto,0) <> 1 AND CveTipoPS = 2").ToString.ToDecimal importeMN = importeMovimiento * tipoCambioActual * Multiplicador @@ -9802,11 +9815,11 @@ Partial Class Compras_Compras BtnGuardar.Enabled = True UpFacturar.Update() - End Sub + End Sub #End Region - + #Region "CargaXML" - + Private Function ValorXML(n As XmlNode, Campo As String, Optional Retorno As String = "") As String Dim o As XmlNode = n.Attributes.Cast(Of XmlAttribute)().SingleOrDefault(Function(a) String.Compare(a.Name, Campo, True) = 0) If o Is Nothing Then @@ -10011,10 +10024,10 @@ Partial Class Compras_Compras 'End Try - End Sub - + End Sub + #End Region - + #Region "GV'S" Protected Sub GVAnticipos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVAnticipos.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -10279,9 +10292,9 @@ Partial Class Compras_Compras End If - End Sub + End Sub #End Region - + #Region "METODOS" Private Sub GeneraGlobalDT(data As Object) Dim ObjPS As New ClsProductosServicios @@ -10714,66 +10727,66 @@ Partial Class Compras_Compras CargarUMAlias() - End Sub + End Sub #End Region - + #Region " ALGO DE AF QUE NUNCA SE USABA " - 'Protected Sub GVAF_RowCreated(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAF.RowCreated - ' If e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Alternate OrElse e.Row.RowState = DataControlRowState.Normal) Then - ' e.Row.FCDropDownList("DdlTipoActivoFijo").DataSource = TmpDTTiposAF - ' e.Row.FCDropDownList("DdlTipoActivoFijo").DataBind() - - ' e.Row.FCDropDownList("DdlSubTipoActivoFijo").DataSource = Nothing - ' e.Row.FCDropDownList("DdlSubTipoActivoFijo").DataBind() - ' e.Row.FCDropDownList("DdlSubTipoActivoFijo").Items.Insert(0, New ListItem("Seleccione", "-1")) - - - ' e.Row.FCDropDownList("DdlAF").DataSource = Nothing - ' e.Row.FCDropDownList("DdlAF").DataBind() - ' e.Row.FCDropDownList("DdlAF").Items.Insert(0, New ListItem("Seleccione", "-1")) - - ' End If - 'End Sub - - 'Protected Sub GVAF_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAF.RowDataBound - ' If e.Row.RowType = DataControlRowType.DataRow Then - ' If e.Row.RowIndex = 0 Then - ' e.Row.Cells(0).Width = Unit.Pixel(20) - ' e.Row.Cells(1).Width = Unit.Pixel(140) - ' e.Row.Cells(2).Width = Unit.Pixel(250) - ' End If - - ' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right - ' e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left - ' e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left - ' End If - 'End Sub - - 'Protected Sub DdlTipoActivoFijo_SelectedIndexChanged(sender As Object, e As System.EventArgs) - ' Dim Array() As String = Nothing - ' Dim DdlGVSubTipoAF As DropDownList = Nothing - - ' Array = DirectCast(sender, DropDownList).ClientID.Split("_"c) - ' If Array.Length > 0 Then - ' DdlGVSubTipoAF = DirectCast(GVAF.Rows(Array(3).ToEntero).Controls(4).Controls(1), DropDownList) - ' End If - - ' If DdlGVSubTipoAF IsNot Nothing Then CargaSubTipoAF(DirectCast(sender, DropDownList), DdlGVSubTipoAF) - 'End Sub - - 'Protected Sub GvOCC2_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOCC2.RowDataBound - ' If e.Row.RowType = DataControlRowType.DataRow Then - - ' e.Row.Cells(0).Text = (e.Row.RowIndex + 1).ToString - - ' End If - 'End Sub - - 'Protected Sub chkFuncionariosEmpleados_CheckedChanged(sender As Object, e As EventArgs) Handles chkFuncionariosEmpleados.CheckedChanged - ' PnlPagoContado.Visible = Not chkFuncionariosEmpleados.Checked - ' PnlFuncionarioEmpleado.Visible = chkFuncionariosEmpleados.Checked - ' UPCondicionesPago.Update() - 'End Sub + 'Protected Sub GVAF_RowCreated(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAF.RowCreated + ' If e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Alternate OrElse e.Row.RowState = DataControlRowState.Normal) Then + ' e.Row.FCDropDownList("DdlTipoActivoFijo").DataSource = TmpDTTiposAF + ' e.Row.FCDropDownList("DdlTipoActivoFijo").DataBind() + + ' e.Row.FCDropDownList("DdlSubTipoActivoFijo").DataSource = Nothing + ' e.Row.FCDropDownList("DdlSubTipoActivoFijo").DataBind() + ' e.Row.FCDropDownList("DdlSubTipoActivoFijo").Items.Insert(0, New ListItem("Seleccione", "-1")) + + + ' e.Row.FCDropDownList("DdlAF").DataSource = Nothing + ' e.Row.FCDropDownList("DdlAF").DataBind() + ' e.Row.FCDropDownList("DdlAF").Items.Insert(0, New ListItem("Seleccione", "-1")) + + ' End If + 'End Sub + + 'Protected Sub GVAF_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVAF.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + ' If e.Row.RowIndex = 0 Then + ' e.Row.Cells(0).Width = Unit.Pixel(20) + ' e.Row.Cells(1).Width = Unit.Pixel(140) + ' e.Row.Cells(2).Width = Unit.Pixel(250) + ' End If + + ' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Right + ' e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left + ' e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left + ' End If + 'End Sub + + 'Protected Sub DdlTipoActivoFijo_SelectedIndexChanged(sender As Object, e As System.EventArgs) + ' Dim Array() As String = Nothing + ' Dim DdlGVSubTipoAF As DropDownList = Nothing + + ' Array = DirectCast(sender, DropDownList).ClientID.Split("_"c) + ' If Array.Length > 0 Then + ' DdlGVSubTipoAF = DirectCast(GVAF.Rows(Array(3).ToEntero).Controls(4).Controls(1), DropDownList) + ' End If + + ' If DdlGVSubTipoAF IsNot Nothing Then CargaSubTipoAF(DirectCast(sender, DropDownList), DdlGVSubTipoAF) + 'End Sub + + 'Protected Sub GvOCC2_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOCC2.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + + ' e.Row.Cells(0).Text = (e.Row.RowIndex + 1).ToString + + ' End If + 'End Sub + + 'Protected Sub chkFuncionariosEmpleados_CheckedChanged(sender As Object, e As EventArgs) Handles chkFuncionariosEmpleados.CheckedChanged + ' PnlPagoContado.Visible = Not chkFuncionariosEmpleados.Checked + ' PnlFuncionarioEmpleado.Visible = chkFuncionariosEmpleados.Checked + ' UPCondicionesPago.Update() + 'End Sub Protected Sub BtnOCAceptar_Click(sender As Object, e As EventArgs) Handles BtnOCAceptar.Click 'carga la OC Dim CveOC As Integer = -1 @@ -10810,45 +10823,45 @@ Partial Class Compras_Compras 'UpnAF.Update() - End Sub + End Sub #End Region - + #Region "Estimaciones" - - 'Private Sub CargaDatosEstimaciones(pCveProveedor As Integer) - ' Dim Con As New ClsContratos - ' If Con.GetEstimaciones(pCveProveedor, -1, -1, -1, -1, 0, UsuarioActual.CveEmpresa) Then - ' GVEst.DataSource = Con.DtResultados - ' GVEst.DataBind() - - ' End If - ' UPEstimaciones.Update() - ' Con.Dispose() - 'End Sub - - 'Protected Sub GVEst_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVEst.RowDataBound - ' If e.Row.RowType = DataControlRowType.DataRow Then - ' If e.Row.RowIndex = 0 Then - ' e.Row.Cells(0).Width = Unit.Pixel(30) - ' e.Row.Cells(1).Width = Unit.Pixel(30) 'Seccion - ' e.Row.Cells(2).Width = Unit.Pixel(300) 'SubSeccion - ' e.Row.Cells(3).Width = Unit.Pixel(100) 'Cantidad - ' End If - - ' If e.Row.DBCampo("RazonSocial") = "" Then - ' e.Row.CssClass = "Totales" : e.Row.Height = 25 - ' ElseIf e.Row.DBCampo("Contrato") = "" Then - ' e.Row.CssClass = "SubTotales2" : e.Row.Height = 25 - ' ElseIf e.Row.DBCampo("Seccion") = "" Then - ' e.Row.CssClass = "SubTotales" : e.Row.Height = 25 - ' ElseIf e.Row.DBCampo("Clasificacion") = "" Then - ' e.Row.CssClass = "SubTotales3" : e.Row.Height = 25 - ' End If - - ' End If - 'End Sub + + 'Private Sub CargaDatosEstimaciones(pCveProveedor As Integer) + ' Dim Con As New ClsContratos + ' If Con.GetEstimaciones(pCveProveedor, -1, -1, -1, -1, 0, UsuarioActual.CveEmpresa) Then + ' GVEst.DataSource = Con.DtResultados + ' GVEst.DataBind() + + ' End If + ' UPEstimaciones.Update() + ' Con.Dispose() + 'End Sub + + 'Protected Sub GVEst_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVEst.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + ' If e.Row.RowIndex = 0 Then + ' e.Row.Cells(0).Width = Unit.Pixel(30) + ' e.Row.Cells(1).Width = Unit.Pixel(30) 'Seccion + ' e.Row.Cells(2).Width = Unit.Pixel(300) 'SubSeccion + ' e.Row.Cells(3).Width = Unit.Pixel(100) 'Cantidad + ' End If + + ' If e.Row.DBCampo("RazonSocial") = "" Then + ' e.Row.CssClass = "Totales" : e.Row.Height = 25 + ' ElseIf e.Row.DBCampo("Contrato") = "" Then + ' e.Row.CssClass = "SubTotales2" : e.Row.Height = 25 + ' ElseIf e.Row.DBCampo("Seccion") = "" Then + ' e.Row.CssClass = "SubTotales" : e.Row.Height = 25 + ' ElseIf e.Row.DBCampo("Clasificacion") = "" Then + ' e.Row.CssClass = "SubTotales3" : e.Row.Height = 25 + ' End If + + ' End If + 'End Sub #End Region - + #Region " ALMACEN " Private Sub CargaGvInv() @@ -11165,11 +11178,11 @@ Partial Class Compras_Compras UpAlmacenEvidencia.Update() - End Sub + End Sub #End Region - + #Region "PESTAÑA INFORMACION GENERAL DE BANCO IE" - + Private Sub CargaTipoTransaccion() DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros("Tipo = 'Egs'") DdlTipoTransaccion.DataBind() @@ -11190,52 +11203,52 @@ Partial Class Compras_Compras DdlCuentaCaja.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveTipoCuenta = 1")) DdlCuentaCaja.DataBind() DdlCuentaCaja.Items.Insert(0, New ListItem("Seleccione", "-1")) - End Sub - + End Sub + #End Region - + #Region "FINANCIAMIENTO - AC" - 'Private Sub CreaDtAC() - ' DtAC = New DataTable - ' DtAC.Columns.Add("IdCuenta", GetType(String)) - ' DtAC.Columns.Add("Cuenta", GetType(String)) - ' DtAC.Columns.Add("Saldo", GetType(String)) - 'End Sub - 'Protected Sub CargaGvAc(Optional datos As DataTable = Nothing) - ' If UsuarioActual.Empresa.UsaAC Then - ' GvAC.DataBind() - ' GvAC.DataSource = If(datos IsNot Nothing, datos, DtAC) - ' GvAC.DataBind() - - ' Dim Total As Double = GvAC.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("PorDevengar").ToDouble) - - ' Lbtotalsaldo.Text = Total.ToString.FormatoNumero - ' UPPM.Update() - ' PnlAC.Visible = True - ' End If - 'End Sub - - 'Protected Sub CargaAC() - ' Dim Cont As New ClsContPAQi(UsuarioActual.Empresa) - - ' If Cont.GetACSaldos(UsuarioActual.Empresa.EjercicioActual, 2) Then - ' DtAC = Cont.DtResultados.Copy.FiltraParametros("PorDevengar > 0") - ' Else - ' Alert("Ocurrio un error al cargar los Presupuestos. Por favor vuelva a cargar la pagina") - ' End If - - ' Cont.Dispose() - 'End Sub - - 'Protected Sub GvAC_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvAC.RowDataBound - ' If e.Row.RowType = DataControlRowType.DataRow Then - - ' e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", String.Format("ValidaImporte(this,{0});", e.Row.DBCampo("PorDevengar"))) - ' End If - 'End Sub - + 'Private Sub CreaDtAC() + ' DtAC = New DataTable + ' DtAC.Columns.Add("IdCuenta", GetType(String)) + ' DtAC.Columns.Add("Cuenta", GetType(String)) + ' DtAC.Columns.Add("Saldo", GetType(String)) + 'End Sub + 'Protected Sub CargaGvAc(Optional datos As DataTable = Nothing) + ' If UsuarioActual.Empresa.UsaAC Then + ' GvAC.DataBind() + ' GvAC.DataSource = If(datos IsNot Nothing, datos, DtAC) + ' GvAC.DataBind() + + ' Dim Total As Double = GvAC.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("PorDevengar").ToDouble) + + ' Lbtotalsaldo.Text = Total.ToString.FormatoNumero + ' UPPM.Update() + ' PnlAC.Visible = True + ' End If + 'End Sub + + 'Protected Sub CargaAC() + ' Dim Cont As New ClsContPAQi(UsuarioActual.Empresa) + + ' If Cont.GetACSaldos(UsuarioActual.Empresa.EjercicioActual, 2) Then + ' DtAC = Cont.DtResultados.Copy.FiltraParametros("PorDevengar > 0") + ' Else + ' Alert("Ocurrio un error al cargar los Presupuestos. Por favor vuelva a cargar la pagina") + ' End If + + ' Cont.Dispose() + 'End Sub + + 'Protected Sub GvAC_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvAC.RowDataBound + ' If e.Row.RowType = DataControlRowType.DataRow Then + + ' e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", String.Format("ValidaImporte(this,{0});", e.Row.DBCampo("PorDevengar"))) + ' End If + 'End Sub + #End Region - + #Region "TAB - PERSONAL" Private Sub CargaGvPersonal() GvPersonal.DataSource = TmpDT @@ -11406,13 +11419,13 @@ Partial Class Compras_Compras Next - End Sub - - - - + End Sub + + + + #End Region - + #Region "TAB - ACTIVOS FIJOS -AF" Protected Sub CargarGvActivosFijos(sender As Object, e As EventArgs) Tab.ActiveTabIndex = 3 @@ -11642,58 +11655,58 @@ Partial Class Compras_Compras End Sub Protected Sub BtnAFMedida_Click(sender As Object, e As EventArgs) TmpDT(HdnIndexTmpDT.Value.ToEntero)("AFMedida") = HdnTxtAFMedida.Value - End Sub + End Sub #End Region - + #Region "C O N T R A T O S" - 'Protected Sub ImgBtnBuscarContrato_Click(sender As Object, e As ImageClickEventArgs) Handles ImgBtnBuscarContrato.Click - ' If CveProveedor <= 0 Then - ' Alert("Debe de Seleccionar un proveedor") - ' Exit Sub - ' End If - - ' RegistraScript(String.Format("AbrirVentana('/Contratos/PopUpBuscarContrato.aspx?V=VCCOMP',730,300,'N');")) - 'End Sub - - 'Protected Sub CargaVContrato(sender As Object, e As EventArgs) - ' CargaVContrato2(HdnVCveContrato.Value) - 'End Sub - - 'Protected Sub CargaVContrato2(CveContrato As String) - ' If TxtContrato.Text <> "" Then - ' Dim ObjContratos As New ClsContratos - ' Dim DTContratosTemp As DataTable = Nothing - - ' GvContratos1.DataSource = TmpDT - ' GvContratos1.DataBind() - ' UPGVContratos1.Update() - - ' Dim ArrayCveContratos As String() = HdnVCveContrato.Value.Split(New Char() {","c}) - ' For i As Integer = 1 To ArrayCveContratos.Count - ' If ObjContratos.GetContratosDetalle(ArrayCveContratos(i - 1).ToEntero) Then - ' If IsNothing(DTContratosTemp) Then - ' DTContratosTemp = ObjContratos.DtResultados.Copy - ' Else - ' DTContratosTemp.Merge(ObjContratos.DtResultados) - ' End If - ' Else - ' Alert("Ocurrio un ERROR al cargar el Contrato") - ' DTContratosTemp.Rows.Clear() - ' Exit For - ' End If - ' Next - - ' GvContratos2.DataSource = DTContratosTemp - ' GvContratos2.DataBind() - ' UPGVContratos2.Update() - - ' ObjContratos.Dispose() - ' End If - 'End Sub + 'Protected Sub ImgBtnBuscarContrato_Click(sender As Object, e As ImageClickEventArgs) Handles ImgBtnBuscarContrato.Click + ' If CveProveedor <= 0 Then + ' Alert("Debe de Seleccionar un proveedor") + ' Exit Sub + ' End If + + ' RegistraScript(String.Format("AbrirVentana('/Contratos/PopUpBuscarContrato.aspx?V=VCCOMP',730,300,'N');")) + 'End Sub + + 'Protected Sub CargaVContrato(sender As Object, e As EventArgs) + ' CargaVContrato2(HdnVCveContrato.Value) + 'End Sub + + 'Protected Sub CargaVContrato2(CveContrato As String) + ' If TxtContrato.Text <> "" Then + ' Dim ObjContratos As New ClsContratos + ' Dim DTContratosTemp As DataTable = Nothing + + ' GvContratos1.DataSource = TmpDT + ' GvContratos1.DataBind() + ' UPGVContratos1.Update() + + ' Dim ArrayCveContratos As String() = HdnVCveContrato.Value.Split(New Char() {","c}) + ' For i As Integer = 1 To ArrayCveContratos.Count + ' If ObjContratos.GetContratosDetalle(ArrayCveContratos(i - 1).ToEntero) Then + ' If IsNothing(DTContratosTemp) Then + ' DTContratosTemp = ObjContratos.DtResultados.Copy + ' Else + ' DTContratosTemp.Merge(ObjContratos.DtResultados) + ' End If + ' Else + ' Alert("Ocurrio un ERROR al cargar el Contrato") + ' DTContratosTemp.Rows.Clear() + ' Exit For + ' End If + ' Next + + ' GvContratos2.DataSource = DTContratosTemp + ' GvContratos2.DataBind() + ' UPGVContratos2.Update() + + ' ObjContratos.Dispose() + ' End If + 'End Sub #End Region - + #Region "TAB ALMACEN - INVENTARIOS ISRAEL PIÑA - 5 FEBRERO 2015" - + Protected Sub CalculaTotalPorDevengar() Dim total = TxtTotal.Text.ToDouble For Each Gvr As GridViewRow In GvInv.Rows @@ -11707,10 +11720,10 @@ Partial Class Compras_Compras Protected Sub CambiaTotalDevengar(sender As Object, e As EventArgs) CalculaTotalPorDevengar() - End Sub - + End Sub + #End Region - + #Region " AJUSTA IMPORTES " Private Sub AjustaImporteUltimoConcepto(ImporteAjuste As Decimal, Optional EsCarga As Boolean = False) 'Dim TempSubTotal = TxtSubTotal.Text.ToDouble @@ -11809,9 +11822,9 @@ Partial Class Compras_Compras GvPS.DataBind() UpPS.Update() - End Sub + End Sub #End Region - + #Region "DDL'S" Protected Sub DdlCredito_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCredito.SelectedIndexChanged CargaCreditosDetalle(DdlCredito.SelectedValue.ToEntero) @@ -11967,7 +11980,7 @@ Partial Class Compras_Compras IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero IdCuentaBancariaComplementaria = dr("IdCtaContableComplementaria").ToString.ToEntero - CveCuentaBancariaComplementaria = dr("IdCtaContableSIGComplementaria").ToString.ToEntero + CveCuentaBancariaComplementaria = dr("IdCtaContableComplementariaSIG").ToString.ToEntero If dr("UsaTarjeta").ToString = "True" Then CargaGridTarjetas() Else @@ -12040,9 +12053,9 @@ Partial Class Compras_Compras RVDocumentoImporteFE.MaximumValue = saldo.ToString UPCondicionesPago.Update() - End Sub + End Sub #End Region - + #Region "CHK'S" Protected Sub RBLCajaChica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RBLCajaChica.SelectedIndexChanged Select Case RBLCajaChica.SelectedValue @@ -12264,9 +12277,9 @@ Partial Class Compras_Compras ElseIf RblRembolso.SelectedValue.ToEntero = 2 Then TrRembolsoCajaChica.Visible = True End If - End Sub + End Sub #End Region - + #Region "ARMONIZACION CONTABLE - AC - SIMPLIFICADO" Private Sub CargaPresupuestosEgresos(Optional CargaTodo As Boolean = True) @@ -12530,10 +12543,10 @@ Partial Class Compras_Compras EjercicioAC = Ejercicio End If - End Sub - + End Sub + #End Region - + #Region "E V E N T O - B I T A C O R A" Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then @@ -12630,9 +12643,9 @@ Partial Class Compras_Compras End If ObjEventoBitacora.Dispose() GvEB.DataBind() - End Sub + End Sub #End Region - + #Region " C O N T A B I L I D A D " Protected Sub BtnDescontabilizar_Click(sender As Object, e As EventArgs) 'Alert("Hola entre", TipoMensaje.MsgError) @@ -13021,10 +13034,10 @@ Partial Class Compras_Compras If Not ErrorCompra Then CargaCompra() End If - End Sub - + End Sub + #End Region - + #Region " REEMBOLSOS NO USA AC " Protected Sub DdlPersonal2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPersonalReembolso.SelectedIndexChanged ViewState("CvePersonal") = DdlPersonalReembolso.SelectedValue @@ -13038,13 +13051,13 @@ Partial Class Compras_Compras CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero End If ViewState("CveCajaChica") = DdlCuentaCajaChicaReembolso.SelectedValue - End Sub + End Sub #End Region - + #Region " ALMACEN " - + #End Region - + #Region " CONSIGNACIONES " Protected Sub ChkConsignacion_CheckedChanged(sender As Object, e As EventArgs) @@ -13314,13 +13327,13 @@ Partial Class Compras_Compras BtnGuardar.Enabled = True UpFacturar.Update() - End Sub + End Sub #End Region - + #Region " ***** Devoluciones INV ***** " - - '*se envia true si hubo un error*' - + + '*se envia true si hubo un error*' + Private Function guardardevolucion(ObjInventario As ClsInventarios, CveCompra As Integer, subtotal As Double, Fecha As Date) As Boolean Dim ErrorMovInv As Boolean = False Dim CveAlmacen As Integer @@ -13517,9 +13530,9 @@ Partial Class Compras_Compras ImgBtnBuscarOC.Visible = False UpParametros.Update() UpPSS.Update() - End Sub + End Sub #End Region - + #Region " REFACTURACION " Private Sub ValidaRefacturacion() If Not CveCompra > 0 AndAlso DdlTipoComprobante.SelectedValue = "Fac" And UsuarioActual.Empresa.CvePlataforma <> 2 Then @@ -13753,10 +13766,10 @@ Partial Class Compras_Compras End If Return ErrorBitacora - End Function - + End Function + #End Region - + #Region " CANCELAR COMPRA " Private Sub ValidaCancelarCompra() If UsuarioActual.TienePermisoProceso(140) Then @@ -14035,10 +14048,10 @@ Partial Class Compras_Compras DivValesCombustible.Visible = True RegistraScript(String.Format("$('#{0}').modal('show')", DivValesCombustible.ClientID)) UPPValesCombustible.Update() - End Sub - + End Sub + #End Region - + #Region " VALES COMBUSTIBLES " Protected Sub BtnValesVincular_Click(sender As Object, e As EventArgs) IdVale = New List(Of Integer) @@ -14058,9 +14071,9 @@ Partial Class Compras_Compras ' Alert(cve.ToString) 'Next End If - End Sub + End Sub #End Region - + #Region " VINCULAR OC " Private Sub InicializaOC() 'BORRAR OC @@ -15093,11 +15106,11 @@ Partial Class Compras_Compras Alert($"El concepto {PS} tiene especificada la cantidad {Cantidad} pero un costo de cero ($0).

En caso de vincular la OC de esta manera la cantidad especificada sera considerada como recibida.

De ser correcto Continue o de lo contrario rectifique.", TipoMensaje.MsgAdvertencia) - End Sub + End Sub #End Region - + #Region "F L E T E S Y S E R V I C I O S" - + Public Sub CreaDTFacturas() Dim dt As New DataTable @@ -15314,6 +15327,16 @@ Partial Class Compras_Compras TotalFlete = 0 TotalAlmacen = 0 + 'Obtenemos el total del almacen y guardamos las consecutivas pertenecientes al mismo + For Each Dr2 As DataRow In DtInv.Rows + TotalAlmacen += Math.Round(Dr2("Total").ToString.ToDecimal, 2) + ListaConsecutivas.Add(Dr2("Consec").ToString) + Next + + 'sino hay producto en almacen para aplciarle un servicio, no se debe de amrcar como costo indirecto + 'esto aplica cuando la factura solo trae un concepto, y es el de servicio + If TotalAlmacen = 0 Then Exit Sub + 'Obtenemos el total del flete y marcamos los conceptos que pertenecen a flete For Each gvr As GridViewRow In GVServicios.Rows If gvr.DataKey("CvePS").ToEntero = CvePS Or gvr.FCCheckBox("chkServicios").Checked Then @@ -15328,11 +15351,6 @@ Partial Class Compras_Compras If Not TotalFlete > 0 Then Exit Sub - 'Obtenemos el total del almacen y guardamos las consecutivas pertenecientes al mismo - For Each Dr2 As DataRow In DtInv.Rows - TotalAlmacen += Math.Round(Dr2("Total").ToString.ToDecimal, 2) - ListaConsecutivas.Add(Dr2("Consec").ToString) - Next 'Asignamos los costos indirectos y los indices For Each Drt As DataRow In TmpDT.Rows diff --git a/Contabilidad/OCDetalleAlmacen.aspx.vb b/Contabilidad/OCDetalleAlmacen.aspx.vb index 70023f39b..680091bbf 100644 --- a/Contabilidad/OCDetalleAlmacen.aspx.vb +++ b/Contabilidad/OCDetalleAlmacen.aspx.vb @@ -106,7 +106,7 @@ Partial Class Contabilidad_OCDetalleAlmacen If CvePrePoliza > 0 Then If Cargo > Abono Then - If (ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, Diferencia, Referencia, 228, Referencia, Fecha, IdCtaCuenta228, -1, ImporteME:=Diferencia, ImporteMX:=Diferencia, CveCompra:=CveCompra, Contabilizable:=1, CveOC:=CveOC, CveOCDetalle:=CveOCDetalle, CveProveedor:=CveProveedor)) Then + If (ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, Diferencia, Referencia, 176, Referencia, Fecha, IdCtaCuenta228, -1, ImporteME:=Diferencia, ImporteMX:=Diferencia, CveCompra:=CveCompra, Contabilizable:=1, CveOC:=CveOC, CveOCDetalle:=CveOCDetalle, CveProveedor:=CveProveedor)) Then If (ObjConta.AddPrePolizasDetalle(CvePrePoliza, 1, -Diferencia, Referencia, 177, Referencia, Fecha, IdCtaCuenta177, -1, ImporteME:=-0, ImporteMX:=-Diferencia, CveCompra:=CveCompra, Contabilizable:=1, CveOC:=CveOC, CveOCDetalle:=CveOCDetalle, CveProveedor:=CveProveedor)) Then ContadorProcesados = ContadorProcesados + 1 diff --git a/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc b/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc new file mode 100644 index 000000000..a76bee9e1 --- /dev/null +++ b/Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc @@ -0,0 +1,1023 @@ + + + + + + + + + 3.57404cm + + + 2.36927cm + + + 2.15604cm + + + 15.6445cm + + + 2.02375cm + + + + + 0.4148cm + + + + + true + true + + + + + Disponible + + + + + + + Textbox3 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Unidad + + + + + + + Textbox5 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Código + + + + + + + Textbox16 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Producto + + + + + + + Textbox12 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + SerieLote + + + + + + + Textbox4 + + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + + Black + + 1pt + + Silver + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.49417cm + + + + + true + true + + + + + =IIf(Fields!PS.Value = "", "Folio: " & Fields!FolioSalida.Value, Fields!Cantidad.Value) + + + + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =IIf(Fields!PS.Value = "", Fields!FechaMovto.Value, Fields!UnidadMedida.Value) + + + + + + + UnidadMedida + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Codigo.Value + + + + + + + Codigo + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + + + + =IIf(Fields!PS.Value = "", "Almacén Destino: " & Fields!AlmacenDestino.Value & " Responsable: " & Fields!Recibio.Value, Fields!PS.Value) + + + + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + true + + + + + + true + true + + + + + =Fields!SerieLote.Value + + + + + + + SerieLote + + + =IIf(Fields!PS.Value = "", "#9cacc1", "NoColor") + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + + + + + + + true + true + true + true + DataSet1 + 0.17639cm + 0.24474cm + 0.90897cm + 25.7676cm + + + + + + 0.67394in + + + + + + + Textbox1 + 0.47625cm + 6.54965cm + 0.6cm + 12.60299cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + REPORTE DE TRASPASO DE ALMACÉN + + + + + + + + + + + + + + + + Textbox2 + 1.07625cm + 6.54965cm + 0.52945cm + 12.60299cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + =Parameters!LogoPath.Value + FitProportional + 0.11458in + 0.28839cm + 2.09585cm + 5.89966cm + 2 + + + + + + true + true + + + + + =Parameters!Filtros.Value + HTML + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 3.30439cm + 0.24474cm + 0cm + 25.72823cm + 4 + + + + + + + + + + + 1.84855cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 0.27341cm + 22.76211cm + 0.38981cm + 3.13456cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Usuario: + + + + + + + Textbox8 + 0.27341cm + 0.28839cm + 0.38981cm + 1.60042cm + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!UsuarioImprimio.Value + + + + + + + Textbox9 + 0.27341cm + 1.83272cm + 0.38981cm + 7.13374cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Fecha Impresión: + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 0.15875cm + 0.24474cm + 0cm + 25.72823cm + 4 + + + + + + true + true + + + + + =Globals!ExecutionTime + + + + + + + Textbox11 + 0.27341cm + 12.77526cm + 0.38981cm + 4.99273cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + IMPRESO EN SIG, Rep. Traspaso Almacén + + + + + + + Textbox13 + 0.63378cm + 0.28839cm + 0.46771cm + 6.69369cm + 6 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 21.59cm + 27.94cm + 0.5cm + 0.5cm + 0cm + 0cm + 0.13cm + + + +
  • + PDF +
  • +
  • + Excel +
  • +
    + + + + + + + + + <%-- + +
    + +
    +
    +
    --%> +
    + + + + +
    +
    +
    + + "> + +
    +
    +
    + + + +
    +
    + + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + +
    +
    + + +
    + +
    + +
    +
    +
    + +
    > +
    + +
    + +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + " style="display: inline-block; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + <%----%> + + + + + + + + diff --git a/Inventarios/RepTraspasoAlmacen.aspx.vb b/Inventarios/RepTraspasoAlmacen.aspx.vb new file mode 100644 index 000000000..9612e4d1e --- /dev/null +++ b/Inventarios/RepTraspasoAlmacen.aspx.vb @@ -0,0 +1,176 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Microsoft.Reporting.WebForms +Imports Extensiones +Partial Class RepTraspasoAlmacen + Inherits ClsPaginas + Private Shared missing As Object = System.Reflection.Missing.Value + +#Region "PROPIEDADES" + Private Property FechaI As String + Get + Return ViewState("FechaI").ToString + End Get + Set(value As String) + ViewState("FechaI") = value + End Set + End Property + Private Property FechaF As String + Get + Return ViewState("FechaF").ToString + End Get + Set(value As String) + ViewState("FechaF") = value + End Set + End Property + 'Private Property CveCliente As Integer + ' Get + ' Return ViewState("CveCliente").ToString.ToEntero + ' End Get + ' Set(value As Integer) + ' ViewState("CveCliente") = value + ' End Set + 'End Property + 'Private Property Sucursales As String + ' Get + ' Return ViewState("Sucursales").ToString + ' End Get + ' Set(value As String) + ' ViewState("Sucursales") = value + ' End Set + 'End Property + Private Property DtInventarios As DataTable + Get + Return DirectCast(ViewState("DtInventarios"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtInventarios") = 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 + txtFechaI.Text = Now.ToShortDateString + txtFechaF.Text = Now.ToShortDateString + + CargaAlmacenOrigen() + CargaAlmacenDestino() + CargaDatos() + OrdenaDatos() + + End If + End Sub + +#Region " C A R G A - D A T O S " + Public Sub CargaDatos() + Dim ObjInventarios As New ClsInventarios + + FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim(), MinFecha.ToShortDateString) + FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim(), MaxFecha.ToShortDateString) + 'CveCliente = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1) + + 'Sucursales = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString + + If ObjInventarios.RepTraspasoAlmacen(FechaI.ToDate, FechaF.ToDate, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, ChkRecibido.Checked, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjInventarios.DtResultados + DtInventarios = ObjInventarios.DtResultados + GvDatos.DataBind() + UPDatos.Update() + End If + + ObjInventarios.Dispose() + End Sub +#End Region + +#Region "O R D E N A M I E N T O" + Private Sub OrdenaDatos() + 'If (GvDatos.Rows.Count > 0) Then + ' GvDatos.UseAccessibleHeader = True + ' GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader + ' RegistraScript("OrdenarGV();") + 'End If + End Sub +#End Region + +#Region "G V - D A T O S " + Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then + + 'Cuando es titulo + If e.Row.DBCampo("PS").ToString.Trim = "" Then + e.Row.CssClass = "Totales" + + e.Row.Cells(0).Text = String.Format("Folio: {0} ", e.Row.DBCampo("FolioSalida"), e.Row.DBCampo("CveMovimientoSalida")) + e.Row.Cells(1).Text = String.Format("{0}", e.Row.DBCampo("FechaMovto").ToString.ToDate.ToShortDateString) + e.Row.Cells(3).Text = String.Format("Almacen Destino: {0}       Responsable: {1}", e.Row.DBCampo("AlmacenDestino"), e.Row.DBCampo("Recibio")) + End If + + End If + End Sub +#End Region + +#Region "CARGA COMBOS FILTRO" + Private Sub CargaAlmacenOrigen() + DdlAlmacenOrigen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,21)") + DdlAlmacenOrigen.Items.Insert(0, New ListItem(" Todos ", "-1")) + DdlAlmacenOrigen.SelectedValue = "-1" + DdlAlmacenOrigen.DataBind() + DdlAlmacenOrigen.SelectedValueExist(UsuarioActual.CveAlmacen) + End Sub + Private Sub CargaAlmacenDestino() + DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,21)") + DdlAlmacenDestino.DataBind() + DdlAlmacenDestino.Items.Insert(0, New ListItem("Todos", "-1")) + DdlAlmacenDestino.SelectedValue = "-1" + End Sub +#End Region + +#Region "IMPRESION" + Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click + Imprime("PDF") + End Sub + Private Sub Imprime(Formato As String) + If DtInventarios IsNot Nothing Then + Dim StrFiltro As New StringBuilder + If txtFechaI.Text <> "" Then StrFiltro.AppendFormat(" Fecha Inicio: {0}", txtFechaI.Text.ToDate.ToShortDateString) + If txtFechaF.Text <> "" Then StrFiltro.AppendFormat(" Fecha Fin: {0}", txtFechaF.Text.ToDate.ToShortDateString) + + If DdlAlmacenOrigen.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Almacén Origen: {0}", DdlAlmacenOrigen.SelectedItem.Text) + If DdlAlmacenDestino.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Almacén Destino: {0}", DdlAlmacenDestino.SelectedItem.Text) + If ChkRecibido.Checked Then StrFiltro.AppendFormat(" Recibidos: Si") Else StrFiltro.AppendFormat(" Recibidos: No") + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + + Dim FechaI, FechaF As String + FechaI = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", "-1", txtFechaI.Text) + FechaF = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", "-1", txtFechaF.Text) + + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) + params.Add(New ReportParameter("FechaInicio", FechaI)) + params.Add(New ReportParameter("FechaFin", FechaF)) + params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) + params.Add(New ReportParameter("Filtros", StrFiltro.ToString)) + If Imagen.Exists Then + params.Add(New ReportParameter("LogoPath", logouri)) + Else + params.Add(New ReportParameter("LogoPath", "")) + End If + ImprimirPDF("Empresas/Grales/Formatos/RepTraspasoAlmacen.rdlc", DtInventarios, params, String.Format("RepTraspasoAlmacen-{0}", Now.ToDateTime.ToShortDateString), Formato) + Else + Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia) + End If + End Sub +#End Region + Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + CargaDatos() + End Sub + + Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + Imprime("Excel") + End Sub +End Class diff --git a/LogMail.txt b/LogMail.txt index 6b789a002..6d47c895f 100644 --- a/LogMail.txt +++ b/LogMail.txt @@ -4,4 +4,23 @@ en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 05/09/2019:12:31 p. m. From:'signotificaciones@adssistemas.mx' - Para:';' - Asunto:'Envío de complemento de pago' - CCP: '' - Adjuntos: 2 - Ocurrió un error al mandar correo.System.InvalidOperationException: Se debe especificar un destinatario. en System.Net.Mail.SmtpClient.Send(MailMessage message) - en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 10/09/2019:12:16 p. m. From:'signotificaciones@adssistemas.mx' - Para:'DSDDS@hotmail.com' - Asunto:'SIG - La Orden Compra #26598 cambió de estatus.' - CCP: '' - Adjuntos: 0 10/09/2019:02:58 p. m. No se especifico a remitente - SIG - La Orden Compra #28107 cambió de estatus. 11/09/2019:11:56 a. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Solicitud Vacaciones ' - CCP: '' - Adjuntos: 0 11/09/2019:12:35 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'(Vacaciones:Permisos) Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:02 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Permiso para Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:03 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 20/09/2019:05:15 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29109' - CCP: '' - Adjuntos: 1 20/09/2019:05:36 p. m. No se especifico a remitente - Entrega de Factura HMO - 29110 20/09/2019:05:45 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29111' - CCP: '' - Adjuntos: 1 20/09/2019:05:47 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29112' - CCP: '' - Adjuntos: 1 23/09/2019:10:55 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'Solicitud de anticipo de Orden de Compra' - CCP: '' - Adjuntos: 0 23/09/2019:11:05 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 23/09/2019:11:34 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 25/09/2019:05:06 p. m. No se especifico a remitente - SIG - La Orden Compra #4860 cambió de estatus. \ No newline at end of file + en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\WWWSIGIT\App_Code\ClsSisMail.vb:línea 129 10/09/2019:12:16 p. m. From:'signotificaciones@adssistemas.mx' - Para:'DSDDS@hotmail.com' - Asunto:'SIG - La Orden Compra #26598 cambió de estatus.' - CCP: '' - Adjuntos: 0 10/09/2019:02:58 p. m. No se especifico a remitente - SIG - La Orden Compra #28107 cambió de estatus. 11/09/2019:11:56 a. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Solicitud Vacaciones ' - CCP: '' - Adjuntos: 0 11/09/2019:12:35 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'(Vacaciones:Permisos) Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:02 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Permiso para Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:03 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 11/09/2019:01:10 p. m. From:'signotificaciones@adssistemas.mx' - Para:'antonio.gonzalez@adssistemas.mx' - Asunto:'Vacaciones Asistencia Técnica AD Sistemas' - CCP: '' - Adjuntos: 0 20/09/2019:05:15 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29109' - CCP: '' - Adjuntos: 1 20/09/2019:05:36 p. m. No se especifico a remitente - Entrega de Factura HMO - 29110 20/09/2019:05:45 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29111' - CCP: '' - Adjuntos: 1 20/09/2019:05:47 p. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'japmx95@gmail.com' - Asunto:'Entrega de Factura HMO - 29112' - CCP: '' - Adjuntos: 1 23/09/2019:10:55 a. m. From:'signotificaciones@adssistemas.mx' - Para:'japmx95@gmail.com' - Asunto:'Solicitud de anticipo de Orden de Compra' - CCP: '' - Adjuntos: 0 23/09/2019:11:05 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 23/09/2019:11:34 a. m. No se especifico a remitente - Solicitud de anticipo de Orden de Compra 25/09/2019:05:06 p. m. No se especifico a remitente - SIG - La Orden Compra #4860 cambió de estatus. 30/09/2019:07:28 p. m. From:'signotificaciones@adssistemas.mx' - Para:'lillianrivas@compuproveedores.com;athziryrodriguez@compuproveedores.com' - Asunto:'Vinculación de factura de OC ' - CCP: '' - Adjuntos: 0 01/10/2019:12:27 a. m. From:'signotificaciones@adssistemas.mx' - Para:'lillianrivas@compuproveedores.com;' - Asunto:'NOTIFICACION DE 100% DE AVANCE DE CONTRATO' - CCP: '' - Adjuntos: 0 01/10/2019:12:28 a. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'pagaduria@difson.gob.mx;enrique.garcia@difson.gob.mx;laura.romero@difson.gob.mx' - Asunto:'Entrega de Factura HMO-29475' - CCP: 'LILLIANRIVAS@COMPUPROVEEDORES.COM' - Adjuntos: 2 + - Ocurrió Cargar datos Correo.System.IO.IOException: No se puede escribir datos de en la conexión de transporte: Se ha forzado la interrupción de una conexión existente por el host remoto. ---> System.Net.Sockets.SocketException: Se ha forzado la interrupción de una conexión existente por el host remoto + en System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) + --- Fin del seguimiento de la pila de la excepción interna --- + en System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) + en System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) + en System.Net.Security._SslStream.StartFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) + en System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) + en System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) + en System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) + en System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size) + en System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) + en System.Net.Mail.SmtpPooledStream.Dispose(Boolean disposing) + en System.IO.Stream.Close() + en System.Net.ConnectionPool.Destroy(PooledStream pooledStream) + en System.Net.ConnectionPool.ForceCleanup() + en System.Net.ConnectionPoolManager.CleanupConnectionPool(ServicePoint servicePoint, String groupName) + en System.Net.Mail.SmtpClient.Dispose(Boolean disposing) + en System.Net.Mail.SmtpClient.Dispose() + en ClsSisMail.FinalSend(Mail ObjMail) en C:\inetpub\wwwVentas\App_Code\ClsSisMail.vb:línea 138 01/10/2019:12:28 a. m. From:'ENVIOFACTURADIGITAL@COMPUPROVEEDORES.COM' - Para:'pagaduria@difson.gob.mx;enrique.garcia@difson.gob.mx;laura.romero@difson.gob.mx' - Asunto:'Entrega de Factura HMO-29475' - CCP: 'LILLIANRIVAS@COMPUPROVEEDORES.COM' - Adjuntos: 2 \ No newline at end of file diff --git a/LogTimbrado.txt b/LogTimbrado.txt index fcccb8013..4d2db01dc 100644 --- a/LogTimbrado.txt +++ b/LogTimbrado.txt @@ -12,3 +12,7 @@ .. PAC: 3 - Verificado : (36) 36 Armado: (32) 68 Genera: (0) 68 Timbrado: (10604) 10672 Actualizado: (16) 10688 ..05/09/2019:12:31 p. m. .. PAC: 4 - Verificado : (12) 12 Certificado : (209) 221 Armado: (35) 256 Genera: (306) 562 Timbrado: (918) 1480 ..20/09/2019:05:37 p. m. + + .. PAC: 4 - Verificado : (6) 6 Certificado : (384) 390 Armado: (27) 417 Genera: (390) 807 Timbrado: (2271) 3078 Guardado: (219) 3297 Actualizado: (902) 4199 ..01/10/2019:12:27 a. m. + + .. PAC: 4 - Verificado : (0) 0 Certificado : (204) 204 Armado: (1) 205 Genera: (249) 454 Timbrado: (431) 885 ..01/10/2019:12:27 a. m. diff --git a/OS/CatEstatusOrdenServicio.aspx b/OS/CatEstatusOrdenServicio.aspx index c613e70b4..fc7f2c5ef 100644 --- a/OS/CatEstatusOrdenServicio.aspx +++ b/OS/CatEstatusOrdenServicio.aspx @@ -4,6 +4,10 @@