suite
This commit is contained in:
parent
05ed715d34
commit
f5aa994832
@ -30,10 +30,10 @@ class PPaymentDocument < ActiveRecord::Base
|
||||
if self.p_document
|
||||
|
||||
|
||||
sum = self.siblings_payments_total + self.amount.to_f
|
||||
sum = self.siblings_payments_total.to_f + self.amount.to_f
|
||||
|
||||
|
||||
if sum > self.p_document.totals[:total_ttc].to_f
|
||||
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})")
|
||||
end
|
||||
|
@ -1,7 +1,6 @@
|
||||
#p_payment_form_wrapper
|
||||
|
||||
.content
|
||||
=debug @p_payment.errors.messages
|
||||
=semantic_form_for [:admin, @p_payment], :remote => true, :html => {:id => "p_payment_general_form",:onsubmit => "$this = $(this); if ($this.data().isSubmitted) { alert('La sauvegarde est en cours, merci de patienter.');return false; } $this.data().isSubmitted = true; return true;"} do |f|
|
||||
-@p_customer = @p_payment.p_customer if @p_payment.p_customer
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user