-- cambio a unificación función validaciónprepolizas
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
'Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports ADSTimbrado
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Ventas_ClientesAbonar
|
||||
@@ -1369,17 +1370,12 @@ Partial Class Ventas_ClientesAbonar
|
||||
|
||||
ObjFacturaDevolucion.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
ObjFacturaDevolucion.TipoCambio = If(Me.CveMoneda = 1, 1, GlobalTipoCambio(NowADS()).FormatoNumero(4).ToDecimal())
|
||||
ObjFacturaDevolucion.ConvertirPesos = False
|
||||
ObjFacturaDevolucion.CveMoneda = CveMoneda
|
||||
ObjFacturaDevolucion.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {CveMoneda}")
|
||||
ObjFacturaDevolucion.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {CveMoneda}")
|
||||
ObjFacturaDevolucion.Serie = Serie
|
||||
ObjFacturaDevolucion.Folio = Folio
|
||||
ObjFacturaDevolucion.Fecha = NowADS()
|
||||
ObjFacturaDevolucion.CvePrePoliza = -1
|
||||
ObjFacturaDevolucion.CveMetodoPago = 0
|
||||
ObjFacturaDevolucion.CondicionesPago = 0 ' 0 - Contado, 1 - Credito (CHECAR)
|
||||
ObjFacturaDevolucion.FormaPago = 0
|
||||
|
||||
ObjFacturaDevolucion.TipoDocto = "Egs"
|
||||
ObjFacturaDevolucion.Fecha = NowADS()
|
||||
@@ -1433,7 +1429,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
ObjFacturaDevolucion.DtVentasRelacionadas.Columns.Add("CveVenta", GetType(Integer))
|
||||
|
||||
Dim Fol As New List(Of String)
|
||||
For Each Fac In ListaVentasGenerarNC
|
||||
For Each Fac As Modelos.Factura In ListaVentasGenerarNC
|
||||
Fol.Add(Fac.FolioFiscal)
|
||||
|
||||
Dim RowVenta As DataRow = ObjFacturaDevolucion.DtVentasRelacionadas.NewRow
|
||||
@@ -1460,24 +1456,14 @@ Partial Class Ventas_ClientesAbonar
|
||||
End Select
|
||||
|
||||
ObjFacturaDevolucion.FechaPago = NowADS()
|
||||
Dim DtVentasNC As DataTable = InicializaDTVentasNC()
|
||||
|
||||
ObjFacturaDevolucion.CveCorte = -1
|
||||
'ObjFacturaDevolucion.CveMesa = -1
|
||||
ObjFacturaDevolucion.NumeroPersonas = 0
|
||||
ObjFacturaDevolucion.CveContrato = -1
|
||||
ObjFacturaDevolucion.DescripcionContrato = ""
|
||||
ObjFacturaDevolucion.CveClienteSucursal = -1
|
||||
ObjFacturaDevolucion.Entrega = ""
|
||||
ObjFacturaDevolucion.CveAlmacen = -1
|
||||
|
||||
Dim DtVentasNC = InicializaDTVentasNC()
|
||||
|
||||
Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("TotalImporte")
|
||||
Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIVA")
|
||||
Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetIVA")
|
||||
Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteRetISR")
|
||||
Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("ImporteIEPS")
|
||||
Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUMD("Descuento")
|
||||
Dim TotalImporte As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("TotalImporte")
|
||||
Dim ImporteIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteIVA")
|
||||
Dim ImporteRetIVA As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteRetIVA")
|
||||
Dim ImporteRetISR As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteRetISR")
|
||||
Dim ImporteIEPS As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("ImporteIEPS")
|
||||
Dim Descuento As Decimal = ObjFacturaDevolucion.DtDetalle.SUM("Descuento")
|
||||
Dim Amortizacion As Decimal = 0
|
||||
|
||||
Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
|
||||
@@ -1493,8 +1479,8 @@ Partial Class Ventas_ClientesAbonar
|
||||
ObjFacturaDevolucion.Total = Total
|
||||
ObjFacturaDevolucion.TotalOtrosConceptos = 0
|
||||
|
||||
For Each Fac In ListaVentasGenerarNC
|
||||
Dim Drt = DtVentasNC.NewRow
|
||||
For Each Fac As Modelos.Factura In ListaVentasGenerarNC
|
||||
Dim Drt As DataRow = DtVentasNC.NewRow
|
||||
Drt("CveVenta") = Fac.CveVenta
|
||||
Drt("Importe") = Fac.DescuentoProntoPago
|
||||
Drt("FolioFiscal") = Fac.FolioFiscal
|
||||
@@ -1508,7 +1494,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion, ListaVentasGenerarNC)
|
||||
|
||||
Try
|
||||
Dim Resp = ObjFacturaDevolucion.EmitirFactura(False, Transac:=SqlTransaccion)
|
||||
Dim Resp As Modelos.Factura.MMensajeFactura = ObjFacturaDevolucion.EmitirFactura(False, Transac:=SqlTransaccion)
|
||||
Retorno.Respuesta = Resp
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al guardar la NC de pronto pago", ex)
|
||||
@@ -1572,7 +1558,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString()
|
||||
Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString()
|
||||
|
||||
For Each Fac In ListaVentasGenerarNC
|
||||
For Each Fac As Modelos.Factura In ListaVentasGenerarNC
|
||||
Timbre.CFDIRelacionados.UUID.Add(Fac.FolioFiscal)
|
||||
Next
|
||||
End If
|
||||
@@ -1601,7 +1587,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
tPS = tPS.Replace("|", " ")
|
||||
|
||||
If tPS.Length >= 1000 Then
|
||||
Dim tPSRecortado = tPS.Remove(999, tPS.Length - 999)
|
||||
Dim tPSRecortado As String = tPS.Remove(999, tPS.Length - 999)
|
||||
tPS = tPSRecortado
|
||||
End If
|
||||
|
||||
@@ -1740,7 +1726,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
DtImpuestos.AcceptChanges()
|
||||
Dim AcumuladoNC As Decimal = 0
|
||||
|
||||
For Each Fac In ListaVentasGenerarNC
|
||||
For Each Fac As Modelos.Factura In ListaVentasGenerarNC
|
||||
DtImpuestos.Merge(CargaDtImpuestosNC(Fac.CveVenta, Fac.DescuentoProntoPago), True, MissingSchemaAction.Ignore)
|
||||
Next
|
||||
|
||||
@@ -2384,7 +2370,7 @@ Partial Class Ventas_ClientesAbonar
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
|
||||
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=5) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
|
||||
GuardaLogAD($"Ventas/ClientesAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
|
||||
@@ -211,8 +211,8 @@ public partial class Ventas_RepNCxAplicar : ClsPaginas
|
||||
{
|
||||
MsgError = "Ocurrio un error al saldar el movimiento";
|
||||
}
|
||||
|
||||
if (ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1))
|
||||
Usuario UA = UsuarioActual;
|
||||
if (MsgError == "" && ObjConta.ValidacionesPrePoliza(CvePrePoliza, ref UA, Opcion: -1))
|
||||
{
|
||||
if (ObjConta.ValorPolizaDescuadre > 0)
|
||||
{
|
||||
|
||||
@@ -15835,7 +15835,7 @@ Partial Class Ventas
|
||||
ErrorConta = True
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 3) Then
|
||||
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, 3) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Ventas/Ventas-Anticipos | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
ErrorConta = True
|
||||
@@ -21368,7 +21368,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
|
||||
If ObjConta.ValidacionesPrePoliza(-1, UsuarioActual, Opcion:=2, CveVenta:=CveVenta) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||
OcurrioError = True
|
||||
@@ -25802,11 +25802,7 @@ Partial Class Ventas
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
'If Descuentos > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not SubtotalMovto, Descuentos, SerieFolio, 103, ConceptoPartida, FechaPago, IdCuentaContableNoDeducible, -1, CveCliente:=CveCliente, CveVenta:=CveVenta, ImporteMX:=Descuentos, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto) Then
|
||||
' MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
'End If
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 5) Then
|
||||
If ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, 5) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
MsgError = ObjConta.MensajePolizaDescuadre + " " + ObjConta.ValorDiferencia
|
||||
GuardaLogAD($"Ventas/ClientesAbonar | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
@@ -29814,14 +29810,6 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
'If ObjConta.ValidacionPrePolizaCuadre(-1, 2, CveVenta) Then
|
||||
' If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
' If ObjConta.ValorPolizaDescuadre = 2 Then
|
||||
' OcurrioError = True
|
||||
' MensajeError = ObjConta.MensajePolizaDescuadre
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
Catch ex As Exception
|
||||
OcurrioError = True
|
||||
OnError("Ocurrió un error al guardar la cotización", ex)
|
||||
|
||||
Reference in New Issue
Block a user