-- si la aplicación de NC, tiene impuestos,q ue no simplifique la prepóliza

This commit is contained in:
2022-06-05 17:29:42 -07:00
parent c2feddcb55
commit df3a27a1ac

View File

@@ -15339,11 +15339,11 @@ Partial Class Ventas
Dim ObjCliente As New ClsClientes(ObjConta.IniciaTransacSQL()) Dim ObjCliente As New ClsClientes(ObjConta.IniciaTransacSQL())
Dim ObjContpaq As ClsContPAQi = Nothing Dim ObjContpaq As ClsContPAQi = Nothing
Dim CvePrepoliza As Integer Dim CvePrePoliza As Integer
Dim ErrorConta As Boolean Dim ErrorConta As Boolean
Dim CveIEAnticipo As Integer Dim CveIEAnticipo As Integer
Dim CvePlantillaPoliza As Integer = 10 Dim CvePlantillaPoliza As Integer = 10
Dim PorcentajeAmortizacion As Decimal = 0 Dim PorcentajeAmortizacion As Decimal
Dim sumaAmorticaciones As Decimal = 0 Dim sumaAmorticaciones As Decimal = 0
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>" Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
Dim CveCuentaContabilizacion As Integer = 1 Dim CveCuentaContabilizacion As Integer = 1
@@ -15351,17 +15351,7 @@ Partial Class Ventas
Dim ContaIdPoliza As Integer = 0 Dim ContaIdPoliza As Integer = 0
Dim ConceptoAmortizacion As Integer = 0 Dim ConceptoAmortizacion As Integer = 0
Dim UsaComplementariaClientes As Boolean = True Dim UsaComplementariaClientes As Boolean = True
'If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True Dim SimplificaPrePoliza As Boolean = True
'Dim FechaMaxima As Date = MinFecha
'For Each gvr As GridViewRow In GVAnticipos.Rows
' If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
' If gvr.FCLiteral("LtlFecha").Text.ToDate > FechaMaxima Then
' FechaMaxima = gvr.FCLiteral("LtlFecha").Text.ToDate
' End If
' End If
'Next
''[IPP] PARCHE TEMPORAL PARA ANTICIPOS DE JAM ''[IPP] PARCHE TEMPORAL PARA ANTICIPOS DE JAM
'If FechaMaxima < "01/01/2018".ToDate And UsuarioActual.CveEmpresa = 119 Then 'If FechaMaxima < "01/01/2018".ToDate And UsuarioActual.CveEmpresa = 119 Then
@@ -15385,7 +15375,6 @@ Partial Class Ventas
Dim IdCtaIVAXTrasladar As Integer = 0 Dim IdCtaIVAXTrasladar As Integer = 0
Dim IdCtaIVATrasladado As Integer = 0 Dim IdCtaIVATrasladado As Integer = 0
Dim CveSubProyectoVenta As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero() Dim CveSubProyectoVenta As Integer = DdlSubProyectoDatos.SelectedValue.ToEntero()
Dim Importe91 As Decimal = 0 Dim Importe91 As Decimal = 0
@@ -15413,19 +15402,7 @@ Partial Class Ventas
End If End If
End If End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = Now 'gvr.DataKey("Fecha").ToDate
' Dim Fecha As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & Fecha & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString().ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString().ToDecimal
' End If
' End If
'End If
If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS If DdlMoneda.SelectedValue.ToEntero() = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero() = 1 Then 'SI LA VENTA VIENE EN PESOS Y SE VA A PAGAR EN PESOS
tipoCambioPago = 1 tipoCambioPago = 1
@@ -15481,8 +15458,8 @@ Partial Class Ventas
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento importeMX = importeMovimiento
End If End If
importeMovimiento = Math.Round(importeMovimiento, 2) importeMovimiento = importeMovimiento.RoundSQL
importeMX = Math.Round(importeMX, 2) importeMX = importeMX.RoundSQL
TipoCambioGeneral = tipoCambioVentaValuacion TipoCambioGeneral = tipoCambioVentaValuacion
If CveMonedaVenta = 1 Then If CveMonedaVenta = 1 Then
@@ -15549,26 +15526,26 @@ Partial Class Ventas
importeMovimiento = 0 importeMovimiento = 0
Case 91 'Amortizacion Nota de Credito Case 91 'Amortizacion Nota de Credito
Dim TC As Decimal = 1 Dim TC As Decimal = 1
If gvr.DataKey("CveConceptoContable").ToString().ToEntero() = 12 Then If gvr.DataKey("CveConceptoContable").ToEntero() = 12 Then
If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToString().ToDecimal = 1 Then If CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento importeMX = importeMovimiento
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToString().ToDecimal = 2 Then ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento * gvr.DataKey("TipoCambio").ToString().ToDecimal importeMX = importeMovimiento * gvr.DataKey("TipoCambio").ToString().ToDecimal
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToString().ToDecimal = 2 Then ElseIf CveMonedaVenta = 1 And gvr.DataKey("CveMoneda").ToEntero = 2 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal importeMX = importeMovimiento * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
TC = TipoCambioFluctuacion TC = TipoCambioFluctuacion
ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToString().ToDecimal = 1 Then ElseIf CveMonedaVenta = 2 And gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.FCTextBox("TxtTC" & gvr.RowIndex).Text.ToDecimal
importeMX = importeMovimiento importeMX = importeMovimiento
TC = gvr.DataKey("TipoCambio").ToString().ToDecimal TC = gvr.DataKey("TipoCambio").ToString().ToDecimal
End If End If
importeMovimiento = Math.Round(importeMovimiento, 2) importeMovimiento = importeMovimiento.RoundSQL
importeMX = Math.Round(importeMX, 2) importeMX = importeMX.RoundSQL
If ObjConta.GetRetCuenta(ConceptoContable, CveCliente) Then If ObjConta.GetRetCuenta(ConceptoContable, CveCliente) Then
If ObjConta.DtResultados.Rows.Count > 0 Then If ObjConta.DtResultados.Rows.Count > 0 Then
@@ -15845,6 +15822,7 @@ Partial Class Ventas
Case 39 ' IEPS Trasladado Case 39 ' IEPS Trasladado
If gvr.DataKey("RegresarImpuesto") = "1" Then If gvr.DataKey("RegresarImpuesto") = "1" Then
SimplificaPrePoliza = False
CveIEAnticipo = gvr.DataKey("CveIE").ToEntero() CveIEAnticipo = gvr.DataKey("CveIE").ToEntero()
importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.DataKey("DevolucionImportePagado").ToDecimal importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal * gvr.DataKey("DevolucionImportePagado").ToDecimal
PorcentajeImpuesto = 0 PorcentajeImpuesto = 0
@@ -15888,7 +15866,7 @@ Partial Class Ventas
ErrorConta = True ErrorConta = True
End If End If
If Not ErrorConta AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrepoliza, UsuarioActual.CveEmpresa) Then If Not ErrorConta AndAlso SimplificaPrePoliza AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrepoliza, UsuarioActual.CveEmpresa) Then
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError) Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
End If End If