diff --git a/app/models/p_customer.rb b/app/models/p_customer.rb index 030d011..5f8b579 100644 --- a/app/models/p_customer.rb +++ b/app/models/p_customer.rb @@ -188,7 +188,7 @@ class PCustomer < ActiveRecord::Base end - + self.update_caches end diff --git a/app/models/p_payment_document.rb b/app/models/p_payment_document.rb index addb3a0..411ca2e 100644 --- a/app/models/p_payment_document.rb +++ b/app/models/p_payment_document.rb @@ -35,7 +35,7 @@ class PPaymentDocument < ActiveRecord::Base if sum.round(2) > self.p_document.totals[:total_ttc].to_f.round(2) - errors.add(:amount, "Ne doit pas dépasser le montant de la somme restant dues (#{self.p_document.totals[:total_ttc].to_f - siblings_payments_total})") + errors.add(:amount, "Ne doit pas dépasser le montant de la somme restant dues (#{(self.p_document.totals[:total_ttc].to_f.round(2) - siblings_payments_total.to_f.round(2)).round(2)})") end