From d21e641c8f4f212a94c7711ff9f5cc09c8a49266 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 26 Jul 2021 18:35:05 -0700 Subject: [PATCH 01/44] -- gridview con productos que coinciden --- Inventarios/RepAnomalias.aspx | 44 ++++++++++++++++++++++++++++++++ Inventarios/RepAnomalias.aspx.vb | 13 ++++++++++ 2 files changed, 57 insertions(+) diff --git a/Inventarios/RepAnomalias.aspx b/Inventarios/RepAnomalias.aspx index 1b930ed61..3b7ee3bef 100644 --- a/Inventarios/RepAnomalias.aspx +++ b/Inventarios/RepAnomalias.aspx @@ -304,6 +304,50 @@ +
+
+ +
+
+ Número de registros: +
+
+ " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb index ad367eea6..6935e4ef9 100644 --- a/Inventarios/RepAnomalias.aspx.vb +++ b/Inventarios/RepAnomalias.aspx.vb @@ -187,6 +187,11 @@ Partial Class Inventarios_RepAnomalias GvF.DataBind() BanderaSerieLoteCad(GvF, DtF) + Dim DtC As DataTable = dt.FiltraParametros("Diferencia = 0") + GvC.DataSource = DtC + GvC.DataBind() + BanderaSerieLoteCad(GvC, DtC) + Dim Script = "" If (GvF.Rows.Count > 0) Then GvF.UseAccessibleHeader = True @@ -204,6 +209,14 @@ Partial Class Inventarios_RepAnomalias LtlTotalRegistrosSobran.Text = GvS.Rows.Count.ToString End If + If (GvC.Rows.Count > 0) Then + GvC.UseAccessibleHeader = True + GvC.HeaderRow.TableSection = TableRowSection.TableHeader + Script += "OrdenarGVS();" + divRegistradosCoinciden.Visible = True + LtlCoincidentes.Text = GvC.Rows.Count.ToString + End If + PSIguales() RegistraScript(Script) From c5011cd59406f90b9abd498c73717be370b0eea7 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 27 Jul 2021 21:51:43 -0700 Subject: [PATCH 02/44] caracter faltante --- Contabilidad/ContabilidadElectronica.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contabilidad/ContabilidadElectronica.aspx.vb b/Contabilidad/ContabilidadElectronica.aspx.vb index 05310e147..0e154f034 100644 --- a/Contabilidad/ContabilidadElectronica.aspx.vb +++ b/Contabilidad/ContabilidadElectronica.aspx.vb @@ -121,7 +121,7 @@ Partial Class Contabilidad_ContabilidadElectronica Str.AppendFormat("Sello=""{0}"" ", "123") Str.AppendFormat("noCertificado=""{0}"" ", "123") Str.AppendFormat("Certificado=""{0}"" ", "1234567890") - Str.Append("xmlns:catalogocuentas=""www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas""") + Str.Append("xmlns:catalogocuentas=""www.sat.gob.mx/esquemas/ContabilidadE/1_1/CatalogoCuentas"">") 'DETALLES For Each Dr As DataRow In DtCuentas.Rows From 4c95979000990e7bec46058548854de546f438fa Mon Sep 17 00:00:00 2001 From: Hector Date: Wed, 28 Jul 2021 13:57:47 -0700 Subject: [PATCH 03/44] Validacion descuento via nomina --- Bancos/Devoluciones.aspx | 2 +- Bancos/Devoluciones.aspx.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Bancos/Devoluciones.aspx b/Bancos/Devoluciones.aspx index 2e7b1a6a3..0948bde24 100644 --- a/Bancos/Devoluciones.aspx +++ b/Bancos/Devoluciones.aspx @@ -65,7 +65,7 @@
- + diff --git a/Bancos/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs index a8e06bbe5..017243297 100644 --- a/Bancos/Devoluciones.aspx.cs +++ b/Bancos/Devoluciones.aspx.cs @@ -415,7 +415,7 @@ public partial class Bancos_Devoluciones : ClsPaginas string Conc = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; string Ref = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; - if (OpcionDevolucion.SelectedValue.ToEntero() == 3 || TipoDevolucion.SelectedValue.ToString().ToEntero() == 2) + if (OpcionDevolucion.SelectedValue.ToEntero() == 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() == 2) { foreach (GridViewRow gvr in GvDevoluciones.Rows) { From 31415c80417627b361cce76b3ec6ca917cc104d9 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Jul 2021 18:55:27 -0700 Subject: [PATCH 04/44] parametro de ver por detalle/cantidad en if. ya cerrado --- App_Code/ClsInventarios.vb | 3 ++- Inventarios/RepAnomalias.aspx.vb | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 2c8d4284b..a4f596a68 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2863,12 +2863,13 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetInventarioFisicoResultados(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean + Public Function GetInventarioFisicoResultados(CveInventarioFisico As Integer, CveEmpresa As Integer, Optional GPO As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_InventarioFisicoResultadosGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@GPO", SqlDbType.Int).Value = GPO End With Try SqlAdapter.Fill(Data) diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb index 6935e4ef9..29071ec0c 100644 --- a/Inventarios/RepAnomalias.aspx.vb +++ b/Inventarios/RepAnomalias.aspx.vb @@ -82,7 +82,7 @@ Partial Class Inventarios_RepAnomalias dt = Inventario.DtResultados End If Else - If Inventario.GetInventarioFisicoResultados(CveInventarioFisico, UsuarioActual.CveEmpresa) Then + If Inventario.GetInventarioFisicoResultados(CveInventarioFisico, UsuarioActual.CveEmpresa, DdlGPO.SelectedValue.ToString.ToEntero) Then dt = Inventario.DtResultados End If End If @@ -155,7 +155,7 @@ Partial Class Inventarios_RepAnomalias If Inventario.GetInventarioFisicoDetallesProveedores(CveInventarioFisico, UsuarioActual.CveEmpresa) Then Dim dta As DataTable = Inventario.DtResultados Dim str As New StringBuilder - If dta IsNot Nothing AndAlso dt.Rows.Count > 0 Then + If dta IsNot Nothing AndAlso dta.Rows.Count > 0 Then For Each dr As DataRow In dta.FiltraParametros("Incluye = 1").Rows str.AppendFormat("{0},", dr("RazonSocial")) @@ -273,9 +273,9 @@ Partial Class Inventarios_RepAnomalias 'End Sub Private Sub LnkPDF_Click(sender As Object, e As EventArgs) Handles LnkPDF.Click - ImprimirbytesPDF(Impimir, Formato:="PDF") + ImprimirbytesPDF(Imprimir, Formato:="PDF") End Sub - Protected Function Impimir() As Byte() + Protected Function Imprimir() As Byte() Dim retorno As Byte() = Nothing Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepAnomalias.rdlc", UsuarioActual.Empresa.Ruta)) From fc7dedc60eac4343bb73c43960b27af27298b626 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Jul 2021 20:31:11 -0700 Subject: [PATCH 05/44] parametro movto permanente --- App_Code/ClsNominas.vb | 11 +++--- Bancos/Devoluciones.aspx.cs | 67 +++++++++++++++++++++---------------- Nomina/Nomina.aspx.cs | 5 ++- 3 files changed, 46 insertions(+), 37 deletions(-) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 71020a7ac..3295fce89 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -2603,8 +2603,8 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer) As Boolean - Dim retorno As Boolean = False + Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer) As Integer + Dim retorno As Integer = 0 DataAdapter("PA_AddMovtoPermanente", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -2618,15 +2618,16 @@ Public Class ClsNominas .Add("@fechaInicioAplicacion", SqlDbType.VarChar).Value = (fechaInicioAplicacion) .Add("@estatus", SqlDbType.Bit).Value = (estatus) .Add("@CveCuenta", SqlDbType.Int).Value = (CveCuenta) + .Add("@CveMovtoPermanente", SqlDbType.Int).Direction = ParameterDirection.Output End With Try SqlAdapter.Fill(Data) - retorno = True + retorno = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero Catch sqEx As SqlException - retorno = False + retorno = -1 OnError("Ocurrió un error al agregar los movimientos permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Catch ex As Exception - retorno = False + retorno = -1 OnError("Ocurrió un error al agregar los movimientos permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno diff --git a/Bancos/Devoluciones.aspx.cs b/Bancos/Devoluciones.aspx.cs index 017243297..9a4c6db72 100644 --- a/Bancos/Devoluciones.aspx.cs +++ b/Bancos/Devoluciones.aspx.cs @@ -112,8 +112,7 @@ public partial class Bancos_Devoluciones : ClsPaginas } protected void TipoDevolucion_SelectedIndexChanged(object sender, EventArgs e) - { - string tipo = ""; + { switch (TipoDevolucion.SelectedValue) { case "1": @@ -160,7 +159,7 @@ public partial class Bancos_Devoluciones : ClsPaginas } protected void CargaPersonal() { - DdlPersonal.DataSource = get_GlobalDTRHPersonal(UsuarioActual.CveEmpresa); + DdlPersonal.DataSource = get_GlobalDTRHPersonal(UsuarioActual.CveEmpresa).FiltraParametros("", "NombreCompleto"); DdlPersonal.DataBind(); DdlPersonal.Items.Insert(0, new ListItem("Seleccione", "-1")); } @@ -417,25 +416,7 @@ public partial class Bancos_Devoluciones : ClsPaginas if (OpcionDevolucion.SelectedValue.ToEntero() == 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() == 2) { - foreach (GridViewRow gvr in GvDevoluciones.Rows) - { - if (gvr.FCCheckBox("Chk").Checked) - { - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovoDevolucion, gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), Ref, CveConceptoContableDevolucion, Conc, DateTime.Now, 0, -1, CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), CveIEDevolucion: CveIE)) - { - MsgError = "No se pudo insertar concepto de Devolución"; - break; - } - } - } - //GUARDA PREPOLIZAS DETALLE Bancos - if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, !TipoMovoDevolucion, TxtImporte.Text.ToDecimal(), Ref, 174, Conc, DateTime.Now, 0, -1, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: cveCliente, CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: TxtImporte.Text.ToDecimal())) - { - MsgError = "No se pudo insertar concepto de Devolución"; - } - - if (MsgError.Equals("")) - { + int cveConcepto = DdlConcepto.SelectedValue.ToEntero(); string descripcion = TxtDescripcion.Text; @@ -448,11 +429,36 @@ public partial class Bancos_Devoluciones : ClsPaginas bool estatus = true; int CveCuenta = -1; - if (!ObjNom.AddMovtoPermanente(cveConcepto, cvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta)) + if (ObjNom.AddMovtoPermanente(cveConcepto, cvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta) < 0) { MsgError = "No se pudo insertar movimiento permanente"; } + + + foreach (GridViewRow gvr in GvDevoluciones.Rows) + { + if (gvr.FCCheckBox("Chk").Checked) + { + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovoDevolucion, gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), Ref, CveConceptoContableDevolucion, Conc, DateTime.Now, 0, -1, CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: gvr.FCTextBox("TxtAbonar").Text.ToDecimal(), CveIEDevolucion: CveIE)) + { + MsgError = "No se pudo insertar concepto de Devolución"; + break; + } + else + { + //Decimal tTotal = (TxtValor.Text.ToDecimal() * TxtVecesAplicar.Text.ToDecimal()).RoundSQL(); + Decimal tTotal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal(); + //GUARDA PREPOLIZAS DETALLE Via Nómina + if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, !TipoMovoDevolucion, tTotal, Ref, 174, Conc, DateTime.Now, 0, -1, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: cveCliente, CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: tTotal)) + { + MsgError = "No se pudo insertar concepto de Devolución"; + } + } + } } + + + } else @@ -612,17 +618,20 @@ public partial class Bancos_Devoluciones : ClsPaginas Msg.AppendFormat(@"

Ver Póliza", IDPoliza); } ObjIE.Commit(); + + if (!Msg.ToString().Equals("")) + { + string AccionJS = String.Format(@"document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery); + Alert(Msg.ToString(), TipoMensaje.MsgInformacion, String.Format(@"document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery)); + } } else { ObjIE.RollBack(); + Msg.Clear(); + Alert(Msg.ToString(), TipoMensaje.MsgError); } - - if (!Msg.ToString().Equals("")) - { - string AccionJS = String.Format(@"document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery); - Alert(Msg.ToString(), TipoMensaje.MsgInformacion, String.Format(@"document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery)); - } + ObjIE.Dispose(); ObjMov.Dispose(); diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index fc195f656..cf9a412a2 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -1395,7 +1395,7 @@ public partial class Nomina_Nomina2 : ClsPaginas Archivo fileItem = continuar ? Filesgral[0] : null; if (continuar) { - string FileExtension = fileItem.Extencion.ToUpper(); + string FileExtension = fileItem.Extension.ToUpper(); if (FileExtension == "XLS" | FileExtension == "XLSX" | FileExtension == "CSV") { } @@ -4586,8 +4586,7 @@ public partial class Nomina_Nomina2 : ClsPaginas bool Continuar; using (ClsNominas ObjMovt = new ClsNominas()) { - Continuar = ObjMovt.AddMovtoPermanente(cveConcepto, SRCvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta); - + Continuar = ObjMovt.AddMovtoPermanente(cveConcepto, SRCvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta) > 0; } if (Continuar) { From 31638f4eedb902c8abc956822a03c3b97b5b7b88 Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 28 Jul 2021 20:34:02 -0700 Subject: [PATCH 06/44] -- cambio en propiedad Extension y Path, del objeto Archivo --- AC/RegNomina.aspx.vb | 3 -- App_Code/modExtensiones.vb | 10 ++-- Ashx/E48.ashx | 2 +- Ashx/SIGFacturacionCiclica.ashx | 2 +- Bancos/CargarConciliacionesBancarias.aspx.vb | 50 +------------------- Compras/Proveedores.aspx.vb | 4 +- Contabilidad/FisImpuestos.aspx.vb | 2 +- Contabilidad/RegPoliza.aspx.vb | 4 +- Contabilidad/RegPrePoliza.aspx.vb | 4 +- Contabilidad/RegPrePolizaS.aspx.vb | 4 +- Contratos/CatContratosPlantillas.aspx.vb | 2 +- Contratos/Contrato.aspx.vb | 4 +- Contratos/Contrato.vb | 4 +- Contratos/ContratoAvance.aspx.vb | 4 +- Contratos/ContratosSecciones.aspx.vb | 3 -- GPS/CatEventos.aspx.vb | 4 +- GPS/DispositivosControles.aspx.vb | 8 ++-- GPS/DispositivosControles.aspx.vb.vb.exclude | 4 +- GPS/WizardDispositivos.aspx.cs | 2 +- General/SaldosIniciales.aspx.vb | 4 +- Inventarios/AjustesSeccionAlmacen.aspx.vb | 4 +- Inventarios/EntradasSalidas.aspx.vb | 4 +- Inventarios/KardexAlmacenHorizontal.aspx.vb | 2 +- Inventarios/RecepcionAlmacen.aspx.vb | 2 +- Inventarios/RepMaximoMinimo.aspx.vb | 2 +- Inventarios/TrasladoSolicitud.aspx.vb | 4 +- Inventarios/TraspasoAlmacen.aspx.vb | 2 +- MF/CargaLayout.aspx.cs | 2 +- OI/MinutaDetalle.aspx.cs | 16 +++---- OI/Proyecto.aspx.cs | 4 +- OI/RepProyectos.aspx.cs | 4 +- OI/TareaDetalle.aspx.cs | 6 +-- PyME/Sistemas/WizardRegistro.aspx.vb | 10 ++-- RH/ActualizacionMasiva.aspx.vb | 2 +- Sistemas/Librerias.aspx | 2 +- UserControl/TareaNueva.ascx.cs | 4 +- Ventas/Clientes.aspx.vb | 4 +- reporteador.aspx.cs | 4 -- 38 files changed, 73 insertions(+), 129 deletions(-) diff --git a/AC/RegNomina.aspx.vb b/AC/RegNomina.aspx.vb index a85fa5425..7568b2c12 100644 --- a/AC/RegNomina.aspx.vb +++ b/AC/RegNomina.aspx.vb @@ -421,9 +421,6 @@ Partial Class AC_RegNomina End If End If - - Dim drt As DataRow - IDPoliza = objAC.AddPoliza(3, TxtConcepto.Text.Trim, 0, 0, UsuarioActual.CveUsuario, Fecha) If IDPoliza > 0 Then diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 2f4fb03ae..95863dc34 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -3433,16 +3433,16 @@ Namespace Extensiones Public Class Archivo Public Sub New() filename = "" - patch = "Temp\" + path = "Temp\" descripcion = "" End Sub Public Property filename As String - Public Property patch As String + Public Property path As String Public Property descripcion As String - Public ReadOnly Property Extencion As String + Public ReadOnly Property Extension As String Get - Return IO.Path.GetExtension(String.Format("{0}{1}{2}", If(patch.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory), patch, filename)).Replace(".", "") + Return IO.Path.GetExtension(String.Format("{0}{1}{2}", If(path.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory), path, filename)).Replace(".", "") End Get End Property Public ReadOnly Property filenameO As String @@ -3452,7 +3452,7 @@ Namespace Extensiones End Property Public ReadOnly Property FileUrl As String Get - Return String.Format("{0}{1}{2}", If(patch.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory), patch, filename) + Return String.Format("{0}{1}{2}", If(path.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory), path, filename) End Get End Property End Class diff --git a/Ashx/E48.ashx b/Ashx/E48.ashx index a3d8a1d15..385fd6efe 100644 --- a/Ashx/E48.ashx +++ b/Ashx/E48.ashx @@ -445,7 +445,7 @@ Public Class E48 : Implements IHttpHandler, IRequiresSessionState Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa) - Dim dttemp As DataTable + Dim dttemp As DataTable = Nothing 'sino existe, recarga los datos Dim ObjUsr As New ClsInventarios If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then dttemp = ObjUsr.DtResultados diff --git a/Ashx/SIGFacturacionCiclica.ashx b/Ashx/SIGFacturacionCiclica.ashx index 35541349c..63fd22d9f 100644 --- a/Ashx/SIGFacturacionCiclica.ashx +++ b/Ashx/SIGFacturacionCiclica.ashx @@ -343,7 +343,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt Dim DtDetalle As DataTable = Nothing Dim objContratos As New ClsContratos - If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero) Then + If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero, UsuarioActual.CveUsuario) Then DtDetalle = objContratos.DtResultados.FiltraParametros("CveTipoPresupuesto=2") Else DtDetalle = Nothing diff --git a/Bancos/CargarConciliacionesBancarias.aspx.vb b/Bancos/CargarConciliacionesBancarias.aspx.vb index 8fe358133..380ccb142 100644 --- a/Bancos/CargarConciliacionesBancarias.aspx.vb +++ b/Bancos/CargarConciliacionesBancarias.aspx.vb @@ -77,60 +77,14 @@ Partial Class Bancos_CargarConciliacionesBancarias Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargaExcel(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) End If End Sub - Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable - SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) - Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath) - - Dim unnamed As Integer = 0 - Dim cols As Integer - Dim columns As String() - Dim curRow As Integer = 0 - Dim curCol As Integer = 0 - Dim dataTable As DataTable = New DataTable() - Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0) - - For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1 - - If firstRowHasHeaders Then - - If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then - dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString()) - Else - dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) - End If - - curRow = 1 - Else - dataTable.Columns.Add("Column " & (cols + 1)) - End If - Next - - While curRow < worksheet.Rows.Count - columns = New String(cols - 1) {} - - For curCol = 0 To cols - 1 - - If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then - columns(curCol) = "" - Else - columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString() - End If - Next - - dataTable.Rows.Add(columns) - curRow += 1 - End While - - Return dataTable - End Function Private Sub CargaExcel(Ruta As String, FileName As String, Tipo As String) If Not DdlCuenta.SelectedValue.ToEntero > 0 Then diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index ea3a19572..3133c92fc 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -4608,8 +4608,8 @@ Partial Class Compras_Proveedores Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) diff --git a/Contabilidad/FisImpuestos.aspx.vb b/Contabilidad/FisImpuestos.aspx.vb index 4ca322152..24a0db316 100644 --- a/Contabilidad/FisImpuestos.aspx.vb +++ b/Contabilidad/FisImpuestos.aspx.vb @@ -311,7 +311,7 @@ Partial Class Contabilidad_FisImpuestos Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") filemove = fileItem.FileUrl RutaArchivo = String.Format("{0}{1}", RutaDirectorio, CveImpuesto) - RutaArchivo = String.Format("{0}.{1}", RutaArchivo, fileItem.Extencion) + RutaArchivo = String.Format("{0}.{1}", RutaArchivo, fileItem.Extension) Try If Not Directory.Exists(RutaDirectorio) Then diff --git a/Contabilidad/RegPoliza.aspx.vb b/Contabilidad/RegPoliza.aspx.vb index 42de3dde7..48ac946b3 100644 --- a/Contabilidad/RegPoliza.aspx.vb +++ b/Contabilidad/RegPoliza.aspx.vb @@ -1891,8 +1891,8 @@ Partial Class RegPoliza Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb", "xls"), "EXCEL", "CSV") + Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb", "xls"), "EXCEL", "CSV") CargarArchivo(Directorio, file.FileUrl, Tipo) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index 6fd47f81b..91bf2e427 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -2158,9 +2158,9 @@ Partial Class ContabilidadC_RegPrePoliza If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = Server.MapPath("~") & file.patch + Dim Directorio As String = Server.MapPath("~") & file.path - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 47c048b72..8c5ff6a36 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1966,9 +1966,9 @@ Partial Class ContabilidadC_RegPrePolizaS If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = Server.MapPath("~") & file.patch + Dim Directorio As String = Server.MapPath("~") & file.path - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) diff --git a/Contratos/CatContratosPlantillas.aspx.vb b/Contratos/CatContratosPlantillas.aspx.vb index e2c1ad0ae..5ce9a7c86 100644 --- a/Contratos/CatContratosPlantillas.aspx.vb +++ b/Contratos/CatContratosPlantillas.aspx.vb @@ -83,7 +83,7 @@ Partial Class Contratos_CatContratosPlantillas Alert("El nombre del archivo excede los 200 Caracteres permitidos favor de modificarlo.", TipoMensaje.MsgAdvertencia) URL = "" Exit Sub - ElseIf fileItem.Extencion <> "doc" AndAlso fileItem.Extencion <> "docx" Then + ElseIf fileItem.Extension <> "doc" AndAlso fileItem.Extension <> "docx" Then Alert("Solo se permiten archivos de tipo .doc o .docx, favor de modificarlo", TipoMensaje.MsgAdvertencia) URL = "" Exit Sub diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index 31f16c46a..67b1f65e6 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -3554,8 +3554,8 @@ Partial Class Contratos_Default Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) diff --git a/Contratos/Contrato.vb b/Contratos/Contrato.vb index 7972d98d8..07fb55a52 100644 --- a/Contratos/Contrato.vb +++ b/Contratos/Contrato.vb @@ -2143,8 +2143,8 @@ Partial Class Contratos_Default Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) diff --git a/Contratos/ContratoAvance.aspx.vb b/Contratos/ContratoAvance.aspx.vb index 43540332c..c462ab589 100644 --- a/Contratos/ContratoAvance.aspx.vb +++ b/Contratos/ContratoAvance.aspx.vb @@ -364,7 +364,7 @@ Partial Class Contratos_ContratoAvance Dim urlsave As String = String.Format("Empresas\{0}\Contrato\{1}\Anexos", UsuarioActual.CveEmpresa, CveContrato) For Each fileItem As Archivo In guardarArchivos - fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extencion}", ""), urlsave) + fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extension}", ""), urlsave) Next @@ -428,7 +428,7 @@ Partial Class Contratos_ContratoAvance Dim urlsave As String = String.Format("Empresas\{0}\Contrato\{1}\Anexos", UsuarioActual.CveEmpresa, CveContrato) For Each fileItem As Archivo In guardarArchivos - fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extencion}", ""), urlsave) + fileItem.filename.FilesMove(fileItem.filename.Replace($".{fileItem.Extension}", ""), urlsave) Next ObjContratos.Commit() diff --git a/Contratos/ContratosSecciones.aspx.vb b/Contratos/ContratosSecciones.aspx.vb index ec6d6513d..c312fd5c5 100644 --- a/Contratos/ContratosSecciones.aspx.vb +++ b/Contratos/ContratosSecciones.aspx.vb @@ -2,14 +2,11 @@ Option Strict On Imports System.Drawing -Imports AspMap Imports Extensiones Imports System.Data Imports System.IO Imports System.Text Imports System.Threading -Imports AspMap.Web -Imports AspMap.Web.Extensions Partial Class Contratos_ContratosSecciones Inherits ClsPaginas diff --git a/GPS/CatEventos.aspx.vb b/GPS/CatEventos.aspx.vb index 0c19d4965..af6b3e6e1 100644 --- a/GPS/CatEventos.aspx.vb +++ b/GPS/CatEventos.aspx.vb @@ -113,7 +113,7 @@ Partial Class GPS_CatEventos If Not Directory.Exists(Path) Then Directory.CreateDirectory(Path) End If - Dim directorioNew As String = String.Format("{0}\{1}.{2}", Path, Imagen, ArchivoImagen.Extencion) + Dim directorioNew As String = String.Format("{0}\{1}.{2}", Path, Imagen, ArchivoImagen.Extension) If File.Exists(directorioNew) Then My.Computer.FileSystem.DeleteFile(directorioNew) End If @@ -123,7 +123,7 @@ Partial Class GPS_CatEventos If TxtUpSonido.getfiles().Archivos.Count > 0 Then Dim ArchivoSonido As Archivo = TxtUpSonido.getfiles().Archivos(0) Dim PathSonido As String = $"{ModExtensiones.DirectorioBaseEmpresas}Sonidos" - Dim dirSonido As String = String.Format("{0}\{1}.{2}", PathSonido, Sonido, ArchivoSonido.Extencion) + Dim dirSonido As String = String.Format("{0}\{1}.{2}", PathSonido, Sonido, ArchivoSonido.Extension) If File.Exists(dirSonido) Then My.Computer.FileSystem.DeleteFile(dirSonido) End If diff --git a/GPS/DispositivosControles.aspx.vb b/GPS/DispositivosControles.aspx.vb index 3f7d901bf..7ecc5e736 100644 --- a/GPS/DispositivosControles.aspx.vb +++ b/GPS/DispositivosControles.aspx.vb @@ -139,7 +139,7 @@ Partial Class GPS_DispositivosControles If EsEditar = 0 Then If TxtCalibración.getfiles().Archivos.Count > 0 Then Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0) - If Archivo.Extencion <> "xls" AndAlso Archivo.Extencion <> "xlsx" Then + If Archivo.Extension <> "xls" AndAlso Archivo.Extension <> "xlsx" Then GPS.RollBack() GPS.Dispose() Alert("El archivo de calibración debe de ser un archivo excel.") @@ -156,7 +156,7 @@ Partial Class GPS_DispositivosControles Try Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0) Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}TablasCalibracion" - Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion) + Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extension) If File.Exists(dirSonido) Then My.Computer.FileSystem.DeleteFile(dirSonido) End If @@ -211,7 +211,7 @@ Partial Class GPS_DispositivosControles ElseIf EsEditar = 1 Then If TxtCalibración.getfiles().Archivos.Count > 0 Then Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0) - If Archivo.Extencion <> "xls" AndAlso Archivo.Extencion <> "xlsx" Then + If Archivo.Extension <> "xls" AndAlso Archivo.Extension <> "xlsx" Then GPS.RollBack() GPS.Dispose() Alert("El archivo de calibración debe de ser un archivo excel.") @@ -227,7 +227,7 @@ Partial Class GPS_DispositivosControles If Not huboerror Then Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0) Dim Path As String = $"{ModExtensiones.DirectorioBaseEmpresas}TablasCalibracion" - Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion) + Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extension) If File.Exists(dirSonido) Then My.Computer.FileSystem.DeleteFile(dirSonido) End If diff --git a/GPS/DispositivosControles.aspx.vb.vb.exclude b/GPS/DispositivosControles.aspx.vb.vb.exclude index e1eb00ae1..4226629f2 100644 --- a/GPS/DispositivosControles.aspx.vb.vb.exclude +++ b/GPS/DispositivosControles.aspx.vb.vb.exclude @@ -94,7 +94,7 @@ Partial Class GPS_DispositivosControles If EsEditar = 0 Then If TxtCalibración.getfiles().Archivos.Count > 0 Then Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0) - If Archivo.Extencion <> "xls" AndAlso Archivo.Extencion <> "xlsx" Then + If Archivo.Extension <> "xls" AndAlso Archivo.Extension <> "xlsx" Then GPS.RollBack() GPS.Dispose() Alert("El archivo de calibración debe de ser un archivo excel.") @@ -161,7 +161,7 @@ Partial Class GPS_DispositivosControles If Not huboerror Then Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0) Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}TablasCalibracion" - Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion) + Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extension) If File.Exists(dirSonido) Then My.Computer.FileSystem.DeleteFile(dirSonido) End If diff --git a/GPS/WizardDispositivos.aspx.cs b/GPS/WizardDispositivos.aspx.cs index d922d90dd..0c02dfe42 100644 --- a/GPS/WizardDispositivos.aspx.cs +++ b/GPS/WizardDispositivos.aspx.cs @@ -777,7 +777,7 @@ public partial class GPS_WizardDispositivos : ClsPaginas { Archivo Archivo = TxtCalibracion.getfiles().Archivos[0]; string Path = $"{ModExtensiones.DirectorioBaseEmpresas}TablasCalibracion"; - string dirSonido = string.Format(@"{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion); + string dirSonido = string.Format(@"{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extension); if (File.Exists(dirSonido)) { File.Delete(dirSonido); } File.Move(Archivo.FileUrl, dirSonido); SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet()); diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 03fa02cb5..716d296f2 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -19,9 +19,9 @@ Partial Class General_SaldosIniciales If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = Server.MapPath("~") & file.patch + Dim Directorio As String = Server.MapPath("~") & file.path - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index d11bc08fb..cbfd3c09c 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -325,8 +325,8 @@ Partial Class Inventarios_AjustesSeccionAlmacen Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "") + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "") If Tipo = "EXCEL" Then Dim CveAlmacen As Integer = DdlAlmacenExcel.SelectedValue.ToEntero() Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}") diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 7eea03d5b..8b5dd2eca 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -4724,8 +4724,8 @@ Partial Class Inventarios_EntradasSalidas If DdlAlmacen.SelectedValue.ToEntero > 0 Then If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb", "xls"), "EXCEL", "CSV") + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb", "xls"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb index bae47a480..f40c3cdac 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx.vb +++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb @@ -372,7 +372,7 @@ Partial Class Inventarios_KardexAlmacen If TxtProyeccionExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtProyeccionExcel.getfiles().Archivos(0) Dim Directorio As String = Server.MapPath("~") & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 826698cd6..c8d89bea7 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -4729,7 +4729,7 @@ Partial Class Inventarios_RecepcionAlmacen Bitacora = "Documento Relacionado" End If - If ObjEventoBitacora.AddEventoBitacora(Bitacora, String.Format(".{0}", archivoOriginal.Extencion), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMovimientoAlmacen:=CveMovimiento) Then + If ObjEventoBitacora.AddEventoBitacora(Bitacora, String.Format(".{0}", archivoOriginal.Extension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMovimientoAlmacen:=CveMovimiento) Then Try If archivoOriginal.filename <> "" Then Archivo = New System.IO.FileInfo(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, archivoOriginal.filename)) diff --git a/Inventarios/RepMaximoMinimo.aspx.vb b/Inventarios/RepMaximoMinimo.aspx.vb index b9d589ecc..2e678fb2b 100644 --- a/Inventarios/RepMaximoMinimo.aspx.vb +++ b/Inventarios/RepMaximoMinimo.aspx.vb @@ -363,7 +363,7 @@ Partial Class Inventarios_RepMaximoMinimo Dim fileItem As Archivo = If(continuar, Filesgral(0), Nothing) If continuar Then - Dim FileExtension As String = fileItem.Extencion.ToUpper() + Dim FileExtension As String = fileItem.Extension.ToUpper() If FileExtension = "XLS" Or FileExtension = "XLSX" Or FileExtension = "CSV" Then Else diff --git a/Inventarios/TrasladoSolicitud.aspx.vb b/Inventarios/TrasladoSolicitud.aspx.vb index 2fb44a88f..86adbd457 100644 --- a/Inventarios/TrasladoSolicitud.aspx.vb +++ b/Inventarios/TrasladoSolicitud.aspx.vb @@ -921,8 +921,8 @@ Partial Class Inventarios_TrasladoSolicitud Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 79fb8deaf..554f7e64a 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -2817,7 +2817,7 @@ Partial Class Inventarios_TraspasoAlmacen Protected Sub BtnCargaExcelConceptos_Click(sender As Object, e As EventArgs) If TxtExcelConceptos.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcelConceptos.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path CargarArchivoConceptos(Directorio, file.filename) RegistraScript("$('#DivCargaExcelConceptos').modal('hide');") Else diff --git a/MF/CargaLayout.aspx.cs b/MF/CargaLayout.aspx.cs index 97a0eea68..f3b2a7f31 100644 --- a/MF/CargaLayout.aspx.cs +++ b/MF/CargaLayout.aspx.cs @@ -31,7 +31,7 @@ public partial class MF_CargaLayout : ClsPaginas var File = TxtArchivo.getfiles().Archivos[0]; var Direct =File.FileUrl; var Fecha =System.IO.File.GetLastWriteTime(Direct); - if (!File.Extencion.Contiene("txt")) { Alert("Tiene que ser un archivo de texto", TipoMensaje.MsgAdvertencia); return; } + if (!File.Extension.Contiene("txt")) { Alert("Tiene que ser un archivo de texto", TipoMensaje.MsgAdvertencia); return; } CargarArchivo(Direct, File.filename ,Fecha); } else diff --git a/OI/MinutaDetalle.aspx.cs b/OI/MinutaDetalle.aspx.cs index e6391f1ed..8c129d4e0 100644 --- a/OI/MinutaDetalle.aspx.cs +++ b/OI/MinutaDetalle.aspx.cs @@ -335,8 +335,8 @@ public partial class OI_MinutaDetalle : ClsPaginas foreach (Archivo item in TxtArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } bool Continuar = true; @@ -490,8 +490,8 @@ public partial class OI_MinutaDetalle : ClsPaginas foreach (Archivo item in TxtTareaArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } @@ -614,8 +614,8 @@ public partial class OI_MinutaDetalle : ClsPaginas foreach (Archivo item in TxtAgendaArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } @@ -709,8 +709,8 @@ public partial class OI_MinutaDetalle : ClsPaginas foreach (Archivo item in Txtfilecomentario.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } using (ClsOIEventos objoi = new ClsOIEventos()) { diff --git a/OI/Proyecto.aspx.cs b/OI/Proyecto.aspx.cs index 2e6630d24..24749ecf1 100644 --- a/OI/Proyecto.aspx.cs +++ b/OI/Proyecto.aspx.cs @@ -134,8 +134,8 @@ public partial class OI_Proyecto : ClsPaginas //foreach (Archivo item in TxtArchivo.getfiles().Archivos) //{ // archivoname = item.filenameO; - // ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - // rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.patch, item.filename); + // ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + // rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.path, item.filename); //} diff --git a/OI/RepProyectos.aspx.cs b/OI/RepProyectos.aspx.cs index 640866951..4e142a81e 100644 --- a/OI/RepProyectos.aspx.cs +++ b/OI/RepProyectos.aspx.cs @@ -100,8 +100,8 @@ public partial class OI_RepProyectos : ClsPaginas //foreach (Archivo item in TxtArchivo.getfiles().Archivos) //{ // archivoname = item.filenameO; - // ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - // rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.patch, item.filename); + // ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + // rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.path, item.filename); //} diff --git a/OI/TareaDetalle.aspx.cs b/OI/TareaDetalle.aspx.cs index 58b263e8c..3ce6ffa2c 100644 --- a/OI/TareaDetalle.aspx.cs +++ b/OI/TareaDetalle.aspx.cs @@ -715,7 +715,7 @@ public partial class OI_TareaDetalle : ClsPaginas foreach (Archivo item in TxtArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); } @@ -1118,7 +1118,7 @@ public partial class OI_TareaDetalle : ClsPaginas foreach (Archivo item in Txtfilecomentario.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); } using (ClsOIEventos objoi = new ClsOIEventos()) @@ -1209,7 +1209,7 @@ public partial class OI_TareaDetalle : ClsPaginas foreach (Archivo item in txtActualizarArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); } string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); diff --git a/PyME/Sistemas/WizardRegistro.aspx.vb b/PyME/Sistemas/WizardRegistro.aspx.vb index ebc8d5bd5..ca9193bc0 100644 --- a/PyME/Sistemas/WizardRegistro.aspx.vb +++ b/PyME/Sistemas/WizardRegistro.aspx.vb @@ -494,7 +494,7 @@ Partial Class Sistemas_WizardRegistro If TxtFormatoFactura.getfiles().Archivos().Count > 0 Then Dim FormatoFactura As Archivo = TxtFormatoFactura.getfiles().Archivos(0) Dim PathFormato = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\Formatos\" - Dim dirFormato As String = String.Format("{0}\Factura.{1}", PathFormato, FormatoFactura.Extencion) + Dim dirFormato As String = String.Format("{0}\Factura.{1}", PathFormato, FormatoFactura.Extension) If File.Exists(dirFormato) Then My.Computer.FileSystem.DeleteFile(dirFormato) End If @@ -1940,7 +1940,7 @@ Partial Class Sistemas_WizardRegistro If TxtAddUnidadesMedida.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtAddUnidadesMedida.getfiles().Archivos(0) Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarExcelUnidadesMedida(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) @@ -2433,7 +2433,7 @@ Partial Class Sistemas_WizardRegistro If TxtAddProveedor.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtAddProveedor.getfiles().Archivos(0) Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivoProveedor(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) @@ -2615,7 +2615,7 @@ Partial Class Sistemas_WizardRegistro If TxtAddClientes.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtAddClientes.getfiles().Archivos(0) Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivoCliente(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) @@ -2807,7 +2807,7 @@ Partial Class Sistemas_WizardRegistro If TxtAddFactura.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtAddFactura.getfiles().Archivos(0) Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivoFactura(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) diff --git a/RH/ActualizacionMasiva.aspx.vb b/RH/ActualizacionMasiva.aspx.vb index 800133704..4251563ed 100644 --- a/RH/ActualizacionMasiva.aspx.vb +++ b/RH/ActualizacionMasiva.aspx.vb @@ -327,7 +327,7 @@ Partial Class RH_ActualizacionMasiva End If End Using If continuar Then - Dim FileExtension As String = fileItem.Extencion.ToUpper() + Dim FileExtension As String = fileItem.Extension.ToUpper() If FileExtension = "XLS" Or FileExtension = "XLSX" Or FileExtension = "CSV" Then Else diff --git a/Sistemas/Librerias.aspx b/Sistemas/Librerias.aspx index 2477770a8..068e6a572 100644 --- a/Sistemas/Librerias.aspx +++ b/Sistemas/Librerias.aspx @@ -195,7 +195,7 @@ color:blue;mso-ansi-language:EN-US">:TextBox>

-

 

'.VB

                'obtiene el listado de archivos cargados

                Dim Filesgral As List(Of Archivo) = TxtLogo.getfiles().Archivos

                'este if se puede reemplazar por un foreach en caso de que se dee agregar mas de un archivo

                If Filesgral.Count > 0 Then

                    Dim fileItem As Archivo = Filesgral(0)

                    Dim Path As String = HttpContext.Current.Request.ApplicationPath

                    Path = HttpContext.Current.Request.MapPath(Path)

                    Path = String.Format("{0}Imagenes\Empresas\", Path)

                    'aqui se elimina el archivo anterior en este caso particular se esta actualizando el archivo y para que no exista conflicto al reemplazar el archvio

                    If Not Directory.Exists(Path) Then

                        Directory.CreateDirectory(Path)

                    End If

                    'para poner el nombre del archivo esto te puede ayudar

                    'fileItem.filenameO : Nombre original del archivo sin tick

                    'fileItem.Extencion : extension del archivo

                    'fileItem.filename : este es el nombre del archivo con un tick el cual lo debe har unico en el servidor

                    Path = String.Format("{0}Logo_{1}.png", Path, idEmpresa)

                    If File.Exists(Path) Then

                        File.Delete(Path)

                    End If

                    'este es el paso  mas importante aqui se mueve el archivo de la carpeta temporal a nuestra carpeta deseada. fileItem.FileUrl es la ubicacion del archivo temporal en nuestro servidor

                    My.Computer.FileSystem.MoveFile(fileItem.FileUrl, Path)

                End If

                'no olvides limpiar el textvox para que no tenga archivos cargados cuando lo vuelvan a usar

                TxtLogo.Text = ""

+

 

'.VB

                'obtiene el listado de archivos cargados

                Dim Filesgral As List(Of Archivo) = TxtLogo.getfiles().Archivos

                'este if se puede reemplazar por un foreach en caso de que se dee agregar mas de un archivo

                If Filesgral.Count > 0 Then

                    Dim fileItem As Archivo = Filesgral(0)

                    Dim Path As String = HttpContext.Current.Request.ApplicationPath

                    Path = HttpContext.Current.Request.MapPath(Path)

                    Path = String.Format("{0}Imagenes\Empresas\", Path)

                    'aqui se elimina el archivo anterior en este caso particular se esta actualizando el archivo y para que no exista conflicto al reemplazar el archvio

                    If Not Directory.Exists(Path) Then

                        Directory.CreateDirectory(Path)

                    End If

                    'para poner el nombre del archivo esto te puede ayudar

                    'fileItem.filenameO : Nombre original del archivo sin tick

                    'fileItem.Extension : extension del archivo

                    'fileItem.filename : este es el nombre del archivo con un tick el cual lo debe har unico en el servidor

                    Path = String.Format("{0}Logo_{1}.png", Path, idEmpresa)

                    If File.Exists(Path) Then

                        File.Delete(Path)

                    End If

                    'este es el paso  mas importante aqui se mueve el archivo de la carpeta temporal a nuestra carpeta deseada. fileItem.FileUrl es la ubicacion del archivo temporal en nuestro servidor

                    My.Computer.FileSystem.MoveFile(fileItem.FileUrl, Path)

                End If

                'no olvides limpiar el textvox para que no tenga archivos cargados cuando lo vuelvan a usar

                TxtLogo.Text = ""

#ADS number diff --git a/UserControl/TareaNueva.ascx.cs b/UserControl/TareaNueva.ascx.cs index b9640b9cc..1ce591d19 100644 --- a/UserControl/TareaNueva.ascx.cs +++ b/UserControl/TareaNueva.ascx.cs @@ -177,8 +177,8 @@ public partial class UserControl_TareaNueva : System.Web.UI.UserControl foreach (Archivo item in TxtArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index e6660992f..89f53ef8c 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -5794,7 +5794,7 @@ Partial Class Clientes If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) @@ -7827,7 +7827,7 @@ Partial Class Clientes Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") filemove = fileItem.FileUrl RutaArchivo = String.Format("{0}{1}_{2}", RutaDirectorio, CveCliente, _CveDocumentacion) - RutaArchivo = String.Format("{0}.{1}", RutaArchivo, fileItem.Extencion) + RutaArchivo = String.Format("{0}.{1}", RutaArchivo, fileItem.Extension) Try If Not Directory.Exists(RutaDirectorio) Then diff --git a/reporteador.aspx.cs b/reporteador.aspx.cs index 5b0a79f08..a6d229997 100644 --- a/reporteador.aspx.cs +++ b/reporteador.aspx.cs @@ -16,10 +16,6 @@ public partial class reporteador : ClsPaginas return ViewState["rutaArchivo"].ToString(); } set { ViewState["rutaArchivo"] = value; } - } - protected void Page_PreInit(object sender, EventArgs e) - { - } protected void Page_Load(object sender, EventArgs e) { From fc1589ba1a7486236adbf4a0cce395043f14ad84 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 29 Jul 2021 09:00:54 -0700 Subject: [PATCH 07/44] =?UTF-8?q?cambio=20en=20propiedad=20path,=20extensi?= =?UTF-8?q?=C3=B3n=20de=20"Archivo"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/KardexAlmacenHorizontal.aspx.vb | 2 +- Inventarios/RepAnomalias.aspx.vb | 10 ++++++---- OI/TareaDetalle.aspx.cs | 6 +++--- Ventas/ActualizarPrecios.aspx.vb | 2 +- Ventas/CatMetasVendedores.aspx | 4 ++-- Ventas/CatMetasVendedores.aspx.vb | 2 +- Ventas/Clientes.aspx.vb | 2 +- asmx/WSGPSApp.asmx | 1 - 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb index f40c3cdac..022798c18 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx.vb +++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb @@ -371,7 +371,7 @@ Partial Class Inventarios_KardexAlmacen Protected Sub BtnAgregarProyeccion_Click(sender As Object, e As EventArgs) If TxtProyeccionExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtProyeccionExcel.getfiles().Archivos(0) - Dim Directorio As String = Server.MapPath("~") & file.patch + Dim Directorio As String = Server.MapPath("~") & file.path Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else diff --git a/Inventarios/RepAnomalias.aspx.vb b/Inventarios/RepAnomalias.aspx.vb index 29071ec0c..6d833f829 100644 --- a/Inventarios/RepAnomalias.aspx.vb +++ b/Inventarios/RepAnomalias.aspx.vb @@ -338,10 +338,12 @@ Partial Class Inventarios_RepAnomalias #End Region Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable) - Gv.Columns(5).Visible = resultado.MAX("CveSeccionAlmacen").ToEntero > 0 - Gv.Columns(6).Visible = resultado.MAX("Serie") <> "" - Gv.Columns(7).Visible = resultado.MAX("Lote") <> "" - Gv.Columns(8).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha + If resultado IsNot Nothing Then + Gv.Columns(5).Visible = resultado.MAX("CveSeccionAlmacen").ToEntero > 0 + Gv.Columns(6).Visible = resultado.MAX("Serie") <> "" + Gv.Columns(7).Visible = resultado.MAX("Lote") <> "" + Gv.Columns(8).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha + End If End Sub Private Sub LnkCrear_Click(sender As Object, e As EventArgs) Handles LnkCrear.Click diff --git a/OI/TareaDetalle.aspx.cs b/OI/TareaDetalle.aspx.cs index 3ce6ffa2c..ea868bc5d 100644 --- a/OI/TareaDetalle.aspx.cs +++ b/OI/TareaDetalle.aspx.cs @@ -716,7 +716,7 @@ public partial class OI_TareaDetalle : ClsPaginas { archivoname = item.filenameO; ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } @@ -1119,7 +1119,7 @@ public partial class OI_TareaDetalle : ClsPaginas { archivoname = item.filenameO; ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } using (ClsOIEventos objoi = new ClsOIEventos()) { @@ -1210,7 +1210,7 @@ public partial class OI_TareaDetalle : ClsPaginas { archivoname = item.filenameO; ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); if (!System.IO.Directory.Exists(ruta)) diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index ca172e5ec..d3a8d25d2 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -389,7 +389,7 @@ Partial Class Ventas_ActualizarPrecios If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path CargarArchivo(Directorio, file.filename) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) diff --git a/Ventas/CatMetasVendedores.aspx b/Ventas/CatMetasVendedores.aspx index d02cb68a3..e502470b9 100644 --- a/Ventas/CatMetasVendedores.aspx +++ b/Ventas/CatMetasVendedores.aspx @@ -74,7 +74,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/Ventas/CatMetasVendedores.aspx.vb b/Ventas/CatMetasVendedores.aspx.vb index db8d9ff24..d8871551c 100644 --- a/Ventas/CatMetasVendedores.aspx.vb +++ b/Ventas/CatMetasVendedores.aspx.vb @@ -221,7 +221,7 @@ Partial Class CatMetasVendedores Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path CargarArchivo(Directorio, file.filename) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index 89f53ef8c..f9cddc43f 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -5793,7 +5793,7 @@ Partial Class Clientes Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else diff --git a/asmx/WSGPSApp.asmx b/asmx/WSGPSApp.asmx index 5a00618b0..3249864b7 100644 --- a/asmx/WSGPSApp.asmx +++ b/asmx/WSGPSApp.asmx @@ -8,7 +8,6 @@ Imports System.Data Imports Extensiones Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq -Imports WebServiceApp Imports System.Globalization Imports System.Web.Script.Services Imports System.Web.Script.Serialization From 435590e90223930b59f605677aa04177c70e17c0 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 29 Jul 2021 09:01:15 -0700 Subject: [PATCH 08/44] cambio en propiedades, extension y path, de "Archivo" --- CRM/CatEmpresasCRM.aspx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/CatEmpresasCRM.aspx.cs b/CRM/CatEmpresasCRM.aspx.cs index 729929056..89eff8ed4 100644 --- a/CRM/CatEmpresasCRM.aspx.cs +++ b/CRM/CatEmpresasCRM.aspx.cs @@ -152,7 +152,7 @@ public partial class CRM_CatEmpresasCRM : ClsPaginas if( TxtExcel.getfiles().Archivos.Count > 0 ) { Archivo file = TxtExcel.getfiles().Archivos[0]; - string Directorio = Server.MapPath("~") + file.patch; + string Directorio = Server.MapPath("~") + file.path; DataTable dt = ReadExcelFile(Directorio + file.filename, true); DataRowCollection Rows = dt.Rows; From cead7dcae128525d72f5c0d14fe832d38387b5d3 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 29 Jul 2021 10:04:54 -0700 Subject: [PATCH 09/44] Valida diferencia de IPES Compras --- Compras/Compras.aspx.vb | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index f65919d08..e10a8b627 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -8595,6 +8595,50 @@ Partial Class Compras_Compras Respuesta = True End If + + + If Respuesta Then + + Dim IEPSPSDetalles As Decimal = TmpDT.SUM("IEPSPS", " IEPSPS > 0 ").ToDecimal + Dim DiferenciaIEPSPS As Decimal = TxtIEPS.Text.ToDecimal - IEPSPSDetalles + + Dim DTConsultaIEPSPS As New DataTable + DTConsultaIEPSPS = TmpDT.FiltraParametros(" AplicaIEPS = 'True'") + + + Dim IndiceContador As Integer = 0 + Dim IndicePrimero As Integer = 0 + + + For Each dRow As DataRow In TmpDT.Rows + If Boolean.Parse(dRow("AplicaIEPS").ToString) Then + IndicePrimero = IndiceContador + Exit For + End If + IndiceContador = IndiceContador + 1 + Next + + If DiferenciaIEPSPS <> 0 Then + + If DTConsultaIEPSPS.Rows.Count > 0 Then + 'Ajusta IPES en primer registro que aplique IEPS + TmpDT.Rows(IndicePrimero)("IEPSPS") = TmpDT.Rows(IndicePrimero)("IEPSPS").ToString.ToDecimal + DiferenciaIEPSPS + TmpDT.AcceptChanges() + Else + Respuesta = False + Alert("Los productos especificados en el lisado no tienen asigando impuesto IEPS, favor de realizar la correción en el producto que aplique el impúesto.", TipoMensaje.MsgAdvertencia) + End If + End If + + + End If + + + + + + + Return Respuesta End Function From cb2c11a996015bcdc6cc2e3a695080b83d6261fa Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 29 Jul 2021 10:05:15 -0700 Subject: [PATCH 10/44] propiedad Extension y path, de objeto Archivo --- 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 dae0fd7d6..427ea75c9 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -6355,8 +6355,8 @@ Partial Class OC Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) @@ -7732,7 +7732,7 @@ Partial Class OC Protected Sub BtnCargaExcelCot_Click(sender As Object, e As EventArgs) If TxtExcelCot.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcelCot.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path CargarArchivoCot(Directorio, file.filename) CargaCotizaciones(CveOrdenCompra) From c216bcfecb244ef0e64486580d6d0494c0839005 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 29 Jul 2021 10:05:40 -0700 Subject: [PATCH 11/44] mejoras, en indirectos --- Contratos/ContratoObra.aspx | 132 +++++-------- Contratos/ContratoObra.aspx.vb | 330 +++++++++++++++++---------------- 2 files changed, 210 insertions(+), 252 deletions(-) diff --git a/Contratos/ContratoObra.aspx b/Contratos/ContratoObra.aspx index 6092a9d45..357ef318a 100644 --- a/Contratos/ContratoObra.aspx +++ b/Contratos/ContratoObra.aspx @@ -302,18 +302,11 @@ - --%> - - - - - - + --%> + - - - +
@@ -810,7 +803,7 @@
@@ -824,13 +817,10 @@ - - - @@ -839,10 +829,8 @@ - - - - + + @@ -851,9 +839,7 @@ - - - + @@ -861,13 +847,13 @@ - + - + - + @@ -876,17 +862,12 @@ data-toggle="confirmation" data-popout="true" data-original-title="¿Habilitar el avance?" data-btn-ok-label="si" > - - + - + - - - - - + <%-- @@ -901,15 +882,13 @@ CssClass="btn btn-circle btn-sm green" Text="" /> --%> - + + - - - - +
@@ -972,7 +951,7 @@
@@ -986,13 +965,10 @@ - - - @@ -1001,7 +977,7 @@ - + @@ -1010,14 +986,14 @@ - + - + - + @@ -1031,24 +1007,18 @@ - + - + - - - - + + + - - - - - @@ -1147,7 +1117,7 @@ - @@ -1366,8 +1336,8 @@
- " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
@@ -1375,12 +1345,12 @@
- +
- - - - + + + + <%-- --%> @@ -1389,12 +1359,12 @@ + CssClass="table table-striped table-hover Widthall" GridLines="None"> - + - + @@ -1403,27 +1373,15 @@ - + - + - -<%-- - - - - - - - - - - --%> - + @@ -2897,7 +2855,7 @@
Insumos - Insumos-Indirecto + Indirectos Mano de Obra Maquinaria Herramienta Flotilla @@ -2912,13 +2870,7 @@
- - -
- - -
- +
diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index 368397521..7b926f413 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -440,7 +440,7 @@ Partial Class Contratos_ContratoObra End If - CargaEstadoCueta() + CargaEstadoCuenta() TabEstadoCuenta.Visible = True @@ -497,17 +497,17 @@ Partial Class Contratos_ContratoObra If CveContrato > 0 Then If UsuarioActual.TienePermisoProceso(164) Then BtnEliminar.Visible = True - Gv.Columns(8).Visible = True + Gv.Columns(7).Visible = True GvInsumos.Columns(7).Visible = True Else BtnEliminar.Visible = False - Gv.Columns(8).Visible = False + Gv.Columns(7).Visible = False GvInsumos.Columns(7).Visible = False End If Else TabPres.Visible = False - Gv.Columns(8).Visible = True + Gv.Columns(7).Visible = True GvInsumos.Columns(7).Visible = True End If @@ -902,7 +902,7 @@ Partial Class Contratos_ContratoObra If TipoContrato = 4 Then TabPI.Visible = True End If - If ObjContratos.GetContratosDetalle(CveContrato, UsuarioActual.CveEmpresa) Then + If ObjContratos.GetContratosDetalle(CveContrato, UsuarioActual.CveEmpresa, 2) Then TmpDT = ObjContratos.DtResultados If TmpDT.MAX("Cantidad_Original").ToString.ToEntero > 0 OrElse TmpDT.MAX("PU_Original").ToString.ToEntero > 0 Then BtnAutorizar.Visible = False @@ -921,12 +921,11 @@ Partial Class Contratos_ContratoObra UpGVInsumos.Update() UPGVInt.Update() + TotalAvanceVentas = TmpDT.FiltraParametros("CveTipoPresupuesto=2 AND CveContratoDetalle > 0").SUM("Total").ToDecimal + TotalAvanceInterno = TmpDT.FiltraParametros("CveTipoPresupuesto=1 AND CveContratoDetalle > 0").SUM("Total").ToDecimal - TotalAvanceVentas = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").ToDecimal - TotalAvanceInterno = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").ToDecimal - - LbTotalGeneral.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero() - LbTotalGeneralInsumos.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero() + LbTotalGeneral.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=2 AND CveContratoDetalle > 0").SUM("Total").FormatoNumero() + LbTotalGeneralInsumos.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1 AND CveContratoDetalle > 0").SUM("Total").FormatoNumero() LbTotalGeneralInt.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero() 'LblImporte.Text = "$" & TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero() @@ -1354,9 +1353,9 @@ Partial Class Contratos_ContratoObra DdlClasificacionAdd.DataBind() DdlClasificacionAdd.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlClasificacionAddInsumos.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) ' GlobalDTClasificacionesPresupuestos(UsuarioActual.CveEmpresa) - DdlClasificacionAddInsumos.DataBind() - DdlClasificacionAddInsumos.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'DdlClasificacionAddInsumos.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) ' GlobalDTClasificacionesPresupuestos(UsuarioActual.CveEmpresa) + 'DdlClasificacionAddInsumos.DataBind() + 'DdlClasificacionAddInsumos.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlClasificacionInt.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) 'GlobalDTSubFamilias(UsuarioActual.CveEmpresa) DdlClasificacionInt.DataBind() @@ -1418,9 +1417,9 @@ Partial Class Contratos_ContratoObra DdlUMInsumos.DataBind() UpTitulos.Update() End Sub - Protected Sub DdlClasificacionInsumos_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacionAddInsumos.SelectedIndexChanged - ChangeDdlProductoInsumos() - End Sub + 'Protected Sub DdlClasificacionInsumos_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacionAddInsumos.SelectedIndexChanged + ' ChangeDdlProductoInsumos() + 'End Sub Private Sub ChangeDdlProductoInsumos() If UsuarioActual.Empresa.Funcionalidad(105) = "" Then 'Dim filtro As String = "" @@ -1432,15 +1431,15 @@ Partial Class Contratos_ContratoObra ' filtro = String.Format("CveClasificacion={0}", DdlClasificacionAddInsumos.SelectedValue) ' End If 'End If - DdlProductowsInsumos.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacionAddInsumos.SelectedValue.ToEntero).FiltraParametros("", "PSCodigo") - DdlProductowsInsumos.DataBind() - DdlProductowsInsumos.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) - Else - 'If isWhitFamily() Then - ' DdlProductowsInsumos.ddlWS.Attributes.Add("data-idSubFamilia", DdlClasificacionAddInsumos.SelectedValue) - 'Else - DdlProductowsInsumos.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacionAddInsumos.SelectedValue) - 'End If + 'DdlProductowsInsumos.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacionAddInsumos.SelectedValue.ToEntero).FiltraParametros("", "PSCodigo") + 'DdlProductowsInsumos.DataBind() + 'DdlProductowsInsumos.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) + Else + 'If isWhitFamily() Then + ' DdlProductowsInsumos.ddlWS.Attributes.Add("data-idSubFamilia", DdlClasificacionAddInsumos.SelectedValue) + 'Else + ' DdlProductowsInsumos.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacionAddInsumos.SelectedValue) + 'End If End If End Sub #End Region @@ -1503,15 +1502,11 @@ Partial Class Contratos_ContratoObra Row("NoIdentificacion") = "" 'TxtNoIdentificacionv.Text.Trim Row("OCInterna") = "" 'TxtOCInterna.Text.Trim Row("LimitarCantidad") = ChkLimitarCantidadAdd.Checked 'If(ChkLimitarVenta.Checked, 1, 0) - Row("Observacion") = "" 'TxtObservacionesDetalles.Text - - Row("CveRubro") = 1 - + Row("Observacion") = "" 'TxtObservacionesDetalles.Text + Row("CveRubro") = 2 Dim ObjContratos As New ClsContratos - - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), "", Observacion:=Row("Observacion").ToString, CveRubro:=1) Then If Autorizado Then @@ -1842,8 +1837,6 @@ Partial Class Contratos_ContratoObra End If - - If CveContratoDetalleEditar = -1 Then Dim Row As DataRow = TmpDT.NewRow() @@ -1901,8 +1894,8 @@ Partial Class Contratos_ContratoObra Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero Row("UM") = DdlUMInsumos.SelectedItem - Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue - Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem + 'Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue + 'Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero Row("PS") = DdlProductowsInsumos.SelectedText Row("CodigoPS") = DdlProductowsInsumos.SelectedText @@ -1915,10 +1908,7 @@ Partial Class Contratos_ContratoObra Dim ObjContratos As New ClsContratos If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), "", CveRubro:=Row("CveRubro").ToString.ToEntero, CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then - 'If Autorizado Then - ' Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) - ' guardarBitacora(msj) - 'End If + Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") TmpDT.Rows.Add(Row) @@ -2053,8 +2043,12 @@ Partial Class Contratos_ContratoObra Protected Sub GVInsumos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvInsumos.RowDataBound - If e.Row.RowIndex > -1 Then - + If e.Row.RowIndex > -1 Then + If e.Row.DBCampo("CveContratoDetalle") = "" Then + e.Row.CssClass = "SubTotales" + End If + + e.Row.FCCheckBox("CHKPAvance").Visible = Autorizado 'e.Row.FCCheckBox("CHKPEstimacion").Visible = Autorizado If UsuarioActual.TienePermisoProceso(124) Then @@ -3266,70 +3260,6 @@ Partial Class Contratos_ContratoObra #End Region #Region "SUBIR EXCEL" - Public Sub DescargarFormato() - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\FormatoContrato.xlsx" - Dim Archivo As New IO.FileInfo(Directorio) - If Archivo.Exists Then - Response.Clear() - Response.ClearHeaders() - Response.ClearContent() - Response.AddHeader("Content-Disposition", "attachment; filename=" + Archivo.Name) - Response.AddHeader("Content-Length", Archivo.Length.ToString()) - Response.ContentType = "text/plain" - Response.Flush() - Response.TransmitFile(Archivo.FullName) - Response.End() - End If - End Sub - 'Public Sub LbDescargarExcel_Click(sender As Object, e As EventArgs) Handles LbDescargarExcel.Click - ' DescargarFormato() - 'End Sub - Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable - SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) - Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath) - - Dim unnamed As Integer = 0 - Dim cols As Integer - Dim columns As String() - Dim curRow As Integer = 0 - Dim curCol As Integer = 0 - Dim dataTable As DataTable = New DataTable() - Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0) - - For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1 - - If firstRowHasHeaders Then - - If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then - dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString()) - Else - dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) - End If - - curRow = 1 - Else - dataTable.Columns.Add("Column " & (cols + 1)) - End If - Next - - While curRow < worksheet.Rows.Count - columns = New String(cols - 1) {} - - For curCol = 0 To cols - 1 - - If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then - columns(curCol) = "" - Else - columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString() - End If - Next - - dataTable.Rows.Add(columns) - curRow += 1 - End While - - Return dataTable - End Function @@ -3353,8 +3283,8 @@ Partial Class Contratos_ContratoObra Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") ' CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) @@ -3601,7 +3531,7 @@ Partial Class Contratos_ContratoObra #End Region #Region " IMPRIMIR DOCUMENTO - SABE " - Public Sub DescarFormato(documento As String) + Public Sub DescargarFormato(documento As String) Dim PathRoot As String = Server.MapPath("/") Dim PathSource As String @@ -4273,7 +4203,7 @@ Partial Class Contratos_ContratoObra TxtCantidadInsumos.Text = gvRow.DataKey("CantidadContratada").ToDouble.ToString - DdlClasificacionAddInsumos.SelectedValueExist(gvRow.DataKey("CveClasificacion").ToEntero) + ' DdlClasificacionAddInsumos.SelectedValueExist(gvRow.DataKey("CveClasificacion").ToEntero) DdlProductowsInsumos.ddl.SelectedValueExist(gvRow.DataKey("CvePS").ToString.ToEntero) @@ -4294,7 +4224,7 @@ Partial Class Contratos_ContratoObra DVActividadesRH.Visible = True DVSubTipoActivoFijo.Visible = False - DVClasificacion.Visible = False + ' DVClasificacion.Visible = False DVPS.Visible = False DVUM.Visible = False @@ -4310,7 +4240,7 @@ Partial Class Contratos_ContratoObra DVSubTipoActivoFijo.Visible = True - DVClasificacion.Visible = False + 'DVClasificacion.Visible = False DVPS.Visible = False DVUM.Visible = False @@ -4323,7 +4253,7 @@ Partial Class Contratos_ContratoObra DVActividadesRH.Visible = False DVSubTipoActivoFijo.Visible = False - DVClasificacion.Visible = True + 'DVClasificacion.Visible = True DVPS.Visible = True DVUM.Visible = True @@ -4334,7 +4264,6 @@ Partial Class Contratos_ContratoObra End If - ModalControlPSAdd = False ChkContinualAgregandoControl.Visible = False ChkContinualAgregandoControl.Checked = False @@ -4386,7 +4315,7 @@ Partial Class Contratos_ContratoObra TxtCantidadInsumos.Text = "" - DdlClasificacionAddInsumos.SelectedValueExist(-1) + ' DdlClasificacionAddInsumos.SelectedValueExist(-1) DdlProductowsInsumos.txtText.Value = "" DdlProductowsInsumos.txtValue.Value = "" DdlUMInsumos.SelectedValueExist(-1) @@ -4394,7 +4323,7 @@ Partial Class Contratos_ContratoObra DdlRubro.SelectedValue = "2" - DVClasificacion.Visible = True + ' DVClasificacion.Visible = True DVPS.Visible = True DVUM.Visible = True @@ -4450,6 +4379,7 @@ Partial Class Contratos_ContratoObra Dim DTCargaPresupuestoInsumos As New DataTable Dim DTCargaPresupuestoManoObra As New DataTable Dim DTCargaPresupuestoFlotillas As New DataTable + Dim DTCargaPresupuestoIndirectos As New DataTable If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then @@ -4457,7 +4387,7 @@ Partial Class Contratos_ContratoObra DTCargaPresupuesto = CargaPreSupuestoExcel("Presupuesto") If DTCargaPresupuesto.Rows.Count > 0 Then - ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, Nothing, Nothing) + ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, Nothing, Nothing, Nothing) Else Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia) End If @@ -4466,9 +4396,10 @@ Partial Class Contratos_ContratoObra DTCargaPresupuesto = CargaPreSupuestoExcel("Insumos") DTCargaPresupuestoManoObra = CargaPreSupuestoExcel("ManoObra") - DTCargaPresupuestoFlotillas = CargaPreSupuestoExcel("Maquinaria") + DTCargaPresupuestoFlotillas = CargaPresupuestoExcel("Maquinaria") + DTCargaPresupuestoIndirectos = CargaPresupuestoExcel("Indirectos") - ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, DTCargaPresupuestoManoObra, DTCargaPresupuestoFlotillas) + ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, DTCargaPresupuestoManoObra, DTCargaPresupuestoFlotillas, DTCargaPresupuestoIndirectos) End If @@ -4478,7 +4409,6 @@ Partial Class Contratos_ContratoObra Protected Sub BtnDecargaFormato_Click(sender As Object, e As EventArgs) - Dim FI As New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx") If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then @@ -4503,11 +4433,10 @@ Partial Class Contratos_ContratoObra End If - End Sub - Private Function CargaPreSupuestoExcel(Hoja As String) As DataTable + Private Function CargaPresupuestoExcel(Hoja As String) As DataTable Dim FileExtension As String = "-1" Dim Filesgral As List(Of Archivo) = TxtModalCargaPresupuesto.getfiles().Archivos @@ -4518,13 +4447,11 @@ Partial Class Contratos_ContratoObra FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") - If Not FileExtension.ToUpper.Contiene("XLSX", "XSL") Then Alert("El archivo no es una archivo de Excel", TipoMensaje.MsgAdvertencia) Exit For End If - Dim tempArray() As String tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) SpreadsheetInfo.SetLicense(Extensiones.SerialGemBoxSpreadsheet) @@ -4541,23 +4468,15 @@ Partial Class Contratos_ContratoObra Next - - RegistraScript("$('#ModalUploadPresupuesto').modal('hide')") - UpModalCargaPresupuesto.Update() - - DTPS = DTPS.FiltraParametros("Cantidad > 0") - Return DTPS - - End Function - Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable, DTCargaPresupuestoManoObra As DataTable, DTCargaPresupuestoFlotillas As DataTable) + Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable, DTCargaPresupuestoManoObra As DataTable, DTCargaPresupuestoFlotillas As DataTable, DTCargaPresupuestoIndirectos As DataTable) If Not DTPresupuesto Is Nothing Then @@ -4572,6 +4491,10 @@ Partial Class Contratos_ContratoObra DTCargaPresupuestoFlotillas.CaseSensitive = False End If + If Not DTCargaPresupuestoIndirectos Is Nothing Then + DTCargaPresupuestoIndirectos.CaseSensitive = False + End If + Dim ErrorProceso = False Dim DTPS = New DataTable @@ -4617,24 +4540,18 @@ Partial Class Contratos_ContratoObra Dim CvePS As Integer = -1 Dim CveUM As Integer = -1 Dim StrArray() As String - - StrArray = GetPS("Codigo", DrowPS("Codigo").ToString).Split("|"c) If StrArray.Length > 0 Then - If CBool(StrArray(0)) = True Then CvePS = StrArray(1).ToEntero - End If - End If If CvePS = -1 Then StrArray = GetPS("PS", DrowPS("Producto").ToString).Split("|"c) - If StrArray.Length > 0 Then If CBool(StrArray(0)) = True Then CvePS = StrArray(1).ToEntero @@ -4852,13 +4769,117 @@ Partial Class Contratos_ContratoObra ErrorProceso = True RowNoEncontrados &= "Sub Tipo: " & DrowPS("SubTipoAF").ToString & "<\BR>" End If - - Next - - End If + If Not DTCargaPresupuestoIndirectos Is Nothing Then + + For Each DrowPS As DataRow In DTCargaPresupuestoIndirectos.Rows + + Dim CvePS As Integer = -1 + Dim CveUM As Integer = -1 + Dim StrArray() As String + StrArray = GetPS("Codigo", DrowPS("Codigo").ToString).Split("|"c) + + If StrArray.Length > 0 Then + If CBool(StrArray(0)) = True Then + CvePS = StrArray(1).ToEntero + End If + End If + + + If CvePS = -1 Then + + StrArray = GetPS("PS", DrowPS("Producto").ToString).Split("|"c) + If StrArray.Length > 0 Then + If CBool(StrArray(0)) = True Then + CvePS = StrArray(1).ToEntero + End If + End If + + If CvePS = -1 Then + + Dim ObjPS As New ClsProductosServicios + + Dim CveClasificacion As Integer + If DrowPS.Table.Columns.Contains("Clasificacion") Then + CveClasificacion = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion = '{0}'", DrowPS("Clasificacion").ToString.Trim)).ToEntero + Else + CveClasificacion = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveClasificacion").ToString.ToEntero 'toma el primero + End If + + Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{ DrowPS("UnidadMedida").ToString}' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString}'").ToString.ToEntero + + If Not CveUnidadMedida > 0 Then + CveUnidadMedida = GlobalDTUnidadesMedida(CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveUnidadMedida").ToString.ToEntero + End If + + If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, DrowPS("Codigo").ToString.Trim, "", "", DrowPS("Producto").ToString, DrowPS("PU").ToString.ToDouble, 0, 0, False, 0, False, If(TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas, True, False), + UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, CveTipoPS:=2, CveSATPS:=-1, CveMarca:=-1, CveTamaño:=-1, CveMedida:=-1, CveRinTamaño:=-1, CveModelo:=-1, Litraje:=-1, IEPSPorcentaje:=-1, CveClasificacion2:=-1, CveClasificacionDetalle:=-1) > 0 Then + CvePS = ObjPS.CvePS + Else + CvePS = -1 + RowNoEncontrados &= "Producto: " & StrArray(1) & "<\BR>" + End If + + ObjPS.Dispose() + + End If + + End If + + + If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then + + CveUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $" UnidadMedida = '{ DrowPS("UnidadMedida").ToString.Trim }' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString.Trim }'").ToEntero + + If CveUM <= 0 Then + CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero + End If + + + Dim Row As DataRow = DTPS.NewRow() + + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble + Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble + Row("CveUM") = CveUM + Row("UM") = "" + Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero + Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString + Row("CvePS") = CvePS + Row("PS") = DrowPS("Producto").ToString + Row("CodigoPS") = DrowPS("Producto").ToString + Row("PU") = DrowPS("PU").ToString.ToDouble + Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + + Select Case TipoCargaPresupuesto + Case EnumTipoCargaPresupuesto.Control + Row("CveTipoPresupuesto") = 1 + Row("CveRubro") = 5 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + Exit Select + Case Else + Row("CveTipoPresupuesto") = 1 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + End Select + + + Row("NoIdentificacion") = "" + Row("OCInterna") = "" + Row("LimitarCantidad") = 0 + Row("Observacion") = "" + + DTPS.Rows.Add(Row) + Else + ErrorProceso = True + End If + Next + + End If If Not ErrorProceso Then @@ -4888,13 +4909,8 @@ Partial Class Contratos_ContratoObra NrowTmpDT("Clasificacion") = Row("Clasificacion") NrowTmpDT("CvePS") = Row("CvePS") - NrowTmpDT("PS") = Row("PS") NrowTmpDT("CodigoPS") = Row("CodigoPS") - - - - NrowTmpDT("PU") = Row("PU") NrowTmpDT("Total") = Row("Total") NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto") @@ -4956,22 +4972,14 @@ Partial Class Contratos_ContratoObra ObjContratos.Dispose() - End If - - If RowNoEncontrados.Length > 0 Then Alert($"Productos y Sub Tipos no encontrados
{RowNoEncontrados} ", TipoMensaje.MsgAdvertencia) End If - - - End Sub - - Protected Sub LnkHabilitaAvance_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) @@ -4990,10 +4998,8 @@ Partial Class Contratos_ContratoObra row("PermitirAvance") = IIf(PermitirAvance = 1, 0, 1).ToString.ToEntero - CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) - Alert("Se ha permitido levantar avance", TipoMensaje.MsgInformacion) Else Alert("no se pudo permitir avance", TipoMensaje.MsgAdvertencia) @@ -5003,7 +5009,7 @@ Partial Class Contratos_ContratoObra End Sub - Private Sub CargaEstadoCueta() + Private Sub CargaEstadoCuenta() Dim ObjContratos As New ClsContratos @@ -5247,7 +5253,7 @@ Partial Class Contratos_ContratoObra DVDias.Visible = True DVActividadesRH.Visible = True - DVClasificacion.Visible = False + 'DVClasificacion.Visible = False DVPS.Visible = False DVUM.Visible = False @@ -5259,7 +5265,7 @@ Partial Class Contratos_ContratoObra DVDias.Visible = True DVActividadesRH.Visible = False - DVClasificacion.Visible = False + 'DVClasificacion.Visible = False DVPS.Visible = False DVUM.Visible = False @@ -5268,8 +5274,8 @@ Partial Class Contratos_ContratoObra Else DVDias.Visible = False DVActividadesRH.Visible = False - - DVClasificacion.Visible = True + ' + 'DVClasificacion.Visible = True DVPS.Visible = True DVUM.Visible = True From aeb87f309dc0b9f2baf76af469b1bce186ae7430 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 29 Jul 2021 10:08:27 -0700 Subject: [PATCH 12/44] ajustes de contratos --- Compras/Compras.aspx | 10 +++++----- Compras/Compras.aspx.vb | 39 ++++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 22040bb52..a96e8339d 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -5359,8 +5359,8 @@
--%> - - - - - - - - - - - - - - - - - -
Clasificación Contratado Avance Faltante Clasificación Contratado Avance Faltante Avance Por Facturar Anticipo
@@ -454,7 +455,7 @@
+ DataKeyNames="CvePrePolizaDetalle, CveConceptoContable, IdCtaContable, CveSubProyecto, CveTipoGasto,Referencia,CveVenta,CveCompra, CveProveedor, CveCliente, CvePersonal, CveCuenta, PorcentajeImpuesto" Width="100%" > Movimiento @@ -729,6 +730,10 @@ + + + +
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 8c5ff6a36..222b9f505 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -331,7 +331,8 @@ Partial Class ContabilidadC_RegPrePolizaS .Add("ContadoNumeroFolio", Type.GetType("System.String")) .Add("ContadoImporte", Type.GetType("System.Double")) .Add("ContadoBeneficiario", Type.GetType("System.String")) - .Add("ContadoObservaciones", Type.GetType("System.String")) + .Add("ContadoObservaciones", Type.GetType("System.String")) + .Add("PorcentajeImpuesto", Type.GetType("System.Double")) .Add("Modificado", Type.GetType("System.Boolean")) @@ -578,7 +579,9 @@ Partial Class ContabilidadC_RegPrePolizaS DdlConceptosContables.DataBind() End Sub - Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged + Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged + + If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then CargaProveedores() DdlProveedores.Visible = True @@ -1051,7 +1054,8 @@ Partial Class ContabilidadC_RegPrePolizaS row.DataKey("IdCtaContable").ToEntero, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero), CveConceptoContable:=row.DataKey("CveConceptoContable").ToEntero, CveProveedor:=row.DataKey("CveProveedor").ToEntero, CveCompra:=row.DataKey("CveCompra").ToEntero, - CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, CvePersonal:=row.DataKey("CvePersonal").ToEntero, Referencia:=row.FCLiteral("TxtRef").Text, CveCuenta:=row.DataKey("CveCuenta").ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, + CvePersonal:=row.DataKey("CvePersonal").ToEntero, Referencia:=row.FCLiteral("TxtRef").Text, CveCuenta:=row.DataKey("CveCuenta").ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then OcurrioError = True Exit For End If @@ -1065,7 +1069,7 @@ Partial Class ContabilidadC_RegPrePolizaS ImporteMX:=If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveProveedor:=row.DataKey("CveProveedor").ToEntero, CveCompra:=row.DataKey("CveCompra").ToEntero, CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, - CvePersonal:=row.DataKey("CvePersonal").ToEntero, CveCuenta:=row.DataKey("CveCuenta").ToEntero) Then + CvePersonal:=row.DataKey("CvePersonal").ToEntero, CveCuenta:=row.DataKey("CveCuenta").ToEntero, PorcentajeImpuesto:=row.DataKey("PorcentajeImpuesto").ToDecimal) Then OcurrioError = True Exit For End If @@ -1119,6 +1123,7 @@ Partial Class ContabilidadC_RegPrePolizaS Dim CveCuenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCuenta").ToString.ToEntero Dim Cargo As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtCargo").Text.ToDouble Dim Abono As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtAbono").Text.ToDouble + Dim PorcentajeImpuesto As Double = GvPrePoliza.Rows(IndiceGrid).DataKey("PorcentajeImpuesto").ToEntero CargaConceptosContablesE() DdlConceptosContablesE.SelectedValueExist(CveConceptoContable) @@ -1187,7 +1192,11 @@ Partial Class ContabilidadC_RegPrePolizaS DdlCuentaContableE.DataBind() DdlCuentaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0")) End Sub - Private Sub DdlConceptosContablesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContablesE.SelectedIndexChanged + Private Sub DdlConceptosContablesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContablesE.SelectedIndexChanged + Dim dr As DataRow = GlobalDTContaConceptosContables(DdlConceptosContablesE.SelectedValue.ToEntero).FiltroPrimero("") + If dr IsNot Nothing Then + DdlPorcentajeIVAE.Visible = dr("AplicaImpuesto") = "True" + End If If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then CargaProveedoresE() DdlProveedoresE.Visible = True @@ -1303,9 +1312,14 @@ Partial Class ContabilidadC_RegPrePolizaS dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero - dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, "")) + If DdlComprasE.Visible = True AndAlso DdlComprasE.SelectedValue.ToEntero > 0 Then dr("FolioFactura") = DdlComprasE.SelectedItem.ToString() + If DdlVentasE.Visible = True AndAlso DdlVentasE.SelectedValue.ToEntero > 0 Then dr("FolioFactura") = DdlVentasE.SelectedItem.ToString() dr("Modificado") = True + If DdlPorcentajeIVAE.Visible Then + dr("PorcentajeImpuesto") = DdlPorcentajeIVAE.SelectedValue.ToDecimal + End If + DtMovimientos.Rows.Add(dr) DtMovimientos.AcceptChanges() From f9c174bf46eddfd2e14d89eaea15b24aa35e4eb7 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 29 Jul 2021 20:01:13 -0700 Subject: [PATCH 20/44] permite editar pu, relacionado en contrato --- OC/OC.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OC/OC.aspx b/OC/OC.aspx index 59056f36c..30dc72362 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -2781,7 +2781,7 @@ - + From 76c1613c18ec3ac6b65976e786069d9d8d39a060 Mon Sep 17 00:00:00 2001 From: Hector Date: Fri, 30 Jul 2021 09:25:54 -0700 Subject: [PATCH 21/44] continuar agregando --- OC/OC.aspx | 2 +- OC/OC.aspx.vb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OC/OC.aspx b/OC/OC.aspx index 59056f36c..c8893251e 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -2747,7 +2747,7 @@
-
+
" style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 5b552d66e..58850f9c4 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -8513,8 +8513,9 @@ Partial Class OC CargaSuperior() CargaDatosDetalles() - - RegistraScript("$('#DivmodalConmtrato').modal('hide')") + If Not ChkContinualAgregandoControl.Checked Then + RegistraScript("$('#DivmodalConmtrato').modal('hide')") + End If UPPDetalle.Update() From e52194e2401d61f1df27b37c0038c9a514e0c9e8 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 30 Jul 2021 11:01:40 -0700 Subject: [PATCH 22/44] Se elimina formato de Factura de empresa 24 que no corresponde a la empresa (la empresa 24 no usa ventas) --- Empresas/24/Formatos/Factura.rdlc | 4108 ----------------------------- 1 file changed, 4108 deletions(-) delete mode 100644 Empresas/24/Formatos/Factura.rdlc diff --git a/Empresas/24/Formatos/Factura.rdlc b/Empresas/24/Formatos/Factura.rdlc deleted file mode 100644 index 48af8d6b8..000000000 --- a/Empresas/24/Formatos/Factura.rdlc +++ /dev/null @@ -1,4108 +0,0 @@ - - - - - - true - - - - - Tipo - - - - - - - Textbox3 - 0.90692in - 5.662in - 0.5cm - 2.24597in - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Fecha y hora de emisión - - - - - - - - - - - - - - - - Textbox3 - 0.46414in - 5.662in - 0.5cm - 2.24597in - 1 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =IIF(Parameters!Serie.Value.ToString="",Parameters!Folio.Value,Parameters!Serie.Value & "-" &Parameters!Folio.Value) - - - - - - - Textbox3 - 0.22455in - 5.662in - 0.60856cm - 2.24597in - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!TipoDocumento.Value - - - - - - - Textbox3 - 0.0412cm - 5.662in - 0.52916cm - 2.24597in - 3 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Innovación y Desarrollo en Telemetría SA de CV - - - - - - - - - R.F.C IDT130809KA5 - - - - - - - - - raul@argustecnologias.com - - - - - - - Textbox4 - 1.93416in - 0.66099in - 3.62386in - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - SON: ( - - - - =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) - - - - ) - - - - - - - ImporteLetra - 2.45237in - 1.40437in - 0.2053in - 4.28167in - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!SelloCFDI.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!SelloSAT.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!CadenaOriginal.Value - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!QR.Value - FitProportional - 4.58097in - 0.04026in - 0.95455in - 1.49755in - 9 - - - - - - Embedded - Logo1 - FitProportional - 0.07204cm - 0.06139cm - 2.88998cm - 4.56434cm - 10 - - - - - - true - - - - - =Parameters!Fecha.Value - - - - - - - Textbox3 - 0.66099in - 5.662in - 0.25114in - 2.24597in - 11 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!Tipo.Value & Parameters!Ref.Value - - - - - - - Textbox3 - 1.10364in - 5.662in - 0.25635in - 2.24597in - 12 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Domicilio Fiscal - - - - - - - - - Poder Legislativo, #75, Col Misión del Sol, - - - - - - - - - C.P 83100 Hermosillo, Sonora, México, - - - - - - - - - Tel.: (662)-210-1899 - - - - - - - Textbox10 - 0.51102in - 1.80916in - 0.65513in - 1.92119in - 13 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Lugar de Expedición - - - - - - - - - =Parameters!DomicilioSucursal.Value - - - - - - - Textbox10 - 0.51102in - 3.77202in - 0.65513in - 1.88998in - 14 - - - Top - - - - true - true - - - - - Nombre - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteNombre.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Dirección - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteDireccion.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Ciudad - - - - - - - - 1.25pt - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!ClienteLugar.Value - - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Sub Total 1 - - - - - - - Textbox19 - 2.21973in - 5.68604in - 0.21875in - 0.99552in - 21 - - - - White - - 1pt - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Descuento - - - - - - - Textbox19 - 2.43848in - 5.68499in - 0.21875in - 0.99552in - 22 - - - - White - - 1pt - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Amort. Ant - - - - - - - Textbox19 - 2.65723in - 5.68604in - 0.20535in - 0.99552in - 23 - - - - White - - 1pt - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Sub Total 2 - - - - - - - Textbox19 - 2.86258in - 5.68604in - 0.23803in - 0.99552in - 24 - - - - White - - 1pt - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - IVA (16%) - - - - - - - Textbox19 - 3.102in - 5.68499in - 0.21875in - 0.99552in - 25 - - - - White - - 1pt - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Total - - - - - - - Textbox19 - 3.32075in - 5.68499in - 0.21875in - 0.99552in - 26 - - - - White - - 1pt - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =IIF(Parameters!SubTotal.Value= 0 ,"-",Parameters!SubTotal.Value) - - - - - - - Textbox42 - 2.21973in - 6.69406in - 0.21875in - 1.24179in - 27 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - true - - - - - =IIF(Parameters!Amortizacion.Value = 0,"-",Parameters!Amortizacion.Value) - - - - - - - Textbox42 - 2.65772in - 6.693in - 0.20535in - 1.24179in - 28 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - true - - - - - =iif(Parameters!Descuento.Value= 0, "-",Parameters!Descuento.Value) - - - - - - - Textbox42 - 2.43892in - 6.693in - 0.21875in - 1.24179in - 29 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - true - - - - - =IIF(Parameters!SubTotal2.Value = 0,"-",Parameters!SubTotal2.Value) - - - - - - - Textbox42 - 2.86258in - 6.69406in - 0.23803in - 1.24179in - 30 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - true - - - - - =iif(Parameters!IVA.Value = 0,"-",Parameters!IVA.Value) - - - - - - - Textbox42 - 3.10061in - 6.69406in - 0.21875in - 1.24179in - 31 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - true - - - - - =Parameters!Total.Value - - - - - - - Textbox42 - 3.31936in - 6.69406in - 0.21875in - 1.24179in - 32 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Importe con letra: - - - - - - - Textbox19 - 2.45237in - 0.04458in - 0.2053in - 1.35979in - 33 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Forma de pago: - - - - - - - Textbox19 - 2.65772in - 0.04458in - 0.22222in - 1.35979in - 34 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - - - - - - - - - - - - - - - - - - - Sello digital del CFDI: - - - - - - - Textbox19 - 2.86952in - 0.04458in - 0.47749in - 1.35979in - 35 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - - - - - - - - - - Sello del SAT: - - - - - - - Textbox19 - 3.33868in - 0.04515in - 0.47749in - 1.36417in - 36 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Cadena original del complemento de certificación digital del SAT: - - - - - - - Textbox19 - 3.80598in - 0.02417in - 0.21875in - 5.66187in - 37 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!FormaPago.Value - - - - - - - ImporteLetra - 2.65772in - 1.40437in - 0.22222in - 4.28167in - 38 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Folio Fiscal: - - - - - - - Textbox54 - 4.55882in - 1.64412in - 0.18056in - 4.03672in - 39 - - - - - - - White - - - - - - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - No. Serie del Certificado del SAT: - - - - - - - Textbox54 - 4.75327in - 1.64412in - 0.18056in - 4.03672in - 40 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha y Hora de certificación: - - - - - - - Textbox54 - 4.95182in - 1.64412in - 0.19444in - 4.03672in - 41 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Certificado del Contribuyente: - - - - - - - Textbox54 - 5.15743in - 1.64412in - 0.19445in - 4.03672in - 42 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FolioFiscal.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FechaCertificacion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!CertificadoContribuyente.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Regímen: Regímen General de Ley Personas Morales; Condiciones de pago: - - - - =IIF(Parameters!CondicionPago.Value.ToString="","No Identificado",Parameters!CondicionPago.Value) - - - - ; Método de Pago: - - - - =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) - - - - ; Num. Cta Pago: - - - - =IIF(Parameters!NumCta.Value="0" Orelse Parameters!NumCta.Value="","No Identificado",Parameters!NumCta.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Éste documento es una representacion impresa de un CFDi - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - true - true - - - - - P A G A R E con Folio - - - - =Parameters!Serie.Value - - - - - - - - - =Parameters!Folio.Value - - - - Por éste pagare prometo (emos) pagar incondicionalmente a la orden de Innovación y Desarrollo en Telemetría SA de CV, a su vencimiento el - - - - =Parameters!Vencimiento.Value - - - - , en Hermosillo, Sonora o en el domicilio señalado a elección del acreedor o tenedor la cantidad de $ - - - - =Parameters!Total.Value - - - - SON: ( - - - - =Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) - - - - ). Valor recibido a mi (nuestra) entera satisfacción. la falta de pago de éste documento a su vencimiento dará derecho a Innovación y Desarrollo en Telemetría SA de CV o tenedor, desde el día siguiente a cobrar el 10% mensual de interes moratorios hasta su total liquidación y los gastos judiciales que se ocasionen. Lugar y Fecha de Suscripción: Hermosillo, Sonora a - - - - =CDATE(Parameters!Fecha.Value).ToString("dd/MM/yyyy") - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Nombre: - - - - =Parameters!ClienteNombre.Value - - - - - - - =Parameters!ClienteDireccion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Acepto de conformidad - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 0.29357cm - 0.09963cm - 0cm - 0.57653cm - 3 - - - - - - 0.29357cm - 0.73559cm - 0cm - 0.57653cm - 4 - - - - - - 0.29357cm - 1.35545cm - 0cm - 0.57653cm - 5 - - - - - - 0.29357cm - 1.80439cm - 0cm - 0.57653cm - 6 - - - - - - 0.29357cm - 2.37686cm - 0cm - 0.57653cm - 7 - - - - - - 0.29357cm - 3.01789cm - 0cm - 0.57653cm - 8 - - - - - - 0.29357cm - 3.65558cm - 0cm - 0.57653cm - 9 - - - - - - 0.29357cm - 4.29154cm - 0cm - 0.57653cm - 10 - - - - - - 0.29357cm - 4.92728cm - 0cm - 0.57653cm - 11 - - - - - - 0.29357cm - 5.25981cm - 0cm - 0.57653cm - 12 - - - - - - 0.29357cm - 5.89576cm - 0cm - 0.57653cm - 13 - - - - - - 0.29357cm - 6.50505cm - 0cm - 0.57653cm - 14 - - - - - - 0.29357cm - 7.18531cm - 0cm - 0.57653cm - 15 - - - - - - 0.29357cm - 7.82127cm - 0cm - 0.57653cm - 16 - - - - - - 0.29357cm - 8.48346cm - 0cm - 0.57653cm - 17 - - - - - - 0.29357cm - 8.81599cm - 0cm - 0.57653cm - 18 - - - - - - 0.29357cm - 9.45195cm - 0cm - 0.57653cm - 19 - - - - - - 0.29357cm - 10.11415cm - 0cm - 0.57653cm - 20 - - - - - - 0.29357cm - 14.08927cm - 0cm - 0.57653cm - 21 - - - - - - 0.29357cm - 14.72523cm - 0cm - 0.57653cm - 22 - - - - - - 0.29357cm - 15.33451cm - 0cm - 0.57653cm - 23 - - - - - - 0.29357cm - 15.64058cm - 0cm - 0.57653cm - 24 - - - - - - 0.29357cm - 16.27654cm - 0cm - 0.57653cm - 25 - - - - - - 0.29357cm - 16.91228cm - 0cm - 0.57653cm - 26 - - - - - - 0.29357cm - 10.76463cm - 0cm - 0.57653cm - 27 - - - - - - 0.29357cm - 11.42705cm - 0cm - 0.57653cm - 28 - - - - - - 0.29357cm - 12.06279cm - 0cm - 0.57653cm - 29 - - - - - - 0.29357cm - 12.36886cm - 0cm - 0.57653cm - 30 - - - - - - 0.29357cm - 12.89898cm - 0cm - 0.57653cm - 31 - - - - - - 0.29357cm - 13.53472cm - 0cm - 0.57653cm - 32 - - - - - - 0.29357cm - 18.40663cm - 0cm - 0.57653cm - 33 - - - - - - 0.29357cm - 19.04259cm - 0cm - 0.57653cm - 34 - - - - - - 0.29357cm - 17.74353cm - 0cm - 0.57653cm - 35 - - - - - - 3.29402cm - 15.33451cm - 0cm - 4.58211cm - 36 - - - - - - true - 14.39536cm - 0.13016cm - 4.24605cm - 20.06179cm - 49 - - = (Parameters!AplicaPagare.Value="0" ORelse Parameters!AplicaPagare.Value="") - - - - - - - true - - - - - =Parameters!Observaciones.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 2.12527cm - - - 2.02474cm - - - 10.17786cm - - - 2.52862cm - - - 3.15415cm - - - - - 0.52063cm - - - - - true - - - - - Cantidad - - - - - - - Textbox34 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Unidad - - - - - - - Textbox53 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Descripción - - - - - - - Textbox79 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - P. Unitario - - - - - - - Textbox84 - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Importe - - - - - - - - - - - - - - - #e2ab67 - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.4148cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!UM.Value - - - - - - - UM1 - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PS.Value &Fields!Obs.Value - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PU.Value - - - - - - - PU1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cantidad.Value*Fields!PU.Value - - - - - - - Textbox88 - - - - - - - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - 0.08406cm - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - - - - - - Before - - - - DsOC - 4.5569cm - 0.11468cm - 1.01949cm - 20.01064cm - 51 - - - - - - true - - - - - RFC: - - - - =Parameters!ClienteRFC.Value - - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - Logo2 - FitProportional - 9.09616cm - 14.88948cm - 1.14078cm - 5.16751cm - 53 - - - - - - 18.64141cm - - - - - - - - =Today - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0.5cm - 0.5cm - 1cm - 0.5cm - 1.27cm - @@ -11,9 +19,59 @@ Catálogo de periodos + + +
  • + Agregar +
  • +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    +
    Tipo Periodo:
    +
    + + + + + +
    +
    Ejercicio:
    +
    + + +
    + +
    Estatus:
    +
    + + + + + +
    + + +
    + +
    +
    + +
    +
    +
    @@ -129,97 +187,10 @@
    Comandos
    - - - - - - - - <%-- - --%> - - - <%-- - --%> - - - - - - -
    - - - - -
    - - - - - - - - -
    -
    - - - - -
    - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - + @@ -341,8 +312,6 @@ - - @@ -359,15 +328,9 @@ --%> - -
    - - -
    -
    - +
    @@ -386,6 +349,121 @@
    + diff --git a/Nomina/CatPeriodos.aspx.vb b/Nomina/CatPeriodos.aspx.vb index a2fff6cc9..9703cb742 100644 --- a/Nomina/CatPeriodos.aspx.vb +++ b/Nomina/CatPeriodos.aspx.vb @@ -7,25 +7,33 @@ Imports Extensiones Partial Class Nomina_CatPeriodos Inherits ClsPaginas - - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + Private Property Comando As String + Get + Return ViewState("Comando").ToString + End Get + Set(value As String) + ViewState("Comando") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then ViewState("Orden") = "" - CargaDatos() - CargaTipoPeriodo() + CargaTipoPeriodo() + cargaEjercicios() + CargaDatos() - ''Permiso Registro - 'If PermisoRegistro Then - ' LbAgregar.Enabled = True - 'Else - ' LbAgregar.Enabled = False - 'End If - End If + ''Permiso Registro + 'If PermisoRegistro Then + ' LbAgregar.Enabled = True + 'Else + ' LbAgregar.Enabled = False + 'End If + End If End Sub Public Sub CargaDatos() Dim ObjNom_Periodos As New ClsNominas - If ObjNom_Periodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, Now.Year, -1, -1) Then + If ObjNom_Periodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlEjercicio.SelectedValue.ToEntero, -1, -1, DdlEstatus.SelectedValue.ToEntero) Then ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados @@ -42,44 +50,27 @@ Partial Class Nomina_CatPeriodos End If End Sub - Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click - Dim ObjNom_Periodos As New ClsNominas - Dim Numero As Integer = TxtNumero.Text.Trim.ToEntero - Dim EsInicioMes As Boolean = ChkEsInicioMes.Checked - Dim EsFinMes As Boolean = ChkEsFinMes.Checked - Dim EsInicioSS As Boolean = CBool(ChkEsInicioSS.Checked) - Dim EsFinSS As Boolean = ChkEsFinSS.Checked - Dim EsInicioAño As Boolean = ChkEsInicioAño.Checked - Dim EsFinAño As Boolean = ChkEsFinAño.Checked - Dim FueCalculado As Boolean = ChkFueCalculado.Checked - Dim FechaInicio As Date = TxtFechaInicio.Text.Trim.ToDate - Dim FechaFin As Date = TxtFechaFin.Text.Trim.ToDate - Dim Mes As Integer = FechaFin.Month - Dim Ejercicio As Integer = FechaFin.Year - Dim CveTipoPeriodo As Integer = DdlTipoPeriodo.SelectedValue.ToEntero - Dim Estatus As Integer = DdlEstatus.SelectedValue.ToEntero - - If ObjNom_Periodos.AddPeriodo(CveTipoPeriodo, Ejercicio, Mes, Numero, FechaInicio, FechaFin, EsInicioMes, EsFinMes, ChkEsInicioSS.Checked, ChkEsFinAño.Checked, ChkEsInicioAño.Checked, ChkEsFinAño.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - - Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion) - UpDatos.Update() - ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados - CargaDatos() - If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then - CargaGrid(ViewState("Orden").ToString()) - Else - CargaGrid("") - End If - - End If - 'ObjNom_Periodos.Dispose() - End Sub #Region " C O M B O S" Private Sub CargaTipoPeriodo() DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo + DdlTipoPeriodoAdd.DataSource = GlobalDTTipoPeriodo + DdlTipoPeriodo.DataBind() + DdlTipoPeriodoAdd.DataBind() + End Sub + + Private Sub cargaEjercicios() + Dim objconta As New ClsContabilidad + If objconta.GetEjercicios(UsuarioActual.CveEmpresa) Then + DdlEjercicio.DataSource = objconta.DtResultados + Else + DdlEjercicio.DataSource = Nothing + End If + objconta.Dispose() + DdlEjercicio.DataBind() + DdlEjercicio.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub #End Region @@ -120,12 +111,23 @@ Partial Class Nomina_CatPeriodos e.Row.Cells(12).HorizontalAlign = HorizontalAlign.Center e.Row.Cells(13).HorizontalAlign = HorizontalAlign.Center e.Row.Cells(14).HorizontalAlign = HorizontalAlign.Center - If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then - e.Row.FCDropDownList("DdlTipoPeriodo").DataSource = GlobalDTTipoPeriodo - e.Row.FCDropDownList("DdlTipoPeriodo").DataBind() - e.Row.FCDropDownList("DdlTipoPeriodo").SelectedValue = e.Row.DBCampo("CveTipoPeriodo") - e.Row.FCDropDownList("DdlEstatus").SelectedItem.Text = e.Row.DBCampo("Estatus") + + e.Row.FCCheckBox("ChkEsInicioMes").Checked = Convert.ToBoolean(e.Row.DataKey("EsInicioMes").ToString) + e.Row.FCCheckBox("ChkEsFinMes").Checked = Convert.ToBoolean(e.Row.DataKey("EsFinMes").ToString) + e.Row.FCCheckBox("ChkEsInicioSS").Checked = Convert.ToBoolean(e.Row.DataKey("EsInicioSS").ToString) + e.Row.FCCheckBox("ChkEsFinSS").Checked = Convert.ToBoolean(e.Row.DataKey("EsFinSS").ToString) + e.Row.FCCheckBox("ChkEsInicioAño").Checked = Convert.ToBoolean(e.Row.DataKey("EsInicioAño").ToString) + e.Row.FCCheckBox("ChkEsFinAño").Checked = Convert.ToBoolean(e.Row.DataKey("EsFinAño").ToString) + e.Row.FCCheckBox("ChkFueCalculado").Checked = Convert.ToBoolean(e.Row.DataKey("FueCalculado").ToString) + + If e.Row.DataKey("Estatus").ToString.ToEntero = 1 Then + e.Row.FCLiteral("LtlEstatus").Text = "Actual" + ElseIf e.Row.DataKey("Estatus").ToString.ToEntero = 2 Or e.Row.DataKey("Estatus").ToString.ToEntero = 3 Then + e.Row.FCLiteral("LtlEstatus").Text = "Cerrado" + Else + e.Row.FCLiteral("LtlEstatus").Text = "" End If + End If End Sub @@ -156,51 +158,7 @@ Partial Class Nomina_CatPeriodos End If End Sub - Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating - Dim ObjNom_Periodos As New ClsNominas - Dim Numero As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtNumero"), TextBox).Text.Trim.ToEntero - Dim EsInicioMes As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsInicioMes").Checked - Dim EsFinMes As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsFinMes").Checked - Dim EsInicioSS As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsInicioSS").Checked - Dim EsFinSS As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsFinSS").Checked - Dim EsInicioAño As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsInicioAño").Checked - Dim EsFinAño As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsFinAño").Checked - Dim FueCalculado As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkFueCalculado").Checked - Dim FechaInicio As Date = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFechaInicio"), TextBox).Text.Trim.ToDateTime - Dim FechaFin As Date = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFechaFin"), TextBox).Text.Trim.ToDateTime - Dim Mes As Integer = FechaFin.Month - Dim Ejercicio As Integer = FechaFin.Year - Dim CveTipoPeriodo As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlTipoPeriodo"), DropDownList).SelectedValue.ToEntero - Dim Estatus As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlEstatus"), DropDownList).SelectedValue.ToEntero - Dim CvePeriodo As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero - - If ObjNom_Periodos.UpdatePeriodo(FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado, - CveTipoPeriodo, Ejercicio, Mes, Numero, Estatus, CvePeriodo, UsuarioActual.CveEmpresa) Then - GvDatos.EditIndex = -1 - ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados - Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) - End If - - ObjNom_Periodos.Dispose() - - If ViewState("Orden").ToString() <> String.Empty Then - CargaGrid(ViewState("Orden").ToString()) - Else - CargaGrid("") - End If - - End Sub - - Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing - GvDatos.EditIndex = e.NewEditIndex - If ViewState("Orden").ToString() <> String.Empty Then - CargaGrid(ViewState("Orden").ToString()) - Else - CargaGrid("") - End If - End Sub #End Region #Region "O R D E N A M I E N T O" @@ -239,4 +197,151 @@ Partial Class Nomina_CatPeriodos UpDatos.Update() End Sub #End Region + + Private Sub LnkAddPeriodo_Click(sender As Object, e As EventArgs) Handles LnkAddPeriodo.Click + LimpiarModal() + Comando = "Agregar" + lblTiulomodal.Text = "Agregar Periodo" + RegistraScript("$('#divAddPeriodo').modal('show');") + End Sub + Protected Sub BtnAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregar.Click + Dim ObjNom_Periodos As New ClsNominas + + Dim EsInicioMes As Boolean + Dim EsFinMes As Boolean + Dim EsInicioSS As Boolean + Dim EsFinSS As Boolean + Dim EsInicioAño As Boolean + Dim EsFinAño As Boolean + Dim FueCalculado As Boolean + Dim Numero As Integer = TxtNumeroAdd.Text.Trim.ToEntero + Dim FechaInicio As Date = TxtFechaInicioAdd.Text.Trim.ToDate + Dim FechaFin As Date = TxtFechaFinAdd.Text.Trim.ToDate + Dim Mes As Integer = FechaFin.Month + Dim Ejercicio As Integer = FechaFin.Year + Dim CveTipoPeriodo As Integer = DdlTipoPeriodoAdd.SelectedValue.ToEntero + Dim Estatus As Integer = DdlEstatusAdd.SelectedValue.ToEntero + Dim CvePeriodo As Integer = hdnCvePerido.Value.ToEntero + + For Each item As ListItem In CBLchk.Items + Select Case item.Value.ToEntero() + Case 1 + If item.Selected Then EsInicioMes = True Else EsInicioMes = False + Case 2 + If item.Selected Then EsFinMes = True Else EsFinMes = False + Case 3 + If item.Selected Then EsInicioSS = True Else EsInicioSS = False + Case 4 + If item.Selected Then EsFinSS = True Else EsFinSS = False + Case 5 + If item.Selected Then EsInicioAño = True Else EsInicioAño = False + Case 6 + If item.Selected Then EsFinAño = True Else EsFinAño = False + Case 7 + If item.Selected Then FueCalculado = True Else FueCalculado = False + End Select + Next + If Comando = "Agregar" Then + + If ObjNom_Periodos.AddPeriodo(CveTipoPeriodo, Ejercicio, Mes, Numero, FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + + Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion) + UpDatos.Update() + ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados + CargaDatos() + If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then + CargaGrid(ViewState("Orden").ToString()) + Else + CargaGrid("") + End If + + End If + ElseIf Comando = "Actualizar" Then + + If ObjNom_Periodos.UpdatePeriodo(FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado, CveTipoPeriodo, Ejercicio, Mes, Numero, Estatus, CvePeriodo, UsuarioActual.CveEmpresa) Then + + Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + UpDatos.Update() + ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados + CargaDatos() + If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then + CargaGrid(ViewState("Orden").ToString()) + Else + CargaGrid("") + End If + End If + + End If + + + RegistraScript("$('#divAddPeriodo').modal('hide');") + + 'ObjNom_Periodos.Dispose() + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click + CargaDatos() + End Sub + Protected Sub LnkEditar_Click(sender As Object, e As EventArgs) + LimpiarModal() + Comando = "Actualizar" + lblTiulomodal.Text = "Actualizar Periodo" + Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + DdlTipoPeriodoAdd.SelectedValueExist(GvRow.DataKey("CveTipoPeriodo").ToString.ToEntero) + TxtNumeroAdd.Text = GvRow.DataKey("Numero").ToString + TxtFechaInicioAdd.Text = GvRow.DataKey("FechaInicio").ToString + TxtFechaFinAdd.Text = GvRow.DataKey("FechaFin").ToString + DdlEstatusAdd.SelectedValueExist(GvRow.DataKey("Estatus").ToString.ToEntero) + hdnCvePerido.Value = GvRow.DataKey("CvePeriodo").ToString + For Each item As ListItem In CBLchk.Items + Select Case item.Value.ToEntero() + Case 1 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsInicioMes").ToString) + Case 2 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsFinMes").ToString) + Case 3 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsInicioSS").ToString) + Case 4 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsFinSS").ToString) + Case 5 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsInicioAño").ToString) + Case 6 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsFinAño").ToString) + Case 7 + item.Selected = Convert.ToBoolean(GvRow.DataKey("FueCalculado").ToString) + End Select + Next + UpModalPerido.Update() + + RegistraScript("$('#divAddPeriodo').modal('show')") + End Sub + + Private Sub LimpiarModal() + DdlTipoPeriodoAdd.SelectedValueExist(-1) + TxtNumeroAdd.Text = "" + TxtFechaInicioAdd.Text = "" + TxtFechaFinAdd.Text = "" + DdlEstatusAdd.SelectedValueExist(-1) + For Each item As ListItem In CBLchk.Items + Select Case item.Value.ToEntero() + Case 1 + item.Selected = False + Case 2 + item.Selected = False + Case 3 + item.Selected = False + Case 4 + item.Selected = False + Case 5 + item.Selected = False + Case 6 + item.Selected = False + Case 7 + item.Selected = False + End Select + Next + UpModalPerido.Update() + End Sub End Class From 5772bdf068ee8ffbe67d450bd6de3bc2ac2b1996 Mon Sep 17 00:00:00 2001 From: Hector Date: Fri, 30 Jul 2021 16:37:31 -0700 Subject: [PATCH 27/44] cambio en ejercicios --- Nomina/CatPeriodos.aspx.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Nomina/CatPeriodos.aspx.vb b/Nomina/CatPeriodos.aspx.vb index 9703cb742..5ce0f941e 100644 --- a/Nomina/CatPeriodos.aspx.vb +++ b/Nomina/CatPeriodos.aspx.vb @@ -61,13 +61,13 @@ Partial Class Nomina_CatPeriodos End Sub Private Sub cargaEjercicios() - Dim objconta As New ClsContabilidad - If objconta.GetEjercicios(UsuarioActual.CveEmpresa) Then - DdlEjercicio.DataSource = objconta.DtResultados + Dim ObjNom_Periodos As New ClsNominas + If ObjNom_Periodos.GetEjercicios(UsuarioActual.CveEmpresa) Then + DdlEjercicio.DataSource = ObjNom_Periodos.DtResultados Else DdlEjercicio.DataSource = Nothing End If - objconta.Dispose() + ObjNom_Periodos.Dispose() DdlEjercicio.DataBind() DdlEjercicio.Items.Insert(0, New ListItem("Todos", "-1")) From 43621476375a341b76df4b8ee1a5a00e40295d36 Mon Sep 17 00:00:00 2001 From: rrene Date: Fri, 30 Jul 2021 19:18:58 -0700 Subject: [PATCH 28/44] -- columna codigo,CPK para empresa acumuladora --- Ventas/ActualizarPrecios.aspx | 5 +++-- Ventas/ActualizarPrecios.aspx.vb | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Ventas/ActualizarPrecios.aspx b/Ventas/ActualizarPrecios.aspx index 831afae7e..20890b2fc 100644 --- a/Ventas/ActualizarPrecios.aspx +++ b/Ventas/ActualizarPrecios.aspx @@ -161,8 +161,9 @@ - - + + + diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index d3a8d25d2..3093d872a 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -175,7 +175,13 @@ Partial Class Ventas_ActualizarPrecios CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then GVPrecios.DataSource = objPS.DtResultados End If - objPS.Dispose() + objPS.Dispose() + + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + GVPrecios.Columns(2).Visible = True + End If + + dvDatos.Visible = True GVPrecios.DataBind() From b5b497430054fe5b5d3fdfe634cb58b56e37c0d0 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 30 Jul 2021 20:41:43 -0700 Subject: [PATCH 29/44] GvPS se agrega columna de porcentaje de IEPS --- Compras/Compras.aspx | 28 +++++++++++++++++++--------- Compras/Compras.aspx.vb | 19 ++++++++++--------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index f25ecfa5d..90b1948f5 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -689,6 +689,7 @@ P.U.  % IVA  + % IEPS  Total 
    ¿No Deducible?  @@ -792,53 +793,62 @@ - <%-- 9 --%> - + <%-- 9 --%> + + + + + + + <%-- 10 --%> + + + <%-- 11 --%> - <%-- 11 --%> + <%-- 12 --%> - <%-- 12 --%> + <%-- 13 --%> - <%-- 13 --%> + <%-- 14 --%> - <%-- 14 --%> + <%-- 15 --%> - <%-- 15 --%> + <%-- 16 --%> - <%-- 16 --%> + <%-- 17 --%> - <%-- 17 --%> + <%-- 18 --%> diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index f0e41fc77..6b1c3d08d 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -11022,11 +11022,12 @@ Partial Class Compras_Compras 'e.Row.Cells(11).Width = Unit.Pixel(43) If UsuarioActual.Empresa.UsaAC Then 'AndAlso (CveFactura > 0 Or CveCompra > 0) - e.Row.Cells(12).Width = Unit.Pixel(150) e.Row.Cells(13).Width = Unit.Pixel(150) e.Row.Cells(14).Width = Unit.Pixel(150) e.Row.Cells(15).Width = Unit.Pixel(150) - e.Row.Cells(16).Width = Unit.Pixel(100) + e.Row.Cells(16).Width = Unit.Pixel(150) + e.Row.Cells(17).Width = Unit.Pixel(150) + e.Row.Cells(18).Width = Unit.Pixel(100) End If End If @@ -11127,11 +11128,11 @@ Partial Class Compras_Compras 'CargaPresupuestosEgresos If UsuarioActual.Empresa.UsaAC Then - e.Row.Cells(13).Visible = True e.Row.Cells(14).Visible = True e.Row.Cells(15).Visible = True e.Row.Cells(16).Visible = True e.Row.Cells(17).Visible = True + e.Row.Cells(18).Visible = True e.Row.FCDropDownList("DdlAC1").Items.Clear() e.Row.FCDropDownList("DdlAC1").DataSource = DtPresupuestos.FiltraParametros("", DistinctColumns:={"CveProgramaOperativo", "ProgramaOperativo"}) @@ -11162,19 +11163,19 @@ Partial Class Compras_Compras 'SI EL PRESUPUESTO DE EGRESOS VIENE DESDE LA OC, SE BLOQUEA PE If e.Row.DBCampo("CveOrdenCompraDetalle").ToEntero > 0 AndAlso e.Row.DBCampo("CvePresupuestoEgreso").ToEntero > 0 Then - e.Row.Cells(13).Enabled = False e.Row.Cells(14).Enabled = False e.Row.Cells(15).Enabled = False e.Row.Cells(16).Enabled = False e.Row.Cells(17).Enabled = False + e.Row.Cells(18).Enabled = False End If Else - e.Row.Cells(13).Visible = False e.Row.Cells(14).Visible = False e.Row.Cells(15).Visible = False e.Row.Cells(16).Visible = False e.Row.Cells(17).Visible = False + e.Row.Cells(18).Visible = False End If End If @@ -13291,11 +13292,11 @@ Partial Class Compras_Compras 'Seccion Grid GvPS.Width = 1760 - GvPS.Columns(12).Visible = True GvPS.Columns(13).Visible = True GvPS.Columns(14).Visible = True GvPS.Columns(15).Visible = True GvPS.Columns(16).Visible = True + GvPS.Columns(17).Visible = True 'Panel General UpPresupuestosAC.Visible = True @@ -17506,7 +17507,7 @@ Partial Class Compras_Compras CargaRetISRConcepto() Dim NumNoDed As Integer = TmpDT.COUNT("CvePS", "NoDeducible = True ") - If NumNoDed > 0 Then GvPS.Columns(10).Visible = True 'visualiza columnas de nodeducibles + If NumNoDed > 0 Then GvPS.Columns(11).Visible = True 'visualiza columnas de nodeducibles If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") Then InicializaAplicaNCFact() @@ -20506,12 +20507,12 @@ Partial Class Compras_Compras If ChkEsNoDeducible.Checked Then EsNoDeducible = True dvNoDeducible.Visible = True - GvPS.Columns(10).Visible = True + GvPS.Columns(11).Visible = True UpEsNoDeduciblePS.Visible = True Else EsNoDeducible = False dvNoDeducible.Visible = False - GvPS.Columns(10).Visible = False + GvPS.Columns(11).Visible = False UpEsNoDeduciblePS.Visible = False End If 'DivEsNoDeducible.Visible = False From d59dc01317c93cdec2ea0e4afbe8631f4eb5c019 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 30 Jul 2021 21:54:30 -0700 Subject: [PATCH 30/44] Correcion en cancelacion de usados --- App_Code/Modelos.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index e4f5db821..b36f28a44 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2099,7 +2099,7 @@ Namespace Modelos For Each drow As DataRow In factura.DtDetalle.Rows If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then - If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario, + If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "") Then Resultado = False Exit For @@ -2158,7 +2158,7 @@ Namespace Modelos If factura.Cliente.EsDistribuidor AndAlso factura.CveConceptoMovimiento = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then - If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario, + If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Dr("Cantidad").ToString.ToDecimal(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then ' Mensaje = "Error al guardar Movimientos de distribuidor" Resultado = False From a25faf66d709cb1b1115bac2646bcba48d724253 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Sat, 31 Jul 2021 00:41:38 -0700 Subject: [PATCH 31/44] valida IEPSPorcentaje nulo --- Compras/Compras.aspx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 90b1948f5..ca2f18d1d 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -687,9 +687,9 @@
    - P.U.  - % IVA  - % IEPS  + P.U.  + % IVA  + % IEPS  Total 
    ¿No Deducible?  @@ -788,15 +788,16 @@ <%-- 7 --%> <%-- 8 --%> - + <%-- 9 --%> - - - + + + + <%----%> From 9bc17178ac8565ce0fd5c0d5220cf050b89097f1 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 31 Jul 2021 09:35:44 -0700 Subject: [PATCH 32/44] - --- Ventas/ProductosServicios.aspx | 2 +- Ventas/ProductosServicios.aspx.vb | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index c9d4bb2ae..da6216dcc 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -133,7 +133,7 @@
    - + diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index bc7e20c47..be2d00b05 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -251,6 +251,10 @@ Partial Class ProductosyServicios 'DdlTipoPSDes.Attributes.Add("onChange", "CreaDescripcionPS();") End If + If UsuarioActual.CveEmpresa.Contiene(72, 80) Then + TxtPS.CssClass = "form-control Mayuscula" + End If + If UsuarioActual.CveEmpresa.Contiene(72, 80) And CvePS = -1 Then 'DivDatos.Attributes("class") = "col-md-12" @@ -1327,9 +1331,9 @@ Partial Class ProductosyServicios End If Else - If CodigoBarrasCargado.Length > 0 And TxtCodigoBarras.Text.Length = 0 Then - TxtCodigoBarras.Text = CodigoBarrasCargado - End If + 'If CodigoBarrasCargado.Length > 0 And TxtCodigoBarras.Text.Length = 0 Then 'RMF.2021.07.30, se comentó, por no entender la validaci´n, y nodeja limpiar codigos + ' TxtCodigoBarras.Text = CodigoBarrasCargado + 'End If Dim PSS As String = TxtPS.Text.Trim.Replace("|", "") If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then PSS = PSS.ToUpper From 4c3b3d75cbea5368b00d2f0cf85fa7bc96ad5f88 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 31 Jul 2021 09:53:55 -0700 Subject: [PATCH 33/44] extensiones y path --- Ventas/Ventas.aspx.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 68d69336d..b9521be42 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -22754,8 +22754,8 @@ Partial Class Ventas Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo, file.FileUrl) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) From fbde0a2e581cf4211d13d4e4525e6246ba6e97ea Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 31 Jul 2021 09:54:05 -0700 Subject: [PATCH 34/44] Ruta personalizada por Empresa --- AF/AF.aspx.vb | 12 +- AF/ResguardoAF.aspx.vb | 18 +- AIMMGM/ConsultaCliente.aspx.vb | 14 +- AIMMGM/Pagos.aspx.vb | 2 +- AIMMGM/Registro.aspx.vb | 2 +- AIMMGM/ePagos.aspx.vb | 2 +- App_Code/ClsPaginas.vb | 74 +- App_Code/ClsSisEmpresas.vb | 4 +- App_Code/Empresa.vb | 9 +- Ashx/SIGCRM.ashx | 2 +- Bancos/IE.aspx.vb | 7 +- Bancos/PagoAcreedor.aspx.cs | 4 +- Bancos/PagoDeudor.aspx.cs | 4 +- Bancos/PolizaCheque.aspx.vb | 2 +- Bancos/PopIEVentas.aspx.vb | 2 - Bancos/PrestamoPersonal.aspx.cs | 4 +- Bancos/ProveedoresAbonar.aspx.vb | 2 +- Bancos/RepCobrado.aspx.vb | 2 +- Bancos/RepCobradoDetalle.aspx.vb | 2 +- Bancos/RepIE.aspx.vb | 2 +- CRM/Acercamiento.aspx.cs | 2 +- Compras/Compras.aspx.vb | 8 +- Compras/PopUpVerFactura.aspx.vb | 8 +- Compras/Proveedores.aspx.vb | 6 +- Compras/RepComprasAFDetalle.aspx.vb | 2 +- Compras/RepCxPPeriodo.aspx.cs | 2 +- Compras/RepGastosFijos.aspx.cs | 6 +- Compras/RepPagado.aspx.cs | 2 +- Compras/RepPagadoDetalle.aspx.cs | 2 +- Compras/RepPagadoPeriodo.aspx.cs | 2 +- Compras/eFacturas.aspx.vb | 20 +- Contabilidad/RegPrePoliza.aspx.vb | 9 +- Contratos/Contrato.aspx.vb | 16 +- Contratos/Contrato.vb | 12 +- Contratos/ContratoObra.aspx.vb | 4864 ++++++++++++----------- CxC/RepCxCPeriodo.aspx.cs | 2 +- GPS/CatDistribuidoresMaster.aspx.vb | 10 +- General/RepPaqueteriasGuias.aspx.cs | 2 +- Inventarios/PopUpBuscarMovto.aspx.vb | 2 +- Inventarios/RecepcionAlmacen.aspx.vb | 4 +- Inventarios/RepConsumoInterno.aspx.cs | 2 +- Inventarios/RepEntradasSalidas.aspx.vb | 2 +- Inventarios/RepEntregasForaneas.aspx.vb | 2 +- Nomina/Finiquito.aspx.cs | 2 +- Nomina/Nomina.aspx.cs | 6 +- OC/CotizacionEnLinea.aspx.vb | 6 +- OC/ListaRequisicion.aspx.cs | 2 +- OC/PopUpBuscarReq.aspx.vb | 2 +- OC/RepCotizacionesDetalle.aspx.vb | 12 +- OI/CircularDetalle.aspx.vb | 2 +- OI/CircularDetalleB.aspx.cs | 2 +- OI/DocumentoDetalle.aspx.cs | 2 +- OI/Documentos.aspx.cs | 2 +- OI/EventoComentario.aspx.vb | 30 +- OI/PopUpAgenda.aspx.vb | 16 +- Planeacion/CargarArchivo.aspx.vb | 6 +- Planeacion/CargarImagen.aspx.vb | 6 +- Planeacion/Sucursal.aspx.vb | 2 +- PortalCliente/PortalCliente.aspx.vb | 4 +- PortalProveedor/PortalProveedor.aspx.vb | 2 +- Proveedores/PortalProveedor.aspx.vb | 2 +- PyME/Sistemas/WizardRegistro.aspx.vb | 2 +- RH/CatCursos.aspx.vb | 4 +- RH/MiPerfil.aspx.vb | 2 +- RH/Personal.aspx.vb | 26 +- RH/RepBuzonCalidad.aspx.vb | 2 +- Sistemas/Empresa.aspx.vb | 13 +- Site.master.vb | 2 +- Ventas/Clientes.aspx.vb | 14 +- Ventas/ClientesAbonar.aspx.vb | 6 +- Ventas/PV.aspx.vb | 2 +- Ventas/PopUpBuscarFolio.aspx.vb | 2 +- Ventas/PopUpImprimir.aspx.vb | 2 +- Ventas/ProductosServicios.aspx.vb | 4 +- Ventas/RepPS.aspx.vb | 4 +- Ventas/RepRecuperacionDetalle.aspx.vb | 2 +- Ventas/Ventas.aspx | 2 +- Ventas/Ventas.aspx.vb | 37 +- Ventas/eFacturas.aspx.vb | 6 +- 79 files changed, 2710 insertions(+), 2685 deletions(-) diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index d2779e6d3..5c2f76690 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -877,7 +877,7 @@ Partial Class AF_AF Filename = fileItem.filename Next - Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Licencias\{1}", ModExtensiones.DirectorioBaseEmpresas, Filename)) + Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Licencias\{1}", UsuarioActual.Empresa.Ruta, Filename)) If Archivo.Exists() Then Archivo.Delete() End If @@ -940,7 +940,7 @@ Partial Class AF_AF extencion = array(array.Length - 1) End If - If Adjunto.Trim.Length > 0 Then + If Adjunto.Trim.Length > 0 Then Dim linkDescarga = "/Empresas/" & UsuarioActual.Empresa.CveEmpresa & "/AF/Polizas/" & Adjunto & "." & extencion Dim linkDescargaArchivo = UsuarioActual.Empresa.Ruta & "AF/Polizas/" & Adjunto & "." & extencion @@ -1030,13 +1030,13 @@ Partial Class AF_AF Filename = fileItem.filename Next - Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Polizas\{1}", AppDomain.CurrentDomain.BaseDirectory, Filename)) + Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Polizas\{1}", UsuarioActual.Empresa.Ruta, Filename)) If Archivo.Exists() Then Archivo.Delete() End If If Filename <> "" Then - Filename.FilesMove(String.Format("{0}", Archivo.Name), String.Format("Empresas\{0}\AF\Polizas", UsuarioActual.CveEmpresa)) + Filename.FilesMove(String.Format("{0}", Archivo.Name), String.Format("{0}AF\Polizas", UsuarioActual.Empresa.Ruta)) End If If HdnModalidadPoliza.Value = "A" Then @@ -2022,7 +2022,7 @@ Partial Class AF_AF Dim DirectorioOld As New StringBuilder Dim DirectorioNew As New StringBuilder DirectorioOld.AppendFormat("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, FileMove) - DirectorioNew.AppendFormat("{0}Empresas\{1}\AF\", ModExtensiones.DirectorioBaseEmpresas, CveEmpresaActual) + DirectorioNew.AppendFormat("{0}AF\", UsuarioActual.Empresa.Ruta) If Not Directory.Exists(DirectorioNew.ToString) Then Directory.CreateDirectory(DirectorioNew.ToString) End If @@ -2054,7 +2054,7 @@ Partial Class AF_AF If (CveImagenActivoFijo > 0) Then Dim ObjActivoFijo As New ClsAF If ObjActivoFijo.RemoveActivosFijosImagenes(CveImagenActivoFijo) Then - File.Delete(String.Format("{0}Empresas\{1}\{2}", ModExtensiones.DirectorioBaseEmpresas, CveEmpresaActual, ObjActivoFijo.DtResultados.Rows(0)("URL"))) + File.Delete(String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjActivoFijo.DtResultados.Rows(0)("URL"))) CargarArchivo() RegistraScript("initcarusel();") End If diff --git a/AF/ResguardoAF.aspx.vb b/AF/ResguardoAF.aspx.vb index 5f48d7542..86984d0f8 100644 --- a/AF/ResguardoAF.aspx.vb +++ b/AF/ResguardoAF.aspx.vb @@ -542,10 +542,10 @@ Partial Class AF_ResguardoAF If EsLiberacion Then If objAF.UpdateActivosFijosResguardosURL($"AFR{CveResguardoPadre}.{FileExtension}", "-1", CveResguardoPadre) Then If filemove <> "" Then - If File.Exists(String.Format("{2}Empresas\{0}\AF\Resguardos\AFR{1}.{3}", UsuarioActual.CveEmpresa, CveResguardoPadre, ModExtensiones.DirectorioBaseEmpresas, FileExtension)) Then - File.Delete(String.Format("{2}Empresas\{0}\AF\Resguardos\AFR{1}.{3}", UsuarioActual.CveEmpresa, CveResguardoPadre, ModExtensiones.DirectorioBaseEmpresas, FileExtension)) + If File.Exists(String.Format("{0}\AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) Then + File.Delete(String.Format("{0}AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) End If - If filemove.FilesMove(String.Format("AFR{0}", CveResguardoPadre), String.Format("Empresas\{0}\AF\Resguardos", UsuarioActual.CveEmpresa)) Then + If filemove.FilesMove(String.Format("AFR{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta)) Then HuboError = False Else HuboError = True @@ -558,10 +558,10 @@ Partial Class AF_ResguardoAF If EsURL2 Then If objAF.UpdateActivosFijosResguardosURLGpo("-1", $"AFT{CveResguardoPadre}.{FileExtension}", CveResguardoPadre) Then If filemove <> "" Then - If File.Exists(String.Format("{2}Empresas\{0}\AF\Resguardos\AFR{1}.{3}", UsuarioActual.CveEmpresa, CveResguardoPadre, ModExtensiones.DirectorioBaseEmpresas, FileExtension)) Then - File.Delete(String.Format("{2}Empresas\{0}\AF\Resguardos\AFR{1}.{3}", UsuarioActual.CveEmpresa, CveResguardoPadre, ModExtensiones.DirectorioBaseEmpresas, FileExtension)) + If File.Exists(String.Format("{0}AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) Then + File.Delete(String.Format("{0}AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) End If - If filemove.FilesMove(String.Format("AFT{0}", CveResguardoPadre), String.Format("Empresas\{0}\AF\Resguardos", UsuarioActual.CveEmpresa)) Then + If filemove.FilesMove(String.Format("AFT{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta)) Then HuboError = False Else HuboError = True @@ -575,10 +575,10 @@ Partial Class AF_ResguardoAF If objAF.UpdateActivosFijosResguardosURLGpo($"AFR{CveResguardoPadre}.{FileExtension}", "-1", CveResguardoPadre) Then If filemove <> "" Then - If File.Exists(String.Format("{2}Empresas\{0}\AF\Resguardos\AFR{1}.{3}", UsuarioActual.CveEmpresa, CveResguardoPadre, ModExtensiones.DirectorioBaseEmpresas, FileExtension)) Then - File.Delete(String.Format("{2}Empresas\{0}\AF\Resguardos\AFR{1}.{3}", UsuarioActual.CveEmpresa, CveResguardoPadre, ModExtensiones.DirectorioBaseEmpresas, FileExtension)) + If File.Exists(String.Format("{0}AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) Then + File.Delete(String.Format("{0}AF\Resguardos\AFR{1}.{2}", UsuarioActual.Empresa.Ruta, CveResguardoPadre, FileExtension)) End If - If filemove.FilesMove(String.Format("AFR{0}", CveResguardoPadre), String.Format("Empresas\{0}\AF\Resguardos", UsuarioActual.CveEmpresa)) Then + If filemove.FilesMove(String.Format("AFR{0}", CveResguardoPadre), String.Format("{0}AF\Resguardos", UsuarioActual.Empresa.Ruta)) Then HuboError = False Else HuboError = True diff --git a/AIMMGM/ConsultaCliente.aspx.vb b/AIMMGM/ConsultaCliente.aspx.vb index 29c856863..1264906e2 100644 --- a/AIMMGM/ConsultaCliente.aspx.vb +++ b/AIMMGM/ConsultaCliente.aspx.vb @@ -648,14 +648,14 @@ Partial Class AIMMGM_ConsultaCliente End If Dim AIM As New ClsAIMMGM - If Not IO.Directory.Exists(String.Format("{0}\Empresas\{1}\Documentos", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) Then - IO.Directory.CreateDirectory(String.Format("{0}\Empresas\{1}\Documentos", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) + If Not IO.Directory.Exists(String.Format("{0}Documentos", UsuarioActual.Empresa.Ruta)) Then + IO.Directory.CreateDirectory(String.Format("{0}Documentos", UsuarioActual.Empresa.Ruta, UsuarioActual.CveEmpresa)) End If Dim Cve As Integer = AIM.AddPago(CveCliente, CveVentaDetalle, TxtImporte.Text.ToDouble, 1, TxtFecha.Text.ToDate, IO.Path.GetExtension(FUComprobante.FileName), TxtObservaciones.Text.Trim, 9999, TxtAprobacion.Text.ToEntero) If Cve > 0 Then - FUComprobante.SaveAs(String.Format("{0}/Empresas/{1}/Documentos/{2}{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Cve, IO.Path.GetExtension(FUComprobante.FileName))) + FUComprobante.SaveAs(String.Format("{0}Documentos/{1}{2}", UsuarioActual.Empresa.Ruta, Cve, IO.Path.GetExtension(FUComprobante.FileName))) Alert("Pago ingresado correctamente", TipoMensaje.MsgInformacion) End If AIM.Dispose() @@ -669,8 +669,8 @@ Partial Class AIMMGM_ConsultaCliente Exit Sub End If 'obtengo la clave de la publicidad - If Not IO.Directory.Exists(String.Format("{0}\Empresas\{1}\Documentos", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) Then - IO.Directory.CreateDirectory(String.Format("{0}\Empresas\{1}\Documentos", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) + If Not IO.Directory.Exists(String.Format("{0}Documentos", UsuarioActual.Empresa.Ruta)) Then + IO.Directory.CreateDirectory(String.Format("{0}Documentos", UsuarioActual.Empresa.Ruta)) End If Dim Logo As String @@ -680,10 +680,10 @@ Partial Class AIMMGM_ConsultaCliente If AIM.DtResultados.Rows.Count > 0 Then CvePublicidad = AIM.DtResultados.Rows(0)("CvePublicidad").ToString.ToEntero Logo = String.Format("Logo{0}{1}", CvePublicidad, IO.Path.GetExtension(FULogo.FileName)) - FULogo.SaveAs(String.Format("{0}/Empresas/{1}/Documentos/{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Logo)) + FULogo.SaveAs(String.Format("{0}Documentos/{2}", UsuarioActual.Empresa.Ruta, Logo)) AIM.UpdateLogo(CvePublicidad, Logo) - ImgLogo.ImageUrl = String.Format("/Empresas/{0}/Documentos/{1}", UsuarioActual.CveEmpresa, Logo) + ImgLogo.ImageUrl = String.Format("{0}/Documentos/{1}", UsuarioActual.Empresa.Ruta, Logo) End If End If diff --git a/AIMMGM/Pagos.aspx.vb b/AIMMGM/Pagos.aspx.vb index 37f0c54a4..24ccdebfd 100644 --- a/AIMMGM/Pagos.aspx.vb +++ b/AIMMGM/Pagos.aspx.vb @@ -161,7 +161,7 @@ Partial Class AIMMGM_Pagos Next Next - Dim Archivoxlsx As String = String.Format("{0}/Empresas/{1}/Documentos/{2}.xlsx", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, NombreArchivoXLSX) + Dim Archivoxlsx As String = String.Format("{0}Documentos/{1}.xlsx", UsuarioActual.Empresa.Ruta, NombreArchivoXLSX) Using wb As New XLWorkbook() wb.Worksheets.Add(dtt) wb.SaveAs(Archivoxlsx) diff --git a/AIMMGM/Registro.aspx.vb b/AIMMGM/Registro.aspx.vb index cc37fbe2f..b0b5a6a05 100644 --- a/AIMMGM/Registro.aspx.vb +++ b/AIMMGM/Registro.aspx.vb @@ -125,7 +125,7 @@ Partial Class AIMMGM_Registro Private Sub CargaReCompra(ClavePago As String, CveCliente As Integer) Dim tmp As New DataTable - Dim Carpeta As String = String.Format("{0}AIMMGM/ePagos", ModExtensiones.DirectorioBaseEmpresas) + Dim Carpeta As String = String.Format("{0}AIMMGM/ePagos", UsuarioActual.Empresa.Ruta) Dim Archivo As String = String.Format("{0}/{1}.xml", Carpeta, ClavePago) Dim Archivo2 As String = String.Format("{0}/C{1}.xml", Carpeta, ClavePago) diff --git a/AIMMGM/ePagos.aspx.vb b/AIMMGM/ePagos.aspx.vb index 75fc0b45a..1e498a877 100644 --- a/AIMMGM/ePagos.aspx.vb +++ b/AIMMGM/ePagos.aspx.vb @@ -90,7 +90,7 @@ Partial Class AIMMGM_ePagos Private Sub CargaCompra() Dim tmp As New DataTable - Dim Carpeta As String = String.Format("{0}AIMMGM/ePagos", ModExtensiones.DirectorioBaseEmpresas) + Dim Carpeta As String = String.Format("{0}AIMMGM/ePagos", UsuarioActual.Empresa.Ruta) Dim Archivo As String = String.Format("{0}/{1}.xml", Carpeta, ClavePago) Dim Archivo2 As String = String.Format("{0}/C{1}.xml", Carpeta, ClavePago) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 9e898f86c..1d8d75be2 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5565,20 +5565,31 @@ Public Class ClsPaginas sw.Start() Dim Bytes As Byte() = Nothing + Dim CveUsuario As Integer = 0 + Dim CveEmpresa As Integer = 0 + Dim RutaEmpresa As String = "" + + If Context.Session("UsuarioSIG") IsNot Nothing Then + CveUsuario = UsuarioActual.CveUsuario + CveEmpresa = UsuarioActual.CveEmpresa + RutaEmpresa = UsuarioActual.Empresa.RutaArchivos + End If + Dim bdir As String = If(RutaReporte.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory) + + 'TOMAR LA RUTA BASE PARA EL DIRECTORIO DE LA EMPRESA + If Not String.IsNullOrEmpty(RutaEmpresa) AndAlso Not RutaReporte.Contains("Grales") Then + bdir = RutaEmpresa.Replace($"{CveEmpresa}/", "") + End If + RutaReporte.Replace("/", "\") + If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) End If If EsProduccion Then - Dim CveUsuario As Integer = 0 - Dim CveEmpresa As Integer = 0 - If Context.Session("UsuarioSIG") IsNot Nothing Then - CveUsuario = UsuarioActual.CveUsuario - CveEmpresa = UsuarioActual.CveEmpresa - End If Dim wsreport As New WSRDLC.WebServiceSoapClient Dim params As New List(Of WSRDLC.ReportParameter) Dim ds As New DataSet @@ -5963,11 +5974,11 @@ Public Class ClsPaginas #End Region #Region "IMPRIMIR FACTURA" - Public Sub PdfFacturaPyME(ByRef Vta As Modelos.Factura, DT As DataTable) + Public Sub PdfFacturaPyME(ByRef Vta As Modelos.Factura, DT As DataTable, Optional Guardar As Boolean = True) Dim retorno As Byte() = Nothing 'DATOS GENERALES - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta Dim PathXML As String = $"{Ruta}XML\{Vta.TipoDocto}\{Vta.SerieFolio}.xml" Dim NombreArchivo As String = "" Dim NombreArchivoDescarga As String = "" @@ -6456,26 +6467,27 @@ Public Class ClsPaginas DataSet.Tables.Add(Vta.DtDeduccion.Copy) If Archivo.Exists Then - - ImprimirbytesPDF(ImprimirPDFPyME(RutaFormato, DataSet, params, NombreArchivo, "PDF", MR:=Nothing), "Factura") - Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)) - If Not ArchivoPDF.Exists Then - Try - DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta)) - DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto)) - File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno) - Catch ex As Exception - Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia) - End Try - Else - Try - ArchivoPDF.Delete() - File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno) - Catch ex As Exception - Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia) - End Try + If Guardar Then + Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio)) + If Not ArchivoPDF.Exists Then + Try + DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta)) + DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto)) + File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno) + Catch ex As Exception + Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia) + End Try + Else + Try + ArchivoPDF.Delete() + File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno) + Catch ex As Exception + Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia) + End Try + End If End If + Else params.Add(New CrystalParametro("Empresa", UsuarioActual.Empresa.Empresa)) params.Add(New CrystalParametro("RFC", UsuarioActual.Empresa.RFC)) @@ -6493,7 +6505,7 @@ Public Class ClsPaginas ' Dim ObjVentas As New ClsVentas 'DATOS GENERALES - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta Dim PathXML As String = $"{Ruta}XML\{Vta.TipoDocto}\{Vta.SerieFolio}.xml" Dim NombreArchivo As String = "" Dim NombreArchivoDescarga As String = "" @@ -7913,7 +7925,7 @@ Public Class ClsPaginas Dim DTDeducciones As Data.DataTable Dim DTDeducciones2 As New Data.DataTable - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\" + Dim Ruta As String = RutaEmpresa Dim PathXML As String = $"{Ruta}XML\Nomina\{ObjNomina.Serie }{If(indemnizacion, "F", "")}-{ObjNomina.Folio}.xml" Dim FechaEmision, FechaCertificacion As DateTime Dim FolioFiscal, NoSerieCertificado, NoSerieCertificadoContribuyente, SelloCFDi, SelloSAT As String @@ -8278,7 +8290,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToString)) 'DATOS GENERALES - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta Dim PathXML As String = $"{Ruta}XML\Pag\{Serie}-{Folio}.xml" Dim PathPDF As String = $"{Ruta}PDF\Pag\{Serie}-{Folio}.pdf" SerieFolio = $"{Serie}-{Folio}" @@ -8413,8 +8425,8 @@ Public Class ClsPaginas End If - If File.Exists($"{UsuarioActual.Empresa.Ruta}\Formatos\ReciboDePago.rdlc") Then - rutaArchivo = $"Empresas\{UsuarioActual.CveEmpresa}\Formatos\ReciboDePago.rdlc" + If File.Exists($"{UsuarioActual.Empresa.Ruta}Formatos\ReciboDePago.rdlc") Then + rutaArchivo = $"{UsuarioActual.Empresa.Ruta}Formatos\ReciboDePago.rdlc" Else rutaArchivo = " \Empresas\Grales\Formatos\ReciboDePago.rdlc" End If diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb index 0e5c9d088..8712432be 100644 --- a/App_Code/ClsSisEmpresas.vb +++ b/App_Code/ClsSisEmpresas.vb @@ -465,7 +465,9 @@ Public Class ClsSisEmpresas _Empresa.CveEncuestaCRM = Data.Rows(0)("CveEncuestaCRM").ToString.ToEntero _Empresa.FielPassword = Data.Rows(0)("FielPassword").ToString - _Empresa.FielPFX = Data.Rows(0)("FielPFX").ToString + _Empresa.FielPFX = Data.Rows(0)("FielPFX").ToString + + _Empresa.RutaArchivos = Data.Rows(0)("RutaArchivos").ToString Else diff --git a/App_Code/Empresa.vb b/App_Code/Empresa.vb index 3e8120dd8..aeb1ff7b7 100644 --- a/App_Code/Empresa.vb +++ b/App_Code/Empresa.vb @@ -99,10 +99,15 @@ Public Class Empresa Public Property Soporte_USR As String Public Property Soporte_PWD As String Public Property Soporte_Tipo As String - Public Property Timbres As Integer + Public Property Timbres As Integer + Public Property RutaArchivos As String Public ReadOnly Property Ruta As String Get - Return String.Format("{0}\{1}\", Extensiones.ModExtensiones.DirectorioEmpresas, Me.CveEmpresa) + If Not String.IsNullOrEmpty(RutaArchivos) Then + Return RutaArchivos + Else + Return String.Format("{0}\{1}\", Extensiones.ModExtensiones.DirectorioEmpresas, Me.CveEmpresa) + End If End Get End Property Public Property IdCuentaIVAxTrasladar As Integer diff --git a/Ashx/SIGCRM.ashx b/Ashx/SIGCRM.ashx index dacdc1843..77aefdf0e 100644 --- a/Ashx/SIGCRM.ashx +++ b/Ashx/SIGCRM.ashx @@ -56,7 +56,7 @@ Public Class SIGCRM : Implements IHttpHandler, IRequiresSessionState Dim Usuario As Usuario = UsuarioActual(context) If Not IsNothing(Usuario) Then - Dim Url = String.Format("{0}\Empresas\{1}\Acercamientos\{2}\Imagenes\{3}", ModExtensiones.DirectorioBaseEmpresas, Usuario.CveEmpresa, CveAcercamiento, Archivo) + Dim Url = String.Format("{0}Acercamientos\{1}\Imagenes\{2}", Usuario.Empresa.Ruta, CveAcercamiento, Archivo) If File.Exists(Url) Then context.Response.ContentType = String.Format("image/{0}", Extension) diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index e0ef0f2ee..b2f5d6555 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -5028,8 +5028,8 @@ Partial Class Bancos_IE #Region " CARGAR - COMPROBANTE " Protected Sub BtnConfirmaComprobante_Click(sender As Object, e As EventArgs) - Dim DirectorioGuardar = String.Format("{0}Empresas\{1}\IE", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa) - Dim ArchivoTemporal = String.Format("{0}Empresas\{1}\Temp\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Session("FileUpload").ToString) + Dim DirectorioGuardar = String.Format("{0}IE", UsuarioActual.Empresa.Ruta) + Dim ArchivoTemporal = String.Format("{0}Temp\{1}", UsuarioActual.Empresa.Ruta, Session("FileUpload").ToString) If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ArchivoTemporal) Then Dim Extension As String = Path.GetExtension(ArchivoTemporal) @@ -5084,8 +5084,7 @@ Partial Class Bancos_IE Dim Path As String = HttpContext.Current.Request.ApplicationPath Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") - Path = Extensiones.DirectorioBaseEmpresas - Path += String.Format("Empresas/{0}/IE", UsuarioActual.CveEmpresa) + Path = String.Format("{0}IE", UsuarioActual.Empresa.Ruta) diff --git a/Bancos/PagoAcreedor.aspx.cs b/Bancos/PagoAcreedor.aspx.cs index fc91d55d9..0220112e6 100644 --- a/Bancos/PagoAcreedor.aspx.cs +++ b/Bancos/PagoAcreedor.aspx.cs @@ -321,7 +321,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); } decimal Importe; decimal ImporteMN; @@ -744,7 +744,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); } if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, false, Importe, Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedorPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteMN, TipoCambio: TC, TipoCambioPago: TC, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index e96343893..9176dded2 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -355,7 +355,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); } // SI ES DOLARES @@ -699,7 +699,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); } //GUARDA PREPOLIZAS DETALLE diff --git a/Bancos/PolizaCheque.aspx.vb b/Bancos/PolizaCheque.aspx.vb index ef2889275..ff500fbfe 100644 --- a/Bancos/PolizaCheque.aspx.vb +++ b/Bancos/PolizaCheque.aspx.vb @@ -1021,7 +1021,7 @@ Partial Class Bancos_PolizaCheque 'If Conta IsNot Nothing Then Conta.Commit() If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)) + filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta)) End If GeneraChequePDF(CveIE, UsuarioActual.Empresa, IDPoliza) diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb index 9f38b7a6d..94c1ebf6f 100644 --- a/Bancos/PopIEVentas.aspx.vb +++ b/Bancos/PopIEVentas.aspx.vb @@ -3467,8 +3467,6 @@ Partial Class Bancos_PopIEVentas PDFReciboDePagos(-1, -1, ObjBancos.CveComplementoPago, False) - Dim LigaDescargaXML = $"../Empresas/{UsuarioActual.CveEmpresa}/XML/Pag/{ObjBancos.ComplementoSerieFolio}.xml" - Dim LigaDescargaPDF = $"../Empresas/{UsuarioActual.CveEmpresa}/PDF/Pag/{ObjBancos.ComplementoSerieFolio}.pdf" Retorno.AppendFormat(" Complemento de pago {0}
    ", ObjBancos.ComplementoSerieFolio) Retorno.AppendFormat("XML    ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}&CveIE={2}", ObjBancos.ComplementoSerieFolio, ObjBancos.CveComplementoPago, CveIE))) Retorno.AppendFormat("PDF   ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}&CveIE={2}", ObjBancos.ComplementoSerieFolio, ObjBancos.CveComplementoPago, CveIE))) diff --git a/Bancos/PrestamoPersonal.aspx.cs b/Bancos/PrestamoPersonal.aspx.cs index 2ecb1b234..083e605c0 100644 --- a/Bancos/PrestamoPersonal.aspx.cs +++ b/Bancos/PrestamoPersonal.aspx.cs @@ -296,7 +296,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); } decimal Importe; decimal ImporteMN; @@ -590,7 +590,7 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas //GUARDA COMPROBANTE if (!filemove.Equals("")) { - filemove.FilesMove(CveIE.ToString(), string.Format(@"Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)); + filemove.FilesMove(CveIE.ToString(), string.Format(@"{0}IE", UsuarioActual.Empresa.Ruta)); } if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, Importe, Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancosPrestamo, -1, CveIE, CvePersonal: DdlFuncionarioEmpleadoPrestamo.SelectedValue.ToEntero(), ImporteMX: ImporteMN, TipoCambio: TC, TipoCambioPago:TC)) diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 056bb2fd1..55b03dca0 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -888,7 +888,7 @@ Partial Class Bancos_ProveedoresAbonar 'guardo el archivo If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)) + filemove.FilesMove(CveIE.ToString, String.Format("{0}\IE", UsuarioActual.Empresa.Ruta)) End If Anexo.Text = "" diff --git a/Bancos/RepCobrado.aspx.vb b/Bancos/RepCobrado.aspx.vb index 970fbe2e9..27bab7d10 100644 --- a/Bancos/RepCobrado.aspx.vb +++ b/Bancos/RepCobrado.aspx.vb @@ -134,7 +134,7 @@ Partial Class Ventas_RepRecuperacion If DdlCuentaBancaria.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Cuenta Bancaria: {0}", DdlCuentaBancaria.SelectedItem.Text) Dim RutaPDF As String - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta RutaPDF = $"{Ruta}\Formatos\RepRecuperacion.rdlc" If Not File.Exists(RutaPDF) Then RutaPDF = "Empresas/Grales/Formatos/RepRecuperacion.rdlc" diff --git a/Bancos/RepCobradoDetalle.aspx.vb b/Bancos/RepCobradoDetalle.aspx.vb index 16ad3e3ca..06560f929 100644 --- a/Bancos/RepCobradoDetalle.aspx.vb +++ b/Bancos/RepCobradoDetalle.aspx.vb @@ -193,7 +193,7 @@ Partial Class Ventas_RepRecuperacionDetalle If DdlProveedorSucursal.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Proveedor Sucursal: {0}", DdlProveedorSucursal.SelectedItem.Text) Dim RutaPDF As String - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta RutaPDF = $"{Ruta}\Formatos\RepRecuperacionDetalle.rdlc" If Not File.Exists(RutaPDF) Then RutaPDF = "Empresas/Grales/Formatos/RepRecuperacionDetalle.rdlc" diff --git a/Bancos/RepIE.aspx.vb b/Bancos/RepIE.aspx.vb index 9abca51fc..79f1f35ea 100644 --- a/Bancos/RepIE.aspx.vb +++ b/Bancos/RepIE.aspx.vb @@ -535,7 +535,7 @@ Partial Class Bancos_RepIE End Sub Private Sub Imprimir(Formato As String) - Dim LogoRutaFisica As String = String.Format("Empresas\{0}\Logo.png", UsuarioActual.CveEmpresa) + Dim LogoRutaFisica As String = String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta) Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}Logo.png", UsuarioActual.Empresa.Ruta)) diff --git a/CRM/Acercamiento.aspx.cs b/CRM/Acercamiento.aspx.cs index ad05f2e5d..03abe16fb 100644 --- a/CRM/Acercamiento.aspx.cs +++ b/CRM/Acercamiento.aspx.cs @@ -1448,7 +1448,7 @@ public partial class CRM_Acercamiento : ClsPaginas if ((CveArchivo > 0)) { string NombreNuevo = string.Format("{0}{1}", CveArchivo, FileExtension); - string DirectorioNuevo = string.Format("{0}\\Empresas\\{1}\\Acercamientos\\{2}\\Imagenes\\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CveAcercamiento); + string DirectorioNuevo = string.Format("{0}Acercamientos\\{1}\\Imagenes\\", UsuarioActual.Empresa.Ruta, CveAcercamiento); if (!Directory.Exists(DirectorioNuevo)) { Directory.CreateDirectory(DirectorioNuevo); diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index f65919d08..7dc209b2e 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -580,12 +580,6 @@ Partial Class Compras_Compras End Set End Property - 'Private ReadOnly Property Ruta As String - ' Get - ' Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" - ' End Get - 'End Property - Public Class Anticipos Public Property TipoMovto As String @@ -1636,7 +1630,7 @@ Partial Class Compras_Compras Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) ' no toma la cero, porque es el totalizador Dim XMLDoc As New XmlDocument - Dim Archivo As String = String.Format("{0}Empresas\{1}\Compras\{2}\{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, dr("RFCDe"), dr("XML")) + Dim Archivo As String = String.Format("{0}Compras\{2}\{3}", UsuarioActual.Empresa.Ruta, dr("RFCDe"), dr("XML")) If IO.File.Exists(Archivo) Then Dim Validada As Boolean = True diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 1cb659ebc..3a4a65a77 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -69,11 +69,7 @@ Partial Class PopUpVerFactura ViewState("TmpDTMaterialesOS") = value End Set End Property - Private ReadOnly Property Ruta As String - Get - Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" - End Get - End Property + Private ReadOnly Property DomicilioFiscalCompu As String Get Dim SisEmpresa As New ClsSisEmpresas() @@ -4369,7 +4365,7 @@ Partial Class PopUpVerFactura ' 04/05/2018 - Pruebas de impresion de factura PyME Private Sub GeneraPDFVtaPyMe(Venta As Modelos.Factura, Optional Formato As String = "PDF") - Dim Directorio1 As String = String.Format("{0}Empresas\{1}\Formatos\Factura.mrt", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa) + Dim Directorio1 As String = String.Format("{0}Formatos\Factura.mrt", UsuarioActual.Empresa.Ruta) Dim File As FileInfo = New FileInfo(Directorio1) If File.Exists Then diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index ea3a19572..3d6f80da9 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -709,7 +709,7 @@ Partial Class Compras_Proveedores Try Dim dr As DataRow = ObjeFacturas.DtResultados.Rows(0) - XMLDoc.Load(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & dr("CveEmpresa").ToString & "\Compras\" & dr("RFCDe").ToString & "\" & dr("XML").ToString) + XMLDoc.Load(UsuarioActual.Empresa.Ruta & "Compras\" & dr("RFCDe").ToString & "\" & dr("XML").ToString) Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix) Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3" Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable) @@ -4608,8 +4608,8 @@ Partial Class Compras_Proveedores Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) diff --git a/Compras/RepComprasAFDetalle.aspx.vb b/Compras/RepComprasAFDetalle.aspx.vb index 0d78f1e74..e8de3702b 100644 --- a/Compras/RepComprasAFDetalle.aspx.vb +++ b/Compras/RepComprasAFDetalle.aspx.vb @@ -332,7 +332,7 @@ Partial Class Compras_RepComprasAFDetalle Dim ObjTareas As New ClsOIEventos Dim RutaPDF As String - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta RutaPDF = $"{Ruta}\Formatos\RepComprasAFDetalle.rdlc" If Not File.Exists(RutaPDF) Then RutaPDF = "Empresas\Grales\Formatos\RepComprasAFDetalle.rdlc" diff --git a/Compras/RepCxPPeriodo.aspx.cs b/Compras/RepCxPPeriodo.aspx.cs index bd3e49f7a..5b9f2a458 100644 --- a/Compras/RepCxPPeriodo.aspx.cs +++ b/Compras/RepCxPPeriodo.aspx.cs @@ -247,7 +247,7 @@ public partial class Compras_RepCxPPeriodo : ClsPaginas StrFiltro.AppendFormat(" Registro: {0}", DdlUsuarioRegistro.SelectedItem.Text); string RutaPDF = ""; - string Ruta = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas/{UsuarioActual.CveEmpresa}/"; + string Ruta = UsuarioActual.Empresa.Ruta; RutaPDF = $"{Ruta}/Formatos/RepCxPPeriodo.rdlc"; if (!System.IO.File.Exists(RutaPDF)) { diff --git a/Compras/RepGastosFijos.aspx.cs b/Compras/RepGastosFijos.aspx.cs index 92265c1dc..2e41a8983 100644 --- a/Compras/RepGastosFijos.aspx.cs +++ b/Compras/RepGastosFijos.aspx.cs @@ -215,9 +215,9 @@ public partial class Compras_RepGastosFijos : ClsPaginas protected void ImprimiReporte(string Formato = "PDF") { string FechaInicio = DateTime.Parse(TxtFechaI.Text).ToShortDateString(); - string FechaFinal = DateTime.Parse(TxtFechaF.Text).ToShortDateString(); - - string Ruta = string.Format("{0}Empresas/{1}/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa); + string FechaFinal = DateTime.Parse(TxtFechaF.Text).ToShortDateString(); + + string Ruta = UsuarioActual.Empresa.Ruta; string RutaPDF = string.Format("{0}/Formatos/RepGastosFijos.rdlc", Ruta); if (!File.Exists(RutaPDF)) diff --git a/Compras/RepPagado.aspx.cs b/Compras/RepPagado.aspx.cs index d2faa08d1..b5dafa73c 100644 --- a/Compras/RepPagado.aspx.cs +++ b/Compras/RepPagado.aspx.cs @@ -243,7 +243,7 @@ public partial class Compras_RepPagado : ClsPaginas StrFiltro.AppendFormat(" Moneda: {0}", DdlMoneda.SelectedItem.Text); string RutaPDF = ""; - string Ruta = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas/{UsuarioActual.CveEmpresa}/"; + string Ruta = UsuarioActual.Empresa.Ruta; RutaPDF = $"{Ruta}/Formatos/RepRecuperacion.rdlc"; if (!System.IO.File.Exists(RutaPDF)) { diff --git a/Compras/RepPagadoDetalle.aspx.cs b/Compras/RepPagadoDetalle.aspx.cs index a5bded5ec..326d99ed8 100644 --- a/Compras/RepPagadoDetalle.aspx.cs +++ b/Compras/RepPagadoDetalle.aspx.cs @@ -274,7 +274,7 @@ public partial class Compras_RepPágadoDetalle : ClsPaginas StrFiltro.AppendFormat(" Moneda: {0}", DdlMoneda.SelectedItem.Text); string RutaPDF = ""; - string Ruta = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas/{UsuarioActual.CveEmpresa}/"; + string Ruta = UsuarioActual.Empresa.Ruta; RutaPDF = $"{Ruta}/Formatos/RepPagadoDetalle.rdlc"; if (!System.IO.File.Exists(RutaPDF)) { diff --git a/Compras/RepPagadoPeriodo.aspx.cs b/Compras/RepPagadoPeriodo.aspx.cs index 7de9ab3b3..c514e6827 100644 --- a/Compras/RepPagadoPeriodo.aspx.cs +++ b/Compras/RepPagadoPeriodo.aspx.cs @@ -292,7 +292,7 @@ public partial class Compras_RepPagadoPeriodo : ClsPaginas StrFiltro.AppendFormat(" Moneda: {0}", DdlMoneda.SelectedItem.Text); string RutaPDF = ""; - string Ruta = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas/{UsuarioActual.CveEmpresa}/"; + string Ruta = UsuarioActual.Empresa.Ruta; RutaPDF = $"{Ruta}/Formatos/RepPagadoPeriodo.rdlc"; if (!System.IO.File.Exists(RutaPDF)) { diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 2ee5e8db2..aa2e004dd 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -697,7 +697,7 @@ Partial Class Compras_eFacturas txtFechaF.Text = Now.ToShortDateString 'txtFechaI.Text.ToDate.AddMonths(1).AddDays(-1).ToShortDateString - Destino = String.Format("{0}Compras\", UsuarioActual.Empresa.Ruta) 'string.format("{0}Empresas\{1}\Compras\", ModExtensiones.DirectorioBaseEmpresas ,UsuarioActual.CveEmpresa & "\Compras\" + Destino = String.Format("{0}Compras\", UsuarioActual.Empresa.Ruta) Ejecutable = "C:\Proyectos\wwwSIG\Utilerias\ADSUtilerias.exe" Form.DefaultButton = BtnConsultar.UniqueID @@ -1300,7 +1300,7 @@ Partial Class Compras_eFacturas End Sub Protected Sub LnkNoRecibidas_Click(sender As Object, e As EventArgs, Optional ValidaRowCount As Boolean = False) Handles LnkNoRecibias.Click Dim DtNoRecibidas As New DataTable - Dim Ruta As String = String.Format("{0}\Empresas\{1}\Compras\NoRecibidas-{1}.xml", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa) + Dim Ruta As String = String.Format("{0}Compras\NoRecibidas-{1}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveEmpresa) Dim Str As New StringBuilder If IO.File.Exists(Ruta) Then DtNoRecibidas.ReadXml(Ruta) @@ -1428,7 +1428,7 @@ Partial Class Compras_eFacturas If filemove <> "" Then 'filemove.FilesMove("", String.Format("{0}\Temp\Facturas", UsuarioActual.Empresa.Ruta)) - filemove.FilesMove("", String.Format("Empresas\{0}\Temp\Facturas", UsuarioActual.CveEmpresa)) + filemove.FilesMove("", String.Format("{0}Temp\Facturas", UsuarioActual.Empresa.Ruta)) 'AGREGA XML A LA LISTA If FileExtension.ToUpper = "XML" Or FileExtension.ToUpper = "PDF" Then ListXML.Add(String.Format("{0}Temp\Facturas\{1}", UsuarioActual.Empresa.Ruta, filemove)) @@ -1438,7 +1438,7 @@ Partial Class Compras_eFacturas Next - Dim fileEntries As String() = Directory.GetFiles(String.Format("{0}Empresas\{1}\Temp\Facturas", Extensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) + Dim fileEntries As String() = Directory.GetFiles(String.Format("{0}Temp\Facturas", UsuarioActual.Empresa.Ruta)) Dim ListaDirectoriosTemporales As New List(Of String) Dim ListaComprimidos As New List(Of String) @@ -1749,7 +1749,7 @@ Partial Class Compras_eFacturas DirectoryExistsCreate(String.Format("{0}Compras\{1}", UsuarioActual.Empresa.Ruta, RFC.ToUpper)) Try - File.Move(PathArchivo, String.Format("{0}Empresas\{1}\Compras\{2}\{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, RFC.ToUpper, NombreArchivo)) + File.Move(PathArchivo, String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, RFC.ToUpper, NombreArchivo)) Catch ex As Exception Alert("Error") End Try @@ -2787,7 +2787,7 @@ Partial Class Compras_eFacturas XMLNodosPagosModalCount = 0 Dim XMLDoc As New XmlDocument - Dim Archivo As String = String.Format("{0}Empresas\{1}\Compras\{2}\{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML")) + Dim Archivo As String = String.Format("{0}Compras\{2}\{3}", UsuarioActual.Empresa.Ruta, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML")) If IO.File.Exists(Archivo) Then @@ -3669,7 +3669,7 @@ Partial Class Compras_eFacturas Dim strRFCde As String = gvrow.DataKey("RFCde") Dim strXml As String Dim strPDF As String - Dim dirbase As String = String.Format("{0}{1}{2}{3}{4}\", ModExtensiones.DirectorioBaseEmpresas, "\Empresas\", UsuarioActual.CveEmpresa, "\Compras\", strRFCde) + Dim dirbase As String = String.Format("{0}{1}{2}\", UsuarioActual.Empresa.Ruta, "Compras\", strRFCde) If Directory.Exists(dirbase) Then strXml = String.Format("{0}{1}", dirbase, gvrow.DataKey("XML")) strPDF = String.Format("{0}{1}", dirbase, gvrow.DataKey("PDF")) @@ -3704,7 +3704,7 @@ Partial Class Compras_eFacturas Dim gvrow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim strRFCde As String = gvrow.DataKey("RFCde") Dim strPDF As String - Dim dirbase As String = String.Format("{0}{1}{2}{3}{4}\", ModExtensiones.DirectorioBaseEmpresas, "\Empresas\", UsuarioActual.CveEmpresa, "\Compras\", strRFCde) + Dim dirbase As String = String.Format("{0}{1}{2}\", UsuarioActual.Empresa.Ruta, "Compras\", strRFCde) strPDF = String.Format("{0}{1}", dirbase, gvrow.DataKey("PDF")) If File.Exists(strPDF) Then Dim file As New System.IO.FileInfo(strPDF) @@ -3728,7 +3728,7 @@ Partial Class Compras_eFacturas Dim gvrow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim strRFCde As String = gvrow.DataKey("RFCde") Dim strXml As String - Dim dirbase As String = String.Format("{0}{1}{2}{3}{4}\", ModExtensiones.DirectorioBaseEmpresas, "\Empresas\", UsuarioActual.CveEmpresa, "\Compras\", strRFCde) + Dim dirbase As String = String.Format("{0}{1}{2}\", UsuarioActual.Empresa.Ruta, "Compras\", strRFCde) strXml = String.Format("{0}{1}", dirbase, gvrow.DataKey("XML")) If File.Exists(strXml) Then Dim file As New System.IO.FileInfo(strXml) @@ -3949,7 +3949,7 @@ Partial Class Compras_eFacturas Dim XMLDoc As New XmlDocument - Dim Archivo As String = String.Format("{0}Empresas\{1}\Compras\{2}\{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML")) + Dim Archivo As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML")) If IO.File.Exists(Archivo) Then diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb index 6fd47f81b..8630e7aa5 100644 --- a/Contabilidad/RegPrePoliza.aspx.vb +++ b/Contabilidad/RegPrePoliza.aspx.vb @@ -2158,9 +2158,9 @@ Partial Class ContabilidadC_RegPrePoliza If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = Server.MapPath("~") & file.patch + Dim Directorio As String = Server.MapPath("~") & file.path - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) @@ -2359,10 +2359,7 @@ Partial Class ContabilidadC_RegPrePoliza Dim Path As String = HttpContext.Current.Request.ApplicationPath Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") - Path = Extensiones.DirectorioBaseEmpresas - Path += String.Format("Empresas/{0}/IE", UsuarioActual.CveEmpresa) - - + Path = String.Format("{0}IE", UsuarioActual.Empresa.Ruta) If Not Directory.Exists(Path) Then Directory.CreateDirectory(Path) diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index 31f16c46a..35ab2b146 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -1304,10 +1304,10 @@ Partial Class Contratos_Default 'Renombrar archivo If ViewState("extencion") IsNot Nothing Then If ViewState("FUrl").ToString.Length > 0 AndAlso ViewState("extencion").ToString.Length > 0 Then - If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") Then - Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "Contratos") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Contratos") End If - Ruta = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" + Ruta = UsuarioActual.Empresa.Ruta & "Contratos\" 'ViewState("extencion") = FileExtension 'ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", "Temp", ViewState("FName").ToString) @@ -1420,10 +1420,10 @@ Partial Class Contratos_Default If ViewState("extencion") IsNot Nothing Then If ViewState("FUrl").ToString.Length > 0 AndAlso ViewState("extencion").ToString.Length > 0 Then - If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") Then - Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "Contratos") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Contratos") End If - Ruta = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" + Ruta = UsuarioActual.Empresa.Ruta & "Contratos\" Try If File.Exists(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString)) Then @@ -3554,8 +3554,8 @@ Partial Class Contratos_Default Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) diff --git a/Contratos/Contrato.vb b/Contratos/Contrato.vb index 7972d98d8..105e62cfc 100644 --- a/Contratos/Contrato.vb +++ b/Contratos/Contrato.vb @@ -597,10 +597,10 @@ Partial Class Contratos_Default 'Renombrar archivo If ViewState("extencion") IsNot Nothing Then If ViewState("FUrl").ToString.Length > 0 AndAlso ViewState("extencion").ToString.Length > 0 Then - If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") Then - Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "Contratos") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Contratos") End If - Ruta = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" + Ruta = UsuarioActual.Empresa.Ruta & "Contratos\" 'ViewState("extencion") = FileExtension 'ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "Contratos", "Temp", ViewState("FName").ToString) @@ -643,10 +643,10 @@ Partial Class Contratos_Default If ViewState("extencion") IsNot Nothing Then If ViewState("FUrl").ToString.Length > 0 AndAlso ViewState("extencion").ToString.Length > 0 Then - If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") Then - Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "Contratos") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Contratos") End If - Ruta = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" + Ruta = UsuarioActual.Empresa.Ruta & "Contratos\" Try If File.Exists(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString)) Then diff --git a/Contratos/ContratoObra.aspx.vb b/Contratos/ContratoObra.aspx.vb index 368397521..c62a5b68e 100644 --- a/Contratos/ContratoObra.aspx.vb +++ b/Contratos/ContratoObra.aspx.vb @@ -9,8 +9,8 @@ Imports System.Globalization Imports GemBox.Spreadsheet Partial Class Contratos_ContratoObra - Inherits ClsPaginas - + Inherits ClsPaginas + #Region " PROPIEDADES " Private Property CveContrato As Integer Get @@ -340,68 +340,68 @@ Partial Class Contratos_ContratoObra Set(ByVal value As DataSet) ViewState("DsDatosPedDev") = value End Set - End Property - + End Property + Private Property CveSubProyecto As Integer Get - If ViewState("CveSubProyecto") Is Nothing Then - Return -1 - Else - Return CType(ViewState("CveSubProyecto"), Integer) - End If + If ViewState("CveSubProyecto") Is Nothing Then + Return -1 + Else + Return CType(ViewState("CveSubProyecto"), Integer) + End If End Get Set(value As Integer) ViewState("CveSubProyecto") = value - End Set - End Property - - - + End Set + End Property + + + Property TotalAvanceVentas As Decimal Get - If ViewState("TotalAvanceVentas") Is Nothing Then - Return 0D - Else - Return ViewState("TotalAvanceVentas").ToString.ToDecimal - End If + If ViewState("TotalAvanceVentas") Is Nothing Then + Return 0D + Else + Return ViewState("TotalAvanceVentas").ToString.ToDecimal + End If End Get Set(value As Decimal) ViewState("TotalAvanceVentas") = value - End Set - End Property - - - + End Set + End Property + + + Property TotalAvanceInterno As Decimal Get - If ViewState("TotalAvanceInterno") Is Nothing Then - Return 0D - Else - Return ViewState("TotalAvanceInterno").ToString.ToDecimal - End If + If ViewState("TotalAvanceInterno") Is Nothing Then + Return 0D + Else + Return ViewState("TotalAvanceInterno").ToString.ToDecimal + End If End Get Set(value As Decimal) ViewState("TotalAvanceInterno") = value - End Set - End Property - - - - + End Set + End Property + + + + #End Region - + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then CargaValoresIniciales() - CreaDtTmpFianzas() - - - cargaClientes() - - + CreaDtTmpFianzas() + + + cargaClientes() + + If Request("CveContrato") IsNot Nothing AndAlso IsNumeric(Request("CveContrato")) AndAlso Request("CveContrato").ToEntero > 0 Then ViewState("CveContrato") = Request("CveContrato") @@ -430,30 +430,30 @@ Partial Class Contratos_ContratoObra If Request("Opt") IsNot Nothing AndAlso IsNumeric(Request("Opt")) Then Tab.ActiveTabIndex = Request("Opt").ToEntero - If CveContrato > 0 Then - - LnkModalAddPSVentas.Visible = True - LnkModalAddPSControl.Visible = True - LnkModalAddPresupuestoVentas.Visible = True - LnkModalAddPresupuestoControl.Visible = True - LnkModalAddMaquinariaFlotilla.Visible = True - + If CveContrato > 0 Then + + LnkModalAddPSVentas.Visible = True + LnkModalAddPSControl.Visible = True + LnkModalAddPresupuestoVentas.Visible = True + LnkModalAddPresupuestoControl.Visible = True + LnkModalAddMaquinariaFlotilla.Visible = True + End If - CargaEstadoCueta() + CargaEstadoCuenta() + + TabEstadoCuenta.Visible = True + + + If TxtLimiteGastos.Text.ToDecimal > 0 Then + TabGastos.Visible = True + LnkModalAddGastos.Visible = True + CargaGastos() + + End If + + Indicadores() - TabEstadoCuenta.Visible = True - - - If TxtLimiteGastos.Text.ToDecimal > 0 Then - TabGastos.Visible = True - LnkModalAddGastos.Visible = True - CargaGastos() - - End If - - Indicadores() - Else 'Configuración de Modalidad Insert LblFechaCaptura.Text = Now.ToShortDateString() @@ -466,10 +466,10 @@ Partial Class Contratos_ContratoObra TabReporteAvance.Visible = False TabAvanveDocumento.Visible = False - TAB.ActiveTabIndex = 0 - - - + TAB.ActiveTabIndex = 0 + + + End If 'carga combos @@ -477,12 +477,12 @@ Partial Class Contratos_ContratoObra CargaPS() CargaPSInsumos() ConfiguraTipos() - 'CargaDatosEncabezado() - - - CargaDLLCargaGVCentrosConsto() - tabalCentrosdecotso() - + 'CargaDatosEncabezado() + + + CargaDLLCargaGVCentrosConsto() + tabalCentrosdecotso() + End If @@ -497,28 +497,28 @@ Partial Class Contratos_ContratoObra If CveContrato > 0 Then If UsuarioActual.TienePermisoProceso(164) Then BtnEliminar.Visible = True - Gv.Columns(8).Visible = True + Gv.Columns(7).Visible = True GvInsumos.Columns(7).Visible = True Else BtnEliminar.Visible = False - Gv.Columns(8).Visible = False + Gv.Columns(7).Visible = False GvInsumos.Columns(7).Visible = False - End If - + End If + Else TabPres.Visible = False - Gv.Columns(8).Visible = True + Gv.Columns(7).Visible = True GvInsumos.Columns(7).Visible = True End If - TabAvanveDocumento.Visible = False - TabContratosGastos.Visible = False - TabPed.Visible = False - - End Sub - + TabAvanveDocumento.Visible = False + TabContratosGastos.Visible = False + TabPed.Visible = False + + End Sub + #Region " CARGA VALORES INICIALES " Private Sub CargaValoresIniciales() CveContrato = -1 @@ -534,26 +534,26 @@ Partial Class Contratos_ContratoObra FolioSugerido = "" CargaProyecto() - CargaContratista() - - + CargaContratista() + + DdlUM.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) DdlUM.DataBind() DdlMoneda.DataSource = GlobalDTMonedas - DdlMoneda.DataBind() - - - + DdlMoneda.DataBind() + + + CargaContratosEstatus() - CreaDT() - - + CreaDT() + + If UsuarioActual.CveEmpresa.Contiene(72, 80) Then divResponsable.Visible = False - End Sub - - - + End Sub + + + Protected Sub DdlMoneda_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlMoneda.SelectedIndexChanged If DdlMoneda.SelectedIndex = 0 Then @@ -568,10 +568,10 @@ Partial Class Contratos_ContratoObra End Sub Public Function isWithFamily() As Boolean Return UsuarioActual.CveEmpresa = 66 - End Function - - Private Sub cargaClientes() - DdlCliente.setEsWebService(True) + End Function + + Private Sub cargaClientes() + DdlCliente.setEsWebService(True) DdlCliente.Attributes.Add("data-metodo", "getcliente") End Sub @@ -599,20 +599,20 @@ Partial Class Contratos_ContratoObra TmpDT.Columns.Add("NoIdentificacion", GetType(String)) TmpDT.Columns.Add("LimitarCantidad", GetType(Integer)) TmpDT.Columns.Add("OCInterna", GetType(String)) - TmpDT.Columns.Add("Observacion", GetType(String)) - - + TmpDT.Columns.Add("Observacion", GetType(String)) + + TmpDT.Columns.Add("CveRubro", GetType(Integer)) TmpDT.Columns.Add("CveActividad", GetType(Integer)) TmpDT.Columns.Add("CveSubTipoActivoFijo", GetType(Integer)) TmpDT.Columns.Add("Rubro", GetType(String)) TmpDT.Columns.Add("Actividad", GetType(String)) - TmpDT.Columns.Add("SubTipoActivoFijo", GetType(String)) - - TmpDT.Columns.Add("Dias", GetType(Integer)) - - + TmpDT.Columns.Add("SubTipoActivoFijo", GetType(String)) + + TmpDT.Columns.Add("Dias", GetType(Integer)) + + End Sub Protected Sub Limpiar() TxtNumeroContrato.Text = "" @@ -621,55 +621,55 @@ Partial Class Contratos_ContratoObra DdlCliente.SelectedValue = "-1" TxtFechaInicial.Text = "" TxtFechaFinal.Text = "" - TxtPorIVA.Text = "" - - 'DdlProyecto.SelectedValue = "-1" - + TxtPorIVA.Text = "" + + 'DdlProyecto.SelectedValue = "-1" + TxtCantidad.Text = "" TxtPU.Text = "" TmpDT.Clear() CargaGVPresupuestos(TmpDT) CargaGVPresupuestosInsumos(TmpDT) LbTotalGeneral.Text = "0.00" - End Sub + End Sub #End Region - + #Region " CONFIGURA TIPOS CONTRATO " - + Private Sub ConfiguraTipos() If Not TipoContrato.Contiene({7, 9, 13, 16, 18, 21}) Then TabAF.Visible = False - End If - - - - 'DONDE OCUPA ALMACEN + End If + + + + 'DONDE OCUPA ALMACEN Dim CveTipoAlmacenOrigen = "12,15" - Dim CveTipoAlmacenDestino = "11,12" - - - + Dim CveTipoAlmacenDestino = "11,12" + + + + End Sub + + Private Sub MuestraPermiteAvance() + + End Sub - Private Sub MuestraPermiteAvance() - - - End Sub - #End Region - - - + + + #Region " INICIO DE PAGINA " - - - + + + Private Sub modalidades(modalidadDetalleInt As Integer) If modalidadDetalleInt = 1 Then - ModalidadDetalle = 1 - - + ModalidadDetalle = 1 + + DvTotal.Visible = True @@ -677,43 +677,43 @@ Partial Class Contratos_ContratoObra ' TableDatosCabecera.Visible = True 'End If - If CveTipoContrato = 25 Then - - DvTotal.Visible = False - - + If CveTipoContrato = 25 Then + + DvTotal.Visible = False + + End If ElseIf modalidadDetalleInt = 2 Then - ModalidadDetalle = 2 - - - DvTotal.Visible = True - - + ModalidadDetalle = 2 + + + DvTotal.Visible = True + + 'If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then ' TableDatosCabecera.Visible = True - 'End If - - - + 'End If + + + End If UpGral.Update() - End Sub - - - + End Sub + + + #End Region - + #Region " CARGA DATOS " Private Sub CargaDatos() Dim ObjContratos As New ClsContratos() - Dim Ruta = Request.ApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" - 'DivTipoContrato.Visible = False - - + Dim Ruta = Request.ApplicationPath + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" + 'DivTipoContrato.Visible = False + + If ObjContratos.GetContratos(CveContrato, UsuarioActual.CveEmpresa) Then If ObjContratos.DtResultados.Rows.Count > 0 Then @@ -733,63 +733,63 @@ Partial Class Contratos_ContratoObra TxtDescripcionContrato.Text = ObjContratos.DescripcionContrato TxtNumeroContrato.Text = ObjContratos.NumeroContrato TxtNumeroLicitacion.Text = ObjContratos.NumeroLicitacion - TipoContrato = ObjContratos.CveContratoTipo + TipoContrato = ObjContratos.CveContratoTipo CveTipoContrato = ObjContratos.DtResultados.Rows(0)("CveContratoTipo").ToString.ToEntero - TxtCorreoNotificacion.Text = ObjContratos.DtResultados.Rows(0)("CorreoNotificacionPedDev").ToString - DdlCliente.SelectedValue = ObjContratos.CveCliente.ToString - DdlCliente.SelectedText = ObjContratos.NombreComercial.ToString - - If ObjContratos.CveProveedor > 0 Then - ' TrProveedor.Visible = True + TxtCorreoNotificacion.Text = ObjContratos.DtResultados.Rows(0)("CorreoNotificacionPedDev").ToString + DdlCliente.SelectedValue = ObjContratos.CveCliente.ToString + DdlCliente.SelectedText = ObjContratos.NombreComercial.ToString + + If ObjContratos.CveProveedor > 0 Then + ' TrProveedor.Visible = True TrCliente.Visible = False CargaContratista() DdlContratista.SelectedValue = ObjContratos.CveProveedor.ToString DdlContratista.SelectedText = ObjContratos.RazonSocial.ToString Else - cargaClientes() - DdlCliente.SelectedValue = ObjContratos.CveCliente.ToString - UpCliente.Update() + cargaClientes() + DdlCliente.SelectedValue = ObjContratos.CveCliente.ToString + UpCliente.Update() UpGral.Update() CargaSucursalCliente() DdlSucursalCliente.SelectedValue = ObjContratos.CveSucursalCliente.ToString - End If - + End If + CargaContratoAddendum() - If ObjContratos.DtResultados.Rows(0)("CveContratoTipo").ToString.ToEntero = 14 Then - RFVEstatus.ValidationGroup = "" - DvTotal.Visible = True - RowEstatus.Visible = False - CargaPlantillas() + If ObjContratos.DtResultados.Rows(0)("CveContratoTipo").ToString.ToEntero = 14 Then + RFVEstatus.ValidationGroup = "" + DvTotal.Visible = True + RowEstatus.Visible = False + CargaPlantillas() TabPres.HeaderText = "Partidas" End If If ObjContratos.DtResultados.Rows(0)("CveContratoTipo").ToString.ToEntero = 25 Then trLicitacion.Visible = False - divResponsable.Visible = False + divResponsable.Visible = False trIva.Visible = False trAnticipo.Visible = False trAmortizacion.Visible = False - trPorGarantia.Visible = False + trPorGarantia.Visible = False DvTotal.Visible = False TabPVInsumos.Visible = False RowEstatus.Visible = False - TabPres.HeaderText = "Partidas" + TabPres.HeaderText = "Partidas" 'TableDatosCabecera.Visible = False TabAvanveDocumento.Visible = False - TabSistema.Visible = False - TabContratosGastos.Visible = False - TDAvance.Style.Add("display", "none") - 'TxtNoIdentificacionv.Visible = False - DvObservaciones.Visible = True + TabSistema.Visible = False + TabContratosGastos.Visible = False + TDAvance.Style.Add("display", "none") + 'TxtNoIdentificacionv.Visible = False + DvObservaciones.Visible = True TxtObservaciones.Text = ObjContratos.DtResultados.Rows(0)("Observaciones").ToString - Gv.Columns(3).Visible = True - - End If - - - + Gv.Columns(3).Visible = True + + End If + + + FechaF = ObjContratos.FechaFinal FechaI = ObjContratos.FechaInicial TxtFechaFinal.Text = ObjContratos.FechaFinal.ToShortDateString @@ -803,33 +803,33 @@ Partial Class Contratos_ContratoObra 'DdlProyecto.SelectedValue = ObjContratos.CveProyecto.ToString LblSubProyecto.Text = ObjContratos.SubProyectoContrato DdlTipoContratoObra.SelectedValueExist(ObjContratos.CveContratoTipo) - 'CargaSubProyectoContrato(DdlProyecto.SelectedValue.ToEntero) - + 'CargaSubProyectoContrato(DdlProyecto.SelectedValue.ToEntero) + 'DdlSubProyectoContrato.SelectedValue = ObjContratos.CveSubProyecto.ToString - TxtPorIVA.Text = ObjContratos.PorIVA.ToString - TxtLimiteGastos.Text = ObjContratos.LimiteDeGasto.ToString - TxtTotal.Text = ObjContratos.Importe.FormatoNumero - - + TxtPorIVA.Text = ObjContratos.PorIVA.ToString + TxtLimiteGastos.Text = ObjContratos.LimiteDeGasto.ToString + TxtTotal.Text = ObjContratos.Importe.FormatoNumero + + DdlEstatus.SelectedValueExist(ObjContratos.CveContratosEstatus.ToString) CargarFianzas() If ObjContratos.TipoEstatus = 2 Then - DdlEstatus.Enabled = False + DdlEstatus.Enabled = False Else DdlEstatus.Items.Clear() 'Se esta ocultando concluido' DdlEstatus.DataSource = CType(DdlEstatus.DataSource, DataTable).FiltraParametros("TipoEstatus NOT IN (2)") - DdlEstatus.DataBind() - - + DdlEstatus.DataBind() + + End If TxtTipoCambio.Text = ObjContratos.TipoCambio.ToString - ModalidadDetalle = ObjContratos.ModalidadDetalle + ModalidadDetalle = ObjContratos.ModalidadDetalle modalidades(ModalidadDetalle) CargaGVGastos() @@ -844,27 +844,27 @@ Partial Class Contratos_ContratoObra Contratante = ObjContratos.RazonSocial.ToString Else Contratante = ObjContratos.NombreComercial.ToString - End If - - LblFechaCaptura.Text = ObjContratos.FechaIng.ToShortDateString - - CargaPresupuesto() - + End If + + LblFechaCaptura.Text = ObjContratos.FechaIng.ToShortDateString + + CargaPresupuesto() + cargarBitacora() If LblImporte.Text.ToDecimal <= 0 Then LblImporte.Text = ObjContratos.ImporteTotal.ToString.FormatoNumero End If If Not IsDBNull(ObjContratos.Archivo) AndAlso ObjContratos.Archivo <> "" AndAlso ObjContratos.Archivo <> "-1" AndAlso ObjContratos.Archivo <> $"{ObjContratos.CveContrato}." Then - ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo) - + ViewState("FUrl") = Path.Combine(UsuarioActual.Empresa.Ruta, "CONTRATOS", ObjContratos.Archivo) + BtnDescargar.Visible = True Else BtnDescargar.Visible = False A1.Visible = True - End If - - + End If + + DVSubProyecto.Visible = True DVddlproyecto.Visible = False @@ -880,8 +880,8 @@ Partial Class Contratos_ContratoObra End If UpGral.Update() UPAFUL.Update() - UpProyecto.Update() - ' UpImpuestos.Update() + UpProyecto.Update() + ' UpImpuestos.Update() UpTitulos.Update() ObjContratos.Dispose() End Sub @@ -902,7 +902,7 @@ Partial Class Contratos_ContratoObra If TipoContrato = 4 Then TabPI.Visible = True End If - If ObjContratos.GetContratosDetalle(CveContrato, UsuarioActual.CveEmpresa) Then + If ObjContratos.GetContratosDetalle(CveContrato, UsuarioActual.CveEmpresa, 2) Then TmpDT = ObjContratos.DtResultados If TmpDT.MAX("Cantidad_Original").ToString.ToEntero > 0 OrElse TmpDT.MAX("PU_Original").ToString.ToEntero > 0 Then BtnAutorizar.Visible = False @@ -919,50 +919,49 @@ Partial Class Contratos_ContratoObra UpGV.Update() UpGVInsumos.Update() - UPGVInt.Update() - - - TotalAvanceVentas = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").ToDecimal - TotalAvanceInterno = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").ToDecimal - - LbTotalGeneral.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero() - LbTotalGeneralInsumos.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero() + UPGVInt.Update() + + TotalAvanceVentas = TmpDT.FiltraParametros("CveTipoPresupuesto=2 AND CveContratoDetalle > 0").SUM("Total").ToDecimal + TotalAvanceInterno = TmpDT.FiltraParametros("CveTipoPresupuesto=1 AND CveContratoDetalle > 0").SUM("Total").ToDecimal + + LbTotalGeneral.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=2 AND CveContratoDetalle > 0").SUM("Total").FormatoNumero() + LbTotalGeneralInsumos.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1 AND CveContratoDetalle > 0").SUM("Total").FormatoNumero() LbTotalGeneralInt.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero() 'LblImporte.Text = "$" & TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero() End If End Sub - Private Sub CargarFianzas() - - + Private Sub CargarFianzas() + + Dim ObjContrato As ClsContratos = New ClsContratos() If ObjContrato.GetContratoFianza(CveContrato, -1, "-1", "-1", UsuarioActual.CveEmpresa, -1) Then - DtTmpFianzas = ObjContrato.DtResultados - - + DtTmpFianzas = ObjContrato.DtResultados + + DtTmpFianzasInicial = DtTmpFianzas.Copy() End If - ObjContrato.Dispose() - - - End Sub + ObjContrato.Dispose() + + + End Sub #End Region - + #Region " GUARDAR " - Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click - - If DdlContratista.SelectedValue.ToEntero = -1 And DdlCliente.SelectedValue.ToEntero = -1 Then - Alert("Debe seleccionar con quién está haciendo el contrato. Proveedor o Cliente", TipoMensaje.MsgAdvertencia) - Exit Sub + Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click + + If DdlContratista.SelectedValue.ToEntero = -1 And DdlCliente.SelectedValue.ToEntero = -1 Then + Alert("Debe seleccionar con quién está haciendo el contrato. Proveedor o Cliente", TipoMensaje.MsgAdvertencia) + Exit Sub End If - If TxtPorAmortizacionAnticipo.Text.ToDecimal < TxtPorAnticipo.Text.ToDecimal Then - Alert("El porcentaje de amortización no debe de ser menor al porcentaje de anticipo.", TipoMensaje.MsgAdvertencia) - Exit Sub + If TxtPorAmortizacionAnticipo.Text.ToDecimal < TxtPorAnticipo.Text.ToDecimal Then + Alert("El porcentaje de amortización no debe de ser menor al porcentaje de anticipo.", TipoMensaje.MsgAdvertencia) + Exit Sub End If @@ -973,36 +972,36 @@ Partial Class Contratos_ContratoObra Dim Archivo = Session("FileUpload").ToString Dim Ruta = Session("FileFolder").ToString - Dim Minimo, Maximo, Total As Double - - Minimo = 0 'txtMinimo.Text.ToDouble - Maximo = 0 'txtMaximo.Text.ToDouble - Total = TxtTotal.Text.ToDouble - - - + Dim Minimo, Maximo, Total As Double + + Minimo = 0 'txtMinimo.Text.ToDouble + Maximo = 0 'txtMaximo.Text.ToDouble + Total = TxtTotal.Text.ToDouble + + + If DdlMoneda.SelectedIndex > 0 Then If TxtTipoCambio.Text.Trim.Length = 0 Or TxtTipoCambio.Text.Trim.ToDouble = 0.0 Then Alert("Cuando seleccione una moneda diferente a peso debe especificar el tipo de cambio.", TipoMensaje.MsgAdvertencia) Exit Sub End If - End If - - If CveContrato > 0 Then + End If + + If CveContrato > 0 Then If DdlContratista.SelectedValue.ToEntero = -1 And DdlCliente.SelectedValue.ToEntero = -1 Then Alert("Debe seleccionar con quién está haciendo el contrato. Proveedor o Cliente", TipoMensaje.MsgAdvertencia) Exit Sub - End If - End If - + End If + End If + Dim ObjContratos As New ClsContratos Dim ObjInventarios As New ClsInventarios(ObjContratos.IniciaTransacSQL) TipoContrato = DdlTipoContratoObra.SelectedValue.ToEntero 'Crear Contrato - If Not CveContrato > 0 Then - + If Not CveContrato > 0 Then + Dim EstatusContrato As Integer = 1 CveContrato = ObjContratos.AddContratosObra(TxtNumeroContrato.Text, TxtDescripcionContrato.Text, TxtNumeroLicitacion.Text.Trim, DdlContratista.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, -1, TxtFechaInicial.Text.ToDate, TxtFechaFinal.Text.ToDate, @@ -1022,8 +1021,8 @@ Partial Class Contratos_ContratoObra 'Renombrar archivo If ViewState("extencion") IsNot Nothing Then If ViewState("FUrl").ToString.Length > 0 AndAlso ViewState("extencion").ToString.Length > 0 Then - If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") Then - Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "Contratos") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Contratos") End If Ruta = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" @@ -1036,23 +1035,23 @@ Partial Class Contratos_ContratoObra System.IO.File.Move(ViewState("FUrl").ToString, String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString)) Catch ex As Exception - End Try + End Try End If - End If - - - + End If + + + If TxtNumeroContrato.Text = FolioSugerido Then - Dim ObjFolios As New ClsGralFolios - + Dim ObjFolios As New ClsGralFolios + If Not ObjFolios.UpdateFolioActual(CveSubProyecto, "Con", True, UsuarioActual.CveEmpresa) Then TieneError = True End If ObjFolios.Dispose() - End If - - + End If + + Else TieneError = True End If @@ -1081,16 +1080,16 @@ Partial Class Contratos_ContratoObra TieneError = Not GuardaFianzas(ObjContratos) 'Renombrar archivo - If Not TieneError Then - - + If Not TieneError Then + + If ViewState("extencion") IsNot Nothing Then If ViewState("FUrl").ToString.Length > 0 AndAlso ViewState("extencion").ToString.Length > 0 Then - If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") Then - Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos") + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "Contratos") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Contratos") End If - Ruta = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Contratos\" + Ruta = UsuarioActual.Empresa.Ruta & "Contratos\" Try If File.Exists(String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString)) Then @@ -1099,11 +1098,11 @@ Partial Class Contratos_ContratoObra System.IO.File.Move(ViewState("FUrl").ToString, String.Format("{0}{1}.{2}", Ruta, CveContrato.ToString, ViewState("extencion").ToString)) Catch ex As Exception - End Try - + End Try + End If - End If - + End If + End If Else TieneError = True @@ -1131,9 +1130,9 @@ Partial Class Contratos_ContratoObra UpGral.Update() ObjContratos.Dispose() - End Sub + End Sub #End Region - + #Region " ELIMINAR " Protected Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click Dim objContratos As New ClsContratos @@ -1143,9 +1142,9 @@ Partial Class Contratos_ContratoObra Else ' Alert("Ocurrio un error al eliminar el contrato", TipoMensaje.MsgError) End If - End Sub + End Sub #End Region - + #Region " TERMINAR/CANCELAR CONTRATO " Protected Sub LBTerminarContrato_Click(sender As Object, e As EventArgs) Dim ObjContratos As New ClsContratos @@ -1169,33 +1168,33 @@ Partial Class Contratos_ContratoObra Alert("El Contrato fue cancelado Correctamente.", TipoMensaje.MsgInformacion, String.Format("document.location.href=""/Contratos/Contrato.aspx?CveContrato={0}""", CveContrato)) End If ObjContratos.Dispose() - End Sub + End Sub #End Region - + #Region " TABS " - + #Region " TAB: INFORMACION GENERAL" - + #Region "COMBOS - INFO GENERAL" - Private Sub CargaProyecto() - - 'trddlproyecto.Visible = LblProyecto.Visible - CargarCentrosDeCosto(DdlProyecto, Nothing, LblProyecto, LblSubProyectoTitulo) - - DdlProyecto.Visible = True - LblProyecto.Visible = True - - - 'LblCentroCosto.Text = LblSubProyectoTitulo.Text - LblSubProyectoTitulo.Text = LblSubProyectoTitulo.Text & ":" - - 'If UsuarioActual.Empresa.GralSoloProyecto Then - ' CargaSubProyectoContrato(-1) - ' lblsubproyecto.Text = "Proyecto" - 'Else - ' DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("", "", {"CveProyecto", "Proyecto"}) - ' DdlProyecto.DataBind() - 'End If + Private Sub CargaProyecto() + + 'trddlproyecto.Visible = LblProyecto.Visible + CargarCentrosDeCosto(DdlProyecto, Nothing, LblProyecto, LblSubProyectoTitulo) + + DdlProyecto.Visible = True + LblProyecto.Visible = True + + + 'LblCentroCosto.Text = LblSubProyectoTitulo.Text + LblSubProyectoTitulo.Text = LblSubProyectoTitulo.Text & ":" + + 'If UsuarioActual.Empresa.GralSoloProyecto Then + ' CargaSubProyectoContrato(-1) + ' lblsubproyecto.Text = "Proyecto" + 'Else + ' DdlProyecto.DataSource = GlobalDTProyectos(UsuarioActual.Empresa.CveEmpresa).FiltraParametros("", "", {"CveProyecto", "Proyecto"}) + ' DdlProyecto.DataBind() + 'End If End Sub 'Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged ' CargaSubProyectoContrato(DdlProyecto.SelectedValue.ToEntero) @@ -1207,7 +1206,7 @@ Partial Class Contratos_ContratoObra ' DdlSubProyectoContrato.Items.Insert(0, New ListItem("Seleccione un Proyecto", "-1")) 'End Sub Private Sub CargaContratista() - DdlContratista.setEsWebService(True) + DdlContratista.setEsWebService(True) DdlContratista.Attributes.Add("data-metodo", "getproveedores") End Sub @@ -1229,8 +1228,8 @@ Partial Class Contratos_ContratoObra ObjContratos.Dispose() End Sub Protected Sub DdlCliente_SelectedIndexChanged(sender As Object, e As EventArgs) - CargaSucursalCliente() - ' CargaDireccionesEnvios(DdlCliente.SelectedValue.ToEntero) + CargaSucursalCliente() + ' CargaDireccionesEnvios(DdlCliente.SelectedValue.ToEntero) UPPDatos.Update() End Sub Private Sub CargaSucursalCliente() @@ -1245,8 +1244,8 @@ Partial Class Contratos_ContratoObra If ObjCliente.DtResultados.Rows.Count > 0 Then TrClienteSucursal.Visible = True End If - DdlSucursalCliente.DataBind() - ' DdlTipoContrato.Items.Insert(0, New ListItem("Matriz", "-1")) + DdlSucursalCliente.DataBind() + ' DdlTipoContrato.Items.Insert(0, New ListItem("Matriz", "-1")) End If 'If UsuarioActual.Empresa.CvePlataforma = 3 Then ' QUITAR ' CargaCuentasEquipos() @@ -1257,20 +1256,20 @@ Partial Class Contratos_ContratoObra 'CargaContratoPadre() UpProyecto.Update() - End Sub - - - - - - - - - + End Sub + + + + + + + + + #End Region - + #Region " ARCHIVO " - + Private Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click DescargarArchivo() End Sub @@ -1337,13 +1336,13 @@ Partial Class Contratos_ContratoObra If Not FileExtension = "-1" Then BtnDescargar.Visible = True End If - End Sub + End Sub #End Region - + #End Region - + #Region " TAB: PRESUPUESTOS " - + #Region "C O M B O S - PRESUPUESTOS" Private Function isWhitFamily() As Boolean Return (UsuarioActual.CveEmpresa = 66) @@ -1354,15 +1353,15 @@ Partial Class Contratos_ContratoObra DdlClasificacionAdd.DataBind() DdlClasificacionAdd.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlClasificacionAddInsumos.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) ' GlobalDTClasificacionesPresupuestos(UsuarioActual.CveEmpresa) - DdlClasificacionAddInsumos.DataBind() - DdlClasificacionAddInsumos.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'DdlClasificacionAddInsumos.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) ' GlobalDTClasificacionesPresupuestos(UsuarioActual.CveEmpresa) + 'DdlClasificacionAddInsumos.DataBind() + 'DdlClasificacionAddInsumos.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlClasificacionInt.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) 'GlobalDTSubFamilias(UsuarioActual.CveEmpresa) DdlClasificacionInt.DataBind() DdlClasificacionInt.Items.Insert(0, New ListItem("Seleccione", "-1")) - End Sub - + End Sub + #Region " FUNCIONALIDAD 105 " Private Sub CargaPS() DdlProductows.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") @@ -1418,9 +1417,9 @@ Partial Class Contratos_ContratoObra DdlUMInsumos.DataBind() UpTitulos.Update() End Sub - Protected Sub DdlClasificacionInsumos_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacionAddInsumos.SelectedIndexChanged - ChangeDdlProductoInsumos() - End Sub + 'Protected Sub DdlClasificacionInsumos_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacionAddInsumos.SelectedIndexChanged + ' ChangeDdlProductoInsumos() + 'End Sub Private Sub ChangeDdlProductoInsumos() If UsuarioActual.Empresa.Funcionalidad(105) = "" Then 'Dim filtro As String = "" @@ -1432,30 +1431,30 @@ Partial Class Contratos_ContratoObra ' filtro = String.Format("CveClasificacion={0}", DdlClasificacionAddInsumos.SelectedValue) ' End If 'End If - DdlProductowsInsumos.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacionAddInsumos.SelectedValue.ToEntero).FiltraParametros("", "PSCodigo") - DdlProductowsInsumos.DataBind() - DdlProductowsInsumos.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'DdlProductowsInsumos.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacionAddInsumos.SelectedValue.ToEntero).FiltraParametros("", "PSCodigo") + 'DdlProductowsInsumos.DataBind() + 'DdlProductowsInsumos.ddl.Items.Insert(0, New ListItem("Seleccione", "-1")) Else 'If isWhitFamily() Then ' DdlProductowsInsumos.ddlWS.Attributes.Add("data-idSubFamilia", DdlClasificacionAddInsumos.SelectedValue) 'Else - DdlProductowsInsumos.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacionAddInsumos.SelectedValue) + ' DdlProductowsInsumos.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacionAddInsumos.SelectedValue) 'End If End If - End Sub + End Sub #End Region - + #End Region - + #Region " TAB PRESUPUESTOS VENTAS " Private Sub CargaGVPresupuestos(DtTemp As DataTable) Gv.DataSource = DtTemp DtPresupuestos = DtTemp Gv.DataBind() - If CveTipoContrato = 25 Then - ' Gv.Columns(0).Visible = False - Gv.Columns(1).Visible = False - ' Gv.Columns(3).Visible = False + If CveTipoContrato = 25 Then + ' Gv.Columns(0).Visible = False + Gv.Columns(1).Visible = False + ' Gv.Columns(3).Visible = False Gv.Columns(6).Visible = False End If 'If (Gv.Rows.Count > 0) Then @@ -1485,125 +1484,121 @@ Partial Class Contratos_ContratoObra Protected Sub BtnAgregarDetalle_Click(sender As Object, e As EventArgs) - If CveContratoDetalleEditar = -1 Then - - Dim Row As DataRow = TmpDT.NewRow() - Row("Cantidad") = TxtCantidad.Text.ToDouble.FormatoNumero - Row("CantidadContratada") = TxtCantidad.Text.ToDouble.FormatoNumero - Row("CveUM") = DdlUM.SelectedValue.ToEntero - Row("UM") = DdlUM.SelectedItem - Row("CveClasificacion") = DdlClasificacionAdd.SelectedValue - Row("Clasificacion") = DdlClasificacionAdd.SelectedItem - Row("CvePS") = DdlProductows.SelectedValue.ToEntero - Row("PS") = DdlProductows.SelectedText - Row("CodigoPS") = DdlProductows.SelectedText - Row("PU") = TxtPU.Text.ToDouble.FormatoNumero - Row("Total") = (TxtCantidad.Text.ToDouble * TxtPU.Text.ToDouble).FormatoNumero - Row("CveTipoPresupuesto") = 2 - Row("NoIdentificacion") = "" 'TxtNoIdentificacionv.Text.Trim - Row("OCInterna") = "" 'TxtOCInterna.Text.Trim - Row("LimitarCantidad") = ChkLimitarCantidadAdd.Checked 'If(ChkLimitarVenta.Checked, 1, 0) - Row("Observacion") = "" 'TxtObservacionesDetalles.Text - - Row("CveRubro") = 1 - - - - Dim ObjContratos As New ClsContratos - - - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), "", Observacion:=Row("Observacion").ToString, CveRubro:=1) Then - - If Autorizado Then - Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) - guardarBitacora(msj) - End If - - Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") - TmpDT.Rows.Add(Row) - TmpDT.AcceptChanges() - Dim TotalRow = Row("Total").ToString.ToDouble - - CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) - - UpGV.Update() - LimpiarModalVentas() - - LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero - LblImporte.Text = LbTotalGeneral.Text - TxtCantidad.Focus() - UpGral.Update() - - - If Not ChkContinualAgregandoVentas.Checked Then - RegistraScript("$('#ModalVentasAddPS').modal('hide')") - End If - - Else - Alert("Ocurrio un error al agregar el detalle", TipoMensaje.MsgError) - End If - - ObjContratos.Dispose() - Else - - - Dim Cantidad, PU As Double : Dim CvePS, CveUM As Integer - Dim NoIdentificacion As String = "" - 'Dim OCInterna As String = "" - ' Dim LimitarCantidad As Boolean - Dim Observaciones As String = "" - - Cantidad = TxtCantidad.Text.ToDouble - PU = TxtPU.Text.ToDouble - CvePS = DdlProductows.SelectedValue.ToEntero - CveUM = DdlUM.SelectedValue.ToEntero - 'NoIdentificacion = TxtNoIdentificacionv.Text.Trim - 'OCInterna = TxtOCInterna.Text.Trim - 'LimitarCantidad = If(ChkLimitarVenta.Checked, True, False) - Observaciones = "" - Dim limitarCantidad As Boolean = ChkLimitarCantidad.Checked - - - Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalleEditar))(0) - Dim LimitarCantidadValidator As Boolean = row("LimitarCantidad").ToString = "True" - - - Dim ObjContratos As New ClsContratos - If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, NoIdentificacion, limitarCantidad, "", Observaciones, CveRubro:=1) Then - - If Autorizado Then - Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}", - row("PS").ToString, row("Cantidad").ToString, row("PU").ToString, Cantidad, PU) - guardarBitacora(msj) - End If - - row("Cantidad") = Cantidad - row("CantidadContratada") = Cantidad - row("PU") = PU - row("Total") = Cantidad * PU - row("CveUM") = CveUM - row("UM") = DdlUM.SelectedItem.Text - row("NoIdentificacion") = NoIdentificacion - row("OCInterna") = "" - row("LimitarCantidad") = limitarCantidad - row("Observacion") = Observaciones - - TmpDT.AcceptChanges() - Alert("Cambios realizados correctamente.", TipoMensaje.MsgInformacion) - RegistraScript("$('#ModalVentasAddPS').modal('hide')") - Else - Alert("Error al Actualizar Detalle", TipoMensaje.MsgError) - End If - ObjContratos.Dispose() - - - Gv.EditIndex = -1 - LbTotalGeneral.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero - LblImporte.Text = LbTotalGeneral.Text - CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) - - End If - CveContratoDetalleEditar = -1 + If CveContratoDetalleEditar = -1 Then + + Dim Row As DataRow = TmpDT.NewRow() + Row("Cantidad") = TxtCantidad.Text.ToDouble.FormatoNumero + Row("CantidadContratada") = TxtCantidad.Text.ToDouble.FormatoNumero + Row("CveUM") = DdlUM.SelectedValue.ToEntero + Row("UM") = DdlUM.SelectedItem + Row("CveClasificacion") = DdlClasificacionAdd.SelectedValue + Row("Clasificacion") = DdlClasificacionAdd.SelectedItem + Row("CvePS") = DdlProductows.SelectedValue.ToEntero + Row("PS") = DdlProductows.SelectedText + Row("CodigoPS") = DdlProductows.SelectedText + Row("PU") = TxtPU.Text.ToDouble.FormatoNumero + Row("Total") = (TxtCantidad.Text.ToDouble * TxtPU.Text.ToDouble).FormatoNumero + Row("CveTipoPresupuesto") = 2 + Row("NoIdentificacion") = "" 'TxtNoIdentificacionv.Text.Trim + Row("OCInterna") = "" 'TxtOCInterna.Text.Trim + Row("LimitarCantidad") = ChkLimitarCantidadAdd.Checked 'If(ChkLimitarVenta.Checked, 1, 0) + Row("Observacion") = "" 'TxtObservacionesDetalles.Text + Row("CveRubro") = 2 + + + Dim ObjContratos As New ClsContratos + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), "", Observacion:=Row("Observacion").ToString, CveRubro:=1) Then + + If Autorizado Then + Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) + guardarBitacora(msj) + End If + + Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") + TmpDT.Rows.Add(Row) + TmpDT.AcceptChanges() + Dim TotalRow = Row("Total").ToString.ToDouble + + CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) + + UpGV.Update() + LimpiarModalVentas() + + LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero + LblImporte.Text = LbTotalGeneral.Text + TxtCantidad.Focus() + UpGral.Update() + + + If Not ChkContinualAgregandoVentas.Checked Then + RegistraScript("$('#ModalVentasAddPS').modal('hide')") + End If + + Else + Alert("Ocurrio un error al agregar el detalle", TipoMensaje.MsgError) + End If + + ObjContratos.Dispose() + Else + + + Dim Cantidad, PU As Double : Dim CvePS, CveUM As Integer + Dim NoIdentificacion As String = "" + 'Dim OCInterna As String = "" + ' Dim LimitarCantidad As Boolean + Dim Observaciones As String = "" + + Cantidad = TxtCantidad.Text.ToDouble + PU = TxtPU.Text.ToDouble + CvePS = DdlProductows.SelectedValue.ToEntero + CveUM = DdlUM.SelectedValue.ToEntero + 'NoIdentificacion = TxtNoIdentificacionv.Text.Trim + 'OCInterna = TxtOCInterna.Text.Trim + 'LimitarCantidad = If(ChkLimitarVenta.Checked, True, False) + Observaciones = "" + Dim limitarCantidad As Boolean = ChkLimitarCantidad.Checked + + + Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalleEditar))(0) + Dim LimitarCantidadValidator As Boolean = row("LimitarCantidad").ToString = "True" + + + Dim ObjContratos As New ClsContratos + If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, NoIdentificacion, limitarCantidad, "", Observaciones, CveRubro:=1) Then + + If Autorizado Then + Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}", + row("PS").ToString, row("Cantidad").ToString, row("PU").ToString, Cantidad, PU) + guardarBitacora(msj) + End If + + row("Cantidad") = Cantidad + row("CantidadContratada") = Cantidad + row("PU") = PU + row("Total") = Cantidad * PU + row("CveUM") = CveUM + row("UM") = DdlUM.SelectedItem.Text + row("NoIdentificacion") = NoIdentificacion + row("OCInterna") = "" + row("LimitarCantidad") = limitarCantidad + row("Observacion") = Observaciones + + TmpDT.AcceptChanges() + Alert("Cambios realizados correctamente.", TipoMensaje.MsgInformacion) + RegistraScript("$('#ModalVentasAddPS').modal('hide')") + Else + Alert("Error al Actualizar Detalle", TipoMensaje.MsgError) + End If + ObjContratos.Dispose() + + + Gv.EditIndex = -1 + LbTotalGeneral.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=2").SUM("Total").FormatoNumero + LblImporte.Text = LbTotalGeneral.Text + CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) + + End If + CveContratoDetalleEditar = -1 End Sub Private Sub CargaDatosPresup() @@ -1622,10 +1617,10 @@ Partial Class Contratos_ContratoObra ContratosSecciones.Dispose() UpGral.Update() - End Sub - + End Sub + #Region "GV PRESUPUESTOS" - + Protected Sub EstClick(sender As Object, e As System.EventArgs) 'Get the button that raised the event Dim btn As CheckBox = DirectCast(sender, CheckBox) @@ -1665,14 +1660,14 @@ Partial Class Contratos_ContratoObra End Sub Protected Sub GV_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles Gv.RowDataBound - If e.Row.RowIndex > -1 Then - - Dim LnkHabilitaAvance As LinkButton = e.Row.FCLinkButton("LnkHabilitaAvance") - ' e.Row.FCCheckBox("CHKPAvance").Visible = Autorizado - 'e.Row.FCCheckBox("CHKPEstimacion").Visible = Autorizado + If e.Row.RowIndex > -1 Then + + Dim LnkHabilitaAvance As LinkButton = e.Row.FCLinkButton("LnkHabilitaAvance") + ' e.Row.FCCheckBox("CHKPAvance").Visible = Autorizado + 'e.Row.FCCheckBox("CHKPEstimacion").Visible = Autorizado If UsuarioActual.TienePermisoProceso(124) Then e.Row.FCCheckBox("CHKPAvance").Enabled = True - LnkHabilitaAvance.Enabled = True + LnkHabilitaAvance.Enabled = True End If If e.Row.DBCampo("PermitirAvance").ToString = "1" Then @@ -1683,24 +1678,24 @@ Partial Class Contratos_ContratoObra If e.Row.DBCampo("PermitirEstimacion").ToString = "1" Then ' e.Row.FCCheckBox("CHKPEstimacion").Checked = True End If - If Autorizado Then - ' e.Row.FCLinkButton("imgE").Visible = False + If Autorizado Then + ' e.Row.FCLinkButton("imgE").Visible = False 'e.Row.FCLinkButton("imgD").Visible = False End If If CveTipoContrato = 25 Then e.Row.Cells(1).Width = Unit.Pixel(10) e.Row.Cells(6).Width = Unit.Pixel(250) - End If - - - - - If e.Row.DBCampo("PermitirAvance").ToString = "1" Then - LnkHabilitaAvance.Text = "" - LnkHabilitaAvance.Attributes.Add("data-original-title", "¿Deshabilitar avance?") - Else - LnkHabilitaAvance.Text = "" - LnkHabilitaAvance.Attributes.Add("data-original-title", "¿Habilitar avance?") + End If + + + + + If e.Row.DBCampo("PermitirAvance").ToString = "1" Then + LnkHabilitaAvance.Text = "" + LnkHabilitaAvance.Attributes.Add("data-original-title", "¿Deshabilitar avance?") + Else + LnkHabilitaAvance.Text = "" + LnkHabilitaAvance.Attributes.Add("data-original-title", "¿Habilitar avance?") End If @@ -1790,7 +1785,7 @@ Partial Class Contratos_ContratoObra If ObjContratos.RemoveContratosDetalle(CveContratoDetalle, CveContrato) Then TmpDT.Rows.Remove(DbRow) CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) - LbTotalGeneral.Text = Gv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.FCLabel("LtTotal").Text.ToDouble).ToString.FormatoNumero + LbTotalGeneral.Text = Gv.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.FCLabel("LtTotal").Text.ToDouble).ToString.FormatoNumero Alert("Detalle eliminado eliminado correctamente.") Else Alert("Ocurrió un error al eliminar el detalle (Producto/Servicio). Por favor vuelva a intentar", TipoMensaje.MsgError) @@ -1803,12 +1798,12 @@ Partial Class Contratos_ContratoObra ' Seleccionado = e.CommandArgument.ToString Gv.SelectRow(e.CommandArgument.ToString.ToEntero - 1) End If - End Sub + End Sub #End Region - - + + #End Region - + #Region " TAB PRESUPUESTOS INSUMOS " Private Sub CargaGVPresupuestosInsumos(DtTemp As DataTable) GvInsumos.DataSource = DtTemp @@ -1822,238 +1817,237 @@ Partial Class Contratos_ContratoObra UpGVInsumos.Update() End Sub - Protected Sub BtnAgregarDetalleInsumos_Click(sender As Object, e As EventArgs) - - + Protected Sub BtnAgregarDetalleInsumos_Click(sender As Object, e As EventArgs) + + 'DdlProductowsInsumos.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") - If Not DdlProductowsInsumos.UsaWebService Then - If DdlRubro.SelectedValue.ToEntero = 2 And DdlProductowsInsumos.SelectedValue.ToEntero <= 0 Then - Alert("Debe de seleccionar un producto.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - - Else - - - If DdlRubro.SelectedValue.ToEntero = 1 And DdlProductowsInsumos.txtValue.Value.ToEntero <= 0 Then - Alert("Debe de seleccionar un producto.", TipoMensaje.MsgAdvertencia) - Exit Sub + If Not DdlProductowsInsumos.UsaWebService Then + If DdlRubro.SelectedValue.ToEntero = 2 And DdlProductowsInsumos.SelectedValue.ToEntero <= 0 Then + Alert("Debe de seleccionar un producto.", TipoMensaje.MsgAdvertencia) + Exit Sub End If - End If - - - - If CveContratoDetalleEditar = -1 Then - - Dim Row As DataRow = TmpDT.NewRow() - Row("Cantidad") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero - Row("CantidadContratada") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero - - Row("PU") = TxtPUInsumos.Text.ToDouble.FormatoNumero - Row("Total") = (TxtCantidadInsumos.Text.ToDouble * TxtPUInsumos.Text.ToDouble).FormatoNumero - Row("CveTipoPresupuesto") = 1 - Row("NoIdentificacion") = "" 'TxtNoIdentificacionvInsumos.Text.Trim - Row("LimitarCantidad") = ChkLimitarCantidad.Checked - - Row("CveRubro") = DdlRubro.SelectedValue.ToEntero - Row("Rubro") = DdlRubro.SelectedItem.Text - - If DdlRubro.SelectedValue.ToEntero = 3 Then - - Row("CveActividad") = DdlActividades.SelectedValue.ToEntero - Row("Actividad") = DdlActividades.SelectedItem.Text - Row("Dias") = TxtDias.Text.ToEntero - Row("CveSubTipoActivoFijo") = -1 - - - Row("CveUM") = -1 - Row("UM") = "" - Row("CveClasificacion") = -1 - Row("Clasificacion") = "" - Row("CvePS") = -1 - Row("PS") = DdlActividades.SelectedItem.Text - Row("CodigoPS") = DdlActividades.SelectedItem.Text - - - ElseIf DdlRubro.SelectedValue.ToEntero = 4 Then - - Row("CveActividad") = -1 - Row("Actividad") = "" - Row("Dias") = TxtDias.Text.ToEntero - Row("CveSubTipoActivoFijo") = DdlSubTipoActivoFijo.SelectedValue.ToEntero - - - Row("CveUM") = -1 - Row("UM") = "" - Row("CveClasificacion") = -1 - Row("Clasificacion") = "" - Row("CvePS") = -1 - Row("PS") = DdlSubTipoActivoFijo.SelectedItem.Text - Row("CodigoPS") = DdlSubTipoActivoFijo.SelectedItem.Text - - Else - Row("CveActividad") = -1 - Row("Actividad") = "" - Row("CveSubTipoActivoFijo") = -1 - Row("Dias") = 0 - - - Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero - Row("UM") = DdlUMInsumos.SelectedItem - Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue - Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem - Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero - Row("PS") = DdlProductowsInsumos.SelectedText - Row("CodigoPS") = DdlProductowsInsumos.SelectedText - - - - End If - - - Dim ObjContratos As New ClsContratos - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), "", - CveRubro:=Row("CveRubro").ToString.ToEntero, CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then - 'If Autorizado Then - ' Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) - ' guardarBitacora(msj) - 'End If - - Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") - TmpDT.Rows.Add(Row) - Dim TotalRow = Row("Total").ToString.ToDouble - - CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) - - UpGVInsumos.Update() - LimpiarModalControl() - LbTotalGeneralInsumos.Text = (LbTotalGeneralInsumos.Text.ToDouble + TotalRow).ToString.FormatoNumero - 'LblImporte.Text = LbTotalGeneral.Text - TxtCantidadInsumos.Focus() - UpGral.Update() - - - If Not ChkContinualAgregandoControl.Checked Then - RegistraScript("$('#ModalControlAddPS').modal('hide')") - End If - - Else - Alert("Ocurrio un error al agregar el detalle", TipoMensaje.MsgError) - End If - - ObjContratos.Dispose() - - Else - - Dim Cantidad, PU As Double - Dim CvePS, CveUM As Integer - - Dim CveRubro As Integer = DdlRubro.SelectedValue.ToEntero - - Dim CveActividad As Integer = -1 - Dim CveSubTipoActivoFijo As Integer = -1 - Dim Dias As Integer = 0 - - If CveRubro = 3 Then - - CveSubTipoActivoFijo = -1 - CveActividad = DdlActividades.SelectedValue.ToEntero - Dias = TxtDias.Text.ToEntero - - CvePS = -1 - CveUM = -1 - - ElseIf CveRubro = 4 Then - - CveSubTipoActivoFijo = DdlSubTipoActivoFijo.SelectedValue.ToEntero - CveActividad = -1 - Dias = TxtDias.Text.ToEntero - - CvePS = -1 - CveUM = -1 - - Else - CvePS = DdlProductowsInsumos.SelectedValue.ToEntero - CveUM = DdlUMInsumos.SelectedValue.ToEntero - End If - - - Cantidad = TxtCantidadInsumos.Text.ToDouble - PU = TxtPUInsumos.Text.ToDouble - Dim limitarCantidad As Boolean = ChkLimitarCantidad.Checked - - - - Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalleEditar))(0) - - Dim ObjContratos As New ClsContratos - If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, "", limitarCantidad, "", CveRubro:=CveRubro, CveActividad:=CveActividad, CveSubTipoActivoFijo:=CveSubTipoActivoFijo, Dias:=Dias) Then - - 'If Autorizado Then - ' Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}", - ' row("PS").ToString, row("Cantidad").ToString, row("PU").ToString, Cantidad, PU) - ' guardarBitacora(msj) - 'End If - - - - row("Cantidad") = Cantidad - row("CantidadContratada") = Cantidad - row("PU") = PU - row("Total") = Cantidad * PU - row("CveUM") = CveUM - - row("NoIdentificacion") = "" 'NoIdentificacion - row("LimitarCantidad") = limitarCantidad - - row("CveActividad") = CveActividad - row("CveSubTipoActivoFijo") = CveSubTipoActivoFijo - row("Dias") = Dias - - - If CveRubro = 3 Then - row("PS") = DdlActividades.SelectedItem.Text - row("CodigoPS") = DdlActividades.SelectedItem.Text - row("UM") = "" - ElseIf CveRubro = 4 Then - row("PS") = DdlSubTipoActivoFijo.SelectedItem.Text - row("CodigoPS") = DdlSubTipoActivoFijo.SelectedItem.Text - row("UM") = "" - Else - row("UM") = DdlUMInsumos.SelectedItem.Text - End If - - TmpDT.AcceptChanges() - - Alert("Cambios realizados correctamente.", TipoMensaje.MsgInformacion) - RegistraScript("$('#ModalControlAddPS').modal('hide')") - - Else - Alert("Error al Actualizar Detalle", TipoMensaje.MsgError) - End If - ObjContratos.Dispose() - - GvInsumos.EditIndex = -1 - LbTotalGeneralInsumos.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero - CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) - CveContratoDetalleEditar = -1 - - - End If - - + Else + + + If DdlRubro.SelectedValue.ToEntero = 1 And DdlProductowsInsumos.txtValue.Value.ToEntero <= 0 Then + Alert("Debe de seleccionar un producto.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + End If + + If CveContratoDetalleEditar = -1 Then + + Dim Row As DataRow = TmpDT.NewRow() + Row("Cantidad") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero + Row("CantidadContratada") = TxtCantidadInsumos.Text.ToDouble.FormatoNumero + + Row("PU") = TxtPUInsumos.Text.ToDouble.FormatoNumero + Row("Total") = (TxtCantidadInsumos.Text.ToDouble * TxtPUInsumos.Text.ToDouble).FormatoNumero + Row("CveTipoPresupuesto") = 1 + Row("NoIdentificacion") = "" 'TxtNoIdentificacionvInsumos.Text.Trim + Row("LimitarCantidad") = ChkLimitarCantidad.Checked + + Row("CveRubro") = DdlRubro.SelectedValue.ToEntero + Row("Rubro") = DdlRubro.SelectedItem.Text + + If DdlRubro.SelectedValue.ToEntero = 3 Then + + Row("CveActividad") = DdlActividades.SelectedValue.ToEntero + Row("Actividad") = DdlActividades.SelectedItem.Text + Row("Dias") = TxtDias.Text.ToEntero + Row("CveSubTipoActivoFijo") = -1 + + + Row("CveUM") = -1 + Row("UM") = "" + Row("CveClasificacion") = -1 + Row("Clasificacion") = "" + Row("CvePS") = -1 + Row("PS") = DdlActividades.SelectedItem.Text + Row("CodigoPS") = DdlActividades.SelectedItem.Text + + + ElseIf DdlRubro.SelectedValue.ToEntero = 4 Then + + Row("CveActividad") = -1 + Row("Actividad") = "" + Row("Dias") = TxtDias.Text.ToEntero + Row("CveSubTipoActivoFijo") = DdlSubTipoActivoFijo.SelectedValue.ToEntero + + + Row("CveUM") = -1 + Row("UM") = "" + Row("CveClasificacion") = -1 + Row("Clasificacion") = "" + Row("CvePS") = -1 + Row("PS") = DdlSubTipoActivoFijo.SelectedItem.Text + Row("CodigoPS") = DdlSubTipoActivoFijo.SelectedItem.Text + + Else + Row("CveActividad") = -1 + Row("Actividad") = "" + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + + + Row("CveUM") = DdlUMInsumos.SelectedValue.ToEntero + Row("UM") = DdlUMInsumos.SelectedItem + 'Row("CveClasificacion") = DdlClasificacionAddInsumos.SelectedValue + 'Row("Clasificacion") = DdlClasificacionAddInsumos.SelectedItem + Row("CvePS") = DdlProductowsInsumos.SelectedValue.ToEntero + Row("PS") = DdlProductowsInsumos.SelectedText + Row("CodigoPS") = DdlProductowsInsumos.SelectedText + + + + End If + + + Dim ObjContratos As New ClsContratos + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), "", + CveRubro:=Row("CveRubro").ToString.ToEntero, CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then + + + Row("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") + TmpDT.Rows.Add(Row) + Dim TotalRow = Row("Total").ToString.ToDouble + + CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) + + UpGVInsumos.Update() + LimpiarModalControl() + LbTotalGeneralInsumos.Text = (LbTotalGeneralInsumos.Text.ToDouble + TotalRow).ToString.FormatoNumero + 'LblImporte.Text = LbTotalGeneral.Text + TxtCantidadInsumos.Focus() + UpGral.Update() + + + If Not ChkContinualAgregandoControl.Checked Then + RegistraScript("$('#ModalControlAddPS').modal('hide')") + End If + + Else + Alert("Ocurrio un error al agregar el detalle", TipoMensaje.MsgError) + End If + + ObjContratos.Dispose() + + Else + + Dim Cantidad, PU As Double + Dim CvePS, CveUM As Integer + + Dim CveRubro As Integer = DdlRubro.SelectedValue.ToEntero + + Dim CveActividad As Integer = -1 + Dim CveSubTipoActivoFijo As Integer = -1 + Dim Dias As Integer = 0 + + If CveRubro = 3 Then + + CveSubTipoActivoFijo = -1 + CveActividad = DdlActividades.SelectedValue.ToEntero + Dias = TxtDias.Text.ToEntero + + CvePS = -1 + CveUM = -1 + + ElseIf CveRubro = 4 Then + + CveSubTipoActivoFijo = DdlSubTipoActivoFijo.SelectedValue.ToEntero + CveActividad = -1 + Dias = TxtDias.Text.ToEntero + + CvePS = -1 + CveUM = -1 + + Else + CvePS = DdlProductowsInsumos.SelectedValue.ToEntero + CveUM = DdlUMInsumos.SelectedValue.ToEntero + End If + + + Cantidad = TxtCantidadInsumos.Text.ToDouble + PU = TxtPUInsumos.Text.ToDouble + Dim limitarCantidad As Boolean = ChkLimitarCantidad.Checked + + + + Dim row = TmpDT.Select(String.Format(" CveContratoDetalle={0}", CveContratoDetalleEditar))(0) + + Dim ObjContratos As New ClsContratos + If ObjContratos.UpdateContratosDetalle(CveContratoDetalleEditar, CveContrato, CvePS, Cantidad, PU, UsuarioActual.CveUsuario, "", limitarCantidad, "", CveRubro:=CveRubro, CveActividad:=CveActividad, CveSubTipoActivoFijo:=CveSubTipoActivoFijo, Dias:=Dias) Then + + 'If Autorizado Then + ' Dim msj As String = String.Format("Se realizaron los siguientes cambios, el Presupuesto Interno se modificó: {1} {0} {2:C2} a {3} {0} {4:C2}", + ' row("PS").ToString, row("Cantidad").ToString, row("PU").ToString, Cantidad, PU) + ' guardarBitacora(msj) + 'End If + + + + row("Cantidad") = Cantidad + row("CantidadContratada") = Cantidad + row("PU") = PU + row("Total") = Cantidad * PU + row("CveUM") = CveUM + + row("NoIdentificacion") = "" 'NoIdentificacion + row("LimitarCantidad") = limitarCantidad + + row("CveActividad") = CveActividad + row("CveSubTipoActivoFijo") = CveSubTipoActivoFijo + row("Dias") = Dias + + + If CveRubro = 3 Then + row("PS") = DdlActividades.SelectedItem.Text + row("CodigoPS") = DdlActividades.SelectedItem.Text + row("UM") = "" + ElseIf CveRubro = 4 Then + row("PS") = DdlSubTipoActivoFijo.SelectedItem.Text + row("CodigoPS") = DdlSubTipoActivoFijo.SelectedItem.Text + row("UM") = "" + Else + row("UM") = DdlUMInsumos.SelectedItem.Text + End If + + TmpDT.AcceptChanges() + + Alert("Cambios realizados correctamente.", TipoMensaje.MsgInformacion) + RegistraScript("$('#ModalControlAddPS').modal('hide')") + + Else + Alert("Error al Actualizar Detalle", TipoMensaje.MsgError) + End If + ObjContratos.Dispose() + + GvInsumos.EditIndex = -1 + LbTotalGeneralInsumos.Text = TmpDT.FiltraParametros("CveTipoPresupuesto=1").SUM("Total").FormatoNumero + CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) + CveContratoDetalleEditar = -1 + + + End If - End Sub - + + + End Sub + #Region "GV PRESUPUESTOS" - + Protected Sub GVInsumos_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvInsumos.RowDataBound If e.Row.RowIndex > -1 Then + If e.Row.DBCampo("CveContratoDetalle") = "" Then + e.Row.CssClass = "SubTotales" + End If + e.Row.FCCheckBox("CHKPAvance").Visible = Autorizado 'e.Row.FCCheckBox("CHKPEstimacion").Visible = Autorizado @@ -2073,13 +2067,13 @@ Partial Class Contratos_ContratoObra 'e.Row.FCLinkButton("imgE").Visible = False 'e.Row.FCLinkButton("imgD").Visible = False End If - If e.Row.FCLabel("LtlLimitarCantidad").Text.ToString = "True" Then - e.Row.FCLabel("LtlLimitarCantidad").Text = "Si" - Else - e.Row.FCLabel("LtlLimitarCantidad").Text = "No" - End If - - End If + If e.Row.FCLabel("LtlLimitarCantidad").Text.ToString = "True" Then + e.Row.FCLabel("LtlLimitarCantidad").Text = "Si" + Else + e.Row.FCLabel("LtlLimitarCantidad").Text = "No" + End If + + End If If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) e.Row.FCDropDownList("DdlUMEdit").DataBind() @@ -2174,14 +2168,14 @@ Partial Class Contratos_ContratoObra ' Seleccionado = e.CommandArgument.ToString GvInsumos.SelectRow(e.CommandArgument.ToString.ToEntero - 1) End If - End Sub + End Sub #End Region - - + + #End Region - + #Region " TAB PRESUPUESTOS INTERNOS" - + Protected Sub AgregarInt_Click(sender As Object, e As EventArgs) Handles AgregarInt.Click Dim Row As DataRow = TmpDT.NewRow() Row("Cantidad") = TxtCantidadInt.Text.ToDouble.FormatoNumero @@ -2221,12 +2215,12 @@ Partial Class Contratos_ContratoObra 'Alert("No se pudo agregar el detalle") End If ObjContratos.Dispose() - End Sub - - + End Sub + + #Region "GVInternos" - - + + Protected Sub GVInt_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvInt.RowEditing GvInt.EditIndex = e.NewEditIndex GvInt.DataSource = TmpDT.FiltraParametros("CveTipoPresupuesto=1") @@ -2308,13 +2302,13 @@ Partial Class Contratos_ContratoObra ' Seleccionado = e.CommandArgument.ToString GvInt.SelectRow(e.CommandArgument.ToString.ToEntero - 1) End If - End Sub + End Sub #End Region - + #End Region - + #End Region - + #Region " TAB: REPORTE AVANCES " Private Sub CargaDatosAvance() If CveContrato <= 0 Then @@ -2348,22 +2342,22 @@ Partial Class Contratos_ContratoObra GvDatosAvance.UseAccessibleHeader = True GvDatosAvance.HeaderRow.TableSection = TableRowSection.TableHeader RegistraScript("OrdenarGV();") - End If - - - If ObjContratos.GetReporteContratosAvancesDetalleControl(CveContrato, UsuarioActual.CveEmpresa) Then - - GvDatosAvanceControl.DataSource = ObjContratos.DtResultados + End If + + + If ObjContratos.GetReporteContratosAvancesDetalleControl(CveContrato, UsuarioActual.CveEmpresa) Then + + GvDatosAvanceControl.DataSource = ObjContratos.DtResultados Else Alert("Ocurrió un Error al obtener el Reporte de Avances de control. Por favor vuelva a intentar", TipoMensaje.MsgError) - End If - - - GvDatosAvanceControl.DataBind() - - ObjContratos.Dispose() - UpGral.Update() - + End If + + + GvDatosAvanceControl.DataBind() + + ObjContratos.Dispose() + UpGral.Update() + End Sub Protected Sub GvDatosAvance_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosAvance.RowDataBound @@ -2384,11 +2378,11 @@ Partial Class Contratos_ContratoObra e.Row.FCLinkButton("LBAvanceXFacturarImporte").CommandArgument = Liga2 End If - End Sub - - - Protected Sub GvDatosAvanceControl_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosAvanceControl.RowDataBound - + End Sub + + + Protected Sub GvDatosAvanceControl_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatosAvanceControl.RowDataBound + If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("CveClasificacion").ToString.ToEntero = 0 Then @@ -2408,24 +2402,24 @@ Partial Class Contratos_ContratoObra End If End Sub - Protected Sub MuestaModalVentasAvance(sender As Object, e As EventArgs) - - Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow) - - GvDatosVentasAvance.Visible = True - GvDatosVentasAvanceInterno.Visible = False - GvDatosVentasAvanceInternoRH.Visible = False - GvDatosVentasAvanceInternoMaquinaria.Visible = False - - 'Dim Btn = CType(sender, LinkButton) - 'Dim Parametros = Btn.CommandArgument.Split("|"c) - - - Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero - Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero - Dim CodigoPS As String = GvRow.DataKey("CodigoPS") - Dim Clasificacion As String = GvRow.DataKey("Clasificacion") - + Protected Sub MuestaModalVentasAvance(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow) + + GvDatosVentasAvance.Visible = True + GvDatosVentasAvanceInterno.Visible = False + GvDatosVentasAvanceInternoRH.Visible = False + GvDatosVentasAvanceInternoMaquinaria.Visible = False + + 'Dim Btn = CType(sender, LinkButton) + 'Dim Parametros = Btn.CommandArgument.Split("|"c) + + + Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero + Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero + Dim CodigoPS As String = GvRow.DataKey("CodigoPS") + Dim Clasificacion As String = GvRow.DataKey("Clasificacion") + Dim ObjContratos As New ClsContratos If ObjContratos.GetVentasAvanceObra(CveContrato, CveClasificacion, CvePS, 1, -1, UsuarioActual.CveEmpresa) Then @@ -2436,54 +2430,54 @@ Partial Class Contratos_ContratoObra End If ObjContratos.Dispose() - GvDatosVentasAvance.DataBind() - - LbTituloModalVentasAvance.Text = "Ventas de Avance" - + GvDatosVentasAvance.DataBind() + + LbTituloModalVentasAvance.Text = "Ventas de Avance" + LbClasificacionVentasAvance.Text = Clasificacion LbPSVentasAvance.Text = CodigoPS UpVentasAvance.Update() - End Sub - - - Protected Sub MuestaModalVentasAvanceInterno(sender As Object, e As EventArgs) - - Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow) - - Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero - Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero - Dim CodigoPS As String = GvRow.DataKey("CodigoPS") - Dim Clasificacion As String = GvRow.DataKey("Clasificacion") - Dim CveRubro As Integer = GvRow.DataKey("CveRubro").ToEntero - - GvDatosVentasAvance.Visible = False - - If CveRubro = 3 Then - GvDatosVentasAvanceInterno.Visible = False - GvDatosVentasAvanceInternoRH.Visible = True - GvDatosVentasAvanceInternoMaquinaria.Visible = False - ElseIf CveRubro = 4 Then - GvDatosVentasAvanceInterno.Visible = False - GvDatosVentasAvanceInternoRH.Visible = False - GvDatosVentasAvanceInternoMaquinaria.Visible = True - Else - GvDatosVentasAvanceInterno.Visible = True - GvDatosVentasAvanceInternoRH.Visible = False - GvDatosVentasAvanceInternoMaquinaria.Visible = False - End If - + End Sub + + + Protected Sub MuestaModalVentasAvanceInterno(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow) + + Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero + Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero + Dim CodigoPS As String = GvRow.DataKey("CodigoPS") + Dim Clasificacion As String = GvRow.DataKey("Clasificacion") + Dim CveRubro As Integer = GvRow.DataKey("CveRubro").ToEntero + + GvDatosVentasAvance.Visible = False + + If CveRubro = 3 Then + GvDatosVentasAvanceInterno.Visible = False + GvDatosVentasAvanceInternoRH.Visible = True + GvDatosVentasAvanceInternoMaquinaria.Visible = False + ElseIf CveRubro = 4 Then + GvDatosVentasAvanceInterno.Visible = False + GvDatosVentasAvanceInternoRH.Visible = False + GvDatosVentasAvanceInternoMaquinaria.Visible = True + Else + GvDatosVentasAvanceInterno.Visible = True + GvDatosVentasAvanceInternoRH.Visible = False + GvDatosVentasAvanceInternoMaquinaria.Visible = False + End If + Dim ObjContratos As New ClsContratos - If ObjContratos.GetVentasAvanceObra(CveContrato, CveClasificacion, CvePS, 2, CveRubro, UsuarioActual.CveEmpresa) Then - - If CveRubro = 3 Then - GvDatosVentasAvanceInternoRH.DataSource = ObjContratos.DtResultados - ElseIf CveRubro = 4 Then - GvDatosVentasAvanceInternoMaquinaria.DataSource = ObjContratos.DtResultados - Else - GvDatosVentasAvanceInterno.DataSource = ObjContratos.DtResultados + If ObjContratos.GetVentasAvanceObra(CveContrato, CveClasificacion, CvePS, 2, CveRubro, UsuarioActual.CveEmpresa) Then + + If CveRubro = 3 Then + GvDatosVentasAvanceInternoRH.DataSource = ObjContratos.DtResultados + ElseIf CveRubro = 4 Then + GvDatosVentasAvanceInternoMaquinaria.DataSource = ObjContratos.DtResultados + Else + GvDatosVentasAvanceInterno.DataSource = ObjContratos.DtResultados End If RegistraScript("$('#ModalVentasAvance').modal('show');RecargaAvances = true;") @@ -2491,28 +2485,28 @@ Partial Class Contratos_ContratoObra Alert("Ocurrió un error al obtener el Listado de Ventas de Avance. Por favor vuelva a intentar", TipoMensaje.MsgError) End If - ObjContratos.Dispose() - - If CveRubro = 3 Then - GvDatosVentasAvanceInternoRH.DataBind() - ElseIf CveRubro = 4 Then - GvDatosVentasAvanceInternoMaquinaria.DataBind() - Else - GvDatosVentasAvanceInterno.DataBind() - End If - - - LbTituloModalVentasAvance.Text = "Compras de Avance" - + ObjContratos.Dispose() + + If CveRubro = 3 Then + GvDatosVentasAvanceInternoRH.DataBind() + ElseIf CveRubro = 4 Then + GvDatosVentasAvanceInternoMaquinaria.DataBind() + Else + GvDatosVentasAvanceInterno.DataBind() + End If + + + LbTituloModalVentasAvance.Text = "Compras de Avance" + LbClasificacionVentasAvance.Text = Clasificacion LbPSVentasAvance.Text = CodigoPS UpVentasAvance.Update() - End Sub - + End Sub + #End Region - + #Region " TAB: REPORTE AVANCES POR DOCUMENTO " Protected Sub RBLTipoDocto_SelectedIndexChanged(sender As Object, e As EventArgs) CargaDatosAvancePorDocumento() @@ -2529,8 +2523,8 @@ Partial Class Contratos_ContratoObra DtAvanceDocumento = ObjContratos.DtResultados If DtAvanceDocumento.Rows.Count > 0 Then 'LBImprimir.Visible = True - End If - ' LBImprimirInformacionG.Visible = True + End If + ' LBImprimirInformacionG.Visible = True Else Alert("Ocurrió un error al obtener el Reporte de Avances por Documento. Por favor vuelva a intentar", TipoMensaje.MsgError) End If @@ -2556,10 +2550,10 @@ Partial Class Contratos_ContratoObra e.Row.CssClass = "Totales" End If End If - End Sub - + End Sub + #End Region - + #Region " TAB: CONTRATO GASTOS " Private Sub MandaCorreo(Para As String, Asunto As String, Body As String) Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para) @@ -2785,9 +2779,9 @@ Partial Class Contratos_ContratoObra Protected Sub LnkDescargar_Click1(sender As Object, e As EventArgs) Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=CONG&CVECONTRATO={0}&CVECONTRATOGASTO={1}", CveContrato, gvRow.DataKey("CveContratoGasto").ToString))}'") - End Sub + End Sub #End Region - + #Region "TAB: PEDIDOS / DEVOLUCIONES" Private Sub CargaDatosPedDev() Dim ObjContratos As New ClsContratos @@ -2897,10 +2891,10 @@ Partial Class Contratos_ContratoObra End If End If - End Sub - + End Sub + #End Region - + #Region " TAB: ALMACEN - ACTIVOS FIJBtnAlmacenEsInterno_ClickOS " Private Sub CargaInventarios() @@ -3063,28 +3057,28 @@ Partial Class Contratos_ContratoObra GvDatosAlmacen.Columns(6).Visible = False CargaInventarios() - UPHajusteAF.Update() - ' UpHajusteAcciones.Update() - + UPHajusteAF.Update() + ' UpHajusteAcciones.Update() + End Sub - Protected Sub LnkAjusteAF_Click(sender As Object, e As EventArgs) - - ' LnkAjusteAF.Visible = False + Protected Sub LnkAjusteAF_Click(sender As Object, e As EventArgs) + + ' LnkAjusteAF.Visible = False DivHajusteAF.Visible = True GvDatosAlmacen.Columns(6).Visible = True CargaInventarios() - UPHajusteAF.Update() - ' UpHajusteAcciones.Update() + UPHajusteAF.Update() + ' UpHajusteAcciones.Update() UpAlmacen.Update() - End Sub - - - + End Sub + + + #Region " DEVOLUCION ALMACEN " Protected Sub BtnDevolucionAlmacen_Click(sender As Object, e As EventArgs) Dim ObjVentas As New ClsVentas @@ -3107,26 +3101,26 @@ Partial Class Contratos_ContratoObra End If ObjVentas.Dispose() - End Sub - - - - - 'Public Sub CargaDatosEncabezado() - - ' TablaUtilidad.Visible = True - ' LblUtilidad.Text = $"$ {(SumaAvance - SumaGasto).ToString.FormatoNumero()}" - - ' If (SumaAvance - SumaGasto) < 0 Then LblUtilidad.ForeColor = Drawing.Color.Red - ' LblFacturado.Text = SumaAvance.FormatoNumero - ' LblPorFacturar.Text = (LblImporte.Text.ToDouble - SumaAvance).FormatoNumero - - 'End Sub - + End Sub + + + + + 'Public Sub CargaDatosEncabezado() + + ' TablaUtilidad.Visible = True + ' LblUtilidad.Text = $"$ {(SumaAvance - SumaGasto).ToString.FormatoNumero()}" + + ' If (SumaAvance - SumaGasto) < 0 Then LblUtilidad.ForeColor = Drawing.Color.Red + ' LblFacturado.Text = SumaAvance.FormatoNumero + ' LblPorFacturar.Text = (LblImporte.Text.ToDouble - SumaAvance).FormatoNumero + + 'End Sub + #End Region - + #End Region - + #Region "TAB SISTEMA" Protected Sub ChkPermitirAvance_CheckedChanged(sender As Object, e As EventArgs) Dim ObjContrato As New ClsContratos @@ -3144,11 +3138,11 @@ Partial Class Contratos_ContratoObra ObjContrato.Dispose() Alert("Se ha permitido estimar en la sección", TipoMensaje.MsgInformacion) CargaDatos() - End Sub + End Sub #End Region - + #End Region - + #Region " BITACORA " Private Sub guardarBitacora(Descripcion As String) Dim ObjEventoBitacora As New ClsOIEventos @@ -3261,80 +3255,16 @@ Partial Class Contratos_ContratoObra txtFileBit.getfiles().Archivos.Clear() txtFileBit.Text = "" - End Sub - -#End Region - -#Region "SUBIR EXCEL" - Public Sub DescargarFormato() - Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\FormatoContrato.xlsx" - Dim Archivo As New IO.FileInfo(Directorio) - If Archivo.Exists Then - Response.Clear() - Response.ClearHeaders() - Response.ClearContent() - Response.AddHeader("Content-Disposition", "attachment; filename=" + Archivo.Name) - Response.AddHeader("Content-Length", Archivo.Length.ToString()) - Response.ContentType = "text/plain" - Response.Flush() - Response.TransmitFile(Archivo.FullName) - Response.End() - End If End Sub - 'Public Sub LbDescargarExcel_Click(sender As Object, e As EventArgs) Handles LbDescargarExcel.Click - ' DescargarFormato() - 'End Sub - Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable - SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) - Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath) - Dim unnamed As Integer = 0 - Dim cols As Integer - Dim columns As String() - Dim curRow As Integer = 0 - Dim curCol As Integer = 0 - Dim dataTable As DataTable = New DataTable() - Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0) +#End Region - For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1 +#Region "SUBIR EXCEL" - If firstRowHasHeaders Then - If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then - dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString()) - Else - dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) - End If - curRow = 1 - Else - dataTable.Columns.Add("Column " & (cols + 1)) - End If - Next + Private Function GetPS(Opt As String, Valor As String) As String - While curRow < worksheet.Rows.Count - columns = New String(cols - 1) {} - - For curCol = 0 To cols - 1 - - If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then - columns(curCol) = "" - Else - columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString() - End If - Next - - dataTable.Rows.Add(columns) - curRow += 1 - End While - - Return dataTable - End Function - - - - Private Function GetPS(Opt As String, Valor As String) As String - Dim StrReturn As String = String.Empty Dim CvePS As Integer = 0 @@ -3353,25 +3283,25 @@ Partial Class Contratos_ContratoObra Private Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") - ' CargarArchivo(Directorio, file.filename, Tipo) + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + ' CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) End If - End Sub - - + End Sub + + #End Region - - - + + + #Region " IMPRESION " - + #Region " IMPRIMIR AVANCE POR DOCUMENTO " - 'Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles LBImprimir.Click - ' GenerarPDF() - 'End Sub + 'Protected Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles LBImprimir.Click + ' GenerarPDF() + 'End Sub Private Sub GenerarPDF(Optional Formato As String = "PDF") Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) @@ -3397,24 +3327,24 @@ Partial Class Contratos_ContratoObra End If Dim Nombre As String = If(LtlTitulo.Text.Length > 20, LtlTitulo.Text.Substring(0, 20), LtlTitulo.Text) ImprimirPDF("Empresas/Grales/Formatos/RepContratoAvanceDocumento.rdlc", dt, params, $"{Nombre}-AvanceDocumento", Formato:=Formato) - End Sub - - - - + End Sub + + + + #End Region - + #Region "I M P R E S I O N D E G A S T O S" - 'Protected Sub ImgImprimirGastos_Click(sender As Object, e As EventArgs) Handles LBImprimirGastos.Click - ' GenerarPDFGastos() - 'End Sub + 'Protected Sub ImgImprimirGastos_Click(sender As Object, e As EventArgs) Handles LBImprimirGastos.Click + ' GenerarPDFGastos() + 'End Sub Private Sub GenerarPDFGastos(Optional Formato As String = "PDF") Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - ' Dim UtilidadGastos As String = IIf(LblUtilidad.Text <> "", LblUtilidad.Text, "-").ToString - - + Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) + ' Dim UtilidadGastos As String = IIf(LblUtilidad.Text <> "", LblUtilidad.Text, "-").ToString + + Dim dt As DataTable = DtGastos Dim params As New List(Of ReportParameter) params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) @@ -3427,9 +3357,9 @@ Partial Class Contratos_ContratoObra params.Add(New ReportParameter("FechaInicio", TxtFechaInicial.Text.Trim)) params.Add(New ReportParameter("FechaFin", TxtFechaFinal.Text.Trim)) params.Add(New ReportParameter("TipoContrato", TipoDocumento)) - params.Add(New ReportParameter("TotalContrato", LblImporte.Text)) - ' params.Add(New ReportParameter("Utilidad", UtilidadGastos)) - + params.Add(New ReportParameter("TotalContrato", LblImporte.Text)) + ' params.Add(New ReportParameter("Utilidad", UtilidadGastos)) + If Imagen.Exists Then params.Add(New ReportParameter("LogoPath", logouri)) Else @@ -3437,22 +3367,22 @@ Partial Class Contratos_ContratoObra End If Dim Nombre As String = If(LtlTitulo.Text.Length > 20, LtlTitulo.Text.Substring(0, 20), LtlTitulo.Text) ImprimirPDF("Empresas/Grales/Formatos/RepContratoGastos.rdlc", dt, params, $"{Nombre}-Gastos", Formato:=Formato) - End Sub - - 'Private Sub LBAgregarGasto_Click(sender As Object, e As EventArgs) Handles LBAgregarGasto.Click - ' TxtDescripcion.Text = "" - ' TxtImporteC.Text = "" - ' TxtFecha.Text = "" - ' UpAgregarGastos.Update() - ' RegistraScript("$('#ModalAgregarGastos').modal();") - 'End Sub - + End Sub + + 'Private Sub LBAgregarGasto_Click(sender As Object, e As EventArgs) Handles LBAgregarGasto.Click + ' TxtDescripcion.Text = "" + ' TxtImporteC.Text = "" + ' TxtFecha.Text = "" + ' UpAgregarGastos.Update() + ' RegistraScript("$('#ModalAgregarGastos').modal();") + 'End Sub + #End Region - + #Region "I M P R E S I O N D E S U M I N I S T R O S" - 'Protected Sub ImgImprimirSuministros_Click(sender As Object, e As EventArgs) Handles LbImprimirSuministros.Click - ' GenerarPDFSuministros() - 'End Sub + 'Protected Sub ImgImprimirSuministros_Click(sender As Object, e As EventArgs) Handles LbImprimirSuministros.Click + ' GenerarPDFSuministros() + 'End Sub Private Sub GenerarPDFSuministros(Optional Formato As String = "PDF") Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) @@ -3477,13 +3407,13 @@ Partial Class Contratos_ContratoObra End If Dim Nombre As String = If(LtlTitulo.Text.Length > 20, LtlTitulo.Text.Substring(0, 20), LtlTitulo.Text) ImprimirPDF("Empresas/Grales/Formatos/RepContratoSuministros.rdlc", dt, params, $"{Nombre}-Suministros", Formato:=Formato) - End Sub + End Sub #End Region - + #Region "I M P R E S I O N D E A V A N C E " - 'Private Sub lbImprimirAvance_Click(sender As Object, e As EventArgs) Handles lbImprimirAvance.Click - ' GenerarPDFAvance() - 'End Sub + 'Private Sub lbImprimirAvance_Click(sender As Object, e As EventArgs) Handles lbImprimirAvance.Click + ' GenerarPDFAvance() + 'End Sub Private Sub GenerarPDFAvance(Optional Formato As String = "PDF") Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) @@ -3509,13 +3439,13 @@ Partial Class Contratos_ContratoObra End If Dim Nombre As String = If(LtlTitulo.Text.Length > 20, LtlTitulo.Text.Substring(0, 20), LtlTitulo.Text) ImprimirPDF("Empresas/Grales/Formatos/ContratoAvance.rdlc", dt, params, $"{Nombre}-Avance", Formato:=Formato) - End Sub + End Sub #End Region - + #Region "I M P R E S I O N D E P R E S U P U E S T O " - 'Private Sub lLbImprimirPresupuesto_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuesto.Click - ' GenerarPDFPPresupuesto() - 'End Sub + 'Private Sub lLbImprimirPresupuesto_Click(sender As Object, e As EventArgs) Handles LbImprimirPresupuesto.Click + ' GenerarPDFPPresupuesto() + 'End Sub Private Sub GenerarPDFPPresupuesto(Optional Formato As String = "PDF") Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) @@ -3541,16 +3471,16 @@ Partial Class Contratos_ContratoObra End If Dim Nombre As String = If(LtlTitulo.Text.Length > 20, LtlTitulo.Text.Substring(0, 20), LtlTitulo.Text) ImprimirPDF("Empresas/Grales/Formatos/RepContratoPresupuestos.rdlc", dt, params, $"{Nombre}-Presupuestos", Formato:=Formato) - End Sub + End Sub #End Region - + #Region "I M P R E S I O N D E A C T I V O S F I J O S " - 'Private Sub LbImprmirAF_Click(sender As Object, e As EventArgs) Handles LbImprmirAF.Click - ' GenerarPDFActivosFijos() - 'End Sub - 'Private Sub LbImprmirAFExcel_Click(sender As Object, e As EventArgs) Handles LbImprmirAFExcel.Click - ' GenerarPDFActivosFijos("Excel") - 'End Sub + 'Private Sub LbImprmirAF_Click(sender As Object, e As EventArgs) Handles LbImprmirAF.Click + ' GenerarPDFActivosFijos() + 'End Sub + 'Private Sub LbImprmirAFExcel_Click(sender As Object, e As EventArgs) Handles LbImprmirAFExcel.Click + ' GenerarPDFActivosFijos("Excel") + 'End Sub Private Sub GenerarPDFActivosFijos(Optional Formato As String = "PDF") Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) @@ -3595,13 +3525,13 @@ Partial Class Contratos_ContratoObra End If Dim Nombre As String = If(LtlTitulo.Text.Length > 20, LtlTitulo.Text.Substring(0, 20), LtlTitulo.Text) ImprimirPDF("Empresas/Grales/Formatos/RepContratoActivosFijos.rdlc", dt, params, $"{Nombre}-ActivosFijos", Formato:=Formato) - End Sub - - + End Sub + + #End Region - + #Region " IMPRIMIR DOCUMENTO - SABE " - Public Sub DescarFormato(documento As String) + Public Sub DescargarFormato(documento As String) Dim PathRoot As String = Server.MapPath("/") Dim PathSource As String @@ -3663,26 +3593,26 @@ Partial Class Contratos_ContratoObra Private Sub CargaPlantillas() Dim ObjGral As New ClsGenerales If ObjGral.ContratosPlantillaGet(-1, UsuarioActual.CveEmpresa) Then - DtPlantillasContratos = ObjGral.DtResultados.FiltraParametros("Tipo = 'Con'") - ' DdlPlantillaContrato.DataSource = DtPlantillasContratos + DtPlantillasContratos = ObjGral.DtResultados.FiltraParametros("Tipo = 'Con'") + ' DdlPlantillaContrato.DataSource = DtPlantillasContratos Else DtPlantillasContratos = Nothing End If ObjGral.Dispose() 'DdlPlantillaContrato.DataSource = DtPlantillasContratos 'DdlPlantillaContrato.DataBind() - End Sub - - 'Protected Sub BtnImprimirC_Click(sender As Object, e As EventArgs) Handles liImprimir.Click - ' ' Dim docx As String = DtPlantillasContratos.FiltroPrimeroValor("URL", $"CveContratoPlantilla = {DdlPlantillaContrato.SelectedValue}") - ' ' DescarFormato(docx) - 'End Sub - + End Sub + + 'Protected Sub BtnImprimirC_Click(sender As Object, e As EventArgs) Handles liImprimir.Click + ' ' Dim docx As String = DtPlantillasContratos.FiltroPrimeroValor("URL", $"CveContratoPlantilla = {DdlPlantillaContrato.SelectedValue}") + ' ' DescarFormato(docx) + 'End Sub + #End Region - - + + #End Region - + #Region "CREAR A PARTIR DE" Private Sub BtnAgregarContratoHijo_Click(sender As Object, e As EventArgs) Handles BtnAgregarContratoHijo.Click Dim TieneError = False @@ -3692,10 +3622,10 @@ Partial Class Contratos_ContratoObra Try Dim CveContratoHijo As Integer = -1 - Dim Minimo, Maximo, Total As Double - - Minimo = -1 - Maximo = -1 + Dim Minimo, Maximo, Total As Double + + Minimo = -1 + Maximo = -1 Total = -1 'If txtMinimo.Text.ToDouble > 0 And chkDetalleContrato.Checked Then Minimo = txtMinimo.Text.ToDouble Else Minimo = -1 @@ -3819,97 +3749,97 @@ Partial Class Contratos_ContratoObra End If Return TieneError - End Function - - 'Private Sub AgregarMovimientosAFHijo(CveContratoHijo As Integer) - ' 'BUSCA LOS ACTIVOS FIJOS VIGENTES - ' Dim Dt As DataTable = DtMovimientos.FiltraParametros($"(CodigoPS IS NULL AND Cantidad - CantidadDevolucion > 0) OR (CodigoPS IS NOT NULL AND SerieFolioDevolucion IS NULL)") - - - ' Dim DtVentas As DataTable = Dt.FiltraParametros($"No = 0") - - ' Dim CveAlmacenOrigen As Integer = DdlAlmacenOrigen.SelectedValue.ToEntero - ' Dim CveAlmacenDestino As Integer = DdlAlmacenDestino.SelectedValue.ToEntero - ' Dim CveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero - - ' Dim CveConceptoSalida As Integer = 8 - ' Dim CveConceptoEntrada As Integer = 9 - ' Dim CveCliente As Integer = If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, DdlCliente.SelectedValue.ToEntero) - - ' Dim ObjInv As New ClsInventarios() - ' Try - ' ObjInv.IniciaTransacSQL() - ' Dim TieneError As Boolean = False - - ' For Each Dr As DataRow In DtVentas.Rows - - ' Dim CveVentaAlmacen As Integer = Dr("CveVenta").ToString.ToEntero - - ' 'Movimiento de salida por traspaso al almacen destino - ' Dim CveMovimientoSalida As Integer = ObjInv.AddMovimiento(CveAlmacenDestino, CveConceptoSalida, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, DdlSubProyectoContrato.SelectedValue.ToEntero, -1, CveContrato:=CveContrato, CveCliente:=CveCliente, CveAlmacenDestino:=CveAlmacenOrigen) - - ' If CveMovimientoSalida > 0 Then - ' For Each Row As DataRow In Dt.FiltraParametros($"CvePS IS NOT NULL AND CveVenta = {CveVentaAlmacen}").Rows - - ' Dim Cantidad As Double = Row("Cantidad").ToString.ToDouble - ' Dim CvePS As Integer = Row("CvePS").ToString.ToEntero - ' Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero - ' Dim CveUnidadMedida As Integer = Row("CveUnidadMedida").ToString.ToEntero - ' Dim PU As Double = Row("PU").ToString.ToDouble - - ' If Not ObjInv.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUnidadMedida, CvePS, PU, -1) Then - ' TieneError = True - ' Exit For - ' End If - ' Next - ' Else - ' TieneError = True - ' Exit For - ' End If - - ' 'Movimeinto de entrada por traspaso al almacen origen - ' Dim CveMovimientoEntrada As Integer = ObjInv.AddMovimiento(CveAlmacenOrigen, CveConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, DdlSubProyectoContrato.SelectedValue.ToEntero, -1, CveContrato:=CveContratoHijo, CveCliente:=CveCliente, CveAlmacenDestino:=CveAlmacenDestino) - - ' If CveMovimientoEntrada > 0 Then - ' For Each Row As DataRow In Dt.FiltraParametros($"CvePS IS NOT NULL AND CveVenta = {CveVentaAlmacen}").Rows - - ' Dim Cantidad As Double = Row("Cantidad").ToString.ToDouble - ' Dim CvePS As Integer = Row("CvePS").ToString.ToEntero - ' Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero - ' Dim CveUnidadMedida As Integer = Row("CveUnidadMedida").ToString.ToEntero - ' Dim PU As Double = Row("PU").ToString.ToDouble - - ' If Not ObjInv.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUnidadMedida, CvePS, PU, -1) Then - ' TieneError = True - ' Exit For - ' End If - ' Next - ' Else - ' TieneError = True - ' Exit For - ' End If - - ' Next - ' If TieneError Then - ' Alert("Ocurrió un error al traspasar los activos fijos", TipoMensaje.MsgAdvertencia) - ' ObjInv.RollBack() - ' Else - ' ObjInv.Commit() - ' End If - - ' Catch ex As Exception - ' ObjInv.RollBack() - ' OnError("Ocurrió un error al traspasar los activos fijos", ex) - ' End Try - ' ObjInv.Dispose() - - - 'End Sub - - - + End Function + + 'Private Sub AgregarMovimientosAFHijo(CveContratoHijo As Integer) + ' 'BUSCA LOS ACTIVOS FIJOS VIGENTES + ' Dim Dt As DataTable = DtMovimientos.FiltraParametros($"(CodigoPS IS NULL AND Cantidad - CantidadDevolucion > 0) OR (CodigoPS IS NOT NULL AND SerieFolioDevolucion IS NULL)") + + + ' Dim DtVentas As DataTable = Dt.FiltraParametros($"No = 0") + + ' Dim CveAlmacenOrigen As Integer = DdlAlmacenOrigen.SelectedValue.ToEntero + ' Dim CveAlmacenDestino As Integer = DdlAlmacenDestino.SelectedValue.ToEntero + ' Dim CveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero + + ' Dim CveConceptoSalida As Integer = 8 + ' Dim CveConceptoEntrada As Integer = 9 + ' Dim CveCliente As Integer = If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, DdlCliente.SelectedValue.ToEntero) + + ' Dim ObjInv As New ClsInventarios() + ' Try + ' ObjInv.IniciaTransacSQL() + ' Dim TieneError As Boolean = False + + ' For Each Dr As DataRow In DtVentas.Rows + + ' Dim CveVentaAlmacen As Integer = Dr("CveVenta").ToString.ToEntero + + ' 'Movimiento de salida por traspaso al almacen destino + ' Dim CveMovimientoSalida As Integer = ObjInv.AddMovimiento(CveAlmacenDestino, CveConceptoSalida, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, DdlSubProyectoContrato.SelectedValue.ToEntero, -1, CveContrato:=CveContrato, CveCliente:=CveCliente, CveAlmacenDestino:=CveAlmacenOrigen) + + ' If CveMovimientoSalida > 0 Then + ' For Each Row As DataRow In Dt.FiltraParametros($"CvePS IS NOT NULL AND CveVenta = {CveVentaAlmacen}").Rows + + ' Dim Cantidad As Double = Row("Cantidad").ToString.ToDouble + ' Dim CvePS As Integer = Row("CvePS").ToString.ToEntero + ' Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero + ' Dim CveUnidadMedida As Integer = Row("CveUnidadMedida").ToString.ToEntero + ' Dim PU As Double = Row("PU").ToString.ToDouble + + ' If Not ObjInv.AddMovimientoDetalle(CveMovimientoSalida, Cantidad, CveUnidadMedida, CvePS, PU, -1) Then + ' TieneError = True + ' Exit For + ' End If + ' Next + ' Else + ' TieneError = True + ' Exit For + ' End If + + ' 'Movimeinto de entrada por traspaso al almacen origen + ' Dim CveMovimientoEntrada As Integer = ObjInv.AddMovimiento(CveAlmacenOrigen, CveConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, DdlSubProyectoContrato.SelectedValue.ToEntero, -1, CveContrato:=CveContratoHijo, CveCliente:=CveCliente, CveAlmacenDestino:=CveAlmacenDestino) + + ' If CveMovimientoEntrada > 0 Then + ' For Each Row As DataRow In Dt.FiltraParametros($"CvePS IS NOT NULL AND CveVenta = {CveVentaAlmacen}").Rows + + ' Dim Cantidad As Double = Row("Cantidad").ToString.ToDouble + ' Dim CvePS As Integer = Row("CvePS").ToString.ToEntero + ' Dim CveVentaDetalle As Integer = Row("CveVentaDetalle").ToString.ToEntero + ' Dim CveUnidadMedida As Integer = Row("CveUnidadMedida").ToString.ToEntero + ' Dim PU As Double = Row("PU").ToString.ToDouble + + ' If Not ObjInv.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUnidadMedida, CvePS, PU, -1) Then + ' TieneError = True + ' Exit For + ' End If + ' Next + ' Else + ' TieneError = True + ' Exit For + ' End If + + ' Next + ' If TieneError Then + ' Alert("Ocurrió un error al traspasar los activos fijos", TipoMensaje.MsgAdvertencia) + ' ObjInv.RollBack() + ' Else + ' ObjInv.Commit() + ' End If + + ' Catch ex As Exception + ' ObjInv.RollBack() + ' OnError("Ocurrió un error al traspasar los activos fijos", ex) + ' End Try + ' ObjInv.Dispose() + + + 'End Sub + + + #End Region - + #Region "FIANZAS" Protected Sub LimpiarCamposModalFianzas() txtFolioFianza.Text = "" @@ -3925,12 +3855,12 @@ Partial Class Contratos_ContratoObra LnkDescargar.Visible = False 'BtnGuardarFianza.Text = "Guardar" UPModalFianza.Update() - Me.RegistraScript("$('#DvModalFianza').modal();") - - End Sub - - - + Me.RegistraScript("$('#DvModalFianza').modal();") + + End Sub + + + Private Sub GuardaAdjunto(FolioFechaVencimiento As String) If Not TxtModalAdjuntoArchivo.getfiles.Archivos.Count > 0 Then Exit Sub @@ -3952,13 +3882,13 @@ Partial Class Contratos_ContratoObra Catch ex As Exception Alert("Ocurrió un error al guardar el archivo Adjunto. Por favor vuelva a intentar.", TipoMensaje.MsgError) End Try - End Sub - - + End Sub + + Protected Sub LnkDescargar_Click(sender As Object, e As EventArgs) 'DescargarAdjunto() - End Sub - + End Sub + Protected Sub imgEFianzaGv_Click(sender As Object, e As EventArgs) LimpiarCamposModalFianzas() EsEditarFianza = True @@ -3972,11 +3902,11 @@ Partial Class Contratos_ContratoObra txtFechaVenFianza.Text = GvRow.DataKey("FechaVencimiento").ToString() LnkDescargar.Visible = GvRow.DataKey("Adjunto").ToString <> "" - txth4Fianza.InnerText = "Editar Fianza" - + txth4Fianza.InnerText = "Editar Fianza" + UPModalFianza.Update() - Me.RegistraScript("$('#DvModalFianza').modal();") - + Me.RegistraScript("$('#DvModalFianza').modal();") + End Sub Protected Sub CreaDtTmpFianzas() DtTmpFianzas = New DataTable() @@ -3989,8 +3919,8 @@ Partial Class Contratos_ContratoObra DtTmpFianzas.Columns.Add("FechaVencimiento", GetType(String)) DtTmpFianzas.Columns.Add("Adjunto", GetType(String)) - DtTmpFianzasInicial = DtTmpFianzas.Copy - + DtTmpFianzasInicial = DtTmpFianzas.Copy + End Sub Protected Function GuardaFianzas(ObjContrato As ClsContratos) As Boolean @@ -4037,8 +3967,8 @@ Partial Class Contratos_ContratoObra Protected Sub LnkDescargaAdjunto_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow) - IndexFianzaEditar = GvRow.DataItemIndex - ' DescargarAdjunto() + IndexFianzaEditar = GvRow.DataItemIndex + ' DescargarAdjunto() End Sub Protected Sub GvFianzas_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then @@ -4048,10 +3978,10 @@ Partial Class Contratos_ContratoObra ScriptManager.GetCurrent(Me).RegisterPostBackControl(lb) End If End If - End Sub - + End Sub + #End Region - + #Region "CONVENIO DE PRECIO FIJO" Protected Sub CargaConvenioPrecioFijo() '12/04/2018 - oculta campo de licitacion, portlet finanzas y campo tipo de garantia @@ -4060,9 +3990,9 @@ Partial Class Contratos_ContratoObra 'DivTipoGarantia.Visible = False UpGral.Update() - End Sub + End Sub #End Region - + #Region "NOMENCLATURA CONTRATOS" Protected Sub GetNoContratoNuevo() Dim ObjContratos As New ClsContratos() @@ -4092,488 +4022,481 @@ Partial Class Contratos_ContratoObra End If ObjContratos.Dispose() - End Sub + End Sub #End Region - + #Region "IMPUESOS LOCALES" - 'Protected Sub ChkImpuestosLocales_CheckedChanged(sender As Object, e As EventArgs) - ' If ChkImpuestosLocales.Checked Then - ' GvImpuestosLocales.Visible = True - ' Else - ' GvImpuestosLocales.Visible = False - ' End If - 'End Sub - 'Public Sub CargaImpuestosLocales() - ' Dim ObjContratos As New ClsContratos - ' If ObjContratos.GetContratoImpuestosLocales(CveContrato, UsuarioActual.CveEmpresa) Then - ' GvImpuestosLocales.DataSource = ObjContratos.DtResultados - ' End If - ' ObjContratos.Dispose() - ' GvImpuestosLocales.DataBind() - ' UpImpuestos.Update() - 'End Sub - - + 'Protected Sub ChkImpuestosLocales_CheckedChanged(sender As Object, e As EventArgs) + ' If ChkImpuestosLocales.Checked Then + ' GvImpuestosLocales.Visible = True + ' Else + ' GvImpuestosLocales.Visible = False + ' End If + 'End Sub + 'Public Sub CargaImpuestosLocales() + ' Dim ObjContratos As New ClsContratos + ' If ObjContratos.GetContratoImpuestosLocales(CveContrato, UsuarioActual.CveEmpresa) Then + ' GvImpuestosLocales.DataSource = ObjContratos.DtResultados + ' End If + ' ObjContratos.Dispose() + ' GvImpuestosLocales.DataBind() + ' UpImpuestos.Update() + 'End Sub + + #End Region - - - - Property ModalVentasPSAdd As Boolean - Get - If ViewState("ModalVentasAdd") Is Nothing Then - Return False - Else - Return Boolean.Parse(ViewState("ModalVentasAdd").ToString) - End If - End Get - Set(value As Boolean) - ViewState("ModalVentasAdd") = value - End Set - End Property - - - Property ModalControlPSAdd As Boolean - Get - If ViewState("ModalControlPSAdd") Is Nothing Then - Return False - Else - Return Boolean.Parse(ViewState("ModalControlPSAdd").ToString) - End If - End Get - Set(value As Boolean) - ViewState("ModalControlPSAdd") = value - End Set - End Property - - Property Carga As Boolean - Get - If ViewState("ModalControlPSAdd") Is Nothing Then - Return False - Else - Return Boolean.Parse(ViewState("ModalControlPSAdd").ToString) - End If - End Get - Set(value As Boolean) - ViewState("ModalControlPSAdd") = value - End Set - End Property - - Enum EnumTipoCargaPresupuesto - Ventas - Control - End Enum - - Property TipoCargaPresupuesto As EnumTipoCargaPresupuesto - Get - If ViewState("TipoCargaPresupuesto") Is Nothing Then - Return EnumTipoCargaPresupuesto.Ventas - Else - Return DirectCast(ViewState("TipoCargaPresupuesto"), EnumTipoCargaPresupuesto) - End If - End Get - Set(value As EnumTipoCargaPresupuesto) - ViewState("TipoCargaPresupuesto") = value - End Set - End Property - - - Property CveContratoDetalleEditar As Integer - Get - - If ViewState("CveContratoDetalleEditar") Is Nothing Then - Return -1 - Else - Return ViewState("CveContratoDetalleEditar").ToString.ToEntero - End If - - End Get - Set(value As Integer) - ViewState("CveContratoDetalleEditar") = value - End Set - End Property - - Protected Sub LnkModalAddPresupuestoVentas_Click(sender As Object, e As EventArgs) - - LnlModalcargaPresupuestoTitulo.Text = "Carga Presupuesto Ventas" - UpModalCargaPresupuesto.Update() - RegistraScript("$('#ModalUploadPresupuesto').modal('show')") - TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas - - End Sub - - Protected Sub LnkModalAddPresupuestoControl_Click(sender As Object, e As EventArgs) - - LnlModalcargaPresupuestoTitulo.Text = "Carga Presupuesto Control" - UpModalCargaPresupuesto.Update() - RegistraScript("$('#ModalUploadPresupuesto').modal('show')") - TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Control - - End Sub - - Protected Sub LnkModalAddPSVentas_Click(sender As Object, e As EventArgs) - CveContratoDetalleEditar = -1 - ModalVentasPSAdd = True - ChkContinualAgregandoVentas.Visible = True - ChkContinualAgregandoVentas.Checked = True - LimpiarModalVentas() - RegistraScript("$('#ModalVentasAddPS').modal('show')") - - End Sub - - Protected Sub LnkModalAddPSControl_Click(sender As Object, e As EventArgs) - CveContratoDetalleEditar = -1 - ModalControlPSAdd = True - ChkContinualAgregandoControl.Visible = True - ChkContinualAgregandoControl.Checked = True - LimpiarModalControl() - RegistraScript("$('#ModalControlAddPS').modal('show')") - - End Sub - - - Protected Sub LnkEditarPresupuestoVentaDetalle_Click(sender As Object, e As EventArgs) - - Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) - LimpiarModalVentas() - - CveContratoDetalleEditar = GvRow.DataKey("CveContratoDetalle").ToEntero - - TxtCantidad.Text = GvRow.DataKey("CantidadContratada").ToDouble.ToString - - DdlClasificacionAdd.SelectedValueExist(GvRow.DataKey("CveClasificacion").ToEntero) - - DdlProductows.txtText.Value = GvRow.DataKey("PS").ToString - DdlProductows.txtValue.Value = GvRow.DataKey("CvePS").ToString - - DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductows.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) - DdlUM.DataBind() - DdlUM.SelectedValueExist(GvRow.DataKey("CveUM").ToDouble.ToString) - - TxtPU.Text = GvRow.DataKey("PU").ToDouble.ToString - - - - ModalVentasPSAdd = False - ChkContinualAgregandoVentas.Visible = False - ChkContinualAgregandoVentas.Checked = False - - - RegistraScript("$('#ModalVentasAddPS').modal('show')") - End Sub - Protected Sub LnkEditarPresupuestoControlDetalle_Click(sender As Object, e As EventArgs) - - Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) - - Dim CveRubro As Integer = gvRow.DataKey("CveRubro").ToEntero - - LimpiarModalControl() - - CveContratoDetalleEditar = gvRow.DataKey("CveContratoDetalle").ToEntero - - TxtCantidadInsumos.Text = gvRow.DataKey("CantidadContratada").ToDouble.ToString - - - DdlClasificacionAddInsumos.SelectedValueExist(gvRow.DataKey("CveClasificacion").ToEntero) - - DdlProductowsInsumos.ddl.SelectedValueExist(gvRow.DataKey("CvePS").ToString.ToEntero) - - - DdlUMInsumos.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductowsInsumos.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) - DdlUMInsumos.DataBind() - DdlUMInsumos.SelectedValueExist(gvRow.DataKey("CveUM").ToDouble.ToString) - - TxtPUInsumos.Text = gvRow.DataKey("PU").ToDouble.ToString - Dim limitarCantidad As String = gvRow.DataKey("LimitarCantidad").ToString - ChkLimitarCantidad.Checked = limitarCantidad = "True" - - DdlRubro.SelectedValueExist(gvRow.DataKey("CveRubro").ToString) - - If CveRubro = 3 Then - - DVDias.Visible = True - DVActividadesRH.Visible = True - DVSubTipoActivoFijo.Visible = False - - DVClasificacion.Visible = False - DVPS.Visible = False - DVUM.Visible = False - - DdlActividades.SelectedValueExist(gvRow.DataKey("CveActividad")) - DdlSubTipoActivoFijo.SelectedValueExist(-1) - TxtDias.Text = gvRow.DataKey("Dias") - - ElseIf CveRubro = 4 Then - - - DVDias.Visible = True - DVActividadesRH.Visible = False - DVSubTipoActivoFijo.Visible = True - - - DVClasificacion.Visible = False - DVPS.Visible = False - DVUM.Visible = False - - DdlActividades.SelectedValueExist(-1) - DdlSubTipoActivoFijo.SelectedValueExist(gvRow.DataKey("CveSubTipoActivoFijo")) - TxtDias.Text = gvRow.DataKey("Dias") - - Else - DVDias.Visible = False - DVActividadesRH.Visible = False - DVSubTipoActivoFijo.Visible = False - - DVClasificacion.Visible = True - DVPS.Visible = True - DVUM.Visible = True - - DdlActividades.SelectedValueExist(-1) - DdlSubTipoActivoFijo.SelectedValueExist(-1) - TxtDias.Text = "0" - - End If - - - - ModalControlPSAdd = False - ChkContinualAgregandoControl.Visible = False - ChkContinualAgregandoControl.Checked = False - - UpModalControlAddPS.Update() - - RegistraScript("$('#ModalControlAddPS').modal('show')") - End Sub - - - Private Sub LimpiarModalVentas() - - 'TxtOCInterna.Text = "" - TxtCantidad.Text = "" - 'ChkLimitarVenta.Checked = False - 'TxtNoIdentificacionv.Text = "" - DdlClasificacionAdd.SelectedValueExist(-1) - DdlProductows.txtText.Value = "" - DdlProductows.txtValue.Value = "" - DdlUM.SelectedValueExist(-1) - TxtPU.Text = "" - ChkLimitarCantidad.Checked = False - - - If ModalVentasPSAdd = True Then - LtlModalVentasPSTitulo.Text = "Agregar Producto Presupuesto de Ventas" - Else - LtlModalVentasPSTitulo.Text = "Editar Producto Presupuesto de Ventas" - End If - - - UpModalVentasAddPS.Update() - - End Sub - - Private Sub LimpiarModalControl() - - DdlActividades.Items.Clear() - DdlSubTipoActivoFijo.Items.Clear() - - - DdlActividades.DataSource = GlobalDTRHActividades(UsuarioActual.CveEmpresa) - DdlActividades.DataBind() - DdlActividades.Items.Insert(0, New ListItem("Seleccione una", "-1")) - - DdlSubTipoActivoFijo.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa) - DdlSubTipoActivoFijo.DataBind() - DdlSubTipoActivoFijo.Items.Insert(0, New ListItem("Seleccione uno", "-1")) - - TxtCantidadInsumos.Text = "" - - DdlClasificacionAddInsumos.SelectedValueExist(-1) - DdlProductowsInsumos.txtText.Value = "" - DdlProductowsInsumos.txtValue.Value = "" - DdlUMInsumos.SelectedValueExist(-1) - TxtPUInsumos.Text = "" - - DdlRubro.SelectedValue = "2" - - DVClasificacion.Visible = True - DVPS.Visible = True - DVUM.Visible = True - - DVDias.Visible = False - DVActividadesRH.Visible = False - - TxtDias.Text = "" - DdlActividades.SelectedValueExist(-1) - - - - If ModalControlPSAdd = True Then - LtlModalControlPSTitulo.Text = "Agregar Producto Presupuesto Control" - Else - LtlModalControlPSTitulo.Text = "Editar Producto Presupuesto Control" - End If - - UpModalControlAddPS.Update() - - End Sub - - Private Sub LimpiarModalMaquinaria() - - DdlPersonal.Items.Clear() - - - - - DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) - DdlPersonal.DataBind() - DdlPersonal.Items.Insert(0, New ListItem("Seleccione uno", "-1")) - - Dim Objcontratos As New ClsContratos - If Objcontratos.GetContratosMaquinariaFlotillaSubTipoAF(CveContrato, UsuarioActual.CveEmpresa) Then - DdlSubTipoAF.DataSource = Objcontratos.DtResultados - End If - Objcontratos.Dispose() - DdlSubTipoAF.DataBind() - DdlSubTipoAF.Items.Insert(0, New ListItem("Seleccione uno", "-1")) - - - TxtFechaMaquinaria.Text = "" - - - - UpModalMaquinariaFlotilla.Update() - - End Sub - - Protected Sub BtnCargaPresupuesto_Click(sender As Object, e As EventArgs) - - Dim DTCargaPresupuesto As New DataTable - Dim DTCargaPresupuestoInsumos As New DataTable - Dim DTCargaPresupuestoManoObra As New DataTable - Dim DTCargaPresupuestoFlotillas As New DataTable - - - If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then - - DTCargaPresupuesto = CargaPreSupuestoExcel("Presupuesto") - - If DTCargaPresupuesto.Rows.Count > 0 Then - ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, Nothing, Nothing) - Else - Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia) - End If - - Else - - DTCargaPresupuesto = CargaPreSupuestoExcel("Insumos") - DTCargaPresupuestoManoObra = CargaPreSupuestoExcel("ManoObra") - DTCargaPresupuestoFlotillas = CargaPreSupuestoExcel("Maquinaria") - - ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, DTCargaPresupuestoManoObra, DTCargaPresupuestoFlotillas) - - End If - - TxtModalCargaPresupuesto.Text = "" - - End Sub - - Protected Sub BtnDecargaFormato_Click(sender As Object, e As EventArgs) - - - Dim FI As New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx") - - If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then - FI = New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx") - Else - FI = New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObraInterno.xlsx") - End If - - - If FI.Exists Then - - Response.ContentType = "application/octet-stream" - - If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then - Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObra.xlsx") - Else - Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObraInterno.xlsx") - End If - - Response.TransmitFile(FI.FullName) - Response.End() - - End If - - - End Sub - - - Private Function CargaPreSupuestoExcel(Hoja As String) As DataTable - + + + + Property ModalVentasPSAdd As Boolean + Get + If ViewState("ModalVentasAdd") Is Nothing Then + Return False + Else + Return Boolean.Parse(ViewState("ModalVentasAdd").ToString) + End If + End Get + Set(value As Boolean) + ViewState("ModalVentasAdd") = value + End Set + End Property + + + Property ModalControlPSAdd As Boolean + Get + If ViewState("ModalControlPSAdd") Is Nothing Then + Return False + Else + Return Boolean.Parse(ViewState("ModalControlPSAdd").ToString) + End If + End Get + Set(value As Boolean) + ViewState("ModalControlPSAdd") = value + End Set + End Property + + Property Carga As Boolean + Get + If ViewState("ModalControlPSAdd") Is Nothing Then + Return False + Else + Return Boolean.Parse(ViewState("ModalControlPSAdd").ToString) + End If + End Get + Set(value As Boolean) + ViewState("ModalControlPSAdd") = value + End Set + End Property + + Enum EnumTipoCargaPresupuesto + Ventas + Control + End Enum + + Property TipoCargaPresupuesto As EnumTipoCargaPresupuesto + Get + If ViewState("TipoCargaPresupuesto") Is Nothing Then + Return EnumTipoCargaPresupuesto.Ventas + Else + Return DirectCast(ViewState("TipoCargaPresupuesto"), EnumTipoCargaPresupuesto) + End If + End Get + Set(value As EnumTipoCargaPresupuesto) + ViewState("TipoCargaPresupuesto") = value + End Set + End Property + + + Property CveContratoDetalleEditar As Integer + Get + + If ViewState("CveContratoDetalleEditar") Is Nothing Then + Return -1 + Else + Return ViewState("CveContratoDetalleEditar").ToString.ToEntero + End If + + End Get + Set(value As Integer) + ViewState("CveContratoDetalleEditar") = value + End Set + End Property + + Protected Sub LnkModalAddPresupuestoVentas_Click(sender As Object, e As EventArgs) + + LnlModalcargaPresupuestoTitulo.Text = "Carga Presupuesto Ventas" + UpModalCargaPresupuesto.Update() + RegistraScript("$('#ModalUploadPresupuesto').modal('show')") + TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas + + End Sub + + Protected Sub LnkModalAddPresupuestoControl_Click(sender As Object, e As EventArgs) + + LnlModalcargaPresupuestoTitulo.Text = "Carga Presupuesto Control" + UpModalCargaPresupuesto.Update() + RegistraScript("$('#ModalUploadPresupuesto').modal('show')") + TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Control + + End Sub + + Protected Sub LnkModalAddPSVentas_Click(sender As Object, e As EventArgs) + CveContratoDetalleEditar = -1 + ModalVentasPSAdd = True + ChkContinualAgregandoVentas.Visible = True + ChkContinualAgregandoVentas.Checked = True + LimpiarModalVentas() + RegistraScript("$('#ModalVentasAddPS').modal('show')") + + End Sub + + Protected Sub LnkModalAddPSControl_Click(sender As Object, e As EventArgs) + CveContratoDetalleEditar = -1 + ModalControlPSAdd = True + ChkContinualAgregandoControl.Visible = True + ChkContinualAgregandoControl.Checked = True + LimpiarModalControl() + RegistraScript("$('#ModalControlAddPS').modal('show')") + + End Sub + + + Protected Sub LnkEditarPresupuestoVentaDetalle_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + LimpiarModalVentas() + + CveContratoDetalleEditar = GvRow.DataKey("CveContratoDetalle").ToEntero + + TxtCantidad.Text = GvRow.DataKey("CantidadContratada").ToDouble.ToString + + DdlClasificacionAdd.SelectedValueExist(GvRow.DataKey("CveClasificacion").ToEntero) + + DdlProductows.txtText.Value = GvRow.DataKey("PS").ToString + DdlProductows.txtValue.Value = GvRow.DataKey("CvePS").ToString + + DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductows.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) + DdlUM.DataBind() + DdlUM.SelectedValueExist(GvRow.DataKey("CveUM").ToDouble.ToString) + + TxtPU.Text = GvRow.DataKey("PU").ToDouble.ToString + + + + ModalVentasPSAdd = False + ChkContinualAgregandoVentas.Visible = False + ChkContinualAgregandoVentas.Checked = False + + + RegistraScript("$('#ModalVentasAddPS').modal('show')") + End Sub + Protected Sub LnkEditarPresupuestoControlDetalle_Click(sender As Object, e As EventArgs) + + Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + + Dim CveRubro As Integer = gvRow.DataKey("CveRubro").ToEntero + + LimpiarModalControl() + + CveContratoDetalleEditar = gvRow.DataKey("CveContratoDetalle").ToEntero + + TxtCantidadInsumos.Text = gvRow.DataKey("CantidadContratada").ToDouble.ToString + + + ' DdlClasificacionAddInsumos.SelectedValueExist(gvRow.DataKey("CveClasificacion").ToEntero) + + DdlProductowsInsumos.ddl.SelectedValueExist(gvRow.DataKey("CvePS").ToString.ToEntero) + + + DdlUMInsumos.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductowsInsumos.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) + DdlUMInsumos.DataBind() + DdlUMInsumos.SelectedValueExist(gvRow.DataKey("CveUM").ToDouble.ToString) + + TxtPUInsumos.Text = gvRow.DataKey("PU").ToDouble.ToString + Dim limitarCantidad As String = gvRow.DataKey("LimitarCantidad").ToString + ChkLimitarCantidad.Checked = limitarCantidad = "True" + + DdlRubro.SelectedValueExist(gvRow.DataKey("CveRubro").ToString) + + If CveRubro = 3 Then + + DVDias.Visible = True + DVActividadesRH.Visible = True + DVSubTipoActivoFijo.Visible = False + + ' DVClasificacion.Visible = False + DVPS.Visible = False + DVUM.Visible = False + + DdlActividades.SelectedValueExist(gvRow.DataKey("CveActividad")) + DdlSubTipoActivoFijo.SelectedValueExist(-1) + TxtDias.Text = gvRow.DataKey("Dias") + + ElseIf CveRubro = 4 Then + + + DVDias.Visible = True + DVActividadesRH.Visible = False + DVSubTipoActivoFijo.Visible = True + + + 'DVClasificacion.Visible = False + DVPS.Visible = False + DVUM.Visible = False + + DdlActividades.SelectedValueExist(-1) + DdlSubTipoActivoFijo.SelectedValueExist(gvRow.DataKey("CveSubTipoActivoFijo")) + TxtDias.Text = gvRow.DataKey("Dias") + + Else + DVDias.Visible = False + DVActividadesRH.Visible = False + DVSubTipoActivoFijo.Visible = False + + 'DVClasificacion.Visible = True + DVPS.Visible = True + DVUM.Visible = True + + DdlActividades.SelectedValueExist(-1) + DdlSubTipoActivoFijo.SelectedValueExist(-1) + TxtDias.Text = "0" + + End If + + + ModalControlPSAdd = False + ChkContinualAgregandoControl.Visible = False + ChkContinualAgregandoControl.Checked = False + + UpModalControlAddPS.Update() + + RegistraScript("$('#ModalControlAddPS').modal('show')") + End Sub + + + Private Sub LimpiarModalVentas() + + 'TxtOCInterna.Text = "" + TxtCantidad.Text = "" + 'ChkLimitarVenta.Checked = False + 'TxtNoIdentificacionv.Text = "" + DdlClasificacionAdd.SelectedValueExist(-1) + DdlProductows.txtText.Value = "" + DdlProductows.txtValue.Value = "" + DdlUM.SelectedValueExist(-1) + TxtPU.Text = "" + ChkLimitarCantidad.Checked = False + + + If ModalVentasPSAdd = True Then + LtlModalVentasPSTitulo.Text = "Agregar Producto Presupuesto de Ventas" + Else + LtlModalVentasPSTitulo.Text = "Editar Producto Presupuesto de Ventas" + End If + + + UpModalVentasAddPS.Update() + + End Sub + + Private Sub LimpiarModalControl() + + DdlActividades.Items.Clear() + DdlSubTipoActivoFijo.Items.Clear() + + + DdlActividades.DataSource = GlobalDTRHActividades(UsuarioActual.CveEmpresa) + DdlActividades.DataBind() + DdlActividades.Items.Insert(0, New ListItem("Seleccione una", "-1")) + + DdlSubTipoActivoFijo.DataSource = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa) + DdlSubTipoActivoFijo.DataBind() + DdlSubTipoActivoFijo.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + TxtCantidadInsumos.Text = "" + + ' DdlClasificacionAddInsumos.SelectedValueExist(-1) + DdlProductowsInsumos.txtText.Value = "" + DdlProductowsInsumos.txtValue.Value = "" + DdlUMInsumos.SelectedValueExist(-1) + TxtPUInsumos.Text = "" + + DdlRubro.SelectedValue = "2" + + ' DVClasificacion.Visible = True + DVPS.Visible = True + DVUM.Visible = True + + DVDias.Visible = False + DVActividadesRH.Visible = False + + TxtDias.Text = "" + DdlActividades.SelectedValueExist(-1) + + + + If ModalControlPSAdd = True Then + LtlModalControlPSTitulo.Text = "Agregar Producto Presupuesto Control" + Else + LtlModalControlPSTitulo.Text = "Editar Producto Presupuesto Control" + End If + + UpModalControlAddPS.Update() + + End Sub + + Private Sub LimpiarModalMaquinaria() + + DdlPersonal.Items.Clear() + + + + + DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) + DdlPersonal.DataBind() + DdlPersonal.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + Dim Objcontratos As New ClsContratos + If Objcontratos.GetContratosMaquinariaFlotillaSubTipoAF(CveContrato, UsuarioActual.CveEmpresa) Then + DdlSubTipoAF.DataSource = Objcontratos.DtResultados + End If + Objcontratos.Dispose() + DdlSubTipoAF.DataBind() + DdlSubTipoAF.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + + TxtFechaMaquinaria.Text = "" + + + + UpModalMaquinariaFlotilla.Update() + + End Sub + + Protected Sub BtnCargaPresupuesto_Click(sender As Object, e As EventArgs) + + Dim DTCargaPresupuesto As New DataTable + Dim DTCargaPresupuestoInsumos As New DataTable + Dim DTCargaPresupuestoManoObra As New DataTable + Dim DTCargaPresupuestoFlotillas As New DataTable + Dim DTCargaPresupuestoIndirectos As New DataTable + + + If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then + + DTCargaPresupuesto = CargaPreSupuestoExcel("Presupuesto") + + If DTCargaPresupuesto.Rows.Count > 0 Then + ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, Nothing, Nothing, Nothing) + Else + Alert("No se encintraron partidas en el documento", TipoMensaje.MsgAdvertencia) + End If + + Else + + DTCargaPresupuesto = CargaPreSupuestoExcel("Insumos") + DTCargaPresupuestoManoObra = CargaPreSupuestoExcel("ManoObra") + DTCargaPresupuestoFlotillas = CargaPresupuestoExcel("Maquinaria") + DTCargaPresupuestoIndirectos = CargaPresupuestoExcel("Indirectos") + + ProcesaDatosCargaPresupuesto(DTCargaPresupuesto, DTCargaPresupuestoManoObra, DTCargaPresupuestoFlotillas, DTCargaPresupuestoIndirectos) + + End If + + TxtModalCargaPresupuesto.Text = "" + + End Sub + + Protected Sub BtnDecargaFormato_Click(sender As Object, e As EventArgs) + + Dim FI As New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx") + + If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then + FI = New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObra.xlsx") + Else + FI = New IO.FileInfo($"{Extensiones.DirectorioBaseEmpresas}\Empresas\Grales\Formatos\FormatoPresupuestoObraInterno.xlsx") + End If + + + If FI.Exists Then + + Response.ContentType = "application/octet-stream" + + If TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas Then + Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObra.xlsx") + Else + Response.AppendHeader("Content-Disposition", $"attachment; filename=FormatoPresupuestoObraInterno.xlsx") + End If + + Response.TransmitFile(FI.FullName) + Response.End() + + End If + + End Sub + + + Private Function CargaPresupuestoExcel(Hoja As String) As DataTable + Dim FileExtension As String = "-1" Dim Filesgral As List(Of Archivo) = TxtModalCargaPresupuesto.getfiles().Archivos - Dim Filename As String = "" - Dim DTPS = New DataTable - + Dim Filename As String = "" + Dim DTPS = New DataTable + For Each fileItem As Archivo In Filesgral FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + If Not FileExtension.ToUpper.Contiene("XLSX", "XSL") Then + Alert("El archivo no es una archivo de Excel", TipoMensaje.MsgAdvertencia) + Exit For + End If - If Not FileExtension.ToUpper.Contiene("XLSX", "XSL") Then - Alert("El archivo no es una archivo de Excel", TipoMensaje.MsgAdvertencia) - Exit For - End If - - Dim tempArray() As String - tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) - SpreadsheetInfo.SetLicense(Extensiones.SerialGemBoxSpreadsheet) - Dim workbook = ExcelFile.Load(fileItem.FileUrl) - Dim worksheet = workbook.Worksheets(Hoja) - DTPS = worksheet.CreateDataTable(New CreateDataTableOptions() With - { - .ColumnHeaders = True, - .StartRow = 0, - .NumberOfColumns = 6, - .NumberOfRows = worksheet.Rows.Count, - .Resolution = ColumnTypeResolution.AutoPreferStringCurrentCulture - }) - - Next - - - - RegistraScript("$('#ModalUploadPresupuesto').modal('hide')") - - UpModalCargaPresupuesto.Update() - - - DTPS = DTPS.FiltraParametros("Cantidad > 0") - - - Return DTPS - - - End Function - - - Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable, DTCargaPresupuestoManoObra As DataTable, DTCargaPresupuestoFlotillas As DataTable) - - - If Not DTPresupuesto Is Nothing Then - DTPresupuesto.CaseSensitive = False - End If - - If Not DTCargaPresupuestoManoObra Is Nothing Then - DTCargaPresupuestoManoObra.CaseSensitive = False - End If - - If Not DTCargaPresupuestoFlotillas Is Nothing Then - DTCargaPresupuestoFlotillas.CaseSensitive = False - End If - - Dim ErrorProceso = False - + tempArray = fileItem.filename.ToString().Split("-".ToCharArray()) + SpreadsheetInfo.SetLicense(Extensiones.SerialGemBoxSpreadsheet) + Dim workbook = ExcelFile.Load(fileItem.FileUrl) + Dim worksheet = workbook.Worksheets(Hoja) + DTPS = worksheet.CreateDataTable(New CreateDataTableOptions() With + { + .ColumnHeaders = True, + .StartRow = 0, + .NumberOfColumns = 6, + .NumberOfRows = worksheet.Rows.Count, + .Resolution = ColumnTypeResolution.AutoPreferStringCurrentCulture + }) + + Next + + RegistraScript("$('#ModalUploadPresupuesto').modal('hide')") + UpModalCargaPresupuesto.Update() + DTPS = DTPS.FiltraParametros("Cantidad > 0") + + Return DTPS + End Function + + + Private Sub ProcesaDatosCargaPresupuesto(DTPresupuesto As DataTable, DTCargaPresupuestoManoObra As DataTable, DTCargaPresupuestoFlotillas As DataTable, DTCargaPresupuestoIndirectos As DataTable) + + + If Not DTPresupuesto Is Nothing Then + DTPresupuesto.CaseSensitive = False + End If + + If Not DTCargaPresupuestoManoObra Is Nothing Then + DTCargaPresupuestoManoObra.CaseSensitive = False + End If + + If Not DTCargaPresupuestoFlotillas Is Nothing Then + DTCargaPresupuestoFlotillas.CaseSensitive = False + End If + + If Not DTCargaPresupuestoIndirectos Is Nothing Then + DTCargaPresupuestoIndirectos.CaseSensitive = False + End If + + Dim ErrorProceso = False + Dim DTPS = New DataTable DTPS.Columns.Add("CveContratoDetalle", GetType(Integer)) DTPS.Columns.Add("Cantidad", GetType(Double)) @@ -4597,843 +4520,926 @@ Partial Class Contratos_ContratoObra DTPS.Columns.Add("NoIdentificacion", GetType(String)) DTPS.Columns.Add("LimitarCantidad", GetType(Integer)) DTPS.Columns.Add("OCInterna", GetType(String)) - DTPS.Columns.Add("Observacion", GetType(String)) - - DTPS.Columns.Add("CveRubro", GetType(Integer)) - DTPS.Columns.Add("CveActividad", GetType(Integer)) - DTPS.Columns.Add("CveSubTipoActivoFijo", GetType(Integer)) - - DTPS.Columns.Add("Rubro", GetType(String)) - DTPS.Columns.Add("Actividad", GetType(String)) - DTPS.Columns.Add("SubTipoActivoFijo", GetType(String)) - DTPS.Columns.Add("Dias", GetType(Integer)) - - Dim RowNoEncontrados As String = "" - - If Not DTPresupuesto Is Nothing Then - - For Each DrowPS As DataRow In DTPresupuesto.Rows - - Dim CvePS As Integer = -1 - Dim CveUM As Integer = -1 - Dim StrArray() As String - - - StrArray = GetPS("Codigo", DrowPS("Codigo").ToString).Split("|"c) - - If StrArray.Length > 0 Then - - If CBool(StrArray(0)) = True Then - CvePS = StrArray(1).ToEntero - - End If - - End If - - - If CvePS = -1 Then - - StrArray = GetPS("PS", DrowPS("Producto").ToString).Split("|"c) - - If StrArray.Length > 0 Then - If CBool(StrArray(0)) = True Then - CvePS = StrArray(1).ToEntero - End If - End If - - If CvePS = -1 Then - - Dim ObjPS As New ClsProductosServicios - - Dim CveClasificacion As Integer - If DrowPS.Table.Columns.Contains("Clasificacion") Then - CveClasificacion = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion = '{0}'", DrowPS("Clasificacion").ToString.Trim)).ToEntero - Else - CveClasificacion = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveClasificacion").ToString.ToEntero 'toma el primero - End If - - Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{ DrowPS("UnidadMedida").ToString}' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString}'").ToString.ToEntero - - If Not CveUnidadMedida > 0 Then - CveUnidadMedida = GlobalDTUnidadesMedida(CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveUnidadMedida").ToString.ToEntero - End If - - If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, DrowPS("Codigo").ToString.Trim, "", "", DrowPS("Producto").ToString, DrowPS("PU").ToString.ToDouble, 0, 0, False, 0, False, If(TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas, True, False), - UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, CveTipoPS:=2, CveSATPS:=-1, CveMarca:=-1, CveTamaño:=-1, CveMedida:=-1, CveRinTamaño:=-1, CveModelo:=-1, Litraje:=-1, IEPSPorcentaje:=-1, CveClasificacion2:=-1, CveClasificacionDetalle:=-1) > 0 Then - CvePS = ObjPS.CvePS - Else - CvePS = -1 - RowNoEncontrados &= "Producto: " & StrArray(1) & "<\BR>" - End If - - ObjPS.Dispose() - - End If - - End If - - - If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then - - CveUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $" UnidadMedida = '{ DrowPS("UnidadMedida").ToString.Trim }' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString.Trim }'").ToEntero - - If CveUM <= 0 Then - CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero - End If - - - Dim Row As DataRow = DTPS.NewRow() - - Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble - Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble - Row("CveUM") = CveUM - Row("UM") = "" - Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero - Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString - Row("CvePS") = CvePS - Row("PS") = DrowPS("Producto").ToString - Row("CodigoPS") = DrowPS("Producto").ToString - Row("PU") = DrowPS("PU").ToString.ToDouble - Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble - - Select Case TipoCargaPresupuesto - Case EnumTipoCargaPresupuesto.Ventas - - Row("CveTipoPresupuesto") = 2 - Row("CveRubro") = 1 - Row("CveActividad") = -1 - Row("CveSubTipoActivoFijo") = -1 - Row("Dias") = 0 - - Exit Select - Case EnumTipoCargaPresupuesto.Control - Row("CveTipoPresupuesto") = 1 - Row("CveRubro") = 2 - Row("CveActividad") = -1 - Row("CveSubTipoActivoFijo") = -1 - Row("Dias") = 0 - Exit Select - Case Else - Row("CveTipoPresupuesto") = 1 - Row("CveActividad") = -1 - Row("CveSubTipoActivoFijo") = -1 - Row("Dias") = 0 - End Select - - - Row("NoIdentificacion") = "" - Row("OCInterna") = "" - Row("LimitarCantidad") = 0 - Row("Observacion") = "" - - DTPS.Rows.Add(Row) - Else - ErrorProceso = True - End If - Next - - End If - - - - If Not DTCargaPresupuestoManoObra Is Nothing And Not ErrorProceso Then - - - For Each DrowPS As DataRow In DTCargaPresupuestoManoObra.Rows - - Dim CveActividad As Integer = 0 - Dim Actividad As String - - - If DrowPS("Actividad").ToString.Trim.Length > 0 Then - GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing - CveActividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActividad", $" Actividad = '{ DrowPS("Actividad").ToString.Trim }'").ToEntero - - If CveActividad <= 0 Then - - - Dim ObjRH As New ClsRH() - - If ObjRH.AddActividades(DrowPS("Actividad").ToString.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - - CveActividad = ObjRH.CveActividad - - If CveActividad <= 0 Then - ErrorProceso = True - End If - - GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing - - Else - ErrorProceso = True - End If - - ObjRH.Dispose() - - End If - - - If CveActividad > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 And Not ErrorProceso Then - - Actividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Actividad", $" CveActividad = {CveActividad}") - - Dim Row As DataRow = DTPS.NewRow() - Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble - Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble - Row("CveUM") = -1 - Row("UM") = "Actividad RH" - Row("CveClasificacion") = -1 - Row("Clasificacion") = "" - Row("CvePS") = -1 - Row("PS") = Actividad - Row("CodigoPS") = Actividad - Row("PU") = DrowPS("PU").ToString.ToDouble - Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble - - Row("CveTipoPresupuesto") = 1 - Row("CveRubro") = 3 - Row("CveActividad") = CveActividad - Row("CveSubTipoActivoFijo") = -1 - Row("Dias") = DrowPS("Dias").ToString.ToEntero - - Row("NoIdentificacion") = "" - Row("OCInterna") = "" - Row("LimitarCantidad") = 0 - Row("Observacion") = "" - - DTPS.Rows.Add(Row) - Else - ErrorProceso = True - End If - End If - - - Next - - End If - - If Not DTCargaPresupuestoFlotillas Is Nothing Then - - For Each DrowPS As DataRow In DTCargaPresupuestoFlotillas.Rows - - Dim CveSubTipoActivoFijo As Integer = 0 - Dim SubTipoActivoFijo As String = DrowPS("SubTipoAF").ToString - - CveSubTipoActivoFijo = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubTipoActivoFijo", $" SubTipoActivoFijo = '{DrowPS("SubTipoAF").ToString }'").ToEntero - - If CveSubTipoActivoFijo > 0 Then - - Dim Row As DataRow = DTPS.NewRow() - Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble - Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble - Row("CveUM") = -1 - Row("UM") = "Maquinaria Flotilla" - Row("CveClasificacion") = -1 - Row("Clasificacion") = "" - Row("CvePS") = -1 - Row("PS") = SubTipoActivoFijo - Row("CodigoPS") = SubTipoActivoFijo - Row("PU") = DrowPS("PU").ToString.ToDouble - Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble - - Row("CveTipoPresupuesto") = 1 - Row("CveRubro") = 3 - Row("CveActividad") = -1 - Row("CveSubTipoActivoFijo") = CveSubTipoActivoFijo - Row("Dias") = DrowPS("Horas").ToString.ToEntero - - Row("NoIdentificacion") = "" - Row("OCInterna") = "" - Row("LimitarCantidad") = 0 - Row("Observacion") = "" - - DTPS.Rows.Add(Row) - Else - ErrorProceso = True - RowNoEncontrados &= "Sub Tipo: " & DrowPS("SubTipoAF").ToString & "<\BR>" - End If - - - Next - - - End If - - - If Not ErrorProceso Then - - Dim ObjContratos As New ClsContratos - Dim TotalRow As Double = 0 - ObjContratos.IniciaTransacSQL() - - For Each Row As DataRow In DTPS.Rows - - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, - Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString, CveRubro:=Row("CveRubro").ToString.ToEntero, - CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then - - If Autorizado Then - Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con rubro {4} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"), Row("CveRubro")) - guardarBitacora(msj) - End If - - Dim NrowTmpDT As DataRow = TmpDT.NewRow - - - NrowTmpDT("Cantidad") = Row("Cantidad") - NrowTmpDT("CantidadContratada") = Row("CantidadContratada") - NrowTmpDT("CveUM") = Row("CveUM") - NrowTmpDT("UM") = Row("UM") - NrowTmpDT("CveClasificacion") = Row("CveClasificacion") - NrowTmpDT("Clasificacion") = Row("Clasificacion") - NrowTmpDT("CvePS") = Row("CvePS") - - - NrowTmpDT("PS") = Row("PS") - NrowTmpDT("CodigoPS") = Row("CodigoPS") - - - - - NrowTmpDT("PU") = Row("PU") - NrowTmpDT("Total") = Row("Total") - NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto") - NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion") - NrowTmpDT("OCInterna") = Row("OCInterna") - NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad") - NrowTmpDT("Observacion") = Row("Observacion") - - NrowTmpDT("CveRubro") = Row("CveRubro") - NrowTmpDT("CveActividad") = Row("CveActividad") - NrowTmpDT("CveSubTipoActivoFijo") = Row("CveSubTipoActivoFijo") - - NrowTmpDT("Rubro") = Row("Rubro") - NrowTmpDT("Actividad") = Row("Actividad") - NrowTmpDT("SubTipoActivoFijo") = Row("SubTipoActivoFijo") - NrowTmpDT("Dias") = Row("Dias") - - - NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") - - TmpDT.Rows.Add(NrowTmpDT) - TmpDT.AcceptChanges() - - TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble - Else - ErrorProceso = True - Exit For - End If - Next - - - If ErrorProceso Then - ObjContratos.RollBack() - Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError) - Else - - ObjContratos.Commit() - Alert("Presupuesto Cargado correctamente") - - - Select Case TipoCargaPresupuesto - Case EnumTipoCargaPresupuesto.Ventas - CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) - UpGV.Update() - Exit Select - Case EnumTipoCargaPresupuesto.Control - CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) - UpGVInsumos.Update() - Exit Select - Case Else - - End Select - - LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero - LblImporte.Text = LbTotalGeneral.Text - UpGral.Update() - - End If - - ObjContratos.Dispose() - - - End If - - - - If RowNoEncontrados.Length > 0 Then - Alert($"Productos y Sub Tipos no encontrados
    {RowNoEncontrados} ", TipoMensaje.MsgAdvertencia) - End If - - - - - End Sub - - - - Protected Sub LnkHabilitaAvance_Click(sender As Object, e As EventArgs) - - Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) - - Dim PermitirAvance As Integer = GvRow.DataKey("PermitirAvance").ToEntero - - 'Get the button that raised the event - 'Dim btn As CheckBox = DirectCast(sender, CheckBox) - 'Dim gvr As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow) - + DTPS.Columns.Add("Observacion", GetType(String)) + + DTPS.Columns.Add("CveRubro", GetType(Integer)) + DTPS.Columns.Add("CveActividad", GetType(Integer)) + DTPS.Columns.Add("CveSubTipoActivoFijo", GetType(Integer)) + + DTPS.Columns.Add("Rubro", GetType(String)) + DTPS.Columns.Add("Actividad", GetType(String)) + DTPS.Columns.Add("SubTipoActivoFijo", GetType(String)) + DTPS.Columns.Add("Dias", GetType(Integer)) + + Dim RowNoEncontrados As String = "" + + If Not DTPresupuesto Is Nothing Then + + For Each DrowPS As DataRow In DTPresupuesto.Rows + + Dim CvePS As Integer = -1 + Dim CveUM As Integer = -1 + Dim StrArray() As String + StrArray = GetPS("Codigo", DrowPS("Codigo").ToString).Split("|"c) + + If StrArray.Length > 0 Then + If CBool(StrArray(0)) = True Then + CvePS = StrArray(1).ToEntero + End If + End If + + + If CvePS = -1 Then + + StrArray = GetPS("PS", DrowPS("Producto").ToString).Split("|"c) + If StrArray.Length > 0 Then + If CBool(StrArray(0)) = True Then + CvePS = StrArray(1).ToEntero + End If + End If + + If CvePS = -1 Then + + Dim ObjPS As New ClsProductosServicios + + Dim CveClasificacion As Integer + If DrowPS.Table.Columns.Contains("Clasificacion") Then + CveClasificacion = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion = '{0}'", DrowPS("Clasificacion").ToString.Trim)).ToEntero + Else + CveClasificacion = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveClasificacion").ToString.ToEntero 'toma el primero + End If + + Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{ DrowPS("UnidadMedida").ToString}' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString}'").ToString.ToEntero + + If Not CveUnidadMedida > 0 Then + CveUnidadMedida = GlobalDTUnidadesMedida(CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveUnidadMedida").ToString.ToEntero + End If + + If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, DrowPS("Codigo").ToString.Trim, "", "", DrowPS("Producto").ToString, DrowPS("PU").ToString.ToDouble, 0, 0, False, 0, False, If(TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas, True, False), + UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, CveTipoPS:=2, CveSATPS:=-1, CveMarca:=-1, CveTamaño:=-1, CveMedida:=-1, CveRinTamaño:=-1, CveModelo:=-1, Litraje:=-1, IEPSPorcentaje:=-1, CveClasificacion2:=-1, CveClasificacionDetalle:=-1) > 0 Then + CvePS = ObjPS.CvePS + Else + CvePS = -1 + RowNoEncontrados &= "Producto: " & StrArray(1) & "<\BR>" + End If + + ObjPS.Dispose() + + End If + + End If + + + If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then + + CveUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $" UnidadMedida = '{ DrowPS("UnidadMedida").ToString.Trim }' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString.Trim }'").ToEntero + + If CveUM <= 0 Then + CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero + End If + + + Dim Row As DataRow = DTPS.NewRow() + + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble + Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble + Row("CveUM") = CveUM + Row("UM") = "" + Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero + Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString + Row("CvePS") = CvePS + Row("PS") = DrowPS("Producto").ToString + Row("CodigoPS") = DrowPS("Producto").ToString + Row("PU") = DrowPS("PU").ToString.ToDouble + Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + + Select Case TipoCargaPresupuesto + Case EnumTipoCargaPresupuesto.Ventas + + Row("CveTipoPresupuesto") = 2 + Row("CveRubro") = 1 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + + Exit Select + Case EnumTipoCargaPresupuesto.Control + Row("CveTipoPresupuesto") = 1 + Row("CveRubro") = 2 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + Exit Select + Case Else + Row("CveTipoPresupuesto") = 1 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + End Select + + + Row("NoIdentificacion") = "" + Row("OCInterna") = "" + Row("LimitarCantidad") = 0 + Row("Observacion") = "" + + DTPS.Rows.Add(Row) + Else + ErrorProceso = True + End If + Next + + End If + + + + If Not DTCargaPresupuestoManoObra Is Nothing And Not ErrorProceso Then + + + For Each DrowPS As DataRow In DTCargaPresupuestoManoObra.Rows + + Dim CveActividad As Integer = 0 + Dim Actividad As String + + + If DrowPS("Actividad").ToString.Trim.Length > 0 Then + GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing + CveActividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveActividad", $" Actividad = '{ DrowPS("Actividad").ToString.Trim }'").ToEntero + + If CveActividad <= 0 Then + + + Dim ObjRH As New ClsRH() + + If ObjRH.AddActividades(DrowPS("Actividad").ToString.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + + CveActividad = ObjRH.CveActividad + + If CveActividad <= 0 Then + ErrorProceso = True + End If + + GlobalDTRHActividades(UsuarioActual.CveEmpresa) = Nothing + + Else + ErrorProceso = True + End If + + ObjRH.Dispose() + + End If + + + If CveActividad > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 And Not ErrorProceso Then + + Actividad = GlobalDTRHActividades(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Actividad", $" CveActividad = {CveActividad}") + + Dim Row As DataRow = DTPS.NewRow() + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble + Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble + Row("CveUM") = -1 + Row("UM") = "Actividad RH" + Row("CveClasificacion") = -1 + Row("Clasificacion") = "" + Row("CvePS") = -1 + Row("PS") = Actividad + Row("CodigoPS") = Actividad + Row("PU") = DrowPS("PU").ToString.ToDouble + Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + + Row("CveTipoPresupuesto") = 1 + Row("CveRubro") = 3 + Row("CveActividad") = CveActividad + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = DrowPS("Dias").ToString.ToEntero + + Row("NoIdentificacion") = "" + Row("OCInterna") = "" + Row("LimitarCantidad") = 0 + Row("Observacion") = "" + + DTPS.Rows.Add(Row) + Else + ErrorProceso = True + End If + End If + + + Next + + End If + + If Not DTCargaPresupuestoFlotillas Is Nothing Then + + For Each DrowPS As DataRow In DTCargaPresupuestoFlotillas.Rows + + Dim CveSubTipoActivoFijo As Integer = 0 + Dim SubTipoActivoFijo As String = DrowPS("SubTipoAF").ToString + + CveSubTipoActivoFijo = GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubTipoActivoFijo", $" SubTipoActivoFijo = '{DrowPS("SubTipoAF").ToString }'").ToEntero + + If CveSubTipoActivoFijo > 0 Then + + Dim Row As DataRow = DTPS.NewRow() + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble + Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble + Row("CveUM") = -1 + Row("UM") = "Maquinaria Flotilla" + Row("CveClasificacion") = -1 + Row("Clasificacion") = "" + Row("CvePS") = -1 + Row("PS") = SubTipoActivoFijo + Row("CodigoPS") = SubTipoActivoFijo + Row("PU") = DrowPS("PU").ToString.ToDouble + Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + + Row("CveTipoPresupuesto") = 1 + Row("CveRubro") = 3 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = CveSubTipoActivoFijo + Row("Dias") = DrowPS("Horas").ToString.ToEntero + + Row("NoIdentificacion") = "" + Row("OCInterna") = "" + Row("LimitarCantidad") = 0 + Row("Observacion") = "" + + DTPS.Rows.Add(Row) + Else + ErrorProceso = True + RowNoEncontrados &= "Sub Tipo: " & DrowPS("SubTipoAF").ToString & "<\BR>" + End If + Next + End If + + If Not DTCargaPresupuestoIndirectos Is Nothing Then + + For Each DrowPS As DataRow In DTCargaPresupuestoIndirectos.Rows + + Dim CvePS As Integer = -1 + Dim CveUM As Integer = -1 + Dim StrArray() As String + StrArray = GetPS("Codigo", DrowPS("Codigo").ToString).Split("|"c) + + If StrArray.Length > 0 Then + If CBool(StrArray(0)) = True Then + CvePS = StrArray(1).ToEntero + End If + End If + + + If CvePS = -1 Then + + StrArray = GetPS("PS", DrowPS("Producto").ToString).Split("|"c) + If StrArray.Length > 0 Then + If CBool(StrArray(0)) = True Then + CvePS = StrArray(1).ToEntero + End If + End If + + If CvePS = -1 Then + + Dim ObjPS As New ClsProductosServicios + + Dim CveClasificacion As Integer + If DrowPS.Table.Columns.Contains("Clasificacion") Then + CveClasificacion = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("Clasificacion = '{0}'", DrowPS("Clasificacion").ToString.Trim)).ToEntero + Else + CveClasificacion = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveClasificacion").ToString.ToEntero 'toma el primero + End If + + Dim CveUnidadMedida As Integer = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{ DrowPS("UnidadMedida").ToString}' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString}'").ToString.ToEntero + + If Not CveUnidadMedida > 0 Then + CveUnidadMedida = GlobalDTUnidadesMedida(CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)("CveUnidadMedida").ToString.ToEntero + End If + + If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, DrowPS("Codigo").ToString.Trim, "", "", DrowPS("Producto").ToString, DrowPS("PU").ToString.ToDouble, 0, 0, False, 0, False, If(TipoCargaPresupuesto = EnumTipoCargaPresupuesto.Ventas, True, False), + UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, CveTipoPS:=2, CveSATPS:=-1, CveMarca:=-1, CveTamaño:=-1, CveMedida:=-1, CveRinTamaño:=-1, CveModelo:=-1, Litraje:=-1, IEPSPorcentaje:=-1, CveClasificacion2:=-1, CveClasificacionDetalle:=-1) > 0 Then + CvePS = ObjPS.CvePS + Else + CvePS = -1 + RowNoEncontrados &= "Producto: " & StrArray(1) & "<\BR>" + End If + + ObjPS.Dispose() + + End If + + End If + + + If CvePS > 0 And DrowPS("Cantidad").ToString.ToDouble > 0 Then + + CveUM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $" UnidadMedida = '{ DrowPS("UnidadMedida").ToString.Trim }' OR Abreviatura = '{ DrowPS("UnidadMedida").ToString.Trim }'").ToEntero + + If CveUM <= 0 Then + CveUM = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveUnidadMedida", "").ToString.ToEntero + End If + + + Dim Row As DataRow = DTPS.NewRow() + + Row("Cantidad") = DrowPS("Cantidad").ToString.ToDouble + Row("CantidadContratada") = DrowPS("Cantidad").ToString.ToDouble + Row("CveUM") = CveUM + Row("UM") = "" + Row("CveClasificacion") = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion", "").ToString.ToEntero + Row("Clasificacion") = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = '{ Row("CveClasificacion").ToString }'").ToString + Row("CvePS") = CvePS + Row("PS") = DrowPS("Producto").ToString + Row("CodigoPS") = DrowPS("Producto").ToString + Row("PU") = DrowPS("PU").ToString.ToDouble + Row("Total") = DrowPS("Cantidad").ToString.ToDouble * DrowPS("PU").ToString.ToDouble + + Select Case TipoCargaPresupuesto + Case EnumTipoCargaPresupuesto.Control + Row("CveTipoPresupuesto") = 1 + Row("CveRubro") = 5 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + Exit Select + Case Else + Row("CveTipoPresupuesto") = 1 + Row("CveActividad") = -1 + Row("CveSubTipoActivoFijo") = -1 + Row("Dias") = 0 + End Select + + + Row("NoIdentificacion") = "" + Row("OCInterna") = "" + Row("LimitarCantidad") = 0 + Row("Observacion") = "" + + DTPS.Rows.Add(Row) + Else + ErrorProceso = True + End If + Next + + End If + + If Not ErrorProceso Then + + Dim ObjContratos As New ClsContratos + Dim TotalRow As Double = 0 + ObjContratos.IniciaTransacSQL() + + For Each Row As DataRow In DTPS.Rows + + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, + Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), Row("OCInterna").ToString, Observacion:=Row("Observacion").ToString, CveRubro:=Row("CveRubro").ToString.ToEntero, + CveActividad:=Row("CveActividad").ToString.ToEntero, CveSubTipoActivoFijo:=Row("CveSubTipoActivoFijo").ToString.ToEntero, Dias:=Row("Dias").ToString.ToEntero) Then + + If Autorizado Then + Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con rubro {4} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU"), Row("CveRubro")) + guardarBitacora(msj) + End If + + Dim NrowTmpDT As DataRow = TmpDT.NewRow + + + NrowTmpDT("Cantidad") = Row("Cantidad") + NrowTmpDT("CantidadContratada") = Row("CantidadContratada") + NrowTmpDT("CveUM") = Row("CveUM") + NrowTmpDT("UM") = Row("UM") + NrowTmpDT("CveClasificacion") = Row("CveClasificacion") + NrowTmpDT("Clasificacion") = Row("Clasificacion") + NrowTmpDT("CvePS") = Row("CvePS") + + NrowTmpDT("PS") = Row("PS") + NrowTmpDT("CodigoPS") = Row("CodigoPS") + NrowTmpDT("PU") = Row("PU") + NrowTmpDT("Total") = Row("Total") + NrowTmpDT("CveTipoPresupuesto") = Row("CveTipoPresupuesto") + NrowTmpDT("NoIdentificacion") = Row("NoIdentificacion") + NrowTmpDT("OCInterna") = Row("OCInterna") + NrowTmpDT("LimitarCantidad") = Row("LimitarCantidad") + NrowTmpDT("Observacion") = Row("Observacion") + + NrowTmpDT("CveRubro") = Row("CveRubro") + NrowTmpDT("CveActividad") = Row("CveActividad") + NrowTmpDT("CveSubTipoActivoFijo") = Row("CveSubTipoActivoFijo") + + NrowTmpDT("Rubro") = Row("Rubro") + NrowTmpDT("Actividad") = Row("Actividad") + NrowTmpDT("SubTipoActivoFijo") = Row("SubTipoActivoFijo") + NrowTmpDT("Dias") = Row("Dias") + + + NrowTmpDT("CveContratoDetalle") = ObjContratos.DtResultados.Rows(0)("CveContratoDetalle") + + TmpDT.Rows.Add(NrowTmpDT) + TmpDT.AcceptChanges() + + TotalRow = TotalRow + NrowTmpDT("Total").ToString.ToDouble + Else + ErrorProceso = True + Exit For + End If + Next + + + If ErrorProceso Then + ObjContratos.RollBack() + Alert("Se presento un error al cargar el presupuesto.", TipoMensaje.MsgError) + Else + + ObjContratos.Commit() + Alert("Presupuesto Cargado correctamente") + + + Select Case TipoCargaPresupuesto + Case EnumTipoCargaPresupuesto.Ventas + CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) + UpGV.Update() + Exit Select + Case EnumTipoCargaPresupuesto.Control + CargaGVPresupuestosInsumos(TmpDT.FiltraParametros("CveTipoPresupuesto=1")) + UpGVInsumos.Update() + Exit Select + Case Else + + End Select + + LbTotalGeneral.Text = (LbTotalGeneral.Text.ToDouble + TotalRow).ToString.FormatoNumero + LblImporte.Text = LbTotalGeneral.Text + UpGral.Update() + + End If + + ObjContratos.Dispose() + + End If + + If RowNoEncontrados.Length > 0 Then + Alert($"Productos y Sub Tipos no encontrados
    {RowNoEncontrados} ", TipoMensaje.MsgAdvertencia) + End If + + End Sub + + Protected Sub LnkHabilitaAvance_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + + Dim PermitirAvance As Integer = GvRow.DataKey("PermitirAvance").ToEntero + + 'Get the button that raised the event + 'Dim btn As CheckBox = DirectCast(sender, CheckBox) + 'Dim gvr As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow) + Dim CveContratoDetalle As Integer = GvRow.DataKey("CveContratoDetalle").ToString.ToEntero - Dim objContrato As New ClsContratos - + Dim objContrato As New ClsContratos + If objContrato.UpdateContratosDetalleAvance(CveContratoDetalle, IIf(PermitirAvance = 1, 0, 1).ToString.ToEntero) Then - Dim row = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0) - + Dim row = TmpDT.Select(String.Format("CveContratoDetalle={0}", CveContratoDetalle))(0) + row("PermitirAvance") = IIf(PermitirAvance = 1, 0, 1).ToString.ToEntero - CargaGVPresupuestos(TmpDT.FiltraParametros("CveTipoPresupuesto=2")) - Alert("Se ha permitido levantar avance", TipoMensaje.MsgInformacion) Else Alert("no se pudo permitir avance", TipoMensaje.MsgAdvertencia) End If - objContrato.Dispose() - - End Sub - - Private Sub CargaEstadoCueta() - - - Dim ObjContratos As New ClsContratos - - If ObjContratos.GetContratosObraEstadoCuenta(CveContrato, UsuarioActual.CveEmpresa, 1) Then - GvEstadoCuentaAnticipos.DataSource = ObjContratos.DtResultados - Else - GvEstadoCuentaAnticipos.DataSource = Nothing - End If - - If ObjContratos.GetContratosObraEstadoCuenta(CveContrato, UsuarioActual.CveEmpresa, 2) Then - GvEstadoCuentaFacturas.DataSource = ObjContratos.DtResultados - Else - GvEstadoCuentaFacturas.DataSource = Nothing - End If - - - ObjContratos.Dispose() - - GvEstadoCuentaAnticipos.DataBind() - GvEstadoCuentaFacturas.DataBind() - - - - UpEstoCuenta.Update() - - End Sub - - - - - Private Sub CargaGastos() - - Dim GastosCompras As Double = 0 - Dim GastosVeiculos As Double = 0 - Dim GatosNominas As Double = 0 - Dim GastosProcentaje As Double = 0 - - - Dim ObjContratos As New ClsContratos - - If ObjContratos.GetContratosObragGastosVeiculos(CveContrato, UsuarioActual.CveEmpresa) Then - GvGastosVeiculos.DataSource = ObjContratos.DtResultados - GastosVeiculos = ObjContratos.DtResultados.SUM("Importe", " CveContratoGasto > 0 ") - - Else - GvGastosVeiculos.DataSource = Nothing - End If - - If ObjContratos.GetContratosObragGastosCompras(CveContrato, UsuarioActual.CveEmpresa) Then - GvGastosCompras.DataSource = ObjContratos.DtResultados - GastosCompras = ObjContratos.DtResultados.SUM("Importe", "CveContrato > 0") - Else - GvGastosCompras.DataSource = Nothing - End If - - If ObjContratos.GetContratosObragGastosNomina(CveContrato, UsuarioActual.CveEmpresa) Then - GvGastosNomina.DataSource = ObjContratos.DtResultados - GatosNominas = ObjContratos.DtResultados.SUM("Importe", "CveContrato > 0") - Else - GvGastosNomina.DataSource = Nothing - End If - - ObjContratos.Dispose() - - GvGastosVeiculos.DataBind() - GvGastosCompras.DataBind() - GvGastosNomina.DataBind() - - LblGastoContrato.Text = LblImporte.Text - LblGastoNomina.Text = "$ " & GatosNominas.ToString("###,###,###.00") - LblGastoGastos.Text = "$ " & GastosCompras.ToString("###,###,###.00") - LblGastoIndirectos.Text = "$ " & GastosVeiculos.ToString("###,###,###.00") - - UpGastos.Update() - - GastosProcentaje = (GastosVeiculos + GatosNominas + GastosCompras) * 100 / (LblGastoContrato.Text.ToDecimal) - LblGastoPorcentaje.Text = GastosProcentaje.ToString("###.00") & " %" - - End Sub - - - Private Sub GvGastosVeiculos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvGastosVeiculos.RowDataBound - - If e.Row.RowType = DataControlRowType.DataRow Then - - If e.Row.DataKey("ORDEN").ToEntero = 1 Then - e.Row.CssClass = "Totales" - e.Row.Cells(1).Text = "Total" - Dim LnkEliminarGasto As LinkButton = e.Row.FCLinkButton("LnkEliminarGasto") - LnkEliminarGasto.Visible = False - - - End If - - End If - End Sub - - - Private Sub GvGastosCompras_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvGastosCompras.RowDataBound - - If e.Row.RowType = DataControlRowType.DataRow Then - - If e.Row.DataKey("CveContrato").ToEntero > 0 Then - e.Row.CssClass = "Totales" - e.Row.Cells(1).Text = "Total" - - ElseIf e.Row.DataKey("CveContrato").ToEntero = 0 And e.Row.DataKey("CveClasificacion").ToEntero > 0 And e.Row.DataKey("ORDEN").ToEntero = 1 Then - e.Row.CssClass = "SubTotales" - e.Row.Cells(0).Text = e.Row.DataKey("Clasificacion") - e.Row.Cells(0).Width = 250 - End If - - End If - - - End Sub - - Private Sub GvGastosNomina_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvGastosNomina.RowDataBound - - If e.Row.RowType = DataControlRowType.DataRow Then - - If e.Row.DataKey("CvePersonal").ToEntero = 0 Then - e.Row.CssClass = "Totales" - e.Row.Cells(1).Text = "Total" - End If - - End If - - End Sub - - Protected Sub LnkModalAddGastos_Click(sender As Object, e As EventArgs) - - - RegistraScript("$('#ModalControlAddGastoVeiculo').modal('show');") - - End Sub - - Protected Sub LnkEliminarGasto_Click(sender As Object, e As EventArgs) - - Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) - - Dim CveContratoGasto As Integer = GvRow.DataKey("CveContratoGasto").ToString.ToEntero - - Dim ObjContratos As New ClsContratos - Dim ErrorProceso As Boolean = True - - - If ObjContratos.RemoveContratoGasto(CveContratoGasto) Then - ErrorProceso = False - End If - - If Not ErrorProceso Then - CargaGastos() - Alert("Gasto eliminado correctamente.") - End If - - - ObjContratos.Dispose() - - - End Sub - - Protected Sub BtnModalAgreagrGasto_Click(sender As Object, e As EventArgs) - - Dim ErrorProceso As Boolean = True - - Dim ObjContratos As New ClsContratos - - If ObjContratos.AddContratoGasto(CveContrato, TxtGastosDescripcion.Text, TxtGastosImporte.Text.ToDecimal, Now, UsuarioActual.CveUsuario) Then - ErrorProceso = False - End If - - ObjContratos.Dispose() - - If Not ErrorProceso Then - CargaGastos() - RegistraScript("$('#ModalControlAddGastoVeiculo').modal('hide');") - End If - - - End Sub - - Private Sub Indicadores() - - - + objContrato.Dispose() + + End Sub + + Private Sub CargaEstadoCuenta() + + + Dim ObjContratos As New ClsContratos + + If ObjContratos.GetContratosObraEstadoCuenta(CveContrato, UsuarioActual.CveEmpresa, 1) Then + GvEstadoCuentaAnticipos.DataSource = ObjContratos.DtResultados + Else + GvEstadoCuentaAnticipos.DataSource = Nothing + End If + + If ObjContratos.GetContratosObraEstadoCuenta(CveContrato, UsuarioActual.CveEmpresa, 2) Then + GvEstadoCuentaFacturas.DataSource = ObjContratos.DtResultados + Else + GvEstadoCuentaFacturas.DataSource = Nothing + End If + + + ObjContratos.Dispose() + + GvEstadoCuentaAnticipos.DataBind() + GvEstadoCuentaFacturas.DataBind() + + + + UpEstoCuenta.Update() + + End Sub + + + + + Private Sub CargaGastos() + + Dim GastosCompras As Double = 0 + Dim GastosVeiculos As Double = 0 + Dim GatosNominas As Double = 0 + Dim GastosProcentaje As Double = 0 + + + Dim ObjContratos As New ClsContratos + + If ObjContratos.GetContratosObragGastosVeiculos(CveContrato, UsuarioActual.CveEmpresa) Then + GvGastosVeiculos.DataSource = ObjContratos.DtResultados + GastosVeiculos = ObjContratos.DtResultados.SUM("Importe", " CveContratoGasto > 0 ") + + Else + GvGastosVeiculos.DataSource = Nothing + End If + + If ObjContratos.GetContratosObragGastosCompras(CveContrato, UsuarioActual.CveEmpresa) Then + GvGastosCompras.DataSource = ObjContratos.DtResultados + GastosCompras = ObjContratos.DtResultados.SUM("Importe", "CveContrato > 0") + Else + GvGastosCompras.DataSource = Nothing + End If + + If ObjContratos.GetContratosObragGastosNomina(CveContrato, UsuarioActual.CveEmpresa) Then + GvGastosNomina.DataSource = ObjContratos.DtResultados + GatosNominas = ObjContratos.DtResultados.SUM("Importe", "CveContrato > 0") + Else + GvGastosNomina.DataSource = Nothing + End If + + ObjContratos.Dispose() + + GvGastosVeiculos.DataBind() + GvGastosCompras.DataBind() + GvGastosNomina.DataBind() + + LblGastoContrato.Text = LblImporte.Text + LblGastoNomina.Text = "$ " & GatosNominas.ToString("###,###,###.00") + LblGastoGastos.Text = "$ " & GastosCompras.ToString("###,###,###.00") + LblGastoIndirectos.Text = "$ " & GastosVeiculos.ToString("###,###,###.00") + + UpGastos.Update() + + GastosProcentaje = (GastosVeiculos + GatosNominas + GastosCompras) * 100 / (LblGastoContrato.Text.ToDecimal) + LblGastoPorcentaje.Text = GastosProcentaje.ToString("###.00") & " %" + + End Sub + + + Private Sub GvGastosVeiculos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvGastosVeiculos.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + If e.Row.DataKey("ORDEN").ToEntero = 1 Then + e.Row.CssClass = "Totales" + e.Row.Cells(1).Text = "Total" + Dim LnkEliminarGasto As LinkButton = e.Row.FCLinkButton("LnkEliminarGasto") + LnkEliminarGasto.Visible = False + + + End If + + End If + End Sub + + + Private Sub GvGastosCompras_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvGastosCompras.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + If e.Row.DataKey("CveContrato").ToEntero > 0 Then + e.Row.CssClass = "Totales" + e.Row.Cells(1).Text = "Total" + + ElseIf e.Row.DataKey("CveContrato").ToEntero = 0 And e.Row.DataKey("CveClasificacion").ToEntero > 0 And e.Row.DataKey("ORDEN").ToEntero = 1 Then + e.Row.CssClass = "SubTotales" + e.Row.Cells(0).Text = e.Row.DataKey("Clasificacion") + e.Row.Cells(0).Width = 250 + End If + + End If + + + End Sub + + Private Sub GvGastosNomina_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvGastosNomina.RowDataBound + + If e.Row.RowType = DataControlRowType.DataRow Then + + If e.Row.DataKey("CvePersonal").ToEntero = 0 Then + e.Row.CssClass = "Totales" + e.Row.Cells(1).Text = "Total" + End If + + End If + + End Sub + + Protected Sub LnkModalAddGastos_Click(sender As Object, e As EventArgs) + + + RegistraScript("$('#ModalControlAddGastoVeiculo').modal('show');") + + End Sub + + Protected Sub LnkEliminarGasto_Click(sender As Object, e As EventArgs) + + Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + + Dim CveContratoGasto As Integer = GvRow.DataKey("CveContratoGasto").ToString.ToEntero + + Dim ObjContratos As New ClsContratos + Dim ErrorProceso As Boolean = True + + + If ObjContratos.RemoveContratoGasto(CveContratoGasto) Then + ErrorProceso = False + End If + + If Not ErrorProceso Then + CargaGastos() + Alert("Gasto eliminado correctamente.") + End If + + + ObjContratos.Dispose() + + + End Sub + + Protected Sub BtnModalAgreagrGasto_Click(sender As Object, e As EventArgs) + + Dim ErrorProceso As Boolean = True + + Dim ObjContratos As New ClsContratos + + If ObjContratos.AddContratoGasto(CveContrato, TxtGastosDescripcion.Text, TxtGastosImporte.Text.ToDecimal, Now, UsuarioActual.CveUsuario) Then + ErrorProceso = False + End If + + ObjContratos.Dispose() + + If Not ErrorProceso Then + CargaGastos() + RegistraScript("$('#ModalControlAddGastoVeiculo').modal('hide');") + End If + + + End Sub + + Private Sub Indicadores() + + + Dim Con As New ClsContratos Dim DTDatos As New DataTable - If Con.GetContratosObraRepAvances(MinFecha, MaxFecha, DdlCliente.SelectedValue.ToEntero, CveContrato, UsuarioActual.CveEmpresa) Then - DTDatos = Con.DtResultados + If Con.GetContratosObraRepAvances(MinFecha, MaxFecha, DdlCliente.SelectedValue.ToEntero, CveContrato, UsuarioActual.CveEmpresa) Then + DTDatos = Con.DtResultados End If - Con.Dispose() - - - Try - If DTDatos.Rows.Count > 0 Then - - Dim CantidadAvance As Decimal = DTDatos.Rows(0)("Cantidad").ToString.ToDecimal - Dim ImporteAvance As Decimal = DTDatos.Rows(0)("AvanceImporte").ToString.ToDecimal - Dim TotalAvancePorcentaje As Decimal = If(ImporteAvance > 0, (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2), 0) - - Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal - Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal - Dim TotalFaltantePorcentaje As Decimal = If(ImporteInterno > 0, (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2), 0) - - - LtlAvanceImporte.Text = $"$ { ImporteAvance.ToString("###,###,###.00") }" - LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %" - LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%" - SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%") - - - LtlAvanceInternoImporte.Text = $"$ {DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal.ToString("###,###,###.00")}" - LtlAvanceInternoImportePorcentaje1.Text = $"{TotalFaltantePorcentaje.ToString("###.00")} %" - LtlAvanceInternoImportePorcentaje2.Text = $"{TotalFaltantePorcentaje.ToString("###.00")}%" - SPFaltante.Attributes.Add("style", $"width:{TotalFaltantePorcentaje.ToString.ToEntero}%") - - End If - - Catch ex As Exception - - End Try - - - DVGraficas.Visible = True - - UpGrafica.Update() - - End Sub - - - - - Protected Sub DdlRubro_SelectedIndexChanged(sender As Object, e As EventArgs) - - - If DdlRubro.SelectedValue.ToEntero = 3 Then 'Rubro RH - DVDias.Visible = True - DVActividadesRH.Visible = True - - DVClasificacion.Visible = False - DVPS.Visible = False - DVUM.Visible = False - - DVSubTipoActivoFijo.Visible = False - - - ElseIf DdlRubro.SelectedValue.ToEntero = 4 Then 'Rubro Maquinaria florilla herramienta - - DVDias.Visible = True - DVActividadesRH.Visible = False - - DVClasificacion.Visible = False - DVPS.Visible = False - DVUM.Visible = False - - DVSubTipoActivoFijo.Visible = True - - Else - DVDias.Visible = False - DVActividadesRH.Visible = False - - DVClasificacion.Visible = True - DVPS.Visible = True - DVUM.Visible = True - - DVSubTipoActivoFijo.Visible = False - - End If - - UpModalControlAddPS.Update() - - End Sub - - Protected Sub LnkModalAddMaquinariaFlotilla_Click(sender As Object, e As EventArgs) - - LimpiarModalMaquinaria() - RegistraScript("$('#ModalMaquinaria').modal('show');") - - End Sub - - - Protected Sub DdlSubTipoAF_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubTipoAF.SelectedIndexChanged - - DdlAF.Items.Clear() - - If DdlSubTipoAF.SelectedIndex > 0 Then - - - Dim CveSubTipoActivoFijo As Integer = 0 - - Dim Separador As Char() = {"-"c} - - Try - CveSubTipoActivoFijo = DdlSubTipoAF.SelectedValue.Split(Separador)(0).ToEntero - Catch ex As Exception - CveSubTipoActivoFijo = 0 - End Try - - If CveSubTipoActivoFijo > 0 Then - DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1).FiltraParametros(String.Format("CveSubTipoActivoFijo IN ({0})", CveSubTipoActivoFijo)) - End If - - Else - DdlAF.DataSource = Nothing - - End If - - DdlAF.DataBind() - - - + Con.Dispose() + + + Try + If DTDatos.Rows.Count > 0 Then + + Dim CantidadAvance As Decimal = DTDatos.Rows(0)("Cantidad").ToString.ToDecimal + Dim ImporteAvance As Decimal = DTDatos.Rows(0)("AvanceImporte").ToString.ToDecimal + Dim TotalAvancePorcentaje As Decimal = If(ImporteAvance > 0, (ImporteAvance * 100 / TotalAvanceVentas).RoundSQL(2), 0) + + Dim CantidadInterno As Decimal = DTDatos.Rows(0)("CantidadInterno").ToString.ToDecimal + Dim ImporteInterno As Decimal = DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal + Dim TotalFaltantePorcentaje As Decimal = If(ImporteInterno > 0, (ImporteInterno * 100 / TotalAvanceInterno).RoundSQL(2), 0) + + + LtlAvanceImporte.Text = $"$ { ImporteAvance.ToString("###,###,###.00") }" + LtlAvanceImporteProcentaje1.Text = $"{TotalAvancePorcentaje.ToString("###.00")} %" + LtlAvanceImporteProcentaje2.Text = $"{TotalAvancePorcentaje.ToString("###.00")}%" + SPAvance1.Attributes.Add("style", $"width:{TotalAvancePorcentaje.ToString.ToEntero}%") + + + LtlAvanceInternoImporte.Text = $"$ {DTDatos.Rows(0)("ImporteInterno").ToString.ToDecimal.ToString("###,###,###.00")}" + LtlAvanceInternoImportePorcentaje1.Text = $"{TotalFaltantePorcentaje.ToString("###.00")} %" + LtlAvanceInternoImportePorcentaje2.Text = $"{TotalFaltantePorcentaje.ToString("###.00")}%" + SPFaltante.Attributes.Add("style", $"width:{TotalFaltantePorcentaje.ToString.ToEntero}%") + + End If + + Catch ex As Exception + + End Try + + + DVGraficas.Visible = True + + UpGrafica.Update() + + End Sub + + + + + Protected Sub DdlRubro_SelectedIndexChanged(sender As Object, e As EventArgs) + + + If DdlRubro.SelectedValue.ToEntero = 3 Then 'Rubro RH + DVDias.Visible = True + DVActividadesRH.Visible = True + + 'DVClasificacion.Visible = False + DVPS.Visible = False + DVUM.Visible = False + + DVSubTipoActivoFijo.Visible = False + + + ElseIf DdlRubro.SelectedValue.ToEntero = 4 Then 'Rubro Maquinaria florilla herramienta + + DVDias.Visible = True + DVActividadesRH.Visible = False + + 'DVClasificacion.Visible = False + DVPS.Visible = False + DVUM.Visible = False + + DVSubTipoActivoFijo.Visible = True + + Else + DVDias.Visible = False + DVActividadesRH.Visible = False + ' + 'DVClasificacion.Visible = True + DVPS.Visible = True + DVUM.Visible = True + + DVSubTipoActivoFijo.Visible = False + + End If + + UpModalControlAddPS.Update() + + End Sub + + Protected Sub LnkModalAddMaquinariaFlotilla_Click(sender As Object, e As EventArgs) + + LimpiarModalMaquinaria() + RegistraScript("$('#ModalMaquinaria').modal('show');") + + End Sub + + + Protected Sub DdlSubTipoAF_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubTipoAF.SelectedIndexChanged + + DdlAF.Items.Clear() + + If DdlSubTipoAF.SelectedIndex > 0 Then + + + Dim CveSubTipoActivoFijo As Integer = 0 + + Dim Separador As Char() = {"-"c} + + Try + CveSubTipoActivoFijo = DdlSubTipoAF.SelectedValue.Split(Separador)(0).ToEntero + Catch ex As Exception + CveSubTipoActivoFijo = 0 + End Try + + If CveSubTipoActivoFijo > 0 Then + DdlAF.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa, -1).FiltraParametros(String.Format("CveSubTipoActivoFijo IN ({0})", CveSubTipoActivoFijo)) + End If + + Else + DdlAF.DataSource = Nothing + + End If + + DdlAF.DataBind() + + + DdlAF.Items.Insert(0, New ListItem("Todos", "-1")) UpModalMaquinariaFlotilla.Update() - End Sub - - - Protected Sub BtnModalMaquinariaAdd_Click(sender As Object, e As EventArgs) - - Dim CveContratoDetalle As Integer = 0 - - Dim Separador As Char() = {"-"c} - - Try - CveContratoDetalle = DdlSubTipoAF.SelectedValue.Split(Separador)(1).ToEntero - Catch ex As Exception - CveContratoDetalle = 0 - End Try - - Dim ObjContrato As New ClsContratos - - If ObjContrato.AddContratosMaquinariaFlotilla(DdlAF.SelectedValue.ToEntero, TxtFechaMaquinaria.Text.ToDate, DdlPersonal.SelectedValue.ToEntero, TxtMaquinariaImporte.Text.ToDecimal, CveContratoDetalle) Then - - - If Not ChkModalMaquinaria.Checked Then - RegistraScript("$('#ModalMaquinaria').modal('hide');") - End If - - Alert("Registro agregado correctamente.") - - End If - - ObjContrato.Dispose() - - End Sub - - - - Property DTCentrosCostoGB As DataTable - - Get - If ViewState("DTCentrosCosto") Is Nothing Then - Return New DataTable - Else - Return DirectCast(ViewState("DTCentrosCosto"), DataTable) - End If - End Get - Set(value As DataTable) - ViewState("DTCentrosCosto") = value - End Set - - End Property - - - Private Sub tabalCentrosdecotso() - - Dim DTCentrosCosto As New DataTable - DTCentrosCosto.Columns.Add("CveSubProyecto", GetType(Integer)) - DTCentrosCosto.Columns.Add("SubProyecto", GetType(String)) - DTCentrosCosto.Columns.Add("Porcentaje", GetType(Decimal)) - DTCentrosCostoGB = DTCentrosCosto - - End Sub - - - Private Sub AddtabalCentrosdecotso(CveSubProyecto As Integer, SubProyecto As String, porcentaje As Decimal) - - Dim drow As DataRow = DTCentrosCostoGB.NewRow - - drow("CveSubProyecto") = CveSubProyecto - drow("SubProyecto") = SubProyecto - drow("Porcentaje") = porcentaje - - DTCentrosCostoGB.Rows.Add(drow) - - - - TxtCentroCostosPorcentaje.Text = "" - - CargaGVCentrosConsto() - - End Sub - Private Sub RemovetabalCentrosdecotso(Indice As Integer) - - - - CargaGVCentrosConsto() - End Sub - - - - - Private Sub CargaGVCentrosConsto() - - GVCentrosConsto.DataSource = DTCentrosCostoGB - GVCentrosConsto.DataBind() - UpGVCentrosConsto.Update() - - End Sub - - - Private Sub CargaDLLCargaGVCentrosConsto() - - DdlCentroCostos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubproyecto", "SubProyecto"}) - DdlCentroCostos.DataBind() - DdlCentroCostos.Items.Insert(0, New ListItem("Seleccione uno", "-1")) - - End Sub - - - Protected Sub LnkAgregarCentroCostosPorcentaj_Click(sender As Object, e As EventArgs) - - AddtabalCentrosdecotso(DdlCentroCostos.SelectedValue.ToEntero, DdlCentroCostos.SelectedItem.Text, TxtCentroCostosPorcentaje.Text.ToDecimal) - - End Sub + End Sub + + + Protected Sub BtnModalMaquinariaAdd_Click(sender As Object, e As EventArgs) + + Dim CveContratoDetalle As Integer = 0 + + Dim Separador As Char() = {"-"c} + + Try + CveContratoDetalle = DdlSubTipoAF.SelectedValue.Split(Separador)(1).ToEntero + Catch ex As Exception + CveContratoDetalle = 0 + End Try + + Dim ObjContrato As New ClsContratos + + If ObjContrato.AddContratosMaquinariaFlotilla(DdlAF.SelectedValue.ToEntero, TxtFechaMaquinaria.Text.ToDate, DdlPersonal.SelectedValue.ToEntero, TxtMaquinariaImporte.Text.ToDecimal, CveContratoDetalle) Then + + + If Not ChkModalMaquinaria.Checked Then + RegistraScript("$('#ModalMaquinaria').modal('hide');") + End If + + Alert("Registro agregado correctamente.") + + End If + + ObjContrato.Dispose() + + End Sub + + + + Property DTCentrosCostoGB As DataTable + + Get + If ViewState("DTCentrosCosto") Is Nothing Then + Return New DataTable + Else + Return DirectCast(ViewState("DTCentrosCosto"), DataTable) + End If + End Get + Set(value As DataTable) + ViewState("DTCentrosCosto") = value + End Set + + End Property + + + Private Sub tabalCentrosdecotso() + + Dim DTCentrosCosto As New DataTable + DTCentrosCosto.Columns.Add("CveSubProyecto", GetType(Integer)) + DTCentrosCosto.Columns.Add("SubProyecto", GetType(String)) + DTCentrosCosto.Columns.Add("Porcentaje", GetType(Decimal)) + DTCentrosCostoGB = DTCentrosCosto + + End Sub + + + Private Sub AddtabalCentrosdecotso(CveSubProyecto As Integer, SubProyecto As String, porcentaje As Decimal) + + Dim drow As DataRow = DTCentrosCostoGB.NewRow + + drow("CveSubProyecto") = CveSubProyecto + drow("SubProyecto") = SubProyecto + drow("Porcentaje") = porcentaje + + DTCentrosCostoGB.Rows.Add(drow) + + + + TxtCentroCostosPorcentaje.Text = "" + + CargaGVCentrosConsto() + + End Sub + Private Sub RemovetabalCentrosdecotso(Indice As Integer) + + + + CargaGVCentrosConsto() + End Sub + + + + + Private Sub CargaGVCentrosConsto() + + GVCentrosConsto.DataSource = DTCentrosCostoGB + GVCentrosConsto.DataBind() + UpGVCentrosConsto.Update() + + End Sub + + + Private Sub CargaDLLCargaGVCentrosConsto() + + DdlCentroCostos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("", "", {"CveSubproyecto", "SubProyecto"}) + DdlCentroCostos.DataBind() + DdlCentroCostos.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + End Sub + + + Protected Sub LnkAgregarCentroCostosPorcentaj_Click(sender As Object, e As EventArgs) + + AddtabalCentrosdecotso(DdlCentroCostos.SelectedValue.ToEntero, DdlCentroCostos.SelectedItem.Text, TxtCentroCostosPorcentaje.Text.ToDecimal) + + End Sub End Class diff --git a/CxC/RepCxCPeriodo.aspx.cs b/CxC/RepCxCPeriodo.aspx.cs index ea4952923..35de41dd3 100644 --- a/CxC/RepCxCPeriodo.aspx.cs +++ b/CxC/RepCxCPeriodo.aspx.cs @@ -287,7 +287,7 @@ public partial class CxC_RepCxCPeriodo : ClsPaginas StrFiltro.AppendFormat(" Clasificación Cliente: {0}", DdlClienteClasificacion.SelectedItem.Text); string RutaPDF = ""; - string Ruta = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas/{UsuarioActual.CveEmpresa}/"; + string Ruta = UsuarioActual.Empresa.Ruta; RutaPDF = $"{Ruta}/Formatos/RepCxCPeriodo.rdlc"; if (!System.IO.File.Exists(RutaPDF)) { diff --git a/GPS/CatDistribuidoresMaster.aspx.vb b/GPS/CatDistribuidoresMaster.aspx.vb index 4c21ac38b..6c532482b 100644 --- a/GPS/CatDistribuidoresMaster.aspx.vb +++ b/GPS/CatDistribuidoresMaster.aspx.vb @@ -98,11 +98,11 @@ Partial Class GPS_CatDistribuidoresMaster 'Dim CveSucursal = objSucursales.AddSucursal("MATRIZ", "M", 0.16, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", "", "", "", "", "", "", "", "", 1) 'If CveSucursal < 0 Then HuboError = True End If - If Not HuboError Then - If Not IO.Directory.Exists(String.Format("{0}\{1}", ModExtensiones.DirectorioBaseEmpresas, objEmpresa.CveEmpresa)) Then - IO.Directory.CreateDirectory(String.Format("{0}Empresas\{1}", ModExtensiones.DirectorioBaseEmpresas, objEmpresa.CveEmpresa)) - End If - Alert("El distribuidor se agregó correctamente", TipoMensaje.MsgInformacion) + If Not HuboError Then + If Not IO.Directory.Exists(String.Format("{0}", UsuarioActual.Empresa.Ruta)) Then + IO.Directory.CreateDirectory(String.Format("{0}", UsuarioActual.Empresa.Ruta)) + End If + Alert("El distribuidor se agregó correctamente", TipoMensaje.MsgInformacion) End If ElseIf EsEditar = 1 Then If objEmpresa.UpdateDistribuidorMaster(TxtRFC.Text, TxtEmpresa.Text, TxtTelefono.Text, TxtContacto.Text, TxtMail.Text, UsuarioActual.CveUsuario, chkEstatus.Checked, CveEmpresa) Then diff --git a/General/RepPaqueteriasGuias.aspx.cs b/General/RepPaqueteriasGuias.aspx.cs index 51a8138da..cb7120051 100644 --- a/General/RepPaqueteriasGuias.aspx.cs +++ b/General/RepPaqueteriasGuias.aspx.cs @@ -854,7 +854,7 @@ public partial class General_RepPaqueteriasGuias : ClsPaginas string FechIngaFinal = TxtFechaFinalIngreso.Text; - string Ruta = string.Format("{0}Empresas/{1}/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa); + string Ruta = UsuarioActual.Empresa.Ruta; string RutaPDF = string.Format("{0}/Formatos/RepPaqueteriasGuias.rdlc", Ruta); if (!File.Exists(RutaPDF)) diff --git a/Inventarios/PopUpBuscarMovto.aspx.vb b/Inventarios/PopUpBuscarMovto.aspx.vb index 3880f05ec..6765c901f 100644 --- a/Inventarios/PopUpBuscarMovto.aspx.vb +++ b/Inventarios/PopUpBuscarMovto.aspx.vb @@ -9,7 +9,7 @@ Partial Class PopUpBuscarFolio #Region "PROPIEDADES" Private ReadOnly Property Ruta As String Get - Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" + Return UsuarioActual.Empresa.Ruta End Get End Property #End Region diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 826698cd6..a2750203c 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -4495,7 +4495,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim Compra As String = DdlFolio.SelectedItem.Text Dim RutaPDF As String - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta RutaPDF = $"{Ruta}\Formatos\EntradaAlmacen.rdlc" If Not File.Exists(RutaPDF) Then RutaPDF = "Empresas/Grales/Formatos/EntradaAlmacen.rdlc" @@ -4729,7 +4729,7 @@ Partial Class Inventarios_RecepcionAlmacen Bitacora = "Documento Relacionado" End If - If ObjEventoBitacora.AddEventoBitacora(Bitacora, String.Format(".{0}", archivoOriginal.Extencion), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMovimientoAlmacen:=CveMovimiento) Then + If ObjEventoBitacora.AddEventoBitacora(Bitacora, String.Format(".{0}", archivoOriginal.Extension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMovimientoAlmacen:=CveMovimiento) Then Try If archivoOriginal.filename <> "" Then Archivo = New System.IO.FileInfo(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, archivoOriginal.filename)) diff --git a/Inventarios/RepConsumoInterno.aspx.cs b/Inventarios/RepConsumoInterno.aspx.cs index 5dd00883e..0268d9c13 100644 --- a/Inventarios/RepConsumoInterno.aspx.cs +++ b/Inventarios/RepConsumoInterno.aspx.cs @@ -177,7 +177,7 @@ public partial class Inventarios_RepConsumoInterno : ClsPaginas string FechaFin = DateTime.Parse(TxtFechaF.Text).ToShortDateString(); - string Ruta = string.Format("{0}Empresas/{1}/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa); + string Ruta = UsuarioActual.Empresa.Ruta; string RutaPDF = string.Format("{0}/Formatos/RepConsumoInterno.rdlc", Ruta); if (!File.Exists(RutaPDF)) diff --git a/Inventarios/RepEntradasSalidas.aspx.vb b/Inventarios/RepEntradasSalidas.aspx.vb index 6d03bc17b..0765352a7 100644 --- a/Inventarios/RepEntradasSalidas.aspx.vb +++ b/Inventarios/RepEntradasSalidas.aspx.vb @@ -368,7 +368,7 @@ Partial Class Inventarios_ReporteEntradasSalidas FechaF = Now End If Dim RutaPDF As String - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta Dim NombreArchivoDescarga = "ReporteEntradas-Salidas" If UsuarioActual.CveEmpresa.Contiene(119) Then diff --git a/Inventarios/RepEntregasForaneas.aspx.vb b/Inventarios/RepEntregasForaneas.aspx.vb index 23cb7c449..0e3044a3c 100644 --- a/Inventarios/RepEntregasForaneas.aspx.vb +++ b/Inventarios/RepEntregasForaneas.aspx.vb @@ -721,7 +721,7 @@ Partial Class Inventarios_RepEntregasForaneas Dim Tipo As String = DdlTipo.SelectedItem.Text Dim RutaPDF As String - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta RutaPDF = $"{Ruta}\Formatos\RepEntregasForaneas.rdlc" If Not File.Exists(RutaPDF) Then RutaPDF = "Empresas/Grales/Formatos/RepEntregasForaneas.rdlc" diff --git a/Nomina/Finiquito.aspx.cs b/Nomina/Finiquito.aspx.cs index 39df74d49..fb3677356 100644 --- a/Nomina/Finiquito.aspx.cs +++ b/Nomina/Finiquito.aspx.cs @@ -762,7 +762,7 @@ public partial class Nomina_Finiquito : ClsPaginas //parametros.Add(new Microsoft.Reporting.WebForms.ReportParameter("", "")); //parametros.Add(new Microsoft.Reporting.WebForms.ReportParameter("", "")); //parametros.Add(new Microsoft.Reporting.WebForms.ReportParameter("", "")); - string urlfile = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, string.Format("Empresas/{0}/Formatos/SobreReciboFiniquito.rdlc", UsuarioActual.CveEmpresa)); + string urlfile = System.IO.Path.Combine(string.Format("{0}Formatos/SobreReciboFiniquito.rdlc", UsuarioActual.Empresa.Ruta)); if (!System.IO.File.Exists(urlfile)) { urlfile = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas/Grales/Formatos/SobreReciboFiniquito.rdlc"); diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 5fb57800d..83f8726f9 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -1367,7 +1367,7 @@ public partial class Nomina_Nomina2 : ClsPaginas Archivo fileItem = continuar ? Filesgral[0] : null; if (continuar) { - string FileExtension = fileItem.Extencion.ToUpper(); + string FileExtension = fileItem.Extension.ToUpper(); if (FileExtension == "XLS" | FileExtension == "XLSX" | FileExtension == "CSV") { } @@ -2346,7 +2346,7 @@ public partial class Nomina_Nomina2 : ClsPaginas //parametros.Add(new Microsoft.Reporting.WebForms.ReportParameter("", "")); //parametros.Add(new Microsoft.Reporting.WebForms.ReportParameter("", "")); //parametros.Add(new Microsoft.Reporting.WebForms.ReportParameter("", "")); - string urlfile = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, string.Format("Empresas/{0}/Formatos/SobreRecibo.rdlc", UsuarioActual.CveEmpresa)); + string urlfile = System.IO.Path.Combine(string.Format("{0}Formatos/SobreRecibo.rdlc", UsuarioActual.Empresa.Ruta)); if (!System.IO.File.Exists(urlfile)) { urlfile = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas/Grales/Formatos/SobreRecibo.rdlc"); @@ -6203,7 +6203,7 @@ public partial class Nomina_Nomina2 : ClsPaginas { if (ObjNomina.GetNom_Nominas(-1, TxtCvePersonal.Text.ToEntero(), TxtCvePeriodo.Text.ToEntero(), -1, UsuarioActual.CveEmpresa)) { - Ruta = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\\{UsuarioActual.CveEmpresa}\\"; + Ruta = UsuarioActual.Empresa.Ruta; PathXML = $"{Ruta}XML\\Nomina\\{ObjNomina.SerieFolio}.xml"; PathXMLF = $"{Ruta}XML\\Nomina\\{ObjNomina.Serie}F-{ObjNomina.Folio}.xml"; Xmlname = ObjNomina.SerieFolio; diff --git a/OC/CotizacionEnLinea.aspx.vb b/OC/CotizacionEnLinea.aspx.vb index 3390f9e6d..bb512cde4 100644 --- a/OC/CotizacionEnLinea.aspx.vb +++ b/OC/CotizacionEnLinea.aspx.vb @@ -299,10 +299,10 @@ Partial Class OC_CotizacionEnLinea If FUArchivo.HasFile Then 'verificar que exista el directorio - If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa)) Then - System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa)) + If Not System.IO.Directory.Exists(String.Format("{0}Cotizaciones/", Empresa.Ruta)) Then + System.IO.Directory.CreateDirectory(String.Format("{0}Cotizaciones/", Empresa.Ruta)) End If - FUArchivo.SaveAs(String.Format("{0}/Empresas/{1}/Cotizaciones/{2}{3}", ModExtensiones.DirectorioBaseEmpresas, CveEmpresa, CveCotizacion, IO.Path.GetExtension(FUArchivo.FileName))) + FUArchivo.SaveAs(String.Format("{0}Cotizaciones/{1}{2}", Empresa.Ruta, CveCotizacion, IO.Path.GetExtension(FUArchivo.FileName))) End If For Each dr As GridViewRow In GvD.Rows diff --git a/OC/ListaRequisicion.aspx.cs b/OC/ListaRequisicion.aspx.cs index 36b8d6b66..447ef0980 100644 --- a/OC/ListaRequisicion.aspx.cs +++ b/OC/ListaRequisicion.aspx.cs @@ -102,7 +102,7 @@ public partial class OC_ListaRequisicion : ClsPaginas protected void ImprimiReporte(string Formato = "PDF") { - string Ruta = string.Format("{0}Empresas/{1}/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa); + string Ruta = UsuarioActual.Empresa.Ruta; string RutaPDF = string.Format("{0}/Formatos/ListaRequisicion.rdlc", Ruta); if (!File.Exists(RutaPDF)) diff --git a/OC/PopUpBuscarReq.aspx.vb b/OC/PopUpBuscarReq.aspx.vb index 1290d66c0..60be97147 100644 --- a/OC/PopUpBuscarReq.aspx.vb +++ b/OC/PopUpBuscarReq.aspx.vb @@ -19,7 +19,7 @@ Partial Class OC_PopUpBuscarReq End Property Private ReadOnly Property Ruta As String Get - Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" + Return UsuarioActual.Empresa.Ruta End Get End Property #End Region diff --git a/OC/RepCotizacionesDetalle.aspx.vb b/OC/RepCotizacionesDetalle.aspx.vb index e519b2935..31fdadb22 100644 --- a/OC/RepCotizacionesDetalle.aspx.vb +++ b/OC/RepCotizacionesDetalle.aspx.vb @@ -199,12 +199,12 @@ Partial Class PopOCCotizacionesDetalle TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario) Then 'verificar que exista el directorio - If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) Then - System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) + If Not System.IO.Directory.Exists(String.Format("{0}Cotizaciones/", UsuarioActual.Empresa.Ruta)) Then + System.IO.Directory.CreateDirectory(String.Format("{0}Cotizaciones/", UsuarioActual.Empresa.Ruta)) End If If Filename <> "" Then - Filename.FilesMove(objCotizacion.CveCotizacion.ToString(), String.Format("Empresas\{0}\Cotizaciones", UsuarioActual.CveEmpresa)) + Filename.FilesMove(objCotizacion.CveCotizacion.ToString(), String.Format("{0}Cotizaciones", UsuarioActual.Empresa.Ruta)) End If For Each dr As GridViewRow In GvDC.Rows @@ -220,12 +220,12 @@ Partial Class PopOCCotizacionesDetalle If objCotizacion.UpdateCotizacion(CboProveedores.SelectedValue.ToEntero, -1, TxtFolio.Text, TxtFecha.Text, FileExtension, ddlMoneda.SelectedValue.ToEntero, TxtDiasCredito.Text.ToEntero, UsuarioActual.CveUsuario, CveCotizacion) Then 'verificar que exista el directorio - If Not System.IO.Directory.Exists(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) Then - System.IO.Directory.CreateDirectory(String.Format("{0}/Empresas/{1}/Cotizaciones/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) + If Not System.IO.Directory.Exists(String.Format("{0}Cotizaciones/", UsuarioActual.Empresa.Ruta)) Then + System.IO.Directory.CreateDirectory(String.Format("{0}Cotizaciones/", UsuarioActual.Empresa.Ruta)) End If If Filename <> "" Then - Filename.FilesMove(CveCotizacion.ToString(), String.Format("Empresas\{0}\Cotizaciones", UsuarioActual.CveEmpresa)) + Filename.FilesMove(CveCotizacion.ToString(), String.Format("{0}Cotizaciones", UsuarioActual.Empresa.Ruta)) End If For Each dr As GridViewRow In GvDC.Rows diff --git a/OI/CircularDetalle.aspx.vb b/OI/CircularDetalle.aspx.vb index 0931f4078..e5a6ed498 100644 --- a/OI/CircularDetalle.aspx.vb +++ b/OI/CircularDetalle.aspx.vb @@ -162,7 +162,7 @@ Partial Class OI_CircularDetalle End Function Private Function TituloAnterior() As String - Dim Directorio As New IO.DirectoryInfo(String.Format("{0}Empresas/{1}/Formatos/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)) + Dim Directorio As New IO.DirectoryInfo(String.Format("{0}Formatos/", UsuarioActual.Empresa.Ruta)) Dim ArchivosArreglo As IO.FileInfo() = Directorio.GetFiles() Dim patronRegEx As String = String.Format("^{0}_.*", CveCircular) Dim archivoEncontrado As String = "" diff --git a/OI/CircularDetalleB.aspx.cs b/OI/CircularDetalleB.aspx.cs index 690fef2d1..84886f3f2 100644 --- a/OI/CircularDetalleB.aspx.cs +++ b/OI/CircularDetalleB.aspx.cs @@ -208,7 +208,7 @@ public partial class OI_CircularDetalleB : ClsPaginas private string TituloAnterior() { - System.IO.DirectoryInfo Directorio = new System.IO.DirectoryInfo(string.Format("{0}Empresas/{1}/Formatos/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa)); + System.IO.DirectoryInfo Directorio = new System.IO.DirectoryInfo(string.Format("{0}Formatos/", UsuarioActual.Empresa.Ruta)); System.IO.FileInfo[] ArchivosArreglo = Directorio.GetFiles(); string patronRegEx = string.Format("^{0}_.*", CveCircular); string archivoEncontrado = ""; diff --git a/OI/DocumentoDetalle.aspx.cs b/OI/DocumentoDetalle.aspx.cs index ebd3aed72..027218fbe 100644 --- a/OI/DocumentoDetalle.aspx.cs +++ b/OI/DocumentoDetalle.aspx.cs @@ -680,7 +680,7 @@ public partial class OI_DocumentoDetalle : ClsPaginas int CveUsuario = GvRow.DataKey("CveUsuario").ToEntero(); DataRow UsuarioSeleccionado = GetUsuarioParticipante(CveUsuario); string Propuesta = UsuarioSeleccionado["Adjunto"] == null ? "" : UsuarioSeleccionado["Adjunto"].ToString(); - string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}/{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, this.CveDocumento, Propuesta); + string Ruta = string.Format("{0}DocumentosRepo/{1}/{2}", UsuarioActual.Empresa.Ruta, this.CveDocumento, Propuesta); if (File.Exists(Ruta)) { byte[] archivoBytes = File.ReadAllBytes(Ruta); diff --git a/OI/Documentos.aspx.cs b/OI/Documentos.aspx.cs index 7a085368f..d55cbd28c 100644 --- a/OI/Documentos.aspx.cs +++ b/OI/Documentos.aspx.cs @@ -46,7 +46,7 @@ public partial class OI_Documentos : ClsPaginas string CveDocumento = GvRow.DataKey("CveDocumento"); //string NombreArchivo = ArchivoFisico.Split('_')[1]; - string Ruta = string.Format("{0}Empresas/{1}/DocumentosRepo/{2}/{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CveDocumento, ArchivoFisico); + string Ruta = string.Format("{0}DocumentosRepo/{1}/{2}", UsuarioActual.Empresa.Ruta, CveDocumento, ArchivoFisico); if (File.Exists(Ruta)) { byte[] archivoBytes = File.ReadAllBytes(Ruta); diff --git a/OI/EventoComentario.aspx.vb b/OI/EventoComentario.aspx.vb index 5d71becb9..78112c2b5 100644 --- a/OI/EventoComentario.aspx.vb +++ b/OI/EventoComentario.aspx.vb @@ -94,21 +94,21 @@ Partial Class OI_EventoComentario Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click 'Preguntar si existe en temporales - If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then - Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) - If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos") Then Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos") - If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension) Then - File.Delete(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension) - File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension) + If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(UsuarioActual.Empresa.Ruta & "Temp\" & Session("FileUpload").ToString) Then + Dim Extension As String = Path.GetExtension(UsuarioActual.Empresa.Ruta & "Temp\" & Session("FileUpload").ToString) + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "OI\Eventos") Then Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "OI\Eventos") + If File.Exists(UsuarioActual.Empresa.Ruta & "OI\Eventos\" & CveComentario & Extension) Then + File.Delete(UsuarioActual.Empresa.Ruta & "OI\Eventos\" & CveComentario & Extension) + File.Move(UsuarioActual.Empresa.Ruta & "Temp\" & Session("FileUpload").ToString, UsuarioActual.Empresa.Ruta & "OI\Eventos\" & CveComentario & Extension) Else - File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\OI\Eventos\" & CveComentario & Extension) - End If - - Else - 'Imagen Default - 'If ImgPersonal.ImageUrl = "../Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" Then - ' ImgPersonal.ImageUrl = "/Imagenes/SinImagen.jpg" - 'End If - End If + File.Move(UsuarioActual.Empresa.Ruta & "Temp\" & Session("FileUpload").ToString, UsuarioActual.Empresa.Ruta & "OI\Eventos\" & CveComentario & Extension) + End If + + Else + 'Imagen Default + 'If ImgPersonal.ImageUrl = "../Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" Then + ' ImgPersonal.ImageUrl = "/Imagenes/SinImagen.jpg" + 'End If + End If End Sub End Class \ No newline at end of file diff --git a/OI/PopUpAgenda.aspx.vb b/OI/PopUpAgenda.aspx.vb index 7292474e9..39af5e7be 100644 --- a/OI/PopUpAgenda.aspx.vb +++ b/OI/PopUpAgenda.aspx.vb @@ -785,18 +785,18 @@ Partial Class OI_PopUpAgenda ObjEventos.Dispose() End Sub Protected Sub BtnCargarArchivo_Click(sender As Object, e As System.EventArgs) Handles BtnCargarArchivo.Click - If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) Then - Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString) - If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos") Then Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos") - File.Move(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" & Session("FileUpload").ToString, ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\" & CveEvento & "_" & ArchConsecutivo & Extension) + If Session("FileUpload").ToString <> String.Empty AndAlso File.Exists(UsuarioActual.Empresa.Ruta & "Temp\" & Session("FileUpload").ToString) Then + Dim Extension As String = Path.GetExtension(UsuarioActual.Empresa.Ruta & "Temp\" & Session("FileUpload").ToString) + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "Eventos\Archivos") Then Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Eventos\Archivos") + File.Move(UsuarioActual.Empresa.Ruta & "Temp\" & Session("FileUpload").ToString, UsuarioActual.Empresa.Ruta & "Eventos\" & CveEvento & "_" & ArchConsecutivo & Extension) Session("FileUpload") = "" - If File.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) Then + If File.Exists(UsuarioActual.Empresa.Ruta & "Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) Then Dim ObjActivosFijos As New ClsAF If ObjActivosFijos.AddActivosFijosImagenes(CveEvento, CveEvento & "_" & ArchConsecutivo & Extension, UsuarioActual.CveUsuario) Then 'CargarArchivo() Else - File.Delete(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) + File.Delete(UsuarioActual.Empresa.Ruta & "Eventos\Archivos" & CveEvento & "_" & ArchConsecutivo & Extension) End If ObjActivosFijos.Dispose() @@ -840,8 +840,8 @@ Partial Class OI_PopUpAgenda 'End Sub Protected Sub BtnAddObs_Click(sender As Object, e As EventArgs) Handles BtnAddObs.Click - Dim RutaGuardar As String = String.Format("{0}Empresas\{1}\OI\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa) - Dim RutaArchivo As String = String.Format("{0}Empresas\{1}\OI\Temp\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Session("Eventos")) + Dim RutaGuardar As String = String.Format("OI\", UsuarioActual.Empresa.Ruta) + Dim RutaArchivo As String = String.Format("OI\Temp\{2}", UsuarioActual.Empresa.Ruta, Session("Eventos")) Dim tCveSeguimiento As Integer Dim Archivo As String = "" diff --git a/Planeacion/CargarArchivo.aspx.vb b/Planeacion/CargarArchivo.aspx.vb index 929ee65a1..f4ea6329e 100644 --- a/Planeacion/CargarArchivo.aspx.vb +++ b/Planeacion/CargarArchivo.aspx.vb @@ -17,10 +17,10 @@ Partial Class CargarArchivo Protected Sub AFU_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AFU.UploadedComplete If AFU.HasFile Then - If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp") Then - Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp") + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "Temp") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Temp") End If - Dim UploadFolder As String = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" + Dim UploadFolder As String = UsuarioActual.Empresa.Ruta & "Temp\" Dim Extension As String = System.IO.Path.GetExtension(AFU.PostedFile.FileName) If System.IO.File.Exists(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension) Then diff --git a/Planeacion/CargarImagen.aspx.vb b/Planeacion/CargarImagen.aspx.vb index 96af0e798..4a4114b00 100644 --- a/Planeacion/CargarImagen.aspx.vb +++ b/Planeacion/CargarImagen.aspx.vb @@ -13,10 +13,10 @@ Partial Class CargarImagen Protected Sub AFU_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AFU.UploadedComplete If AFU.HasFile Then - If Not Directory.Exists(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp") Then - Directory.CreateDirectory(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp") + If Not Directory.Exists(UsuarioActual.Empresa.Ruta & "Temp") Then + Directory.CreateDirectory(UsuarioActual.Empresa.Ruta & "Temp") End If - Dim UploadFolder As String = ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\" + Dim UploadFolder As String = UsuarioActual.Empresa.Ruta & "Temp\" Dim Extension As String = System.IO.Path.GetExtension(AFU.PostedFile.FileName) If System.IO.File.Exists(UploadFolder & UsuarioActual.CveUsuario.ToString & Extension) Then diff --git a/Planeacion/Sucursal.aspx.vb b/Planeacion/Sucursal.aspx.vb index 69d00a738..2e9702867 100644 --- a/Planeacion/Sucursal.aspx.vb +++ b/Planeacion/Sucursal.aspx.vb @@ -62,7 +62,7 @@ Partial Class Sucursal Else Matriz.Checked = False End If - If System.IO.File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\" & DT.Rows(0)("FormatoFactura").ToString) Then + If System.IO.File.Exists(UsuarioActual.Empresa.Ruta & "Formatos\" & DT.Rows(0)("FormatoFactura").ToString) Then 'DirectCast("HLVer", HtmlLink). = "Ver" End If diff --git a/PortalCliente/PortalCliente.aspx.vb b/PortalCliente/PortalCliente.aspx.vb index e6245a911..471ed5960 100644 --- a/PortalCliente/PortalCliente.aspx.vb +++ b/PortalCliente/PortalCliente.aspx.vb @@ -363,7 +363,7 @@ Partial Class Ventas_PortalCliente 'Dim ObjEmprea As New ClsEmpresas() 'If ObjEmprea.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then Dim ObjMail As New ClsSisMail() - Dim Ruta As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta If File.Exists(Ruta & "PDF\" & HdnFolioVenta.Value & ".pdf") AndAlso File.Exists(Ruta & "XML\" & HdnFolioVenta.Value & ".xml") Then Dim PDF As String = Ruta & "PDF\" & HdnFolioVenta.Value & ".pdf" @@ -1309,7 +1309,7 @@ Partial Class Ventas_PortalCliente If e.Row.RowIndex >= 0 Then e.Row.Cells(0).Width = Unit.Pixel(100) 'CARGAR IMAGENES DE PERSONAL - If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & e.Row.DBCampo("URL") & ".png") Then + If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & e.Row.DBCampo("URL") & ".png") Then e.Row.FCImage("ImgPersonal").ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & e.Row.DBCampo("URL") & ".png" End If diff --git a/PortalProveedor/PortalProveedor.aspx.vb b/PortalProveedor/PortalProveedor.aspx.vb index 093cdb5ec..1c935a145 100644 --- a/PortalProveedor/PortalProveedor.aspx.vb +++ b/PortalProveedor/PortalProveedor.aspx.vb @@ -594,7 +594,7 @@ Partial Class Portal_PortalProveedor Protected Sub GvBancos_comprobante(sender As Object, e As EventArgs) Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim Path As String = String.Format("{0}{1}{2}{3}{4}{5}", ModExtensiones.DirectorioBaseEmpresas, "Empresas\", UsuarioActual.CveEmpresa, "\IE\", Gvr.FCHiddenField("CveIe").Value, ".png") + Dim Path As String = String.Format("{0}{1}{2}{3}", UsuarioActual.Empresa.Ruta, "IE\", Gvr.FCHiddenField("CveIe").Value, ".png") Dim Archivo As New System.IO.FileInfo(Path) If Archivo.Exists Then diff --git a/Proveedores/PortalProveedor.aspx.vb b/Proveedores/PortalProveedor.aspx.vb index 2a3a50e6d..ad4ae37f7 100644 --- a/Proveedores/PortalProveedor.aspx.vb +++ b/Proveedores/PortalProveedor.aspx.vb @@ -412,7 +412,7 @@ Partial Class Portal_PortalProveedor Protected Sub GvBancos_comprobante(sender As Object, e As EventArgs) Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim Path As String = String.Format("{0}{1}{2}{3}{4}{5}", ModExtensiones.DirectorioBaseEmpresas, "Empresas\", UsuarioActual.CveEmpresa, "\IE\", Gvr.FCHiddenField("CveIe").Value, ".png") + Dim Path As String = String.Format("{0}{1}{2}{3}", UsuarioActual.Empresa.Ruta, "IE\", Gvr.FCHiddenField("CveIe").Value, ".png") Dim Archivo As New System.IO.FileInfo(Path) If Archivo.Exists Then diff --git a/PyME/Sistemas/WizardRegistro.aspx.vb b/PyME/Sistemas/WizardRegistro.aspx.vb index ebc8d5bd5..f1e9aaa76 100644 --- a/PyME/Sistemas/WizardRegistro.aspx.vb +++ b/PyME/Sistemas/WizardRegistro.aspx.vb @@ -493,7 +493,7 @@ Partial Class Sistemas_WizardRegistro Case 4 If TxtFormatoFactura.getfiles().Archivos().Count > 0 Then Dim FormatoFactura As Archivo = TxtFormatoFactura.getfiles().Archivos(0) - Dim PathFormato = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\Formatos\" + Dim PathFormato = $"{UsuarioActual.Empresa.Ruta}Formatos\" Dim dirFormato As String = String.Format("{0}\Factura.{1}", PathFormato, FormatoFactura.Extencion) If File.Exists(dirFormato) Then My.Computer.FileSystem.DeleteFile(dirFormato) diff --git a/RH/CatCursos.aspx.vb b/RH/CatCursos.aspx.vb index cf3b85c55..461c691fe 100644 --- a/RH/CatCursos.aspx.vb +++ b/RH/CatCursos.aspx.vb @@ -327,9 +327,9 @@ Partial Class RH_CatCursos Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim params As New List(Of ReportParameter) - Dim Archivo As String = $"Empresas/{UsuarioActual.CveEmpresa}/Formatos/CursosInvitados.rdlc" + Dim Archivo As String = $"{UsuarioActual.Empresa.Ruta}Formatos/CursosInvitados.rdlc" - If Not File.Exists($"{Extensiones.DirectorioBaseEmpresas}/{Archivo}") Then + If Not File.Exists(Archivo) Then Archivo = "Empresas/Grales/Formatos/CursosInvitados.rdlc" End If diff --git a/RH/MiPerfil.aspx.vb b/RH/MiPerfil.aspx.vb index b2793709e..9fe5b2b49 100644 --- a/RH/MiPerfil.aspx.vb +++ b/RH/MiPerfil.aspx.vb @@ -467,7 +467,7 @@ Partial Class RH_MiPerfil puestoProp = "" End If - If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL) Then + If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & ObjPersonal.URL) Then ImgPersonal.ImageUrl = $"/Empresas/{UsuarioActual.CveEmpresa}/RH/Personal/{ObjPersonal.URL}" End If diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index da16a8d97..84a2daf1d 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -1470,17 +1470,17 @@ Partial Class RH_Personal End If - If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".jpg") Then + If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".jpg") Then Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.jpg", UsuarioActual.CveEmpresa, CvePersonal) Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica)) ImgPersonal.ImageUrl = logouri - ElseIf File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".png") Then + ElseIf File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".png") Then Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.png", UsuarioActual.CveEmpresa, CvePersonal) Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica)) ImgPersonal.ImageUrl = logouri - ElseIf File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & ".bmp") Then + ElseIf File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & ".bmp") Then Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.bmp", UsuarioActual.CveEmpresa, CvePersonal) Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica)) @@ -1689,9 +1689,9 @@ Partial Class RH_Personal Dim ObjCuentasDeposito As New ClsGenerales(ObjPersonal.IniciaTransacSQL()) Dim ObjAF As New ClsAF(ObjPersonal.IniciaTransacSQL()) - Dim Extension As String = Path.GetExtension(ModExtensiones.DirectorioBaseEmpresas + "Empresas\" & UsuarioActual.CveEmpresa & "\Temp\RH\" & ViewState("Archivo").ToString()) + Dim Extension As String = Path.GetExtension(UsuarioActual.Empresa.Ruta & "Temp\RH\" & ViewState("Archivo").ToString()) Dim URL As String = CvePersonal & Extension - Dim Ruta = String.Format("{0}Empresas\{1}\Temp\RH\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ViewState("Archivo").ToString()) + Dim Ruta = String.Format("{0}Temp\RH\{1}", UsuarioActual.Empresa.Ruta, ViewState("Archivo").ToString()) Dim Archivo As New System.IO.FileInfo(Ruta) @@ -3405,7 +3405,7 @@ Partial Class RH_Personal - If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL & ".png") Then + If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & ObjPersonal.URL & ".png") Then params.Add(New ReportParameter("LogoUri", "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & ObjPersonal.URL & ".png")) Else params.Add(New ReportParameter("LogoUri", "")) @@ -3507,7 +3507,7 @@ Partial Class RH_Personal - If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.URL & ".png") Then + If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & ObjPersonal.URL & ".png") Then params.Add(New ReportParameter("LogoUri", "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & ObjPersonal.URL & ".png")) Else params.Add(New ReportParameter("LogoUri", "")) @@ -3553,7 +3553,7 @@ Partial Class RH_Personal - If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & ObjPersonal.CvePersonal & ".png") Then + If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & ObjPersonal.CvePersonal & ".png") Then params.Add(New ReportParameter("LogoUri", String.Format("{0}://{1}:{2}/Empresas/{3}/RH/Personal/{4}.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa, ObjPersonal.CvePersonal))) Else params.Add(New ReportParameter("LogoUri", "")) @@ -5348,9 +5348,9 @@ Partial Class RH_Personal FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") filemove = fileItem.filename - Dim yaExistente As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.jpg", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CvePersonal) - Dim yaExistentePNG As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.png", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CvePersonal) - Dim yaExistenteBMP As String = String.Format("{0}Empresas\{1}\RH\Personal\{2}.bmp", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CvePersonal) + Dim yaExistente As String = String.Format("{0}RH\Personal\{1}.jpg", UsuarioActual.Empresa.Ruta, CvePersonal) + Dim yaExistentePNG As String = String.Format("{0}RH\Personal\{1}.png", UsuarioActual.Empresa.Ruta, CvePersonal) + Dim yaExistenteBMP As String = String.Format("{0}RH\Personal\{1}.bmp", UsuarioActual.Empresa.Ruta, CvePersonal) If File.Exists(yaExistente) Then File.Delete(yaExistente) @@ -5365,7 +5365,7 @@ Partial Class RH_Personal End If ViewState("Archivo") = String.Format("{0}.{1}", CvePersonal.ToString(), FileExtension) Next - If File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & CvePersonal & "." & FileExtension) Then + If File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & CvePersonal & "." & FileExtension) Then Dim LogoRutaFisica As String = String.Format("Empresas\{0}\RH\Personal\{1}.{2}", UsuarioActual.CveEmpresa, CvePersonal, FileExtension) Dim logouri = String.Format("{0}://{1}:{2}/ashx/sigfiles.ashx?P={3}&version={4}", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Encripta(LogoRutaFisica), Now) ImgPersonal.ImageUrl = logouri @@ -5596,7 +5596,7 @@ Partial Class RH_Personal Protected Sub GenerarPDFConsumo(Optional Formato As String = "PDF") Dim CodigoP As String = "" Dim NombreCompletoP As String = "" - Dim Ruta As String = String.Format("{0}Empresas/{1}/", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa) + Dim Ruta As String = UsuarioActual.Empresa.Ruta Dim RutaPDF As String = String.Format("{0}/Formatos/RepConsumoPersonal.rdlc", Ruta) If Not File.Exists(RutaPDF) Then RutaPDF = "Empresas/Grales/Formatos/RepConsumoPersonal.rdlc" diff --git a/RH/RepBuzonCalidad.aspx.vb b/RH/RepBuzonCalidad.aspx.vb index 85ec18f65..a4ee140d9 100644 --- a/RH/RepBuzonCalidad.aspx.vb +++ b/RH/RepBuzonCalidad.aspx.vb @@ -66,7 +66,7 @@ Partial Class RH_RepBuzonCalidad e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left Else ' - If System.IO.File.Exists(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\RH\Personal\" & e.Row.DBCampo("CvePersonal") & ".png") Then + If System.IO.File.Exists(UsuarioActual.Empresa.Ruta & "RH\Personal\" & e.Row.DBCampo("CvePersonal") & ".png") Then e.Row.FCImage("ImgPersonal").ImageUrl = "/Empresas/" & UsuarioActual.CveEmpresa & "/RH/Personal/" & e.Row.DBCampo("CvePersonal") & ".png" End If e.Row.Cells(0).Visible = False diff --git a/Sistemas/Empresa.aspx.vb b/Sistemas/Empresa.aspx.vb index bf1c5fadc..66b11a5ce 100644 --- a/Sistemas/Empresa.aspx.vb +++ b/Sistemas/Empresa.aspx.vb @@ -1467,8 +1467,17 @@ Partial Class Sistemas_Empresa Dim Archivopfx As String Dim Archivokey As Archivo = Nothing Dim Archivocer As Archivo = Nothing - Dim dirbase = String.Format("{0}Empresas\{1}\Certificados\Fiel\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) - Dim dirbasepfx = String.Format("{0}Empresas\{1}\Certificados\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) + + Dim dirbase = "" ' String.Format("{0}Empresas\{1}\Certificados\Fiel\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) + Dim dirbasepfx = "" ' String.Format("{0}Empresas\{1}\Certificados\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) + If EmpresaEditar IsNot Nothing Then + dirbase = String.Format("{0}Certificados\Fiel\", EmpresaEditar.Ruta) + dirbasepfx = String.Format("{0}Certificados\", EmpresaEditar.Ruta) + Else + dirbase = String.Format("{0}Empresas\{1}\Certificados\Fiel\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) + dirbasepfx = String.Format("{0}Empresas\{1}\Certificados\", ModExtensiones.DirectorioBaseEmpresas, ViewState("CveEmpresa")) + End If + If (Not Directory.Exists(dirbase)) Then Directory.CreateDirectory(dirbase) End If diff --git a/Site.master.vb b/Site.master.vb index 5f9de4168..a6f63e6b8 100644 --- a/Site.master.vb +++ b/Site.master.vb @@ -500,7 +500,7 @@ Partial Class Site Private Function ConvertCER() As String Try - Dim Archivo As String = String.Format("{0}Empresas\{1}\Certificados\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.ArchivoCer) + Dim Archivo As String = String.Format("{0}Certificados\{1}", UsuarioActual.Empresa.Ruta, UsuarioActual.Empresa.ArchivoCer) If File.Exists(Archivo) Then Dim CerFile As New FileStream(Archivo, FileMode.Open, FileAccess.Read) Dim Size As Integer = CerFile.Length.ToString().ToEntero() diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index e6660992f..a45fdff33 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -2121,7 +2121,7 @@ Partial Class Clientes If HdnCveVenta.Value <> "-1" AndAlso HdnFolioVenta.Value <> "-1" Then Dim ObjMail As New ClsSisMail() - Dim Ruta As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta Dim Cuerpo As String = TxtBody.Text Dim Asunto As String = "" @@ -5310,7 +5310,7 @@ Partial Class Clientes If HdnCveVenta2.Value <> "-1" AndAlso HdnFolioVenta2.Value <> "-1" Then Dim ObjMail As New ClsSisMail() - Dim Ruta As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta Dim Cuerpo As String = TxtBody2.Text Dim Asunto As String = "" @@ -5793,8 +5793,8 @@ Partial Class Clientes Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) @@ -7116,13 +7116,13 @@ Partial Class Clientes If GvRow.DataKey("Documentacion") = "Pagaré" AndAlso UsuarioActual.CveEmpresa = 140 Then - stringDescargaDocumento = ModExtensiones.DirectorioBaseEmpresas & String.Format("Empresas\{0}\Formatos\Pagaré.docx", UsuarioActual.CveEmpresa) + stringDescargaDocumento = UsuarioActual.Empresa.Ruta & "Formatos\Pagaré.docx" TxtDireccionAval.Text = "" TxtAval.Text = "" RegistraScript("$('#ModalDivPagare').modal('show')") Else - stringDescargaDocumento = ModExtensiones.DirectorioBaseEmpresas & String.Format("Empresas\{0}\DocElectronica\Clientes\{1}\{2}", UsuarioActual.CveEmpresa, CveCliente, Adjunto) + stringDescargaDocumento = UsuarioActual.Empresa.Ruta & String.Format("DocElectronica\Clientes\{0}\{1}", CveCliente, Adjunto) linkDescargaPagare = stringDescargaDocumento @@ -7827,7 +7827,7 @@ Partial Class Clientes Comprobante = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") filemove = fileItem.FileUrl RutaArchivo = String.Format("{0}{1}_{2}", RutaDirectorio, CveCliente, _CveDocumentacion) - RutaArchivo = String.Format("{0}.{1}", RutaArchivo, fileItem.Extencion) + RutaArchivo = String.Format("{0}.{1}", RutaArchivo, fileItem.Extension) Try If Not Directory.Exists(RutaDirectorio) Then diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 17b13577e..c6374fedd 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -776,7 +776,7 @@ Partial Class Ventas_ClientesAbonar 'Guardar archivo If filemove <> "" Then - filemove.FilesMove(CveIE.ToString, String.Format("Empresas\{0}\IE", UsuarioActual.CveEmpresa, UsuarioActual.Empresa.Ruta)) + filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta)) End If @@ -2507,8 +2507,8 @@ Partial Class Ventas_ClientesAbonar PDFReciboDePagos(-1, -1, ObjBancos.CveComplementoPago, False) - Dim LigaDescargaXML = $"../Empresas/{UsuarioActual.CveEmpresa}/XML/Pag/{ObjBancos.ComplementoSerieFolio}.xml" - Dim LigaDescargaPDF = $"../Empresas/{UsuarioActual.CveEmpresa}/PDF/Pag/{ObjBancos.ComplementoSerieFolio}.pdf" + 'Dim LigaDescargaXML = $"../Empresas/{UsuarioActual.CveEmpresa}/XML/Pag/{ObjBancos.ComplementoSerieFolio}.xml" + 'Dim LigaDescargaPDF = $"../Empresas/{UsuarioActual.CveEmpresa}/PDF/Pag/{ObjBancos.ComplementoSerieFolio}.pdf" Retorno.AppendFormat(" Complemento de pago {0}
    ", ObjBancos.ComplementoSerieFolio) Retorno.AppendFormat("XML    ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}&CveIE={2}", ObjBancos.ComplementoSerieFolio, ObjBancos.CveComplementoPago, CveIE))) Retorno.AppendFormat("PDF   ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}&CveIE={2}", ObjBancos.ComplementoSerieFolio, ObjBancos.CveComplementoPago, CveIE))) diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb index 1c5db7aa7..96dfaf3ed 100644 --- a/Ventas/PV.aspx.vb +++ b/Ventas/PV.aspx.vb @@ -227,7 +227,7 @@ Partial Class PV Private ReadOnly Property Ruta As String Get - Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" + Return UsuarioActual.Empresa.Ruta End Get End Property diff --git a/Ventas/PopUpBuscarFolio.aspx.vb b/Ventas/PopUpBuscarFolio.aspx.vb index 960074304..f6ecdce33 100644 --- a/Ventas/PopUpBuscarFolio.aspx.vb +++ b/Ventas/PopUpBuscarFolio.aspx.vb @@ -7,7 +7,7 @@ Partial Class PopUpBuscarFolio Private ReadOnly Property Ruta As String Get - Return ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" + Return UsuarioActual.Empresa.Ruta End Get End Property diff --git a/Ventas/PopUpImprimir.aspx.vb b/Ventas/PopUpImprimir.aspx.vb index bf9706395..5148fd881 100644 --- a/Ventas/PopUpImprimir.aspx.vb +++ b/Ventas/PopUpImprimir.aspx.vb @@ -64,7 +64,7 @@ Partial Class PopUpImprimir RegistraScript("$get('tdContenido').style.height='520px'") Else - Dim Path As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\" & Ext & "\" & CveVenta & "." & Ext + Dim Path As String = UsuarioActual.Empresa.Ruta & Ext & "\" & CveVenta & "." & Ext Dim Archivo As New System.IO.FileInfo(Path) If Archivo.Exists Then diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index bc7e20c47..8dbe4521d 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -2434,7 +2434,7 @@ Partial Class ProductosyServicios Dim Archivo = "" Dim DirectorioTemporal = "" - Dim DirectorioDestino = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\Ecommerce\Productos\Imagenes\" + Dim DirectorioDestino = $"{UsuarioActual.Empresa.Ruta}\Ecommerce\Productos\Imagenes\" If Not Directory.Exists(DirectorioDestino) Then Directory.CreateDirectory(DirectorioDestino) End If @@ -2469,7 +2469,7 @@ Partial Class ProductosyServicios If (CveImagenActivoFijo > 0) Then Dim ObjEcommerce As New ClsECommerce If ObjEcommerce.ProductosImagenesRemove(CveImagenActivoFijo, UsuarioActual.CveEmpresa) Then - File.Delete(String.Format("{0}Empresas\{1}\{2}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, ObjEcommerce.DtResultados.Rows(0)("URL"))) + File.Delete(String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjEcommerce.DtResultados.Rows(0)("URL"))) CargarGaleriaImagenesEcommerce() RegistraScript("initcarusel();") End If diff --git a/Ventas/RepPS.aspx.vb b/Ventas/RepPS.aspx.vb index 47208fa02..cd2ca327a 100644 --- a/Ventas/RepPS.aspx.vb +++ b/Ventas/RepPS.aspx.vb @@ -226,8 +226,8 @@ Partial Class Ventas_RepPS End If params.Add(New ReportParameter("Parametros", SbParametros.ToString())) - If System.IO.File.Exists($"{ModExtensiones.DirectorioBaseEmpresas}/Empresas/{UsuarioActual.CveEmpresa}/Formatos/RepPS.rdlc") Then - ImprimirPDF($"Empresas/{UsuarioActual.CveEmpresa}/Formatos/RepPS.rdlc", DtReporte, params, "ReportePS") + If System.IO.File.Exists($"{UsuarioActual.Empresa.Ruta}Formatos/RepPS.rdlc") Then + ImprimirPDF($"{UsuarioActual.Empresa.Ruta}Formatos/RepPS.rdlc", DtReporte, params, "ReportePS") Else ImprimirPDF($"Empresas/Grales/Formatos/RepPS.rdlc", DtReporte, params, "ReportePS") End If diff --git a/Ventas/RepRecuperacionDetalle.aspx.vb b/Ventas/RepRecuperacionDetalle.aspx.vb index bbbb91a97..1c99eed8e 100644 --- a/Ventas/RepRecuperacionDetalle.aspx.vb +++ b/Ventas/RepRecuperacionDetalle.aspx.vb @@ -341,7 +341,7 @@ Partial Class Ventas_RepRecuperacionDetalle If DdlClienteSucursal.SelectedValue <> "-1" Then StrFiltro.AppendFormat(" Cliente Sucursal: {0}", DdlClienteSucursal.SelectedItem.Text) Dim RutaPDF As String - Dim Ruta As String = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" + Dim Ruta As String = UsuarioActual.Empresa.Ruta '$"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{UsuarioActual.CveEmpresa}\" RutaPDF = $"{Ruta}\Formatos\RepRecuperacionDetalle.rdlc" If Not File.Exists(RutaPDF) Then RutaPDF = "Empresas/Grales/Formatos/RepRecuperacionDetalle.rdlc" diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index c54c6f784..2a85b6ce7 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1060,7 +1060,7 @@ <%----%> <%--0--%> diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 68d69336d..72e383ea8 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -6949,6 +6949,11 @@ Partial Class Ventas GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlUnidadMedida").Enabled = False GvPS.Rows(e.NewEditIndex).FCDropDownList("DdlClasificacion").Enabled = False End If + + If GvPS.Rows(e.NewEditIndex).DataKey("CvePromocionDetalle").ToString().ToEntero() > 0 Then + GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False + GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").ToolTip = "No se puede editar el descuento porque viene de una promoción" + End If End Sub Protected Sub GvPS_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvPS.RowCancelingEdit GvPS.EditIndex = -1 @@ -6971,7 +6976,7 @@ Partial Class Ventas Exit Sub End If - If UsuarioActual.CveEmpresa = 140 Then + If UsuarioActual.CveEmpresa = 140 OrElse DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then ObjDescuento = CalcularDescuentos(TmpDT.Rows(e.RowIndex)("CvePS").ToString().ToEntero(), Cantidad, PU) End If @@ -7214,6 +7219,10 @@ Partial Class Ventas TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR TmpDT.Rows(e.RowIndex)("CuentaPredial") = CuentaPredial + If ObjDescuento IsNot Nothing Then + TmpDT.Rows(e.RowIndex)("CvePromocionDetalle") = ObjDescuento.CvePromocionDetalle + End If + If GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").Items.Count = 0 Then TmpDT.Rows(e.RowIndex)("Proyecto") = "Sin Proyecto Asignado" TmpDT.Rows(e.RowIndex)("CveSubProyecto") = -1 @@ -8442,7 +8451,7 @@ Partial Class Ventas Try - Dim DirectoriArchivoXML As String = System.IO.Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas", UsuarioActual.CveEmpresa.ToString(), ObjFactura.TipoDocto) + Dim DirectoriArchivoXML As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto) ' System.IO.Path.Combine() If Not Directory.Exists(DirectoriArchivoXML) Then Directory.CreateDirectory(DirectoriArchivoXML) End If @@ -13727,7 +13736,7 @@ Partial Class Ventas End If If UsuarioActual.Empresa.CvePlataforma = 2 Then - PdfFacturaPyME(ObjFactura, TmpDT) + PdfFacturaPyME(ObjFactura, TmpDT, False) Else 'REINICIA VALORES DE CONVERSION DE MONEDA @@ -13779,7 +13788,7 @@ Partial Class Ventas End Select - ImprimirbytesPDF(PdfFactura(ObjFactura), "Factura", "PDF") + ImprimirbytesPDF(PdfFactura(ObjFactura, Guardar:=False), "Factura", "PDF") Select Case ConversionRemision Case "*" @@ -16694,11 +16703,11 @@ Partial Class Ventas Dim dr As DataRow = Nothing If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then - dr = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {3} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {3} ))", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc ") + dr = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {3} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {3} ))", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, Cantidad), Orderby:="CantidadMinima desc ") If dr Is Nothing Then 'verifica marca, si tiene asignada la promocion - dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {4} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc") + dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {4} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, Cantidad), Orderby:="CantidadMinima desc") End If End If @@ -16714,7 +16723,7 @@ Partial Class Ventas TipoAplicacion = dr("TipoAplicacion").ToString().ToEntero() If CantMinima > 0 Then - Cant = Math.Floor(TxtCantidad.Text.ToDecimal / CantMinima).ToEntero() + Cant = Math.Floor(Cantidad / CantMinima).ToEntero() End If End If @@ -21517,7 +21526,7 @@ Partial Class Ventas Dim RFC As String = "" Dim XMLDoc As New XmlDocument - Dim Archivo As String = String.Format("{0}Empresas\{1}\Ventas\{2}\{3}", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Request("RFC"), $"{Request("CveFactura")}.xml") + Dim Archivo As String = String.Format("{0}Ventas\{1}\{2}", UsuarioActual.Empresa.Ruta, Request("RFC"), $"{Request("CveFactura")}.xml") If IO.File.Exists(Archivo) Then Dim Validada As Boolean = True @@ -22987,7 +22996,7 @@ Partial Class Ventas RequiereAlmacenOrigen = True DdlAlmacenOrigen.Items.Clear() DdlAlmacenOrigen.Items.Insert(0, New ListItem(" Seleccione ", "-1")) - DdlAlmacenOrigen.SelectedValue = "-1" + DdlAlmacenOrigen.SelectedValueExist("-1") DdlAlmacenOrigen.DataBind() DdlAlmacenOrigen.Items.Insert(0, New ListItem("Almacen", DbRowVenta("CveAlmacenTraspasoDestino").ToString())) DdlAlmacenOrigen.SelectedValueExist(DbRowVenta("CveAlmacenTraspasoDestino").ToString()) @@ -30052,7 +30061,7 @@ Partial Class Ventas For Each drow As DataRow In factura.DtDetalle.Rows If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then - If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, + If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "") Then Resultado = False Exit For @@ -31939,8 +31948,7 @@ Partial Class Ventas Adjunto = String.Format("{0}-{1}.{2}", LblSerie.Text, TxtFolio.Text, FileExtension) Dim objVentas As New ClsVentas Dim Path As String - Path = Extensiones.DirectorioBaseEmpresas - Path += String.Format("Empresas/{0}/Ventas", UsuarioActual.CveEmpresa) + Path = String.Format("{0}Ventas", UsuarioActual.Empresa.Ruta) If Not Directory.Exists(Path) Then Directory.CreateDirectory(Path) End If @@ -31967,8 +31975,7 @@ Partial Class Ventas Protected Sub BtnArchivoAdjunto_Click(sender As Object, e As System.EventArgs) Handles BtnArchivoAdjunto.Click Dim ruta As String = HttpContext.Current.Request.ApplicationPath - ruta = Extensiones.DirectorioBaseEmpresas - ruta += String.Format("Empresas/{0}/Ventas", UsuarioActual.CveEmpresa) + ruta = String.Format("{0}Ventas", UsuarioActual.Empresa.Ruta) ruta += $"/{Adjunto}" Dim Archivo As New System.IO.FileInfo(ruta) @@ -32003,7 +32010,7 @@ Partial Class Ventas Protected Sub BtnEliminarAdjunto_Click(sender As Object, e As System.EventArgs) Handles BtnEliminarAdjunto.Click Dim objVentas As New ClsVentas Dim Path As String - Path = String.Format("{0}Empresas/{1}/Ventas/{2}", Extensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, Adjunto) + Path = String.Format("{0}Ventas/{1}", UsuarioActual.Empresa.Ruta, Adjunto) If File.Exists(Path) Then File.Delete(Path) End If diff --git a/Ventas/eFacturas.aspx.vb b/Ventas/eFacturas.aspx.vb index 2fe02e10e..92b66a211 100644 --- a/Ventas/eFacturas.aspx.vb +++ b/Ventas/eFacturas.aspx.vb @@ -48,7 +48,7 @@ Partial Class Ventas_eFacturas txtFechaF.Text = Now.ToShortDateString 'txtFechaI.Text.ToDate.AddMonths(1).AddDays(-1).ToShortDateString - Destino = String.Format("{0}Ventas\", UsuarioActual.Empresa.Ruta) 'string.format("{0}Empresas\{1}\Compras\", ModExtensiones.DirectorioBaseEmpresas ,UsuarioActual.CveEmpresa & "\Compras\" + Destino = String.Format("{0}Ventas\", UsuarioActual.Empresa.Ruta) Ejecutable = String.Format("{0}\Utilerias\eeeFacturas.exe", AppDomain.CurrentDomain.BaseDirectory) Form.DefaultButton = BtnConsultar.UniqueID @@ -354,7 +354,7 @@ Partial Class Ventas_eFacturas Protected Sub LnkNoRecibidas_Click(sender As Object, e As EventArgs) Handles LnkNoRecibias.Click Dim dt As New DataTable - Dim Ruta As String = String.Format("{0}\Empresas\{1}\Compras\NoRecibidas-{1}.xml", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa) + Dim Ruta As String = String.Format("{0}Compras\NoRecibidas-{1}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveEmpresa) Dim Str As New StringBuilder If IO.File.Exists(Ruta) Then dt.ReadXml(Ruta) @@ -464,7 +464,7 @@ Partial Class Ventas_eFacturas Dim ObjProcess As Process = Nothing Dim Mensajes As String = "" Dim EjecutableUtilerias = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Utilerias\ADSUtilerias.exe") - Dim Folder = Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas\") + Dim Folder = UsuarioActual.Empresa.Ruta.Replace($"{UsuarioActual.CveEmpresa.ToString()}\", "") 'Path.Combine(ModExtensiones.DirectorioBaseEmpresas, "Empresas\") Dim error1 As Boolean = False Dim en As New CultureInfo("en-US") Dim fechai = txtFechaI.Text.Trim.ToDate.ToString("d", en) From 998d185e46ef7080931b19700dfb0c033c206897 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 31 Jul 2021 09:54:24 -0700 Subject: [PATCH 35/44] -solo cargue eventos especificando usuario --- Ashx/CargaEventos.ashx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index 7edc077a0..f74549f7e 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -28,16 +28,16 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState FI = context.Request("start").ToDate FF = context.Request("end").ToDate + If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then + 'Convierte el objeto de Eventos en JSON + 'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer + Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events) + + context.Response.Write(sJSON) + End If + End If - - If Not GetEventos(CveUsuario, CveEmpresa, FI, FF) Then - 'Convierte el objeto de Eventos en JSON - 'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer - Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events) - - context.Response.Write(sJSON) - End If End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable From 89d76c35463487b566435a997f761a4c6e086a26 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 31 Jul 2021 09:55:06 -0700 Subject: [PATCH 36/44] se eliminaron --- Empresas/1/Formatos/FacturaBack.rdlc | 5802 -------------------------- Empresas/111/Formatos/Factura.rdlc | 3664 ---------------- Empresas/111/Formatos/OC.rdlc | 1862 --------- 3 files changed, 11328 deletions(-) delete mode 100644 Empresas/1/Formatos/FacturaBack.rdlc delete mode 100644 Empresas/111/Formatos/Factura.rdlc delete mode 100644 Empresas/111/Formatos/OC.rdlc diff --git a/Empresas/1/Formatos/FacturaBack.rdlc b/Empresas/1/Formatos/FacturaBack.rdlc deleted file mode 100644 index b1b4dfd5f..000000000 --- a/Empresas/1/Formatos/FacturaBack.rdlc +++ /dev/null @@ -1,5802 +0,0 @@ - - - 0 - - - - System.Data.DataSet - /* Local Connection */ - - 06ae5329-8ff5-42b5-b7f4-6d68e5186420 - - - - System.Data.DataSet - /* Local Connection */ - - 3fde81d4-b9ca-4175-9160-5293ca8b9aa9 - - - - System.Data.DataSet - /* Local Connection */ - - c220a38d-e45b-4e04-917e-7dfd9cc3345f - - - - - - DsOC - /* Local Query */ - - - - CveOrdenCompraDetalle - System.Int64 - - - CveOrdenCompra - System.Int64 - - - Cantidad - System.Double - - - CveUnidadMedida - System.Int64 - - - Abreviatura - System.String - - - PS - System.String - - - CveClasificacion - System.Int64 - - - Clasificacion - System.String - - - CveActivoFijo - System.Int64 - - - Codigo - System.String - - - TipoDato - System.Int64 - - - CodigoAF - System.String - - - CodigoPS - System.String - - - UnidadMedida - System.String - - - Importe - System.Decimal - - - Total - System.Decimal - - - UM - System.String - - - Obs - System.String - - - SubProyecto - System.String - - - PU - System.String - - - Descuento - System.String - - - Marca - System.String - - - ClaveUM - System.String - - - ClaveProdServ - System.String - - - - DsOC - C:\Users\Orlando Bojorquez\Documents\Visual Studio 2013\WebSites\WebSite1\App_Code\DsOC.xsd - DtOCDetalle - - - - - - - - DataSet2 - /* Local Query */ - - - - ImpuestoLocal - System.String - - - Importe - System.Double - - - Nombre - System.String - - - ImporteT - System.String - - - Orden - System.String - - - - DataSet2 - C:\Users\jesus\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DataSet2.xsd - DataTable1 - - - - - - - - DsFirmas - /* Local Query */ - - - - Titulo - System.String - - - Nombre - System.String - - - Puesto - System.String - - - Lado - System.String - - - - DsFirmas - C:\Users\Jesus Murua\Documents\Visual Studio 2015\WebSites\WebSite2\App_Code\DsFirmas.xsd - DataTable1 - - - - - - - - - - - - - - true - true - - - - - Por este pagaré prometo (emos) pagar incondicionalmente a la orden de COMPUPROVEEDORES, S.A. DE C.V. el día - - - - =Parameters!Vencimiento.Value - - - - en Hermosillo, Sonora o en el domicilio que se me requiera, la cantidad de: - - - - $ - - - - =Parameters!Total.Value - - - - ( - - - - =UCase(Parameters!ImporteLetra.Value) - - - - ) - - - - la falta de pago de este documento dará derecho a COMPUPROVEEDORES, S.A. DE C.V. a cobrar 5% mensual de intereses moratorios hasta su total liquidación. - - - - - - - true - true - - - - - ACEPTO (NOMBRE Y FIRMA) - - - - - - - - - Día: - - - - =Parameters!Vencimiento.Value - - - - en - - - - =Parameters!CiudadSucursal.Value - - - - - - - Textbox79 - 0.98541in - 4.98342in - 0.33472in - 3.15252in - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - 0.95764in - 5.2612in - 0in - 2.29784in - 2 - - - - - - true - true - - - - - =Parameters!ClienteNombre.Value - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - 6.87813in - 0.17798in - 1.38195in - 8.13594in - - - - - - true - true - - - - - Facturado a: - - - - - - - - - Cliente: - - - - =Parameters!ClienteNombre.Value - - - - - - - - - Calle: - - - - - - - - =Parameters!ClienteCalle.Value - - - - - - - - - Colonia: - - - - - - - - =Parameters!ClienteColonia.Value - - - - - - - - Ciudad: - - - - =Parameters!ClienteCiudad.Value - - - - - - - - - Municipio y/o Delegación: - - - - =Parameters!ClienteMunicipio.Value - - - - - - - - - Estado: - - - - - - - - =Parameters!ClienteEstado.Value - - - - - - - - CP: - - - - - - - - =Parameters!ClienteCP.Value - - - - - - - - - Pais: - - - - =Parameters!ClientePais.Value - - - - - - - - RFC: - - - - =Parameters!ClienteRFC.Value - - - - - - - - - Teléfono: - - - - =Parameters!ClienteTelefono.Value - - - - - - - - - Coordinador Empresarial: - - - - =Parameters!VendedorNombre.Value - - - - - - - Textbox2 - 1.74312in - 0.45207cm - 1.53071in - 3.86958in - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - true - true - - - - - "Este documento es una representación impresa de un CFDI" - - - - - - - - - Folio fiscal: - - - - =Parameters!FolioFiscal.Value - - - - - - - =Parameters!FechaCertificacion.Value - - - - Número de serie del Certificado de Sello Digital: - - - - =Parameters!CertificadoContribuyente.Value - - - - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - - - - - - - - - - - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - External - =Parameters!QR.Value - FitProportional - 0.0444in - 6.56374in - 1.2939in - 1.53682in - 1 - - - - - - true - 5.35317in - 0.17339in - 1.39013in - 8.14013in - 2 - - - - - - Embedded - Logo - FitProportional - 0.0125in - 0.17067in - 1.09458in - 1.14765in - 3 - - - - - - true - true - - - - - Domicilio fiscal: - - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - =Parameters!Sucursal.Value - - - - - - - - - Tel. - - - - =Microsoft.VisualBasic.Interaction.IIF(Parameters!Sucursal.Value = "MATRIZ", "(662) 214 2200", Microsoft.VisualBasic.Interaction.IIF(Parameters!Sucursal.Value = "Tijuana", "(664) 645 1814", Microsoft.VisualBasic.Interaction.IIF(Parameters!Sucursal.Value = "Culiacán", "(667) 715 8533", Microsoft.VisualBasic.Interaction.IIF(Parameters!Sucursal.Value = "Aguascalientes", "(449) 913 4418", "")))) - - - - - - - - - SUCURSALES - - - - - - - - - - - - - Culiacán, Sin. - - - - - - - - - - - - Tijuana, B.C - - - - . - - - - - - - - Aguascalientes, Ags. - - - - - - - - - - - - - (667) - - - - 715 8533 - - - - - - - - - - - - (664) - - - - 645 1814 - - - - - - - - - - - - (449) - - - - 913 4418 - - - - - - - Textbox10 - 0.13104cm - 3.73814cm - 2.14312cm - 9.51761cm - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - www. - - - - compuproveedores - - - - .com - - - - - - - Textbox2 - 1.98841cm - 3.73814cm - 0.58527cm - 9.51761cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - - - - - Factura - - - - - - - - - - - - - Serie: - - - - =Parameters!Serie.Value - - - - Folio: - - - - =Parameters!Folio.Value - - - - - - - - - Fecha: - - - - - - - - =Parameters!Fecha.Value - - - - - - - - - Fecha de Vencimiento: - - - - - - - - =Parameters!Vencimiento.Value - - - - - - - - - Forma de pago: - - - - =Parameters!FormaPago.Value - - - - - - - - - Método de pago: - - - - =Parameters!MetodoPago.Value - - - - - - - - - Cuenta: - - - - =IIF(Parameters!NumCta.Value="0" Orelse Parameters!NumCta.Value="","No Identificado",Parameters!NumCta.Value) - - - - - - - - - Régimen fiscal: - - - - - - - - - - - - - Regimen General de Ley Personas Morales - - - - - - - - - - - Textbox4 - 0.05159in - 5.57992in - 1.64016in - 2.7336in - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - 1.69533cm - 7.16359cm - 0.38833cm - 0cm - 8 - - - - - - 1.72708cm - 9.82914cm - 0.38833cm - 0cm - 9 - - - - - - true - true - - - - - Enviar a: - - - - - - - - - Calle: - - - - =Parameters!EnvioDireccion.Value - - - - - - - - - - - - - Colonia: - - - - - - - - =Parameters!EnvioColonia.Value - - - - Ciudad: - - - - =Parameters!EnvioCiudad.Value - - - - - - - - - Municipio y/o Delegación: - - - - =Parameters!EnvioCiudad.Value - - - - - - - - - Estado: - - - - =Parameters!EnvioEstado.Value - - - - CP: - - - - - - - - =Parameters!EnvioCP.Value - - - - - - - - - Pais: - - - - =Parameters!ClientePais.Value - - - - - - - - RFC: - - - - =Parameters!ClienteRFC.Value - - - - - - - - - - - - - Teléfono: - - - - =Parameters!ClienteTelefono.Value - - - - - - - - - Pedido: - - - - - - - - =Parameters!OC.Value - - - - - - - Textbox36 - 4.40287cm - 7.37039cm - 3.91265cm - 6.74968cm - 10 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Expedido en - - - - : - - - - - - - - - =Parameters!DomicilioSucursal.Value - - - - - - - Textbox40 - 4.42754cm - 14.94028cm - 3.88798cm - 6.17606cm - 11 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 0.81615in - - - 0.62224in - - - 0.70711in - - - 0.98425in - - - 0.98425in - - - 2.2209in - - - 0.68106in - - - 1.11998in - - - - - 0.19645in - - - - - true - true - - - - - CANTIDAD - - - - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Cve U.M SAT - - - - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - CLAVE - - - - - - - Textbox29 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - Clave Prod Serv - - - - - - - Textbox3 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - U.M - - - - - - - Textbox8 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - DESCRIPCIÓN - - - - - - - Textbox17 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - P/U - - - - - - - Textbox23 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - IMPORTE - - - - - - - Textbox1 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.17561in - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ClaveUM.Value - - - - - - - ClaveUM - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Codigo.Value - - - - - - - Codigo - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!ClaveProdServ.Value - - - - - - - ClaveProdServ - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!UnidadMedida.Value - - - - - - - UnidadMedida - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PS.Value & " " & Fields!Obs.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PU.Value - - - - - - - PU - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cantidad.Value * Fields!PU.Value - - - - - - - TiempoEntrega - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsOC - 3.34327in - 0.17798in - 0.37206in - 8.13594in - 12 - - - - - - true - true - - - - - - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - Embedded - Microsoft - Fit - 10.18865cm - 0.63633cm - 2.37313cm - 11.6363cm - 14 - - - - - - true - true - - - - - - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =UCase(Parameters!ImporteLetra.Value) - - - - - - - ImporteLetra - 4.32608in - 4.41508in - 0.18861in - 3.89844in - 16 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - BBVA Bancomer CTA.0446 9111 53 CLABE 0127 6000 446 9111 534 - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - No hay cancelación de factura después de 7 días - - - - - - - Textbox33 - 12.77869cm - 13.0006cm - 0.44794cm - 8.11574cm - 18 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Serie: - - - - - - - - =Parameters!Serie.Value - - - - - - - - Folio: - - - - =Parameters!Folio.Value - - - - - - - Textbox81 - 6.88992in - 6.24753in - 0.18682in - 2.05349in - 21 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 2.99824cm - - - - - 0.48004cm - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - =Fields!ImpuestoLocal.Value - - - - 2.71633cm - - - true - true - - - - - =IIF(Fields!ImpuestoLocal.Value = "Total",UCase(Fields!ImpuestoLocal.Value),Fields!ImpuestoLocal.Value) - - - - - - White - 2pt - 2pt - 2pt - 2pt - - - - - - - - DataSet1 - 10.21335cm - 15.40177cm - 0.48004cm - 5.71457cm - 23 - - - - - - true - true - - - - - =Parameters!EstatusFactura.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!EstatusEntrega.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - 21.04939cm - - - - =Parameters!UsuarioImprimio.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - =Parameters!FechaImpresion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ="Página " & Globals.PageNumber & " de " & Globals.TotalPages - - - - - - - Textbox35 - 0.17639cm - 18.24379cm - 0.41981cm - 2.5cm - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - CFDI Relacionados - - - - - - - Textbox5 - 1.21165cm - 0.43307cm - 0.54004cm - 20.63354cm - 3 - - - #0e2455 - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Tipo Relación: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - 07 CFDI por aplicación de anticipo - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Folio Fiscal: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FolioFiscalPadre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0cm - 0cm - 0.5cm - 0.5cm - 1.27cm - - - - - - - Textbox3 - 0.3103in - 6.40983in - 0.5cm - 1.31293in - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!TipoDocumento.Value - - - - - - - Textbox3 - 0.25286cm - 6.40983in - 0.5cm - 1.31293in - 1 - - - Black - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - ECONOLLANTAS SERVICIOS Y ACCESORIOS SA DE CV -ESA990617N99 - - - - - - - - - VERACRUZ Y CUERNAVACA 148 SAN BENITO HERMOSILLO - - - - - - - - - HERMOSILLO SONORA CP 83190 MEXICO - - - - - - - - - Tel: 210-3600 210-0041 - - - - - - - - - - - - Textbox4 - 0.30578cm - 1.70679in - 0.78708in - 2.59505in - 2 - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - logo - FitProportional - 0.30578cm - 0.06139cm - 1.99918cm - 4.2033cm - 3 - - - - - - true - - - - - www.econollantas.com - - - - - - - - - 01800 560-6757 - - - - - - - Textbox10 - 0.92143in - 1.70679in - 0.32291in - 2.59505in - 4 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Expedido en Sucursal: 2 -MATRIZ - - - - - VERACRUZ Y CUERNAVACA 148 SAN BENITO HERMOSILLO HERMOSILLO -Tel: 662-210-0041 662-210-3600 -Correo:veracruz@econollantas.com -MAT Marco Antonio Alvarado Medina - - - - - - - - - - - - - - - - Textbox10 - 0.12039in - 4.36275in - 1.12396in - 1.95541in - 5 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - =Parameters!Fecha.Value - - - - - - - Textbox3 - 0.51239in - 6.40983in - 0.5cm - 1.31293in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Folio Fiscal: - - - - - - - Textbox54 - 1.31379in - 0.18056in - 0.66679in - 7 - - - - - - - White - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - No. Serie del Certificado del SAT: - - - - - - - Textbox54 - 1.70678in - 0.18056in - 1.67901in - 8 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha y Hora de certificación: - - - - - - - Textbox54 - 1.50824in - 0.19444in - 1.53781in - 9 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SerieCertificadoSAT.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FechaCertificacion.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FolioFiscal.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - No. de Serie del Certificado del CSD: - - - - - - - Textbox54 - 1.31379in - 8.82379cm - 0.17077in - 1.85039in - 13 - - - - - - - White - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Régimen Fiscal: - - - - - - - Textbox54 - 1.71657in - 8.82379cm - 0.18056in - 0.82791in - 14 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Lugar, fecha y hora emisión: - - - - - - - Textbox54 - 1.50824in - 8.82379cm - 0.19444in - 1.53781in - 15 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Régimen General de Ley Personas Morales - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Fecha.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!FolioFiscal.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ClienteNombre.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ClienteLugar.Value - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 2.12527cm - - - 2.02474cm - - - 10.17786cm - - - 2.52862cm - - - 3.15415cm - - - - - 0.52063cm - - - - - true - - - - - Cantidad - - - - - - - Textbox34 - - - - Black - - - - Black - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Unidad - - - - - - - Textbox53 - - - - Black - - - - Black - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Descripción - - - - - - - Textbox79 - - - - Black - - - - Black - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - P. Unitario - - - - - - - Textbox84 - - - - Black - - - - Black - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - - - - - Importe - - - - - - - - - - - - - - - - Black - - - - Black - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.4148cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!UM.Value - - - - - - - UM1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PS.Value & " " & Fields!Obs.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!PU.Value - - - - - - - PU1 - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!Cantidad.Value * Fields!PU.Value - - - - - - - Textbox88 - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - 0.13698cm - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - After - - - - - - Before - - - - DsOC - 7.23842cm - 0.10027cm - 1.07241cm - 20.01064cm - 21 - - - - - - true - - - - - EL CLIENTE NO ACEPTA PÓLIZA DE SEGURO - - - - - - - Textbox10 - 3.3317in - 0.05129in - 0.18749in - 2.43861in - 22 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - Hermosillo: Veracruz (662) 210-0041 - Morelos (662) 2110805 - Colosio (662) 2608088 - Reforma (662) 213-8724 - Perisur (662) 2544849 - Rodríguez (662) 213-1388 - Sahuaro (662) 2161471 - - - - - - - - - Solidaridad (662) 216-0935 - Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 -Solidaridad (662) 216-0935 - - - - - - - - Textbox10 - 3.58864in - 0.05129in - 0.61791in - 7.87614in - 23 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =IIF(Parameters!CondicionPago.Value.ToString="","No Identificado",Parameters!CondicionPago.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 2.41181cm - - - 3.35949cm - - - - - 0.46458cm - - - - - true - true - - - - - Ord.Compra: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Parameters!OC.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46458cm - - - - - true - true - - - - - Pedido por: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.46458cm - - - - - true - true - - - - - TEL: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - - - - - - - - - - - - - - - DsOC - 5.00392cm - 11.67382cm - 1.39374cm - 5.7713cm - 25 - - - - - - - - Embedded - toyotires - FitProportional - 0.72918cm - 3.1248cm - - - - - - Embedded - descarga - FitProportional - 3.50446cm - 0.72918cm - 3.61746cm - 1 - - - - - - Embedded - mastercraft - FitProportional - 8.14691cm - 0.72918cm - 3.03031cm - 2 - - - - - - Embedded - GRC_0 - FitProportional - 12.0768cm - 0.72918cm - 3.27725cm - 3 - - - - - - Embedded - googleplay - FitProportional - 0.51151cm - 16.26369cm - 0.69391cm - 1.2521cm - 4 - - - - - - Embedded - itunes - FitProportional - 0.47624cm - 17.69217cm - 0.72918cm - 1.4869cm - 5 - - - - - - true - - - - - DESCARGA NUESTRA APLICACIÓN - - - - - - - Textbox10 - 0.00001in - 6.08675in - 0.18749in - 1.67819in - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - - - - - <** Toda corrección de los datos del comprobante deberá efectuarse dentro del mes y año de expedición **> - - - - - - - Textbox10 - 0.59156in - 0.01078in - 0.24291in - 7.87614in - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - 10.82221cm - 0.1029cm - 2.20951cm - 20.03278cm - 26 - - - - - - 13.16577cm - 0.1029cm - 0cm - 20.03278cm - 27 - - - - - - - - true - true - - - - - ="SON: " & Microsoft.VisualBasic.Strings.UCase(Parameters!ImporteLetra.Value) - - - - - - - - - Método de Pago: - - - - =IIF(Parameters!MetodoPago.Value.ToString="","No Identificado",Parameters!MetodoPago.Value) - - - - Número Cuenta: - - - - =IIF(Parameters!NumCta.Value="0" Orelse Parameters!NumCta.Value="","No Identificado",Parameters!NumCta.Value) - - - - - - - - - - - - - - - - - - =Parameters!FormaPago.Value - - - - Precios incluyen IVA por ser venta al - - - - - - - - - - - - - - - - - - - - - - - - - Textbox43 - 0.03528cm - 3.58701cm - 1.63592cm - 10.71085cm - - - 2pt - 2pt - 2pt - 2pt - - - - - - - 2.99107cm - - - - - 0.6cm - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 2pt - 2pt - es-MX - - - - - - - - - - - - - - - - - - - =Fields!ImpuestoLocal.Value - - - - 2.40402cm - - - true - true - - - - - =Fields!ImpuestoLocal.Value - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - DataSet1 - 0.03528cm - 14.51617cm - 0.6cm - 5.39509cm - 1 - - - - - - true - 13.27161cm - 0.13028cm - 1.75917cm - 19.91126cm - 28 - - - - - - 15.12955cm - 0.1029cm - 0cm - 20.03278cm - 29 - - - - - - - - - - - 4.06703cm - - - 11.7334cm - - - - - 0.6cm - - - - - true - true - - - - - =Parameters!Observaciones.Value - - - - - - - Textbox128 - - - - - - - - - - - - - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - 2 - - - - - - - 1.8cm - - - - - true - true - - - - - Sello digital del CFDI: - - - - - - - Textbox132 - - - - - 1pt - - - - 1pt - - - - 1pt - - - - 1pt - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Parameters!SelloCFDI.Value - - - - - - - Textbox133 - - - Top - 2pt - 2pt - 2pt - 2pt - - - - - - - - 1.2cm - - - - - true - true - - - - - Sello del SAT: - - - - - - - Textbox134 - - - - - 1pt - - - - 1pt - - - - 1pt - - - - 1pt - - Middle - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Parameters!SelloSAT.Value - - - - - - - Textbox135 - - - Top - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.6cm - - - - - true - true - - - - - Cadena original del complemento de certificación digital del SAT: - - - - - - - Textbox136 - - - - - - - - - - - - - - 1pt - - Middle - 2pt - 2pt - 2pt - 2pt - - - 2 - - - - - - - - - - - - - - - - - - - - - - DsOC - 3.94361cm - 4.2cm - 15.80043cm - - - - - - External - =Parameters!QR.Value - FitProportional - 1.20129in - 1.48366in - 1 - - - - - - true - - - - - =Parameters!CadenaOriginal.Value - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Este CFDI fue certificado por el PAC Finkok autorización del SAT 10852 publicada 2013-03-22 18:00:00. Para descargar el archivo XML visite - - - - WWW.FE.LC/5UBMU - - - - o utilice el código de barras a la derecha: - - - - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - 15.27066cm - 0.16556cm - 6.99792cm - 19.87598cm - 30 - - - - - - 22.44641cm - - - - - - - Textbox3 - 0.07056cm - 16.14544cm - 0.41479cm - 3.95896cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - - - =Today - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 0.5cm - 0.5cm - 1cm - 0.5cm - 1.27cm - - - - - - - Textbox1 - - - - Black - - 1pt - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - CODIGO - - - - - - - Textbox7 - - - - Black - - 1pt - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - PRODUCTO - - - - - - - Textbox9 - - - - Black - - 1pt - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - D E S C R I P C I O N - - - - - - - Textbox9 - - - - Black - - 1pt - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - P. UNITARIO - - - - - - - Textbox13 - - - - Black - - 1pt - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - IMPORTE - - - - - - - Textbox5 - - - - Black - - 1pt - - - Black - - 1pt - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 0.38833cm - - - - - true - true - - - - - =Fields!Cantidad.Value - - - - - - - Cantidad1 - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!CodigoPS.Value - - - - - - - CodigoPS1 - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Producto.Value - - - - - - - Producto - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Obs.Value - - - - - - - Obs - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Importe.Value - - - - - - - Importe - - - 2pt - 2pt - 1pt - - - - - - - - true - true - - - - - =Fields!Total.Value - - - - - - - Total - - - 2pt - 2pt - 1pt - - - - - - - - - - - - - - - - - - - - - - After - - - - - - - DsOC - 4.95953cm - 0.38651in - 0.86133cm - 18.29976cm - - - - - - true - true - - - - - SUCURSAL SOLIDARIDAD - - - - - - - - - - - - - R.F.C ESA990617N99 - - - - - - - - - BLVD. SOLIDARIDAD ESQ NUÑO DE GUZMAN COL PROGRESISTA - - - - - - - - - TEL/FAX 216-0935 Y 216-0925 HERMOSILLO, SONORA - - - - - - - - - MATRIZ: - - - - VERACRUZ Y CUERNAVACA # 48 COL SAN BENITO - - - - - - - - - TEL 210-00-41, 210-36-00 HERMOSILLO, SONORA - - - - - - - - - - - - - - - - Textbox10 - 0.254cm - 6.07528cm - 2.74678cm - 8.85781cm - 1 - - - 2pt - 2pt - 2pt - 2pt - - - - Embedded - compuproveedores - FitProportional - 0.59579cm - 0.98173cm - 2.00595cm - 1.89688cm - 2 - - - - - - true - true - - - - - P - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!ProveedorNombre.Value - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - ORDEN DE COMPRA - - - - - - - Textbox19 - 2.01597cm - 15.53795cm - 0.49417cm - 3.74354cm - 5 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Gray - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Folio.Value - - - - - - - Textbox20 - 2.51014cm - 15.53795cm - 0.54708cm - 3.74354cm - 6 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Fecha.Value - - - - - - - Textbox20 - 3.62195cm - 15.53796cm - 0.54708cm - 3.74353cm - 7 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - FECHA - - - - - - - Textbox19 - 3.16305cm - 15.53795cm - 0.49417cm - 3.74354cm - 8 - - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - - Black - - 1pt - - Gray - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - FAVOR DE ENTREGAR AL PROTADOR DE LA PRESENTE, CON UN CARGO A NUESTRA CUENTA LO SIGUIENTE: - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - NOTA IMPORTANTE - - - - - - - - - REHUSAREMOS EL PAGO DE LA MERCANCIA SI NO VIENE ACOMPAÑADA A LA FACTURA ESTA ORDEN - - - - - - - Textbox16 - 6.03253cm - 0.98173cm - 1.94938cm - 3.94331cm - 10 - - - 2pt - 2pt - 2pt - 2pt - - - - 5.89142cm - 0.98173cm - 0cm - 18.29976cm - 11 - - - - - - true - true - - - - - I.V.A. - - - - - - - Textbox20 - 6.93619cm - 14.28149cm - 0.45183cm - 2.5cm - 12 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - TOTAL: - - - - - - - Textbox20 - 7.54678cm - 14.28149cm - 0.45183cm - 2.5cm - 13 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - DESCUENTO: - - - - - - - Textbox20 - 6.48436cm - 14.28149cm - 0.45183cm - 2.5cm - 14 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!IVA.Value - - - - - - - Textbox20 - 6.93619cm - 16.78149cm - 0.45183cm - 2.5cm - 15 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!Total.Value - - - - - - - Textbox20 - 7.54678cm - 16.78149cm - 0.45183cm - 2.5cm - 16 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - - - - - - - - Textbox20 - 6.48436cm - 16.78149cm - 0.45183cm - 2.5cm - 17 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - SUB-TOTAL - - - - - - - Textbox20 - 6.03253cm - 14.28149cm - 0.45183cm - 2.5cm - 18 - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - =Parameters!SubTotal.Value - - - - - - - Textbox20 - 6.03253cm - 16.78149cm - 0.45183cm - 2.5cm - 19 - - - 2pt - 2pt - 2pt - 2pt - - - - 7.46131cm - 13.91637cm - 0cm - 5.55563cm - 20 - - - - - - 8.06917cm - 13.91637cm - 0cm - 5.55563cm - 21 - - - - - - true - true - - - - - =UCase(Parameters!ImporteLetra.Value) - - - - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Autorizó - - - - - - - Textbox12 - 11.12427cm - 6.39074cm - 0.44478cm - 5.83844cm - 23 - - - 2pt - 2pt - 2pt - 2pt - - - - 11.02995cm - 6.08009cm - 0cm - 6.6275cm - 24 - - - - - - 4.6147in - - - - - - - Textbox3 - 0.17639cm - 16.30946cm - 0.46287cm - 2.82268cm - - - 2pt - 2pt - 2pt - 2pt - - - - true - true - - - - - Fecha Impresión: - - - - - - - - =Today - - - - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - 27.94cm - 21.59cm - 1cm - 0cm - 1cm - 1cm - 0.13cm -