From e75da60228b43d960563cf207e26f7791c0b86e8 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Wed, 2 Dec 2020 11:11:15 -0700 Subject: [PATCH 1/4] Cambios Compras --- Compras/Compras.aspx.vb | 133 ++++++------ TareasProgramadas/Tareas119.ashx | 336 ++++++++++++++++--------------- 2 files changed, 251 insertions(+), 218 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index da0b58856..c73133e33 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -2688,77 +2688,88 @@ Partial Class Compras_Compras TmpDT.Columns.Add("CveContrato", GetType(Integer)) TmpDT.Columns.Add("DifPSSat", GetType(Integer)) - TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer)) - TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer)) + + If Not TmpDT.Columns.Contains("CveContratoDetalle") Then + TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer)) + End If + + + If Not TmpDT.Columns.Contains("CveCultivoCuadroDetalle") Then + TmpDT.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer)) + End If + + + + GvPS.DataSource = TmpDT - GvPS.DataBind() - - If UsuarioActual.Empresa.UsaAC Then - CargaHidendsAC() - End If - - CalculaTotales(True) - - If UsuarioActual.Empresa.UsaInventarios Then - DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy - - If dr("Inventario").ToString = "1" Then - - CveMovimientoAlmacen = dr("CveMovimiento").ToString.ToEntero - - Dim Inv As New ClsInventarios - If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa) Then - 'Dim TempParametros = Encripta(String.Format("OP=Alm&CveMovimiento={0}", dr("CveMovimiento"))) - 'ImgImprimirAlmacen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", TempParametros) - - ImgImprimirAlmacen.Visible = True - ImgImprimirAlmacen.NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", dr("CveMovimiento")) - - Dim drt As DataRow - 'actualizo el almacen - For Each dri As DataRow In DtInv.Rows - - drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad"))) - If drt IsNot Nothing Then - Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) 'Charlie - TmpDr("CveAlmacen") = drt("CveAlmacen") 'Charlie - - dri("CveAlmacen") = drt("CveAlmacen") - - End If - - Next - - End If - - 'Proceso Super Tramposo de Charlie - If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa, CveCompra:=-123) Then - Dim drt As DataRow - For Each dri As DataRow In DtInv.Rows - drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad"))) - If drt IsNot Nothing Then - Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) - TmpDr("CveAlmacen") = drt("CveAlmacen") - End If - Next - End If - - Inv.Dispose() + GvPS.DataBind() + If UsuarioActual.Empresa.UsaAC Then + CargaHidendsAC() End If - CargaGvInv() + CalculaTotales(True) - 'Ocultamos "Recibir Aqui" - GvInv.Columns(6).Visible = False - GvInv.Columns(7).Visible = False + If UsuarioActual.Empresa.UsaInventarios Then + DtInv = TmpDT.FiltraParametros(String.Format("CveTipoPS = 2")).Copy + If dr("Inventario").ToString = "1" Then + + CveMovimientoAlmacen = dr("CveMovimiento").ToString.ToEntero + + Dim Inv As New ClsInventarios + If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa) Then + 'Dim TempParametros = Encripta(String.Format("OP=Alm&CveMovimiento={0}", dr("CveMovimiento"))) + 'ImgImprimirAlmacen.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", TempParametros) + + ImgImprimirAlmacen.Visible = True + ImgImprimirAlmacen.NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", dr("CveMovimiento")) + + Dim drt As DataRow + 'actualizo el almacen + For Each dri As DataRow In DtInv.Rows + + drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad"))) + If drt IsNot Nothing Then + Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) 'Charlie + TmpDr("CveAlmacen") = drt("CveAlmacen") 'Charlie + + dri("CveAlmacen") = drt("CveAlmacen") + + End If + + Next + + End If + + 'Proceso Super Tramposo de Charlie + If Inv.GetMovimientosDetalle(dr("CveMovimiento").ToString.ToEntero, UsuarioActual.CveEmpresa, CveCompra:=-123) Then + Dim drt As DataRow + For Each dri As DataRow In DtInv.Rows + drt = Inv.DtResultados.FiltroPrimero(String.Format("CvePS = {0} AND Cantidad = {1}", dri("CvePS"), dri("Cantidad"))) + If drt IsNot Nothing Then + Dim TmpDr As DataRow = TmpDT.Select($"Consec = {dri("Consec").ToString.ToEntero}")(0) + TmpDr("CveAlmacen") = drt("CveAlmacen") + End If + Next + End If + + Inv.Dispose() + + End If + + CargaGvInv() + + 'Ocultamos "Recibir Aqui" + GvInv.Columns(6).Visible = False + GvInv.Columns(7).Visible = False + + End If End If - End If - DdlTipoComprobante.Enabled = False + DdlTipoComprobante.Enabled = False DdlTipoComprobante.SelectedValue = dr("TipoDocto").ToString If dr("TipoDocto").ToString = "Fac" Then ChkAplicaNotaCredito.Enabled = True diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index 4fbb5489d..3ce799f59 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -273,188 +273,210 @@ public class TareasJam : IHttpHandler if (!ErrorProceso) { - ////////////////////////////////////////////////////////////// - this.GuardaLog($"EjecutaThalamus: llenando archivo excel ventas. "); - int count = 2; - var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas); - var wsVentas = wbVentas.Worksheet(1); - - foreach (DataRow DRow in DTVentas.Rows) + try { - wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString(); - wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString(); - wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].ToString(); - wsVentas.Cell(count, 4).Value = DRow["Sale Date"].ToString(); - wsVentas.Cell(count, 5).Value = DRow["Quantity"].ToString(); - wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString(); - wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString(); - count++; + + ////////////////////////////////////////////////////////////// + + this.GuardaLog($"EjecutaThalamus: llenando archivo excel ventas. "); + int count = 2; + var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas); + this.GuardaLog($"EjecutaThalamus: archivo excel ventas cargado. "); + this.GuardaLog($"EjecutaThalamus: archivo excel ventas creando sheet."); + var wsVentas = wbVentas.Worksheet(1); + this.GuardaLog($"EjecutaThalamus: archivo excel ventas sheet creada."); + + foreach (DataRow DRow in DTVentas.Rows) + { + wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString(); + wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString(); + wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].ToString(); + wsVentas.Cell(count, 4).Value = DRow["Sale Date"].ToString(); + wsVentas.Cell(count, 5).Value = DRow["Quantity"].ToString(); + wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString(); + wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString(); + count++; + } + this.GuardaLog($"EjecutaThalamus: guardando archivo excel ventas " + RutaVentas + " "); + wbVentas.SaveAs(RutaVentas); + + var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes); + var wsAlmacenes = wbAlmacenes.Worksheet(1); + + count = 2; + + this.GuardaLog($"EjecutaThalamus: llenando archivo excel almacenes. "); + foreach (DataRow DRow in DTAlmacenes.Rows) + { + wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString(); + wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString(); + wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString(); + wsAlmacenes.Cell(count, 4).Value = DRow["Stock Date"].ToString(); + count++; + } + this.GuardaLog($"EjecutaThalamus: guardando archivo excel alamcenes " + RutaAlmacenes + " "); + wbAlmacenes.SaveAs(RutaAlmacenes); + + var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes); + var wsClientes = wbAClientes.Worksheet(1); + + count = 2; + + this.GuardaLog($"EjecutaThalamus: llenando archivo excel clientes. "); + foreach (DataRow DRow in DTClientes.Rows) + { + wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString(); + wsClientes.Cell(count, 2).Value = DRow["fiscalIdMex"].ToString(); + wsClientes.Cell(count, 3).Value = DRow["fiscalName"].ToString(); + wsClientes.Cell(count, 4).Value = DRow["email"].ToString(); + wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString(); + wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString(); + wsClientes.Cell(count, 7).Value = DRow["address.city"].ToString(); + wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString(); + wsClientes.Cell(count, 9).Value = DRow["address.street2"].ToString(); + wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString(); + wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString(); + wsClientes.Cell(count, 12).Value = DRow["phone.areaCode"].ToString(); + wsClientes.Cell(count, 13).Value = "'" + DRow["phone.number"].ToString(); + wsClientes.Cell(count, 14).Value = DRow["salesman"].ToString(); + + count++; + } + + this.GuardaLog($"EjecutaThalamus: guardando archivo excel clientes " + RutaClientes + " "); + wbAClientes.SaveAs(RutaClientes); + + var wbProductos = new ClosedXML.Excel.XLWorkbook(FormatoProductos); + var wsProductos = wbProductos.Worksheet(1); + + count = 2; + this.GuardaLog($"EjecutaThalamus: llenando archivo excel productos. "); + foreach (DataRow DRow in DTProductos.Rows) + { + wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString(); + wsProductos.Cell(count, 2).Value = DRow["Nombre del Producto"].ToString(); + wsProductos.Cell(count, 3).Value = DRow["Presentación"].ToString(); + + count++; + } + this.GuardaLog($"EjecutaThalamus: guardando archivo excel productos " + RutaProductos + " "); + wbProductos.SaveAs(RutaProductos); + ///////////////////////////////////////////////////////////// + } - this.GuardaLog($"EjecutaThalamus: guardando archivo excel ventas " + RutaVentas + " "); - wbVentas.SaveAs(RutaVentas); - - var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes); - var wsAlmacenes = wbAlmacenes.Worksheet(1); - - count = 2; - - this.GuardaLog($"EjecutaThalamus: llenando archivo excel almacenes. "); - foreach (DataRow DRow in DTAlmacenes.Rows) + catch (Exception ex) { - wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString(); - wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString(); - wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString(); - wsAlmacenes.Cell(count, 4).Value = DRow["Stock Date"].ToString(); - count++; - } - this.GuardaLog($"EjecutaThalamus: guardando archivo excel alamcenes " + RutaAlmacenes + " "); - wbAlmacenes.SaveAs(RutaAlmacenes); - - var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes); - var wsClientes = wbAClientes.Worksheet(1); - - count = 2; - - this.GuardaLog($"EjecutaThalamus: llenando archivo excel clientes. "); - foreach (DataRow DRow in DTClientes.Rows) - { - wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString(); - wsClientes.Cell(count, 2).Value = DRow["fiscalIdMex"].ToString(); - wsClientes.Cell(count, 3).Value = DRow["fiscalName"].ToString(); - wsClientes.Cell(count, 4).Value = DRow["email"].ToString(); - wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString(); - wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString(); - wsClientes.Cell(count, 7).Value = DRow["address.city"].ToString(); - wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString(); - wsClientes.Cell(count, 9).Value = DRow["address.street2"].ToString(); - wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString(); - wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString(); - wsClientes.Cell(count, 12).Value = DRow["phone.areaCode"].ToString(); - wsClientes.Cell(count, 13).Value = "'" + DRow["phone.number"].ToString(); - wsClientes.Cell(count, 14).Value = DRow["salesman"].ToString(); - - count++; + this.GuardaLog($"EjecutaThalamus: Error procesamiento archivos exel " + ex.StackTrace.ToString() + " "); + ErrorProceso = true; + Respuesta = false; } - this.GuardaLog($"EjecutaThalamus: guardando archivo excel clientes " + RutaClientes + " "); - wbAClientes.SaveAs(RutaClientes); - - var wbProductos= new ClosedXML.Excel.XLWorkbook(FormatoProductos); - var wsProductos = wbProductos.Worksheet(1); - - count = 2; - this.GuardaLog($"EjecutaThalamus: llenando archivo excel productos. "); - foreach (DataRow DRow in DTProductos.Rows) + if (!ErrorProceso) { - wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString(); - wsProductos.Cell(count, 2).Value = DRow["Nombre del Producto"].ToString(); - wsProductos.Cell(count, 3).Value = DRow["Presentación"].ToString(); + var FInfoProductos = new FileInfo(RutaProductos); + var FInfoVentas = new FileInfo(RutaVentas); + var FInfoClientes = new FileInfo(RutaClientes); + var FInfoAlmacenes = new FileInfo(RutaAlmacenes); - count++; - } - this.GuardaLog($"EjecutaThalamus: guardando archivo excel productos " + RutaProductos + " "); - wbProductos.SaveAs(RutaProductos); - ///////////////////////////////////////////////////////////// + bool CargaProductos = false; + bool CargaVentas = false; + bool CargaClientes = false; + bool CargaAlmacenes = false; - var FInfoProductos = new FileInfo(RutaProductos); - var FInfoVentas = new FileInfo(RutaVentas); - var FInfoClientes = new FileInfo(RutaClientes); - var FInfoAlmacenes = new FileInfo(RutaAlmacenes); - - bool CargaProductos = false; - bool CargaVentas = false; - bool CargaClientes = false; - bool CargaAlmacenes = false; - - SBLog.AppendLine("Cargas
"); - SBLog.AppendLine(""); + SBLog.AppendLine("Cargas
"); + SBLog.AppendLine("
ArchivoEstado
"); - this.GuardaLog($"EjecutaThalamus: Cargando archivo excel productos a FTP. "); - CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass); + this.GuardaLog($"EjecutaThalamus: Cargando archivo excel productos a FTP. "); + CargaProductos = CargarArchivos(FInfoProductos, FTPServer, TFPUsr, FTPPass); - if (CargaProductos) - { - this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. "); - CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, TFPUsr, FTPPass); - } + if (CargaProductos) + { + this.GuardaLog($"EjecutaThalamus: Verificando archivo productos. "); + CargaProductos = VerificarArchivo(FInfoProductos, FInfoProductos.Length, FTPServer, TFPUsr, FTPPass); + } - if (CargaProductos) - { - SBLog.AppendLine($""); - } - else - { - SBLog.AppendLine($""); - } + if (CargaProductos) + { + SBLog.AppendLine($""); + } + else + { + SBLog.AppendLine($""); + } + + if (CargaProductos) + { + this.GuardaLog($"EjecutaThalamus: Cargando archivo excel ventas a FTP. "); + CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass); + if (CargaVentas) + { + this.GuardaLog($"EjecutaThalamus: Verificando archivo ventas. "); + CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass); + } + } - if (CargaProductos) - { - this.GuardaLog($"EjecutaThalamus: Cargando archivo excel ventas a FTP. "); - CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass); if (CargaVentas) { - this.GuardaLog($"EjecutaThalamus: Verificando archivo ventas. "); - CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass); + SBLog.AppendLine($""); + } + else + { + SBLog.AppendLine($""); } - } - if (CargaVentas) - { - SBLog.AppendLine($""); - } - else - { - SBLog.AppendLine($""); - } + if (CargaProductos & CargaVentas) + { + this.GuardaLog($"EjecutaThalamus: Cargando archivo excel clientes a FTP. "); + CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass); + if (CargaClientes) + { + this.GuardaLog($"EjecutaThalamus: Verificando archivo clientes. "); + CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass); + } + } - if (CargaProductos & CargaVentas) - { - this.GuardaLog($"EjecutaThalamus: Cargando archivo excel clientes a FTP. "); - CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass); if (CargaClientes) { - this.GuardaLog($"EjecutaThalamus: Verificando archivo clientes. "); - CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass); + SBLog.AppendLine($""); } - } - - if (CargaClientes) - { - SBLog.AppendLine($""); - } - else - { - SBLog.AppendLine($""); - } - - if (CargaProductos & CargaVentas & CargaClientes) - { - this.GuardaLog($"EjecutaThalamus: Cargando archivo excel almacenes a FTP. "); - CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass); - if (CargaClientes) + else { - this.GuardaLog($"EjecutaThalamus: Verificando archivo almacenes. "); - CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, $"{FTPServer}/Stock", TFPUsr, FTPPass); + SBLog.AppendLine($""); } - } - if (CargaAlmacenes) - { - SBLog.AppendLine($""); - } - else - { - SBLog.AppendLine($""); - } + if (CargaProductos & CargaVentas & CargaClientes) + { + this.GuardaLog($"EjecutaThalamus: Cargando archivo excel almacenes a FTP. "); + CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass); + if (CargaClientes) + { + this.GuardaLog($"EjecutaThalamus: Verificando archivo almacenes. "); + CargaAlmacenes = VerificarArchivo(FInfoAlmacenes, FInfoAlmacenes.Length, $"{FTPServer}/Stock", TFPUsr, FTPPass); + } + } + + if (CargaAlmacenes) + { + SBLog.AppendLine($""); + } + else + { + SBLog.AppendLine($""); + } - if (CargaProductos & CargaVentas & CargaClientes & CargaAlmacenes) - { - Respuesta = true; - } - else + if (CargaProductos & CargaVentas & CargaClientes & CargaAlmacenes) + { + Respuesta = true; + } + else + { + Respuesta = false; + } + + }else { Respuesta = false; } @@ -505,8 +527,8 @@ public class TareasJam : IHttpHandler ClsSisMail Correo = new ClsSisMail(); - string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx"; - // string Para = "oscar.irigoyen@adssistemas.mx"; + string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx"; + // string Para = "oscar.irigoyen@adssistemas.mx"; string Asunto = ErrorProceso ? $"Carga Layout Corteva {DateTime.Now.ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {DateTime.Now.ToString("yyyy-MM-dd")}"; Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos); From e714e816a665607c9ffbe0394baa820d60b40ae6 Mon Sep 17 00:00:00 2001 From: Rakcsle Supertramp Date: Wed, 2 Dec 2020 17:03:17 -0700 Subject: [PATCH 2/4] Contratos 2020-12-02 --- Contratos/ContratoAvance.aspx | 392 ++++++++++++++++--------------- Contratos/ContratoAvance.aspx.vb | 165 +++++++------ Contratos/ContratoObra.aspx | 131 +++++------ 3 files changed, 352 insertions(+), 336 deletions(-) diff --git a/Contratos/ContratoAvance.aspx b/Contratos/ContratoAvance.aspx index f52875650..1ad582236 100644 --- a/Contratos/ContratoAvance.aspx +++ b/Contratos/ContratoAvance.aspx @@ -45,200 +45,210 @@ - + + + + +
+
+
+ +
+
+ + + +
+
+ + +
+
+
+ + +
+
+
+
+
+
+ + +
+ +
+ Fecha: +
+
+
+ + + + + + + + + + +
+
+ + +
+
+ " style="display: inline-block; margin-right: -20px; width: 150px; height: 25px; border-color: #89C4F4;" /> + " class="btn btn-circle btn-sm label-info"> +
+ +
+ +
+
+ +
ArchivoEstado
Productosok
ProductosError carga
Productosok
ProductosError carga
Ventasok
VentasError carga
Ventasok
VentasError carga
Clientesok
Clientesok
ClientesError carga
ClientesError carga
Almacenesok
AlmacenesError carga
Almacenesok
AlmacenesError carga
+ + + + + + + + + + + + + + + + + + + +
Producto / ServicioAvanceUltimo AvanceLevantamientoAnexo
+ +
+
+ + + + + + + + + + + + + <%# Eval("Abreviatura")%> + + + + + + <%# Eval("Cantidad", "{0:N2}")%> + + + + + + <%# Eval("Importe", "{0:N2}")%> + + + + + <%# Eval("Cantidad_Ultima", "{0:N2}")%> + + + + + <%# Eval("Importe_Ultima", "{0:N2}")%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + + + + + + +<%-- - - -
-
-
- -
-
- - - -
-
- - -
-
-
- - -
-
-
-
-
-
- - -
- -
- Fecha: -
-
-
- - - - - - - - - - -
-
- - -
- -
- - -
-
- - - - - - - - - - - - - - - - - - - - - -
Producto / ServicioAvanceUltimo AvanceLevantamientoAnexo
- -
-
- - - - - - - - - - - - - <%# Eval("Abreviatura")%> - - - - - - <%# Eval("Cantidad", "{0:N2}")%> - - - - - - <%# Eval("Importe", "{0:N2}")%> - - - - - <%# Eval("Cantidad_Ultima", "{0:N2}")%> - - - - - <%# Eval("Importe_Ultima", "{0:N2}")%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
- -
- - -
-
+
@@ -341,7 +351,7 @@ -
+ --%> diff --git a/Contratos/ContratoAvance.aspx.vb b/Contratos/ContratoAvance.aspx.vb index 66c961842..15d5ccce3 100644 --- a/Contratos/ContratoAvance.aspx.vb +++ b/Contratos/ContratoAvance.aspx.vb @@ -138,8 +138,8 @@ Partial Class Contratos_ContratoAvance DdlContratos.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}")) DdlContratos.DataBind() - DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}")) - DDlContratosEstimaciones.DataBind() + 'DDlContratosEstimaciones.DataSource = GlobalDTContratos.FiltraParametros(String.Format($"CveContratoTipo in (30,31) AND CveEmpresa = {UsuarioActual.CveEmpresa}")) + 'DDlContratosEstimaciones.DataBind() End Sub @@ -207,7 +207,7 @@ Partial Class Contratos_ContratoAvance If e.Row.DataKey("CveContratoDetalle").ToEntero > 0 Then Dim LnkAnexo As LinkButton = e.Row.FCLinkButton("LnkModalDropzone") - 'LnkAnexo.Visible = True + Dim DVAnexo As Control = DirectCast(e.Row.FindControl("ModalAnexoEvidencia"), Control) LnkAnexo.OnClientClick = $" $('#{DVAnexo.ClientID}').modal('show'); return false;" @@ -220,9 +220,20 @@ Partial Class Contratos_ContratoAvance Dim LnkGuardarAvance As LinkButton = e.Row.FCLinkButton("LnkGuardarAvance") LnkGuardarAvance.Visible = True + + If e.Row.DataKey("CantidadMax").ToDouble = 0 Then + LnkAnexo.Visible = False + e.Row.FCTextBox("TxtCantidad").Visible = False + LnkGuardarAvance.Visible = False + + End If + End If + + + End If End Sub Protected Sub GetAnexos(sender As Object, e As System.EventArgs) @@ -432,120 +443,120 @@ Partial Class Contratos_ContratoAvance #Region "ESTIMACION" - Private Sub CargaAvancesParaEstimar() - CveContratoEstimacion = -1 + 'Private Sub CargaAvancesParaEstimar() + ' CveContratoEstimacion = -1 - Dim ObjContratos As New ClsContratos() - Dim DTEstimaciones As New DataTable - Dim NumeroEstimacionActual As Integer = 0 + ' Dim ObjContratos As New ClsContratos() + ' Dim DTEstimaciones As New DataTable + ' Dim NumeroEstimacionActual As Integer = 0 - If ObjContratos.GetContratosAvanceEstimacion(DDlContratosEstimaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then - DTEstimaciones = ObjContratos.DtResultados + ' If ObjContratos.GetContratosAvanceEstimacion(DDlContratosEstimaciones.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then + ' DTEstimaciones = ObjContratos.DtResultados - CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero + ' CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero - End If + ' End If - ObjContratos.Dispose() + ' ObjContratos.Dispose() - If DTEstimaciones.Rows.Count > 0 Then - GvEstimaciones.DataSource = DTEstimaciones - BtnGuardarEstimacion.Visible = True - Else - GvEstimaciones.DataSource = Nothing - BtnGuardarEstimacion.Visible = False - End If - GvEstimaciones.DataBind() + ' If DTEstimaciones.Rows.Count > 0 Then + ' GvEstimaciones.DataSource = DTEstimaciones + ' BtnGuardarEstimacion.Visible = True + ' Else + ' GvEstimaciones.DataSource = Nothing + ' BtnGuardarEstimacion.Visible = False + ' End If + ' GvEstimaciones.DataBind() - UpEstimaciones.Update() - End Sub + ' UpEstimaciones.Update() + 'End Sub - Private Sub BtnConsultarEstimaciones_Click(sender As Object, e As EventArgs) Handles BtnConsultarEstimaciones.Click + 'Private Sub BtnConsultarEstimaciones_Click(sender As Object, e As EventArgs) Handles BtnConsultarEstimaciones.Click - CargaAvancesParaEstimar() + ' CargaAvancesParaEstimar() - End Sub + 'End Sub - Private Sub GvEstimaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstimaciones.RowDataBound + 'Private Sub GvEstimaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstimaciones.RowDataBound - If e.Row.RowType = DataControlRowType.DataRow Then + ' If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then + ' If e.Row.DBCampo("CveContratoDetalle").ToString.ToEntero = 0 Then - If e.Row.DBCampo("CveSubFamilias").ToString.ToEntero = 0 Then - If e.Row.DBCampo("CveFamilias").ToString.ToEntero = 0 Then - e.Row.CssClass = "SubTotales" - Else - e.Row.CssClass = "SubTotales2" - End If - Else - e.Row.CssClass = "SubTotales3" - End If - End If - End If + ' If e.Row.DBCampo("CveSubFamilias").ToString.ToEntero = 0 Then + ' If e.Row.DBCampo("CveFamilias").ToString.ToEntero = 0 Then + ' e.Row.CssClass = "SubTotales" + ' Else + ' e.Row.CssClass = "SubTotales2" + ' End If + ' Else + ' e.Row.CssClass = "SubTotales3" + ' End If + ' End If + ' End If - End Sub + 'End Sub - Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click + 'Private Sub BtnGuardarEstimacion_Click(sender As Object, e As EventArgs) Handles BtnGuardarEstimacion.Click - CveEstimacionNueva = -1 - NuemeroEstimacionNuevo = -1 + ' CveEstimacionNueva = -1 + ' NuemeroEstimacionNuevo = -1 - Dim ObjContratos As New ClsContratos() - Dim ErrorProceso As Boolean = False + ' Dim ObjContratos As New ClsContratos() + ' Dim ErrorProceso As Boolean = False - ObjContratos.IniciaTransacSQL() + ' ObjContratos.IniciaTransacSQL() - If ObjContratos.AddContratosAvanceEstimacion(CveContratoEstimacion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ' If ObjContratos.AddContratosAvanceEstimacion(CveContratoEstimacion, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - CveEstimacionNueva = ObjContratos.CveEstimacionNueva - NuemeroEstimacionNuevo = ObjContratos.NumeroEstimacionNueva + ' CveEstimacionNueva = ObjContratos.CveEstimacionNueva + ' NuemeroEstimacionNuevo = ObjContratos.NumeroEstimacionNueva - For Each GvRow As GridViewRow In GvEstimaciones.Rows + ' For Each GvRow As GridViewRow In GvEstimaciones.Rows - If GvRow.DataKey("CveContratoAvance").ToEntero > 0 Then - If Not ObjContratos.UpdateContratosAvanceEstimacion(GvRow.DataKey("CveContratoAvance").ToEntero, ObjContratos.CveEstimacionNueva, UsuarioActual.CveEmpresa) Then - ErrorProceso = True - Exit For - End If - End If - Next + ' If GvRow.DataKey("CveContratoAvance").ToEntero > 0 Then + ' If Not ObjContratos.UpdateContratosAvanceEstimacion(GvRow.DataKey("CveContratoAvance").ToEntero, ObjContratos.CveEstimacionNueva, UsuarioActual.CveEmpresa) Then + ' ErrorProceso = True + ' Exit For + ' End If + ' End If + ' Next - Else - ErrorProceso = True - End If + ' Else + ' ErrorProceso = True + ' End If - 'AddContratosAvanceEstimacion - 'UpdateContratosAvanceEstimacion + ' 'AddContratosAvanceEstimacion + ' 'UpdateContratosAvanceEstimacion - If Not ErrorProceso Then - ObjContratos.Commit() - Alert($"Estimación {NuemeroEstimacionNuevo} agregada correctamente.") + ' If Not ErrorProceso Then + ' ObjContratos.Commit() + ' Alert($"Estimación {NuemeroEstimacionNuevo} agregada correctamente.") - BtnGuardarEstimacion.Visible = False - BtnDescargarGenerado.Visible = True + ' BtnGuardarEstimacion.Visible = False + ' BtnDescargarGenerado.Visible = True - Else - ObjContratos.RollBack() - End If + ' Else + ' ObjContratos.RollBack() + ' End If - ObjContratos.Dispose() + ' ObjContratos.Dispose() - UpEstimaciones.Update() - End Sub + ' UpEstimaciones.Update() + 'End Sub - Private Sub BtnDescargarGenerado_Click(sender As Object, e As EventArgs) Handles BtnDescargarGenerado.Click + 'Private Sub BtnDescargarGenerado_Click(sender As Object, e As EventArgs) Handles BtnDescargarGenerado.Click - GeneraAnexo(CveEstimacionNueva, NuemeroEstimacionNuevo, Now, DDlContratosEstimaciones.SelectedItem.Text) + ' GeneraAnexo(CveEstimacionNueva, NuemeroEstimacionNuevo, Now, DDlContratosEstimaciones.SelectedItem.Text) - End Sub + 'End Sub Private Sub GeneraAnexo(CveEstimacion As Integer, NumeroEstimacion As Integer, FechaEstimacion As Date, NumeroContrato As String) diff --git a/Contratos/ContratoObra.aspx b/Contratos/ContratoObra.aspx index 86f5165e3..d56c9c6bc 100644 --- a/Contratos/ContratoObra.aspx +++ b/Contratos/ContratoObra.aspx @@ -320,24 +320,20 @@
Datos del Contrato
-
- - - - +
- -
+ +
- -
+ +
@@ -345,16 +341,16 @@
- -
+ +
-