This commit is contained in:
Nicolas Bally 2019-07-03 15:37:00 +02:00
parent 4860ad1290
commit f642bb86db
4 changed files with 18 additions and 3 deletions

View File

@ -347,7 +347,11 @@ class PDocument < ActiveRecord::Base
def echeance
d = self.created_at
if self.created_at?
d = self.created_at
else
d = Time.now
end
if self.comptant
d
else

View File

@ -69,7 +69,7 @@ class PPayment < ActiveRecord::Base
self.p_payment_documents.each do |ppd|
r += ppd.amount.to_f
end
return r
return r.round(2)
end
def paid_date_needed?

View File

@ -119,11 +119,22 @@
%table.table
%tr
%th Date
%th Offre
%th Client
%th Type
%th Numéro
%th Total HT
%th Total TTC
%th
Payée
%th Solde
%th Echéance
%th Jours de retard
%th
%tbody#p_customer_sheets_rows

View File

@ -84,7 +84,7 @@
-if !@p_customer_sheet
-if !@p_customer_sheet or true
%td
=link_to "##{p_document.element.id}", admin_p_customer_sheet_path(p_document.element)