From d287f481a84809afcb39c3a95d75d4bd48b693ba Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 18 Sep 2021 12:47:47 -0700 Subject: [PATCH 01/13] =?UTF-8?q?--=20cmabios=20en=20mejora=20de=20Saldosd?= =?UTF-8?q?e=20mercanc=C3=ADa=20en=20tr=C3=A1nsito=20cuando=20es=20NC=20y?= =?UTF-8?q?=20sus=20impuestos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx | 2 +- Compras/Compras.aspx.vb | 46 ++++++++++++++++++++++++++++++++++------- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index ec9888e62..52d7f470c 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -4835,7 +4835,7 @@
- + diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index a389a2184..ef527e830 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6071,12 +6071,36 @@ Partial Class Compras_Compras If chkImportacion.Checked Then ConceptoContable = 287 End If - If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then If ObjConta.DtResultados.Rows.Count > 0 Then IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero End If End If + 'si aplica NC sobre mov de almacen, el impuesto lo toma de la Factura.para la consideracion de mcia en tránsito + + If ChkNCInvNC.Checked And CveMoneda <> 1 AndAlso importeMovimiento > 0 Then + + Dim diferenciaTransito As Decimal = 0 + For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows + If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then + + 'Dim DifTC As Decimal = tipoCambioActual - Gvr.DataKey("TipoCambio").ToDecimal + 'diferenciaTransito = DifTC * (Gvr.DataKey("IVA").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal) + 'diferenciaTransito += DifTC * (Gvr.DataKey("IEPSPS").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal) + importeMN = (Gvr.DataKey("IVA").ToDecimal.RoundSQL * Gvr.DataKey("TipoCambio").ToDecimal * Multiplicador).RoundSQL + 'se registra por cada compra relacionada + + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMN, Referencia, 14, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveCompraAmortizacion:=Gvr.DataKey("CveCompra").ToEntero, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=Gvr.DataKey("TipoCambio").ToDecimal, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then + ErrorPrepoliza = True + End If + End If + Next + importeMovimiento = 0 + importeMN = 0 + End If + + Case 287 'IVA X Acreditar importeMovimiento = importeIVAxAcreditar @@ -6790,6 +6814,7 @@ Partial Class Compras_Compras End If Next + Dim diferenciaTransito As Decimal = 0 For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then Dim importeMNTemp As Decimal = 0 @@ -6797,6 +6822,9 @@ Partial Class Compras_Compras ErrorMovInv = True Exit For End If + Dim DifTC As Decimal = tipoCambioActual - Gvr.DataKey("TipoCambio").ToDecimal + 'diferenciaTransito = DifTC * (Gvr.DataKey("IVA").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal) + 'diferenciaTransito += DifTC * (Gvr.DataKey("IEPSPS").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal) importeMNTemp = (Gvr.DataKey("PU").ToDecimal * Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal * Gvr.DataKey("TipoCambio").ToDecimal).RoundSQL ImporteTransito += importeMNTemp 'se registra por cada compra relacionada @@ -6806,18 +6834,22 @@ Partial Class Compras_Compras End If Next - 'si hay diferencia - Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL + + 'la diferencia se va aplicar sobre los + + 'Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL If diferenciaTransito <> 0 Then Dim tCveCon As Integer = 65 + IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria If diferenciaTransito < 0 Then tCveCon = 64 + IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria End If - diferenciaTransito = diferenciaTransito.Abs - IdCtaContable = 0 - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, If(tCveCon = 64, True, False), diferenciaTransito, Referencia, tCveCon, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=diferenciaTransito, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=1, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza) Then + diferenciaTransito = Math.Abs(diferenciaTransito) + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, If(tCveCon = 64, True, False), diferenciaTransito, Referencia, tCveCon, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=diferenciaTransito, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=1, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then ErrorPrepoliza = True End If End If @@ -6973,7 +7005,7 @@ Partial Class Compras_Compras tidctacon = ViewState("CtaProveedorAnticiposExtranjera").ToString.ToEntero End If - ElseIf DdlTipoComprobante.SelectedValue = "NC" AndAlso UsuarioActual.Empresa.Funcionalidad(405).ToEntero > 0 Then + ElseIf DdlTipoComprobante.SelectedValue = "NC" Then tcvecon = 259 tidctacon = UsuarioActual.Empresa.Funcionalidad(405).ToEntero From 7d49ea4257b990ef1f6fe87627f185b4377c934e Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 22 Sep 2021 11:05:09 -0700 Subject: [PATCH 02/13] -- cambios en dispose --- App_Code/ClsGPS.vb | 15 ++++++++------- App_Code/ClsSisNotificaciones.vb | 18 +++++++++--------- App_Code/ClsVentas.vb | 12 ++++++------ 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/App_Code/ClsGPS.vb b/App_Code/ClsGPS.vb index a16f069eb..790d42e8d 100644 --- a/App_Code/ClsGPS.vb +++ b/App_Code/ClsGPS.vb @@ -5695,18 +5695,19 @@ Public Class ClsGPS If Not disposedValue Then If disposing Then ' TODO: Liberar otro estado (objetos administrados). - If Not Data Is Nothing Then Data.Dispose() + If Not Data Is Nothing Then Data.Dispose() : Data = Nothing If Not Dataset Is Nothing Then Dataset.Clear() Dataset.Dispose() + Dataset = Nothing End If - If Not DtPosiciones Is Nothing Then DtPosiciones.Dispose() - If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() - If Not SqlCommand Is Nothing Then SqlCommand.Dispose() - If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() + If Not DtPosiciones Is Nothing Then DtPosiciones.Dispose() : DtPosiciones = Nothing + If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing + If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing + If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close() - If Not SqlConexion Is Nothing Then SqlConexion.Dispose() - + If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing + End If ' TODO: Liberar su propio estado (objetos no administrados). diff --git a/App_Code/ClsSisNotificaciones.vb b/App_Code/ClsSisNotificaciones.vb index 4aafd6454..37eb2e654 100644 --- a/App_Code/ClsSisNotificaciones.vb +++ b/App_Code/ClsSisNotificaciones.vb @@ -2066,19 +2066,19 @@ Public Class ClsSisNotificaciones If disposing Then ' TODO: Liberar otro estado (objetos administrados). SqlConexion.Close() - SqlConexion.Dispose() + SqlConexion.Dispose() : SqlConexion = Nothing If Not DataSet Is Nothing Then DataSet.Clear() - DataSet.Dispose() + DataSet.Dispose() : DataSet = Nothing End If - If Not Data Is Nothing Then Data.Dispose() - If Not DTNotificacionesGPS Is Nothing Then DTNotificacionesGPS.Dispose() - If Not DTNotificacionesERP Is Nothing Then DTNotificacionesERP.Dispose() - If Not DTNotificacionesArmadas Is Nothing Then DTNotificacionesArmadas.Dispose() - If Not DTReportesProgramados Is Nothing Then DTReportesProgramados.Dispose() + If Not Data Is Nothing Then Data.Dispose() : Data = Nothing + If Not DTNotificacionesGPS Is Nothing Then DTNotificacionesGPS.Dispose() : DTNotificacionesGPS = Nothing + If Not DTNotificacionesERP Is Nothing Then DTNotificacionesERP.Dispose() : DTNotificacionesERP = Nothing + If Not DTNotificacionesArmadas Is Nothing Then DTNotificacionesArmadas.Dispose() : DTNotificacionesArmadas = Nothing + If Not DTReportesProgramados Is Nothing Then DTReportesProgramados.Dispose() : DTNotificacionesGPS = Nothing NotificacionesBitacora = "" - If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() - If Not SqlCommand Is Nothing Then SqlCommand.Dispose() + If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing + If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing End If ' TODO: Liberar su propio estado (objetos no administrados). diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index c8a9c42e7..cee7e3770 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -5257,13 +5257,13 @@ Public Class ClsVentas If Not Me.disposedValue Then If disposing Then ' TODO: dispose managed state (managed objects). - If Not Data Is Nothing Then Data.Dispose() - If Not Dataset Is Nothing Then Dataset.Dispose() - If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() - If Not SqlCommand Is Nothing Then SqlCommand.Dispose() - If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() + If Not Data Is Nothing Then Data.Dispose() : Data = Nothing + If Not Dataset Is Nothing Then Dataset.Dispose() : Dataset = Nothing + If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing + If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing + If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close() - If Not SqlConexion Is Nothing Then SqlConexion.Dispose() + If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing End If ' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below. From 4c5690deaf41af35fa7ded041c41291babc8ff9b Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 22 Sep 2021 15:18:57 -0700 Subject: [PATCH 03/13] =?UTF-8?q?cache=20se=20pas=C3=B3=20a=2030=20minutos?= =?UTF-8?q?=20de=2060=20que=20tenia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsPaginas.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 8611e3a83..49aab559a 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -5470,7 +5470,7 @@ Public Class ClsPaginas Protected Overrides Sub SavePageStateToPersistenceMedium(pviewState As Object) 'If Request.Form("__VIEWSTATE_KEY") IsNot Nothing Then Cache.Remove(Request.Form("__VIEWSTATE_KEY")) 'elimino la cachado anteriormente Dim VSKey As String = String.Format("VIEWSTATE_{0}_{1}_{2}", Session.SessionID, Request.Path, Date.Now.Ticks) - Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(60), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache + Cache.Add(VSKey, pviewState, Nothing, Date.Now.AddMinutes(30), Cache.NoSlidingExpiration, CacheItemPriority.Default, Nothing) 'Store the ViewState on Cache 'Session.Add(VSKey, pviewState) 'Store the ViewState on Cache ClientScript.RegisterHiddenField("__VIEWSTATE_KEY", VSKey) From 6e00abed29094ffe425c2418c4bd080c055871bd Mon Sep 17 00:00:00 2001 From: rrene Date: Wed, 22 Sep 2021 23:49:44 -0700 Subject: [PATCH 04/13] carta porte --- App_Code/CFDITimbre.vb | 6 +++--- App_Code/ClsProductosServicios.vb | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/App_Code/CFDITimbre.vb b/App_Code/CFDITimbre.vb index ddd73483a..a5704429e 100644 --- a/App_Code/CFDITimbre.vb +++ b/App_Code/CFDITimbre.vb @@ -587,7 +587,7 @@ End Class Public Class CFDICartaPorteUbicaciones Public Property TipoEstacion As String = "" - Public Property DistanciaRecorrida As Double = 0 + Public Property DistanciaRecorrida As Decimal = 0 'Public Property Ubicacion As New CFDICartaPorteUbicacion Public Property Origen As New CFDICartaPorteUbicacionOrigen Public Property Destino As New CFDICartaPorteUbicacionDestino @@ -680,8 +680,8 @@ Public Class CFDICartaPorteMercancia Public Property MaterialPeligroso As String = "" Public Property Embalaje As String = "" Public Property DescripEmbalaje As String = "" - Public Property PesoenKg As Double - Public Property ValorMercancia As Double + Public Property PesoenKg As Decimal + Public Property ValorMercancia As Decimal Public Property Moneda As String = "" Public Property FraccionArrancelaria As String = "" Public Property UUIDComercioExt As String = "" diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 1b1a08d6f..e245b1f44 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -92,6 +92,7 @@ Public Class ClsProductosServicios Public Property CveMaterialPeligroso As Integer Public Property CveEmbalaje As Integer Public Property PesoKg As Decimal + Public Property Dimensiones As String 'Nuevo Raul: 10/08/2018 Public Property CveUsuarioModifico As Integer @@ -301,6 +302,7 @@ Public Class ClsProductosServicios CveMaterialPeligroso = Data.Rows(0)("CveMaterialPeligroso").ToString.ToEntero CveEmbalaje = Data.Rows(0)("CveEmbalaje").ToString.ToEntero PesoKg = Data.Rows(0)("PesoKg").ToString.ToDecimal + Dimensiones = Data.Rows(0)("Dimensiones").ToString 'Nuevo Raul: 10/08/2018 CveUsuarioModifico = Data.Rows(0)("CveUsuarioModifico").ToString.ToEntero @@ -416,7 +418,7 @@ Public Class ClsProductosServicios Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False, - Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1) As Integer + Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "") As Integer Dim Retorno As Integer = -1 DataAdapter("PA_ProductosServiciosAdd") @@ -503,6 +505,7 @@ Public Class ClsProductosServicios .Add("@CveMaterialPeligroso", SqlDbType.Int).Value = CveMaterialPeligroso .Add("@CveEmbalaje", SqlDbType.Int).Value = CveEmbalaje .Add("@PesoKg", SqlDbType.SmallMoney).Value = PesoKg + .Add("@Dimensiones", SqlDbType.VarChar).Value = Dimensiones End With @@ -651,7 +654,7 @@ Public Class ClsProductosServicios Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False, - Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1) As Boolean + Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "") As Boolean Dim Retorno As Boolean = False @@ -740,6 +743,7 @@ Public Class ClsProductosServicios .Add("@CveMaterialPeligroso", SqlDbType.Int).Value = CveMaterialPeligroso .Add("@CveEmbalaje", SqlDbType.Int).Value = CveEmbalaje .Add("@PesoKg", SqlDbType.SmallMoney).Value = PesoKg + .Add("@Dimensiones", SqlDbType.VarChar).Value = Dimensiones End With From 1ecb2d874361b6fc2fb6f34c6f9e8865db0da214 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 23 Sep 2021 00:49:35 -0700 Subject: [PATCH 05/13] Parametros nuevos en catalogo de choferes y vehiculos --- Acarreos/CatChoferes.aspx | 304 ++++++++++++++++------------ Acarreos/CatChoferes.aspx.vb | 24 ++- App_Code/ClsAcarreos.vb | 49 +++-- Inventarios/TraspasoAlmacen.aspx | 31 ++- Inventarios/TraspasoAlmacen.aspx.vb | 24 ++- 5 files changed, 269 insertions(+), 163 deletions(-) diff --git a/Acarreos/CatChoferes.aspx b/Acarreos/CatChoferes.aspx index 9680d08b3..3cd1b9183 100644 --- a/Acarreos/CatChoferes.aspx +++ b/Acarreos/CatChoferes.aspx @@ -1,131 +1,173 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatChoferes.aspx.vb" Inherits="Acarreos_CatChoferes" %> - - - - - - - Catálogo de Choferes - - - - - - -
  • - -
  • -
    -
    -
    - - - - - -
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
    - - - - - - - - - > - - - - - - - - - - - - -
    -
    - <%--POPUP AGREGAR--%> - -
    - - - +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatChoferes.aspx.vb" Inherits="Acarreos_CatChoferes" %> + + + + + + + Catálogo de Choferes + + + + + + +
  • + +
  • +
    +
    +
    + + + + + +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    + + + + + + + + + > + + + + + + + + + + + + +
    +
    + <%--POPUP AGREGAR--%> + +
    + + + diff --git a/Acarreos/CatChoferes.aspx.vb b/Acarreos/CatChoferes.aspx.vb index 251fd78bb..2807faa3d 100644 --- a/Acarreos/CatChoferes.aspx.vb +++ b/Acarreos/CatChoferes.aspx.vb @@ -47,12 +47,12 @@ Partial Class Acarreos_CatChoferes 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, TxtDomicilio.Text.Trim, TxtTelefono.Text.Trim, TxtCiudad.Text.Trim, TxtLicencia.Text.Trim) 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:=TxtNumInt.Text.Trim, NumeroInterior:=TxtNumInt.Text.Trim, Colonia:=TxtColonia.Text.Trim, Ciudad:=TxtCiudad.Text.Trim, Estado:=TxtEstado.Text.Trim(), CP:=TxtCP.Text.Trim, NumRegidTribOperador:=TxtNumRegidTribOperador.Text.Trim, ResidenciaFiscalOperador:=TxtResidenciaFiscalOperador.Text.Trim) Then CargaDatos() Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion) End If ElseIf HdnModalidad.Value = "U" Then - If ObjAcar.UpdateChofer(HdnID.Value, TxtChofer.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Estatus, DdlTransportista.SelectedValue, TxtIdentificacion.Text.Trim, TxtDomicilio.Text.Trim, TxtTelefono.Text.Trim, TxtCiudad.Text.Trim, TxtLicencia.Text.Trim) 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, NumeroInterior:=TxtNumInt.Text.Trim, Colonia:=TxtColonia.Text.Trim, Ciudad:=TxtCiudad.Text.Trim, Estado:=TxtEstado.Text.Trim(), CP:=TxtCP.Text.Trim, NumRegidTribOperador:=TxtNumRegidTribOperador.Text.Trim, ResidenciaFiscalOperador:=TxtResidenciaFiscalOperador.Text.Trim) Then CargaDatos() Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion) End If @@ -70,13 +70,25 @@ Partial Class Acarreos_CatChoferes UpDatos.Update() BtnAgregarChofer.Text = "Actualizar" myModalLabel.InnerText = "Actualizar Chofer" + TxtChofer.Text = GvRow.DataKey("Chofer") - TxtIdentificacion.Text = GvRow.DataKey("Identificacion") - TxtDomicilio.Text = GvRow.DataKey("Domicilio") + TxtIdentificacion.Text = GvRow.DataKey("Identificacion") TxtTelefono.Text = GvRow.DataKey("Telefono") + + TxtDomicilio.Text = GvRow.DataKey("Domicilio") + TxtNumInt.Text = GvRow.DataKey("NumeroInterior") + TxtNumExt.Text = GvRow.DataKey("NumeroExterior") + TxtColonia.Text = GvRow.DataKey("Colonia") TxtCiudad.Text = GvRow.DataKey("Ciudad") - TxtLicencia.Text = GvRow.DataKey("Licencia") - DdlTransportista.SelectedValueExist(GvRow.DataKey("CveTransportista")) + TxtEstado.Text = GvRow.DataKey("Estado") + TxtCP.Text = GvRow.DataKey("CP") + TxtLicencia.Text = GvRow.DataKey("Licencia") + + TxtNumRegidTribOperador.Text = GvRow.DataKey("NumRegidTribOperador") + TxtResidenciaFiscalOperador.Text = GvRow.DataKey("ResidenciaFiscalOperador") + + DdlTransportista.SelectedValueExist(GvRow.DataKey("CveTransportista")) + divEstatus.Visible = True ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus")) UpAddChofer.Update() diff --git a/App_Code/ClsAcarreos.vb b/App_Code/ClsAcarreos.vb index 6c42c9419..14875112c 100644 --- a/App_Code/ClsAcarreos.vb +++ b/App_Code/ClsAcarreos.vb @@ -105,12 +105,13 @@ Public Class ClsAcarreos End Sub Public Sub Commit() SqlTransacc.Commit() - End Sub - - + End Sub + + #Region "Choferes" Public Function AddChofer(Chofer As String, CveUsuario As Integer, CveEmpresa As Integer, CveTransportista As Integer, Identificacion As String, Telefono As String, Licencia As String, RFC As String, Domicilio As String, - Optional NumeroExterior As String = "", Optional NumeroInterior As String = "", Optional Colonia As String = "", Optional Ciudad As String = "", Optional Estado As String = "", Optional CP As String = "") As Boolean + Optional NumeroExterior As String = "", Optional NumeroInterior As String = "", Optional Colonia As String = "", Optional Ciudad As String = "", Optional Estado As String = "", Optional CP As String = "", + Optional NumRegidTribOperador As String = "", Optional ResidenciaFiscalOperador As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Acar_ChoferesAdd") With SqlAdapter.SelectCommand.Parameters @@ -129,6 +130,8 @@ Public Class ClsAcarreos .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad .Add("@Estado", SqlDbType.VarChar).Value = Estado .Add("@CP", SqlDbType.VarChar).Value = CP + .Add("@NumRegidTribOperador", SqlDbType.VarChar).Value = NumRegidTribOperador + .Add("@ResidenciaFiscalOperador", SqlDbType.VarChar).Value = ResidenciaFiscalOperador End With Try SqlAdapter.Fill(Data) @@ -141,7 +144,8 @@ Public Class ClsAcarreos End Function Public Function UpdateChofer(CveChofer As Integer, Chofer As String, CveUsuario As Integer, CveEmpresa As Integer, Estatus As Integer, CveTransportista As Integer, Identificacion As String, Telefono As String, Licencia As String, RFC As String, Domicilio As String, - Optional NumeroExterior As String = "", Optional NumeroInterior As String = "", Optional Colonia As String = "", Optional Ciudad As String = "", Optional Estado As String = "", Optional CP As String = "") As Boolean + Optional NumeroExterior As String = "", Optional NumeroInterior As String = "", Optional Colonia As String = "", Optional Ciudad As String = "", Optional Estado As String = "", Optional CP As String = "", + Optional NumRegidTribOperador As String = "", Optional ResidenciaFiscalOperador As String = "") As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Acar_ChoferesUpdate") With SqlAdapter.SelectCommand.Parameters @@ -162,6 +166,8 @@ Public Class ClsAcarreos .Add("@Estado", SqlDbType.VarChar).Value = Estado .Add("@CP", SqlDbType.VarChar).Value = CP .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@NumRegidTribOperador", SqlDbType.VarChar).Value = NumRegidTribOperador + .Add("@ResidenciaFiscalOperador", SqlDbType.VarChar).Value = ResidenciaFiscalOperador End With Try SqlAdapter.Fill(Data) @@ -1340,24 +1346,25 @@ Public Class ClsAcarreos End Try Return Retorno - End Function - - + End Function + + #End Region - + #Region "IDisposable Support" - ' IDisposable - Protected Overridable Sub Dispose(disposing As Boolean) - If Not Me.disposedValue Then - If disposing Then - If Not Data Is Nothing Then Data.Dispose() - If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() - If Not SqlCommand Is Nothing Then SqlCommand.Dispose() - If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close() - If Not SqlConexion Is Nothing Then SqlConexion.Dispose() - End If - End If - Me.disposedValue = True + ' IDisposable + Protected Overridable Sub Dispose(disposing As Boolean) + If Not Me.disposedValue Then + If disposing Then + If Not Data Is Nothing Then Data.Dispose() : Data = Nothing + If Not SqlAdapter Is Nothing Then SqlAdapter.Dispose() : SqlAdapter = Nothing + If Not SqlCommand Is Nothing Then SqlCommand.Dispose() : SqlCommand = Nothing + If Not SqlTransacc Is Nothing Then SqlTransacc.Dispose() : SqlTransacc = Nothing + If SqlConexion.State <> ConnectionState.Closed Then SqlConexion.Close() + If Not SqlConexion Is Nothing Then SqlConexion.Dispose() : SqlConexion = Nothing + End If + End If + Me.disposedValue = True End Sub Public Sub Dispose() Implements IDisposable.Dispose ConexionClose() diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index 320609c34..de0b9518b 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -816,15 +816,42 @@