From a4acb03aa3411326d1889d91d35cdc972495d8e4 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 26 Mar 2022 07:58:57 -0700 Subject: [PATCH 01/13] -- serie en vigencias --- Inventarios/EntradasSalidas.aspx.vb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 9d29b4915..f6543f8e5 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -4102,7 +4102,7 @@ Partial Class Inventarios_EntradasSalidas Dim CodigoPS As String = "" Dim PS As String = "" - Dim CveSeccionAlmacen As Integer = DdlAlmacenCambioVigencias.SelectedValue.ToEntero + Dim CveSeccionAlmacen As Integer = DdlSeccionCambio.SelectedValue.ToEntero Dim Serie As String = If(TxtSerieCambio.Text = "", "", TxtSerieCambio.Text) Dim Lote As String = If(TxtLoteCambio.Text = "", "", TxtLoteCambio.Text) Dim Caducidad As String = If(TxtCaducidadCambio.Text = "", MinFecha.ToShortDateString, TxtCaducidadCambio.Text) @@ -4501,7 +4501,8 @@ Partial Class Inventarios_EntradasSalidas ImporteConcepto += PUEntrada * Dr("Cantidad").ToString.ToDecimal() 'INSERTA EL MOVIMIENTO DE ENTRADA - If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUMVigencia").ToString.ToEntero, Dr("CvePSVigencia").ToString.ToEntero, PUEntrada, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUMVigencia").ToString.ToEntero, Dr("CvePSVigencia").ToString.ToEntero, PUEntrada, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, Serie:=Dr("Serie").ToString, + Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then Mensaje = "Ocurrió un error al guardar los movimientos de entrada" ErrorMovInv = True Exit For @@ -5356,7 +5357,7 @@ Partial Class Inventarios_EntradasSalidas Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33 Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33 Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT - Timbre.Comprobante.Subtotal = Obj.SubTotal + Timbre.Comprobante.SubTotal = Obj.SubTotal Timbre.Comprobante.Descuentos = Obj.Descuento Timbre.Comprobante.Moneda = Obj.MonedaSAT Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString) From 843bfd33edcca119c2e77b684ba9a33dbdc19716 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 26 Mar 2022 07:59:14 -0700 Subject: [PATCH 02/13] -- round --- Bancos/PagoDeudor.aspx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs index 382ffee0f..d1e3553b6 100644 --- a/Bancos/PagoDeudor.aspx.cs +++ b/Bancos/PagoDeudor.aspx.cs @@ -681,7 +681,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas { string Conc = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; string Ref = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; - decimal ImporteBanco = TxtImporte.Text.ToDecimal(); + decimal ImporteBanco = TxtImporte.Text.ToDecimal().RoundSQL(); decimal ImporteMNBanco = ImporteBanco; decimal ImporteComplementaria = 0; decimal TC = TxtTCDolaresPago.Text.ToDecimal(); From 98fa11e179eebcaf1d602d5808b56b438835be46 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 26 Mar 2022 07:59:38 -0700 Subject: [PATCH 03/13] validacion aidcional en transitorio --- Inventarios/TraspasoAlmacen.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 8fc06873d..184917120 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -817,7 +817,7 @@ Partial Class Inventarios_TraspasoAlmacen #Region " GUARDAR " Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click - If ChkEmitirCartaPorte.Checked Then + If ChkTransitorio.Checked AndAlso ChkEmitirCartaPorte.Checked Then If DdlChofer.SelectedValue.ToEntero <= 0 Then Alert("Debe de seleccionar un chofer.", TipoMensaje.MsgAdvertencia) Exit Sub From a150e56d70a586fa3c5d9b2ca82729e5e4148019 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Mon, 4 Apr 2022 10:52:22 -0700 Subject: [PATCH 04/13] Ajusrtes AF, Porcentaje OC --- AF/AF.aspx | 4 +- AF/AF.aspx.vb | 843 +++++++++++++++--- Acumuladores/RepEntradasUsadosClientes.aspx | 4 +- .../RepEntradasUsadosClientes.aspx.vb | 12 +- App_Code/ClsClientes.vb | 4 +- .../Formatos/RepEntradasUsadosClientes.rdlc | 32 +- OC/OC.aspx | 16 + Ventas/Clientes.aspx.vb | 1 + Ventas/PV.aspx | 66 +- Ventas/PV.aspx.vb | 23 +- Ventas/Ventas.aspx.vb | 12 +- 11 files changed, 836 insertions(+), 181 deletions(-) diff --git a/AF/AF.aspx b/AF/AF.aspx index 741f42d39..d5eab06f6 100644 --- a/AF/AF.aspx +++ b/AF/AF.aspx @@ -267,11 +267,11 @@ - + <%-- - + --%> diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index 5da9f7191..2b9409625 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -265,6 +265,19 @@ Partial Class AF_AF End Set End Property + Private Property IndexProduccion As Integer + Get + If ViewState("IndexProduccion") Is Nothing Then + ViewState("IndexProduccion") = -1 + End If + Return ViewState("IndexProduccion").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("IndexProduccion") = value + End Set + End Property + + Private Property CveMantenimiento As Integer Get If ViewState("CveMantenimiento") Is Nothing Then @@ -278,6 +291,18 @@ Partial Class AF_AF End Property + Private Property IndexMantenimiento As Integer + Get + If ViewState("IndexMantenimiento") Is Nothing Then + ViewState("IndexMantenimiento") = -1 + End If + Return ViewState("IndexMantenimiento").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("IndexMantenimiento") = value + End Set + End Property + Private Property CvePlagaEnfermedad As Integer Get If ViewState("CvePlagaEnfermedad") Is Nothing Then @@ -290,8 +315,62 @@ Partial Class AF_AF End Set End Property + + Private Property IndexPlagaEnfermedad As Integer + Get + If ViewState("IndexPlagaEnfermedad") Is Nothing Then + ViewState("IndexPlagaEnfermedad") = -1 + End If + Return ViewState("IndexPlagaEnfermedad").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("IndexPlagaEnfermedad") = value + End Set + End Property + #End Region + + + Private Property DT_Produccion As DataTable + Get + If ViewState("DT_Produccion") Is Nothing Then + ViewState("DT_Produccion") = CreaDTProduccion() + End If + Return DirectCast(ViewState("DT_Produccion"), DataTable) + End Get + Set(value As DataTable) + ViewState("DT_Produccion") = value + End Set + End Property + + + Private Property DT_PlgaEfermedad As DataTable + Get + If ViewState("DT_PlgaEfermedad") Is Nothing Then + ViewState("DT_PlgaEfermedad") = CreaDTPlagaEngermedad() + End If + Return DirectCast(ViewState("DT_PlgaEfermedad"), DataTable) + End Get + Set(value As DataTable) + ViewState("DT_PlgaEfermedad") = value + End Set + End Property + + + Private Property DT_Mantenimiento As DataTable + Get + If ViewState("DT_Mantenimiento") Is Nothing Then + ViewState("DT_Mantenimiento") = CreaDTMantenimiento() + End If + Return DirectCast(ViewState("DT_Mantenimiento"), DataTable) + End Get + Set(value As DataTable) + ViewState("DT_Mantenimiento") = value + End Set + End Property + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not IsPostBack Then @@ -311,6 +390,7 @@ Partial Class AF_AF CargaProduccion() CargaMantenimento() CargaPlagaEnfermedad() + ModalidadesPaginaAF() 'Configuración de Modalidad Update BtnGuardar.Text = "Guardar Cambios" @@ -343,9 +423,11 @@ Partial Class AF_AF If Request("Op") IsNot Nothing Then - ModalidadesPaginaAF(Request("Op").ToString) - End If - + ModalidadesPaginaAFInicial(Request("Op").ToString) + End If + + + End If End Sub Private Sub cargaOrdenesdeservicio() @@ -431,7 +513,9 @@ Partial Class AF_AF CveEmpresaActual = UsuarioActual.CveEmpresa End Sub - Private Sub ModalidadesPaginaAF(Optional Op As String = "") + + + Private Sub ModalidadesPaginaAFInicial(Optional Op As String = "") TabProduccion.Visible = False TabPlagaEnfermedad.Visible = False @@ -440,28 +524,113 @@ Partial Class AF_AF LblFechaCompra.Text = "Fecha de Compra:" LblFechaBaja.Text = "Fecha de Baja:" - 'Arbol Frutal - If DdlTipoActivoFijo.SelectedValue.ToEntero = 150 And DdlSubTipoActivoFijo.SelectedValue.ToEntero = 1936 And CveActivoFijo > 0 Then + + If Op.Length > 0 Then + + 'Arbol Frutal + If Op = "AR" Then + + Dim CveTipoActivoFijoTmp As Integer = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo").FiltroPrimeroValor("CveTipoActivoFijo", $"TipoActivoFijo = 'ARBOLES FRUTALES'").ToEntero + DdlTipoActivoFijo.SelectedValueExist(CveTipoActivoFijoTmp) + DdlTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing) + + Dim CveSubTipoActivoFijoTemp As Integer = GlobalDTSubTipoActivoFijo(CveEmpresaActual).FiltraParametros(String.Format(" CveTipoActivoFijo = {0}", DdlTipoActivoFijo.SelectedValue), "SubTipoActivoFijo").FiltroPrimeroValor("CveSubTipoActivoFijo", $"SubTipoActivoFijo = 'ARBOLES FRUTALES'").ToEntero + DdlSubTipoActivoFijo.SelectedValueExist(CveSubTipoActivoFijoTemp) + DdlSubTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing) + + + LblFechaCompra.Text = "Fecha de Nacimiento" + LblFechaBaja.Text = "Fecha de Muerte" + TabProduccion.Visible = True + + End If + + 'Arbol Apicola + If Op = "AP" Then + + + Dim CveTipoActivoFijoTmp As Integer = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo").FiltroPrimeroValor("CveTipoActivoFijo", $"TipoActivoFijo = 'APICOLAS'").ToEntero + DdlTipoActivoFijo.SelectedValueExist(CveTipoActivoFijoTmp) + DdlTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing) + + Dim CveSubTipoActivoFijoTemp As Integer = GlobalDTSubTipoActivoFijo(CveEmpresaActual).FiltraParametros(String.Format(" CveTipoActivoFijo = {0}", DdlTipoActivoFijo.SelectedValue), "SubTipoActivoFijo").FiltroPrimeroValor("CveSubTipoActivoFijo", $"SubTipoActivoFijo = 'APICOLAS'").ToEntero + DdlSubTipoActivoFijo.SelectedValueExist(CveSubTipoActivoFijoTemp) + DdlSubTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing) + + TabPlagaEnfermedad.Visible = True + + End If + + 'Pozos + If Op = "PO" Then + + + Dim CveTipoActivoFijoTmp As Integer = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo").FiltroPrimeroValor("CveTipoActivoFijo", $"TipoActivoFijo = 'POZOS'").ToEntero + DdlTipoActivoFijo.SelectedValueExist(CveTipoActivoFijoTmp) + DdlTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing) + + Dim CveSubTipoActivoFijoTemp As Integer = GlobalDTSubTipoActivoFijo(CveEmpresaActual).FiltraParametros(String.Format(" CveTipoActivoFijo = {0}", DdlTipoActivoFijo.SelectedValue), "SubTipoActivoFijo").FiltroPrimeroValor("CveSubTipoActivoFijo", $"SubTipoActivoFijo = 'POZOS'").ToEntero + DdlSubTipoActivoFijo.SelectedValueExist(CveSubTipoActivoFijoTemp) + DdlSubTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing) + + TabServyMant.Visible = True + End If + + 'Inmuebles + If Op = "IN" Then + + Dim CveTipoActivoFijoTmp As Integer = GlobalDTTipoActivoFijo(UsuarioActual.CveEmpresa).FiltraParametros("", "TipoActivoFijo").FiltroPrimeroValor("CveTipoActivoFijo", $"TipoActivoFijo = 'INMUEBLES'").ToEntero + DdlTipoActivoFijo.SelectedValueExist(CveTipoActivoFijoTmp) + DdlTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing) + + Dim CveSubTipoActivoFijoTemp As Integer = GlobalDTSubTipoActivoFijo(CveEmpresaActual).FiltraParametros(String.Format(" CveTipoActivoFijo = {0}", DdlTipoActivoFijo.SelectedValue), "SubTipoActivoFijo").FiltroPrimeroValor("CveSubTipoActivoFijo", $"SubTipoActivoFijo = 'INMUEBLES'").ToEntero + DdlSubTipoActivoFijo.SelectedValueExist(CveSubTipoActivoFijoTemp) + DdlSubTipoActivoFijo_SelectedIndexChanged(Nothing, Nothing) + + End If + + UpDatos.Update() + + End If + + End Sub + + + Private Sub ModalidadesPaginaAF() + + TabProduccion.Visible = False + TabPlagaEnfermedad.Visible = False + TabServyMant.Visible = False + + LblFechaCompra.Text = "Fecha de Compra:" + LblFechaBaja.Text = "Fecha de Baja:" + + + If DdlTipoActivoFijo.SelectedItem.Text = "ARBOLES FRUTALES" And DdlSubTipoActivoFijo.SelectedItem.Text = "ARBOLES FRUTALES" Then LblFechaCompra.Text = "Fecha de Nacimiento" LblFechaBaja.Text = "Fecha de Muerte" TabProduccion.Visible = True End If 'Arbol Apicola - If DdlTipoActivoFijo.SelectedValue.ToEntero = 151 And DdlSubTipoActivoFijo.SelectedValue.ToEntero = 1937 And CveActivoFijo > 0 Then + If DdlTipoActivoFijo.SelectedItem.Text = "APICOLAS" And DdlSubTipoActivoFijo.SelectedItem.Text = "APICOLAS" Then TabPlagaEnfermedad.Visible = True End If 'Pozos - If DdlTipoActivoFijo.SelectedValue.ToEntero = 152 And DdlSubTipoActivoFijo.SelectedValue.ToEntero = 1938 And CveActivoFijo > 0 Then + If DdlTipoActivoFijo.SelectedItem.Text = "POZOS" And DdlSubTipoActivoFijo.SelectedItem.Text = "POZOS" Then TabServyMant.Visible = True End If 'Inmuebles - If DdlTipoActivoFijo.SelectedValue.ToEntero = 153 And DdlSubTipoActivoFijo.SelectedValue.ToEntero = 1939 And CveActivoFijo > 0 Then + If DdlTipoActivoFijo.SelectedItem.Text = "INMUEBLES" And DdlSubTipoActivoFijo.SelectedItem.Text = "INMUEBLES" Then End If + + + + UpDatos.Update() End Sub @@ -580,12 +749,84 @@ Partial Class AF_AF DdlModalCultivosCuadro.DataBind() DdlModalCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) End Sub + + + Private Function CreaDTProduccion() As DataTable + 'CveProduccion, CveActivoFijo, CveCultivoCuadroDetalle, Cantidad, Fecha, CveUsuario, FechaIng, Codigo, Descripcion, Usuario, Cuadro + + Dim DTProduccion As New DataTable + + + DTProduccion.Columns.Add("CveProduccion", GetType(Integer)) + DTProduccion.Columns.Add("CveActivoFijo", GetType(Integer)) + DTProduccion.Columns.Add("CveCultivoCuadroDetalle", GetType(Integer)) + DTProduccion.Columns.Add("Cantidad", GetType(Decimal)) + DTProduccion.Columns.Add("Fecha", GetType(Date)) + DTProduccion.Columns.Add("Cuadro", GetType(String)) + + DTProduccion.Columns.Add("CveUsuario", GetType(Integer)) + DTProduccion.Columns.Add("FechaIng", GetType(Date)) + DTProduccion.Columns.Add("Codigo", GetType(String)) + DTProduccion.Columns.Add("Descripcion", GetType(String)) + DTProduccion.Columns.Add("Usuario", GetType(String)) + + + Return DTProduccion + + End Function + + Private Function CreaDTPlagaEngermedad() As DataTable + 'CvePlagaEnfermedad,CveActivoFijo,Observaciones,Fecha,CveUsuario,FechaIng + Dim DTPlgaEfermedad As New DataTable + + DTPlgaEfermedad.Columns.Add("CvePlagaEnfermedad", GetType(Integer)) + DTPlgaEfermedad.Columns.Add("CveActivoFijo", GetType(Integer)) + + DTPlgaEfermedad.Columns.Add("Observaciones", GetType(String)) + DTPlgaEfermedad.Columns.Add("Fecha", GetType(Date)) + + DTPlgaEfermedad.Columns.Add("CveUsuario", GetType(Integer)) + DTPlgaEfermedad.Columns.Add("FechaIng", GetType(Date)) + + DTPlgaEfermedad.Columns.Add("Usuario", GetType(String)) + + + + Return DTPlgaEfermedad + + End Function + + Private Function CreaDTMantenimiento() As DataTable + 'CveMantenimiento, CveActivoFijo, Mantenimiento, Observaciones, Fecha, FechaIng, CveUsuario, Codigo, Descripcion,Usuario,Archivo + Dim DTMantenimiento As New DataTable + + DTMantenimiento.Columns.Add("CveMantenimiento", GetType(Integer)) + DTMantenimiento.Columns.Add("CveActivoFijo", GetType(Integer)) + + DTMantenimiento.Columns.Add("Mantenimiento", GetType(String)) + DTMantenimiento.Columns.Add("Observaciones", GetType(String)) + DTMantenimiento.Columns.Add("Fecha", GetType(Date)) + DTMantenimiento.Columns.Add("FechaIng", GetType(Date)) + + DTMantenimiento.Columns.Add("CveUsuario", GetType(Integer)) + DTMantenimiento.Columns.Add("Codigo", GetType(String)) + DTMantenimiento.Columns.Add("Descripcion", GetType(String)) + DTMantenimiento.Columns.Add("Usuario", GetType(String)) + DTMantenimiento.Columns.Add("Archivo", GetType(String)) + + + Return DTMantenimiento + + End Function + + Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged CargaSubProyecto() End Sub Private Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlSubProyecto.SelectedIndexChanged CargaFolios() + CargaCultivos() End Sub Protected Sub DdlTipoActivoFijo_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlTipoActivoFijo.SelectedIndexChanged @@ -2247,6 +2488,83 @@ Partial Class AF_AF Else ErrorGuardar = True End If + + If Not ErrorGuardar Then + + For Each GvRowProduccion As GridViewRow In GvProduccion.Rows + If Not ObjAF.AddProduccion(ObjAF.CveActivoFijo, GvRowProduccion.DataKey("CveCultivoCuadroDetalle").ToEntero, GvRowProduccion.DataKey("Cantidad").ToDecimal, GvRowProduccion.DataKey("Fecha").ToDate, UsuarioActual.CveUsuario) Then + ErrorGuardar = True + Exit For + End If + Next + + + If Not ErrorGuardar Then + For Each GvRowPlagaEnfermedad As GridViewRow In GvPlagaEnfermedad.Rows + If Not ObjAF.AddPlagaEnfermedad(ObjAF.CveActivoFijo, GvRowPlagaEnfermedad.DataKey("Observaciones"), GvRowPlagaEnfermedad.DataKey("Fecha").ToDate, UsuarioActual.CveUsuario) Then + ErrorGuardar = True + Exit For + End If + Next + End If + + + + If Not ErrorGuardar Then + + + For Each GvRowMantenimiento As GridViewRow In GvMantenimientos.Rows + + Dim CveMantenimientoTemp As Integer = ObjAF.AddMantenimientos(ObjAF.CveActivoFijo, GvRowMantenimiento.DataKey("Mantenimiento"), GvRowMantenimiento.DataKey("Observaciones"), GvRowMantenimiento.DataKey("Fecha").ToDate, UsuarioActual.CveUsuario, "") + + If CveMantenimientoTemp > 0 Then + + If GvRowMantenimiento.DataKey("Archivo").Trim.Length > 0 Then + + Dim fi As New FileInfo(GvRowMantenimiento.DataKey("Archivo").Trim) + + If fi.Exists Then + + Dim Filename As String = fi.Name + Dim FileExtension As String = IO.Path.GetExtension(fi.FullName) + + Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Mantenimientos\{1}", UsuarioActual.Empresa.Ruta, $"{CveMantenimientoTemp}.{FileExtension}")) + If Archivo.Exists() Then + Archivo.Delete() + End If + + If Not Filename.FilesMove(String.Format("{0}", CveMantenimientoTemp.ToString), String.Format("{0}AF\Mantenimientos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then + ErrorGuardar = True + Alert("Error al mover Archivo", TipoMensaje.MsgError) + End If + + If Not ErrorGuardar Then + If Not ObjAF.UpdateMantenimientos(CveMantenimientoTemp, ObjAF.CveActivoFijo, GvRowMantenimiento.DataKey("Mantenimiento"), GvRowMantenimiento.DataKey("Observaciones"), GvRowMantenimiento.DataKey("Fecha").ToDate, UsuarioActual.CveUsuario, $"{CveMantenimientoTemp}{FileExtension}") Then + ErrorGuardar = True + End If + End If + + End If + + End If + + + Else + ErrorGuardar = True + Exit For + End If + + Next + + + + End If + + + + + End If + End If 'PREPOLIZA DE IMPORTACION DESDE ALMACEN @@ -2780,6 +3098,7 @@ Partial Class AF_AF CargaCaracteristicas() CargaDispositivos() ModalidadesPaginaAF() + End Sub #Region "CARGAR CUENTA CONTABLE" @@ -3853,15 +4172,26 @@ Partial Class AF_AF Private Sub CargaProduccion() - Dim ObjAF As New ClsAF - If ObjAF.GetProduccion(CveActivoFijo, UsuarioActual.CveEmpresa) Then - GvProduccion.DataSource = ObjAF.DtResultados + + If CveActivoFijo > 0 Then + + Dim ObjAF As New ClsAF + + If ObjAF.GetProduccion(CveActivoFijo, UsuarioActual.CveEmpresa) Then + GvProduccion.DataSource = ObjAF.DtResultados + Else + GvProduccion.DataSource = Nothing + End If + + ObjAF.Dispose() + + Else - GvProduccion.DataSource = Nothing + GvProduccion.DataSource = DT_Produccion End If - ObjAF.Dispose() + GvProduccion.DataBind() UpProduccion.Update() @@ -3871,9 +4201,13 @@ Partial Class AF_AF Protected Sub LnkAgregarProduccion_Click(sender As Object, e As EventArgs) + + CveProduccion = -1 + IndexProduccion = -1 + LblModaProduccionTitulo.Text = "Agregar Producción" LnkModalAgregarProduccion.Text = "Agregar" - CveProduccion = -1 + DdlModalCultivosCuadro.SelectedValueExist(-1) TxtModalProduccionCantidad.Text = "" @@ -3888,7 +4222,15 @@ Partial Class AF_AF Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - CveProduccion = GvRow.DataKey("CveProduccion").ToEntero + + + If CveActivoFijo > 0 Then + CveProduccion = GvRow.DataKey("CveProduccion").ToEntero + Else + IndexProduccion = GvRow.RowIndex + End If + + Dim CveCultivoCuadroDetalle As Integer = GvRow.DataKey("CveCultivoCuadroDetalle").ToEntero Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate @@ -3910,21 +4252,29 @@ Partial Class AF_AF Protected Sub LnkGvProduccionRemove_Click(sender As Object, e As EventArgs) Dim ErrorProceso As Boolean = False + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim CveProduccionEliminar As Integer = GvRow.DataKey("CveProduccion").ToEntero + If CveActivoFijo > 0 Then - Dim ObjAF As New ClsAF + Dim CveProduccionEliminar As Integer = GvRow.DataKey("CveProduccion").ToEntero + Dim ObjAF As New ClsAF + If ObjAF.RemoveProduccion(CveProduccionEliminar, UsuarioActual.CveEmpresa) Then + ErrorProceso = False + Else + ErrorProceso = True + End If + ObjAF.Dispose() - If ObjAF.RemoveProduccion(CveProduccionEliminar, UsuarioActual.CveEmpresa) Then - ErrorProceso = False Else - ErrorProceso = True + Dim IndexProduccionEliminar As Integer = GvRow.RowIndex + + DT_Produccion.Rows(IndexProduccionEliminar).Delete() + DT_Produccion.AcceptChanges() + ErrorProceso = False + End If - ObjAF.Dispose() - - If Not ErrorProceso Then Alert("Producción Eliminada Correctamente.") CargaProduccion() @@ -3936,28 +4286,60 @@ Partial Class AF_AF Protected Sub LnkModalAgregarProduccion_Click(sender As Object, e As EventArgs) Dim ErrorProceso As Boolean = False - Dim ObjAF As New ClsAF - If CveProduccion > 0 Then - If ObjAF.UpdateProduccion(CveProduccion, CveActivoFijo, DdlModalCultivosCuadro.SelectedValue.ToEntero, TxtModalProduccionCantidad.Text.ToDecimal, TxtModalProduccionFecha.Text.ToDate, UsuarioActual.CveUsuario) Then - ErrorProceso = False + + + + + If CveActivoFijo > 0 Then + + Dim ObjAF As New ClsAF + + If CveProduccion > 0 Then + If ObjAF.UpdateProduccion(CveProduccion, CveActivoFijo, DdlModalCultivosCuadro.SelectedValue.ToEntero, TxtModalProduccionCantidad.Text.ToDecimal, TxtModalProduccionFecha.Text.ToDate, UsuarioActual.CveUsuario) Then + ErrorProceso = False + Else + ErrorProceso = True + End If Else - ErrorProceso = True + If ObjAF.AddProduccion(CveActivoFijo, DdlModalCultivosCuadro.SelectedValue.ToEntero, TxtModalProduccionCantidad.Text.ToDecimal, TxtModalProduccionFecha.Text.ToDate, UsuarioActual.CveUsuario) Then + ErrorProceso = False + Else + ErrorProceso = True + End If End If + + ObjAF.Dispose() + Else - If ObjAF.AddProduccion(CveActivoFijo, DdlModalCultivosCuadro.SelectedValue.ToEntero, TxtModalProduccionCantidad.Text.ToDecimal, TxtModalProduccionFecha.Text.ToDate, UsuarioActual.CveUsuario) Then - ErrorProceso = False + + + If IndexProduccion >= 0 Then + DT_Produccion.Rows(IndexProduccion)("Cuadro") = DdlModalCultivosCuadro.SelectedItem.Text + DT_Produccion.Rows(IndexProduccion)("CveCultivoCuadroDetalle") = DdlModalCultivosCuadro.SelectedValue.ToEntero + DT_Produccion.Rows(IndexProduccion)("Fecha") = TxtModalProduccionFecha.Text.ToDate + DT_Produccion.Rows(IndexProduccion)("Cantidad") = TxtModalProduccionCantidad.Text.ToDecimal Else - ErrorProceso = True + + Dim nRow As DataRow = DT_Produccion.NewRow + + nRow("Cuadro") = DdlModalCultivosCuadro.SelectedItem.Text + nRow("CveCultivoCuadroDetalle") = DdlModalCultivosCuadro.SelectedValue.ToEntero + nRow("Fecha") = TxtModalProduccionFecha.Text.ToDate + nRow("Cantidad") = TxtModalProduccionCantidad.Text.ToDecimal + + DT_Produccion.Rows.Add(nRow) + ErrorProceso = False + End If + + DT_Produccion.AcceptChanges() + End If - - ObjAF.Dispose() - If Not ErrorProceso Then - RegistraScript("$('#DVModalMantenimiento').modal('hide');") + RegistraScript("$('#DVModalProduccion').modal('hide');") Alert("Producción Agregada Correctamente.") CargaProduccion() End If @@ -3973,15 +4355,21 @@ Partial Class AF_AF Private Sub CargaMantenimento() - Dim ObjAF As New ClsAF + If CveActivoFijo > 0 Then + + Dim ObjAF As New ClsAF + If ObjAF.GetMantenimientos(CveActivoFijo, UsuarioActual.CveEmpresa) Then + GvMantenimientos.DataSource = ObjAF.DtResultados + Else + GvMantenimientos.DataSource = Nothing + End If + ObjAF.Dispose() - If ObjAF.GetMantenimientos(CveActivoFijo, UsuarioActual.CveEmpresa) Then - GvMantenimientos.DataSource = ObjAF.DtResultados Else - GvMantenimientos.DataSource = Nothing + GvMantenimientos.DataSource = DT_Mantenimiento End If - ObjAF.Dispose() + GvMantenimientos.DataBind() UpMantenimientos.Update() @@ -3991,10 +4379,14 @@ Partial Class AF_AF Protected Sub LnkAgregarMantenimiento_Click(sender As Object, e As EventArgs) + + CveMantenimiento = -1 + IndexMantenimiento = -1 + LblModaMantenimientoTitulo.Text = "Agregar Mantenimiento" LnkModalAgregarMantenimiento.Text = "Agregar" - CveMantenimiento = -1 + TxtModalMantenimiento.Text = "" TxtModalMantenimientoObservaciones.Text = "" @@ -4011,7 +4403,13 @@ Partial Class AF_AF Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) 'CveMantenimiento, CveActivoFijo, Mantenimiento, Observaciones, Fecha, FechaIng, CveUsuario, Codigo, Descripcion, Usuario - CveMantenimiento = GvRow.DataKey("CveMantenimiento").ToEntero + + If CveActivoFijo > 0 Then + CveMantenimiento = GvRow.DataKey("CveMantenimiento").ToEntero + Else + IndexMantenimiento = GvRow.RowIndex + End If + Dim Mantenimiento As String = GvRow.DataKey("Mantenimiento") Dim Observaciones As String = GvRow.DataKey("Observaciones") @@ -4036,18 +4434,26 @@ Partial Class AF_AF Dim ErrorProceso As Boolean = False Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim CveMantenimientoEliminar As Integer = GvRow.DataKey("CveMantenimiento").ToEntero + Dim IndexMantenimientoEliminar As Integer = GvRow.RowIndex - Dim ObjAF As New ClsAF + If CveActivoFijo > 0 Then + Dim CveMantenimientoEliminar As Integer = GvRow.DataKey("CveMantenimiento").ToEntero + Dim ObjAF As New ClsAF + If ObjAF.RemoveMantenimientos(CveMantenimientoEliminar, UsuarioActual.CveEmpresa) Then + ErrorProceso = False + Else + ErrorProceso = True + End If + ObjAF.Dispose() - If ObjAF.RemoveMantenimientos(CveMantenimientoEliminar, UsuarioActual.CveEmpresa) Then - ErrorProceso = False Else - ErrorProceso = True + + DT_Mantenimiento.Rows(IndexMantenimientoEliminar).Delete() + DT_Mantenimiento.AcceptChanges() + End If - ObjAF.Dispose() If Not ErrorProceso Then @@ -4065,58 +4471,13 @@ Partial Class AF_AF ObjAF.IniciaTransacSQL() - If CveMantenimiento > 0 Then + If CveActivoFijo > 0 Then - Dim FileExtension As String = "" - Dim Filesgral As List(Of Archivo) = TxtArchivoMantenimiento.getfiles().Archivos - Dim Filename As String = "-1" - - If Filesgral.Count > 0 Then - - For Each fileItem As Archivo In Filesgral - FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") - Filename = fileItem.filename - Exit For - Next - - Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Mantenimientos\{1}", UsuarioActual.Empresa.Ruta, $"{CveMantenimiento}.{FileExtension}")) - If Archivo.Exists() Then - Archivo.Delete() - End If - - - If Not Filename.FilesMove(String.Format("{0}", CveMantenimiento.ToString), String.Format("{0}AF\Mantenimientos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then - ErrorProceso = True - Alert("Error al mover Archivo", TipoMensaje.MsgError) - End If - - End If - - If Not ErrorProceso Then - If Not ObjAF.UpdateMantenimientos(CveMantenimiento, CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, $"{CveMantenimiento}.{FileExtension}") Then - ErrorProceso = True - End If - End If - - - Else - - - Dim CveMantenimientoTemp As Integer = -1 - - - CveMantenimientoTemp = ObjAF.AddMantenimientos(CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, "-1") - If CveMantenimientoTemp > 0 Then - ErrorProceso = False - Else - ErrorProceso = True - End If - - If Not ErrorProceso Then + If CveMantenimiento > 0 Then Dim FileExtension As String = "" Dim Filesgral As List(Of Archivo) = TxtArchivoMantenimiento.getfiles().Archivos - Dim Filename As String = "" + Dim Filename As String = "-1" If Filesgral.Count > 0 Then @@ -4126,57 +4487,173 @@ Partial Class AF_AF Exit For Next - Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Mantenimientos\{1}", UsuarioActual.Empresa.Ruta, $"{CveMantenimientoTemp}.{FileExtension}")) + Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Mantenimientos\{1}", UsuarioActual.Empresa.Ruta, $"{CveMantenimiento}.{FileExtension}")) If Archivo.Exists() Then Archivo.Delete() End If - If Not Filename.FilesMove(String.Format("{0}", CveMantenimientoTemp.ToString), String.Format("{0}AF\Mantenimientos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then + If Not Filename.FilesMove(String.Format("{0}", CveMantenimiento.ToString), String.Format("{0}AF\Mantenimientos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then ErrorProceso = True Alert("Error al mover Archivo", TipoMensaje.MsgError) End If - If Not ErrorProceso Then - If Not ObjAF.UpdateMantenimientos(CveMantenimientoTemp, CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, $"{CveMantenimientoTemp}.{FileExtension}") Then - ErrorProceso = True - End If - End If - - End If + If Not ErrorProceso Then + If Not ObjAF.UpdateMantenimientos(CveMantenimiento, CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, $"{CveMantenimiento}.{FileExtension}") Then + ErrorProceso = True + End If + End If + Else + Dim CveMantenimientoTemp As Integer = -1 + + CveMantenimientoTemp = ObjAF.AddMantenimientos(CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, "-1") + If CveMantenimientoTemp > 0 Then + ErrorProceso = False + Else + ErrorProceso = True + End If + + If Not ErrorProceso Then + + Dim FileExtension As String = "" + Dim Filesgral As List(Of Archivo) = TxtArchivoMantenimiento.getfiles().Archivos + Dim Filename As String = "" + + If Filesgral.Count > 0 Then + + For Each fileItem As Archivo In Filesgral + FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "") + Filename = fileItem.filename + Exit For + Next + + Dim Archivo As New System.IO.FileInfo(String.Format("{0}AF\Mantenimientos\{1}", UsuarioActual.Empresa.Ruta, $"{CveMantenimientoTemp}.{FileExtension}")) + If Archivo.Exists() Then + Archivo.Delete() + End If + + + If Not Filename.FilesMove(String.Format("{0}", CveMantenimientoTemp.ToString), String.Format("{0}AF\Mantenimientos", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) Then + ErrorProceso = True + Alert("Error al mover Archivo", TipoMensaje.MsgError) + End If + + If Not ErrorProceso Then + If Not ObjAF.UpdateMantenimientos(CveMantenimientoTemp, CveActivoFijo, TxtModalMantenimiento.Text, TxtModalMantenimientoObservaciones.Text, TxtModalMantenimientoFecha.Text.ToDate, UsuarioActual.CveUsuario, $"{CveMantenimientoTemp}.{FileExtension}") Then + ErrorProceso = True + End If + End If + End If + End If End If + + If Not ErrorProceso Then + TxtArchivoMantenimiento.Text = "" + UpModalMantenimiento.Update() + End If + + + If Not ErrorProceso Then + ObjAF.Commit() + ObjAF.Dispose() + + 'RegistraScript("$('#DVModalMantenimiento').modal('hide');") + 'Alert("Mantenimiento Guardado Correctamente.") + 'CargaMantenimento() + Else + ObjAF.RollBack() + ObjAF.Dispose() + End If + + + Else + + Dim Filesgral As List(Of Archivo) = TxtArchivoMantenimiento.getfiles().Archivos + + + If IndexMantenimiento >= 0 Then + + DT_Mantenimiento.Rows(IndexMantenimiento)("Mantenimiento") = TxtModalMantenimiento.Text + DT_Mantenimiento.Rows(IndexMantenimiento)("Observaciones") = TxtModalMantenimientoObservaciones.Text + DT_Mantenimiento.Rows(IndexMantenimiento)("Fecha") = TxtModalMantenimientoFecha.Text.ToDate + + + If Filesgral.Count > 0 Then + + For Each fileItem As Archivo In Filesgral + + Dim fi As New FileInfo(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)) + + If fi.Exists Then + DT_Mantenimiento.Rows(IndexMantenimiento)("Archivo") = fi.FullName + End If + + Exit For + Next + End If + + DT_Mantenimiento.AcceptChanges() + + Else + + Dim nRow As DataRow = DT_Mantenimiento.NewRow + + nRow("Mantenimiento") = TxtModalMantenimiento.Text + nRow("Observaciones") = TxtModalMantenimientoObservaciones.Text + nRow("Fecha") = TxtModalMantenimientoFecha.Text.ToDate + + If Filesgral.Count > 0 Then + + For Each fileItem As Archivo In Filesgral + + Dim fi As New FileInfo(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)) + + If fi.Exists Then + nRow("Archivo") = fi.FullName + End If + + Exit For + Next + End If + + DT_Mantenimiento.Rows.Add(nRow) + DT_Mantenimiento.AcceptChanges() + + End If + + TxtArchivoMantenimiento.Text = "" + End If - - - - - If Not ErrorProceso Then - ObjAF.Commit() - ObjAF.Dispose() - RegistraScript("$('#DVModalMantenimiento').modal('hide');") Alert("Mantenimiento Guardado Correctamente.") CargaMantenimento() - Else - ObjAF.RollBack() - ObjAF.Dispose() End If + + End Sub Protected Sub LnkDescargaArcgivo_Click(sender As Object, e As EventArgs) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim Archivo As String = GvRow.DataKey("Archivo") - Dim InfArchivo As New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}") + + Dim InfArchivo As FileInfo + + If CveActivoFijo > 0 Then + InfArchivo = New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}") + Else + InfArchivo = New FileInfo(Archivo) + End If If InfArchivo.Exists Then + Response.Clear() Response.AppendHeader("Content-Disposition", "attachment; filename=" + InfArchivo.Name) Response.AppendHeader("Content-Length", InfArchivo.Length.ToString()) @@ -4184,6 +4661,7 @@ Partial Class AF_AF Response.WriteFile(InfArchivo.FullName) Response.End() + End If @@ -4195,13 +4673,27 @@ Partial Class AF_AF If e.Row.RowType = DataControlRowType.DataRow Then Dim Archivo As String = e.Row.DataKey("Archivo") - Dim InfArchivo As New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}") - If InfArchivo.Exists Then - e.Row.FCLinkButton("LnkDescargaArcgivo").Visible = True - ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LnkDescargaArcgivo")) + If Archivo.Length > 0 Then + + + Dim InfArchivo As FileInfo + + If CveActivoFijo > 0 Then + InfArchivo = New FileInfo($"{UsuarioActual.Empresa.Ruta}\AF\Mantenimientos\{Archivo}") + Else + InfArchivo = New FileInfo(Archivo) + End If + + If InfArchivo.Exists Then + e.Row.FCLinkButton("LnkDescargaArcgivo").Visible = True + ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LnkDescargaArcgivo")) + End If + + End If + End If End Sub @@ -4215,15 +4707,22 @@ Partial Class AF_AF Private Sub CargaPlagaEnfermedad() - Dim ObjAF As New ClsAF - If ObjAF.GetPlagaEnfermedad(CveActivoFijo, UsuarioActual.CveEmpresa) Then - GvPlagaEnfermedad.DataSource = ObjAF.DtResultados + + If CveActivoFijo > 0 Then + Dim ObjAF As New ClsAF + If ObjAF.GetPlagaEnfermedad(CveActivoFijo, UsuarioActual.CveEmpresa) Then + GvPlagaEnfermedad.DataSource = ObjAF.DtResultados + Else + GvPlagaEnfermedad.DataSource = Nothing + End If + + ObjAF.Dispose() Else - GvPlagaEnfermedad.DataSource = Nothing + GvPlagaEnfermedad.DataSource = DT_PlgaEfermedad End If - ObjAF.Dispose() + GvPlagaEnfermedad.DataBind() UpPlagaEnfermedad.Update() @@ -4233,10 +4732,18 @@ Partial Class AF_AF Protected Sub LnkAgregarPlagaEnfermedad_Click(sender As Object, e As EventArgs) + + If CveActivoFijo > 0 Then + CvePlagaEnfermedad = -1 + Else + IndexProduccion = -1 + End If + + LblModalTituloPlagaEnfermedad.Text = "Agregar Plaga Enfermedad" LnkModalAgregarProduccion.Text = "Agregar" - CvePlagaEnfermedad = -1 + TxtModalPlagaEnfermedadObservaciones.Text = "" TxtModalPlagaEnfermedadFecha.Text = "" @@ -4250,7 +4757,11 @@ Partial Class AF_AF Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - CvePlagaEnfermedad = GvRow.DataKey("CvePlagaEnfermedad").ToEntero + If CveActivoFijo > 0 Then + CvePlagaEnfermedad = GvRow.DataKey("CvePlagaEnfermedad").ToEntero + Else + IndexPlagaEnfermedad = GvRow.RowIndex + End If Dim Observaciones As String = GvRow.DataKey("Observaciones") Dim Fecha As Date = GvRow.DataKey("Fecha").ToDate @@ -4271,22 +4782,31 @@ Partial Class AF_AF Protected Sub LnkGvPlagaEnfermedadRemove_Click(sender As Object, e As EventArgs) - Dim ErrorProceso As Boolean = False Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) - Dim CvePlagaEnfermedadEliminar As Integer = GvRow.DataKey("CvePlagaEnfermedad").ToEntero - Dim ObjAF As New ClsAF + Dim ErrorProceso As Boolean = False - If ObjAF.RemovePlagaEnfermedad(CvePlagaEnfermedadEliminar, UsuarioActual.CveEmpresa) Then - ErrorProceso = False + If CveActivoFijo > 0 Then + Dim CvePlagaEnfermedadEliminar As Integer = GvRow.DataKey("CvePlagaEnfermedad").ToEntero + Dim ObjAF As New ClsAF + + If ObjAF.RemovePlagaEnfermedad(CvePlagaEnfermedadEliminar, UsuarioActual.CveEmpresa) Then + ErrorProceso = False + Else + ErrorProceso = True + End If + + ObjAF.Dispose() Else - ErrorProceso = True + + Dim IndexPlagaEnfermedadEliminar As Integer = GvRow.RowIndex + DT_PlgaEfermedad.Rows(IndexPlagaEnfermedadEliminar).Delete() + DT_PlgaEfermedad.AcceptChanges() + ErrorProceso = False + End If - ObjAF.Dispose() - - If Not ErrorProceso Then Alert("Plaga Enfermedad Eliminada Correctamente.") CargaPlagaEnfermedad() @@ -4298,25 +4818,54 @@ Partial Class AF_AF Protected Sub LnkModalAgregarPlagaEnfermedad_Click(sender As Object, e As EventArgs) Dim ErrorProceso As Boolean = False - Dim ObjAF As New ClsAF - If CvePlagaEnfermedad > 0 Then - If ObjAF.UpdatePlagaEnfermedad(CvePlagaEnfermedad, CveActivoFijo, TxtModalPlagaEnfermedadObservaciones.Text, TxtModalPlagaEnfermedadFecha.Text.ToDate, UsuarioActual.CveUsuario) Then - ErrorProceso = False + + If CveActivoFijo > 0 Then + + Dim ObjAF As New ClsAF + If CvePlagaEnfermedad > 0 Then + If ObjAF.UpdatePlagaEnfermedad(CvePlagaEnfermedad, CveActivoFijo, TxtModalPlagaEnfermedadObservaciones.Text, TxtModalPlagaEnfermedadFecha.Text.ToDate, UsuarioActual.CveUsuario) Then + ErrorProceso = False + Else + ErrorProceso = True + End If Else - ErrorProceso = True + If ObjAF.AddPlagaEnfermedad(CveActivoFijo, TxtModalPlagaEnfermedadObservaciones.Text, TxtModalPlagaEnfermedadFecha.Text.ToDate, UsuarioActual.CveUsuario) Then + ErrorProceso = False + Else + ErrorProceso = True + End If End If + ObjAF.Dispose() + Else - If ObjAF.AddPlagaEnfermedad(CveActivoFijo, TxtModalPlagaEnfermedadObservaciones.Text, TxtModalPlagaEnfermedadFecha.Text.ToDate, UsuarioActual.CveUsuario) Then - ErrorProceso = False + + If IndexPlagaEnfermedad >= 0 Then + + DT_PlgaEfermedad.Rows(IndexPlagaEnfermedad)("Observaciones") = TxtModalPlagaEnfermedadObservaciones.Text + DT_PlgaEfermedad.Rows(IndexPlagaEnfermedad)("Fecha") = TxtModalPlagaEnfermedadFecha.Text.ToDate + DT_PlgaEfermedad.Rows(IndexPlagaEnfermedad)("Usuario") = UsuarioActual.Usuario + Else - ErrorProceso = True + + Dim nRow As DataRow = DT_PlgaEfermedad.NewRow + + nRow("Observaciones") = TxtModalPlagaEnfermedadObservaciones.Text + nRow("Fecha") = TxtModalPlagaEnfermedadFecha.Text.ToDate + nRow("Usuario") = UsuarioActual.Usuario + + DT_PlgaEfermedad.Rows.Add(nRow) + + DT_PlgaEfermedad.AcceptChanges() + + + End If + ErrorProceso = False End If - ObjAF.Dispose() If Not ErrorProceso Then RegistraScript("$('#DVModalPlagaEnfermedad').modal('hide');") diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx b/Acumuladores/RepEntradasUsadosClientes.aspx index fa2e5a85b..5bb9a18ac 100644 --- a/Acumuladores/RepEntradasUsadosClientes.aspx +++ b/Acumuladores/RepEntradasUsadosClientes.aspx @@ -92,9 +92,9 @@ - + - + diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx.vb b/Acumuladores/RepEntradasUsadosClientes.aspx.vb index cae0e6c31..ed0a413f1 100644 --- a/Acumuladores/RepEntradasUsadosClientes.aspx.vb +++ b/Acumuladores/RepEntradasUsadosClientes.aspx.vb @@ -67,9 +67,13 @@ Partial Class Acumuladores_RepEntradasUsadosClientes If e.Row.DBCampo("EsHeader").ToString = "-1" Or e.Row.DBCampo("Codigo").ToString = "" And e.Row.DataKey("CveVenta").ToString.ToEntero = 0 Then e.Row.CssClass = "SubTotales2" - End If - - + End If + + If e.Row.DataKey("CvePS").ToString.ToEntero > 0 And e.Row.DataKey("CveVenta").ToString.ToEntero = 0 Then + e.Row.CssClass = "SubTotales" + End If + + If e.Row.DataKey("CveVenta").ToString.ToEntero > 0 Then e.Row.Cells(1).Text = $"{e.Row.DataKey("SerieFolio")}" Else @@ -80,7 +84,7 @@ Partial Class Acumuladores_RepEntradasUsadosClientes End If If e.Row.DataKey("EsDistribuidor") <> "" Then - e.Row.Cells(5).Text = $"{e.Row.DataKey("Total").ToDecimal.ToString("###,###,###.00")}" + e.Row.Cells(5).Text = $"{e.Row.DataKey("Total").ToDecimal.ToString("#########")}" End If diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb index 3a0ec3593..0916d36a0 100644 --- a/App_Code/ClsClientes.vb +++ b/App_Code/ClsClientes.vb @@ -1665,7 +1665,7 @@ Public Class ClsClientes End Function Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, CveEstado As Integer, RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer, - NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1) As Boolean + NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_ClientesNoFrecuenteAdd") @@ -1690,6 +1690,8 @@ Public Class ClsClientes .Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33 .Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista + .Add("@CvePrecioLista", SqlDbType.VarChar).Value = RegimenSociedad + .Add("@TipoPersona", SqlDbType.Bit).Value = TipoPersona End With diff --git a/Empresas/140/Formatos/RepEntradasUsadosClientes.rdlc b/Empresas/140/Formatos/RepEntradasUsadosClientes.rdlc index 71646abd5..fd2989e2f 100644 --- a/Empresas/140/Formatos/RepEntradasUsadosClientes.rdlc +++ b/Empresas/140/Formatos/RepEntradasUsadosClientes.rdlc @@ -33,6 +33,10 @@ CveVenta System.Int + + CvePS + System.Int + Folio System.String @@ -125,10 +129,10 @@ Codigo - =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent") + =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value > 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent") 2pt 2pt 2pt @@ -161,10 +165,10 @@ Codigo_Clientes - =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent") + =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value > 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent") 2pt 2pt 2pt @@ -197,10 +201,10 @@ Folio - =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent") + =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value > 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent") 2pt 2pt 2pt @@ -234,10 +238,10 @@ Fecha - =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent") + =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value > 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent") 2pt 2pt 2pt @@ -270,10 +274,10 @@ SubProyecto - =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent") + =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value > 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent") 2pt 2pt 2pt @@ -307,10 +311,10 @@ Cantidad - =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent") + =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value > 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent") 2pt 2pt 2pt @@ -344,10 +348,10 @@ TotalImporte - =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "","LightGrey","Transparent") + =IIF(Fields!EsHeader.Value = "-1" or Fields!Codigo.Value = "" or (Fields!CvePS.Value > 0 and IsNothing(Fields!CveVenta.Value) ),"LightGrey","Transparent") 2pt 2pt 2pt diff --git a/OC/OC.aspx b/OC/OC.aspx index 33fccac15..3f8652f2d 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -763,6 +763,7 @@ POA P.U. Desc. + IVA Total Comandos @@ -863,6 +864,9 @@ + + + <%-- IVA--%> @@ -1015,6 +1019,16 @@ + + + + + + + + + + @@ -1022,6 +1036,8 @@ + + <%-- --%>
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb index d8f9e9000..0f23a71bf 100644 --- a/Ventas/Clientes.aspx.vb +++ b/Ventas/Clientes.aspx.vb @@ -10222,5 +10222,6 @@ Partial Class Clientes UpDatos.Update() End Sub + End Class diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx index 32d49be68..05f66910c 100644 --- a/Ventas/PV.aspx +++ b/Ventas/PV.aspx @@ -2456,6 +2456,7 @@ <%--Descripción--%> +
@@ -2466,8 +2467,12 @@
+ + + +
@@ -2478,11 +2483,59 @@
-
- - - + + +
+
+ + +
+ + <%-- + Física + Moral + --%> + + + + Física + Moral + + + + + +
+ +
+
+ + + + + + + +
+
+
+ + + +
+
+
+
+ + + +
+
+
+ + +
@@ -2575,8 +2628,13 @@
+ + + +
+ -
+ <%--
-
+
--%>
diff --git a/Acarreos/CatChoferes.aspx.vb b/Acarreos/CatChoferes.aspx.vb index 12be6ccc0..5c2b88185 100644 --- a/Acarreos/CatChoferes.aspx.vb +++ b/Acarreos/CatChoferes.aspx.vb @@ -12,7 +12,7 @@ Partial Class Acarreos_CatChoferes Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then CargaDatos() - CargaDdlTransportista() + ' CargaDdlTransportista() CargaDdls() @@ -44,16 +44,16 @@ Partial Class Acarreos_CatChoferes End Sub - Private Sub CargaDdlTransportista() - Dim ObjAcar As New ClsAcarreos() - If ObjAcar.GetTransportista(-1, UsuarioActual.CveEmpresa, 1) Then - DdlTransportista.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlTransportista.DataSource = ObjAcar.DtResultados - DdlTransportista.DataBind() - End If - ObjAcar.Dispose() - UpAddChofer.Update() - End Sub + 'Private Sub CargaDdlTransportista() + ' Dim ObjAcar As New ClsAcarreos() + ' If ObjAcar.GetTransportista(-1, UsuarioActual.CveEmpresa, 1) Then + ' DdlTransportista.Items.Insert(0, New ListItem("Seleccione", "-1")) + ' DdlTransportista.DataSource = ObjAcar.DtResultados + ' DdlTransportista.DataBind() + ' End If + ' ObjAcar.Dispose() + ' UpAddChofer.Update() + 'End Sub Private Sub BtnAgregarChofer_Click(sender As Object, e As EventArgs) Handles BtnAgregarChofer.Click @@ -65,32 +65,32 @@ Partial Class Acarreos_CatChoferes End If - If DdlTransportista.SelectedValue = "-1" Then - Alert("Tiene que seleccionar un transportista.", TipoMensaje.MsgAdvertencia) - Else + 'If DdlTransportista.SelectedValue = "-1" Then + ' Alert("Tiene que seleccionar un transportista.", TipoMensaje.MsgAdvertencia) + 'Else - Dim ObjAcar As New ClsAcarreos + Dim ObjAcar As New ClsAcarreos Dim Estatus = 0 If ChkEstatus.Checked Then Estatus = 1 If HdnModalidad.Value = "A" Then - If ObjAcar.AddChofer(TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTransportista.SelectedValue, TxtIdentificacion.Text.Trim, TxtTelefono.Text.Trim, Licencia:=TxtLicencia.Text, RFC:=TxtRFC.Text.Trim, Domicilio:=TxtDomicilio.Text.Trim, NumeroExterior:=TxtNumExt.Text.Trim, NumeroInterior:=TxtNumInt.Text.Trim, Colonia:="", Ciudad:="", Estado:="", CP:=TxtCP.Text.Trim, NumRegidTribOperador:=TxtNumRegidTribOperador.Text.Trim, ResidenciaFiscalOperador:=DdlResidenciaFiscalOperador.SelectedValue, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveLocalidad:=DdlLocalidad.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero) Then - CargaDatos() - Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion) - GlobalDTChoferes(UsuarioActual.CveEmpresa) = Nothing - End If - ElseIf HdnModalidad.Value = "U" Then - If ObjAcar.UpdateChofer(HdnID.Value.ToEntero(), TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Estatus, DdlTransportista.SelectedValue, TxtIdentificacion.Text.Trim, TxtTelefono.Text.Trim, Licencia:=TxtLicencia.Text, RFC:=TxtRFC.Text.Trim, Domicilio:=TxtDomicilio.Text.Trim, NumeroExterior:=TxtNumExt.Text.Trim, NumeroInterior:=TxtNumInt.Text.Trim, Colonia:="", Ciudad:="", Estado:="", CP:=TxtCP.Text.Trim, NumRegidTribOperador:=TxtNumRegidTribOperador.Text.Trim, ResidenciaFiscalOperador:=DdlResidenciaFiscalOperador.SelectedValue, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveLocalidad:=DdlLocalidad.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero) Then - CargaDatos() - Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion) - GlobalDTChoferes(UsuarioActual.CveEmpresa) = Nothing - End If + If ObjAcar.AddChofer(TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, TxtIdentificacion.Text.Trim, TxtTelefono.Text.Trim, Licencia:=TxtLicencia.Text, RFC:=TxtRFC.Text.Trim, Domicilio:=TxtDomicilio.Text.Trim, NumeroExterior:=TxtNumExt.Text.Trim, NumeroInterior:=TxtNumInt.Text.Trim, Colonia:="", Ciudad:="", Estado:="", CP:=TxtCP.Text.Trim, NumRegidTribOperador:=TxtNumRegidTribOperador.Text.Trim, ResidenciaFiscalOperador:=DdlResidenciaFiscalOperador.SelectedValue, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveLocalidad:=DdlLocalidad.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero) Then + CargaDatos() + Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion) + GlobalDTChoferes(UsuarioActual.CveEmpresa) = Nothing End If + ElseIf HdnModalidad.Value = "U" Then + If ObjAcar.UpdateChofer(HdnID.Value.ToEntero(), TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Estatus, -1, TxtIdentificacion.Text.Trim, TxtTelefono.Text.Trim, Licencia:=TxtLicencia.Text, RFC:=TxtRFC.Text.Trim, Domicilio:=TxtDomicilio.Text.Trim, NumeroExterior:=TxtNumExt.Text.Trim, NumeroInterior:=TxtNumInt.Text.Trim, Colonia:="", Ciudad:="", Estado:="", CP:=TxtCP.Text.Trim, NumRegidTribOperador:=TxtNumRegidTribOperador.Text.Trim, ResidenciaFiscalOperador:=DdlResidenciaFiscalOperador.SelectedValue, CveEstado:=DdlEstado.SelectedValue.ToEntero, CveMunicipio:=DdlMunicipio.SelectedValue.ToEntero, CveLocalidad:=DdlLocalidad.SelectedValue.ToEntero, CveColonia:=DdlColonia.SelectedValue.ToEntero) Then + CargaDatos() + Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion) + GlobalDTChoferes(UsuarioActual.CveEmpresa) = Nothing + End If + End If RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddChofer")) ObjAcar.Dispose() UpDatos.Update() - End If + End Sub Public Sub Edit_Click(sender As Object, e As EventArgs) @@ -121,7 +121,7 @@ Partial Class Acarreos_CatChoferes DdlResidenciaFiscalOperador.SelectedValueExist("-1") DdlResidenciaFiscalOperador.SelectedValueExist(GvRow.DataKey("ResidenciaFiscalOperador")) - DdlTransportista.SelectedValueExist(GvRow.DataKey("CveTransportista")) + ' DdlTransportista.SelectedValueExist(GvRow.DataKey("CveTransportista")) divEstatus.Visible = True ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus")) @@ -182,7 +182,7 @@ Partial Class Acarreos_CatChoferes TxtLicencia.Text = "" - DdlTransportista.SelectedValueExist(-1) + ' DdlTransportista.SelectedValueExist(-1) TxtRFC.Text = "" TxtNumInt.Text = "" TxtNumExt.Text = "" From 272ccde979e7451ec2091ac53826ebaae31b8293 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Apr 2022 11:34:28 -0700 Subject: [PATCH 08/13] -- que no cargue los datos de inicio --- General/CATIEPSxEntidadFed.aspx.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/General/CATIEPSxEntidadFed.aspx.cs b/General/CATIEPSxEntidadFed.aspx.cs index bf502cc9e..980dea570 100644 --- a/General/CATIEPSxEntidadFed.aspx.cs +++ b/General/CATIEPSxEntidadFed.aspx.cs @@ -61,13 +61,13 @@ public partial class General_CATIEPSxEntidadFed : ClsPaginas RfechaInicio = RfechaInicio.ToDate().ToString("yyyy/MM/dd"); RfechaFin = RfechaFin.ToDate().ToString("yyyy/MM/dd"); - CargaIEPSxEntidadFed(); + //CargaIEPSxEntidadFed(); } } protected void CargaIEPSxEntidadFed() { ClsGenerales ObjIEPS = new ClsGenerales(); - ObjIEPS.IEPSxEntidadFed(RcveEstado, RtasaIEPS, RfechaInicio, RfechaFin, 119, RAgrupador); + ObjIEPS.IEPSxEntidadFed(RcveEstado, RtasaIEPS, RfechaInicio, RfechaFin, UsuarioActual.CveEmpresa, RAgrupador); GVIEPSxEntidadFed.DataSource = ObjIEPS.DtResultados; DtIEPS = ObjIEPS.DtResultados; ObjIEPS.Dispose(); From 9bf97dcfeaee2706ea2d7eea1c05b53cb75138bc Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Apr 2022 11:34:51 -0700 Subject: [PATCH 09/13] -- mejoras en validaciones --- Inventarios/TraspasoAlmacen.aspx.vb | 31 +++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 184917120..cf368ca73 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -3115,13 +3115,34 @@ Partial Class Inventarios_TraspasoAlmacen Dim DrAlmO As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.SelectedValue.ToEntero).FiltroPrimero("") If DrAlmO("CveTipoAlmacen").ToString.ToEntero = 26 Then 'costeados - DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (26) AND Estatus = 'Activo'") + If ChkTransitorio.Checked Then + DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoAlmacen IN (26) AND Estatus = 'Activo' ") + Else + DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen IN (26) ") + End If + DdlAlmacenDestino.DataBind() DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) - ElseIf DrAlmO("CveTipoAlmacen").ToString.ToEntero = 22 Then 'Recepcion de Usados + ElseIf DrAlmO("CveTipoAlmacen").ToString.Contiene("22") Then 'Recepcion de Usados + + If ChkTransitorio.Checked Then + DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoAlmacen IN (21,22) AND Estatus = 'Activo' ") + Else + DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen IN (21,22) ") + End If + + DdlAlmacenDestino.DataBind() + DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) + + ElseIf DrAlmO("CveTipoAlmacen").ToString.Contiene("21") Then 'dev proveedor + + If ChkTransitorio.Checked Then + DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(" CveTipoAlmacen IN (21,22) AND Estatus = 'Activo' ") + Else + DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen IN (21,22) ") + End If - DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen IN (21,22) AND Estatus = 'Activo'") DdlAlmacenDestino.DataBind() DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) Else @@ -3129,10 +3150,12 @@ Partial Class Inventarios_TraspasoAlmacen Dim Str As String If ChkTransitorio.Checked Then Str = "" ' String.Format(" AND CveSubProyecto <> {0} ", DrAlmO("CveSubProyecto")) 'RMF. pueden haber almacen que esten dentro de lamisma sucursal, pero que requeiren transitorio + DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24,25,28) {0} AND Estatus = 'Activo' ", Str)) Else Str = String.Format(" AND CveSubProyecto = {0} ", DrAlmO("CveSubProyecto")) + DdlAlmacenDestino.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24,25,28) {0} ", Str)) End If - DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveTipoAlmacen NOT IN (3,4,9,10,11,24,25,28) AND Estatus = 'Activo' {0} ", Str)) + DdlAlmacenDestino.DataBind() DdlAlmacenDestino.Items.Insert(0, New ListItem("Seleccione", "-1")) From eab24d41721011f01806acd496f8fa4d6b1409cc Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Apr 2022 11:35:12 -0700 Subject: [PATCH 10/13] -- filtro por subproyecto --- App_Code/ClsPuntoVenta.vb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/App_Code/ClsPuntoVenta.vb b/App_Code/ClsPuntoVenta.vb index e524ce6bb..bd388c409 100644 --- a/App_Code/ClsPuntoVenta.vb +++ b/App_Code/ClsPuntoVenta.vb @@ -222,13 +222,14 @@ Public Class ClsPuntoVenta Return Retorno End Function - Public Function GetCortesDetalleVentas(CveCorte As Integer, CveEmpresa As Integer) As Boolean + Public Function GetCortesDetalleVentas(CveCorte As Integer, CveSubProyecto As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_CortesDetalleVentasGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveCorte", SqlDbType.Int).Value = CveCorte + .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With From 256bb83d7b498ff77a70d7d020a60a612750df3e Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Apr 2022 11:35:24 -0700 Subject: [PATCH 11/13] =?UTF-8?q?--=20almacenes=20de=20pr=C3=A9stamos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/AjustesSeccionAlmacen.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index 24a4bf08d..195f22f72 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -13,7 +13,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen End Sub Private Sub CargaCombos() - Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,2, 4,12,14,16,19, 26)") + Dim DtAlmacenes As DataTable = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros("CveTipoAlmacen in (1,2,4,8,12,14,16,19, 26)") DdlAlmacen.DataSource = DtAlmacenes DdlAlmacen.DataBind() From 1ae95132c8e20c1dfcfb30c76ec87ebb592c45b2 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Apr 2022 11:35:53 -0700 Subject: [PATCH 12/13] columans - formas y condicione de pago --- Ventas/RepRecuperacionDetalle.aspx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Ventas/RepRecuperacionDetalle.aspx b/Ventas/RepRecuperacionDetalle.aspx index 1c3a85292..f71483ccd 100644 --- a/Ventas/RepRecuperacionDetalle.aspx +++ b/Ventas/RepRecuperacionDetalle.aspx @@ -289,6 +289,8 @@ + + From 89a9dcb5045c529ee61138dc41ef75b5b996e8c5 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 4 Apr 2022 11:36:31 -0700 Subject: [PATCH 13/13] -- que no cargue la tabla de historico, sino se usa --- Ventas/Ventas.aspx.vb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index a2d323f13..a7cf2fcd7 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -6372,7 +6372,7 @@ Partial Class Ventas If CveCliente > 0 Then CargaAnticipos(CveCliente) : UpAnticipos.Update() - If CveCliente > 0 AndAlso UsuarioActual.CveEmpresa = 140 Then + If CveCliente > 0 AndAlso UsuarioActual.CveEmpresa = 140 AndAlso CveVenta <= 0 Then DivVentasUsados.Visible = True Dim ObjClientes As New ClsClientes @@ -22461,12 +22461,13 @@ Partial Class Ventas #Region " DEVOLUCION ALMACEN " Private Sub InicializaDevolucionAlmacen() - If Not GvInv.Rows.Count > 0 Then - Exit Sub + + If CveVenta.Contiene(2035312, 2035310, 2039679) Then + LBAplicaDevolucion.Visible = True End If - If CveVenta = 1651560 Then - LBAplicaDevolucion.Visible = True + If Not GvInv.Rows.Count > 0 Then + Exit Sub End If If CveVenta > 0 AndAlso (SaldoVenta = TxtTotal.Text.ToDecimal OrElse DdlTipoComprobante.SelectedValue = "Dev" OrElse (DdlTipoComprobante.SelectedValue = "Ped" AndAlso TmpDT IsNot Nothing AndAlso TmpDT.COUNT("CveContratoDetalle", "CveContratoDetalle > 0") > 0)) Then 'And (DdlTipoComprobante.SelectedValue.Contiene({"Rem", "Ped"}) Or (DdlTipoComprobante.SelectedValue.Contiene({"Ing"}) And TxtFecha.Text.ToDate.Month = Now.Month And TxtFecha.Text.ToDate.Year = Now.Year)) Then