private void CalculaTotalPagado()
 {
     if (comprasCabBindingSource != null && comprasCabBindingSource.Count > 0)
     {
         decimal importePagado = ServicioComprasPoveedores.CalculaTotalPagado(pagosBindingSource);
         ((DataRowView)comprasCabBindingSource.Current)["ImpPagado"] = importePagado;
     }
 }
        private void CalculaTotalCompra()
        {
            if (comprasCabBindingSource != null && comprasCabBindingSource.Count > 0)
            {
                var totales = ServicioComprasPoveedores.CalculaTotalesCompra(comprasDetBindingSource);

                if (totales != null)
                {
                    ((DataRowView)comprasCabBindingSource.Current)["ImpBase"] = totales.ImporteBase;
                    ((DataRowView)comprasCabBindingSource.Current)["ImpIva"]  = totales.ImporteIVA;
                    ((DataRowView)comprasCabBindingSource.Current)["ImpIRPF"] = totales.ImporteIRPF;
                    ((DataRowView)comprasCabBindingSource.Current)["Importe"] = totales.ImporteTotal;
                }
            }
        }