diff --git a/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c b/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c new file mode 100644 index 0000000..f14f694 Binary files /dev/null and b/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c differ diff --git a/app/controllers/admin/price_documents_controller.rb b/app/controllers/admin/price_documents_controller.rb index 693c8d5..a58c531 100644 --- a/app/controllers/admin/price_documents_controller.rb +++ b/app/controllers/admin/price_documents_controller.rb @@ -330,7 +330,8 @@ class Admin::PriceDocumentsController < ApplicationController @price_document.date = Date.today @avoir = true if @price_document.label == "Avoir" if @price_document.save - if @price_document.cc_label == "Demande prix" + #if @price_document.cc_label == "Demande prix" + if @price_document.cc_label == "Facture achat" render action: :show else redirect_to admin_price_documents_path(:price_document_type_id => @price_document.price_document_type_id) @@ -344,7 +345,6 @@ class Admin::PriceDocumentsController < ApplicationController def update - raise @price_document = PriceDocument.find(params[:id]) @avoir = true if @price_document.label == "Avoir" diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 24a8b80..dddda40 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -159,7 +159,7 @@ class ApplicationController < ActionController::Base if current_admin.has_permission?("bills") set_big_menu :documents, "Achats", admin_price_documents_path(:price_document_type_id =>6, :purchase => true), "file-text-o", "#d97941" - set_sub_menu :documents, :buy_lists, "TdB achats" + #set_sub_menu :documents, :buy_lists, "TdB achats" set_sub_menu :documents, :line_stocks, "Lignes de stock", admin_line_stocks_path set_sub_menu :documents, :stock_movements, "Mouvements de stock manuel", admin_stock_movements_path diff --git a/app/models/p_article.rb b/app/models/p_article.rb index db8556c..ca44f4f 100644 --- a/app/models/p_article.rb +++ b/app/models/p_article.rb @@ -17,7 +17,7 @@ class PArticle < ApplicationRecord acts_as_sorting :fields => { :id => {:name => "id", :reorder => true}, :p_product_ref_ref => {:name => "Code ref", :reorder => true}, - :p_product_ref => {:name => "Désignation", :reorder => true}, + :p_product_ref => {:name => "Référence", :reorder => true}, :p_grade => {:name => "Grade", :reorder => true}, :color => {:name => "Couleur"}, :p_article_serial_nums => {:name => "N° identifiants"}, @@ -27,7 +27,7 @@ class PArticle < ApplicationRecord acts_as_sorting :fields => { :id => {:name => "id", :reorder => true}, :p_product_ref_ref => {:name => "Code ref", :reorder => true}, - :p_product_ref => {:name => "Désignation", :reorder => true}, + :p_product_ref => {:name => "Référence", :reorder => true}, :color => {:name => "Couleur"}, :p_article_serial_nums => {:name => "N° identifiants"}, :actions => {:name => "Actions", :reorder => false}, diff --git a/app/models/p_grade.rb b/app/models/p_grade.rb index 648e10e..28102fe 100644 --- a/app/models/p_grade.rb +++ b/app/models/p_grade.rb @@ -7,5 +7,5 @@ class PGrade < ApplicationRecord :actions => {:name => "Actions", :reorder => false}, } - ACTIVATED = false + ACTIVATED = true end diff --git a/app/models/p_product.rb b/app/models/p_product.rb index bad4974..886c99f 100644 --- a/app/models/p_product.rb +++ b/app/models/p_product.rb @@ -454,4 +454,12 @@ class PProduct < ApplicationRecord end end + + def self.update_brand + PProduct.all.each do |pp| + pp.s_brand = SBrand.first + pp.save + end + end + end diff --git a/app/models/price_document.rb b/app/models/price_document.rb index 125545e..e941947 100644 --- a/app/models/price_document.rb +++ b/app/models/price_document.rb @@ -25,7 +25,8 @@ class PriceDocument < ApplicationRecord has_many :avoir_p_payment_documents, :dependent => :destroy, :foreign_key => :avoir_id, :class_name => "PPaymentDocument" accepts_nested_attributes_for :avoir_p_payment_documents, allow_destroy: true - PURCHASES = ["Demande prix", "Réponse fournisseur", "Commande achat", "Facture achat", "Consultation fournisseur"] + #PURCHASES = ["Demande prix", "Réponse fournisseur", "Commande achat", "Facture achat", "Consultation fournisseur"] + PURCHASES = ["Commande achat"] SALES = ["Bon de commande", "Devis", "Bon de livraison", "Facture", "Avoir"] # AVANCEMENT = ["0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"] AVANCEMENT = ["0%", "25%", "50%", "75%", "100"] diff --git a/app/models/price_line_block.rb b/app/models/price_line_block.rb index 223aab1..b6b2b38 100644 --- a/app/models/price_line_block.rb +++ b/app/models/price_line_block.rb @@ -6,7 +6,7 @@ class PriceLineBlock < ApplicationRecord belongs_to :p_devise validates :p_customer_id, :presence => true, :if => :p_customer_needed? - validates :p_fournisseur_id, :presence => true, :if => :p_fournisseur_needed? + #validates :p_fournisseur_id, :presence => true, :if => :p_fournisseur_needed? validates :particular_bill_id, :presence => true, :if => :particular_bill_needed? validates :particular_send_id, :presence => true, :if => :particular_send_needed? diff --git a/app/views/admin/p_articles/_form.html.haml b/app/views/admin/p_articles/_form.html.haml index ae711c0..f2fbe48 100644 --- a/app/views/admin/p_articles/_form.html.haml +++ b/app/views/admin/p_articles/_form.html.haml @@ -2,7 +2,7 @@ .content =f.inputs do - = f.input :p_product_ref, as: :select, collection: PProductRef.all.distinct, :label => f.object.label_for(:p_product_ref) + = f.input :p_product_ref, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :label => f.object.label_for(:p_product_ref) -if PGrade::ACTIVATED = f.input :p_grade, as: :select, collection: PGrade.pluck(:grade, :id), :label => "Grade" %h4 Numero de série : @@ -17,4 +17,3 @@ .actions=f.submit "sauvegarder", :class => "btn btn-primary" - diff --git a/app/views/admin/p_articles/_p_article.html.haml b/app/views/admin/p_articles/_p_article.html.haml index 7368263..9978840 100644 --- a/app/views/admin/p_articles/_p_article.html.haml +++ b/app/views/admin/p_articles/_p_article.html.haml @@ -12,7 +12,7 @@ -tr[:color] = capture do %td - = p_article.p_product_ref.p_product_color.color + =# p_article.p_product_ref.p_product_color.color -tr[:p_product_ref] = capture do %td @@ -20,7 +20,7 @@ \- = p_article.p_product_ref.ct_sub_name \- - = p_article.p_product_ref.p_product_color.name + =# p_article.p_product_ref.p_product_color.name -tr[:p_article_serial_nums] = capture do %td diff --git a/app/views/admin/price_documents/index.html.haml b/app/views/admin/price_documents/index.html.haml index ca45910..9b37cf8 100644 --- a/app/views/admin/price_documents/index.html.haml +++ b/app/views/admin/price_documents/index.html.haml @@ -1,7 +1,7 @@ .qi_header .right -if params[:price_document_type_id].to_i == 6 # Facture Achat - = link_to 'Ajouter une facture achat', new_admin_price_document_path(:document_type => "Facture d'achat"), :class => "btn btn-primary bgbd-documents", :remote => false + = link_to 'Ajouter une facture achat', new_admin_price_document_path(:document_type => "Facture achat"), :class => "btn btn-primary bgbd-documents", :remote => false -elsif params[:price_document_type_id].to_i == 4 # Commande Achat = link_to 'Ajouter une commande achat', new_admin_price_document_path(:document_type => "Commande achat"), :class => "btn btn-primary bgbd-documents", :remote => false -elsif params[:price_document_type_id].to_i == 7 diff --git a/app/views/admin/price_documents/show.html.haml b/app/views/admin/price_documents/show.html.haml index c474220..19a9616 100644 --- a/app/views/admin/price_documents/show.html.haml +++ b/app/views/admin/price_documents/show.html.haml @@ -203,8 +203,9 @@ %th Qté %th P.U. HT %th TVA - %th - Montant HT + %th Montant HT + %th Actions + %tbody -price_line_block.price_lines.each do |price_line| %tr @@ -238,6 +239,12 @@ %td.numeraire =number_to_currency price_line.tot_amount_ht + %td.actions + = link_to i(:"trash-o"), admin_price_line_path(price_line), method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true + = link_to i(:pencil), edit_admin_price_line_path(price_line), :remote => true + = link_to i(:eye), admin_price_line_path(price_line), :remote => true + = link_to i(:"mobile-alt"), new_admin_p_article_path, :remote => true + / %td=# price_line.line_stocks.sum(:price_ht) .qi_row diff --git a/app/views/admin/price_lines/add_p_articles.js.erb b/app/views/admin/price_lines/add_p_articles.js.erb new file mode 100644 index 0000000..dc68c39 --- /dev/null +++ b/app/views/admin/price_lines/add_p_articles.js.erb @@ -0,0 +1 @@ +show_pane_hover("<%= escape_javascript(render(:partial => "add_p_articles_form"))%>",700,900); \ No newline at end of file