Modification visuelle, saisie des article sur les price line
This commit is contained in:
parent
d3f7a43afe
commit
41774b1731
Binary file not shown.
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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},
|
||||
|
@ -7,5 +7,5 @@ class PGrade < ApplicationRecord
|
||||
:actions => {:name => "Actions", :reorder => false},
|
||||
}
|
||||
|
||||
ACTIVATED = false
|
||||
ACTIVATED = true
|
||||
end
|
||||
|
@ -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
|
||||
|
@ -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"]
|
||||
|
@ -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?
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
1
app/views/admin/price_lines/add_p_articles.js.erb
Normal file
1
app/views/admin/price_lines/add_p_articles.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "add_p_articles_form"))%>",700,900);
|
Reference in New Issue
Block a user