Correciones de usados

This commit is contained in:
2021-08-10 19:58:55 -07:00
parent d0a06d1330
commit 573254bc63

View File

@@ -25210,26 +25210,38 @@ Partial Class Ventas
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If CargarSoloGarantias Then
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
If SaldoMaximo > 0 Then
HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
HdnSaldoMaximoUsados.Value = SaldoMaximo.ToString()
LtlSMU.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
Else
'DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If SaldoMaximo > 0 Then
HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
Else
'DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
ObjAcum.Dispose()
End If
ObjAcum.Dispose()
End If
Else
HdnSaldoMaximoUsados.Value = "0"
@@ -25325,18 +25337,30 @@ Partial Class Ventas
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
If CargaSoloGarantias Then
Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Total", "TipoRNC = 1")
If SaldoMaximo > 0 Then
HdnSaldoMaximoUsados.Value = SaldoMaximo.ToString()
LtlSMU.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
Else
'DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
'DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
ObjAcum.Dispose()
End If
ObjAcum.Dispose()
End If
UpModalRemisionesNC.Update()
@@ -25422,16 +25446,16 @@ Partial Class Ventas
DtDetalleFactura.Dispose()
Else
Dim ObjAcum2 As New ClsAcumuladores
If ObjAcum2.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum2.DtResultados.Rows(6)
HdnSMUBon.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMUBon.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0"
If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing Then
Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo")
If SaldoMaximo > 0 Then
HdnSMUBon.Value = SaldoMaximo.ToString()
LtlSMUBon.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0"
End If
End If
ObjAcum2.Dispose()
End If
UpModalRemisionesNC.Update()
@@ -25559,16 +25583,14 @@ Partial Class Ventas
DtDetalleFactura.Dispose()
Else
Dim ObjAcum2 As New ClsAcumuladores
If ObjAcum2.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum2.DtResultados.Rows(6)
HdnSMUBon.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMUBon.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo")
If SaldoMaximo > 0 Then
HdnSMUBon.Value = SaldoMaximo.ToString()
LtlSMUBon.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0"
End If
ObjAcum2.Dispose()
End If
@@ -26333,8 +26355,14 @@ Partial Class Ventas
'SI ES ACUMULADOR LAS OBSERVACIOENS DEBEN SER EL NOMBRE DEL ACUMULADOR
If GlobalDTAcumTamaños().FiltroPrimero($"CvePSCargo = {CvePSCargo}") IsNot Nothing Then
Obs = RowUsado("CodigoPS").ToString()
'Else
' Obs = RowUsado("Obs").ToString()
End If
'SI TIENE BCI EN LAS OBSERVACIONES AGREGARLO A LA FACTURA
If Not String.IsNullOrEmpty(RowUsado("Observaciones").ToString()) Then
If String.IsNullOrEmpty(Obs) Then
Obs = RowUsado("Observaciones").ToString()
Else
Obs = String.Format("{0} - {1}", Obs, RowUsado("Observaciones").ToString())
End If
End If
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then