8 -COMO CANCELAR DE MUCHAS PROMOCIONES _siguiente semana (Acciones inactivar), Proveedores abonar RNC remision generada ya existe

This commit is contained in:
rakcsle
2025-01-31 15:11:34 -07:00
parent 44f9fbecf7
commit abeea658a4
4 changed files with 141 additions and 8 deletions

View File

@@ -858,6 +858,7 @@ Partial Class Bancos_ProveedoresAbonar
Pago.CveMonedaPago = CveMoneda
'inserto las compras que voy a pagar
Dim nRow As Integer = 1
For Each gvr As GridViewRow In GvCxP.Rows
If gvr.FCCheckBox("Chk").Checked Then
@@ -963,7 +964,7 @@ Partial Class Bancos_ProveedoresAbonar
If serieFolioArray.Length = 2 Then
SerieRNC = serieFolioArray(0)
FolioRNC = serieFolioArray(1)
SerieFolioRNC = $"{FolioRNC}-D-{SerieRNC = serieFolioArray(0)}"
SerieFolioRNC = $"D-{SerieRNC}-{ FolioRNC}"
Else
FolioRNC = serieFolioArray(0)
@@ -992,9 +993,19 @@ Partial Class Bancos_ProveedoresAbonar
End If
Dim ExisteRNC As Boolean = False
If ObjComp.GetCompras(-1, $"D-{SerieRNC}", FolioRNC, CveProveedor, -1, UsuarioActual.CveEmpresa) Then
Dim dtRNC As DataTable = ObjComp.DtResultados.FiltraParametros(" TipoDocto ='RNC' ")
If dtRNC.Rows.Count > 0 Then
ExisteRNC = True
SerieFolioRNC = $"D{nRow}-{SerieRNC}-{ FolioRNC}"
End If
End If
Dim CveCompraRNC As Integer = GeneraRNC(Descuento, ObjComp.IniciaTransacSQL, gvr.DataKey("CveCompra").ToEntero, CompraActual, ObjMov, CvePrePoliza, CveProveedor, HplProveedor.Text, TxtFechaDocumento.Text.ToDate,
$"Remisión Nota de Crédito pago {gvr.DataKey("SerieFolio").ToString}", gvr.DataKey("CveMoneda").ToEntero, TxtTC.Text.ToDecimal, SerieRNC, FolioRNC, PorcentajeIVA:=PorcentajeIVA,
CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero)
CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, nRow:=nRow, ExisteRNC:=ExisteRNC)
If CveCompraRNC > 0 Then
@@ -1012,6 +1023,7 @@ Partial Class Bancos_ProveedoresAbonar
End If
nRow = nRow + 1
Next
Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145, 13, 83)
@@ -1956,7 +1968,7 @@ Partial Class Bancos_ProveedoresAbonar
Public Function GeneraRNC(ImporteRNC As Decimal, ByRef sqltransaccion As SqlTransaction, CveCompraAmortizada As Integer, ByRef CompraActual As Compra, ByRef ObjConta As ClsContabilidad, CvePrePoliza As Integer,
CveProveedor As Integer, NombreProveedor As String, Fecha As Date, Descripcion As String, CveMoneda As Integer, TipoCambio As Decimal, Serie As String, Folio As String, Optional EsDRMN As Boolean = False,
Optional TmpListadoPS As DataTable = Nothing, Optional PorcentajeIVA As Decimal = 0, Optional CveSubProyecto As Integer = -1) As Integer
Optional TmpListadoPS As DataTable = Nothing, Optional PorcentajeIVA As Decimal = 0, Optional CveSubProyecto As Integer = -1, Optional nRow As Integer = -1, Optional ExisteRNC As Boolean = False) As Integer
Dim CveCompraRNC As Integer = -1
Dim respuesta As Boolean = True
'Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal
@@ -1990,7 +2002,7 @@ Partial Class Bancos_ProveedoresAbonar
.Fecha = Fecha,
.CveMoneda = CveMoneda,
.TipoCambio = If(CveMoneda = 1, 1, TipoCambio),
.Serie = $"D-{Serie}",
.Serie = If(ExisteRNC, $"D{nRow}-{Serie}", $"D-{Serie}"),
.Folio = Folio,
.CveCompraAmortizacion = CveCompraAmortizada,
.CveCompraRelacionada = CveCompraAmortizada