Validacion de nc
This commit is contained in:
@@ -7220,7 +7220,7 @@
|
||||
if (Chk.checked) {
|
||||
let SaldoMaximoUtilizable = ToDouble(HdnSaldoMaximoUsados.value)
|
||||
let ImportesAsignados = 0;
|
||||
|
||||
|
||||
$('.ImportesRNCCargo').each(function () {
|
||||
if ($(this).context.id != TxtImporte.id) {
|
||||
ImportesAsignados += ToDouble($(this).val());
|
||||
@@ -7235,16 +7235,15 @@
|
||||
TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||
}
|
||||
} else {
|
||||
TxtImporte.value = "";
|
||||
Chk.checked = false;
|
||||
//if (SaldoMaximoUtilizable > 0) {
|
||||
// TxtImporte.value = "";
|
||||
// Chk.checked = false;
|
||||
//} else {
|
||||
// TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||
//}
|
||||
}
|
||||
if (SaldoMaximoUtilizable > 0) {
|
||||
TxtImporte.value = "";
|
||||
Chk.checked = false;
|
||||
} else {
|
||||
TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
TxtImporte.value = "";
|
||||
}
|
||||
|
||||
@@ -10078,6 +10078,11 @@ Partial Class Ventas
|
||||
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
|
||||
End If
|
||||
End If
|
||||
|
||||
If tPS.Length > 1000 Then
|
||||
tPS = tPS.Remove(999, tPS.Length - 1)
|
||||
End If
|
||||
|
||||
'condicionante, especial
|
||||
If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
|
||||
|
||||
@@ -16395,10 +16400,10 @@ Partial Class Ventas
|
||||
Return False
|
||||
End If
|
||||
|
||||
If (Obs.Length + PS.Length > 1000) AndAlso DdlTipoComprobante.SelectedValue <> "Cot" Then
|
||||
Alert(String.Format("El Nombre y observación del producto tiene longitud de {0} caracteres y excede los 1000 caracteres permitidos.", Obs.Length + PS.Length), TipoMensaje.MsgAdvertencia)
|
||||
Return False
|
||||
End If
|
||||
'If (Obs.Length + PS.Length > 1000) AndAlso DdlTipoComprobante.SelectedValue <> "Cot" Then
|
||||
' Alert(String.Format("El Nombre y observación del producto tiene longitud de {0} caracteres y excede los 1000 caracteres permitidos.", Obs.Length + PS.Length), TipoMensaje.MsgAdvertencia)
|
||||
' Return False
|
||||
'End If
|
||||
|
||||
'VALIDA CONCEPTOS EN CERO - YA SE VALIDA ANTES CON FUNCIONALIDAD - A MIRAS DE ELIMINAR - IPP 28 AGOSTO 2017
|
||||
If Not DdlTipoComprobante.SelectedValue.Contiene("Ped", "Ant") Then
|
||||
@@ -24888,6 +24893,7 @@ Partial Class Ventas
|
||||
For Each RNC In ListaNC
|
||||
Dim UltimoRenglonRNC As Integer = 1
|
||||
Dim TotalAcumuladoRNC As Decimal = 0
|
||||
Dim Terminar As Boolean = False
|
||||
|
||||
For Each RowUsado As DataRow In Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}").Rows
|
||||
|
||||
@@ -24911,8 +24917,32 @@ Partial Class Ventas
|
||||
|
||||
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA)
|
||||
|
||||
|
||||
'SI EL IMPORTE ES MAYOR REALIZA EL AJUSTE
|
||||
If TotalAcumuladoRNC > RNC.TotalRemNCAplicado Then
|
||||
Terminar = True
|
||||
'RESTA LO SUMANDO DEL ACUMULADO
|
||||
TotalAcumuladoRNC -= (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
|
||||
|
||||
Dim Diferencia As Decimal = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
|
||||
|
||||
Dim TotalPartida As Decimal = (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
|
||||
|
||||
Dim PorcentajePorAplicar As Decimal = (Diferencia / TotalPartida)
|
||||
|
||||
Cantidad = Cantidad * PorcentajePorAplicar
|
||||
|
||||
TotalCalculableImpuestos = (Cantidad * ImportePU)
|
||||
ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
|
||||
|
||||
|
||||
ImporteTotal = TotalCalculableImpuestos
|
||||
|
||||
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
|
||||
End If
|
||||
|
||||
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
|
||||
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then
|
||||
If UltimoRenglonRNC = Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}").Rows.Count OrElse Terminar Then
|
||||
Dim Ajuste As Decimal = 0
|
||||
If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
|
||||
Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
|
||||
@@ -24927,6 +24957,10 @@ Partial Class Ventas
|
||||
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, 0, ImporteRetIVA,
|
||||
0, ImporteRetISR, 0, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
|
||||
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalleRNC").ToString().ToEntero())
|
||||
|
||||
If Terminar Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Next
|
||||
@@ -28043,7 +28077,7 @@ Partial Class Ventas
|
||||
End Select
|
||||
|
||||
If ChkMostarProductosRNC.Checked Then
|
||||
|
||||
Dim TotalAcumulado As Decimal = 0
|
||||
Me.AplicaRNCXDetalle = True
|
||||
|
||||
For Each GvRow As GridViewRow In GvRemisionesNCDetalle.Rows
|
||||
@@ -28051,12 +28085,13 @@ Partial Class Ventas
|
||||
If GvRow.FCCheckBox("ChkAplicar").Checked Then
|
||||
Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}")
|
||||
For Each row In Rows
|
||||
row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToEntero()
|
||||
row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
|
||||
TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Dim TerminarCiclo As Boolean = False
|
||||
|
||||
For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
|
||||
Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa)
|
||||
@@ -28082,6 +28117,14 @@ Partial Class Ventas
|
||||
|
||||
End If
|
||||
Next
|
||||
TotalAcumulado += TotalRNC
|
||||
|
||||
'SI SE EXECE RESTA AL ULTIMO
|
||||
If TotalAcumulado > LtlSMU.Text.ToDecimal() Then
|
||||
TerminarCiclo = True
|
||||
TotalAcumulado -= TotalRNC
|
||||
TotalRNC = LtlSMU.Text.ToDecimal() - TotalAcumulado
|
||||
End If
|
||||
|
||||
RemNC.TotalRemNCAplicado = TotalRNC
|
||||
'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO
|
||||
@@ -28095,6 +28138,10 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
ListaRemisionesNC.Add(RemNC)
|
||||
|
||||
If TerminarCiclo Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user