diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 90d787cc5..0039b43eb 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -2154,18 +2154,30 @@ Public Class ClsPaginas
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
- 'Property GlobalDTBancosCuentas(CveUsuario As Integer) As DataTable
- ' Get
- ' Dim Str As String = String.Format("CveEmpresa = {0} ", UsuarioActual.CveEmpresa)
- ' If CveUsuario > -1 Then Str = String.Format("{0} AND CveUsuario ={1}", Str, CveUsuario)
- ' Dim Dv As New DataView(DirectCast(Application("GlobalDTBancosCuentas"), DataTable), Str, "", DataViewRowState.CurrentRows)
- ' GlobalDTBancosCuentas = Dv.ToTable
- ' Dv.Dispose()
- ' End Get
- ' Set(value As DataTable)
- ' Application("GlobalDTBancosCuentas") = value
- ' End Set
- 'End Property
+ Public Shared Property GlobalDTBancosCuentasGral(CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional CveTipoCuenta As Integer = -1) As DataTable
+ Get
+ Dim AppNombre As String = $"GlobalDTBancosCuentasGral-{CveEmpresa}"
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Using ObjBancos As New ClsBancos
+ If ObjBancos.GetBancosCuentas(-1, CveEmpresa) Then
+ HttpContext.Current.Application(AppNombre) = ObjBancos.DtResultados
+ Else
+ HttpContext.Current.Application(AppNombre) = Nothing
+ End If
+ End Using
+ End If
+ Dim Str As String = String.Format("CveEmpresa = {0} ", CveEmpresa)
+ If CveTipoCuenta > -1 Then Str = String.Format("{0} AND CveTipoCuenta = {1}", Str, CveTipoCuenta)
+ If Estatus > -1 Then Str = String.Format("{0} AND Estatus = '{1}'", Str, If(Estatus = 1, "Activo", "Inactivo"))
+ Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str, "", DataViewRowState.CurrentRows)
+ GlobalDTBancosCuentasGral = Dv.ToTable
+ Dv.Dispose()
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = $"GlobalDTBancosCuentasGral-{CveEmpresa}"
+ HttpContext.Current.Application(AppNombre) = value
+ End Set
+ End Property
Public Shared Property GlobalDTBancosCuentas(CveUsuario As Integer, Optional CveCuenta As Integer = -1, Optional Estatus As Integer = 1, Optional CveEmpresa As Integer = -1, Optional CveTipoCuenta As Integer = -1) As DataTable
Get
Dim AppNombre As String = $"GlobalDTBancosCuentas-{CveEmpresa}"
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index ae62dc0f5..0591bf004 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -1656,36 +1656,6 @@ Partial Class Compras_Compras
DdlTipoComprobante_SelectedIndexChanged(Nothing, Nothing)
DdlTipoCompra.SelectedValueExist(15)
DdlTipoCompra_SelectedIndexChanged(Nothing, Nothing)
-
-
- 'For Each gvRow As GridViewRow In GvFacturaNC.Rows
- ' If gvRow.DataKey("CveCompra").ToEntero > 0 AndAlso gvRow.FCCheckBox("ChkFacturaNC").Checked Then
- ' Dim SerieFolioFacura As String = ObtenerUltimaParte(gvRow.DataKey("SerieFolio"))
- ' Dim seleccion As String = ""
-
- ' For Each item As ListItem In DdlRemisionNotaCredito.Items
- ' Dim serieFolioItem As String = ObtenerUltimaParte(item.Text)
- ' If SerieFolioFacura = serieFolioItem Then
- ' 'seleccion = item.Value
- ' AutoSelRNC = True
- ' DdlRemisionNotaCredito.SelectedValueExist(item.Value)
- ' Exit For
- ' End If
-
- ' Next
-
- ' If AutoSelRNC Then
- ' Exit For
- ' End If
-
- ' End If
- 'Next
-
- If AutoSelRNC Then
- 'DdlRemisionNotaCredito_SelectedIndexChanged(Nothing, Nothing)
- End If
-
- HLAplicaNCFact.Visible = True
UpPS.Update()
UpEstatus.Update()
@@ -15189,8 +15159,6 @@ Partial Class Compras_Compras
UpGvOC1.Update()
TmpDT = TmpDT.FiltraParametros("", "PU")
-
-
'PROCESO DE ASIGNACION DE CANTIDAD DEPENDIENDO DEL NoIdentificacion DEL XML Y EL NumeroParte DEL PRODUCTO
If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
For Each Gvr As GridViewRow In GvOC1.Rows
@@ -15446,17 +15414,13 @@ Partial Class Compras_Compras
Vinculacion()
ElseIf Math.Abs(LbSubTotalOC2.Text.ToDecimal - (LbSubTotalOC1.Text.ToDecimal - LbAnticiposOC2.Text.ToDecimal)) < DiferenciaPermitida Then
LbSubTotalDif.Visible = False
- Vinculacion()
- Else
-
- If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
+ If UsuarioActual.Empresa.Funcionalidad(574) = "1" Then
ImporteRNC = (SubTotalCompra - SubTotalGV).RoundSQL(2)
ImporteRNCProntoPago = (SubTotalCompra * PorcentajeProntoPago).RoundSQL(2)
Dim ImporteOCConIVA As Decimal = 0D
Dim ImporteOCSinIVA As Decimal = 0D
-
Dim ImporteCompraConIVA As Decimal = TmpDT.SUM("Total", " IVAPorcentaje > 0 ")
Dim ImporteCompraSinIVA As Decimal = TmpDT.SUM("Total", " IVAPorcentaje = 0 ")
@@ -15472,18 +15436,45 @@ Partial Class Compras_Compras
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA)
- If ConfirmaVinculacionOCProntoPago(AjusteProntoPagoPorcentajeIVA) Then
+ If ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA) Then
Vinculacion()
End If
+ Else
+ Vinculacion()
+ End If
+ Else
+ If UsuarioActual.Empresa.Funcionalidad(574) = "1" Then
+
+ ImporteRNC = (SubTotalCompra - SubTotalGV).RoundSQL(2)
+ ImporteRNCProntoPago = (SubTotalCompra * PorcentajeProntoPago).RoundSQL(2)
+
+ Dim ImporteOCConIVA As Decimal = 0D
+ Dim ImporteOCSinIVA As Decimal = 0D
+ Dim ImporteCompraConIVA As Decimal = TmpDT.SUM("Total", " IVAPorcentaje > 0 ")
+ Dim ImporteCompraSinIVA As Decimal = TmpDT.SUM("Total", " IVAPorcentaje = 0 ")
+
+ For Each gvr As GridViewRow In GvOC1.Rows
+ If gvr.DataKey("IVAPorcentaje").ToDecimal > 0 Then
+ ImporteOCConIVA = ImporteOCConIVA + (gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal)
+ Else
+ ImporteOCSinIVA = ImporteOCSinIVA + (gvr.FCTextBox("TxtCantidad").Text.ToDecimal * gvr.FCTextBox("TxtPU").Text.ToDecimal)
+ End If
+ Next
+
+ AjusteProntoPagoPorcentajeIVA = TmpDT.MAX("IVAPorcentaje").ToDecimal
+ AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
+ AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA)
+
+ If ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA) Then
+ Vinculacion()
+ End If
Else
LbSubTotalDif.Visible = True
LbSubTotalDif.Text = (SubTotalCompra - SubTotalGV).FormatoNumero
Alert("Los SubTotales de la vinculación no coinciden. Rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia,,)
RegistraScript("CalculaTotalesOC();")
End If
-
-
End If
UpEstatus.Update()
@@ -15617,7 +15608,7 @@ Partial Class Compras_Compras
IndexTmpOriginal += 1
Next
- If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 AndAlso (AjusteProntoPagoConIVA > 0 Or AjusteProntoPagoSinIVA > 0) Then
+ If UsuarioActual.Empresa.Funcionalidad(574) = "1" AndAlso (AjusteProntoPagoConIVA > 0 Or AjusteProntoPagoSinIVA > 0) Then
Dim CvePS_RNC As Integer = UsuarioActual.Empresa.Funcionalidad(580).ToEntero
If CvePS_RNC = 0 Then
@@ -15637,9 +15628,6 @@ Partial Class Compras_Compras
Dim Clasificacion As String = PSRow("Clasificacion").ToString
Dim PS As String = PSRow("PS").ToString
Dim CveUM As Integer = PSRow("CveUnidadMedida").ToString.ToEntero
-
-
-
Dim DTConIVA As DataTable = TmpDT.FiltraParametros(" IVAPorcentaje > 0")
If DTConIVA.Rows.Count > 0 Then
@@ -15680,7 +15668,6 @@ Partial Class Compras_Compras
Tab.ActiveTabIndex = 0
UpTabs.Update()
-
ImgClasificacion.Visible = False
ImgSubProyecto.Visible = False
LbAgregar.Visible = False
@@ -16559,8 +16546,9 @@ Partial Class Compras_Compras
If DdlTipoCompra.Items.FindByValue("15") Is Nothing Then
DdlTipoCompra.Items.Add(New ListItem("Remision Nota De Crédito", "15"))
UpEstatus.Update()
+ 'oculta el botón para aplicar el saldo, esto bloquea que no duplique el abono.
+ HLAplicaNCFact.Visible = False
End If
-
End If
Else
DivReembolso.Visible = True
@@ -17204,9 +17192,9 @@ Partial Class Compras_Compras
Dim NumNoDed As Integer = TmpDT.COUNT("CvePS", "NoDeducible = True ")
If NumNoDed > 0 Then GvPS.Columns(11).Visible = True 'visualiza columnas de nodeducibles
- If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") And CveFactura <= 0 Then
- InicializaAplicaNCFact()
- End If
+ 'If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") And CveFactura <= 0 Then
+ ' InicializaAplicaNCFact()
+ 'End If
End Sub
Private Sub OriginalesVisible(Accion As Boolean)
@@ -21824,12 +21812,11 @@ Partial Class Compras_Compras
End Set
End Property
- Public Function ConfirmaVinculacionOCProntoPago(AjusteProntoPagoPorcentajeIVA As Decimal) As Boolean
+ Public Function ConfirmaVinculacionOC_RNC(AjusteProntoPagoPorcentajeIVA As Decimal) As Boolean
If VincularOcProntoPago Then
Return True
Else
-
Dim TmpImporteRNC As Decimal = If(AjusteProntoPagoPorcentajeIVA > 0, ImporteRNC + (ImporteRNC * AjusteProntoPagoPorcentajeIVA), ImporteRNC)
Dim TmpImporteRNCProntoPago As Decimal = If(AjusteProntoPagoPorcentajeIVA > 0, ImporteRNCProntoPago + (ImporteRNCProntoPago * AjusteProntoPagoPorcentajeIVA), ImporteRNCProntoPago)
diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs
index 5d506e66a..9809a4095 100644
--- a/Nomina/Nomina.aspx.cs
+++ b/Nomina/Nomina.aspx.cs
@@ -3323,7 +3323,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
using (ClsNominas objRH = new ClsNominas())
{
- if (objRH.GETPersonalVacaciones(UsuarioActual.CveEmpresa, SRCvePersonal))
+ if (objRH.GetPersonalVacaciones(UsuarioActual.CveEmpresa, SRCvePersonal))
{
GvVacaciones.DataSource = objRH.DtResultados;
@@ -3345,7 +3345,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
ChkVacCobrarIMSS.Checked = true;
using (ClsNominas objnom = new ClsNominas())
{
- if (objnom.GETPersonalVacResumen(UsuarioActual.Empresa.CveEmpresa, SRCvePersonal))
+ if (objnom.GetPersonalVacResumen(UsuarioActual.Empresa.CveEmpresa, SRCvePersonal))
{
DdlVacPeriodo.DataSource = objnom.DtResultados;
DdlVacPeriodo.DataBind();
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index 2b6d48e9c..81e15d68b 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -2748,6 +2748,13 @@ Partial Class OC_OC
TieneError = True
End If
+ If ModalidadSubProyectoGeneral Then
+ Dim t As Integer = DtDetalle.COUNT("CvePS", $"CveSubProyecto <> {DdlSubProyectoGral.SelectedValue}")
+ If t > 0 Then
+ Alert("Se tienen partidas de diferentes Sucursales.", TipoMensaje.MsgAdvertencia)
+ Return True
+ End If
+ End If
'VALIDA QUE ANTES DE QUE PUEDA MANDARLA A SUPERVISADA SE TIENE QUE SELECCIONAR UN PROVEEDOR
If UsuarioActual.Empresa.Funcionalidad(565) = "1" Then
@@ -4054,12 +4061,10 @@ Partial Class OC_OC
e.Row.FCLabel("LtlCantidad").Attributes.Add("data-toggle", "tooltip")
e.Row.FCLabel("LtlCantidad").Attributes.Add("Title", e.Row.DataKey("CveOrdenCompraDetalle"))
End If
-
Catch ex As Exception
End Try
-
If Not (e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5) Then
If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then
diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb
index 8141ec2a3..46a4906b3 100644
--- a/Sistemas/UsuarioDetalle.aspx.vb
+++ b/Sistemas/UsuarioDetalle.aspx.vb
@@ -2295,8 +2295,8 @@ Partial Class Sistemas_UsuarioDetalle
If DdlEmpresaAsignaciones.SelectedValue.ToEntero > 0 Then
If UsuarioControlado Then
DdlCuentasBancarias.DataSource = DtCuentasBancariasControlado.FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}")
- Else
- DdlCuentasBancarias.DataSource = GlobalDTBancosCuentas(-1, -1, -1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros($"CveEmpresa = {DdlEmpresaAsignaciones.SelectedValue}", "", {"CveCuenta", "NumCuentaMoneda"})
+ Else
+ DdlCuentasBancarias.DataSource = GlobalDTBancosCuentasGral(CveEmpresa)
End If
End If
DdlCuentasBancarias.DataBind()
diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb
index a5c7097d9..6e0672c10 100644
--- a/Transportes/RepContratoDetalle.aspx.vb
+++ b/Transportes/RepContratoDetalle.aspx.vb
@@ -591,7 +591,7 @@ Partial Class RepContratoDetalle
If Not ObjContratos.UpdateContratos(CveContrato, TxtFolio.Text, TxtDescripcion.Text, "", UsuarioActual.CveProveedor, DdlClientes.SelectedValue.ToEntero, -1, TxtFechaSalida.Text.ToDate, TxtFechaRegreso.Text.ToDate, TxtUbicacion.Text, "",
DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, ArchivoUpdate, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkEsPresupuestal.Checked, TxtAnticipo.Text.ToDecimal, -1, TxtImporte.Text.ToDecimal,
- DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text) Then
+ DdlMoneda.SelectedValue.ToEntero, 0, CveContratoTipo:=CveContratoTipo, CveTipoAF:=DdlTipoAF.SelectedValue.ToEntero, CveContratosEstatus:=CveContratoEstatus, Observaciones:=TxtObservaciones.Text, CantidadPasajeros:=TxtCantidadPasajeros.Text.ToEntero) Then
ErrorProceso = True
End If
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index c8aefa58c..da5b317a3 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -320,8 +320,6 @@