Correciones de usados

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

View File

@@ -25209,6 +25209,16 @@ Partial Class Ventas
Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal() Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
If CargarSoloGarantias Then
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
If SaldoMaximo > 0 Then
HdnSaldoMaximoUsados.Value = SaldoMaximo.ToString()
LtlSMU.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
Else Else
Dim ObjAcum As New ClsAcumuladores Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
@@ -25231,6 +25241,8 @@ Partial Class Ventas
End If End If
ObjAcum.Dispose() ObjAcum.Dispose()
End If End If
End If
Else Else
HdnSaldoMaximoUsados.Value = "0" HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0" LtlSMU.Text = "0"
@@ -25324,6 +25336,16 @@ Partial Class Ventas
LtlSMU.Text = "0" LtlSMU.Text = "0"
End If End If
Else
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 Else
Dim ObjAcum As New ClsAcumuladores Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
@@ -25339,6 +25361,8 @@ Partial Class Ventas
ObjAcum.Dispose() ObjAcum.Dispose()
End If End If
End If
UpModalRemisionesNC.Update() UpModalRemisionesNC.Update()
UpDescNC.Update() UpDescNC.Update()
End Sub End Sub
@@ -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
ObjAcum2.Dispose() End If
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