From ed3faf60a9948296511e313ae728d05d88149fd3 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 5 Apr 2023 21:08:01 -0700 Subject: [PATCH] Correciones en clase --- App_Code/ClsNominas.vb | 3 ++- App_Code/ClsVentas.vb | 21 +++++++++++++++++++++ App_Code/Modelos.vb | 21 ++++++++++++++++----- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index ae1e97b84..4019544a7 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3121,7 +3121,7 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer) As Integer + Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer, Optional CveIE As Integer = -1) As Integer Dim retorno As Integer = 0 DataAdapter("PA_AddMovtoPermanente", CommandType.StoredProcedure) @@ -3136,6 +3136,7 @@ Public Class ClsNominas .Add("@fechaInicioAplicacion", SqlDbType.VarChar).Value = (fechaInicioAplicacion) .Add("@estatus", SqlDbType.Bit).Value = (estatus) .Add("@CveCuenta", SqlDbType.Int).Value = (CveCuenta) + .Add("@CveIE", SqlDbType.Int).Value = (CveIE) .Add("@CveMovtoPermanente", SqlDbType.Int).Direction = ParameterDirection.Output End With Try diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index f62a5b548..c5f8dd4f9 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -5155,6 +5155,27 @@ Public Class ClsVentas Return Retorno End Function + Public Function GetVentasUsadosSaldosAplicar(CveVentas As String, CveCliente As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_VentasUsadosSaldosAplicarGet", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveVenta", SqlDbType.VarChar).Value = CveVentas + .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los saldos de las ventas con usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetVentasGarantiaPendiente(CveVenta As Integer, Fecha As DateTime, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 2b1a6aa7f..888460422 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2676,7 +2676,10 @@ Namespace Modelos Dim ImporteConcepto12 As Decimal = 0 Dim ImporteAcumulado91 As Decimal = 0 Dim CveUltimaVenta As Integer = 0 - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" + If tipoCambio > 1 Then + Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" + ConceptoContable = 293 + End If IdCtaContable = 0 If tipoCambio = 1 Then IdCtaContable = ObjFactura.Cliente.IdCtaContClientes @@ -3063,11 +3066,19 @@ Namespace Modelos If ObjFactura.DtNCVinculadas IsNot Nothing Then For Each row2 As DataRow In ObjFactura.DtNCVinculadas.Rows - If row2("CveConceptoContable").ToString().ToEntero = 91 Then + If row2("CveConceptoContable").ToString().ToEntero.Contiene(91, 294) Then importeMovimiento = (row2("Importe").ToString().ToDecimal * ValorMultiplicador) sumaAmorticaciones += importeMovimiento - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" + + Dim CveConceptoAplicacionNC As Integer = 91 + Dim CveConceptoPagoNC As Integer = 251 + + If tipoCambio > 1 Then + Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" + CveConceptoAplicacionNC = 294 + CveConceptoPagoNC = 301 + End If 'CTACONTABLE 'IdCtaContable = IdCtaContAnticipos @@ -3143,7 +3154,7 @@ Namespace Modelos End If End If - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe91, Referencia, 91, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=row2("CveVenta").ToString.ToEntero, ImporteMX:=ImporteMN91, ImporteME:=If(tipoCambio = 1, 0, Importe91), CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, Importe91, Referencia, CveConceptoAplicacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveVentaAmortizacion:=row2("CveVenta").ToString.ToEntero, ImporteMX:=ImporteMN91, ImporteME:=If(tipoCambio = 1, 0, Importe91), CveSubProyecto:=CveSubProyectoContabilizar, TipoCambio:=tipoCambio) Then ErrorPrepoliza = True Exit For End If @@ -3158,7 +3169,7 @@ Namespace Modelos End If End If - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, 251, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(row2("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=row2("TCCambioValuacion").ToString.ToDecimal, TipoCambioPago:=tipoCambio) Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, Importe251, Referencia, CveConceptoPagoNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, ImporteMX:=ImporteMN251, ImporteME:=If(row2("TCCambioValuacion").ToString.ToDecimal = 1, 0, Importe251), CveSubProyecto:=CveSubProyectoContabilizar, CveVentaAmortizacion:=ObjFactura.CveVenta, TipoCambio:=row2("TCCambioValuacion").ToString.ToDecimal, TipoCambioPago:=tipoCambio) Then ErrorPrepoliza = True Exit For End If