-- no simplificar al aplicar anticipo posterior
This commit is contained in:
@@ -15714,10 +15714,8 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub AplicaAnticipos()
|
Private Sub AplicaAnticipos()
|
||||||
|
|
||||||
|
|
||||||
If CveVenta > 0 And CveCliente > 0 And Not EsCreaApartirDe And CveDevolucion <= 0 Then
|
If CveVenta > 0 And CveCliente > 0 And Not EsCreaApartirDe And CveDevolucion <= 0 Then
|
||||||
|
|
||||||
|
|
||||||
Dim EsAnticipo2017Jam As Boolean = False
|
Dim EsAnticipo2017Jam As Boolean = False
|
||||||
For Each gvr As GridViewRow In GVAnticipos.Rows
|
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.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
|
||||||
@@ -15739,20 +15737,7 @@ Partial Class Ventas
|
|||||||
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
|
|
||||||
'Dim sumaAmorticaciones As Decimal = 0
|
|
||||||
'Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
|
|
||||||
'Dim CveCuentaContabilizacion As Integer = 1
|
|
||||||
Dim CuentasContablesInvalidas As New StringBuilder
|
|
||||||
Dim ContaIdPoliza As Integer = 0
|
|
||||||
'Dim ConceptoAmortizacion As Integer = 0
|
|
||||||
'Dim UsaComplementariaClientes As Boolean = True
|
|
||||||
|
|
||||||
''[IPP] PARCHE TEMPORAL PARA ANTICIPOS DE JAM
|
|
||||||
'If FechaMaxima < "01/01/2018".ToDate And UsuarioActual.CveEmpresa = 119 Then
|
|
||||||
' FechaMaxima = "01/01/2018".ToDate
|
|
||||||
'End If
|
|
||||||
'Dim NowADS() As DateTime = New DateTime(2020, 2, 19)
|
|
||||||
Try
|
Try
|
||||||
CvePrePoliza = ObjConta.AddPrePolizas("Ventas/Anticipos", CvePlantillaPoliza, TxtTotal.Text.ToDecimal, TxtTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero(), TxtFechaAnticipoCliente.Text.ToDate, String.Format("{0} {1} {2}-{3}", If(EsAnticipo2017Jam, "Aplicación Anticipo 2017", ""), NombreCliente, Serie, TxtFolio.Text), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
CvePrePoliza = ObjConta.AddPrePolizas("Ventas/Anticipos", CvePlantillaPoliza, TxtTotal.Text.ToDecimal, TxtTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero(), TxtFechaAnticipoCliente.Text.ToDate, String.Format("{0} {1} {2}-{3}", If(EsAnticipo2017Jam, "Aplicación Anticipo 2017", ""), NombreCliente, Serie, TxtFolio.Text), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
@@ -15777,7 +15762,6 @@ Partial Class Ventas
|
|||||||
Dim tFecha As Date = NowADS()
|
Dim tFecha As Date = NowADS()
|
||||||
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
|
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
|
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
|
||||||
If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
|
If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
|
||||||
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
|
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
|
||||||
@@ -15898,39 +15882,19 @@ Partial Class Ventas
|
|||||||
|
|
||||||
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
|
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
|
||||||
|
|
||||||
'Dim Pago As New VentaPago
|
|
||||||
'Pago.ImportePagoVenta = importeMovimiento
|
|
||||||
'Pago.ImportePago = importeMovimiento
|
|
||||||
'Pago.CveIE = CveIEAnticipo
|
|
||||||
'Pago.CveMonedaPago = gvr.DataKey("CveMoneda").ToEntero()
|
|
||||||
'Pago.TCPago = gvr.DataKey("TipoCambio").ToDecimal
|
|
||||||
'Pago.TipoPago = "I"
|
|
||||||
'Pago.FechaDocumentoRelacionado = gvr.DataKey("Fecha").ToDate
|
|
||||||
'Pago.CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero()
|
|
||||||
'Pago.Referencia = gvr.DataKey("Folio")
|
|
||||||
|
|
||||||
'importeMovimiento = ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / TxtTotal.Text.ToDecimal) * TxtIVA.Text.ToDecimal)
|
|
||||||
'importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
|
|
||||||
|
|
||||||
''Agregamos el 92
|
|
||||||
'importeMovimiento = gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal 'gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal - ((gvr.FCTextBox("TxtAnticipo" & gvr.RowIndex).Text.ToDecimal / gvr.DataKey("TotalAnticipo" & gvr.RowIndex).ToDecimal) * gvr.DataKey("IVAAnticipo").ToDecimal)
|
|
||||||
'importeMN = Math.Round(importeMovimiento * tipoCambioPago, 2, MidpointRounding.AwayFromZero)
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
ErrorConta = True
|
ErrorConta = True
|
||||||
End If
|
End If
|
||||||
|
''OPCION:99 - NO SIMPLIFICAR
|
||||||
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, 3) Then
|
If Not ErrorConta AndAlso ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=99, AutoConta:=False) Then
|
||||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||||
GuardaLogAD($"Ventas/Ventas-Anticipos | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
GuardaLogAD($"Ventas/Ventas-Anticipos | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||||
ErrorConta = True
|
ErrorConta = True
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -15947,8 +15911,8 @@ Partial Class Ventas
|
|||||||
Msg.Append("Se ha amortizado correctamente")
|
Msg.Append("Se ha amortizado correctamente")
|
||||||
|
|
||||||
'AJUSTA POLIZA
|
'AJUSTA POLIZA
|
||||||
If ContaIdPoliza > 0 Then
|
If ObjConta.ContaFolio > 0 Then
|
||||||
Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", ContaIdPoliza)
|
Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjConta.Commit()
|
ObjConta.Commit()
|
||||||
@@ -16105,14 +16069,12 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
LblAmortizacion.Text = Amortizacion.FormatoNumero(2)
|
LblAmortizacion.Text = Amortizacion.FormatoNumero
|
||||||
|
|
||||||
HdnTipoDescuento.Value = "-1"
|
HdnTipoDescuento.Value = "-1"
|
||||||
HdnDescuento.Value = "0"
|
HdnDescuento.Value = "0"
|
||||||
RegistraScript("BorraDescuentos();")
|
RegistraScript("BorraDescuentos();")
|
||||||
HdnTieneAnticiposVinculados.Value = "1"
|
HdnTieneAnticiposVinculados.Value = "1"
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
CalculaTotalesVenta(ValidarDescuentos:=True)
|
CalculaTotalesVenta(ValidarDescuentos:=True)
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user