--merge Saldos iniciales

This commit is contained in:
2023-11-25 18:48:38 -07:00
20 changed files with 429 additions and 545 deletions

View File

@@ -8911,13 +8911,9 @@ Partial Class Ventas
Exit Sub
End If
If Not LblRFC.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso RegimenFiscalCliente = "616" Then
Alert("El Regimen fiscal del cliente no puede ser <b>'616 - Sin obligaciones fiscales'</b> si no se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'If Not LblRFC.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso DdlUsoCFDI.SelectedValue = "23" Then
' Alert("El uso cfdi del cliente no puede ser <b>'S01 - Sin efectos fiscales'</b> si no se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia)
'hay RFC con regimen 616, con evidencia de constancia
'If Not LblRFC.Text.Trim().ToUpper().Contiene("XAXX010101000", "XEXX010101000") AndAlso RegimenFiscalCliente = "616" Then
' Alert("El Regimen fiscal del cliente no puede ser <b>'616 - Sin obligaciones fiscales'</b> si no se utiliza el RFC genérico.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
@@ -15739,10 +15735,8 @@ Partial Class Ventas
End Sub
Private Sub AplicaAnticipos()
If CveVenta > 0 And CveCliente > 0 And Not EsCreaApartirDe And CveDevolucion <= 0 Then
Dim EsAnticipo2017Jam As Boolean = False
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked Then
@@ -15764,20 +15758,7 @@ Partial Class Ventas
Dim ErrorConta As Boolean
Dim CveIEAnticipo As Integer
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
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)
@@ -15802,7 +15783,6 @@ Partial Class Ventas
Dim tFecha As Date = NowADS()
Dim UltimaFluctuacion As MTipoCambioFluctuacion = GlobalTipoCambioUltimaFluctuacion(tFecha)
If UsuarioActual.Empresa.Funcionalidad(703) = "1" AndAlso UltimaFluctuacion IsNot Nothing Then
If UltimaFluctuacion.FechaFluctuacion <= tFecha Then
FechaUltimaFluctuacion = UltimaFluctuacion.FechaFluctuacion
@@ -15923,39 +15903,19 @@ Partial Class Ventas
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 Select
End If
Next
Else
ErrorConta = True
End If
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, 3) Then
''OPCION:99 - NO SIMPLIFICAR
If Not ErrorConta AndAlso ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=99, AutoConta:=False) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Ventas/Ventas-Anticipos | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
ErrorConta = True
End If
End If
@@ -15972,8 +15932,8 @@ Partial Class Ventas
Msg.Append("Se ha amortizado correctamente")
'AJUSTA POLIZA
If ContaIdPoliza > 0 Then
Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", ContaIdPoliza)
If ObjConta.ContaFolio > 0 Then
Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza)
End If
ObjConta.Commit()
@@ -16130,14 +16090,12 @@ Partial Class Ventas
End If
End If
LblAmortizacion.Text = Amortizacion.FormatoNumero(2)
LblAmortizacion.Text = Amortizacion.FormatoNumero
HdnTipoDescuento.Value = "-1"
HdnDescuento.Value = "0"
RegistraScript("BorraDescuentos();")
HdnTieneAnticiposVinculados.Value = "1"
End If
CalculaTotalesVenta(ValidarDescuentos:=True)
End If