-- al editar remision, que si tiene salida, no permita cambiar el producto
This commit is contained in:
@@ -2090,54 +2090,82 @@ Partial Class Bancos_PopIEVentas
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||
|
||||
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
|
||||
TimpocambioGeneral = TCImpuestos
|
||||
Dim tImporteVenta, tImportePago, Diferencia As Decimal
|
||||
ImporteMovimiento = 0
|
||||
|
||||
Dim Diferencia As Decimal = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVentaValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
Diferencia -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
Diferencia += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
Diferencia += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
Diferencia -= ((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
Diferencia = Math.Round(Diferencia, 2)
|
||||
If CveMonedaVenta = 1 And CveMoneda = 2 Then
|
||||
'factura pesos, pago en dolares
|
||||
tImporteVenta = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVenta).RoundSQL
|
||||
tImportePago = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVenta / tipoCambioPago).RoundSQL
|
||||
ElseIf CveMonedaVenta = 2 And CveMoneda = 2 Then
|
||||
'factura dolares, pago en dolares
|
||||
tImporteVenta = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVenta).RoundSQL
|
||||
tImportePago = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago).RoundSQL
|
||||
ElseIf CveMonedaVenta = 2 And CveMoneda = 1 Then
|
||||
'factura dolares, pago en pesos
|
||||
tImporteVenta = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVenta).RoundSQL
|
||||
tImportePago = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago).RoundSQL
|
||||
End If
|
||||
|
||||
If tImporteVenta <> tImportePago Then
|
||||
If tImporteVenta < tImportePago Then
|
||||
CveConcepto = 64
|
||||
Else
|
||||
CveConcepto = 65
|
||||
End If
|
||||
Diferencia = Math.Abs(tImporteVenta - tImportePago)
|
||||
End If
|
||||
|
||||
' si tiene funcionalidad para que tome el TC de pago, que solo afecta a los impuestos
|
||||
If FuncionalidadFluctuacionImpuestos Then
|
||||
Dim TCImpuestos As Decimal = tipoCambioPago
|
||||
TimpocambioGeneral = TCImpuestos
|
||||
|
||||
Diferencia -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
Diferencia += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
Diferencia += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
Diferencia -= ((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
Diferencia = Math.Round(Diferencia, 2)
|
||||
End If
|
||||
|
||||
|
||||
'' se considera, las diferencias, y no el tipo de cambio, por el caso de las fluctuaciones
|
||||
|
||||
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa
|
||||
If Diferencia < 0 AndAlso CveMonedaVenta = 2 Then
|
||||
ImporteMovimiento = Math.Abs(Diferencia)
|
||||
ImporteMX = ImporteMovimiento
|
||||
End If
|
||||
'If Diferencia < 0 AndAlso CveMonedaVenta = 2 Then
|
||||
' ImporteMovimiento = Math.Abs(Diferencia)
|
||||
' ImporteMX = ImporteMovimiento
|
||||
'End If
|
||||
Else
|
||||
ImporteMovimiento = 0
|
||||
End If
|
||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
|
||||
Case 65 'Perdida
|
||||
If CveMoneda <> 1 OrElse CveMonedaVenta <> 1 Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
'Case 65 'Perdida
|
||||
' If CveMoneda <> 1 OrElse CveMonedaVenta <> 1 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
' CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
|
||||
Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
|
||||
TimpocambioGeneral = TCImpuestos
|
||||
' Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta)
|
||||
' TimpocambioGeneral = TCImpuestos
|
||||
|
||||
|
||||
Dim Diferencia As Decimal = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVentaValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
Diferencia -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
Diferencia += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
Diferencia += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
Diferencia -= ((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
Diferencia = Math.Round(Diferencia, 2)
|
||||
' Dim Diferencia As Decimal = ((MovimientoPagar.Total * PorcentajePago) * tipoCambioVentaValuacion) - ((MovimientoPagar.Total * PorcentajePago) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta
|
||||
' Diferencia -= ((MovimientoPagar.IVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
|
||||
' Diferencia += ((MovimientoPagar.RetIVA * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetIVA * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
|
||||
' Diferencia += ((MovimientoPagar.RetISR * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.RetISR * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
|
||||
' Diferencia -= ((MovimientoPagar.IEPS * PorcentajePago) * tipoCambioVenta) - ((MovimientoPagar.IEPS * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
|
||||
' Diferencia = Math.Round(Diferencia, 2)
|
||||
|
||||
'si la diferencia es negativa es pérdida, si es positiva es ganancia
|
||||
If Diferencia > 0 AndAlso CveMonedaVenta = 2 Then
|
||||
ImporteMovimiento = Math.Abs(Diferencia)
|
||||
ImporteMX = ImporteMovimiento
|
||||
End If
|
||||
Else
|
||||
ImporteMovimiento = 0
|
||||
End If
|
||||
CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
' 'si la diferencia es negativa es pérdida, si es positiva es ganancia
|
||||
' If Diferencia > 0 AndAlso CveMonedaVenta = 2 Then
|
||||
' ImporteMovimiento = Math.Abs(Diferencia)
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' End If
|
||||
' Else
|
||||
' ImporteMovimiento = 0
|
||||
' End If
|
||||
' CveSubProyectoContabilizar = CveSubProyectoVenta
|
||||
|
||||
Case 30
|
||||
If RBLContado.SelectedValue = "1" Then
|
||||
|
||||
Reference in New Issue
Block a user