From 2d53fdb08993cd17de4d8b3e201e52515224186b Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Sat, 12 Sep 2020 12:46:18 -0700 Subject: [PATCH 1/5] =?UTF-8?q?se=20agreg=C3=B3=20una=20ventana=20modal=20?= =?UTF-8?q?que=20muestra=20en=20un=20grid=20las=20series=20en=20los=20alma?= =?UTF-8?q?cenes=20del=20producto=20seleccionado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/Kardex.aspx | 60 ++++++++++++++++++++++++++++++++------ Inventarios/Kardex.aspx.vb | 21 +++++++++++++ 2 files changed, 72 insertions(+), 9 deletions(-) diff --git a/Inventarios/Kardex.aspx b/Inventarios/Kardex.aspx index ca1b60934..6dc8dfaf9 100644 --- a/Inventarios/Kardex.aspx +++ b/Inventarios/Kardex.aspx @@ -116,15 +116,22 @@ Kardex -
  • - Generar PDF -
  • -
  • - Generar Excel -
  • -
  • -   -
  • + + +
  • + Generar PDF +
  • +
  • + Generar Excel +
  • +
  • + Series +
  • +
  • +   +
  • +
    +
    @@ -493,6 +500,41 @@ + diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb index 448dcc4e4..040ca2bc1 100644 --- a/Inventarios/Kardex.aspx.vb +++ b/Inventarios/Kardex.aspx.vb @@ -203,6 +203,8 @@ Partial Class Inventarios_Kardex If AplicaLote Then GvM.Columns(9).Visible = True If AplicaCaducidad Then GvM.Columns(10).Visible = True + Dim AuxAplicaSerie As Boolean = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimeroValor("AplicaSerie") = "True" + LnkSeries.Visible = AuxAplicaSerie 'CARGA INDICADORES If UsuarioActual.TienePermisoProceso(201) Then DivIndicadores.Visible = True @@ -238,6 +240,7 @@ Partial Class Inventarios_Kardex End If GvM.DataSource = DtTemp GvM.DataBind() + UpAcciones.Update() End If Else Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia) @@ -299,6 +302,15 @@ Partial Class Inventarios_Kardex End If End Sub + + Private Sub CargarExistenciasProductosSeries() + Dim ObjInventarios As New ClsInventarios + If ObjInventarios.GetExistenciasProductoSerie(ddlProducto2.SelectedValue.ToEntero(), ddlAlmacen.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + GvSeries.DataSource = ObjInventarios.DtResultados + End If + ObjInventarios.Dispose() + GvSeries.DataBind() + End Sub #End Region #Region " IMPRIMIR " @@ -409,5 +421,14 @@ Partial Class Inventarios_Kardex #End Region +#Region "Acciones" + Protected Sub LnkSeries_OnClick(sender As Object, e As EventArgs) Handles LnkSeries.Click + CargarExistenciasProductosSeries() + UpGridSeries.Update() + RegistraScript(String.Format("$('#{0}').modal('show');", "DivModalSerie")) + End Sub +#End Region + + End Class From d8d48c877c9f85c71fdcef55ab6a7a7720f7227c Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 14 Sep 2020 19:02:50 -0700 Subject: [PATCH 2/5] Devolucion de Proveedor --- Compras/Compras.aspx.vb | 9 +- Inventarios/RecepcionAlmacen.aspx | 2 +- Inventarios/RecepcionAlmacen.aspx.vb | 271 +++++++++++++++++++++++++-- 3 files changed, 268 insertions(+), 14 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index d096c8df3..c151a54f5 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -1332,6 +1332,10 @@ Partial Class Compras_Compras End If + If DdlTipoComprobante.SelectedValue = "DEV" Then + InicializaAplicaNCFact() + End If + If UsuarioActual.Empresa.UsaAC Then @@ -16929,8 +16933,9 @@ Partial Class Compras_Compras CargaRetISRConcepto() - - + If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then + InicializaAplicaNCFact() + End If End Sub Private Sub OriginalesVisible(Accion As Boolean) diff --git a/Inventarios/RecepcionAlmacen.aspx b/Inventarios/RecepcionAlmacen.aspx index c0e7de431..a4d52dd3d 100644 --- a/Inventarios/RecepcionAlmacen.aspx +++ b/Inventarios/RecepcionAlmacen.aspx @@ -418,7 +418,7 @@ + DataKeyNames="EntregaDirecta,Consec,CodigoBarras,CvePS,CveUM,PU,CantidadC,CantidadF,UM,PS,CveCompraDetalle,CveOrdenCompraDetalle,PUExtranjero,AplicaSerieLote,CveClasificacion,Codigo,CveVentaDetalle,CostoIndirecto,CveTamaño,Lote,AplicaSeccion,AplicaLote,AplicaCaducidad,AplicaSerie,CveAlmacenDevolucionProveedor" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None"> diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index cb8126518..3ce4a112d 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -91,6 +91,14 @@ Partial Class Inventarios_RecepcionAlmacen Return ViewState("IdPoliza").ToString.ToEntero End Get End Property + Private Property DtAlmacenesDevolucion As DataTable + Get + Return CType(ViewState("DtAlmacenesDevolucion"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtAlmacenesDevolucion") = value + End Set + End Property Private Property DtDatosDetalle As DataTable Get Return CType(ViewState("DtDatosDetalle"), DataTable) @@ -245,6 +253,14 @@ Partial Class Inventarios_RecepcionAlmacen ViewState("CveAlmacenApartado") = value End Set End Property + Private Property CveAlmacenDevolucionProveedor As Integer + Get + Return CType(ViewState("CveAlmacenDevolucionProveedor"), Integer) + End Get + Set(value As Integer) + ViewState("CveAlmacenDevolucionProveedor") = value + End Set + End Property Private Property TipoMovimiento As Integer Get Return CType(ViewState("TipoMovimiento"), Integer) @@ -361,6 +377,14 @@ Partial Class Inventarios_RecepcionAlmacen ViewState("CveVendedor") = value End Set End Property + Private Property RealizarTraspasoAlmacenDevolucion() As Boolean + Get + Return If(IsNothing(ViewState("RealizarTraspasoAlmacenDevolucion")), False, CBool(ViewState("RealizarTraspasoAlmacenDevolucion"))) + End Get + Set + ViewState("RealizarTraspasoAlmacenDevolucion") = Value + End Set + End Property #End Region @@ -404,8 +428,9 @@ Partial Class Inventarios_RecepcionAlmacen CveFleteCompra = -1 BuscaEntregaDirecta = -1 CveAlmacenApartado = -1 + CveAlmacenDevolucionProveedor = -1 TipoMovimiento = 1 - + RealizarTraspasoAlmacenDevolucion = False CantidadTotal = 0 IndexSeccionAlmacen = 0 @@ -778,6 +803,8 @@ Partial Class Inventarios_RecepcionAlmacen DivTipoCambio.Visible = False Apartado = False CveAlmacenApartado = -1 + CveAlmacenDevolucionProveedor = -1 + RealizarTraspasoAlmacenDevolucion = False BtnGuardar.Enabled = True CargaAlmacenes(-1) @@ -829,6 +856,9 @@ Partial Class Inventarios_RecepcionAlmacen Private Sub CargaCompra(pCveCompra As Integer, pCveProveedor As Integer) 'CargaAlmacenes(-1) + RealizarTraspasoAlmacenDevolucion = False + CveAlmacenDevolucionProveedor = -1 + Dim ObjCompras As New ClsCompras Dim ObjInventario As New ClsInventarios @@ -896,6 +926,13 @@ Partial Class Inventarios_RecepcionAlmacen DtRecepcion = ObjInventario.DtResultados.Copy() End If + If TipoMovimiento = 2 AndAlso GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=21).Rows.Count > 0 Then + RealizarTraspasoAlmacenDevolucion = True + CveAlmacenDevolucionProveedor = DtRecepcion.Rows(0)("CveAlmacenDevolucionProveedor").ToString.ToEntero + 'CreaDTAlmacenDevolucion() + 'CargaAlmacenes(-1, "21", CveTipoCompra) + End If + DtDatosDetalle = Nothing CreaDtDetalle() DtDatosLoteDetalle = Nothing @@ -1494,6 +1531,14 @@ Partial Class Inventarios_RecepcionAlmacen End If End Sub + Private Sub CreaDTAlmacenDevolucion() + If DtAlmacenesDevolucion Is Nothing Then + DtAlmacenesDevolucion = New DataTable + DtAlmacenesDevolucion.Columns.Add("CveCompraDetalle", GetType(Integer)) + DtAlmacenesDevolucion.Columns.Add("CveAlmacenOriginal", GetType(Integer)) + End If + End Sub + Private Sub CargaSerie(Tipo As Integer, Optional CerrarCompletado As Boolean = False) 'RegistraScript("document.getElementById(""TxtSerie"").focus();") RegistraScript("$('#DivSerie').modal();", "ModalLote") @@ -2206,6 +2251,10 @@ Partial Class Inventarios_RecepcionAlmacen Dim CveMovimientoVirtual As Integer = -1 Dim FolioVirtual As Integer = -1 + 'TRASPASO DEVOLUCION + Dim CveMovimientoSalidaTraspaso As Integer = -1 + Dim FolioSalidaTraspaso As String = "" + 'CONTABILIDAD Dim CvePrePoliza = -1 Dim MensajeContabilidad = "" @@ -2218,19 +2267,26 @@ Partial Class Inventarios_RecepcionAlmacen If HdnTipoDocto.Value <> "Fac" Then RecibidaCompleta = False + Dim CveConceptoAlmacen As Integer = If(TipoMovimiento > 1, 13, 2) + Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero Dim CveModalidad As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveModalidad").ToEntero() Dim EsContabilizable As Boolean = (CveModalidad = 1) - 'ENTRADA ALMACÉN - CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, If(TipoMovimiento > 1, 13, 2), 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, - CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), - MovimientoFijo:=If(TipoMovimiento = 2, True, False), Remision:=TxtRemision.Text, Modulo:="RA/G1") - If CveMovimiento > 0 Then - CveMovimientoOriginal = CveMovimiento - InvFolio = ObjInventario.Folio.ToString + If RealizarTraspasoAlmacenDevolucion AndAlso TipoMovimiento = 2 Then + CveConceptoAlmacen = 26 + + 'For Each gvr As GridViewRow In GvInv.Rows + ' If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then + ' Dim Row As DataRow = DtAlmacenesDevolucion.NewRow() + ' Row("CveCompraDetalle") = gvr.DataKey("CveCompraDetalle").ToEntero() + ' Row("CveAlmacenOriginal") = gvr.DataKey("CveAlmacenOriginal").ToEntero() + ' DtAlmacenesDevolucion.Rows.Add(Row) + ' End If + 'Next + Dim DtDetalle As New DataTable Dim DtDetalleLote As New DataTable Dim PU As Decimal = 0.0D @@ -2238,6 +2294,119 @@ Partial Class Inventarios_RecepcionAlmacen Dim CostoIndirecto As Decimal = 0.0D Dim SumaTotal As Decimal = 0.0D Dim Cont As Integer = 0 + + Dim CveMovtoSalidaActual = -1 + Dim CveMovtoEntradaActual = -1 + Dim CveVendedorActual = -1 + Dim CveClienteActual = -1 + + Dim CveAlmacenDestino = CveAlmacen + Dim CveSeccionDestino As Integer = -1 + + 'For Each RowAlmacen As DataRow In DtAlmacenesDevolucion.FiltraParametros("", DistinctColumns:={"CveAlmacenOrignal"}).Rows + + 'SALIDA DE ALMACEN POR TRASPASO + CveMovimientoSalidaTraspaso = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, + CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), + MovimientoFijo:=If(TipoMovimiento = 2, True, False), CveAlmacenDestino:=CveAlmacenDestino, Remision:=TxtRemision.Text, Modulo:="RA/G1") + + If CveMovimientoSalidaTraspaso > 0 Then + FolioSalidaTraspaso = ObjInventario.Folio.ToString() + + For Each gvr As GridViewRow In GvInv.Rows '.Cast(Of GridViewRow).Where(Function(row) row.DataKey("CveAlmacenOrignal") = RowAlmacen("CveAlmacenOrignal").ToString()) + If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then + + PU = DtInv.Rows(gvr.RowIndex)("PU").ToString.ToDecimal + CostoIndirecto = DtInv.Rows(gvr.RowIndex)("CostoIndirecto").ToString.ToDecimal + PUExtranjero = DtInv.Rows(gvr.RowIndex)("PUExtranjero").ToString.ToDecimal + + 'SI FUE POR SERIE LOTE + DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec").ToEntero)) + DtDetalleLote = DtDatosLoteDetalle.FiltraParametros(String.Format("ConsecId = {0}", gvr.DataKey("Consec").ToEntero)) + If DtDetalle.Rows.Count > 0 Then + Dim ContDt As Integer = 0 + For Each Dr As DataRow In DtDetalle.Rows + SumaTotal += PU + CostoIndirecto + If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalle.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> SumaTotal Then + If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + PU = Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - (PU)) + End If + End If + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTraspaso, 1, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Serie:=Dr("Serie").ToString, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then + ErrorMovInv = True + Exit For + End If + ContDt += 1 + Next + ElseIf DtDetalleLote.Rows.Count > 0 Then + Dim ContDt As Integer = 0 + For Each Dr As DataRow In DtDetalleLote.Rows + SumaTotal += Dr("Cantidad").ToString.ToDecimal * (PU + CostoIndirecto) + If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso ContDt + 1 = DtDetalleLote.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> SumaTotal Then + If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - (Dr("Cantidad").ToString.ToDecimal * (PU)))) / Dr("Cantidad").ToString.ToDecimal + End If + End If + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTraspaso, Dr("Cantidad").ToString.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then + ErrorMovInv = True + Exit For + End If + + ContDt += 1 + Next + Else + SumaTotal += gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU + CostoIndirecto) ' considerar el costo indirecto para el ajuste + If RecibidaCompleta AndAlso Cont + 1 = GvInv.Rows.Count AndAlso Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2) <> Math.Round(SumaTotal, 2) Then + Dim tTotal As Decimal = gvr.FCTextBox("TbCantidadF").Text.ToDecimal * (PU) + If Not UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + PU = (Math.Round((TotalCompraOC * If(TipoCambio > 1, TipoCambio, 1)), 2).ToDecimal - (SumaTotal - tTotal)) / gvr.FCTextBox("TbCantidadF").Text.ToDecimal + End If + End If + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTraspaso, gvr.FCTextBox("TbCantidadF").Text.ToDouble, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CvePS").ToEntero, PU, -1, PUTC:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, PUExtranjero), CveCompraDetalle:=gvr.DataKey("CveCompraDetalle").ToEntero, CveOrdenCompraDetalle:=gvr.DataKey("CveOrdenCompraDetalle").ToEntero, CveVentaDetalle:=gvr.DataKey("CveVentaDetalle").ToEntero, CostoIndirecto:=CostoIndirecto, CveUsuarioModifico:=UsuarioActual.CveUsuario, FechaCaducidad:=If(CBool(gvr.DataKey("AplicaCaducidad")), gvr.FCTextBox("TxtCaducidad").Text.ToDate, MinFecha), Lote:=If(CBool(gvr.DataKey("AplicaLote")), gvr.FCTextBox("TxtLote").Text, ""), CveSeccionAlmacen:=If(CBool(gvr.DataKey("AplicaSeccion")), gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, -1)) Then + ErrorMovInv = True + Exit For + End If + + End If + 'If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then + ' For Each Dr As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {gvr.RowIndex}").Rows + ' If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("CantidadSeccionAlmacen").ToString.ToDecimal) Then + ' ErrorMovInv = True + ' Exit For + ' End If + ' Next + 'End If + Cont += 1 + End If + Next + Else + ErrorMovInv = True + End If + + 'Next + + 'MODIFICA EL CONCEPTO PARA REALIZAR LA ENTRADA + CveConceptoAlmacen = 27 + CveAlmacen = CveAlmacenDevolucionProveedor + End If + + 'ENTRADA ALMACÉN + CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, 1, FechaMovto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, + CveCompraSurtir, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, TipoCambio:=If(DdlMonedaTC.SelectedValue.ToEntero = 1, -1, TipoCambio), + MovimientoFijo:=If(TipoMovimiento = 2, True, False), CveMovimientoRelacionado:=CveMovimientoSalidaTraspaso, Remision:=TxtRemision.Text, Modulo:="RA/G1") + + If CveMovimiento > 0 Then + CveMovimientoOriginal = CveMovimiento + InvFolio = ObjInventario.Folio.ToString + + Dim DtDetalle As New DataTable + Dim DtDetalleLote As New DataTable + Dim PU As Decimal = 0.0D + Dim PUExtranjero As Decimal = 0.0D + Dim CostoIndirecto As Decimal = 0.0D + Dim SumaTotal As Decimal = 0.0D + Dim Cont As Integer = 0 + For Each gvr As GridViewRow In GvInv.Rows If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then @@ -2858,6 +3027,7 @@ Partial Class Inventarios_RecepcionAlmacen MensajeError = "Error al obtener movimientos" End If End If + 'PREPOLIZA - NC If TipoMovimiento = 3 AndAlso Not ErrorMovInv Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then @@ -2983,6 +3153,75 @@ Partial Class Inventarios_RecepcionAlmacen End If End If + If Not ErrorMovInv AndAlso TipoMovimiento = 2 AndAlso CveMovimientoSalidaTraspaso > 0 Then + + 'VARIABLES + Dim Fecha As Date = Now + Dim CveProveedor As Integer = -1 + Dim ProveedorNombre As String = "" + Dim SerieFolio As String = "" + + 'Dim DrAlmO, DrAlmD As DataRow + 'Dim CveSucursalOrigen, CveSucursalDestino As Integer + 'Dim TipoAlmacenOrigen, TipoAlmacenDestino As Integer + 'Dim CveSubProyectoOrigen, CveSubProyectoDestino As Integer + Dim IdCtaContableOrigen, IdCtaContableDestino As Integer + + If ObjCompras.GetCompras(CveCompraSurtir, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then + 'Fecha = ObjCompras.DtResultados(0)("Fecha").ToString.ToDate + Fecha = TxtFecha.Text.ToDate + CveProveedor = ObjCompras.DtResultados(0)("CveProveedor").ToString.ToEntero + ProveedorNombre = ObjCompras.DtResultados(0)("RazonSocial").ToString + SerieFolio = $"Compra: {ObjCompras.DtResultados(0)("SerieFolio").ToString}" + Else + ErrorMovInv = True + End If + + 'DrAlmO = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero).FiltroPrimero("") + 'DrAlmD = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenDevolucionProveedor).FiltroPrimero("") + + 'If Not ErrorMovInv AndAlso DrAlmO IsNot Nothing AndAlso DrAlmD IsNot Nothing Then + ' CveSucursalOrigen = DrAlmO("CveSubProyecto").ToString.ToEntero + ' TipoAlmacenOrigen = DrAlmO("CveTipoAlmacen").ToString.ToEntero + ' CveSubProyectoOrigen = DrAlmO("CveSubProyecto").ToString.ToEntero + ' IdCtaContableOrigen = DrAlmO("IdCtaContable").ToString.ToEntero + + ' CveSucursalDestino = DrAlmD("CveSubProyecto").ToString.ToEntero + ' TipoAlmacenDestino = DrAlmD("CveTipoAlmacen").ToString.ToEntero + ' CveSubProyectoDestino = DrAlmD("CveSubProyecto").ToString.ToEntero + ' IdCtaContableDestino = DrAlmO("IdCtaContable").ToString.ToEntero + 'Else + ' ErrorMovInv = True + 'End If + + Dim resultado As DataTable = Nothing + + If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaTraspaso, UsuarioActual.CveEmpresa) Then + resultado = ObjInventario.DtResultados.Copy() + Else + ErrorMovInv = True + End If + + 'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {CveAlmacenDevolucionProveedor}").ToEntero() + + 'AGREGAMOS PREPOLIZAS TRASPASO DIRECTO: + Dim CvePrePolizaTraspaso As Integer = ObjConta.AddPrePolizas("RecepcionAlmacen/TraspasoAlmacen", 53, 0, 0, 1, Now, ProveedorNombre, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CvePrePolizaTraspaso > 0 AndAlso ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaTraspaso, UsuarioActual.CveEmpresa) Then + Dim importe As Decimal = resultado.SUMD("Total").RoundSQL + + If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalidaTraspaso, Contabilizable:=False, ImporteMX:=importe) Then + ErrorMovInv = True + End If + + If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePolizaTraspaso, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableDestino, -1, CveMovimientoAlmacen:=CveMovimiento, Contabilizable:=False, ImporteMX:=importe) Then + ErrorMovInv = True + End If + Else + ErrorMovInv = True + End If + + End If + 'AGREGA SALDOS A OC SURTIDAS If Not ErrorMovInv And CveOCSurtir > 0 Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then @@ -3013,8 +3252,19 @@ Partial Class Inventarios_RecepcionAlmacen Dim Msg As New StringBuilder Dim link As String = String.Format("{1}", CveMovimiento, InvFolio) - Msg.AppendFormat("Movimiento Registrado: Folio: {0}", link) - Msg.AppendFormat("
    Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento))) + 'SI LO SOLO GENERO EL MOVIMIENTO DE ENTRADA O SALIDA + If CveMovimiento > 0 AndAlso CveMovimientoSalidaTraspaso <= 0 Then + Msg.AppendFormat("Movimiento Registrado: Folio: {0}", link) + Msg.AppendFormat("
    Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento))) + 'SI GENERO UN TRASPASO AL ALMACEN DE DEVOLUCION + ElseIf CveMovimiento > 0 AndAlso CveMovimientoSalidaTraspaso > 0 Then + Msg.AppendFormat("Movimiento de Salida: Folio: {0}", String.Format("{1}", CveMovimientoSalidaTraspaso, FolioSalidaTraspaso)) + Msg.AppendFormat("
    Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalidaTraspaso))) + + Msg.AppendFormat("
    Movimiento de Entrada: Folio: {0}", link) + Msg.AppendFormat("
    Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento))) + End If + 'If CveMovtoSalidaDirecta > 0 Then ' Msg.AppendFormat("

    Movimientos de control:
    ") @@ -3047,7 +3297,6 @@ Partial Class Inventarios_RecepcionAlmacen link = String.Format("{1}", CveMovimientoVirtual, FolioVirtual) Msg.AppendFormat("
    Movimiento de Entrada al Almacen Virtual: Folio: {0}", link) Msg.AppendFormat("
    Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtual))) - End If 'CONTABILIDAD From ee8dc02da948338a064b11afc4a892926115d10d Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 14 Sep 2020 19:04:45 -0700 Subject: [PATCH 3/5] Correcciones de portal del cliente --- GPS/Shipments.aspx | 2 +- PortalCliente/PortalCliente.aspx.vb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GPS/Shipments.aspx b/GPS/Shipments.aspx index 4dd237032..a7276eda6 100644 --- a/GPS/Shipments.aspx +++ b/GPS/Shipments.aspx @@ -731,6 +731,6 @@ } - + diff --git a/PortalCliente/PortalCliente.aspx.vb b/PortalCliente/PortalCliente.aspx.vb index 4a162581a..c45f2926f 100644 --- a/PortalCliente/PortalCliente.aspx.vb +++ b/PortalCliente/PortalCliente.aspx.vb @@ -701,7 +701,7 @@ Partial Class Ventas_PortalCliente End If If EstatusPagoProsepago = 0 Then - Alert("Ocurrió un error al procesar el pago, no se a realizadó ningun cargo. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) + Alert("La transacción no se pudo realizar, no se aplicó ningun cargo. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Exit Sub End If @@ -1131,7 +1131,7 @@ Partial Class Ventas_PortalCliente If Not TieneError Then ObjConta.Commit() - Alert($"Se realizó el pago exitoso de las siguientes facturas:

    {MensajeAlert.ToString}", TipoMensaje.MsgInformacion) + Alert($"La transacción se realizó correctamente y el pago se aplicó en las siguientes facturas:

    {MensajeAlert.ToString}", TipoMensaje.MsgInformacion) Else ObjConta.RollBack() Alert(MensajeError.ToString, TipoMensaje.MsgError) From 1c5227adb97c3b017514e9917cdf445741140b2a Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 14 Sep 2020 19:05:05 -0700 Subject: [PATCH 4/5] Cambios en nivel de confianza --- OC/OC.aspx.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 7b394c0fd..29e39b48d 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -5345,11 +5345,11 @@ Partial Class OC If CveConfianzaProveedor <= 0 Then CveConfianzaProveedor = 2 End If - - ChkCotizacion.Checked = CveConfianzaProveedor > 0 - ChkCotizacion.Enabled = CveConfianzaProveedor <= 0 End If + ChkCotizacion.Checked = CveConfianzaProveedor > 0 + ChkCotizacion.Enabled = CveConfianzaProveedor <= 0 + End If End If From f6115c4b61a60dd433a5565a6bab4ef5e32b3beb Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Mon, 14 Sep 2020 19:34:01 -0700 Subject: [PATCH 5/5] Orden de trabajo --- AF/CatTiposServiciosActividades.aspx.cs | 8 +- AF/OrdenTrabajo.aspx | 140 ++++++++----- AF/OrdenTrabajo.aspx.vb | 37 +++- AF/OrdenTrabajoAsignacion.aspx | 237 ++++++++++++++++++++++ AF/OrdenTrabajoAsignacion.aspx.vb | 227 ++++++++++++++++++++++ AF/RepOrdenTrabajo.aspx | 248 ++++++++++++++++++++++++ AF/RepOrdenTrabajo.aspx.vb | 187 ++++++++++++++++++ App_Code/ClsAF.vb | 37 +++- App_Code/ClsBancos.vb | 2 +- App_Code/ClsPaginas.vb | 5 + 10 files changed, 1060 insertions(+), 68 deletions(-) create mode 100644 AF/OrdenTrabajoAsignacion.aspx create mode 100644 AF/OrdenTrabajoAsignacion.aspx.vb create mode 100644 AF/RepOrdenTrabajo.aspx create mode 100644 AF/RepOrdenTrabajo.aspx.vb diff --git a/AF/CatTiposServiciosActividades.aspx.cs b/AF/CatTiposServiciosActividades.aspx.cs index 80f1e0df3..1c4801f17 100644 --- a/AF/CatTiposServiciosActividades.aspx.cs +++ b/AF/CatTiposServiciosActividades.aspx.cs @@ -33,7 +33,7 @@ public partial class AF_CatTiposServiciosActividades : ClsPaginas private void CargaDatos() { ClsAF ObjAF = new ClsAF(); - if (ObjAF.GetTiposServiciosActividades(-1, -1)) + if (ObjAF.GetTiposServiciosActividades(-1, -1,-1)) { GvDatos.DataSource = ObjAF.DtResultados; GvDatos.DataBind(); @@ -74,7 +74,7 @@ public partial class AF_CatTiposServiciosActividades : ClsPaginas GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); CveTipoServicioActividad = GvRow.DataKey("CveTipoServicioActividad").ToEntero(); ClsAF ObjAF = new ClsAF(); - if (ObjAF.DeleteTiposServiciosActividades(CveTipoServicioActividad)) + if (ObjAF.DeleteTiposServiciosActividades(CveTipoServicioActividad, UsuarioActual.CveEmpresa)) { CargaDatos(); UpDatos.Update(); @@ -89,14 +89,14 @@ public partial class AF_CatTiposServiciosActividades : ClsPaginas ClsAF ObjAF = new ClsAF(); if (BtnAgregarTipoServicio.Text == "Agregar") { - if (ObjAF.AddTiposServiciosActividades(DdlActividades.SelectedValue.ToEntero(),TxtDuracion.Text.ToEntero(),TxtObservaciones.Text)) + if (ObjAF.AddTiposServiciosActividades(DdlActividades.SelectedValue.ToEntero(),-1,TxtDuracion.Text.ToDecimal(),TxtObservaciones.Text)) { Alert("Se agregó la Actividad del Tipo de Servicio correctamente"); } } else { - if (ObjAF.UpdateTiposServiciosActividades(CveTipoServicioActividad,DdlActividades.SelectedValue.ToEntero(),TxtDuracion.Text.ToEntero(),TxtObservaciones.Text)) + if (ObjAF.UpdateActividades(DdlActividades.SelectedValue.ToEntero(),TxtDuracion.Text.ToEntero(),TxtObservaciones.Text)) { Alert("Se actualizó la Actividad del Tipo de Servicio correctamente"); } diff --git a/AF/OrdenTrabajo.aspx b/AF/OrdenTrabajo.aspx index 6128ed0b5..9756fc76c 100644 --- a/AF/OrdenTrabajo.aspx +++ b/AF/OrdenTrabajo.aspx @@ -137,67 +137,91 @@
    + +
    +
    +
    + + -
    - -
    +
    +
    +
    +
    + + + +
    +
    + +
    + +
    - + Baja Media Alta -
    - - -
    - - -
    - - - - -
    - - - - - - - -
    - -
    - -
    - - - - -
    - - - <%----%> - - <%----%> -
    -
    - +
    +
    +
    + + +
    + + + + +
    + + + + + + + +
    + +
    +
    +
    + +
    + + + + +
    + + + <%----%> + + <%----%> + +
    + +
    +
    + +
    + +
    + +
    @@ -235,7 +259,7 @@ @@ -248,7 +272,7 @@ - + @@ -256,15 +280,25 @@ - - Faltante - + Faltante - + + + +
    +
    + +
    +
    + +
    +
    + +
    - + +
    diff --git a/AF/OrdenTrabajo.aspx.vb b/AF/OrdenTrabajo.aspx.vb index 522701bf7..f0bfa4347 100644 --- a/AF/OrdenTrabajo.aspx.vb +++ b/AF/OrdenTrabajo.aspx.vb @@ -50,12 +50,16 @@ Partial Class AF_OrdenTrabajo If Request("CveOrdenTrabajo") IsNot Nothing Then CveOrdenTrabajo = Request("CveOrdenTrabajo").ToEntero - DVFechaFin.Visible = True - Tab.Visible = True + If CveOrdenTrabajo > 0 Then - CargaDatos() + DVFechaFin.Visible = True + DVFolioAsignado.Visible = True + DVEstatus.Visible = True + Tab.Visible = True + CargaDatos() + End If End If @@ -78,7 +82,7 @@ Partial Class AF_OrdenTrabajo DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1) DdlAF.DataBind() - + DdlAF.Items.Insert(0, New ListItem("Seleccione uno", "-1")) Dim ObjAF As New ClsAF @@ -127,7 +131,8 @@ Partial Class AF_OrdenTrabajo If ObjAF.DtResultados IsNot Nothing AndAlso ObjAF.DtResultados.Rows.Count > 0 Then - LblFolio.Text = $"Folio OT: {ObjAF.DtResultados(0)("Folio").ToString}" + LblFolio.Text = ObjAF.DtResultados(0)("Folio").ToString + LblAsiganado.Text = ObjAF.DtResultados(0)("NombreCompleto").ToString DdlSubProyecto.SelectedValueExist(ObjAF.DtResultados(0)("CveSubProyecto").ToString) DdlAF.SelectedValueExist(ObjAF.DtResultados(0)("CveAF").ToString) @@ -197,6 +202,16 @@ Partial Class AF_OrdenTrabajo Else + If DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero = 3 Then + If txtFechaF.Text.Length = 0 Then + Alert("La fecha fin es requerida.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + End If + + + + Dim ObjAF As New ClsAF ObjAF.IniciaTransacSQL() Dim ErrorProceso As Boolean = False @@ -210,7 +225,7 @@ Partial Class AF_OrdenTrabajo FechaFinal = txtFechaF.Text.ToDate End If - If Not ObjAF.UpdateOrdenesTrabajo(CveOrdenTrabajo, DdlTipoServicio.SelectedValue.ToEntero, DdlAF.SelectedValue.ToEntero, TxtServicio.Text.Trim, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, txtFechaI.Text.ToDate, FechaFinal, MaxFecha, DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + If Not ObjAF.UpdateOrdenesTrabajo(CveOrdenTrabajo, DdlTipoServicio.SelectedValue.ToEntero, DdlAF.SelectedValue.ToEntero, TxtServicio.Text.Trim, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, txtFechaI.Text.ToDate, FechaFinal, MaxFecha, DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then ErrorProceso = True End If @@ -394,12 +409,16 @@ Partial Class AF_OrdenTrabajo Protected Sub GvMaterial_RowDataBound(sender As Object, e As GridViewRowEventArgs) - If e.Row.RowType = DataControlRowType.Header Then + If e.Row.RowType = DataControlRowType.DataRow Then If GvMaterial.Columns(4).Visible Then - Dim HLOC As HyperLink = e.Row.FCHyperLink("HLOC") - HLOC.NavigateUrl = $"../OC/OC.aspx?CveOrdenTrabajo={CveOrdenTrabajo}" + If e.Row.DataKey("Faltante").ToDecimal > 0 Then + Dim HLOC As HyperLink = e.Row.FCHyperLink("HLOC") + HLOC.Visible = True + HLOC.NavigateUrl = $"../OC/OC.aspx?CveOrdenTrabajo={CveOrdenTrabajo}" + End If + End If diff --git a/AF/OrdenTrabajoAsignacion.aspx b/AF/OrdenTrabajoAsignacion.aspx new file mode 100644 index 000000000..7253a443f --- /dev/null +++ b/AF/OrdenTrabajoAsignacion.aspx @@ -0,0 +1,237 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="OrdenTrabajoAsignacion.aspx.vb" Inherits="AF_OrdenTrabajoAsignacion" %> + + + + + + + + + + + + Ordenes de trabajo Asignación + + + + + + + + +
    +
    +
    + + + + + + +
    +
    + +
    + + +
    + : +
    +
    + +
    + +
    Activo Fijo:
    +
    + +
    + +
    Tipo Servicio:
    +
    + +
    + + +
    Fecha Inicio:
    +
    +
    + + + + +
    + + + <%-- + --%> +
    + + +
    Fecha Fin:
    +
    + + +
    + + + + +
    + + + +
    + + +
    + + +
    +
    +
    +
    +
    Prioridad:
    +
    + + Todas + Baja + Media + Alta + +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + + + + +
    +
    + + +
    + + + + + + diff --git a/AF/OrdenTrabajoAsignacion.aspx.vb b/AF/OrdenTrabajoAsignacion.aspx.vb new file mode 100644 index 000000000..9bcbb867a --- /dev/null +++ b/AF/OrdenTrabajoAsignacion.aspx.vb @@ -0,0 +1,227 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class AF_OrdenTrabajoAsignacion + Inherits ClsPaginas + +#Region " PROPIEDADES" + + Property DT_Cabeceras As DataTable + Get + + If ViewState("DT_Cabeceras") Is Nothing Then + + Return New DataTable + Else + Return DirectCast(ViewState("DT_Cabeceras"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("DT_Cabeceras") = value + End Set + End Property + + + Property DT_Datos As DataTable + Get + + If ViewState("DT_Datos") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DT_Datos"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("DT_Datos") = 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 + + CargaCombos() + CargaDatos() + + Dim FechaActual As Date = Now + + + 'TxtFechaF.Text = $"{FechaActual.Day.ToString("00")}/{FechaActual.Month.ToString("00")}/{FechaActual.Year}" + TxtFechaF.Text = "" + FechaActual = FechaActual.AddDays(-30) + TxtFechaI.Text = $"{FechaActual.Day.ToString("00")}/{FechaActual.Month.ToString("00")}/{FechaActual.Year}" + + End If + End Sub + + +#Region " CARGA PARAMETROS " + +#End Region + +#Region " CARGA COMBOS " + Protected Sub CargaCombos() + + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + + DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1) + DdlAF.DataBind() + + DdlAF.Items.Insert(0, New ListItem("Todos", "-1")) + + Dim ObjAF As New ClsAF + + If ObjAF.GetTiposServicios(-1, -1, -1, UsuarioActual.CveEmpresa) Then + DdlTipoServicio.DataSource = ObjAF.DtResultados + Else + DdlTipoServicio.DataSource = Nothing + End If + + ObjAF.Dispose() + DdlTipoServicio.DataBind() + DdlTipoServicio.Items.Insert(0, New ListItem("Todos", "-1")) + + UpFiltro.Update() + + + End Sub + + +#End Region + +#Region " CARGA DATOS " + Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) + CargaDatos() + + End Sub + + +#End Region + +#Region " GV DATOS " + + Private Sub CargaDatos() + + Dim FechaInicio, FechaFin As Date + + FechaInicio = TxtFechaI.Text.ToDate + + + FechaFin = MaxFecha + If TxtFechaF.Text.Length = 10 Then + FechaFin = TxtFechaF.Text.ToDate + End If + + + Dim ObjAF As New ClsAF + + If ObjAF.GetOrdenesTrabajo(-1, DdlTipoServicio.SelectedValue.ToEntero, -1, DdlAF.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, FechaInicio, FechaFin, MaxFecha, -1, UsuarioActual.CveEmpresa) Then + + GvDatos.DataSource = ObjAF.DtResultados + + If ObjAF.DtResultados.Rows.Count > 0 Then + BtnGuardar.Enabled = True + Else + BtnGuardar.Enabled = False + End If + + Else + GvDatos.DataSource = Nothing + BtnGuardar.Enabled = False + End If + + ObjAF.Dispose() + + GvDatos.DataBind() + UpDatos.Update() + + End Sub + + + + + Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + Dim CvePersonal As Integer = e.Row.DataKey("CvePersonal").ToEntero + Dim DdlPersonal As DropDownList = e.Row.FCDropDownList("DdlPersonal") + + DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, -1).FiltraParametros("CveEstatusPersonal = 1") + DdlPersonal.DataBind() + DdlPersonal.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) + + DdlPersonal.SelectedValueExist(CvePersonal) + + + End If + + End Sub + +#End Region + + + + + Protected Sub LnkEliminarMetricaValor_Click(sender As Object, e As EventArgs) + + End Sub + + + + Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) + + + Dim ObjAf As New ClsAF + Dim ErrorProceso As Boolean = False + Dim CountAsiganados As Integer = 0 + + + ObjAf.IniciaTransacSQL() + + For Each GvRow As GridViewRow In GvDatos.Rows + If GvRow.RowType = DataControlRowType.DataRow Then + + Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero + Dim DdlPersonal As DropDownList = GvRow.FCDropDownList("DdlPersonal") + Dim CveOrdenTrabajo As Integer = GvRow.DataKey("CveOrdenTrabajo").ToEntero + + If DdlPersonal.SelectedValue.ToEntero > 0 AndAlso (DdlPersonal.SelectedValue.ToEntero <> CvePersonal) Then + + If Not ObjAf.UpdateOrdenesTrabajo(CveOrdenTrabajo, -1, -1, "-1", -1, -1, MinFecha, MaxFecha, MaxFecha, -1, UsuarioActual.CveEmpresa, DdlPersonal.SelectedValue.ToEntero) Then + ErrorProceso = True + Else + CountAsiganados = CountAsiganados + 1 + End If + + End If + + End If + Next + + If Not ErrorProceso Then + + ObjAf.Commit() + + If CountAsiganados > 0 Then + Alert($"{CountAsiganados} ordenes de trabajo asignadas.") + Else + Alert($"No se asigno ninguna orden de trabajo.", TipoMensaje.MsgAdvertencia) + End If + + Else + ObjAf.RollBack() + End If + + ObjAf.Dispose() + + + End Sub +End Class diff --git a/AF/RepOrdenTrabajo.aspx b/AF/RepOrdenTrabajo.aspx new file mode 100644 index 000000000..de459d883 --- /dev/null +++ b/AF/RepOrdenTrabajo.aspx @@ -0,0 +1,248 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOrdenTrabajo.aspx.vb" Inherits="AF_RepOrdenTrabajo" %> + + + + + + + + + + + + Reporte ordenes de trabajo + + + + + + + + +
    +
    +
    + + + + + + +
    +
    + +
    + +
    + Folio: +
    +
    + +
    + +
    + : +
    +
    + +
    + +
    Activo Fijo:
    +
    + +
    + +
    Tipo Servicio:
    +
    + +
    + + + +
    + + +
    +
    +
    +
    + + +
    Personal:
    +
    + +
    + + + +
    Fecha Inicio:
    +
    +
    + + + + +
    + + + <%-- + --%> +
    + + +
    Fecha Fin:
    +
    + + +
    + + + + +
    + + + +
    + +
    Estatus:
    +
    + + +
    + + +
    Prioridad:
    +
    + + Todas + Baja + Media + Alta + +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + diff --git a/AF/RepOrdenTrabajo.aspx.vb b/AF/RepOrdenTrabajo.aspx.vb new file mode 100644 index 000000000..d4be6f652 --- /dev/null +++ b/AF/RepOrdenTrabajo.aspx.vb @@ -0,0 +1,187 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class AF_RepOrdenTrabajo + Inherits ClsPaginas + +#Region " PROPIEDADES" + + Property DT_Cabeceras As DataTable + Get + + If ViewState("DT_Cabeceras") Is Nothing Then + + Return New DataTable + Else + Return DirectCast(ViewState("DT_Cabeceras"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("DT_Cabeceras") = value + End Set + End Property + + + Property DT_Datos As DataTable + Get + + If ViewState("DT_Datos") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DT_Datos"), DataTable) + End If + + End Get + Set(value As DataTable) + ViewState("DT_Datos") = 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 + + CargaCombos() + CargaDatos() + + Dim FechaActual As Date = Now + + + 'TxtFechaF.Text = $"{FechaActual.Day.ToString("00")}/{FechaActual.Month.ToString("00")}/{FechaActual.Year}" + TxtFechaF.Text = "" + FechaActual = FechaActual.AddDays(-30) + TxtFechaI.Text = $"{FechaActual.Day.ToString("00")}/{FechaActual.Month.ToString("00")}/{FechaActual.Year}" + + End If + End Sub + + +#Region " CARGA PARAMETROS " + +#End Region + +#Region " CARGA COMBOS " + Protected Sub CargaCombos() + + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + + DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1) + DdlAF.DataBind() + + DdlAF.Items.Insert(0, New ListItem("Todos", "-1")) + + Dim ObjAF As New ClsAF + + If ObjAF.GetTiposServicios(-1, -1, -1, UsuarioActual.CveEmpresa) Then + DdlTipoServicio.DataSource = ObjAF.DtResultados + Else + DdlTipoServicio.DataSource = Nothing + End If + + If ObjAF.GetOrdenesTrabajoEstatus(UsuarioActual.CveEmpresa) Then + DdlOrdenesTrabajoEstatus.DataSource = ObjAF.DtResultados + Else + DdlOrdenesTrabajoEstatus.DataSource = Nothing + End If + + ObjAF.Dispose() + + DdlTipoServicio.DataBind() + DdlTipoServicio.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlOrdenesTrabajoEstatus.DataBind() + DdlOrdenesTrabajoEstatus.Items.Insert(0, New ListItem("Todos", "-1")) + + + + + DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa, -1).FiltraParametros("CveEstatusPersonal = 1") + DdlPersonal.DataBind() + DdlPersonal.Items.Insert(0, New ListItem("Todos", "-1")) + + + UpFiltro.Update() + + + End Sub + + +#End Region + +#Region " CARGA DATOS " + Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) + CargaDatos() + + End Sub + + +#End Region + +#Region " GV DATOS " + + Private Sub CargaDatos() + + + Dim FechaInicio, FechaFin As Date + Dim Folio As Integer = If(TxtFolio.Text.ToEntero > 0, TxtFolio.Text.ToEntero, -1) + FechaInicio = TxtFechaI.Text.ToDate + + + If DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero = 3 AndAlso TxtFechaF.Text.Trim.Length = 0 Then + FechaFin = MaxFecha.AddDays(1) + Else + FechaFin = MaxFecha + End If + + + If TxtFechaF.Text.Length = 10 Then + FechaFin = TxtFechaF.Text.ToDate + End If + + + Dim ObjAF As New ClsAF + + If ObjAF.GetOrdenesTrabajo(-1, DdlTipoServicio.SelectedValue.ToEntero, Folio, DdlAF.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, DdlPrioridad.SelectedValue.ToEntero, FechaInicio, FechaFin, MaxFecha, DdlOrdenesTrabajoEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjAF.DtResultados + Else + GvDatos.DataSource = Nothing + End If + + ObjAF.Dispose() + + GvDatos.DataBind() + UpDatos.Update() + + End Sub + + + + + Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + End If + + End Sub + +#End Region + + + + + Protected Sub LnkEliminarMetricaValor_Click(sender As Object, e As EventArgs) + + End Sub + + + + + +End Class diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index c70e0c563..274b51195 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -4239,6 +4239,40 @@ Public Class ClsAF End Function + 'Public Function GetOrdenesTrabajoAsignacion(CveSubProyecto As Integer, CveAF As Integer, CveTipoServicio As Integer, FechaInicio As Date, FechaFin As Date, Prioridad As Integer, CveEmpresa As Integer) As Boolean + + ' Dim Retorno As Boolean = False + + ' DataAdapter("PA_AF_OrdenesTrabajoAsignacionGet") + + ' With SqlAdapter.SelectCommand.Parameters + ' .Add("@CveOrdenTrabajo", SqlDbType.Int).Value = CveOrdenTrabajo + ' .Add("@CveTipoServicio", SqlDbType.Int).Value = CveTipoServicio + + ' .Add("@CveAF", SqlDbType.Int).Value = CveAF + ' .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + ' .Add("@Prioridad", SqlDbType.Int).Value = Prioridad + ' .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio + '' .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + + ' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + + + + ' End With + + ' Try + ' SqlAdapter.Fill(Data) + ' Retorno = True + ' Catch ex As Exception + ' OnError("Ocurrió un error al consultar las ordenes de trabajo", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + ' End Try + + ' Return Retorno + + 'End Function + + Public Function AddOrdenesTrabajo(CveTipoServicio As Integer, CveAF As Integer, Servicio As String, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -4279,7 +4313,7 @@ Public Class ClsAF - Public Function UpdateOrdenesTrabajo(CveOrdenTrabajo As Integer, CveTipoServicio As Integer, CveAF As Integer, Servicio As String, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer) As Boolean + Public Function UpdateOrdenesTrabajo(CveOrdenTrabajo As Integer, CveTipoServicio As Integer, CveAF As Integer, Servicio As String, CveSubProyecto As Integer, Prioridad As Integer, FechaInicio As Date, FechaFin As Date, FechaFinReal As Date, CveEstatusOT As Integer, CveEmpresa As Integer, CvePersonal As Integer) As Boolean Dim Retorno As Boolean = False @@ -4299,6 +4333,7 @@ Public Class ClsAF .Add("@FechaFinReal", SqlDbType.Date).Value = FechaFinReal .Add("@CveEstatusOT", SqlDbType.Int).Value = CveEstatusOT .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal End With diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index af063505a..1ed92ca05 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -4723,7 +4723,7 @@ Public Class ClsBancos strBody.AppendFormat(" ") - For Each dr As DataRow In DtResultados.FiltraParametros("CveConceptoContable IN (17,312) AND CveCompra > 0").Rows + For Each dr As DataRow In DtResultados.FiltraParametros("CveConceptoContable IN (17,312,308) AND CveCompra > 0").Rows strBody.AppendFormat(" ") strBody.AppendFormat(" {0}", dr("Fecha").ToString.ToDate.ToShortDateString()) strBody.AppendFormat(" {0}", dr("SerieFolio").ToString) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 35bf0d9b8..632aa983b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3964,6 +3964,11 @@ Public Class ClsPaginas PaginaDict.Add("/AF/TipoOrdenTrabajo.aspx".ToUpper(), -1) PaginaDict.Add("/AF/OrdenTrabajo.aspx".ToUpper(), -1) PaginaDict.Add("/AF/RepOrdenTrabajo.aspx".ToUpper(), -1) + PaginaDict.Add("/AF/OrdenTrabajoAsignacion.aspx".ToUpper(), -1) + + + + #End Region 'AIMMGM