Correcion BDH

This commit is contained in:
2020-10-16 12:12:33 -07:00
parent fa5d2042e2
commit d7d0dd0dcd
6 changed files with 436 additions and 276 deletions

View File

@@ -7182,6 +7182,38 @@
}
}
function CalculaSaldoRNCBonChk(TxtImporte, Saldo, Chk) {
if (Chk.checked) {
TxtImporte.value = FormatoNumero(Saldo, 2);
} else {
TxtImporte.value = "";
}
}
function LimitaSaldoRNCBonChk(TxtImporte, Saldo) {
var Importe = 0;
if (TxtImporte.value.includes('.')) {
return;
}
if (TxtImporte.value.includes(',')) {
return;
}
var regex = new RegExp("^[-+]?[0-9]+\.[0-9]+$");
if (regex.test(TxtImporte.value)) {
if (TxtImporte.value != '') {
Importe = parseFloat(TxtImporte.value);
}
if (Importe > Saldo) {
TxtImporte.value = FormatoNumero(Saldo, 2);
} else {
TxtImporte.value = FormatoNumero(Importe, 2);;
}
}
}
function CalculaTotalChk(Total, SubTotal, TxtTotalGv, TxtImporte, Saldo, Porcentaje, Chk) {
var Importe = 0, ImporteSinPorcentaje = 0;
Importe = ($('#C_DdlNCNivelImporte').val() == "1" ? Total : SubTotal);
@@ -7629,7 +7661,7 @@
$get("TxtCambio").value = "0.00";
}
$get("TxtImporteContado").value = total;
$get("TxtImporteContado").value = total - totalRNC;
}
// ****************************************************************************************************************************************************************************

View File

@@ -1791,6 +1791,15 @@ Partial Class Ventas
End Set
End Property
Private Property SerieVenta As String
Get
Return IfNull(ViewState("SerieVenta"), "", ViewState("SerieVenta")).ToString()
End Get
Set(value As String)
ViewState("SerieVenta") = value
End Set
End Property
#End Region
'#Region "AuxiliarConta"
@@ -4070,7 +4079,9 @@ Partial Class Ventas
ViewState("FolioFiscal") = DbRowVenta("FolioFiscal").ToString()
LblSerie.Text = DbRowVenta("Serie").ToString()
SerieVenta = DbRowVenta("Serie").ToString()
LblSerie.Text = SerieVenta
ViewState("Serie") = DbRowVenta("Serie").ToString()
ViewState("Folio") = DbRowVenta("Folio").ToString().ToEntero()
TxtFolio.Text = DbRowVenta("Folio").ToString()
@@ -15071,7 +15082,11 @@ Partial Class Ventas
'ViewState("NumAprobacion") = CLng(DT.Rows(0)("Aprobacion").ToString())
'ViewState("FechaAprobacion") = DT.Rows(0)("FechaAprobacion").ToString().ToDate
ViewState("FolioActual") = DT.Rows(0)("FActual").ToString()
LblSerie.Text = DT.Rows(0)("Serie").ToString()
If UsuarioActual.CveEmpresa = 140 AndAlso CveVenta > 0 AndAlso Not EsCreaApartirDe AndAlso Not String.IsNullOrEmpty(SerieVenta) Then
LblSerie.Text = SerieVenta
Else
LblSerie.Text = DT.Rows(0)("Serie").ToString()
End If
TxtFolio.Text = DT.Rows(0)("FActual").ToString()
BtnCrearApartirDe.Enabled = True
BtnEmitirImprimir.Visible = True
@@ -15126,7 +15141,13 @@ Partial Class Ventas
'ViewState("SubProyectoPorcentajeIVA") = dr("IVA")
ViewState("TipoFormato") = dr("TipoFormato")
ViewState("Serie") = dr("Serie")
LblSerie.Text = dr("Serie").ToString()
If UsuarioActual.CveEmpresa = 140 AndAlso Me.CveVenta > 0 AndAlso Not EsCreaApartirDe AndAlso Not String.IsNullOrEmpty(SerieVenta) Then
LblSerie.Text = SerieVenta
Else
LblSerie.Text = dr("Serie").ToString()
End If
If SerieXML <> "" Then LblSerie.Text = SerieXML
Dim CveSubProyecto As Integer = GetSubProyectoSucursal()
If CveSubProyecto > 0 Then CargaSubProyecto(CveSubProyecto)
@@ -23283,8 +23304,8 @@ Partial Class Ventas
End Sub
Protected Sub GvDescNCBonificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCBonificaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
End If
End Sub
@@ -26577,7 +26598,7 @@ Partial Class Ventas
For Each drow As DataRow In factura.DtDetalle.Rows
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, 2, CveVenta, UsuarioActual.CveUsuario,
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0D, "") Then
Resultado = False
Exit For