This commit is contained in:
rakcsle
2021-03-09 15:41:16 -07:00
86 changed files with 22837 additions and 19697 deletions

View File

@@ -6840,14 +6840,22 @@ Partial Class Compras_Compras
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'cuando es emp acumuladora
Dim Valor = (From dr1 In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").AsEnumerable()
Join dr2 In TmpDT.AsEnumerable On dr1.Field(Of Integer)("CvePSCargo") Equals dr2.Field(Of Integer)("CvePS")
Select New With
{
.Total = dr2.Field(Of Double)("Total")
}).Sum(Function(item) item.Total)
Dim Valor As Decimal = 0
For Each RowAcum As DataRow In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").Rows
Dim TotalTamanio = TmpDT.FiltroPrimeroValor("Total", $"CvePS={RowAcum("CvePSCargo")}").ToDecimal()
If TotalTamanio > 0 Then
Valor += TotalTamanio
End If
Next
importeMovimiento += Valor.ToDecimal
'Dim Valor = (From dr1 In GlobalDTAcumTamaños().FiltraParametros("CveEmpresa = 140").AsEnumerable()
' Join dr2 In TmpDT.AsEnumerable On dr1.Field(Of Integer)("CvePSCargo") Equals dr2.Field(Of Integer)("CvePS")
' Select New With
' {
' .Total = dr2.Field(Of Double)("Total")
' }).Sum(Function(item) item.Total)
importeMovimiento += Valor
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
End If
@@ -19108,21 +19116,24 @@ Partial Class Compras_Compras
CargaAnticipos(CveProveedor, If(ChkNCInv.Checked, "NC", "-1"))
UpAnticipos.Update()
End Sub
Private Sub CargaNCINV()
Private Sub CargaNCINV(Optional ShowAllPendientes As Boolean = False)
Dim SaldoAnticipo = 0.0
Dim CveCompras As String = ""
If ChkNCInvNC.Checked Then
For Each gvr As GridViewRow In GvFacturaNC.Rows
If gvr.FCCheckBox("ChkFacturaNC") IsNot Nothing AndAlso gvr.FCCheckBox("ChkFacturaNC").Checked Then
SaldoAnticipo += gvr.FCTextBox("TxtImporte").Text.ToDouble
If CveCompras <> "" Then
CveCompras = $"{CveCompras},{gvr.DataKey("CveCompra").ToString}"
Else
CveCompras = gvr.DataKey("CveCompra").ToString
If Not ShowAllPendientes Then
For Each gvr As GridViewRow In GvFacturaNC.Rows
If gvr.FCCheckBox("ChkFacturaNC") IsNot Nothing AndAlso gvr.FCCheckBox("ChkFacturaNC").Checked Then
SaldoAnticipo += gvr.FCTextBox("TxtImporte").Text.ToDouble
If CveCompras <> "" Then
CveCompras = $"{CveCompras},{gvr.DataKey("CveCompra").ToString}"
Else
CveCompras = gvr.DataKey("CveCompra").ToString
End If
End If
End If
Next
Next
End If
Else
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox("Chk") IsNot Nothing AndAlso gvr.FCCheckBox("Chk").Checked Then
@@ -19137,7 +19148,6 @@ Private Sub CargaNCINV()
End If
LbNCInvSaldo.Text = SaldoAnticipo.FormatoNumero()
LbNCInvSaldoAlmacen.Text = SaldoAnticipo.FormatoNumero()
@@ -19154,11 +19164,14 @@ Private Sub CargaNCINV()
GVNCInv.DataSource = DtPendientesAlmacen
GVNCInv.DataBind()
If Not String.IsNullOrEmpty(CveCompras) Then
DtPendientesAlmacen = DtPendientesAlmacen.FiltraParametros($"CveCompra IN ({CveCompras})")
End If
GVNCInvAlmacen.DataSource = DtPendientesAlmacen
GVNCInvAlmacen.DataBind()
End If
Else
If ChkNCInvNC.Checked Then
Alert("Niguna de las facturas seleccionadas cuenta con productos pendientes de darles entrada.", TipoMensaje.MsgAdvertencia)
@@ -20418,7 +20431,7 @@ Private Sub CargaNCINV()
Protected Sub BtnFacturaNC_Click(sender As Object, e As EventArgs)
If ChkNCInvNC.Checked Then
CargaNCINV()
CargaNCINV(ShowAllPendientes:=False)
TabModoNC.ActiveTabIndex = 1
TabModoNC_ActiveTabChanged(TabModoNC, EventArgs.Empty)
@@ -20765,9 +20778,11 @@ Private Sub CargaNCINV()
End Sub
Protected Sub ChkMostrarTodos_CheckedChanged(sender As Object, e As EventArgs)
CargaNCINV(ShowAllPendientes:=True)
UpFacturaNC.Update()
UpMostrarTodos.Update()
End Sub
End Class
Public Class MMensajeDevolucion