-- si es nc, vinculada a una devolución y no s va a recibir..

This commit is contained in:
2023-07-29 14:58:57 -07:00
parent a2237fd270
commit 071bebee80

View File

@@ -6635,7 +6635,7 @@ Partial Class Compras_Compras
End If
End If
Next
Dim diferenciaTransito As Decimal = 0
For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
Dim importeMNTemp As Decimal = 0
@@ -6643,6 +6643,7 @@ Partial Class Compras_Compras
ErrorMovInv = True
Exit For
End If
Dim DifTC As Decimal = tipoCambioActual - Gvr.DataKey("TipoCambio").ToDecimal
'diferenciaTransito = DifTC * (Gvr.DataKey("IVA").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal)
'diferenciaTransito += DifTC * (Gvr.DataKey("IEPSPS").ToDecimal / Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDecimal)
@@ -6654,23 +6655,28 @@ Partial Class Compras_Compras
End If
End If
Next
'si se marca que no se va a recibir, falta validación
If Not ErrorMovInv AndAlso Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 1, UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Dim diferenciaTransito As Decimal = 0
'la diferencia se va aplicar sobre los
'Dim diferenciaTransito As Decimal = ImporteTransito - importeMN.RoundSQL
If diferenciaTransito <> 0 Then
Dim tCveCon As Integer = 65
If diferenciaTransito < 0 Then
tCveCon = 64
End If
diferenciaTransito = Math.Abs(diferenciaTransito)
Dim tCveCon As Integer = 65
If diferenciaTransito < 0 Then
tCveCon = 64
End If
diferenciaTransito = Math.Abs(diferenciaTransito)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, If(tCveCon = 64, True, False), diferenciaTransito, Referencia, tCveCon, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=diferenciaTransito, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=1, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
ErrorPrepoliza = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, If(tCveCon = 64, True, False), diferenciaTransito, Referencia, tCveCon, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=diferenciaTransito, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), TipoCambio:=1, CveMovimientoAlmacen:=CveMovimientoDevolucion, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
ErrorPrepoliza = True
End If
End If
End If
Else
Dim DiferenciaDevolucion As Decimal = importeMovimiento - TotalRealDevolucion
Else
Dim DiferenciaDevolucion As Decimal = importeMovimiento - TotalRealDevolucion
If TotalRealDevolucion <> 0 Then
If Math.Abs(DiferenciaDevolucion) > 0 Then