From bbe64521b5dfeac103c6fbeca01bea7994e49e6b Mon Sep 17 00:00:00 2001 From: rakcsle Date: Sat, 24 Aug 2024 13:51:04 -0700 Subject: [PATCH] =?UTF-8?q?SMS=20-=20OS,=20poder=20hacer=20la=20cancelaci?= =?UTF-8?q?=C3=B3n=20de=20una=20OS/Pedido.=20cuando=20la=20OS=20no=20est?= =?UTF-8?q?=C3=A9=20como=20finalizada.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsContabilidad.vb | 2 +- App_Code/ClsOC.vb | 4 +- App_Code/ClsPaginas.vb | 3 + Compras/Compras.aspx.vb | 14 +- Contabilidad/LibroMayor2.aspx | 246 +++++++++++++ Contabilidad/LibroMayor2.aspx.vb | 456 +++++++++++++++++++++++++ Inventarios/EntregaAlmacen.aspx.vb | 37 +- Inventarios/RepNotasSinAlmacen.aspx | 2 +- OC/PopUpBuscarReq.aspx | 4 +- OC/PopUpBuscarReq.aspx.vb | 31 +- OS/Asignaciones.aspx.vb | 34 +- OS/OrdenesServicios.aspx.vb | 6 +- Transportes/RepContratoDetalle.aspx | 2 +- Transportes/RepContratoDetalle.aspx.vb | 10 +- 14 files changed, 820 insertions(+), 31 deletions(-) create mode 100644 Contabilidad/LibroMayor2.aspx create mode 100644 Contabilidad/LibroMayor2.aspx.vb diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index 1964dcf3a..1a7c08f99 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -3577,7 +3577,7 @@ Public Class ClsContabilidad Public Function GetMovimientosAuxiliaresCatalogo(CveCuenta As Integer, FechaI As Date, FechaF As Date, CveMoneda As Integer, CveProyecto As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, TipoReporte As String, OpcionCuentas As Integer) As Boolean Dim Retorno As Boolean = False - DataAdapter("PA_Conta_MovimientosAuxiliaresCatalogoGet") + DataAdapter("PA_Conta_MovimientosAuxiliaresCatalogoGetOIC") With SqlAdapter.SelectCommand.Parameters .Add("@FechaI", SqlDbType.Date).Value = FechaI diff --git a/App_Code/ClsOC.vb b/App_Code/ClsOC.vb index a9083317b..5f7256e58 100644 --- a/App_Code/ClsOC.vb +++ b/App_Code/ClsOC.vb @@ -1670,7 +1670,8 @@ Public Class ClsOC FechaFin As Date, CveOrdenCompra As Integer, CveProveedor As Integer, Folio As Integer, CveUsuarioRegistro As Integer, CveUsuario As Integer, CveEmpresa As Integer, CvePS As Integer, Optional PendientePorSurtir As Boolean = False, Optional CveCliente As Integer = -1, Optional Guia As String = "-1", Optional CveActivoFijo As Integer = -1, Optional SoloSubProyectosConPermiso As Boolean = False, Optional CveUsuarioAutorizo As Integer = -1, - Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveMoneda As Integer = -1, Optional MetodoPago As Integer = -1) As Boolean + Optional CveUsuarioAsignado As Integer = -1, Optional EntregaDirecta As Integer = -1, Optional TopSelect As Integer = 10000, Optional CveMoneda As Integer = -1, + Optional MetodoPago As Integer = -1, Optional Serie As String = "-1") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OC_OrdenesCompraRep") @@ -1701,6 +1702,7 @@ Public Class ClsOC .Add("@TopSelect", SqlDbType.Int).Value = TopSelect .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda .Add("@MetodoPago", SqlDbType.Int).Value = MetodoPago + .Add("@Serie", SqlDbType.VarChar).Value = Serie End With diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 2a64841fe..dea581635 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -10172,6 +10172,9 @@ Public Class ClsPaginas PaginaDict.Add("/Contabilidad/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420) PaginaDict.Add("/Contabilidad/RepAnexoCatalogoMensualHorizontal.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad/CatBloqueoDiario.aspx".ToUpper(), 680) + PaginaDict.Add("/Contabilidad/LibroMayor2.aspx".ToUpper(), -1) + + #End Region #Region "Contratos" '--------------------- C O N T R A T O S - P R E S U P U E S T O S --------------------- diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index a24cdb404..ef2a680a3 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -14902,7 +14902,7 @@ Partial Class Compras_Compras AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA) AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA) - If ConfirmaVinculacionOCProntoPago() Then + If ConfirmaVinculacionOCProntoPago(AjusteProntoPagoPorcentajeIVA) Then Vinculacion() End If @@ -21246,14 +21246,18 @@ Partial Class Compras_Compras End Set End Property - Public Function ConfirmaVinculacionOCProntoPago() As Boolean + Public Function ConfirmaVinculacionOCProntoPago(AjusteProntoPagoPorcentajeIVA As Decimal) As Boolean If VincularOcProntoPago Then Return True Else - Dim StrMsg As String = $"Existe una diferencia de ${(ImporteRNC + ImporteRNCProntoPago).ToString("###,###,###.00")} entre la compra y la Orden de Compra.
Se generaran Remisiones de Nota de Crédito.
- Descuento de ${ImporteRNC.ToString("###,###,###.00")}.
" - If ImporteRNCProntoPago > 0 Then - StrMsg = StrMsg & $"- Pronto pago de ${ImporteRNCProntoPago.ToString("###,###,###.00")}" + + Dim TmpImporteRNC As Decimal = If(AjusteProntoPagoPorcentajeIVA > 0, (ImporteRNC * AjusteProntoPagoPorcentajeIVA), ImporteRNC) + Dim TmpImporteRNCProntoPago As Decimal = If(AjusteProntoPagoPorcentajeIVA > 0, (TmpImporteRNCProntoPago * AjusteProntoPagoPorcentajeIVA), ImporteRNCProntoPago) + + Dim StrMsg As String = $"Existe una diferencia de ${(TmpImporteRNC + TmpImporteRNCProntoPago).ToString("###,###,###.00")} entre la compra y la Orden de Compra.
Se generaran Remisiones de Nota de Crédito.
- Descuento de ${TmpImporteRNC.ToString("###,###,###.00")}.
" + If TmpImporteRNCProntoPago > 0 Then + StrMsg = StrMsg & $"- Pronto pago de ${TmpImporteRNCProntoPago.ToString("###,###,###.00")}" End If LblModalConfirmaVinculacionProntoPago.Text = StrMsg diff --git a/Contabilidad/LibroMayor2.aspx b/Contabilidad/LibroMayor2.aspx new file mode 100644 index 000000000..c4947c6c0 --- /dev/null +++ b/Contabilidad/LibroMayor2.aspx @@ -0,0 +1,246 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="LibroMayor2.aspx.vb" Inherits="Conta_LibroMayor2" EnableEventValidation="false" %> + + + + + + +
  • + Generar EXCEL +
  • +
  • + Imprimir +
  • + +
    + + Movimientos Auxiliares del Catálogo + + + + + +
    +
    +
    + + "><%--class="expand"--%> + +
    +
    +
    +
    + Cuenta: +
    +
    + + + + + +
    +
    + Fecha Inicio: +
    +
    +
    + + + + +
    + + + + + + +
    +
    + Fecha Fin: +
    +
    +
    + + + + +
    + + + + + + +
    +
    +
    +
    +
    > +
    +
    + Tipo Movto +
    +
    + + + + + + + +
    +
    + Tipo +
    +
    + + + + + +
    +
    + Proyecto: +
    +
    + + +
    + SubProyecto: +
    + + +
    + +
    +
    +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    CuentaNombreSaldo Inicial
    FechaTipoNúmeroConceptoReferenciaReferencia MovtoSubProyectoCargosAbonosSaldo
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + + + Saldo Inicial: + + +
    + + + + + + +
    + +
    +
    + + + + + + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + + + + + +
    + + + + + diff --git a/Contabilidad/LibroMayor2.aspx.vb b/Contabilidad/LibroMayor2.aspx.vb new file mode 100644 index 000000000..28c1021e5 --- /dev/null +++ b/Contabilidad/LibroMayor2.aspx.vb @@ -0,0 +1,456 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class Conta_LibroMayor2 + Inherits ClsPaginas + + +#Region "PROPIEDADES" + Private Property DtDatos As DataTable + Get + DtDatos = DirectCast(ViewState("DtDatos"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtDatos") = value + End Set + End Property + Private Property DtTotales As DataTable + Get + DtTotales = DirectCast(ViewState("DtTotales"), DataTable) + End Get + + Set(ByVal value As DataTable) + ViewState("DtTotales") = value + End Set + End Property + Private Property FechaInicio As Date + Get + FechaInicio = ViewState("FechaInicio").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaInicio") = value + End Set + End Property + Private Property FechaFin As Date + Get + FechaFin = ViewState("FechaFin").ToString.ToDate + End Get + Set(value As Date) + ViewState("FechaFin") = value + End Set + End Property + + Private Property TotalPadre As Boolean + Get + TotalPadre = CBool(ViewState("TotalPadre")) + End Get + Set(value As Boolean) + ViewState("TotalPadre") = value + End Set + End Property + Private Property DTCuentas As DataTable + Get + Return CType(ViewState("DTCuentas"), DataTable) + End Get + Set(value As DataTable) + ViewState("DTCuentas") = value + End Set + End Property + Private Property TipoReporte As String + Get + TipoReporte = ViewState("TP").ToString + End Get + Set(value As String) + ViewState("TP") = value + End Set + End Property + Private Property Cuenta As String + Get + Return ViewState("Cuenta").ToString + End Get + Set(value As String) + ViewState("Cuenta") = value + End Set + End Property +#End Region + + Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + 'If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.CveEmpresa <> 119 Then + ' Response.Redirect($"/Contabilidad/RepMovimientosAuxiliaresCatalogo.aspx") + 'End If + + Dim ErrorParametros As Boolean = True + + CargaTipoCuentas() + 'TxtCuenta.Enabled = False + + txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString + txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString + + + If Request("CveCuenta") IsNot Nothing AndAlso IsNumeric(Request("CveCuenta")) AndAlso Request("CveCuenta").ToEntero > 0 Then + If Request("FF") IsNot Nothing AndAlso Request("FF").ToString.Length = 10 AndAlso Request("FF").ToDate > "01/01/1000".ToDate Then + + FechaFin = Request("FF").ToDate + txtFechaF.Text = FechaFin.ToShortDateString + + DdlCuentas.SelectedValueExist(Request("CveCuenta").ToEntero) + + + If Request("FI") IsNot Nothing AndAlso Request("FI").ToString.Length = 10 AndAlso Request("FI").ToDate > "01/01/1000".ToDate Then + FechaInicio = Request("FI").ToDate + txtFechaI.Text = FechaInicio.ToShortDateString + Else + FechaInicio = DateSerial(Year(FechaFin), Month(FechaFin), 1) + TxtFechaF.Text = FechaInicio.ToShortDateString + End If + + If Request("CveProyecto") IsNot Nothing AndAlso IsNumeric(Request("CveProyecto")) Then + DdlProyecto.SelectedValueExist(Request("CveProyecto")) + DdlProyecto_SelectedIndexChanged(Nothing, Nothing) + End If + + If Request("CveSubProyecto") IsNot Nothing AndAlso IsNumeric(Request("CveSubProyecto")) Then + DdlSubproyecto.SelectedValueExist(Request("CveSubProyecto")) + End If + + ErrorParametros = False + + If Request("TP") IsNot Nothing AndAlso IsNumeric(Request("TP")) AndAlso Request("TP").ToEntero > 0 Then + TipoReporte = Request("TP").ToString + + ' DdlTipoReporte.SelectedValue = TipoReporte.ToString + End If + + + ''If DdlTipoCuentas.Items.FindByValue(IdCuenta.ToString) IsNot Nothing Then + '' DdlTipoCuentas.SelectedValue = IdCuenta.ToString + ''Else + '' DdlTipoCuentas.SelectedValue = "-2" + '' TxtCuenta.Enabled = True + + '' If DTCuentas.FiltraParametros(String.Format("Cvecuenta = {0}", IdCuenta)).Rows.Count > 0 Then + '' TxtCuenta.Text = DTCuentas.FiltraParametros(String.Format("CveCuenta = {0}", IdCuenta)).Rows(0)("Codigo").ToString + '' End If + ''End If + + End If + End If + + + If Not ErrorParametros Then + TotalPadre = True + TipoReporte = "1" + CargaDatos() + End If + + End If + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + If DdlCuentas.SelectedValue.ToEntero = -2 Then + Alert("El campo Cuenta es obligatorio.", TipoMensaje.MsgError) + Else + FechaInicio = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", NowADS(), txtFechaI.Text.ToDate) + FechaFin = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", NowADS(), txtFechaF.Text.ToDate) + + CargaDatos() + End If + ' Imprimir_click(sender, e) + 'RegistraScript("Enable();") + End Sub + +#Region "C A R G A - D A T O S" + Public Function WSCuentas() As String + Dim Str As New StringBuilder + Dim i As Integer = 0 + Dim dt As DataTable = DTCuentas + + For Each dr As DataRow In dt.Rows + i += 1 + Str.AppendFormat("{{value:""{0}"",label:""{1}""}}{2}", dr("CveCuenta"), dr("Codigo").ToString.Replace("""", ""), If(i < dt.Rows.Count, ",", "")) + Next + + Return Str.ToString + End Function + Private Sub CargaTipoCuentas() + + Dim ObjTipoCuenta As New ClsContabilidad + DdlCuentas.Enabled = True + + If ObjTipoCuenta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then + DTCuentas = ObjTipoCuenta.DtResultados + DdlCuentas.DataSource = ObjTipoCuenta.DtResultados.FiltraParametros("Codigo NOT IN ('_ACTIVO', '_PASIVO', '_CAPITAL', '_CUADRE', '_ESTADISTICAS', '_ORDEN', '_RACREEDOR', '_RDEUDOR', '_UTILIDAD')") + + End If + ObjTipoCuenta.Dispose() + DdlCuentas.DataBind() + + CargarCentrosDeCosto(DdlProyecto, DdlSubproyecto, LblProyecto, LblSubProyecto, divProyecto:=divProyecto) + + End Sub + + Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProyecto.SelectedIndexChanged + CargarSubProyecto(DdlSubproyecto, DdlProyecto.SelectedValue, "Todos") + End Sub + Private Sub CargaDatos() + + Dim CveProyecto As Integer = DdlProyecto.SelectedValue.ToEntero + Dim CveSubProyecto As Integer = DdlSubproyecto.SelectedValue.ToEntero + TipoReporte = DdlTipoReporte.SelectedValue.ToString + 'If TipoReporte = "1" And DdlCuentas.SelectedValue.ToEntero < 0 Then + ' Alert("No ha seleccionado cuenta, Favor de especificar una", TipoMensaje.MsgAdvertencia) + ' Exit Sub + 'End If + + Cuenta = DdlCuentas.SelectedItem.ToString + Dim ObjConta As New ClsContabilidad + If ObjConta.GetMovimientosAuxiliaresCatalogo(DdlCuentas.SelectedValue.ToEntero, FechaInicio, FechaFin, -1, CveProyecto, CveSubProyecto, UsuarioActual.CveEmpresa, TipoReporte, DdlOpcionCuentas.SelectedValue.ToEntero) Then + DtDatos = ObjConta.DtResultados + DtTotales = DtDatos.Clone + + CargaGrid() + Else + DtDatos = Nothing + End If + + ObjConta.Dispose() + End Sub +#End Region + + Private Sub InsertaTotales() + Dim i As Integer = 0 + Dim Aumento As Integer = 0 + Dim Row As DataRow + Dim Row2 As DataRow + + 'Llena DtTotales + For Each dr As DataRow In DtDatos.Rows + If dr("Concepto").ToString = "" Then + + Row = DtTotales.NewRow + + Row("CveCuenta") = -1 + Row("CargosMovto") = If("1" = "1", dr("Cargos"), dr("CargosME")) + Row("AbonosMovto") = If("1" = "1", dr("Abonos"), dr("AbonosME")) + Row("Saldo") = dr("SaldoActual") + Row("CtaMayor") = dr("CtaMayor") + Row("Concepto") = String.Format("Total {0}:", dr("Nombre")) + Row("Nombre") = dr("Nombre") + DtTotales.Rows.Add(Row) + Row("Clasificacion") = i + End If + + i += 1 + Next + + 'Inserta Totales en DtDatos + For Each dr As DataRow In DtTotales.Rows + i = 0 + + If dr("CtaMayor").ToString = "1" Then + DtDatos.ImportRow(dr) + End If + + If dr("CtaMayor").ToString = "2" Then + For index As Integer = dr("Clasificacion").ToString.ToEntero + Aumento To DtDatos.Rows.Count + If DtDatos.Rows(index)("Nombre").ToString <> dr("Nombre").ToString Then + i = index + Exit For + End If + Next + + Row2 = DtDatos.NewRow + Row2.ItemArray = dr.ItemArray + + DtDatos.Rows.InsertAt(Row2, i + Aumento) + Aumento += 1 + End If + + Next + + End Sub + + +#Region "G R I D - GV DATOS" + Private Sub CargaGrid() + GvDatos.DataSource = DtDatos + 'GvDatos.Dispose() + GvDatos.DataBind() + UpDatos.Update() + End Sub + Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.DataRow Then + + If e.Row.DBCampo("Concepto") = "" Then + e.Row.ControlStyle.Font.Bold = True + e.Row.ControlStyle.Height = 35 + + 'Cuando es Titulo + If e.Row.DBCampo("SaldoActual") = "" Then + CType(e.Row.FindControl("tr2"), HtmlTableRow).Visible = False + + + 'Cuando Es Total + Else + CType(e.Row.FindControl("tr1"), HtmlTableRow).Visible = False + + 'Anterior para TotalPadre + 'If e.Row.DBCampo("CtaMayor").ToString = "2" And (e.Row.DBCampo("Nivel3").ToString <> "" Xor e.Row.DBCampo("Orden").ToString.Length = 18) Then + ' e.Row.FCLabel("LbReferencia").Text = "Total:" + 'Else + ' e.Row.FCLabel("LbConcepto").Text = String.Format("Total {0}:", e.Row.DBCampo("Nombre").ToString) + 'End If + + If TotalPadre Then + CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Width = "1px" + 'CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells.Remove(CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3)) + CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Align = "Right" + CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(3).Width = "400px" + If e.Row.RowIndex + 1 = DtDatos.Rows.Count Then + CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(4).Attributes.Add("style", "border-top: 1px solid black;") + CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(5).Attributes.Add("style", "border-top: 1px solid black;") + CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(6).Attributes.Add("style", "border-top: 1px solid black;") + End If + e.Row.FCLabel("LbReferencia").Text = String.Format("Total {0}:", e.Row.DBCampo("Nombre").ToString) + + + Else + TotalPadre = True + e.Row.FCLabel("LbReferencia").Font.Bold = False + e.Row.FCLabel("LbReferencia").Text = "Total:" + CType(e.Row.FindControl("tr2"), HtmlTableRow).Cells(4).Align = "Right" + End If + + 'e.Row.FCLabel("LbReferencia").Text = String.Format("Total {0}:", If(e.Row.DBCampo("CtaMayor").ToString = "2", "", e.Row.DBCampo("Nombre").ToString)) + e.Row.FCLabel("LbCargos").Text = e.Row.DBCampo("Cargos").ToString.FormatoNumero(If("1" = "1", 2, 4)) + e.Row.FCLabel("LbAbonos").Text = e.Row.DBCampo("Abonos").ToString.FormatoNumero(If("1" = "1", 2, 4)) + e.Row.FCLabel("LbSaldo").Text = e.Row.DBCampo("SaldoActual").ToString.FormatoNumero(If("1" = "1", 2, 4)) + End If + + Else + TotalPadre = False + e.Row.ControlStyle.Font.Bold = False + CType(e.Row.FindControl("tr1"), HtmlTableRow).Visible = False + e.Row.FCHyperLink("HLPoliza").NavigateUrl = String.Format("/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}", e.Row.DBCampo("CvePoliza")) + + If e.Row.DBCampo("CargosMovto").ToDouble <> 0 Then e.Row.FCLabel("LbCargos").Text = e.Row.DBCampo("CargosMovto").ToString.FormatoNumero(If("1" = "1", 2, 4)) + If e.Row.DBCampo("AbonosMovto").ToDouble <> 0 Then e.Row.FCLabel("LbAbonos").Text = e.Row.DBCampo("AbonosMovto").ToString.FormatoNumero(If("1" = "1", 2, 4)) + If e.Row.DBCampo("Saldo").ToDouble <> 0 Then e.Row.FCLabel("LbSaldo").Text = e.Row.DBCampo("Saldo").ToString.FormatoNumero(If("1" = "1", 2, 4)) + + End If + + + 'COLOREA NEGATIVOS + If e.Row.FCLabel("LbCargos").Text.ToDouble < 0 Then + e.Row.FCLabel("LbCargos").ForeColor = Drawing.Color.Red + Else + e.Row.FCLabel("LbCargos").ForeColor = Drawing.Color.Black + End If + + If e.Row.FCLabel("LbAbonos").Text.ToDouble < 0 Then + e.Row.FCLabel("LbAbonos").ForeColor = Drawing.Color.Red + Else + e.Row.FCLabel("LbAbonos").ForeColor = Drawing.Color.Black + End If + + If e.Row.FCLabel("LbSaldo").Text.ToDouble < 0 Then + e.Row.FCLabel("LbSaldo").ForeColor = Drawing.Color.Red + Else + e.Row.FCLabel("LbSaldo").ForeColor = Drawing.Color.Black + End If + + If e.Row.FCLabel("LbSaldoInicial").Text.ToDouble < 0 Then + e.Row.FCLabel("LbSaldoInicial").ForeColor = Drawing.Color.Red + Else + e.Row.FCLabel("LbSaldoInicial").ForeColor = Drawing.Color.Black + End If + + End If + End Sub + +#End Region + + Protected Sub Imprimir_click(sender As Object, e As EventArgs) Handles Imprimir.Click + If DdlCuentas.SelectedValue.ToEntero = -1 Then + Alert("El campo Cuenta es obligatorio.", TipoMensaje.MsgError) + Else + FechaInicio = If(txtFechaI.Text = "" Or txtFechaI.Text = "__/__/____", NowADS(), txtFechaI.Text.ToDate) + FechaFin = If(txtFechaF.Text = "" Or txtFechaF.Text = "__/__/____", NowADS(), txtFechaF.Text.ToDate) + + DtDatos = DtDatos + ImprimirReporte() + End If + End Sub + + Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click + ImprimirReporte("Excel") + + 'Dim htmlTabe As New HtmlTable + 'Dim RutaLogo As String = $"{UsuarioActual.Empresa.Ruta}Logo.png" + 'Dim strinLiteral As String = "" + + 'Dim EncabezadoLiteral As New LiteralControl + + + + 'If System.IO.File.Exists(RutaLogo) Then + ' RutaLogo = $"http://{Request.Url.Host }/Empresas/{UsuarioActual.CveEmpresa}/Logo.png" + + ' strinLiteral = $" + ' + ' + ' + ' + ' + ' + '

    {UsuarioActual.Empresa.Empresa}
    Movimientos Auxiliares del Catálogo

    Fecha:{NowADS().ToString("dd/MM/yyyy")}
    + ' Filtros Cuenta: {DdlCuentas.SelectedItem.Text} Fecha inicio: { TxtFechaDel.Text} Fecha Fin: {TxtFechaAl.Text} + ' + '
    " + 'Else + ' strinLiteral = $" + ' + ' + ' + ' + ' + ' + '

    {UsuarioActual.Empresa.Empresa}
    Movimientos Auxiliares del Catálogo

    Fecha:{NowADS().ToString("dd/MM/yyyy")}
    + ' Filtros Cuenta: {DdlCuentas.SelectedItem.Text} Fecha inicio: { TxtFechaDel.Text} Fecha Fin: {TxtFechaAl.Text} + ' + + '
    " + 'End If + + 'EncabezadoLiteral.Text = strinLiteral + 'GvDatos.ExportToExcel($"MovimientosAuxiliares_{NowADS().ToString("yyyyMMddmmss")}", Encabezado2:=EncabezadoLiteral) + + End Sub + + Private Sub ImprimirReporte(Optional Formato As String = "PDF") + + Dim params As New List(Of ReportParameter) + params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa)) + Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") + params.Add(New ReportParameter("pImg", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) + params.Add(New ReportParameter("pFechaFin", FechaFin.ToString("dd/MM/yyyy"))) + params.Add(New ReportParameter("pFechaInicio", FechaInicio.ToString("dd/MM/yyyy"))) + params.Add(New ReportParameter("CveMoneda", "1")) + params.Add(New ReportParameter("Cuenta", Cuenta)) + ImprimirPDF("Empresas/Grales/Formatos/RepMovimientosAuxiliaresCatalogo.rdlc", DtDatos, params, "MovimientosAuxiliares", Formato) + + End Sub + Public Overrides Sub VerifyRenderingInServerForm(control As Control) + + End Sub + + +End Class diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 7d810834e..1bdf0cc2f 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -4588,6 +4588,39 @@ Partial Class Inventarios_EntregaAlmacen Dim ObjInventario As New ClsInventarios(TransaccionSql) If ObjInventario.GetMovimientosDetalle(CveMovimientoGenerado, UsuarioActual.CveEmpresa) Then If Not cancelarPeido Then + + + 'Dim DT_Ventas_Detalles As DataTable = DTSolicitudDev.FiltraParametros("", "", {"CantidadPedido", "CvePS", "CveVentaDetalle"}) + 'DT_Ventas_Detalles.Columns.Add("CantidadUsada", GetType(Decimal)) + 'DT_Ventas_Detalles.AcceptChanges() + + 'For Each dRow As DataRow In DT_Ventas_Detalles.Rows + + ' For Each gvRow As GridViewRow In GvMU.Rows + + ' Dim CantidadUsada As Decimal = gvRow.FCTextBox("TxtUtilizado").Text.ToDecimal + + ' If dRow("CvePS").ToString.ToDecimal = gvRow.DataKey("CvePS").ToDecimal AndAlso CantidadUsada > 0 Then + + ' dRow("CantidadUsada") = dRow("CantidadUsada").ToString.ToDecimal + CantidadUsada + + ' End If + ' Next + + 'Next + + 'For Each dRow As DataRow In DT_Ventas_Detalles.Rows + ' Dim CantidadUsada As Decimal = dRow("CantidadUsada").ToString.ToDecimal + ' If dRow("CantidadUsada").ToString.ToDecimal < dRow("CantidadPedido").ToString.ToDecimal Then + ' If Not ObjInventario.UpdatePedidoDetalleCantidad(dRow("CveVentaDetalle").ToString.ToEntero, CantidadUsada, 2) Then + ' ProcesoOK = False + ' Exit For + ' End If + ' End If + 'Next + + + For Each Dr As DataRow In ObjInventario.DtResultados.Rows Dim CveVentaDetalle As Integer = Dr("CveVentaDetalle").ToString().ToEntero() @@ -4603,8 +4636,10 @@ Partial Class Inventarios_EntregaAlmacen End If Next - End If + + + End If End If End If diff --git a/Inventarios/RepNotasSinAlmacen.aspx b/Inventarios/RepNotasSinAlmacen.aspx index bbe1ffb73..f047680e6 100644 --- a/Inventarios/RepNotasSinAlmacen.aspx +++ b/Inventarios/RepNotasSinAlmacen.aspx @@ -192,7 +192,7 @@ <%--7--%> <%--8--%> - + <%--9--%> diff --git a/OC/PopUpBuscarReq.aspx b/OC/PopUpBuscarReq.aspx index b6ecbfc70..ad7f39e32 100644 --- a/OC/PopUpBuscarReq.aspx +++ b/OC/PopUpBuscarReq.aspx @@ -141,8 +141,8 @@ - - + + diff --git a/OC/PopUpBuscarReq.aspx.vb b/OC/PopUpBuscarReq.aspx.vb index 23ef40fde..0ba324f3a 100644 --- a/OC/PopUpBuscarReq.aspx.vb +++ b/OC/PopUpBuscarReq.aspx.vb @@ -176,13 +176,38 @@ Partial Class OC_PopUpBuscarReq Dim guia As String = If(TxtGuia.Text.Trim = "", "-1", TxtGuia.Text) 'Cargar Datos + + Dim Serie As String = "-1" + Dim Folio As Integer = -1 + + If TxtFolio.Text.Trim.Length = 0 Then + Serie = "-1" + Folio = -1 + Else + Dim Array() As String = TxtFolio.Text.Trim.Split(CChar("-")) + + If Array.Length >= 2 Then + If Array.Length = 2 Then + Serie = Array(0) + Folio = Array(1).ToEntero + End If + If Array.Length = 3 Then + Serie = Array(0) + "-" + Array(1) + Folio = Array(2).ToEntero + End If + Else + Serie = "-1" + Folio = TxtFolio.Text.Trim.ToEntero + End If + End If + If ValidarFiltrosSeleccionado() Then Dim CveProveedor As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1) Dim ObjOC As New ClsOC ObjOC.GetOrdenesCompraRep(DdlTipo.SelectedValue, CveProyecto, CveSubProyecto, -1, DdlEstatus.SelectedValue.ToEntero, FI, MaxFecha, -1, CveProveedor, - If(TxtFolio.Text.ToEntero <= 0, -1, TxtFolio.Text.ToEntero), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia, - SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), TopSelect:=100) + Folio, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, Guia:=guia, + SoloSubProyectosConPermiso:=If(UsuarioActual.Empresa.Funcionalidad(530) = "1", True, False), TopSelect:=100, Serie:=Serie) Dim DtOC As Data.DataTable = ObjOC.DtResultados ' tipotermino, esattus inicial ObjOC.Dispose() @@ -262,7 +287,7 @@ Partial Class OC_PopUpBuscarReq If DdlTipo.SelectedValue = "REQ" OrElse DdlTipo.SelectedValue = "OC" Then Return True If DdlEstatus.SelectedValue.ToEntero > 0 Then Return True If DdlProveedor.SelectedValue.ToEntero > 0 Then Return True - If TxtFolio.Text.ToEntero > 0 Then Return True + If TxtFolio.Text.Trim.Length > 0 Then Return True If DdlSubProyectos.SelectedValue.ToEntero > 0 Then Return True If DdlProyectos.SelectedValue.ToEntero > 0 Then Return True Return False diff --git a/OS/Asignaciones.aspx.vb b/OS/Asignaciones.aspx.vb index 30f26dad3..0d54934db 100644 --- a/OS/Asignaciones.aspx.vb +++ b/OS/Asignaciones.aspx.vb @@ -2,13 +2,14 @@ Option Strict On Imports System.Data +Imports DocumentFormat.OpenXml.Spreadsheet Imports Extensiones Imports Microsoft.Reporting.WebForms Imports MKB.TimePicker Partial Class OS_Asignaciones - Inherits ClsPaginas - + Inherits ClsPaginas + #Region "PROPIEDADES" Private Property TmpDT As DataTable Get @@ -35,7 +36,7 @@ Partial Class OS_Asignaciones Set(value As DataTable) ViewState("DtTecnicosSubProyectos") = value End Set - End Property + End Property #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then @@ -103,8 +104,8 @@ Partial Class OS_Asignaciones GvNA.Columns(11).HeaderText = "Hora Cirugía" End If - End Sub - + End Sub + #Region "C A R G A S " Private Sub CargaSubProyecto() DdlSubProyecto.Items.Clear() @@ -139,10 +140,17 @@ Partial Class OS_Asignaciones GvNA.DataSource = Nothing End If GvNA.DataBind() - ObjOS.Dispose() + ObjOS.Dispose() + + + + UpOS.Update() CargarTecnico() - End Sub + End Sub + + + Private Sub CargaOrdenesServiciosAsignadas() Dim ObjOS As New ClsOS @@ -240,7 +248,7 @@ Partial Class OS_Asignaciones Dim picker As MKB.TimePicker.TimeSelector = DirectCast(row.FindControl("TimeSelector"), MKB.TimePicker.TimeSelector) If row.FCCheckBox("ChbxAsignar").Checked Then - time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", row.FCTextBox("FechaOS").Text, picker.Hour, picker.Minute, picker.AmPm)) + time = DateTime.Parse(String.Format("{0} {1}:{2} {3}", row.FCTextBox("FechaOS").Text, picker.Hour, picker.Minute, If(picker.Hour < 12, TimeSelector.AmPmSpec.AM, TimeSelector.AmPmSpec.PM))) contadorOrdenesAsignadas += 1 If ObjOS.GetSubProyectosEstatusInicial(DdlTecnico.SelectedValue.ToEntero, 3, UsuarioActual.CveEmpresa) Then @@ -555,8 +563,14 @@ Partial Class OS_Asignaciones e.Row.FindControl("TimeSelector").Visible = True Dim TMSelector = DirectCast(e.Row.FindControl("TimeSelector"), TimeSelector) - TMSelector.Date = FechaCita - + TMSelector.Date = FechaCita + + 'If TMSelector.Hour = 0 And TMSelector.AmPm = TimeSelector.AmPmSpec.AM Or e.Row.DataKey("CveOS").ToEntero = 9004 Then + If FechaCita.Hour = 0 Then + Dim scripttxth As String = " $(document).ready(function() {setTimeout(function() { document.getElementById('" + TMSelector.UniqueID + "_txtHour').value = '00'; }, 100);}); " + RegistraScript(scripttxth) + End If + e.Row.Cells(10).Attributes.Add("data-order", e.Row.DBCampo("FechaCitaOS").ToDate.Ticks.ToString) e.Row.Cells(11).Attributes.Add("data-order", e.Row.DBCampo("FechaCitaOS").ToDate.ToString("HHmm")) diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb index 14029ca24..6c78b4994 100644 --- a/OS/OrdenesServicios.aspx.vb +++ b/OS/OrdenesServicios.aspx.vb @@ -10,6 +10,7 @@ Imports System.ServiceModel.Security Imports RVCFDI.RVLTimbrado Imports Microsoft.Owin.Security.Provider Imports Telerik.Web.UI +Imports ADSNetLibrary.SIGAPI.Services.SAT.DescargaCFDI @@ -478,7 +479,7 @@ Partial Class OS_OrdenesServicios End If End If - If TipoEstatus.Contiene(1, 2, 3, 4) And CveVenta <= 0 Then + If TipoEstatus.Contiene(1, 2, 3, 4) And CveVenta <= 0 And (UsuarioActual.TienePermisoProceso(370) Or UsuarioActual.TienePermisoProceso(382)) Then BtnCancelar.Visible = True Else BtnGuardar.Visible = False @@ -3202,6 +3203,9 @@ Partial Class OS_OrdenesServicios End If End If End If + + 'ProcesoOK = False + Dim Respuesta As New RespuestaFacturacion() Dim DtVentaDetalle As New DataTable Dim CveMovimientoSalida, CveMovimientoEntrada As Integer diff --git a/Transportes/RepContratoDetalle.aspx b/Transportes/RepContratoDetalle.aspx index 540b89c61..4e00508b8 100644 --- a/Transportes/RepContratoDetalle.aspx +++ b/Transportes/RepContratoDetalle.aspx @@ -117,7 +117,7 @@
    - +
    diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb index c5228d721..b766777c9 100644 --- a/Transportes/RepContratoDetalle.aspx.vb +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -148,7 +148,7 @@ Partial Class RepContratoDetalle CveContratoTipo = Contrato.Rows(0)("CveContratoTipo").ToString.ToEntero SubProyecto = Contrato.Rows(0)("SubProyecto").ToString CveMasivo = Contrato.Rows(0)("CveMasivo").ToString.ToEntero - LbFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString + TxtFolio.Text = Contrato.Rows(0)("NumeroContrato").ToString DdlClientes.SelectedText = Contrato.Rows(0)("NombreComercial").ToString DdlClientes.SelectedValue = Contrato.Rows(0)("CveCliente").ToString @@ -267,7 +267,7 @@ Partial Class RepContratoDetalle Response.Clear() Response.ClearHeaders() Response.ClearContent() - Response.AddHeader("Content-Disposition", "attachment; filename=" & LbFolio.Text & $"{File.Extension}") + Response.AddHeader("Content-Disposition", "attachment; filename=" & TxtFolio.Text & $"{File.Extension}") Response.AddHeader("Content-Length", File.Length.ToString()) 'Response.ContentType = "text/plain" Response.ContentType = "application/octet-stream" @@ -297,7 +297,7 @@ Partial Class RepContratoDetalle Dim ObjContratos As New ClsContratos ObjContratos.IniciaTransacSQL() Try - If ObjContratos.UpdateContratos(CveContrato, LbFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", + If ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "", DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, False, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then Alert("Contrato actualizado correctamente") @@ -345,7 +345,7 @@ Partial Class RepContratoDetalle Dim dtResult As New DataTable() Dim params As New List(Of ReportParameter) From { - New ReportParameter("Folio", LbFolio.Text), + New ReportParameter("Folio", TxtFolio.Text), New ReportParameter("Cliente", DdlClientes.SelectedText), New ReportParameter("Servicio", TxtDescripcion.Text), New ReportParameter("Observaciones", TxtObservaciones.Text), @@ -364,7 +364,7 @@ Partial Class RepContratoDetalle New ReportParameter("Usuario", UsuarioActual.Nombre) } - ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Contrato.mrt", dtResult, params, NombreArchivo:=LbFolio.Text) + ImprimirPDFStimul($"{UsuarioActual.Empresa.Ruta}Formatos\Contrato.mrt", dtResult, params, NombreArchivo:=TxtFolio.Text) End Sub Protected Sub AgregarABitacora(Descripcion As String) Dim ObjEventoBitacora As New ClsOIEventos