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