Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

no comment

  • Loading branch information...
commit 203537e26e0bcc371ddfae85af2af2b0b63ad6ff 1 parent a559a8e
larcara@gmail.com authored
Showing with 371 additions and 228 deletions.
  1. +2 −1  app/controllers/application_controller.rb
  2. +1 −1  app/controllers/requirements_controller.rb
  3. +21 −8 app/controllers/suppliers_controller.rb
  4. +14 −6 app/models/admin_mailer.rb
  5. +2 −2 app/models/attachment.rb
  6. +1 −1  app/models/contract.rb
  7. +3 −1 app/models/proposal.rb
  8. +1 −1  app/models/request_for_proposal.rb
  9. +6 −1 app/models/requirement.rb
  10. +20 −17 app/models/supplier.rb
  11. +12 −4 app/models/supplier_category.rb
  12. +44 −8 app/models/supplier_requirement.rb
  13. +1 −1  app/views/addresses/_form.html.erb
  14. +1 −1  app/views/addresses/index.html.erb
  15. +1 −1  app/views/contacts/_form.html.erb
  16. +3 −1 app/views/contracts/_form.html.erb
  17. +4 −4 app/views/contracts/index.html.erb
  18. +5 −5 app/views/devise/mailer/reset_password_instructions.html.erb
  19. +2 −2 app/views/devise/passwords/new.html.erb
  20. +5 −8 app/views/devise/sessions/new.html.erb
  21. +6 −6 app/views/devise/shared/_links.erb
  22. +6 −0 app/views/home/_requisiti_incompleti.html.erb
  23. +4 −1 app/views/home/index.html.erb
  24. +2 −2 app/views/proposals/_form.html.erb
  25. +2 −2 app/views/proposals/proposals_da_valutare.html.haml
  26. +2 −2 app/views/request_for_proposals/offerte_ricevute.html.haml
  27. +1 −1  app/views/scores/_form.html.erb
  28. +1 −1  app/views/supplier_user/passwords/edit.html.erb
  29. +7 −10 app/views/supplier_user/sessions/new.html.erb
  30. +38 −11 app/views/suppliers/_invito.html.erb
  31. +5 −4 app/views/suppliers/_requirement_row.html.erb
  32. +78 −0 app/views/suppliers/_requirement_scaduto.html.erb
  33. +3 −3 app/views/suppliers/index.html.erb
  34. +2 −2 app/views/suppliers/monitoraggio.html.haml
  35. +5 −4 app/views/suppliers/nuova_visura.html.haml
  36. +6 −0 app/views/suppliers/requisiti.html.erb
  37. +38 −34 app/views/suppliers/show.html.haml
  38. +14 −70 app/views/suppliers/stampa.html.haml
  39. +2 −1  db/schema.rb
View
3  app/controllers/application_controller.rb
@@ -58,7 +58,8 @@ def default_url_options(options={})
ActionMailer::Base.smtp_settings=Setting["general|smtp_settings"].values
ActionMailer::Base.default_url_options = Setting["general|default_url_options"].values
-
+ @@controllo_requisiti ||={}
+ @@controllo_requisiti[Date.today] ||= (SupplierRequirement.invalida_requisiti_scaduti! && SupplierRequirement.controlla_requisiti_scaduti!)
#ActionMailer::Base.smtp_settings=cbt_setting
View
2  app/controllers/requirements_controller.rb
@@ -2,7 +2,7 @@ class RequirementsController < ApplicationController
# GET /requirements
# GET /requirements.json
def index
- @requirements = Requirement.order(:description)
+ @requirements = Requirement.attivi.order(:description)
respond_to do |format|
format.html # index.html.erb
View
29 app/controllers/suppliers_controller.rb
@@ -12,8 +12,14 @@ def create
@supplier = Supplier.create(params[:supplier])
respond_to do |format|
if @supplier.save
- format.html { redirect_to (@supplier.new? ? root_path() : edit_supplier_path(@supplier)), notice: 'Supplier was successfully updated.' }
- format.json { head :no_content }
+ if user_signed_in?
+ format.html { redirect_to supplier_path(@supplier), notice: t(:supplier_successfully_update) }
+ format.json { head :no_content }
+ elsif supplier_user_signed_in?
+ format.html { redirect_to (@supplier.new? ? root_path() : edit_supplier_path(@supplier)), notice: t(:supplier_successfully_update) }
+ format.json { head :no_content }
+ end
+
else
format.html { render action: "edit" }
format.json { render json: @supplier.errors, status: :unprocessable_entity }
@@ -100,9 +106,14 @@ def update
respond_to do |format|
if @supplier.update_attributes(params[:supplier])
+ if user_signed_in?
+ format.html { redirect_to supplier_path(@supplier), notice: t(:supplier_successfully_update) }
+ format.json { head :no_content }
+ elsif supplier_user_signed_in?
+ format.html { redirect_to (@supplier.new? ? root_path() : edit_supplier_path(@supplier)), notice: t(:supplier_successfully_update) }
+ format.json { head :no_content }
+ end
- format.html { redirect_to (@supplier.new? ? root_path() : edit_supplier_path(@supplier)), notice: t(:supplier_successfully_update) }
- format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @supplier.errors, status: :unprocessable_entity }
@@ -130,19 +141,21 @@ def categorie
end
def requisiti
- @general_requirements = Requirement.generali.order("description")
- @category_requirements=Requirement.di_categoria.where(:category_requirements => {:category_id => @supplier.category_ids}).order("description")
+
+ @general_requirements = Requirement.attivi.generali.order("description")
+ @category_requirements=Requirement.attivi.di_categoria.where(:category_requirements => {:category_id => @supplier.category_ids}).order("description")
@general_requirements.each do |r|
- sr=@supplier.supplier_requirements.find_or_create_by_requirement_id(r.id, :due_on=>30.days.from_now.end_of_year){|x| x.build_attachment }
+ sr=@supplier.supplier_requirements.non_scaduti.find_or_create_by_requirement_id(r.id, :due_on=>30.days.from_now.end_of_year){|x| x.build_attachment }
sr.save
end
@category_requirements.each do |r|
next if @general_requirements.include? r
- sr=@supplier.supplier_requirements.find_or_create_by_requirement_id(r.id, :due_on=>30.days.from_now.end_of_year){|x| x.build_attachment }
+ sr=@supplier.supplier_requirements.non_scaduti.find_or_create_by_requirement_id(r.id, :due_on=>30.days.from_now.end_of_year){|x| x.build_attachment }
#sr=@supplier.supplier_requirements.find_or_create_by(:requirement_id=>r.id,{ :due_on=>Time.now.end_of_year})
#sr.build_attachment if sr.attachment.blank?
sr.save
end
+ @requisiti_scaduti= @supplier.supplier_requirements.with_state(:scaduto)
#@new_requirement=@supplier.supplier_requirements.build(:due_on=>Time.now.end_of_year)
#@new_requirement.build_attachment
end
View
20 app/models/admin_mailer.rb
@@ -52,15 +52,15 @@ def invia_bozza_offerta(proposal)
mail(:subject => "Portale Fornitori: inoltro offerta in BOZZA per la #{proposal.request_for_proposal.to_label} di #{proposal.supplier.to_label}",
:body=>"Gent.le Dott.ssa Luporini,
- il fornitore #{proposal.supplier.to_label} ha confermato il caricamento di una BOZZA d'offerta relativa alla RFP #{proposal.request_for_proposal.to_label}.
+ il fornitore #{proposal.supplier.to_label} ha confermato il caricamento di una BOZZA d'offerta relativa alla #{proposal.request_for_proposal.to_label}.
Puo' trovare ogni dettaglio utile per la validazione nella sezione del portale a lei riservata")
end
def invia_offerta_definitiva(proposal)
mail(:subject => "Portale Fornitori: inoltro offerta in DEFINITIVA per la #{proposal.request_for_proposal.to_label} di #{proposal.supplier.to_label}",
:body=>"Gent.le Dott.ssa Luporini,
- il fornitore #{proposal.supplier.to_label} ha confermato il caricamento di una DEFINITIVA d'offerta relativa alla RFP #{proposal.request_for_proposal.to_label}.
- Puo' trovare ogni dettaglio utile per la validazione nella sezione del portale a lei riservata")
+ il fornitore #{proposal.supplier.to_label} ha confermato il caricamento di una offerta relativa alla #{proposal.request_for_proposal.to_label}.
+ Puo' trovare ogni dettaglio utile per la valutazione nella sezione del portale a lei riservata")
end
def invita(supplier_email, testo)
@@ -74,7 +74,7 @@ def invita(supplier_email, testo)
end
def riapri_offerta(proposal)
testo ||= "Gent.le Fornitore,
-l'offerta realitava alla RFP #{proposal.request_for_proposal.to_label} è stata resa nuovamente modificabile.
+l'offerta realitava alla #{proposal.request_for_proposal.to_label} è stata resa nuovamente modificabile.
Si prega di provvederealle necessarie correzioni e sottoporre nuovamente il documento definitivo."
mail(:to=>proposal.supplier.email,
@@ -103,10 +103,10 @@ def notifica_offerta(proposal)
end
def offerta_persa(proposal)
testo ||= "Gent.le Fornitore,
-siamo spiacenti di comunicarle che si è conclusa la valutazione delle offerte per la RFP #{proposal.request_for_proposal.to_label} e la sua offerta NON e' stata selezionata."
+siamo spiacenti di comunicarle che si è conclusa la valutazione delle offerte per la #{proposal.request_for_proposal.to_label} e la sua offerta NON e' stata selezionata."
mail(:to=>proposal.supplier.email,
- :subject => "Portale Fornitori: notifica di conclusione RFP #{proposal.request_for_proposal.to_label}.",
+ :subject => "Portale Fornitori: notifica di conclusione #{proposal.request_for_proposal.to_label}.",
:body=> testo.html_safe,
:cc=>Setting["general|admin_email"].values)
end
@@ -128,4 +128,12 @@ def requisito_scartato(sr)
Si prega pertanto di ricontrollare il valore sottoscritto e la documentazione allegata e procedere con una nuova richiesta di accettazione"
)
end
+ def requisito_scaduto(sr)
+
+ mail(:subject => "Portale Fornitori - scadenza requisito" ,
+ :body =>
+ "Spett #{sr.supplier.ragsociale},
+il requisito <b>#{sr.requirement.description}</b> da Lei sottoscritto il #{sr.accepted_on} con il valore <b>#{sr.requirement.requirement_option(sr.accepted_value) }</b> è scaduto, e deve ripresentare sul portale la documentazione necessaria per una nuova accettazione."
+ )
+ end
end
View
4 app/models/attachment.rb
@@ -46,8 +46,8 @@ def attach=file
self.updated_at=Time.now
end
def save_wr_resource()
- puts self.inspect
- puts "inizializzo il tipo #{attachable_type} sottotipo #{sottotipo}"
+ #puts self.inspect
+ #puts "inizializzo il tipo #{attachable_type} sottotipo #{sottotipo}"
#return if conf[:classe_wr].blank?
#begin
docWR= (id_wr.blank? ? WebRainbow.new("admin","password") : WebRainbow.new("admin","password", id_wr) )
View
2  app/models/contract.rb
@@ -1,5 +1,5 @@
class Contract < ActiveRecord::Base
- attr_accessible :protocol, :protocol_date, :supplier_id, :valid_from, :valid_to , :allegati_attributes
+ attr_accessible :protocol, :protocol_date, :supplier_id, :valid_from, :valid_to , :allegati_attributes, :note
has_many :contract_categories
has_many :proposals
belongs_to :supplier
View
4 app/models/proposal.rb
@@ -134,7 +134,9 @@ def allegato_in_bozza(v,i)
def allegato_definitivo(i)
allegati_definitivi.where(:name=>"Allegato#{i}_VDEF").first
end
-
+ def category
+ request_for_proposal.category
+ end
def id_padre(sottotipo)
if sottotipo.to_s==""
View
2  app/models/request_for_proposal.rb
@@ -24,7 +24,7 @@ class RequestForProposal < ActiveRecord::Base
has_one :documento_rfp, :as=>:attachable, :class_name => Attachment, :conditions => {:sottotipo=>""}
has_one :allegato_principale_rfp, :as=>:attachable, :class_name => Attachment, :conditions => {:sottotipo=>"allegato_principale_rfp"}
- has_many :allegati_generici_rfp, :as=>:attachable, :class_name => Attachment,:conditions => {:sottotipo=>"allegati_generici_rfp"}
+ has_many :allegati_generici_rfp, :as=>:attachable, :class_name => Attachment,:conditions => {:sottotipo=>"allegati_generici_rfp"}, :order=>"id asc"
has_many :attachments, :as=>:attachable , :dependent => :destroy
accepts_nested_attributes_for :request_for_proposal_line, :allow_destroy=>true, :reject_if => :all_blank
View
7 app/models/requirement.rb
@@ -5,10 +5,15 @@ class Requirement < ActiveRecord::Base
has_many :suppliers, :through => :supplier_requirements
has_and_belongs_to_many :category , :join_table => :category_requirements
- default_scope :conditions=>["left(description,1) <> 'x' "]
+ scope :attivi, :conditions=>["left(description,1) <> 'x' "]
scope :obbligatori, :conditions=>["mandatory=:mandatory", :mandatory=>true]
+ def attivo?
+ return false if description.start_with?("x")
+ true
+ end
+
def self.generali
r=Requirement.arel_table
ids=CategoryRequirement.select(:requirement_id).collect(&:requirement_id)
View
37 app/models/supplier.rb
@@ -50,7 +50,7 @@ class Supplier < ActiveRecord::Base
state_machine :state, :initial => :new do
- state :new, :invitato, :potenziale, :idoneo , :non_idoneo , :operativo, :non_operativo
+ state :new, :invitato, :potenziale, :idoneo , :non_idoneo , :operativo, :non_operativo , :cancellato
event :registra do
transition [:new,:potenziale,:invitato] =>same # , :if => lambda {|supplier| !supplier.email.blank? }
end
@@ -60,17 +60,12 @@ class Supplier < ActiveRecord::Base
event :richiedi_iscrizione do
transition [:new,:invitato] =>:potenziale , :if => lambda {|supplier| supplier.requisiti_completi? && supplier.categorie_complete? }
end
- #event :invia_variazioni do
- # transition :da_validare=>same, :idoneo=>same, :non_idoneo=>same, :operativo=>same , :if => lambda {|supplier| supplier.variazioni_da_inviare?}
- #end
- #event :qualifica do
- # transition [:potenziale, :da_validare] => :in_qualificazione
- #end
+
event :accetta do
- transition all - [:idoneo] => :idoneo
+ transition all - [:cancellato,:idoneo] => :idoneo
end
event :scarta do
- transition all - [:operativo, :idoneo] => :non_idoneo
+ transition all - [:cancellato,:operativo, :idoneo] => :non_idoneo
end
event :accetta_variazioni do
transition same => same , :if => lambda {|supplier| supplier.variazioni_da_inviare?}
@@ -79,7 +74,7 @@ class Supplier < ActiveRecord::Base
# transition all - [:operativo] => :da_validare
# end
event :annulla_iscrizione do
- transition all - [:operativo] => :potenziale
+ transition all - [:cancellato,:operativo] => :cancellato
end
event :attiva do
transition :idoneo => :operativo #
@@ -99,27 +94,35 @@ class Supplier < ActiveRecord::Base
transition.rollback if supplier.genera_supplier_user(transition.args.first || supplier.email)==false
end
- #after_transition :on=>:invita do |supplier, transition|
- # supplier.save
- #end
after_transition :on => :accetta_variazioni do |supplier, transition|
Version.where(['supplier_id = ?', supplier.id]).destroy_all
end
before_transition :on=>:attiva do |supplier, transition|
- transition.rollback if supplier.codice.blank?
- supplier.errors[:base] << "Per rendere operativo un fornitore e' necessario aver imputato il codice SAP"
+ if supplier.codice.blank?
+ transition.rollback
+ supplier.errors[:base] << "Per rendere operativo un fornitore e' necessario aver imputato il codice SAP"
+ end
+
end
after_transition :on=>:accetta do |supplier, transition|
AdminMailer.conferma_iscrizione(supplier).deliver
end
+ after_transition :on=>:annulla_iscrizione do |supplier, transition|
+ suser=supplier.supplier_user
+ suser.destroy
+ supplier.supplier_user_id=nil
+ #annullare tutti i requisiti e le categorie
+
+ supplier.save
+ end
end
def self.state_name(state="")
return if state.blank?
- x={:new=>"da invitare", :invitato=>"invitato", :potenziale=>"potenziale", :idoneo=>"idoneo" , :non_idoneo=>"non idoneo" , :operativo=>"operativo", :non_operativo=>"non operativo"}
+ x={:new=>"da invitare", :invitato=>"invitato", :potenziale=>"potenziale", :idoneo=>"idoneo" , :non_idoneo=>"non idoneo" , :operativo=>"operativo", :non_operativo=>"non operativo", :cancellato=>"cancellato"}
x[state.downcase.to_sym]
end
def variazioni_da_inviare?
@@ -142,7 +145,7 @@ def categorie_complete?
def requisiti_completi?
ids_categories=supplier_categories.map{|c| c.category_id}.uniq
ids_requirements=Category.where(:id=>ids_categories).map{|c| c.requirement_ids}.flatten.uniq
- ids_requirements += Requirement.obbligatori.map{|x| x.id}
+ ids_requirements += Requirement.attivi.obbligatori.map{|x| x.id}
ids_requirements.uniq!
logger.debug "Requisiti richiesti: #{ids_requirements}"
logger.debug "Requisiti accettati: #{supplier_requirements.map{|r| r.requirement_id if r.can_accetta?}}"
View
16 app/models/supplier_category.rb
@@ -15,28 +15,36 @@ class SupplierCategory < ActiveRecord::Base
transition [:new, :incompleta, :non_abilitata] =>:incompleta , :unless => :requisiti_validi?
end
+ event :verifica do
+ transition [:abilitata] =>:incompleta , :if => lambda { |sc| !sc.requisiti_validi? && sc.request_for_proposals.attive.count==0 }
+ end
event :annulla_iscrizione do
transition :richiesta =>:new
end
event :cancella_iscrizione do
- transition :to=>:new
+ transition :to=>:new , :if => lambda { |sc| sc.current_role==:hdi && sc.request_for_proposals.attive.count==0}
end
event :valida do
- transition all-[:abilitata,:non_abilitata] =>:abilitata , :if => lambda { |sc| sc.current_role==:hdi }
+ transition all-[:abilitata,:non_abilitata] =>:abilitata , :if => lambda { |sc| sc.current_role==:hdi && sc.requisiti_validi? }
end
event :rifiuta do
- transition all-[:non_abilitata]=>:non_abilitata , :if => lambda { |sc| sc.current_role==:hdi }
+ transition all-[:non_abilitata]=>:non_abilitata , :if => lambda { |sc| sc.current_role==:hdi && sc.request_for_proposals.attive.count==0}
end
before_transition :on=>:valida do |cat,trans|
cat.validated_on=Date.today
end
+
+ end
+
+ def request_for_proposals
+ supplier.request_for_proposals.joins(:request_for_proposal_line).where(["request_for_proposal_lines.category_id=?",category_id])
end
def requisiti_validi?
cat=Category.find_by_id(category_id)
return true if cat.blank?
cat_requirement_ids=cat.requirement_ids
return true if cat_requirement_ids.blank?
- sup_requirement_ids=supplier.requirement_ids
+ sup_requirement_ids=supplier.supplier_requirements.compilati.non_scaduti.map(&:requirement_id)
logger.debug ("cat_requirement_ids: #{cat_requirement_ids}")
logger.debug ("sup_requirement_ids: #{sup_requirement_ids}")
View
52 app/models/supplier_requirement.rb
@@ -3,10 +3,15 @@ class SupplierRequirement < ActiveRecord::Base
has_paper_trail :meta => { :supplier_id => Proc.new { |x| x.supplier_id }}
+ scope :compilati, :conditions=>["coalesce(accepted_value,'')<>'' "]
+ scope :in_scadenza, where(["due_on <= ? and state=?", Date.today, "accettato"])
+
+
validates_associated :attachment
validates_associated :requirement
validates_presence_of :requirement_id
- validates_date :due_on, :on => :create, :on_or_after => lambda { 1.month.from_now }, :on_or_after_message => 'il requisitodeve essere valido per almeno un mese'
+ validates_date :due_on, :on => :create, :on_or_after => lambda { 1.month.from_now }, :on_or_after_message => 'il requisito deve essere valido per almeno un mese'
+ validates_date :due_on, :on => :update, :on_or_after => lambda { 1.month.from_now }, :on_or_after_message => 'il requisito deve essere valido per almeno un mese', :if=> lambda{|sr| sr.new? || sr.da_validare? }
has_one :attachment, :as=>:attachable , :dependent => :destroy
accepts_nested_attributes_for :attachment, :allow_destroy=>true, :reject_if => :all_blank
@@ -27,21 +32,27 @@ class SupplierRequirement < ActiveRecord::Base
transition [:new,:da_validare]=>:accettato , :if => lambda { |sc| !(sc.accepted_value.blank? || sc.scaduto? || sc.attach_required? ) }
end
event :controlla_scadenza do
- transition [:da_validare,:accettato]=>:scaduto, :if => lambda { |sc| false}
+ transition [:da_validare,:accettato]=>:scaduto
end
event :rifiuta do
- transition all =>:rifiutato
+ transition all - [:rifiutato, :scaduto] =>:rifiutato
end
after_transition :on=>:rifiuta do |sr,transition|
AdminMailer.requisito_scartato(sr).deliver
end
+ before_transition :on=>:accetta do |sr,transition|
+ sr.accepted_on = Date.today
+ end
#event :sostituisci do
# transition all =>:sostituito
#end
end
+ def self.non_scaduti
+ self.without_state(:scaduto) #where(["due_on is null or due_on > ? ", Date.today])
+ end
def modificabile?
[:new, :da_validare, :rifiutato].include? state.to_sym
end
@@ -103,11 +114,11 @@ def attach_valido?
def attach_required?
requirement.attach_required?
end
- def scaduto?
- return false if due_on.blank?
- #30-06-2012 <= 13-11-2012
- due_on <= Date.today
- end
+ #def scaduto?
+ # return false if due_on.blank?
+ # #30-06-2012 <= 13-11-2012
+ # # due_on <= Date.today
+ #end
def id_wr
@@ -132,4 +143,29 @@ def mappatura_wr(sottotipo="")
return fields
end
+
+ def self.invalida_requisiti_scaduti!
+ SupplierRequirement.in_scadenza.each do |sr|
+ AdminMailer.requisito_scaduto(sr).deliver
+ r=sr.requirement
+ s=sr.supplier
+ cats=r.category.map(&:id)
+ if rfps=s.request_for_proposals.attive.joins(:request_for_proposal_line).where(["request_for_proposal_lines.category_id in (?)",cats])
+ rfps.each do |rfp|
+ AdminMailer.generic_mail(Setting["general|admin_email"].values,nil,nil,"Preventivi con requisiti scaduti",
+ "Il Fornitore #{s.to_label} ha inviato un preventivo per la #{rfp.to_label}
+ ma i suoi requisiti per la categoria relativa alla RFP sono scaduti!!").deliver
+ end
+ else
+ sr.controlla_scadenza
+ end
+ #sr.supplier.supplier_categories.each{|y| y.verifica}
+ end
+ end
+ def self.controlla_requisiti_scaduti!
+ SupplierRequirement.with_state(:scaduto).where(["due_on >= ? " , Date.today-10]).each do |sr| #scaduti negli ultimi 10 gg
+ AdminMailer.requisito_scaduto(sr).deliver
+ end
+ end
+
end
View
2  app/views/addresses/_form.html.erb
@@ -1,5 +1,5 @@
<div class="row">
-<%=label_tag "Digiata l'indirizzo della sede per effettuare la ricerca e la localizzazione:"%>
+<%=label_tag "", "Digiata l'indirizzo della sede per effettuare la ricerca e la localizzazione", :class=>"label "%>
<%=text_field_tag :search, @supplier.ragsociale, :size => 60, :type => "search", :class=>"input-large span8" %>
</div>
<div class="row">
View
2  app/views/addresses/index.html.erb
@@ -14,12 +14,12 @@
</tr>
<% @addresses.each do |address| %>
<tr>
+ <td><%= address.tipologia_label %></td>
<td><%= address.via %></td>
<td><%= address.localita %></td>
<td><%= address.cap %></td>
<td><%= address.prov %></td>
<td><%= address.nazione %></td>
- <td><%= address.tipologia_label %></td>
<td><%= print_date address.valido_al %></td>
<td><%= link_to 'Modifica', edit_supplier_address_path(@supplier,address), :class=>"btn btn-success" %></td>
<td><%= link_to 'Elimina', supplier_address_path(@supplier,address), method: :delete, data: { confirm: t(:generic_confirm_message) }, :class=>"btn btn-danger"%></td>
View
2  app/views/contacts/_form.html.erb
@@ -34,7 +34,7 @@
</div>
</div>
<%end%>
- <%= f.submit "Salva" %>
+ <%= submit_tag "Salva" %>
<% end %>
<script>
$(function() {
View
4 app/views/contracts/_form.html.erb
@@ -4,7 +4,8 @@
<%= f.input :supplier_id, :as=>:hidden %>
<%= f.input :valid_from , :label=>"Valido dal", :as=>:string, :input_html=>{:value=>print_date(@contract.valid_from)}%>
<%= f.input :valid_to , :label=>"Valido al", :as=>:string, :input_html=>{:value=>print_date(@contract.valid_to)}%>
- <%=f.inputs :for => :allegati do |attach| %>
+ <%= f.input :note, :label=>"Note", :input_html=>{:class=>"span9"}%>
+ <%= f.inputs :for => :allegati do |attach| %>
<%=attach.input :attachable_type, :label=>false, :as=>:hidden%>
<%=attach.input :attachable_id, :label=>false, :as=>:hidden%>
<%=attach.input :sottotipo, :label=>false, :as=>:hidden%>
@@ -25,6 +26,7 @@
$(function() {
$("#contract_valid_from").datepicker({ format: 'dd-mm-yyyy'});
$("#contract_valid_to").datepicker({ format: 'dd-mm-yyyy'});
+ $("#contract_note").wysiwyg();
});
View
8 app/views/contracts/index.html.erb
@@ -4,8 +4,8 @@
<tr>
<th>Numero</th>
<th>Fornitore</th>
- <th>Valido dal</th>
- <th>Valido al</th>
+ <th class="span2">Valido dal</th>
+ <th class="span2">Valido al</th>
<th></th>
<th></th>
<th></th>
@@ -15,8 +15,8 @@
<tr>
<td><%= contract.protocol %></td>
<td><%= link_to(contract.supplier.to_label, supplier_path(contract.supplier)) if contract.supplier%></td>
- <td><%= contract.valid_from %></td>
- <td><%= contract.valid_to %></td>
+ <td><%= print_date contract.valid_from %></td>
+ <td><%= print_date contract.valid_to %></td>
<td><%= link_to 'Modifica', edit_contract_path(contract), :class=>"btn btn-info" %></td>
<td><%= link_to 'Elimina', contract, method: :delete, data: { confirm: t(:generic_confirm_message) }, :class=>"btn btn-danger" %></td>
</tr>
View
10 app/views/devise/mailer/reset_password_instructions.html.erb
@@ -1,8 +1,8 @@
-<p>Hello <%= @resource.email %>!</p>
+<p>Salve <%= @resource.email %>!</p>
-<p>Someone has requested a link to change your password, and you can do this through the link below.</p>
+<p>Se hai richiesto un link per cambiare la tua password, puoi utilizzare questo:</p>
-<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
+<p><%= link_to 'Cambia la mia password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
-<p>If you didn't request this, please ignore this email.</p>
-<p>Your password won't change until you access the link above and create a new one.</p>
+<p>Se non sei stato to a richiedere questo link, ti preghiamo di ignorare questa email.</p>
+<p>La tua password non sarà modificata finchè non utilizzerai il link di reset.</p>
View
4 app/views/devise/passwords/new.html.erb
@@ -1,4 +1,4 @@
-<h2>Forgot your password?</h2>
+<h2>Password dimenticata?</h2>
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>
@@ -6,7 +6,7 @@
<div><%= f.label :email %><br />
<%= f.email_field :email %></div>
- <div><%= f.submit "Send me reset password instructions" %></div>
+ <div><%= f.submit "Invia le istruzioni per il reset della password " %></div>
<% end %>
<%= render "devise/shared/links" %>
View
13 app/views/devise/sessions/new.html.erb
@@ -1,17 +1,14 @@
-<h2>Sign in</h2>
+<h3>Accesso al sistema</h3>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
- <div><%= f.label :email %><br />
- <%= f.email_field :email %></div>
-
- <div><%= f.label :password %><br />
- <%= f.password_field :password %></div>
+ <div><%= f.label :email %> <%= f.email_field :email %></div>
+ <div><%= f.label :password %> <%= f.password_field :password %></div>
<% if devise_mapping.rememberable? -%>
- <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
+ <div><%= f.check_box :remember_me %> <%= f.label :remember_me, "Ricordami su questo computer" %></div>
<% end -%>
- <div><%= f.submit "Sign in" %></div>
+ <div><%= f.submit "Accedi" %></div>
<% end %>
<%= render "devise/shared/links" %>
View
12 app/views/devise/shared/_links.erb
@@ -1,25 +1,25 @@
<%- if controller_name != 'sessions' %>
- <%= link_to "Sign in", new_session_path(resource_name) %><br />
+ <%= link_to "Accedi", new_session_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
- <%= link_to "Sign up", new_registration_path(resource_name) %><br />
+ <%= link_to "Registrati", new_registration_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
- <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
+ <%= link_to "Password dimenticata?", new_password_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
+ <%= link_to "Non hai ricevuto la mail con le istruzioni di conferma?", new_confirmation_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
+ <%= link_to "Non hai ricevuto ma mail con le istruzioni per lo sblocco dell'account?", new_unlock_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
- <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
+ <%= link_to "Accedi con #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
<% end -%>
<% end -%>
View
6 app/views/home/_requisiti_incompleti.html.erb
@@ -0,0 +1,6 @@
+
+<h4>Requisiti non completi/ scaduti </h4>
+ <p>Attenzione Alcuni profili / Categorie non risultano complete o risultano scadute</p>
+
+<%=link_to "Verifica le categorie incomplete" , categorie_path(), :class=>"btn btn-danger" if !@supplier.categorie_complete?%>
+<%=link_to "Verifica i requisiti scaduti" , requisiti_path(), :class=>"btn btn-danger" if !@supplier.requisiti_completi? %>
View
5 app/views/home/index.html.erb
@@ -1,5 +1,8 @@
<div class="row span9">
- <%= render :partial => 'step_registrazione' if @supplier.state_events.include? :registra%>
+ <%= render :partial => 'step_registrazione' if (@supplier.state_events.include?( :registra) )%>
+ </div>
+ <div class="row span9">
+ <%= render :partial => 'requisiti_incompleti' if (!@supplier.requisiti_completi? || !@supplier.categorie_complete?)%>
</div>
<!--<div class="row span9">
<%#= render :partial => 'news' unless @supplier.state_events.include? :registra%>
View
4 app/views/proposals/_form.html.erb
@@ -33,9 +33,9 @@
<div class="span4">
<%= button_tag "salva", :class=>"btn btn-success" %>
<%#= button_tag "notifica variazioni", :class=>"btn btn-success", :name=>"gest[notifica]" if !@proposal.new_record?%>
- <%=link_to "<i class='icon-envelope'></i> Invia Mail".html_safe, prepara_mail_supplier_path(@proposal.supplier, :subject=>"rif VS Offerta per la #{@proposal.request_for_proposal.to_label}", :body=>@proposal.note), :target => "_blank", :class=>"btn" %>
+ <%=link_to "<i class='icon-envelope'></i> Richiesta Variazioni".html_safe, prepara_mail_supplier_path(@proposal.supplier, :subject=>"rif VS Offerta per la #{@proposal.request_for_proposal.to_label}", :body=>@proposal.note), :target => "_blank", :class=>"btn" if (@proposal.inviata? || @proposal.definitiva?)%>
<%= button_tag "riapri", :class=>"btn btn-info" , :id=>"btn_salva_def",:name=>"gest[riapri]" if @proposal.can_riapri?%>
- <%= button_tag "accetta", :class=>"btn btn-success" , :id=>"btn_salva_def",:name=>"gest[accetta]" , :data=>{:confirm=> "Attenzione. Accettando questa offerta tutte le altre saranno rifiutate e l'Ufficio Acquisti sarà notificato per l'inserimento di RDA e OF!"}if @proposal.can_accetta?%>
+ <%= button_tag "accetta", :class=>"btn btn-success" , :id=>"btn_salva_def",:name=>"gest[accetta]" , :data=>{:confirm=> "Attenzione. Accettando questa offerta tutte le altre saranno rifiutate e l'Ufficio Acquisti sarà notificato per l'inserimento del relativo OF."}if @proposal.can_accetta?%>
<%= button_tag "scarta", :class=>"btn btn-danger" , :id=>"btn_sottoponi_def", :name=>"gest[scarta]" if @proposal.can_scarta?%>
View
4 app/views/proposals/proposals_da_valutare.html.haml
@@ -18,6 +18,6 @@
!!!%td= proposal.accepted_on
%td= proposal.request_for_proposal.ordine_sap
%td= "#{proposal.scores.count}: #{proposal.scores.map{|s| "#{s.psc.to_i}/30" }.join(", ")}"
- %td= link_to("Modifica", proposal_path(proposal), :class=>"btn btn-success")
- %td= link_to("Valuta", proposal_path(proposal), :class=>"btn btn-info")
+ %td= link_to("Apri", proposal_path(proposal), :class=>"btn btn-success")
+ !!!%td= link_to("Valuta", proposal_path(proposal), :class=>"btn btn-info")
View
4 app/views/request_for_proposals/offerte_ricevute.html.haml
@@ -18,6 +18,6 @@
%td= proposal.request_for_proposal_dispatches.map{|x| x.to_label}.join(" ")
%td= proposal.state
%td= "#{proposal.scores.map{|s| "#{s.psc.to_i}/30" }.join(", ")}"
- %td= link_to("Modifica", proposal_path(proposal), :class=>"btn btn-info")
- %td= link_to("Valuta", proposal_path(proposal), :class=>"btn btn-success")
+ %td= link_to("Apri", proposal_path(proposal), :class=>"btn btn-success")
+ !!!%td= link_to("Valuta", proposal_path(proposal), :class=>"btn btn-success")
View
2  app/views/scores/_form.html.erb
@@ -55,7 +55,7 @@
<% end%>
<div class="row">
<div class="span7">
- <%= f.input :psc , :label=>content_tag(:abbr, "PSC", :title=>"Punteggio Sintetic odi valutazione dell'esecuzione del Contratto"), :as=>:string, :input_html=>{:disabled=>true}%>
+ <%= f.input :psc , :label=>content_tag(:abbr, "PSC", :title=>"Punteggio Sintetico di valutazione dell'esecuzione del Contratto"), :as=>:string, :input_html=>{:disabled=>true}%>
</div>
</div>
<div class="row">
View
2  app/views/supplier_user/passwords/edit.html.erb
@@ -1,4 +1,4 @@
-<h2>Change your password</h2>
+<h2>Modifica la tua password</h2>
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
<%= devise_error_messages! %>
View
17 app/views/supplier_user/sessions/new.html.erb
@@ -1,17 +1,14 @@
-<h2>Sign in</h2>
+<h3>Accesso al sistema</h3>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
- <div><%= f.label :email %><br />
- <%= f.email_field :email %></div>
+ <div><%= f.label :email %> <%= f.email_field :email %></div>
+ <div><%= f.label :password %> <%= f.password_field :password %></div>
- <div><%= f.label :password %><br />
- <%= f.password_field :password %></div>
+ <% if devise_mapping.rememberable? -%>
+ <div><%= f.check_box :remember_me %> <%= f.label :remember_me, "Ricordami su questo computer" %></div>
+ <% end -%>
- <% if devise_mapping.rememberable? -%>
- <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
- <% end -%>
-
- <div><%= f.submit "Sign in" %></div>
+ <div><%= f.submit "Accedi" %></div>
<% end %>
<%= render "devise/shared/links" %>
View
49 app/views/suppliers/_invito.html.erb
@@ -4,13 +4,27 @@
<button type="button" class="close" data-dismiss="alert">chiudi scheda</button>
<h5>Invito per la <%=rfp.to_label%> del <%=print_date(invito.dispatch_on)%></h5>
<div class="row">
- <div class="span5">
- <%=dl_horizontal rfp, :emitted_on, "emessa il" %>
- <%=dl_horizontal rfp, :due_on , "scade il"%>
+ <div class="span4">
+ <dl class="dl-horizontal">
+ <dt><strong> Emessa il:</strong> </dt>
+ <dd><strong><%=print_date(rfp.emitted_on)%></strong></dd>
+ <dt><strong> Scade il:</strong> </dt>
+ <dd><strong><%=print_date(rfp.due_on)%></strong></dd>
+ </dl>
+
+
</div>
- <div class="span3">
- <h3>Invito: <%=invito.state%></h3>
- <%=link_to("Preventivo presentato", edit_proposal_path(invito.proposal_id), :class=>"btn btn-info") if invito.proposal_id%>
+ <div class="span4">
+ <%if invito.proposal.state=="bozza" %>
+ <h3>Offerta in bozza </h3>
+ <%elsif invito.proposal.state=="inviata" %>
+ <h3>Offerta presentata in bozza</h3>
+ <%else%>
+ <h3>Offerta definitiva presentata</h3>
+ <%end%>
+
+
+ <%=link_to("Apri documenti d'offerta", edit_proposal_path(invito.proposal_id), :class=>"btn btn-info") if invito.proposal_id%>
</div>
</div>
</div>
@@ -19,23 +33,36 @@
<button type="button" class="close" data-dismiss="alert">chiudi scheda</button>
<div class="row">
<div class="span5">
- <%=dl_horizontal rfp, :emitted_on , "emessa il" %>
- <%=dl_horizontal rfp, :due_on , "scade il" %>
+ <dl class="dl-horizontal">
+ <dt><strong> Emessa il:</strong> </dt>
+ <dd><strong><%=print_date(rfp.emitted_on)%></strong></dd>
+ <dt><strong> Scade il:</strong> </dt>
+ <dd><strong><%=print_date(rfp.due_on)%></strong></dd>
+ </dl>
+
</div>
<div class="span3">
<%=link_to("Rifiuta", rifiuta_request_for_proposal_url(rfp, :dispatch_id=>invito.id), :class=>"btn btn-large btn-danger", :method => :delete, :data=>{:confirm=>t(:generic_confirm_message)})%>
<%=link_to("Rispondi", rispondi_request_for_proposal_url(rfp, :dispatch_id=>invito.id), :class=>"btn btn-large btn-success")%>
</div>
</div>
- <div class="row"><%= dl_horizontal(rfp, :note) %></div>
<div class="row">
- <ol class=" offset1">
+
+ <dl class="dl-horizontal">
+ <dt><strong> Note:</strong> </dt>
+ <dd><strong><%=rfp.note.html_safe%></strong></dd>
+
+ </dl>
+
+ </div>
+ <div class="row">
+ <ul class=" offset1">
<li><%=attach_link rfp.allegato_principale_rfp%> </li>
<%rfp.allegati_generici_rfp.each do |a|%>
<li><%=attach_link a%> </li>
<% end %>
- </ol>
+ </ul>
</div>
</div>
<%end%>
View
9 app/views/suppliers/_requirement_row.html.erb
@@ -2,15 +2,16 @@
label = "label "
label = "label label-dafare" if r.mandatory?
- supplier_req=@supplier_requirement || @supplier.supplier_requirements.find_by_requirement_id(r.id) || @supplier.supplier_requirements.find_or_create_by_requirement_id(r.id, :due_on=>30.days.from_now.end_of_year){|x| x.build_attachment }
- label = "label label-fatta" if (supplier_req && supplier_req.can_accetta?)
+ supplier_req=@supplier_requirement || @supplier.supplier_requirements.non_scaduti.find_by_requirement_id(r.id) || @supplier.supplier_requirements.non_scaduti.find_or_create_by_requirement_id(r.id, :due_on=>30.days.from_now.end_of_year){|x| x.build_attachment }
+ label = "label label-fatta" if (supplier_req && (supplier_req.can_accetta? || supplier_req.accettato?))
label = "label label-warning" if (supplier_req && supplier_req.rifiutato?)
+ label = "label label-inverse" if (supplier_req && supplier_req.scaduto?)
%>
<%= content_tag :div, :id=>"requirement_heading_#{r.id}" , :class=> "accordion-heading #{}" do%>
<%=link_to( "#requirement_body_#{r.id}", :class=>"accordion-toggle #{label}", :data=>{:toggle=>"collapse" , :parent=>"#accordion1"}) do %>
- <%=r.description%>
+ <%=r.description %>
<%if supplier_req%>
<%=content_tag(:i,"",:class=>"icon-white icon-check pull-right zoom150") if ( supplier_req.can_accetta? || supplier_req.accettato?)%>
<%=content_tag(:i,"",:class=>"icon-white icon-exclamation-sign pull-right zoom150") if ( supplier_req.rifiutato?)%>
@@ -64,7 +65,7 @@
<%#=f.input :attach, :as=>:file if r.attach_required?%>
<%#=(link_to "Visualizza Allegato", attachments_attach_path(:id=>supplier_req.attachment.id), :class=>"btn btn-small" ) if supplier_req.attachment%>
<%=f.input :due_on, :as=>:string , :label=>"Valido fino al", :input_html=>{:value=>print_date(f.object.due_on)}%>
- <%=f.action :submit, :label=>"Salva Valore"%>
+ <%=f.action :submit, :label=>"Salva"%>
<%end%>
<script>
View
78 app/views/suppliers/_requirement_scaduto.html.erb
@@ -0,0 +1,78 @@
+<%
+
+ #supplier_req=@supplier_requirement || @supplier.supplier_requirements.non_scaduti.find_by_requirement_id(r.id) || @supplier.supplier_requirements.non_scaduti.find_or_create_by_requirement_id(r.id, :due_on=>30.days.from_now.end_of_year){|x| x.build_attachment }
+ r=supplier_req.requirement
+ label = "label label-inverse" if (supplier_req && supplier_req.scaduto?)
+
+%>
+
+<%= content_tag :div, :id=>"requirement_heading_#{supplier_req.id}" , :class=> "accordion-heading #{}" do%>
+ <%=link_to( "#requirement_body_#{supplier_req.id}", :class=>"accordion-toggle #{label}", :data=>{:toggle=>"collapse" , :parent=>"#accordion1"}) do %>
+ <%=r.description%>
+ <%if supplier_req%>
+ <%=content_tag(:i,"",:class=>"icon-white icon-check pull-right zoom150") if ( supplier_req.can_accetta? || supplier_req.accettato?)%>
+ <%=content_tag(:i,"",:class=>"icon-white icon-exclamation-sign pull-right zoom150") if ( supplier_req.rifiutato?)%>
+ <%end%>
+ <%end%>
+<%end%>
+
+<%=content_tag :div , :id=> "requirement_body_#{supplier_req.id}" , :class=>"accordion-body collapse" do %>
+ <div class="accordion-inner ">
+ <%=r.note.html_safe%>
+ <%if( supplier_req && !supplier_req.modificabile?)%>
+ <div class="well well-small">
+ confermato il valore
+ <strong><%="#{supplier_req.accepted_value}-#{r.requirement_option(supplier_req.accepted_value)}"%></strong>
+ il
+ <strong><%=print_date supplier_req.accepted_on %> </strong>
+ scadenza
+ <strong><%=print_date supplier_req.due_on %> </strong>
+
+ <%=attach_link supplier_req.attachment, :class=>"btn btn-small" %>
+ <p><%#=link_to "Annulla il Requisito",update_requisito_url(:supplier_requirement=>{:id=>supplier_req.id}), :method=>:delete, :confirm => "Sei sicuro?",:class=>"btn btn-small btn-danger"%></p>
+ </div>
+ <%elsif supplier_req %>
+ <% if supplier_req.errors.any? %>
+ <div id="error_explanation" class="alert alert-error">
+ <h3><%= "Errori:" %> </h3>
+ <ul>
+ <% supplier_req.errors.full_messages.uniq.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <%=semantic_form_for supplier_req, :url=>update_requisito_url(), :remote=>:true , :data=>{"update-target" => 'update-container'} do |f|%>
+ <%#=f.input :supplier_id , :as=>:hidden, :value=> @supplier.id %>
+ <%=f.input :id , :as=>:hidden, :value=> supplier_req.id %>
+ <%=f.input :state , :as=>:hidden, :value=>"new"%>
+ <%=f.input :accepted_value , :as=>:select, :collection => r.requirement_options_for_select, :label=>"Opzioni disponibili" %>
+ <%=f.inputs :for => :attachment do |attach| %>
+ <%=attach.input :attachable_type, :label=>false, :as=>:hidden%>
+ <%=attach.input :attachable_id, :label=>false, :as=>:hidden%>
+ <%=attach.input :sottotipo, :label=>false, :as=>:hidden%>
+ <%=attach.input :attach, :as =>:file, :label=>"Allegato" %>
+ <div class="control-group">
+ <div class="controls">
+ <%=attach_link supplier_req.attachment%>
+ </div>
+ </div>
+ <%end if r.attach_required?%>
+ <%#=f.input :attach, :as=>:file if r.attach_required?%>
+ <%#=(link_to "Visualizza Allegato", attachments_attach_path(:id=>supplier_req.attachment.id), :class=>"btn btn-small" ) if supplier_req.attachment%>
+ <%=f.input :due_on, :as=>:string , :label=>"Valido fino al", :input_html=>{:value=>print_date(f.object.due_on)}%>
+ <%=f.action :submit, :label=>"Salva"%>
+ <%end%>
+
+ <script>
+ $(function() {
+ $("#supplier_requirement_due_on").datepicker({ format: 'dd-mm-yyyy'});
+
+
+ });
+ </script>
+ <%end%>
+ </div>
+<%end%>
+
View
6 app/views/suppliers/index.html.erb
@@ -27,9 +27,9 @@
<%=content_tag :td, link_to(s.ragsociale,supplier_path(s)) %>
<%=content_tag :td, categorie_supplier(s)%>
<%=content_tag :td do%>
- <%= content_tag :span, content_tag(:abbr, s.supplier_requirements.with_state([:new,:da_validare]).count, :title=>"da validare"), :class=>"badge badge-warning" %>
- <%= content_tag :span, content_tag(:abbr, s.supplier_requirements.with_state(:accettato).count, :title=>"validi"), :class=>"badge badge-success" %>
- <%= content_tag :span, content_tag(:abbr, s.supplier_requirements.with_state(:scaduto).count, :title=>"scaduti"), :class=>"badge badge-important" %>
+ <%= content_tag :span, content_tag(:abbr, s.supplier_requirements.compilati.with_state([:new,:da_validare]).count, :title=>"da validare"), :class=>"badge badge-warning" %>
+ <%= content_tag :span, content_tag(:abbr, s.supplier_requirements.compilati.with_state(:accettato).count, :title=>"validi"), :class=>"badge badge-success" %>
+ <%= content_tag :span, content_tag(:abbr, s.supplier_requirements.compilati.with_state(:scaduto).count, :title=>"scaduti"), :class=>"badge badge-important" %>
<% end %>
View
4 app/views/suppliers/monitoraggio.html.haml
@@ -4,7 +4,7 @@
%label="Monitoraggio fornitori anno:"
= select_tag :year, options_for_select([2011,2012],@anno)
= submit_tag :cerca, class: "btn"
- = submit_tag :chiudi_esercizio, class: "btn btn-success pull-right"
+ !!!= submit_tag :chiudi_esercizio, class: "btn btn-success pull-right"
.row
.span7=paginate @suppliers
.row
@@ -16,7 +16,7 @@
%th
%abbr{:title=>"Giudizio Sintetico di Qualificazione"}="GSQ #{@anno-1}"
%th
- %abbr{:title=>"Punteggi extra per IIO9001, ISO14000 e Audit 2° liv"}="Extra #{@anno}"
+ %abbr{:title=>"Punteggi extra per ISO9001, ISO14000 e Audit 2° liv"}="Extra #{@anno}"
%th
%abbr{:title=>"Punteggio Medio di esecuzione dei Contratti"}="PMC #{@anno}"
%th
View
9 app/views/suppliers/nuova_visura.html.haml
@@ -1,4 +1,4 @@
-%h4="Nuova visura"
+%h4="Nuovo allegato"
.row
- if @visura.errors.any?
.alert.alert-error#error_explanation
@@ -7,9 +7,10 @@
-@visura.errors.full_messages.each do |msg|
%li= msg
=semantic_form_for @visura , class: "form" do |f|
+ .pull-right=submit_tag "Salva" , :class=>"btn btn-success"
.row
- .span4=f.input :description, :label=>"Data Validità visura"
- .span4=f.input :name , :label=>"Tipo di visura" , :as=>:select , :collection => ["Visuara Catastale","Visura Camerale", "Report su Impresa/Persona", "Visura Protesti", "Visura Centrale Rischi"] #TODO sostituirli con setting
+ .span4=f.input :description, :label=>"Data Validità"
+ .span4=f.input :name , :label=>"Tipo" , :as=>:select , :collection => ["Report su Impresa/Persona", "Visura Centrale Rischi"] #TODO sostituirli con setting
.row
.span6=f.input :attach, :as=>:file
=f.input :id_padre , :as=>:hidden, :label=>false
@@ -17,6 +18,6 @@
=f.input :attachable_id , :as=>:hidden , :label=>false
=f.input :sottotipo , :as=>:hidden, :label=>false
- =f.submit :label=>"Salva"
+
View
6 app/views/suppliers/requisiti.html.erb
@@ -18,6 +18,12 @@
<%= render :partial => 'requirement_row', :locals=>{:r=>r} %>
<%end%>
<%end%>
+ <h3>Requisiti scaduti</h3>
+ <%@requisiti_scaduti.each do |sr|%>
+ <%=content_tag :div, :class=>"accordion-group", :id=>"requisito_scaduto_#{sr.id}" do%>
+ <%= render :partial => 'requirement_scaduto', :locals=>{:supplier_req=>sr} %>
+ <%end%>
+ <%end%>
</div>
<div class="accordion" id="accordion2">
View
72 app/views/suppliers/show.html.haml
@@ -20,7 +20,7 @@
= link_to "Accetta Iscrizione",url_for(:controller=>:suppliers, :action=>:gestione_iscrizione, :id=>@supplier.id, :event=>:accetta), :class => "btn btn-success" if @supplier.state_events.include? :accetta
= link_to "Scarta Iscrizione",url_for(:controller=>:suppliers, :action=>:gestione_iscrizione, :id=>@supplier.id, :event=>:scarta), :class => "btn btn-danger" if @supplier.state_events.include? :scarta
- = link_to "Annulla Iscrizione",url_for(:controller=>:suppliers, :action=>:gestione_iscrizione, :id=>@supplier.id, :event=>:annulla_qualificazione), :class => "btn btn-danger" if @supplier.state_events.include? :annulla_qualificazione
+ = link_to "Annulla Iscrizione",url_for(:controller=>:suppliers, :action=>:gestione_iscrizione, :id=>@supplier.id, :event=>:annulla_iscrizione), :class => "btn btn-danger" , :data=>{:confirm=>"Attenzione, annullando l'iscrizione i dati di accesso del fornitore saranno cancellati, i requisiti e le categorie saranno annullate. Proseguire?"}if @supplier.can_annulla_iscrizione?
= link_to "Rendi Operativo",url_for(:controller=>:suppliers, :action=>:gestione_iscrizione, :id=>@supplier.id, :event=>:attiva), :class => "btn btn-danger" if @supplier.state_events.include? :attiva
= link_to "Sospendi",url_for(:controller=>:suppliers, :action=>:gestione_iscrizione, :id=>@supplier.id, :event=>:sospendi), :class => "btn btn-danger" if @supplier.state_events.include? :sospendi
@@ -68,7 +68,8 @@
%img{:src=>a.google_maps_url}
%div.row
- %h4#riferimenti_header= "Riferimenti"
+ %h4#riferimenti_header= "Recapiti"
+ !!!.pull-right=link_to "<i class='icon-envelope'></i> Invia Mail".html_safe, prepara_mail_supplier_path(@supplier), :target => "_blank", :class=>"btn"
%table{:class=>"table table-bordered table-condensed"}
%tr
%th="tipo"
@@ -86,8 +87,7 @@
%td
=r.description
=text_prev_version(r, v, :description)
- %td
- =link_to "<i class='icon-envelope'></i> Invia Mail".html_safe, prepara_mail_supplier_path(@supplier, :mail_to=>r.value), :target => "_blank", :class=>"btn"
+ !!!%td=link_to "<i class='icon-envelope'></i> Invia Mail".html_safe, prepara_mail_supplier_path(@supplier, :mail_to=>r.value), :target => "_blank", :class=>"btn"
%div.row
%h4#contatti_header= "Contatti"
%table{:class=>"table table-bordered table-condensed"}
@@ -113,31 +113,6 @@
= " -> "
=attach_link(c.attachment)
%div.row
- %h4#requisiti_header
- = "Requisiti"
- .pull-right
- =link_to "Valida Tutti ",url_for(:controller=>:suppliers, :action=>:mass_update_requirement, :id=>@supplier.id), :class => "btn btn-success"
- %table{:class=>"table table-bordered table-condensed"}
- %tr
- %th="stato"
- %th="requisito"
- %th="dichiarazione"
- !!!%th="accettato il"
- %th="valido fino al"
- %th="allegato"
- %th="azioni"
- - @supplier.supplier_requirements.each do |r|
- %tr{:class=>{:accettato=>:success, :da_validare=>:info, :scaduto=>:error}[r.state.to_sym]}
- %td=r.state
- %td=r.requirement.description[0..40]
- %td=r.requirement.requirement_option(r.accepted_value)
- !!!%td=print_date r.accepted_on
- %td=print_date r.due_on
- %td=attach_link r.attachment
- %td
- =link_to "Valida",url_for(:controller=>:suppliers, :action=>:update_requirement, :id=>@supplier.id, :id_requisito=>r.id, :new_state=>:accetta), :class => "btn btn-success pull-right" if r.can_accetta?
- =link_to "Rifiuta",url_for(:controller=>:suppliers, :action=>:update_requirement, :id=>@supplier.id, :id_requisito=>r.id, :new_state=>:rifiuta, :method => :delete), :class => "btn btn-danger pull-right", :confirm=>t(:alert_confirm_reject_requirement) if r.can_rifiuta?
-%div.row
%h4#categorie_header
= "Categorie"
.pull-right=link_to "Valida Tutte ",url_for(:controller=>:suppliers, :action=>:mass_update_categories, :id=>@supplier.id), :class => "btn btn-success"
@@ -160,14 +135,40 @@
=link_to "Valida",url_for(:controller=>:suppliers, :action=>:update_category, :id=>@supplier.id, :id_category=>c.id, :new_state=>:valida), :class => "btn btn-success pull-right" if c.state_events.include? :valida
=link_to "Rifiuta",url_for(:controller=>:suppliers, :action=>:update_category, :id=>@supplier.id, :id_category=>c.id, :method => :delete, :new_state=>:rifiuta), :class => "btn btn-danger pull-right", :confirm=>t(:alert_confirm_reject_category) if c.state_events.include? :rifiuta
%div.row
+ %h4#requisiti_header
+ = "Requisiti"
+ .pull-right
+ =link_to "Valida Tutti ",url_for(:controller=>:suppliers, :action=>:mass_update_requirement, :id=>@supplier.id), :class => "btn btn-success"
+ %table{:class=>"table table-bordered table-condensed"}
+ %tr
+ %th="stato"
+ %th="requisito"
+ %th="dichiarazione"
+ !!!%th="accettato il"
+ %th.span2="valido fino al"
+ %th="allegato"
+ %th="azioni"
+ - @supplier.supplier_requirements.compilati.order("requirement_id, state").each do |r|
+ %tr{:class=>{:accettato=>:success, :da_validare=>:info, :scaduto=>:warning, :rifiutato=>:error}[r.state.to_sym]}
+ %td=r.state
+ %td=r.requirement.description[0..40]
+ %td=r.requirement.requirement_option(r.accepted_value)
+ !!!%td=print_date r.accepted_on
+ %td=print_date r.due_on
+ %td.btn-small=attach_link r.attachment
+ %td
+ =link_to "Valida",url_for(:controller=>:suppliers, :action=>:update_requirement, :id=>@supplier.id, :id_requisito=>r.id, :new_state=>:accetta), :class => "btn btn-success pull-right" if r.can_accetta?
+ =link_to "Rifiuta",url_for(:controller=>:suppliers, :action=>:update_requirement, :id=>@supplier.id, :id_requisito=>r.id, :new_state=>:rifiuta, :method => :delete), :class => "btn btn-danger pull-right", :confirm=>t(:alert_confirm_reject_requirement) if r.can_rifiuta?
+
+%div.row
%h4#visure_header
- = "Visure "
- .pull-right=link_to '+',{:controller=>:suppliers, :action=>:nuova_visura, :id=>@supplier.id}, :title=>"Nuova Visura" , :target=>"_blank"
+ = "Business Information e Rating"
+ .pull-right=link_to '+',{:controller=>:suppliers, :action=>:nuova_visura, :id=>@supplier.id}, :title=>"Nuova" , :target=>"_blank"
%table{:class=>"table table-bordered table-condensed"}
%tr
%th="Data"
- %th="Tipo di visura"
- %th="Data Validità visura"
+ %th="Tipo di documento"
+ %th="Data Validità"
- @supplier.visure.each do |v|
%tr
%td=print_date v.created_at
@@ -183,13 +184,16 @@
%tr
%th="Numero"
%th="Validita"
+ %th="Note"
- @supplier.contracts.each do |c|
%tr
%td=c.protocol
%td
+ ="dal"
=print_date c.valid_from
- =" - "
+ =" al "
=print_date c.valid_to
+ %td=c.note.html_safe
%td=link_to "Modifica", edit_contract_url(c)
View
84 app/views/suppliers/stampa.html.haml
@@ -43,84 +43,28 @@
%td=r.description
%div.row
- %h4#contatti_header= "Contatti"
+ %h4= "Contatti"
%table{:class=>"table table-bordered table-condensed"}
%tr
%th="ruolo"
%th="Cognome e Nome"
- %th="Data di Nascita"
+ %th="Nato a"
+ %th="il"
+ %th="CF"
%th="Documento"
+ %th="Numero"
+ %th="rilascaito da"
+ %th="rilasciato il"
+ %th="scadenza"
- @supplier.contacts.each do |c|
%tr
%td=c.role_label
%td=c.full_name
+ %td=c.born_city
%td=print_date(c.born_date)
+ %td=c.fiscal_code
%td=c.personal_document
-%div.row
- %h4= "Categorie"
- %table{:class=>"table table-bordered table-condensed"}
- %tr
- %th="stato"
- %th="categoria"
- %th.span2="validata il"
- - @supplier.supplier_categories.each do |c|
- %tr
- %td=c.state
- %td=c.category.breadcumb if c.category
- %td=print_date c.validated_on
-%div.row
- %h4= "Visure "
- %table{:class=>"table table-bordered table-condensed"}
- %tr
- %th="Data"
- %th="File"
- %th="note"
- - @supplier.visure.each do |v|
- %tr
- %td=print_date v.created_at
- %td=v.name
- %td=v.description
-
-%div.row
- %h4= "Contratti "
- %table{:class=>"table table-bordered table-condensed"}
- %tr
- %th="Numero"
- %th="Validita"
- - @supplier.contracts.each do |c|
- %tr
- %td=c.protocol
- %td
- =print_date c.valid_from
- =" - "
- =print_date c.valid_to
-
-%div.row
- %h4= "Offerte "
- %table{:class=>"table table-bordered table-condensed"}
- %tr
- %th="Stato"
- %th="RFP"
- %th="Categoria"
- - @supplier.proposals.each do |p|
- %tr
- %td=p.state
- %td=p.request_for_proposal.to_label
- %td=p.request_for_proposal.category.breadcumb
-
-%div.row
- %h4= "Valutazioni Complessive"
- %table{:class=>"table table-bordered table-condensed"}
- %tr
- %th="Anno"
- %th="Tipo"
- %th="Valutazione"
- %th="Categoria"
- %th="note"
- - @supplier.scores.each do |s|
- %tr
- %td=s.year
- %td=s.proposal ? "#{s.proposal.request_for_proposal.to_label} - Off. #{s.proposal.to_label}": "Valutazione Annuale"
- %td=s.proposal ? s.psc : s.gsq
- %td=s.proposal.request_for_proposal.category.breadcumb if s.proposal
- %td=s.note
+ %td=c.pd_number
+ %td=c.pd_rilasciato_da
+ %td=c.pd_rilasciato_il
+ %td=c.pd_scadenza
View
3  db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20121207122259) do
+ActiveRecord::Schema.define(:version => 20121210154649) do
create_table "active_admin_comments", :force => true do |t|
t.string "resource_id", :null => false
@@ -152,6 +152,7 @@
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "state"
+ t.text "note"
end
create_table "proposal_lines", :force => true do |t|
Please sign in to comment.
Something went wrong with that request. Please try again.