From 2dba5e96b5e03ecbbb978c24d5f50c5c85dce258 Mon Sep 17 00:00:00 2001 From: Nicolas Bally Date: Tue, 12 Mar 2019 20:10:40 +0100 Subject: [PATCH] suite --- app/controllers/admin/p_documents_controller.rb | 2 +- app/models/p_document.rb | 12 +++++++++++- app/views/admin/p_documents/_general.html.haml | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/p_documents_controller.rb b/app/controllers/admin/p_documents_controller.rb index ba927e5..a368552 100755 --- a/app/controllers/admin/p_documents_controller.rb +++ b/app/controllers/admin/p_documents_controller.rb @@ -26,7 +26,7 @@ class Admin::PDocumentsController < ApplicationController params[:inline] = true - if !params[:html] + if !params[:html] and !Rails.env.development? @temp_file = "#{Rails.root}/pdf/p_documents/#{@p_document.d_number}_temp.pdf" @final_file = "#{Rails.root}/pdf/p_documents/#{@p_document.d_number}.pdf" diff --git a/app/models/p_document.rb b/app/models/p_document.rb index f1e1918..43b54a3 100644 --- a/app/models/p_document.rb +++ b/app/models/p_document.rb @@ -299,11 +299,21 @@ class PDocument < ActiveRecord::Base if self.comptant d else - d + self.payment_delais.to_i.day + + puts self.payment_delais.to_i + d = d + self.payment_delais.to_i.days + + puts d end if self.payment_fin_de_mois d = d.end_of_month + puts d + end + + puts d + + #fsdsdf = sfsfd return d end diff --git a/app/views/admin/p_documents/_general.html.haml b/app/views/admin/p_documents/_general.html.haml index d7ba292..4c3244e 100644 --- a/app/views/admin/p_documents/_general.html.haml +++ b/app/views/admin/p_documents/_general.html.haml @@ -130,12 +130,13 @@ -else =@p_document.payment_delais.to_i -if @p_document.payment_fin_de_mois - jours fin de moi + jours fin de mois -else jours nets %td{:style => "width:100px"} =l @p_document.echeance, :format => :date + -if @element.p_customer.p_contacts.count > 0