From 118116ab706186f8cb0f4c3e24c740ff673d61b7 Mon Sep 17 00:00:00 2001
From: Philippe
Date: Thu, 28 Oct 2021 12:25:19 +0200
Subject: [PATCH 01/12] Adding tva_type to price_documents and package_number
to price_line_blocks
---
app/models/price_document.rb | 45 ++++++++++---------
app/models/tva_type.rb | 3 ++
.../admin/price_documents/_form.html.haml | 7 ++-
.../_form_facture_achat.html.haml | 21 ++++-----
app/views/admin/price_lines/_form.html.haml | 1 +
db/migrate/20211028091122_create_tva_types.rb | 17 +++++++
db/schema.rb | 13 +++++-
test/fixtures/tva_types.yml | 11 +++++
test/models/tva_type_test.rb | 7 +++
9 files changed, 91 insertions(+), 34 deletions(-)
create mode 100644 app/models/tva_type.rb
create mode 100644 db/migrate/20211028091122_create_tva_types.rb
create mode 100644 test/fixtures/tva_types.yml
create mode 100644 test/models/tva_type_test.rb
diff --git a/app/models/price_document.rb b/app/models/price_document.rb
index e941947..d81a403 100644
--- a/app/models/price_document.rb
+++ b/app/models/price_document.rb
@@ -5,6 +5,7 @@ class PriceDocument < ApplicationRecord
belongs_to :p_commercial
belongs_to :p_devise
belongs_to :p_payment_type
+ belongs_to :tva_type
has_one :p_compta_element, :dependent => :destroy, :as => :element
@@ -26,7 +27,7 @@ class PriceDocument < ApplicationRecord
accepts_nested_attributes_for :avoir_p_payment_documents, allow_destroy: true
#PURCHASES = ["Demande prix", "Réponse fournisseur", "Commande achat", "Facture achat", "Consultation fournisseur"]
- PURCHASES = ["Commande achat"]
+ PURCHASES = ["Facture 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"]
@@ -265,23 +266,24 @@ class PriceDocument < ApplicationRecord
def self.qi_table_order
{
- :p_customer_code => {:name => "Code client", :reorder => false},
-
-
- :avancement => {:name => "Avancement (%)", :reorder => true},
- :list_designaton => {:name => "Designation liste", :reorder => true},
- :end_date => {:name => "Fin de consultation", :reorder => true},
- :dp_comment => {:name => "Commentaire", :reorder => true},
- :acheteur_text => {:name => "Envoyé à", :reorder => true},
+ :id => {:name => "ID", :reorder => false},
+ :p_customer_code => {:name => "Code client", :reorder => false},
+ #:avancement => {:name => "Avancement (%)", :reorder => true},
+ #:list_designaton => {:name => "Designation liste", :reorder => true},
+ #:end_date => {:name => "Fin de consultation", :reorder => true},
+ #:dp_comment => {:name => "Commentaire", :reorder => true},
+ #:acheteur_text => {:name => "Envoyé à", :reorder => true},
:customer_ref => {:name => "Ref cotation", :reorder => false},
-
- :p_commercial => {:name => "Commercial", :reorder => false},
+ #:p_commercial => {:name => "Commercial", :reorder => false},
:p_customer => {:name => "Client", :reorder => false},
:public_fournisseur_name => {:name => "Nom fournisseur saisi", :reorder => false},
:p_fournisseur => {:name => "Fournisseur", :reorder => false},
:com_counter => {:name => "N° Offre", :reorder => false},
:label => {:name => "Type", :reorder => false},
+ :stock_ok => {:name => "Stock mis à jour ?", :reorder => true},
+ :tva_type_name => {:name => "ID Type de TVA", :reorder => true},
+ :package_number => {:name => "Nombre de colis", :reorder => true},
:d_number => {:name => "Numéro", :reorder => true},
:date => {:name => "Date", :reorder => true},
:cc_payment_end_at => {:name => "Date d'échance", :reorder => true},
@@ -296,21 +298,20 @@ class PriceDocument < ApplicationRecord
:cc_cost_ht => {:name => "Coût HT", :reorder => true, :as => :currency},
:cc_marge_ht => {:name => "Marge HT", :reorder => true, :as => :currency},
:cost_ok => {:name => "Marge calculée", :reorder => true, :as => :boolean},
- :f_token => {:name => "Liens consultation"},
-
-
-
-
-
-
- :stock_ok => {:name => "Stock mis à jour ?", :reorder => true},
+ #:f_token => {:name => "Liens consultation"},
:actions => {:name => "Actions", :reorder => false}
-
-
}
#, :sort_name => "code"
end
+ def ca_tva_type_name
+ self.tva_type.name
+ end
+
+ def package_number
+ self.price_line_block.package_number
+ end
+
def self.valid_sort
r = []
self.qi_table_order.each do |key, value|
@@ -343,7 +344,7 @@ class PriceDocument < ApplicationRecord
include Rails.application.routes.url_helpers
- QI_DYNAMICS = %w(solded_nbr_days solded_at cost_ht marge_ht weight_tot accounting_zone_id accounting_zone_name tot_amount_ht tot_amount_ttc tot_amount_tva label header footer payment_days payment_delais payment_month_end payment_end_at to_paid_ht to_paid_ttc to_paid_tva solded)
+ QI_DYNAMICS = %w(solded_nbr_days solded_at cost_ht marge_ht weight_tot accounting_zone_id accounting_zone_name tot_amount_ht tot_amount_ttc tot_amount_tva label header footer payment_days payment_delais payment_month_end payment_end_at to_paid_ht to_paid_ttc to_paid_tva solded tva_type_name)
def reset_for_update
diff --git a/app/models/tva_type.rb b/app/models/tva_type.rb
new file mode 100644
index 0000000..27bc3ab
--- /dev/null
+++ b/app/models/tva_type.rb
@@ -0,0 +1,3 @@
+class TvaType < ApplicationRecord
+ has_many :price_documents
+end
diff --git a/app/views/admin/price_documents/_form.html.haml b/app/views/admin/price_documents/_form.html.haml
index 60a7314..ea84db3 100644
--- a/app/views/admin/price_documents/_form.html.haml
+++ b/app/views/admin/price_documents/_form.html.haml
@@ -1,3 +1,4 @@
+PRICE_DOCUMENTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
=semantic_form_for [:admin, @price_document], :html => {:class => "qi_price_form"}, :remote => false do |f|
-@p_customer = @price_document.p_customer
=diag do
@@ -42,7 +43,11 @@
-if @price_document.price_document_type_id == 6 or @price_document.price_document_type_id == 7
- = f.input :date, :label => "Date du document :", :as => :date
+ .row
+ .col-6
+ = f.input :date, :label => "Date du document :", :as => :date
+ .col-6
+ = f.input :tva_type_id, :label => "Type de TVA :", as: :select, collection: TvaType.pluck(:name, :id)
.price_line_block_form
=f.semantic_fields_for :price_line_block do |f|
=render :partial => "admin/price_line_blocks/form_#{f.object.block_type_slug}", :locals => {:f => f}
diff --git a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
index dca9aea..88536e2 100644
--- a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
+++ b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
@@ -1,4 +1,4 @@
-
+PRICE LINE BLOCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
=f.inputs do
@@ -34,22 +34,23 @@
= f.input :particular_send_id, :collection => f.object.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de livraison"
-else
=f.inputs do
- = f.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
+ = f.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de livraison"
.clear
%table{:style => "width:100%;"}
%tr
- %td{:style => "width:50%;"}
- = f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date
-
- %td{:style => "width:50%;"}
- = f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date
+ %td
+ =# f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date
+ %td
+ =# f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date
+ .row
+ .col-6
+ = f.input :customer_ref, :label => "Référence commande fournisseur :"
+ .col-6
+ = f.input :package_number, :label => "Nombre de colis :"
-
-
- = f.input :customer_ref, :label => "Référence commande client :"
-if current_admin.has_permission?("customer-sheets-bl")
= f.input :bl_comment, :label => "Commentaire à mettre sur le BL :", :input_html => {:style => "min-height:50px;height:50px;"}
diff --git a/app/views/admin/price_lines/_form.html.haml b/app/views/admin/price_lines/_form.html.haml
index 6861e44..4d21fda 100644
--- a/app/views/admin/price_lines/_form.html.haml
+++ b/app/views/admin/price_lines/_form.html.haml
@@ -3,6 +3,7 @@
%td{:style => "padding-left:10px;", :class => ("error has-error" if form.object.errors[:p_product_ref_id].size > 0 )}
.take.mr-1
+ ="PRICE_LINEEEEEEEE"
=ic :arrows
%td{:style => "white-space: nowrap;"}
diff --git a/db/migrate/20211028091122_create_tva_types.rb b/db/migrate/20211028091122_create_tva_types.rb
new file mode 100644
index 0000000..1d54a38
--- /dev/null
+++ b/db/migrate/20211028091122_create_tva_types.rb
@@ -0,0 +1,17 @@
+class CreateTvaTypes < ActiveRecord::Migration[6.0]
+ def change
+ create_table :tva_types do |t|
+ t.string :name
+
+ t.timestamps
+ end
+
+ TvaType.create(name: "basique")
+ TvaType.create(name: "Sur Marge")
+
+ add_reference :price_documents, :tva_type, index: true
+ add_column :price_documents, :ac_tva_type_name, :string
+ add_column :price_documents, :cc_tva_type_name, :string
+ add_column :price_line_blocks, :package_number, :integer
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 6662bd6..bb88940 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2021_10_18_142636) do
+ActiveRecord::Schema.define(version: 2021_10_28_091122) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -2304,7 +2304,11 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do
t.integer "demande_de_prix_id"
t.integer "avoir_achat_id"
t.integer "facture_achat_id"
+ t.bigint "tva_type_id"
+ t.string "ac_tva_type_name"
+ t.string "cc_tva_type_name"
t.index ["p_customer_id"], name: "index_price_documents_on_p_customer_id"
+ t.index ["tva_type_id"], name: "index_price_documents_on_tva_type_id"
end
create_table "price_line_blocks", force: :cascade do |t|
@@ -2453,6 +2457,7 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do
t.boolean "imported", default: false
t.date "validation_date"
t.string "cc_state"
+ t.integer "package_number"
t.index ["p_customer_id"], name: "index_price_line_blocks_on_p_customer_id"
end
@@ -3007,6 +3012,12 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do
t.index ["accounting_zone_id"], name: "index_tva_rates_on_accounting_zone_id"
end
+ create_table "tva_types", force: :cascade do |t|
+ t.string "name"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ end
+
create_table "tvable_tva_rates", force: :cascade do |t|
t.integer "tvable_id"
t.string "tvable_type"
diff --git a/test/fixtures/tva_types.yml b/test/fixtures/tva_types.yml
new file mode 100644
index 0000000..5181636
--- /dev/null
+++ b/test/fixtures/tva_types.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/models/tva_type_test.rb b/test/models/tva_type_test.rb
new file mode 100644
index 0000000..18c29eb
--- /dev/null
+++ b/test/models/tva_type_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class TvaTypeTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
From 05007c569bb557a19655dfa37b653e528c06124c Mon Sep 17 00:00:00 2001
From: Philippe
Date: Thu, 28 Oct 2021 12:45:37 +0200
Subject: [PATCH 02/12] Adding stock entrace date to price_line_block form
---
.../(__TEMPLATE__)c | Bin 5965 -> 1374 bytes
app/models/price_document.rb | 6 +--
.../_form_facture_achat.html.haml | 38 ++++++++++--------
3 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c b/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c
index f14f6942a4eff9a4b9af0c9026e5b8e2e708b671..e1c3ae14c64ffb6b86d264611307231a215c18c3 100644
GIT binary patch
delta 389
zcmX@BcaKZYSkGL~gv-Ft$jCf3HQB=4I4#v6HPtxPBq=#1&D_W+H6It+*WW5_3~Mm3W{MlU*3sGxAOT!WauA
zgP5*QUc@3R#*>m+T#%Dk$!5(NV#V!HmY7qT8qGFYo>zSGdlp?8&b<7*RInVcLw-R?
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f019c2 100644
--- a/app/models/price_document.rb
+++ b/app/models/price_document.rb
@@ -266,7 +266,8 @@ class PriceDocument < ApplicationRecord
def self.qi_table_order
{
- :id => {:name => "ID", :reorder => false},
+ :id => {:name => "ID", :reorder => false},
+ :actions => {:name => "Actions", :reorder => false},
:p_customer_code => {:name => "Code client", :reorder => false},
#:avancement => {:name => "Avancement (%)", :reorder => true},
#:list_designaton => {:name => "Designation liste", :reorder => true},
@@ -297,9 +298,8 @@ class PriceDocument < ApplicationRecord
:cc_to_paid_ttc => {:name => "Restant dû", :reorder => true, :as => :currency},
:cc_cost_ht => {:name => "Coût HT", :reorder => true, :as => :currency},
:cc_marge_ht => {:name => "Marge HT", :reorder => true, :as => :currency},
- :cost_ok => {:name => "Marge calculée", :reorder => true, :as => :boolean},
+ :cost_ok => {:name => "Marge calculée", :reorder => true, :as => :boolean}
#:f_token => {:name => "Liens consultation"},
- :actions => {:name => "Actions", :reorder => false}
}
#, :sort_name => "code"
end
diff --git a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
index 88536e2..5113806 100644
--- a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
+++ b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
@@ -15,26 +15,26 @@ PRICE LINE BLOCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
-if f.object.p_customer and f.object.p_customer.particular
=render :partial => "admin/p_customers/apercu", :locals => {:particular => f.object.p_customer.particular}
- .addresses.row
- .columns.span_6
- %h3 Adresse de facturation
+ -# .addresses.row
+ -# .columns.span_6
+ -# %h3 Adresse de facturation
- -if f.object.p_customer
- =f.inputs do
- = f.input :particular_bill_id, :collection => f.object.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de facturation"
- -else
- =f.inputs do
- = f.input :particular_bill_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
+ -# -if f.object.p_customer
+ -# =f.inputs do
+ -# = f.input :particular_bill_id, :collection => f.object.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de facturation"
+ -# -else
+ -# =f.inputs do
+ -# = f.input :particular_bill_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
- .columns.span_6
- %h3 Adresse de livraison
+ -# .columns.span_6
+ -# %h3 Adresse de livraison
- -if f.object.p_customer
- =f.inputs do
- = f.input :particular_send_id, :collection => f.object.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de livraison"
- -else
- =f.inputs do
- = f.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de livraison"
+ -# -if f.object.p_customer
+ -# =f.inputs do
+ -# = f.input :particular_send_id, :collection => f.object.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de livraison"
+ -# -else
+ -# =f.inputs do
+ -# = f.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de livraison"
.clear
@@ -45,6 +45,10 @@ PRICE LINE BLOCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
=# f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date
%td
=# f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date
+ .row
+ .col-6
+ = f.input :validation_date, :label => "Date d'entrée en stock :", :as => :date
+
.row
.col-6
= f.input :customer_ref, :label => "Référence commande fournisseur :"
From ee52fca31eb1cd2bba56c995a61d49bef7ef984c Mon Sep 17 00:00:00 2001
From: Philippe
Date: Fri, 29 Oct 2021 18:40:30 +0200
Subject: [PATCH 03/12] PArtciel from OK with device infos, adding coumn to
price line block ct_tot_amount ht and ttc
---
.../(__TEMPLATE__)c | Bin 1374 -> 5965 bytes
app/models/line_stock.rb | 21 ++----
app/models/price_line.rb | 16 -----
app/models/price_line_block.rb | 6 +-
.../p_article_serial_nums/_form.html.haml | 1 -
app/views/admin/p_articles/_form.html.haml | 10 ++-
.../admin/p_product_refs/_form.html.haml | 8 +--
app/views/admin/p_products/_form.html.haml | 2 +-
.../admin/price_documents/_form.html.haml | 4 +-
.../admin/price_documents/show.html.haml | 2 +-
.../_form_facture_achat.html.haml | 18 +++--
app/views/admin/price_lines/_form.html.haml | 66 ++++++------------
.../_form_bon_de_reception_achat.html.haml | 50 +++++++------
db/migrate/20211028091122_create_tva_types.rb | 8 +--
...mns_to_price_docs_adn_price_line_blocks.rb | 10 +++
db/schema.rb | 6 +-
16 files changed, 99 insertions(+), 129 deletions(-)
create mode 100644 db/migrate/20211029111104_add_columns_to_price_docs_adn_price_line_blocks.rb
diff --git a/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c b/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c
index e1c3ae14c64ffb6b86d264611307231a215c18c3..f14f6942a4eff9a4b9af0c9026e5b8e2e708b671 100644
GIT binary patch
literal 5965
zcmbVQUvt~W5f?Qbii9jtbo9@ZEVHzu*orOEk{sE0Gwmg=JYgnrG#1krJz$RHi9!S7
zPym#pdi>UWh4f?eOSNC2eQb9Re~w2&ij*hfh}*s2?(P0|7yG-1y9d_c!NDQ#?RC4a
z&iLMo?w)8J?Dt;r=l$Nx7hJsT9f~iyqPyR+epiy@-U$ywLOOvEguIh7dMo?l4q0Tq
zbI0um!aFTbZW_4)H&uwm0(d?xwi{~?yRv_2hY^pQFmnDn5@C@Pk2>To^LY@8zKuIW
zNgDBSC&CrINCt$wmct=G5g_69M2Rf0p%`{W5S|t#xj(r%-8V;QNPD@13FViged}
zylZW8SG!*V=pG-6c4KuKH!XMIwd;7oDS{u)99Q7p7GMiU-M;{C^(aR{4=pO4h^Pnx
z=R7?BIP(T94%I6=;NCz;vYs5T{sb4}zhzQk;Hx0AeF-Wy%q_<Nw?l5_F
z7K#WS7ntz+N`%(bOS<8#!_f$_1yI3y8AKvzp&-2*|HO}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(`rg==TAv{%?jothMg4LG`%c^6ktvzy2bhCBs27)%9eFwAZh
zj3czIX0wohVY3ekDTwKexTaOSkq0&>Jg^BiuV(OY^*B8|pAqsDXb+eQG7q%02XMz#
z`H+BNv(GaR=!B@H$k}W~t22XVKb;k!7QiPXWOMi+H~VgO`di`$t6tY1YH(GrH=Fuv
z!Og}65Yi&o3=E+Dqh)=xa=W;jOr!{~*}TOdV;FNivRLcnph4lp@eZA6!c8V33I^p{
zbbGWhhB~%Kj}?-qb!Y^hj14~5;2A3b3ez+fBA}aIRAO|3C};XZv#q3w%DzY>jDiia
NrnY#MHog0u{{w}+6Mp~z
delta 389
zcmX@BcaKZYSkGL~gv-Ft$jCf3HQB=4I4#v6HPtxPBq=#1&D_W+H6It+*WW5_3~Mm3W{MlU*3sGxAOT!WauA
zgP5*QUc@3R#*>m+T#%Dk$!5(NV#V!HmY7qT8qGFYo>zSGdlp?8&b<7*RInVcLw-R?
zW`16AH3QJ(lFEYA$(F48%IwzS`PLGg){^!FD8Pv&LQl7O1)pl>bfAZ0D*AZ;yVV6Ew(F}aIP8t9#DHaRm5D?W#k
v)Lfu%N`SsrfrUpkmx2P+lU5+#SaWgJa&d8iJOy+U+vJbjiacy^Qw>7^kL+bZ
diff --git a/app/models/line_stock.rb b/app/models/line_stock.rb
index ab34132..a8886b9 100644
--- a/app/models/line_stock.rb
+++ b/app/models/line_stock.rb
@@ -1,4 +1,4 @@
-class LineStock < ApplicationRecord
+ class LineStock < ApplicationRecord
belongs_to :p_product_ref
belongs_to :stockable, :polymorphic => true
@@ -12,26 +12,17 @@ class LineStock < ApplicationRecord
:stockable => {:name => "Origine", :reorder => false},
:p_product_ref => {:name => "Produit", :reorder => false},
:description => {:name => "Description", :reorder => true, :sort_name => "p_customer_sheets.created_at"},
- :dluo => {:name => "DLUO", :reorder => true},
-
- :qte => {:name => "Quantité", :reorder => true},
+ #:dluo => {:name => "DLUO", :reorder => true},
+ :qte => {:name => "Quantité", :reorder => true },
:qte_available => {:name => "Quantité restante", :reorder => true},
:qte_used => {:name => "Quantité utilisée", :reorder => true},
:price_ht => {:name => "Valeur totale d'origine", :reorder => true, :as => :currency},
-
:price_ht_available => {:name => "Valeur disponnible", :reorder => true, :as => :currency},
-
:price_ht_used => {:name => "Valeur utilisée", :reorder => true, :as => :currency},
-
:price_u_ht => {:name => "Prix Unitaire", :reorder => true, :as => :currency},
-
- :price_u_kg_ht => {:name => "Prix U [Kg]", :reorder => true, :as => :currency},
-
- :qte_kg_per_unit => {:name => "Poids par unité", :reorder => true},
-
- :qte_kg => {:name => "Poids total", :reorder => true},
-
-
+ #:price_u_kg_ht => {:name => "Prix U [Kg]", :reorder => true, :as => :currency},
+ #:qte_kg_per_unit => {:name => "Poids par unité", :reorder => true},
+ #:qte_kg => {:name => "Poids total", :reorder => true},
:actions => {:name => "Actions", :reorder => false},
}
diff --git a/app/models/price_line.rb b/app/models/price_line.rb
index 897399c..dc50cd1 100644
--- a/app/models/price_line.rb
+++ b/app/models/price_line.rb
@@ -540,22 +540,6 @@ class PriceLine < ApplicationRecord
self.ca_discount_ecole_ht
end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
def ca_tot_amount_ht
if self.ct_tot_amount_ht
self.ct_tot_amount_ht
diff --git a/app/models/price_line_block.rb b/app/models/price_line_block.rb
index b6b2b38..0bdb058 100644
--- a/app/models/price_line_block.rb
+++ b/app/models/price_line_block.rb
@@ -681,7 +681,11 @@ class PriceLineBlock < ApplicationRecord
end
def ca_tot_amount_ht
- self.tot_amount_af_discount_ht + self.tot_gen_discount_ht
+ if self.ct_tot_amount_ht
+ return self.ct_tot_amount_ht
+ else
+ self.tot_amount_af_discount_ht + self.tot_gen_discount_ht
+ end
end
def ca_tot_amount_tva
diff --git a/app/views/admin/p_article_serial_nums/_form.html.haml b/app/views/admin/p_article_serial_nums/_form.html.haml
index 545dbdf..d3ec238 100644
--- a/app/views/admin/p_article_serial_nums/_form.html.haml
+++ b/app/views/admin/p_article_serial_nums/_form.html.haml
@@ -16,4 +16,3 @@
=form.inputs do
= form.input :p_serial_num_type_id, :label => "type", as: :select, collection: PSerialNumType.pluck(:name, :id)
= form.input :value
-
diff --git a/app/views/admin/p_articles/_form.html.haml b/app/views/admin/p_articles/_form.html.haml
index f2fbe48..4da53fd 100644
--- a/app/views/admin/p_articles/_form.html.haml
+++ b/app/views/admin/p_articles/_form.html.haml
@@ -2,7 +2,10 @@
.content
=f.inputs do
- = f.input :p_product_ref, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :label => f.object.label_for(:p_product_ref)
+ -if params[:p_product_ref_id]
+ = f.input :p_product_ref, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :selected => f.object.p_product_ref , :label => f.object.label_for(:p_product_ref)
+ -else
+ = 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 :
@@ -11,9 +14,4 @@
=render :partial => "admin/p_article_serial_nums/form", :locals => {:form => form}
%p= link_to_add_fields "Ajouter un numéro de série", f, :p_article_serial_nums, {:class => "btn btn-primary"}
-
-
-
-
-
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
diff --git a/app/views/admin/p_product_refs/_form.html.haml b/app/views/admin/p_product_refs/_form.html.haml
index aa46f8e..a857132 100644
--- a/app/views/admin/p_product_refs/_form.html.haml
+++ b/app/views/admin/p_product_refs/_form.html.haml
@@ -25,10 +25,10 @@
%td
=form.input :ean
%tr
- %td
- =form.input :ct_sorecop, :label => "Sorecop personalisée :"
- %td
- =form.input :sorecop_comment, :label => "Commentaire de Sorecop :"
+ -# %td
+ -# =form.input :ct_sorecop, :label => "Sorecop personalisée :"
+ -# %td
+ -# =form.input :sorecop_comment, :label => "Commentaire de Sorecop :"
%td
=form.input :ct_deee, :label => "DEEE personalisée :"
diff --git a/app/views/admin/p_products/_form.html.haml b/app/views/admin/p_products/_form.html.haml
index d298195..0b0953c 100755
--- a/app/views/admin/p_products/_form.html.haml
+++ b/app/views/admin/p_products/_form.html.haml
@@ -20,7 +20,7 @@
=# f.input :stocked, :label => "Suivi de stock ?"
.col-sm-2
- =f.input :sorecop_cat, label: "Catgorie Sorecop :", :collection => SorecopCat.all, :as => :select, :include_blank => true
+ =#f.input :sorecop_cat, label: "Catgorie Sorecop :", :collection => SorecopCat.all, :as => :select, :include_blank => true
diff --git a/app/views/admin/price_documents/_form.html.haml b/app/views/admin/price_documents/_form.html.haml
index ea84db3..3062be9 100644
--- a/app/views/admin/price_documents/_form.html.haml
+++ b/app/views/admin/price_documents/_form.html.haml
@@ -45,7 +45,9 @@ PRICE_DOCUMENTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
-if @price_document.price_document_type_id == 6 or @price_document.price_document_type_id == 7
.row
.col-6
- = f.input :date, :label => "Date du document :", :as => :date
+ = f.input :date, :label => "Date de la facture achat :", :as => :date
+ .col-6
+ = f.input :supplier_document_date, :label => "Date du document fournisseur :", :as => :date
.col-6
= f.input :tva_type_id, :label => "Type de TVA :", as: :select, collection: TvaType.pluck(:name, :id)
.price_line_block_form
diff --git a/app/views/admin/price_documents/show.html.haml b/app/views/admin/price_documents/show.html.haml
index 19a9616..87f7ba9 100644
--- a/app/views/admin/price_documents/show.html.haml
+++ b/app/views/admin/price_documents/show.html.haml
@@ -243,7 +243,7 @@
= 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
+ = link_to i(:"mobile-alt"), new_admin_p_article_path(p_product_ref_id: price_line.p_product_ref.id), :remote => true
/ %td=# price_line.line_stocks.sum(:price_ht)
diff --git a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
index 5113806..82c3485 100644
--- a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
+++ b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
@@ -1,17 +1,12 @@
PRICE LINE BLOCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
=f.inputs do
-
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
.qi_pannel.qi_plain.padding{:style => "margin:20px 0;"}
- = f.input :p_commercial_id, :label => "Commercial :", :collection => PCommercial.order(:name).all, :as => :select, :member_label => :long_name if f.object.id
-
-
+ =# f.input :p_commercial_id, :label => "Commercial :", :collection => PCommercial.order(:name).all, :as => :select, :member_label => :long_name if f.object.id
= f.hidden_field :p_customer_id, :class => "p_customer_id"
.p_customer_sheet_customer
-
-
-if f.object.p_customer and f.object.p_customer.particular
=render :partial => "admin/p_customers/apercu", :locals => {:particular => f.object.p_customer.particular}
@@ -47,13 +42,11 @@ PRICE LINE BLOCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
=# f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date
.row
.col-6
- = f.input :validation_date, :label => "Date d'entrée en stock :", :as => :date
+ = f.input :stock_entrance_date, :label => "Date d'entrée en stock :", :as => :date
.row
.col-6
= f.input :customer_ref, :label => "Référence commande fournisseur :"
- .col-6
- = f.input :package_number, :label => "Nombre de colis :"
-if current_admin.has_permission?("customer-sheets-bl")
= f.input :bl_comment, :label => "Commentaire à mettre sur le BL :", :input_html => {:style => "min-height:50px;height:50px;"}
@@ -80,11 +73,16 @@ PRICE LINE BLOCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
-if !@avoir
= f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :", :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
- = f.input :ct_tot_fdp_ht, :label => "Frais de port personnalisés :"
+ = f.input :ct_tot_fdp_ht, :label => "Montant des frais de port HT (€) :"
-if !@avoir
-if current_admin.has_permission?("customer-sheets-bl")
= f.input :ct_nbr_ship, :label => "Nombre de colis :"
+
+ = f.input :cc_tot_amount_ttc, label: "Montant TTC à payer", :input_html => {disabled: true}
+ = f.input :cc_tot_amount_ht, label: "Montant HT à payer", input_html: {disabled: true}
+ = f.input :ct_tot_amount_ht, label: "Montant HT personnalisé"
+
-if current_admin.has_permission?("payments")
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
diff --git a/app/views/admin/price_lines/_form.html.haml b/app/views/admin/price_lines/_form.html.haml
index 4d21fda..013f1d6 100644
--- a/app/views/admin/price_lines/_form.html.haml
+++ b/app/views/admin/price_lines/_form.html.haml
@@ -3,69 +3,47 @@
%td{:style => "padding-left:10px;", :class => ("error has-error" if form.object.errors[:p_product_ref_id].size > 0 )}
.take.mr-1
- ="PRICE_LINEEEEEEEE"
=ic :arrows
+ = "PRICE_LINEEEEEEEE"
%td{:style => "white-space: nowrap;"}
-
-
-
.input-group
+ %label Référence
%input.p_product_ref_autocomplete_input.form-control{:type => "text", :style => "", tabindex: 1, autofocus: true, :value => ("#{form.object.p_product_ref.member_label}" if form.object.p_product_ref), :class => "p_product_ref_name"}
= form.hidden_field :p_product_ref_id, :class => "p_product_ref_id"
-
-
-
-
.input-group-append
=link_to "#", class: "btn btn-dark",:onclick => "key=genRanHex(12);select_product_from_manager(key);$(this).closest('tr').find('.p_product_ref_id').attr('id', 'p_product_ref_id_'+key);$(this).closest('tr').find('.p_product_ref_name').attr('id', 'p_product_ref_name_'+key);$(this).closest('tr').find('.p_product_ref_qte').attr('id', 'p_product_ref_qte_'+key);return false;" do
=ic(:search)
-
-
-
-
-
-
-
-
-
-form.object.forced_price = true if form.object.ct_u_price_ht
- -if form.object.forced_price and form.object.p_product_ref
- %td
- .mx-2
- .form-inline
- =qi_js_field_price_line_form(form, :price_line, :price_u_ht, :label => false, label_class: "mr-1", :value => form.object.th_price_u_ht)
- -else
- %td
- .mx-2
- .form-inline
- =qi_js_field_price_line_form(form, :price_line, :price_u_ht, :label =>false, label_class: "mr-1")
+ -# -if form.object.forced_price and form.object.p_product_ref
+ -# %td
+ -# .mx-2
+ -# .form-inline
+ -# =qi_js_field_price_line_form(form, :price_line, :price_u_ht, :label => false, label_class: "mr-1", :value => form.object.th_price_u_ht)
+ -# -else
+ -# %td
+ -# .mx-2
+ -# .form-inline
+ -# =qi_js_field_price_line_form(form, :price_line, :price_u_ht, :label =>false, label_class: "mr-1")
+ -# %td
+ -# .form-inline.mr-2{:style => ("display:none;" if !current_admin or !current_admin.has_permission?("customer-sheets-personalised-price"))}
+ -# = form.input :forced_price, :label => "Prix personnalisé ?", :as => :boolean, :input_html => {:class => "form-inline input_price_line_forced_price"}
+ -# .forced_price_wrapper.mx-2{:style => ("display:none;" if !form.object.forced_price)}= form.input :ct_u_price_ht, :label => false, :input_html => {:class => "input_price_line_ct_u_price_ht"}
%td
- .form-inline.mr-2{:style => ("display:none;" if !current_admin or !current_admin.has_permission?("customer-sheets-personalised-price"))}
- = form.input :forced_price, :label => "Prix personnalisé ?", :as => :boolean, :input_html => {:class => "form-inline input_price_line_forced_price"}
- .forced_price_wrapper.mx-2{:style => ("display:none;" if !form.object.forced_price)}= form.input :ct_u_price_ht, :label => false, :input_html => {:class => "input_price_line_ct_u_price_ht"}
- %td{:style => "width:100px;"}
-
- = form.input :qte, :label => false, :input_html => {:class => "input_price_line_qte form-control p_product_ref_qte", tabindex: 1}
+ = form.input :qte, :label => "Quantité", :input_html => {:class => "input_price_line_qte form-control p_product_ref_qte", tabindex: 1}
+ %td
+ = form.input :ct_u_price_ht, :label => "Prix Unitaire HT :", :input_html => { class: "mx-2"}
+ -# %td
+ -# =form.input :ct_tva_account_id, :collection => options_from_collection_for_select(TvaRate.where(:accounting_zone_id => (@p_customer ? @p_customer.accounting_zone_id : nil)).all, "id", "member_label", form.object.tva_account_id), :as => :select ,:label => false, :include_blank => false , :input_html => {:class => "input_price_line_tva_account_id form-control custom-select"}
%td
-
-
- =form.input :ct_tva_account_id, :collection => options_from_collection_for_select(TvaRate.where(:accounting_zone_id => (@p_customer ? @p_customer.accounting_zone_id : nil)).all, "id", "member_label", form.object.tva_account_id), :as => :select ,:label => false, :include_blank => false , :input_html => {:class => "input_price_line_tva_account_id form-control custom-select"}
-
- %td
-
%span.destroy=link_to_remove_fields ic(:"trash-o"), form
-
-
-
=qi_js_field(form, :price_line, :tva_account_value, :hidden => true)
-
= form.hidden_field :position, :class => "price_line_position_input"
-:javascript
+:javascript
$('.p_product_ref_autocomplete_input').focus()
$( function() {
$('.p_product_ref_autocomplete_input').autocomplete({
diff --git a/app/views/admin/price_lines/_form_bon_de_reception_achat.html.haml b/app/views/admin/price_lines/_form_bon_de_reception_achat.html.haml
index a8d7aa0..8013222 100644
--- a/app/views/admin/price_lines/_form_bon_de_reception_achat.html.haml
+++ b/app/views/admin/price_lines/_form_bon_de_reception_achat.html.haml
@@ -1,27 +1,35 @@
.qi_pannel.qi_plain.padding.price_line_form.col-12.field{:style =>"border-left:4px solid gray;margin-bottom:10px;padding-left:5px;"}
- price_line = form.object
.row
- .col-6.row
- .col-2.d-flex
- .take.mx-3
- =ic :arrows
- %label
- ref :
- %input.p_product_ref_autocomplete_input.form-control.col{:type => "text", :value => ("#{form.object.p_product_ref.ref} #{form.object.p_product_ref.cc_name}" if form.object.p_product_ref)}
+ .col-11
+ .row
+ .col-5.row
+ .col-2.d-flex
+ .take.mx-3
+ =ic :arrows
+ %label
+ Référence :
+ %input.p_product_ref_autocomplete_input.form-control.col{:type => "text", :value => ("#{form.object.p_product_ref.ref} #{form.object.p_product_ref.cc_name}" if form.object.p_product_ref)}
- .col-3.ml-2
- .form-inline
- = form.input :qte, :label => "qte :", :input_html => { class: "mx-2", autofocus: true, tabindex: 1}
- .col-2
- .form-inline
- = form.input :ct_u_price_ht, :label => "PU :", :input_html => { class: "mx-2"}
- .col-1.ml-2
- %span.destroy=link_to_remove_fields ic(:"trash-o"), form
- = form.hidden_field :p_product_ref_id, :class => "p_product_ref_id"
+ .col-3.ml-2
+ .form-inline
+ = form.input :qte, :label => "Quantité :", :input_html => { class: "mx-2", autofocus: true, tabindex: 1}
+ .col-2
+ .form-inline
+ = form.input :ct_u_price_ht, :label => "Prix unitaire HT :", :input_html => { class: "mx-2"}
+ .row
+ .col-5.row
+ .col-2.d-flex
+ .take.mx-3
-
-
- =qi_js_field(form, :price_line, :tva_account_value, :hidden => true)
-
- = form.hidden_field :position, :class => "price_line_position_input"
+ .form-inline
+ =# form.input :ac_tot_amount_ht, :label => "Prix total HT :", :input_html => { class: "mx-2", disabled: true}
+ %label Montant HT :
+ =price_line.tot_amount_ht
+ .col-1
+ .col-1.ml-2
+ %span.destroy=link_to_remove_fields ic(:"trash-o"), form
+ = form.hidden_field :p_product_ref_id, :class => "p_product_ref_id"
+ = qi_js_field(form, :price_line, :tva_account_value, :hidden => true)
+ = form.hidden_field :position, :class => "price_line_position_input"
diff --git a/db/migrate/20211028091122_create_tva_types.rb b/db/migrate/20211028091122_create_tva_types.rb
index 1d54a38..c877bca 100644
--- a/db/migrate/20211028091122_create_tva_types.rb
+++ b/db/migrate/20211028091122_create_tva_types.rb
@@ -6,12 +6,8 @@ class CreateTvaTypes < ActiveRecord::Migration[6.0]
t.timestamps
end
- TvaType.create(name: "basique")
+ TvaType.create(name: "Standard")
TvaType.create(name: "Sur Marge")
-
- add_reference :price_documents, :tva_type, index: true
- add_column :price_documents, :ac_tva_type_name, :string
- add_column :price_documents, :cc_tva_type_name, :string
- add_column :price_line_blocks, :package_number, :integer
+
end
end
diff --git a/db/migrate/20211029111104_add_columns_to_price_docs_adn_price_line_blocks.rb b/db/migrate/20211029111104_add_columns_to_price_docs_adn_price_line_blocks.rb
new file mode 100644
index 0000000..eafc48e
--- /dev/null
+++ b/db/migrate/20211029111104_add_columns_to_price_docs_adn_price_line_blocks.rb
@@ -0,0 +1,10 @@
+class AddColumnsToPriceDocsAdnPriceLineBlocks < ActiveRecord::Migration[6.0]
+ def change
+ add_reference :price_documents, :tva_type, index: true
+ add_column :price_documents, :ac_tva_type_name, :string
+ add_column :price_documents, :cc_tva_type_name, :string
+ add_column :price_documents, :supplier_document_date, :date
+ add_column :price_line_blocks, :stock_entrance_date, :date
+ add_column :price_line_blocks, :ct_tot_amount_ht, :decimal, :precision => 14, :scale => 2
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index bb88940..1a08c45 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2021_10_28_091122) do
+ActiveRecord::Schema.define(version: 2021_10_29_111104) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -2307,6 +2307,7 @@ ActiveRecord::Schema.define(version: 2021_10_28_091122) do
t.bigint "tva_type_id"
t.string "ac_tva_type_name"
t.string "cc_tva_type_name"
+ t.date "supplier_document_date"
t.index ["p_customer_id"], name: "index_price_documents_on_p_customer_id"
t.index ["tva_type_id"], name: "index_price_documents_on_tva_type_id"
end
@@ -2457,7 +2458,8 @@ ActiveRecord::Schema.define(version: 2021_10_28_091122) do
t.boolean "imported", default: false
t.date "validation_date"
t.string "cc_state"
- t.integer "package_number"
+ t.date "stock_entrance_date"
+ t.decimal "ct_tot_amount_ht", precision: 14, scale: 2
t.index ["p_customer_id"], name: "index_price_line_blocks_on_p_customer_id"
end
From f1bad61fd2722ae319293df1754d5bb0b8ff613b Mon Sep 17 00:00:00 2001
From: Philippe
Date: Tue, 2 Nov 2021 19:36:31 +0100
Subject: [PATCH 04/12] adding nested p articles and SN
---
app/assets/stylesheets/pane_hover.scss | 2 +-
.../admin/price_lines_controller.rb | 15 +++++-
app/helpers/application_helper.rb | 3 +-
app/helpers/document_line_helper.rb | 12 +++++
app/models/line_stock.rb | 2 +
app/models/p_article.rb | 4 ++
app/models/p_customer.rb | 9 +++-
app/models/p_customer_sheet.rb | 3 +-
app/models/price_document.rb | 8 ++--
app/models/price_line.rb | 3 ++
app/models/price_line_block.rb | 2 +-
app/models/price_line_p_article.rb | 4 ++
.../p_article_serial_nums/_form.html.haml | 9 ++--
app/views/admin/p_articles/_form.html.haml | 47 ++++++++++++-------
.../admin/p_customer_sheets/_form.html.haml | 30 ++++++++----
app/views/admin/p_products/_form.html.haml | 24 ++++------
.../admin/price_documents/_form.html.haml | 2 +-
.../admin/price_documents/show.html.haml | 47 +++++++++----------
.../admin/price_line_blocks/_form.html.haml | 2 +-
.../_form_facture_achat.html.haml | 19 ++++----
.../price_lines/_add_p_article_form.html.haml | 9 ++++
.../_reponse_pane_hover_form.html.haml | 2 -
...p_articles.js.erb => add_p_article.js.erb} | 2 +-
config/routes.rb | 1 +
...211102094225_add_stockable_to_p_product.rb | 6 +++
...1102105934_create_price_line_p_articles.rb | 12 +++++
db/schema.rb | 13 ++++-
test/fixtures/price_line_p_articles.yml | 11 +++++
test/models/price_line_p_article_test.rb | 7 +++
29 files changed, 212 insertions(+), 98 deletions(-)
create mode 100644 app/models/price_line_p_article.rb
create mode 100644 app/views/admin/price_lines/_add_p_article_form.html.haml
rename app/views/admin/price_lines/{add_p_articles.js.erb => add_p_article.js.erb} (68%)
create mode 100644 db/migrate/20211102094225_add_stockable_to_p_product.rb
create mode 100644 db/migrate/20211102105934_create_price_line_p_articles.rb
create mode 100644 test/fixtures/price_line_p_articles.yml
create mode 100644 test/models/price_line_p_article_test.rb
diff --git a/app/assets/stylesheets/pane_hover.scss b/app/assets/stylesheets/pane_hover.scss
index 31ad878..e94bb43 100644
--- a/app/assets/stylesheets/pane_hover.scss
+++ b/app/assets/stylesheets/pane_hover.scss
@@ -10,7 +10,7 @@
.actions{
- position:absolute;
+ position: static;
bottom:0px;
left:0px;
right:0px;
diff --git a/app/controllers/admin/price_lines_controller.rb b/app/controllers/admin/price_lines_controller.rb
index 0874893..be13d20 100644
--- a/app/controllers/admin/price_lines_controller.rb
+++ b/app/controllers/admin/price_lines_controller.rb
@@ -1,5 +1,5 @@
# -*- encoding : utf-8 -*-
-
+require "awesome_print"
class Admin::PriceLinesController < ApplicationController
layout "admin"
before_action :auth_admin, :except => [:edit, :update]
@@ -44,12 +44,17 @@ class Admin::PriceLinesController < ApplicationController
def update
+ puts "PAAMSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
+ puts params
+ puts "PAAMSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
@price_line = PriceLine.find(params[:id])
-
if @price_line.update_attributes(params.require(:price_line).permit!)
else
+ puts "ERRORSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
+ puts @price_line.errors.messages
+ puts "ERRORSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
render action: "edit"
end
@@ -62,4 +67,10 @@ class Admin::PriceLinesController < ApplicationController
@price_line.destroy
end
+
+ def add_p_article
+ @price_line = PriceLine.find(params[:price_line_id])
+ # @p_article = PArticle.new#@price_line.p_articles.build
+ # @p_article_serial_nums = @p_article.p_article_serial_nums.build
+ end
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 31e8de0..43aa011 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -78,7 +78,6 @@ module ApplicationHelper
icon = sort_direction == "asc" ? "chevron-up" : "chevron-down"
icon = column == sort_column ? icon : ""
link_to raw("#{title} "+ic(icon).html_safe), request.query_parameters.merge({column: column, direction: direction})
- end
-
+ end
end
diff --git a/app/helpers/document_line_helper.rb b/app/helpers/document_line_helper.rb
index 0e54205..88a9a6e 100644
--- a/app/helpers/document_line_helper.rb
+++ b/app/helpers/document_line_helper.rb
@@ -20,6 +20,18 @@ module DocumentLineHelper
end
+
+ if association == :p_articles
+
+
+
+ new_object.p_product_ref_id = f.object.p_product_ref_id
+
+
+
+
+ end
+
if options[:partial]
fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder|
render(options[:partial], :form => builder)
diff --git a/app/models/line_stock.rb b/app/models/line_stock.rb
index a8886b9..9847dfb 100644
--- a/app/models/line_stock.rb
+++ b/app/models/line_stock.rb
@@ -6,6 +6,8 @@
belongs_to :price_line_block
belongs_to :stock_movement_line
belongs_to :partition_lines
+
+
acts_as_sorting :fields => {
:id => {:name => "ID", :reorder => false},
:date => {:name => "Date", :reorder => true, :as => :date},
diff --git a/app/models/p_article.rb b/app/models/p_article.rb
index ca44f4f..bd9cbdc 100644
--- a/app/models/p_article.rb
+++ b/app/models/p_article.rb
@@ -7,8 +7,12 @@ class PArticle < ApplicationRecord
has_many :p_article_serial_nums, dependent: :destroy
# has_many :p_serial_num_values, through: :p_article_serial_nums
+ has_many :price_line_p_articles
+ has_many :price_lines, through: :price_line_p_articles
accepts_nested_attributes_for :p_article_serial_nums
+
+
validates_presence_of :p_product_ref
# has_many :p_product_ref_specs, through: :p_product_ref
# accepts_nested_attributes_for :p_product_ref_specs
diff --git a/app/models/p_customer.rb b/app/models/p_customer.rb
index 372e15b..0d11ced 100644
--- a/app/models/p_customer.rb
+++ b/app/models/p_customer.rb
@@ -73,8 +73,13 @@ class PCustomer < ApplicationRecord
def generate_code
if !self.code
- last_used_code = self.class.all.order(code: :desc).limit(1)[0].code
- last_number = last_used_code.match(/\d+/).to_s.to_i + 1
+ if self.class.all.order(code: :desc).limit(1)[0]
+ last_used_code = self.class.all.order(code: :desc).limit(1)[0].code
+ last_number = last_used_code.match(/\d+/).to_s.to_i + 1
+ else
+ last_used_code = 1
+ last_number = 1
+ end
code = "CLI%04d" % [last_number]
diff --git a/app/models/p_customer_sheet.rb b/app/models/p_customer_sheet.rb
index cada486..45d7409 100644
--- a/app/models/p_customer_sheet.rb
+++ b/app/models/p_customer_sheet.rb
@@ -12,8 +12,9 @@ class PCustomerSheet < ApplicationRecord
belongs_to :p_customer
belongs_to :particular_bill, :class_name => "Particular"#, :dependent => :destroy
+ accepts_nested_attributes_for :particular_bill
belongs_to :particular_send, :class_name => "Particular"#, :dependent => :destroy
-
+ accepts_nested_attributes_for :particular_send
has_one :price_line_block, :as => :price_lineable
diff --git a/app/models/price_document.rb b/app/models/price_document.rb
index 0f019c2..de113f8 100644
--- a/app/models/price_document.rb
+++ b/app/models/price_document.rb
@@ -284,7 +284,7 @@ class PriceDocument < ApplicationRecord
:label => {:name => "Type", :reorder => false},
:stock_ok => {:name => "Stock mis à jour ?", :reorder => true},
:tva_type_name => {:name => "ID Type de TVA", :reorder => true},
- :package_number => {:name => "Nombre de colis", :reorder => true},
+ #:package_number => {:name => "Nombre de colis", :reorder => true},
:d_number => {:name => "Numéro", :reorder => true},
:date => {:name => "Date", :reorder => true},
:cc_payment_end_at => {:name => "Date d'échance", :reorder => true},
@@ -308,9 +308,9 @@ class PriceDocument < ApplicationRecord
self.tva_type.name
end
- def package_number
- self.price_line_block.package_number
- end
+ # def package_number
+ # self.price_line_block.package_number
+ # end
def self.valid_sort
r = []
diff --git a/app/models/price_line.rb b/app/models/price_line.rb
index dc50cd1..3eb2621 100644
--- a/app/models/price_line.rb
+++ b/app/models/price_line.rb
@@ -10,6 +10,9 @@ class PriceLine < ApplicationRecord
has_one :p_fournisseur, :through => :price_line_block
#has_many :price_line_demands, through: :price_line_resp_selects
+ has_many :price_line_p_articles
+ has_many :p_articles, through: :price_line_p_articles
+ accepts_nested_attributes_for :p_articles
default_scope { order('position ASC') }
diff --git a/app/models/price_line_block.rb b/app/models/price_line_block.rb
index 0bdb058..8e4ee2c 100644
--- a/app/models/price_line_block.rb
+++ b/app/models/price_line_block.rb
@@ -543,7 +543,7 @@ class PriceLineBlock < ApplicationRecord
def ca_tot_lines_tva
r = 0.0
self.price_lines.each do |pl|
- r+= pl.tot_amount_tva
+ r+= pl.tot_amount_tva if pl
end
return r
end
diff --git a/app/models/price_line_p_article.rb b/app/models/price_line_p_article.rb
new file mode 100644
index 0000000..2edaf5e
--- /dev/null
+++ b/app/models/price_line_p_article.rb
@@ -0,0 +1,4 @@
+class PriceLinePArticle < ApplicationRecord
+ belongs_to :price_line
+ belongs_to :p_article
+end
diff --git a/app/views/admin/p_article_serial_nums/_form.html.haml b/app/views/admin/p_article_serial_nums/_form.html.haml
index d3ec238..88de8b6 100644
--- a/app/views/admin/p_article_serial_nums/_form.html.haml
+++ b/app/views/admin/p_article_serial_nums/_form.html.haml
@@ -12,7 +12,8 @@
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
- else
- .p_article_serial_nums_form.field
- =form.inputs do
- = form.input :p_serial_num_type_id, :label => "type", as: :select, collection: PSerialNumType.pluck(:name, :id)
- = form.input :value
+ .ml-5
+ .p_article_serial_nums_form.field
+ =form.inputs do
+ = form.input :p_serial_num_type_id, :label => "type", as: :select, collection: PSerialNumType.pluck(:name, :id)
+ = form.input :value
diff --git a/app/views/admin/p_articles/_form.html.haml b/app/views/admin/p_articles/_form.html.haml
index 4da53fd..3a2568b 100644
--- a/app/views/admin/p_articles/_form.html.haml
+++ b/app/views/admin/p_articles/_form.html.haml
@@ -1,17 +1,32 @@
-=semantic_form_for [:admin, @p_article], :remote => true do |f|
+- if params[:controller] == "admin/p_articles"
+ =semantic_form_for [:admin, @p_article], :remote => true do |f|
+ .content
+ =f.inputs do
+ -if params[:p_product_ref_id]
+ = f.input :p_product_ref, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :selected => f.object.p_product_ref , :label => f.object.label_for(:p_product_ref)
+ -else
+ = 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 :
+ .p_article_serial_nums_form
+ = f.semantic_fields_for :p_article_serial_nums do |form|
+ =render :partial => "admin/p_article_serial_nums/form", :locals => {:form => form}
+ %p= link_to_add_fields "Ajouter un numéro de série", f, :p_article_serial_nums, {:class => "btn btn-primary"}
- .content
- =f.inputs do
- -if params[:p_product_ref_id]
- = f.input :p_product_ref, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :selected => f.object.p_product_ref , :label => f.object.label_for(:p_product_ref)
- -else
- = 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 :
- .p_article_serial_nums_form
- = f.semantic_fields_for :p_article_serial_nums do |form|
- =render :partial => "admin/p_article_serial_nums/form", :locals => {:form => form}
- %p= link_to_add_fields "Ajouter un numéro de série", f, :p_article_serial_nums, {:class => "btn btn-primary"}
-
- .actions=f.submit "sauvegarder", :class => "btn btn-primary"
+ .actions=f.submit "sauvegarder", :class => "btn btn-primary"
+- else
+ = form.inputs do
+ -if params[:p_product_ref_id]
+ = form.input :p_product_ref_id, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :label => form.object.label_for(:p_product_ref), input_html: {disabled: true}
+ = form.hidden_field :p_product_ref_id, value: form.object.p_product_ref_id
+ -else
+ = form.input :p_product_ref_id, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :label => form.object.label_for(:p_product_ref), input_html: {disabled: true}
+ = form.hidden_field :p_product_ref_id, value: form.object.p_product_ref_id
+ -if PGrade::ACTIVATED
+ = form.input :p_grade, as: :select, collection: PGrade.pluck(:grade, :id), :label => "Grade"
+ %h4 Numero de série :
+ .p_article_serial_nums_form
+ = form.semantic_fields_for :p_article_serial_nums do |form|
+ =render :partial => "admin/p_article_serial_nums/form", :locals => {:form => form}
+ %p= link_to_add_fields "Ajouter un numéro de série", form, :p_article_serial_nums, {:class => "btn btn-primary"}
diff --git a/app/views/admin/p_customer_sheets/_form.html.haml b/app/views/admin/p_customer_sheets/_form.html.haml
index 2c1194a..f38a269 100755
--- a/app/views/admin/p_customer_sheets/_form.html.haml
+++ b/app/views/admin/p_customer_sheets/_form.html.haml
@@ -5,21 +5,31 @@
.content
.qi_row
.qi_pannel.qi_plain.padding.row
- .col-2
+ .col-8
+ =@p_customer_sheet.p_customer.particular.organisation
-if @p_customer_sheet and @p_customer_sheet.state != "commande"
=#form.input :demande_type, :collection => ["Brouillon", "Demande de bon de commande","Demande de devis"], :as => :select, :include_blank => false, :label => "Type de demande :"
-
- =form.input :state, :collection => ["AV BPA", "PAS BPA","BPA", "Traitée"], :as => :select, :include_blank => false, :label => "Statut :"
-
- =form.input :past_id, :label => "N° système actuel"
- =yield :discount
- .col-2
+ =#form.input :state, :collection => ["AV BPA", "PAS BPA","BPA", "Traitée"], :as => :select, :include_blank => false, :label => "Statut :"
+ =#form.input :past_id, :label => "N° système actuel"
=yield :shipping_date
- .col-8
- =yield :particular
+
+ .qi_row
+ .qi_pannel.qi_plain.padding.row
+ nested form for particular send et bill qui crée à chaque fois un particular
+ ajouter accept nested attributed for particular dans pcustomer sheet
+
- =yield :price_lines
+ .qi_row
+ .qi_pannel.qi_plain.padding.row
+ =yield :price_lines
+ .qi_row
+ .qi_pannel.qi_plain.padding.row
+ =yield :discount
+
+
+
+
.large_actions
.actions
=link_to "Annuler", admin_p_customer_sheets_path(), :class => "btn"
diff --git a/app/views/admin/p_products/_form.html.haml b/app/views/admin/p_products/_form.html.haml
index 0b0953c..d8f02c4 100755
--- a/app/views/admin/p_products/_form.html.haml
+++ b/app/views/admin/p_products/_form.html.haml
@@ -4,26 +4,24 @@
.qi_pannel.qi_plain.padding
=f.inputs do
.row.qi_cancel_margins
-
.col-sm-2
= f.input :p_product_cat_id, :label => "Catégorie produit :", :collection => PProductCat.all, :as => :select, :include_blank => false
-
-
.col-sm-2
%br
= f.input :enabled, :label => "Produit actif ?"
-
.col-sm-2
-
+ %br
+ = f.input :stockable, :label => "Produit stockable ?", :input_html => {:onclick => "$('#with_serial').toggle('slow');"}
+ .col-sm-2
+ %br
+ #with_serial
+ = f.input :with_serial_number, :label => "Avec n° de série ?"
+ .col-sm-2
=f.input :s_brand_id, :label => "Marque :", :collection => SBrand.all, :as => :select, :include_blank => true
-
=# f.input :stocked, :label => "Suivi de stock ?"
-
.col-sm-2
=#f.input :sorecop_cat, label: "Catgorie Sorecop :", :collection => SorecopCat.all, :as => :select, :include_blank => true
-
-
-
+
-if false
%table{:style => "width:100%"}
%tr
@@ -108,9 +106,3 @@
}
-
-
-
-
-
-
diff --git a/app/views/admin/price_documents/_form.html.haml b/app/views/admin/price_documents/_form.html.haml
index 3062be9..0f516cc 100644
--- a/app/views/admin/price_documents/_form.html.haml
+++ b/app/views/admin/price_documents/_form.html.haml
@@ -45,7 +45,7 @@ PRICE_DOCUMENTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
-if @price_document.price_document_type_id == 6 or @price_document.price_document_type_id == 7
.row
.col-6
- = f.input :date, :label => "Date de la facture achat :", :as => :date
+ = f.input :date, :label => "Date de la facture achat :", :as => :date, input_html: {value: Date.today}
.col-6
= f.input :supplier_document_date, :label => "Date du document fournisseur :", :as => :date
.col-6
diff --git a/app/views/admin/price_documents/show.html.haml b/app/views/admin/price_documents/show.html.haml
index 87f7ba9..59cf845 100644
--- a/app/views/admin/price_documents/show.html.haml
+++ b/app/views/admin/price_documents/show.html.haml
@@ -18,7 +18,7 @@
.qi_row
-
+ =debug @price_document.price_line_block.price_lines.count
%table.table.table-striped
-if @price_document.label == "Réponse fournisseur"
@@ -196,7 +196,7 @@
%table.table
%thead
%tr
- %th
+ %th ID
%th Référence
%th Marque
%th Désignation
@@ -205,47 +205,46 @@
%th TVA
%th Montant HT
%th Actions
-
- %tbody
- -price_line_block.price_lines.each do |price_line|
+
+ -price_line_block.price_lines.each do |price_line|
+ %tbody
%tr
- %td
- ="##{price_line.id}"
+ -if price_line.p_articles.count == 0
+ %td{style: "background-color: red;"}
+ ="##{price_line.id}"
+ - elsif price_line.p_articles.count < price_line.qte
+ %td{style: "background-color: orange"}
+ ="##{price_line.id}"
+ - else
+ %td{style: "background-color: green"}
+ ="##{price_line.id}"
%td
=price_line.ref
-
-
-
-
%td
=price_line.p_product_ref.p_product.s_brand.name
-
%td{class: "p_product_ref_cc_name_#{@price_document.id}"}
=link_to price_line.p_product_ref.cc_name, edit_admin_p_product_path(price_line.p_product_ref.p_product) if price_line.p_product_ref and price_line.p_product_ref.p_product
-
%td.numeraire{class: "price_line_qte_#{@price_document.id}"}
=price_line.qte
-
%td.numeraire{class: "price_line_price_u_ht_#{@price_document.id}"}
=number_to_currency price_line.price_u_ht
-
-
%td.numeraire
=price_line.tva_account_value.to_s+"%"
-
-
-
-
%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(p_product_ref_id: price_line.p_product_ref.id), :remote => true
-
- / %td=# price_line.line_stocks.sum(:price_ht)
+ = link_to i(:"mobile-alt"), add_p_article_admin_price_lines_path(p_product_ref_id: price_line.p_product_ref.id, price_line_id: price_line.id), :remote => true
+ -price_line.p_articles.each do |p_article|
+ %tr
+ %td
+ %td="##{p_article.id}"
+ %td=p_article.p_product_ref.name
+ %td
+ - p_article.p_article_serial_nums.each do |sn|
+ ="#{sn.p_serial_num_type.name} - #{sn.value} /"
.qi_row
-if current_admin.has_permission?("show-costs")
diff --git a/app/views/admin/price_line_blocks/_form.html.haml b/app/views/admin/price_line_blocks/_form.html.haml
index f01c327..8f441a3 100644
--- a/app/views/admin/price_line_blocks/_form.html.haml
+++ b/app/views/admin/price_line_blocks/_form.html.haml
@@ -80,7 +80,7 @@
=content_for :discount do
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
-if !@avoir
- = f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :", :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
+ = f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :"#, :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
= f.input :ct_tot_fdp_ht, :label => "Frais de port personnalisés :"
diff --git a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
index 82c3485..db81fc0 100644
--- a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
+++ b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
@@ -42,14 +42,14 @@ PRICE LINE BLOCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
=# f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date
.row
.col-6
- = f.input :stock_entrance_date, :label => "Date d'entrée en stock :", :as => :date
+ = f.input :stock_entrance_date, :label => "Date d'entrée en stock :", :as => :date, input_html: {value: Date.today}
.row
.col-6
= f.input :customer_ref, :label => "Référence commande fournisseur :"
-if current_admin.has_permission?("customer-sheets-bl")
- = f.input :bl_comment, :label => "Commentaire à mettre sur le BL :", :input_html => {:style => "min-height:50px;height:50px;"}
+ =# f.input :bl_comment, :label => "Commentaire à mettre sur le BL :", :input_html => {:style => "min-height:50px;height:50px;"}
-if @p_customer_sheet and @p_customer_sheet.p_customer and @p_customer_sheet.p_customer.p_customer_sheet_note?
%div
@@ -71,17 +71,18 @@ PRICE LINE BLOCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
.qi_pannel.qi_plain.padding.price_line_block_footer{:style => "margin:20px 0;"}
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
+ = f.input :cc_tot_amount_ht, label: "Somme HT des produits", input_html: {disabled: true}
-if !@avoir
- = f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :", :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
- = f.input :ct_tot_fdp_ht, :label => "Montant des frais de port HT (€) :"
+ =# f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :", :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
+ =# f.input :ct_tot_fdp_ht, :label => "Montant des frais de port HT (€) :"
-if !@avoir
-if current_admin.has_permission?("customer-sheets-bl")
- = f.input :ct_nbr_ship, :label => "Nombre de colis :"
-
- = f.input :cc_tot_amount_ttc, label: "Montant TTC à payer", :input_html => {disabled: true}
- = f.input :cc_tot_amount_ht, label: "Montant HT à payer", input_html: {disabled: true}
- = f.input :ct_tot_amount_ht, label: "Montant HT personnalisé"
+ =# f.input :ct_nbr_ship, :label => "Nombre de colis :"
+ = f.input :ct_tot_amount_ht, label: "Montant HT à payer"
+ = f.input :cc_tot_amount_ttc, label: "Montant TTC à payer", :input_html => {disabled: false}
+
+
-if current_admin.has_permission?("payments")
diff --git a/app/views/admin/price_lines/_add_p_article_form.html.haml b/app/views/admin/price_lines/_add_p_article_form.html.haml
new file mode 100644
index 0000000..6367aa5
--- /dev/null
+++ b/app/views/admin/price_lines/_add_p_article_form.html.haml
@@ -0,0 +1,9 @@
+.mx-2.my-2
+ =semantic_form_for [:admin, @price_line], :remote => true do |f|
+ .content
+ =f.inputs do
+ .p_articles_form
+ = f.semantic_fields_for :p_articles do |form|
+ =render :partial => "admin/p_articles/form", :locals => {:form => form, @price_line => f.object}
+ %p= link_to_add_fields "Ajouter un article", f, :p_articles, {:class => "btn btn-primary"} if f.object.p_articles.count < f.object.qte
+ .actions=f.submit "Sauvegarder", :class => "btn btn-primary"
diff --git a/app/views/admin/price_lines/_reponse_pane_hover_form.html.haml b/app/views/admin/price_lines/_reponse_pane_hover_form.html.haml
index 4444417..7bf404a 100644
--- a/app/views/admin/price_lines/_reponse_pane_hover_form.html.haml
+++ b/app/views/admin/price_lines/_reponse_pane_hover_form.html.haml
@@ -1,5 +1,3 @@
-
-
=semantic_form_for [:admin, @price_line], :remote => true do |form|
.content
diff --git a/app/views/admin/price_lines/add_p_articles.js.erb b/app/views/admin/price_lines/add_p_article.js.erb
similarity index 68%
rename from app/views/admin/price_lines/add_p_articles.js.erb
rename to app/views/admin/price_lines/add_p_article.js.erb
index dc68c39..b669ed6 100644
--- a/app/views/admin/price_lines/add_p_articles.js.erb
+++ b/app/views/admin/price_lines/add_p_article.js.erb
@@ -1 +1 @@
-show_pane_hover("<%= escape_javascript(render(:partial => "add_p_articles_form"))%>",700,900);
\ No newline at end of file
+show_pane_hover("<%= escape_javascript(render(:partial => "add_p_article_form"))%>",700,900);
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index a385f22..6c3c724 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -697,6 +697,7 @@ Rails.application.routes.draw do
end
collection do
+ get :add_p_article
end
end
diff --git a/db/migrate/20211102094225_add_stockable_to_p_product.rb b/db/migrate/20211102094225_add_stockable_to_p_product.rb
new file mode 100644
index 0000000..db26f91
--- /dev/null
+++ b/db/migrate/20211102094225_add_stockable_to_p_product.rb
@@ -0,0 +1,6 @@
+class AddStockableToPProduct < ActiveRecord::Migration[6.0]
+ def change
+ add_column :p_products, :stockable, :boolean
+ add_column :p_products, :with_serial_number, :boolean
+ end
+end
diff --git a/db/migrate/20211102105934_create_price_line_p_articles.rb b/db/migrate/20211102105934_create_price_line_p_articles.rb
new file mode 100644
index 0000000..b505378
--- /dev/null
+++ b/db/migrate/20211102105934_create_price_line_p_articles.rb
@@ -0,0 +1,12 @@
+class CreatePriceLinePArticles < ActiveRecord::Migration[6.0]
+ def change
+ create_table :price_line_p_articles do |t|
+ t.belongs_to :p_article
+ t.belongs_to :price_line
+
+ t.timestamps
+ end
+ #add_reference :price_lines, :price_line_p_article, index: true
+ #add_reference :p_articles, :price_line_p_article, index: true
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 1a08c45..3fe7b90 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2021_10_29_111104) do
+ActiveRecord::Schema.define(version: 2021_11_02_105934) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -1930,6 +1930,8 @@ ActiveRecord::Schema.define(version: 2021_10_29_111104) do
t.boolean "conserve_proportion", default: false
t.boolean "frontpage", default: true
t.integer "sorecop_cat_id"
+ t.boolean "stockable"
+ t.boolean "with_serial_number"
t.index ["p_product_cat_id"], name: "index_p_products_on_p_product_cat_id"
t.index ["s_brand_id"], name: "index_p_products_on_s_brand_id"
end
@@ -2463,6 +2465,15 @@ ActiveRecord::Schema.define(version: 2021_10_29_111104) do
t.index ["p_customer_id"], name: "index_price_line_blocks_on_p_customer_id"
end
+ create_table "price_line_p_articles", force: :cascade do |t|
+ t.bigint "p_article_id"
+ t.bigint "price_line_id"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["p_article_id"], name: "index_price_line_p_articles_on_p_article_id"
+ t.index ["price_line_id"], name: "index_price_line_p_articles_on_price_line_id"
+ end
+
create_table "price_line_resp_selects", force: :cascade do |t|
t.integer "price_line_demand_id"
t.integer "price_line_resp_id"
diff --git a/test/fixtures/price_line_p_articles.yml b/test/fixtures/price_line_p_articles.yml
new file mode 100644
index 0000000..5181636
--- /dev/null
+++ b/test/fixtures/price_line_p_articles.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/models/price_line_p_article_test.rb b/test/models/price_line_p_article_test.rb
new file mode 100644
index 0000000..8c4666d
--- /dev/null
+++ b/test/models/price_line_p_article_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class PriceLinePArticleTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
From d0646650c75176c0814b123bd90c9e14c00200c3 Mon Sep 17 00:00:00 2001
From: Philippe
Date: Wed, 3 Nov 2021 16:37:41 +0100
Subject: [PATCH 05/12] adding SN to sell price_line
---
.../(__TEMPLATE__)c | Bin 5965 -> 1374 bytes
.../admin/line_stocks_controller.rb | 4 +
.../admin/p_customer_sheets_controller.rb | 21 ++--
.../admin/price_lines_controller.rb | 13 +--
app/helpers/application_helper.rb | 12 ++-
app/models/line_stock.rb | 3 +
app/models/line_stock_p_article.rb | 4 +
app/models/p_article.rb | 3 +
app/models/p_customer_sheet.rb | 3 +-
app/models/particular.rb | 1 +
app/models/price_document.rb | 5 +
app/models/price_line.rb | 1 +
app/models/price_line_block.rb | 21 +++-
.../admin/line_stocks/_line_stock.html.haml | 1 +
.../_show_p_article_form.html.haml | 13 +++
app/views/admin/line_stocks/index.html.haml | 1 +
.../admin/line_stocks/show_p_article.js.erb | 1 +
app/views/admin/p_articles/_form.html.haml | 3 +-
.../admin/p_customer_sheets/_form.html.haml | 20 +---
app/views/admin/particulars/_form.html.haml | 14 ++-
.../admin/price_documents/show.html.haml | 14 +--
.../admin/price_line_blocks/_form.html.haml | 100 ++++++++----------
.../_price_line_block.html.haml | 3 +
.../price_line_p_articles/_form.html.haml | 1 +
.../_add_price_line_p_article_form.html.haml | 9 ++
.../add_price_line_p_article.js.erb | 1 +
config/routes.rb | 2 +
...1103085623_create_line_stock_p_articles.rb | 10 ++
db/schema.rb | 11 +-
test/fixtures/line_stock_p_articles.yml | 11 ++
test/models/line_stock_p_article_test.rb | 7 ++
31 files changed, 196 insertions(+), 117 deletions(-)
create mode 100644 app/models/line_stock_p_article.rb
create mode 100644 app/views/admin/line_stocks/_show_p_article_form.html.haml
create mode 100644 app/views/admin/line_stocks/show_p_article.js.erb
create mode 100644 app/views/admin/price_line_p_articles/_form.html.haml
create mode 100644 app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
create mode 100644 app/views/admin/price_lines/add_price_line_p_article.js.erb
create mode 100644 db/migrate/20211103085623_create_line_stock_p_articles.rb
create mode 100644 test/fixtures/line_stock_p_articles.yml
create mode 100644 test/models/line_stock_p_article_test.rb
diff --git a/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c b/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c
index f14f6942a4eff9a4b9af0c9026e5b8e2e708b671..e1c3ae14c64ffb6b86d264611307231a215c18c3 100644
GIT binary patch
delta 389
zcmX@BcaKZYSkGL~gv-Ft$jCf3HQB=4I4#v6HPtxPBq=#1&D_W+H6It+*WW5_3~Mm3W{MlU*3sGxAOT!WauA
zgP5*QUc@3R#*>m+T#%Dk$!5(NV#V!HmY7qT8qGFYo>zSGdlp?8&b<7*RInVcLw-R?
zW`16AH3QJ(lFEYA$(F48%IwzS`PLGg){^!FD8Pv&LQl7O1)pl>bfAZ0D*AZ;yVV6Ew(F}aIP8t9#DHaRm5D?W#k
v)Lfu%N`SsrfrUpkmx2P+lU5+#SaWgJa&d8iJOy+U+vJbjiacy^Qw>7^kL+bZ
literal 5965
zcmbVQUvt~W5f?Qbii9jtbo9@ZEVHzu*orOEk{sE0Gwmg=JYgnrG#1krJz$RHi9!S7
zPym#pdi>UWh4f?eOSNC2eQb9Re~w2&ij*hfh}*s2?(P0|7yG-1y9d_c!NDQ#?RC4a
z&iLMo?w)8J?Dt;r=l$Nx7hJsT9f~iyqPyR+epiy@-U$ywLOOvEguIh7dMo?l4q0Tq
zbI0um!aFTbZW_4)H&uwm0(d?xwi{~?yRv_2hY^pQFmnDn5@C@Pk2>To^LY@8zKuIW
zNgDBSC&CrINCt$wmct=G5g_69M2Rf0p%`{W5S|t#xj(r%-8V;QNPD@13FViged}
zylZW8SG!*V=pG-6c4KuK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4Qukx3u{_|t7SP#gfhftbnzxM2X)#0CJt*FTEO
z_dqHz|7^wX{2_8&Lf*$X(}eqW>ND=b&|heb5tN9|!Fwl&>N8;dh>ezRO`0gALH^
z5A1k(1(J$^w38A6pX>PYmMm7xYc
z(Uk#Lx`9uJ(5ySUdV(`rg==TAv{%?jothMg4LG`%c^6ktvzy2bhCBs27)%9eFwAZh
zj3czIX0wohVY3ekDTwKexTaOSkq0&>Jg^BiuV(OY^*B8|pAqsDXb+eQG7q%02XMz#
z`H+BNv(GaR=!B@H$k}W~t22XVKb;k!7QiPXWOMi+H~VgO`di`$t6tY1YH(GrH=Fuv
z!Og}65Yi&o3=E+Dqh)=xa=W;jOr!{~*}TOdV;FNivRLcnph4lp@eZA6!c8V33I^p{
zbbGWhhB~%Kj}?-qb!Y^hj14~5;2A3b3ez+fBA}aIRAO|3C};XZv#q3w%DzY>jDiia
NrnY#MHog0u{{w}+6Mp~z
diff --git a/app/controllers/admin/line_stocks_controller.rb b/app/controllers/admin/line_stocks_controller.rb
index 81131f2..caab464 100644
--- a/app/controllers/admin/line_stocks_controller.rb
+++ b/app/controllers/admin/line_stocks_controller.rb
@@ -133,4 +133,8 @@ class Admin::LineStocksController < ApplicationController
def empty_stock
@price_document = PriceDocument.where(:price_document_type_id => 4, :cost_ok => false)
end
+
+ def show_p_article
+ @line_stock = LineStock.find(params[:line_stock_id])
+ end
end
diff --git a/app/controllers/admin/p_customer_sheets_controller.rb b/app/controllers/admin/p_customer_sheets_controller.rb
index 8905ef1..806e13f 100644
--- a/app/controllers/admin/p_customer_sheets_controller.rb
+++ b/app/controllers/admin/p_customer_sheets_controller.rb
@@ -146,17 +146,20 @@ class Admin::PCustomerSheetsController < ApplicationController
def new
-
-
@p_customer_sheet = PCustomerSheet.new()
-
@p_customer = PCustomer.find(params[:p_customer_id]) if params[:p_customer_id]
-
+
+
@p_customer_sheet.p_customer = @p_customer
- @p_customer_sheet.price_line_block = PriceLineBlock.new(:particular_bill_id => @p_customer.particular_bill_id, :particular_send_id => @p_customer.particular_send_id)
+ @p_customer_sheet.price_line_block = PriceLineBlock.new
@p_customer_sheet.price_line_block.price_lines.build
@p_customer_sheet.price_line_block.p_customer = @p_customer
+
+ @p_customer_sheet.price_line_block.build_particular_send(owner: @p_customer)
+ @p_customer_sheet.price_line_block.build_particular_bill(owner: @p_customer)
+
+
end
@@ -171,15 +174,15 @@ class Admin::PCustomerSheetsController < ApplicationController
def create
@p_customer_sheet = PCustomerSheet.new(params.require(:p_customer_sheet).permit!)
-
@p_customer_sheet.admin = current_admin
-
-
-
if @p_customer_sheet.save
redirect_to admin_p_customer_sheet_path(@p_customer_sheet)
else
+ puts "ERRORSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
+ puts params
+ puts @p_customer_sheet.errors.messages
+ puts "ERRORSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
@p_customer = @p_customer_sheet.price_line_block.p_customer
render action: "new"
diff --git a/app/controllers/admin/price_lines_controller.rb b/app/controllers/admin/price_lines_controller.rb
index be13d20..12df066 100644
--- a/app/controllers/admin/price_lines_controller.rb
+++ b/app/controllers/admin/price_lines_controller.rb
@@ -44,19 +44,12 @@ class Admin::PriceLinesController < ApplicationController
def update
- puts "PAAMSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
- puts params
- puts "PAAMSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
@price_line = PriceLine.find(params[:id])
if @price_line.update_attributes(params.require(:price_line).permit!)
-
+
else
- puts "ERRORSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
- puts @price_line.errors.messages
- puts "ERRORSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
render action: "edit"
-
end
end
@@ -73,4 +66,8 @@ class Admin::PriceLinesController < ApplicationController
# @p_article = PArticle.new#@price_line.p_articles.build
# @p_article_serial_nums = @p_article.p_article_serial_nums.build
end
+
+ def add_price_line_p_article
+ @price_line = PriceLine.find(params[:price_line_id])
+ end
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 43aa011..d0e29b3 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -78,6 +78,16 @@ module ApplicationHelper
icon = sort_direction == "asc" ? "chevron-up" : "chevron-down"
icon = column == sort_column ? icon : ""
link_to raw("#{title} "+ic(icon).html_safe), request.query_parameters.merge({column: column, direction: direction})
- end
+ end
+
+ def id_color(price_line)
+ if price_line.p_articles.count == 0
+ return "background-color: red"
+ elsif price_line.p_articles.count < price_line.qte
+ return "background-color: orange"
+ else
+ return "background-color: #70ff29"
+ end
+ end
end
diff --git a/app/models/line_stock.rb b/app/models/line_stock.rb
index 9847dfb..21da23b 100644
--- a/app/models/line_stock.rb
+++ b/app/models/line_stock.rb
@@ -7,6 +7,9 @@
belongs_to :stock_movement_line
belongs_to :partition_lines
+ has_many :line_stock_p_articles
+ has_many :p_articles, through: :line_stock_p_articles
+
acts_as_sorting :fields => {
:id => {:name => "ID", :reorder => false},
diff --git a/app/models/line_stock_p_article.rb b/app/models/line_stock_p_article.rb
new file mode 100644
index 0000000..54c2762
--- /dev/null
+++ b/app/models/line_stock_p_article.rb
@@ -0,0 +1,4 @@
+class LineStockPArticle < ApplicationRecord
+ belongs_to :line_stock
+ belongs_to :p_article
+end
diff --git a/app/models/p_article.rb b/app/models/p_article.rb
index bd9cbdc..6f695d4 100644
--- a/app/models/p_article.rb
+++ b/app/models/p_article.rb
@@ -10,6 +10,9 @@ class PArticle < ApplicationRecord
has_many :price_line_p_articles
has_many :price_lines, through: :price_line_p_articles
accepts_nested_attributes_for :p_article_serial_nums
+
+ has_many :line_stock_p_articles
+ has_many :line_stocks, through: :line_stock_p_articles
diff --git a/app/models/p_customer_sheet.rb b/app/models/p_customer_sheet.rb
index 45d7409..a16ac3a 100644
--- a/app/models/p_customer_sheet.rb
+++ b/app/models/p_customer_sheet.rb
@@ -13,12 +13,13 @@ class PCustomerSheet < ApplicationRecord
belongs_to :particular_bill, :class_name => "Particular"#, :dependent => :destroy
accepts_nested_attributes_for :particular_bill
+
belongs_to :particular_send, :class_name => "Particular"#, :dependent => :destroy
accepts_nested_attributes_for :particular_send
has_one :price_line_block, :as => :price_lineable
- accepts_nested_attributes_for :price_line_block
+ accepts_nested_attributes_for :price_line_block
has_many :price_lines, :through => :price_line_block
diff --git a/app/models/particular.rb b/app/models/particular.rb
index 9458945..9fbe2bd 100644
--- a/app/models/particular.rb
+++ b/app/models/particular.rb
@@ -7,6 +7,7 @@ class Particular < ApplicationRecord
has_many :open_ranges, :through => :open_range_elements
belongs_to :owner, :polymorphic => true
+ #has_many :p_customer_sheets
#validates :civilite, :presence => true, :if => :force_validation
#validates :name, :presence => true, :if => :force_validation
#validates :firstname, :presence => true, :if => :force_validation
diff --git a/app/models/price_document.rb b/app/models/price_document.rb
index de113f8..ae3a1f6 100644
--- a/app/models/price_document.rb
+++ b/app/models/price_document.rb
@@ -764,4 +764,9 @@ class PriceDocument < ApplicationRecord
end
end
+ def stock_generable
+ return self.price_line_block.price_lines.joins(:p_articles).count < self.price_line_block.price_lines.sum(:qte) ? false : true
+ #exclure les produit non stockable et sans SN
+ end
+
end
diff --git a/app/models/price_line.rb b/app/models/price_line.rb
index 3eb2621..faa5f6d 100644
--- a/app/models/price_line.rb
+++ b/app/models/price_line.rb
@@ -13,6 +13,7 @@ class PriceLine < ApplicationRecord
has_many :price_line_p_articles
has_many :p_articles, through: :price_line_p_articles
accepts_nested_attributes_for :p_articles
+ accepts_nested_attributes_for :price_line_p_articles
default_scope { order('position ASC') }
diff --git a/app/models/price_line_block.rb b/app/models/price_line_block.rb
index 8e4ee2c..744e069 100644
--- a/app/models/price_line_block.rb
+++ b/app/models/price_line_block.rb
@@ -7,8 +7,8 @@ class PriceLineBlock < ApplicationRecord
validates :p_customer_id, :presence => true, :if => :p_customer_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?
+ #validates :particular_bill_id, :presence => true, :if => :particular_bill_needed?
+ #validates :particular_send_id, :presence => true, :if => :particular_send_needed?
belongs_to :particular_bill, :class_name => "Particular"#, :dependent => :destroy
@@ -208,8 +208,18 @@ class PriceLineBlock < ApplicationRecord
def generate_stock
self.price_lines.each do |pl|
if pl.p_product_ref
- LineStock.create(:dluo => pl.dluo, :date => self.price_lineable.date, :p_product_ref => pl.p_product_ref, :description => "Entrée en stock par facture d'achat", :qte => pl.qte, :price_ht => pl.local_tot_amount_ht, :price_line => pl, :price_line_block => self, :stockable => self.price_lineable)
-
+ ls = LineStock.new(
+ :dluo => pl.dluo,
+ :date => self.price_lineable.date,
+ :p_product_ref => pl.p_product_ref,
+ :description => "Entrée en stock par facture d'achat",
+ :qte => pl.qte,
+ :price_ht => pl.local_tot_amount_ht,
+ :price_line => pl,
+ :price_line_block => self,
+ :stockable => self.price_lineable)
+ ls.p_articles = pl.p_articles
+ ls.save
end
@@ -441,6 +451,9 @@ class PriceLineBlock < ApplicationRecord
end
if self.particular_bill_needed? and (!self.p_customer or !self.particular_bill or !self.particular_bill.owner or self.particular_bill.owner != self.p_customer)
+ puts "PARTICULEARRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
+ puts self.particular_bill
+ puts "PARTICULEARRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
errors.add(:particular_bill_id, 'doit être une adresse du client')
end
diff --git a/app/views/admin/line_stocks/_line_stock.html.haml b/app/views/admin/line_stocks/_line_stock.html.haml
index 0dae2d5..fb479c4 100644
--- a/app/views/admin/line_stocks/_line_stock.html.haml
+++ b/app/views/admin/line_stocks/_line_stock.html.haml
@@ -25,6 +25,7 @@
= link_to i(:"trash-o"), [:admin, line_stock], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
= link_to i(:pencil), edit_admin_line_stock_path(line_stock), :remote => true
= link_to i(:eye), admin_line_stock_path(line_stock), :remote => true
+ = link_to i(:"mobile-alt"), show_p_article_admin_line_stocks_path(line_stock_id: line_stock.id), :remote => true
diff --git a/app/views/admin/line_stocks/_show_p_article_form.html.haml b/app/views/admin/line_stocks/_show_p_article_form.html.haml
new file mode 100644
index 0000000..4d014a9
--- /dev/null
+++ b/app/views/admin/line_stocks/_show_p_article_form.html.haml
@@ -0,0 +1,13 @@
+.mx-2.my-2
+ %table.table-bordered
+ %tbody
+ -@line_stock.p_articles.each do |p_article|
+ %tr
+ %td="##{p_article.id}"
+ %td=p_article.p_product_ref.name
+ - p_article.p_article_serial_nums.each do |sn|
+ %tr
+ %td
+ %td
+ ="#{sn.p_serial_num_type.name} - #{sn.value}"
+.actions
\ No newline at end of file
diff --git a/app/views/admin/line_stocks/index.html.haml b/app/views/admin/line_stocks/index.html.haml
index 7360c8e..f7d8347 100644
--- a/app/views/admin/line_stocks/index.html.haml
+++ b/app/views/admin/line_stocks/index.html.haml
@@ -140,3 +140,4 @@
+
\ No newline at end of file
diff --git a/app/views/admin/line_stocks/show_p_article.js.erb b/app/views/admin/line_stocks/show_p_article.js.erb
new file mode 100644
index 0000000..9f660b6
--- /dev/null
+++ b/app/views/admin/line_stocks/show_p_article.js.erb
@@ -0,0 +1 @@
+show_pane_hover("<%= escape_javascript(render(:partial => "show_p_article_form"))%>",700,900);
\ No newline at end of file
diff --git a/app/views/admin/p_articles/_form.html.haml b/app/views/admin/p_articles/_form.html.haml
index 3a2568b..6b380c1 100644
--- a/app/views/admin/p_articles/_form.html.haml
+++ b/app/views/admin/p_articles/_form.html.haml
@@ -15,7 +15,7 @@
%p= link_to_add_fields "Ajouter un numéro de série", f, :p_article_serial_nums, {:class => "btn btn-primary"}
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
-- else
+- elsif params[:controller] == "admin/price_lines"
= form.inputs do
-if params[:p_product_ref_id]
= form.input :p_product_ref_id, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :label => form.object.label_for(:p_product_ref), input_html: {disabled: true}
@@ -30,3 +30,4 @@
= form.semantic_fields_for :p_article_serial_nums do |form|
=render :partial => "admin/p_article_serial_nums/form", :locals => {:form => form}
%p= link_to_add_fields "Ajouter un numéro de série", form, :p_article_serial_nums, {:class => "btn btn-primary"}
+
diff --git a/app/views/admin/p_customer_sheets/_form.html.haml b/app/views/admin/p_customer_sheets/_form.html.haml
index f38a269..5c93951 100755
--- a/app/views/admin/p_customer_sheets/_form.html.haml
+++ b/app/views/admin/p_customer_sheets/_form.html.haml
@@ -1,7 +1,8 @@
=semantic_form_for [:admin, @p_customer_sheet], :html => {:class => "qi_price_form"}, :remote => false do |form|
+ =#debug form.object.errors.messages if current_admin.id == 1
=form.semantic_fields_for :price_line_block do |f|
=render :partial => "admin/price_line_blocks/form", :locals => {:f => f}
-
+
.content
.qi_row
.qi_pannel.qi_plain.padding.row
@@ -11,23 +12,6 @@
=#form.input :demande_type, :collection => ["Brouillon", "Demande de bon de commande","Demande de devis"], :as => :select, :include_blank => false, :label => "Type de demande :"
=#form.input :state, :collection => ["AV BPA", "PAS BPA","BPA", "Traitée"], :as => :select, :include_blank => false, :label => "Statut :"
=#form.input :past_id, :label => "N° système actuel"
- =yield :shipping_date
-
- .qi_row
- .qi_pannel.qi_plain.padding.row
- nested form for particular send et bill qui crée à chaque fois un particular
- ajouter accept nested attributed for particular dans pcustomer sheet
-
-
-
- .qi_row
- .qi_pannel.qi_plain.padding.row
- =yield :price_lines
- .qi_row
- .qi_pannel.qi_plain.padding.row
- =yield :discount
-
-
.large_actions
diff --git a/app/views/admin/particulars/_form.html.haml b/app/views/admin/particulars/_form.html.haml
index 55bd784..03eb796 100644
--- a/app/views/admin/particulars/_form.html.haml
+++ b/app/views/admin/particulars/_form.html.haml
@@ -1,4 +1,3 @@
-
=form.hidden_field :particular_type
=form.hidden_field :skip_validation, :class => "skip_validation"
=form.hidden_field :pro
@@ -31,15 +30,14 @@
=#form.input :email, :label => false, :placeholder => qit("don-particular-email","Email")
=#form.input :tel, :label => false, :placeholder => qit("don-particular-phone","Téléphone")
-Contacts de l'adresse :
+-if !params[:controller] == "p_customer_sheets"
+ Contacts de l'adresse :
+ .p_contacts_form
+ =form.semantic_fields_for :p_contacts do |form|
+ =render :partial => "admin/p_contacts/form", :locals => {:form => form}
-.p_contacts_form
- =form.semantic_fields_for :p_contacts do |form|
- =render :partial => "admin/p_contacts/form", :locals => {:form => form}
-
-
-%p= link_to_add_fields ic(:plus)+" Ajouter un contact à l'adresse", form, :p_contacts
+ %p= link_to_add_fields ic(:plus)+" Ajouter un contact à l'adresse", form, :p_contacts
=#form.input :open_ranges, :label => "Horaires d'ouvertures :", :collection => OpenRange.all, :as => :check_boxes
diff --git a/app/views/admin/price_documents/show.html.haml b/app/views/admin/price_documents/show.html.haml
index 59cf845..a66ebcd 100644
--- a/app/views/admin/price_documents/show.html.haml
+++ b/app/views/admin/price_documents/show.html.haml
@@ -209,15 +209,8 @@
-price_line_block.price_lines.each do |price_line|
%tbody
%tr
- -if price_line.p_articles.count == 0
- %td{style: "background-color: red;"}
- ="##{price_line.id}"
- - elsif price_line.p_articles.count < price_line.qte
- %td{style: "background-color: orange"}
- ="##{price_line.id}"
- - else
- %td{style: "background-color: green"}
- ="##{price_line.id}"
+ %td{style: id_color(price_line)}
+ ="##{price_line.id}"
%td
=price_line.ref
%td
@@ -250,7 +243,8 @@
-if current_admin.has_permission?("show-costs")
%p
-if @price_document.price_document_type_id == 6
- =link_to "Générer les stocks", generate_stocks_admin_price_document_path(@price_document), :class => "btn btn-primary" if !@price_document.stock_ok
+ =link_to "Générer les stocks", generate_stocks_admin_price_document_path(@price_document), :class => "btn btn-primary" if !@price_document.stock_ok and @price_document.stock_generable
+ =link_to "Générer les stocks", generate_stocks_admin_price_document_path(@price_document), :class => "btn btn-primary disabled" if !@price_document.stock_ok and !@price_document.stock_generable
-elsif @price_document.price_document_type_id == 4 or @price_document.price_document_type_id == 5
%p
Coût :
diff --git a/app/views/admin/price_line_blocks/_form.html.haml b/app/views/admin/price_line_blocks/_form.html.haml
index 8f441a3..9adc306 100644
--- a/app/views/admin/price_line_blocks/_form.html.haml
+++ b/app/views/admin/price_line_blocks/_form.html.haml
@@ -4,47 +4,42 @@
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
- = f.hidden_field :p_customer_id, :class => "p_customer_id"
- =content_for :particular do
- .row
- .p_customer_sheet_customer.col-12.mb-4
+ = f.text_field :p_customer_id, :class => "p_customer_id"
+ .row
+ .p_customer_sheet_customer.col-12.mb-4
+ -if f.object.p_customer and f.object.p_customer.particular
+ =render :partial => "admin/p_customers/apercu", :locals => {:particular => f.object.p_customer.particular}
- -if f.object.p_customer and f.object.p_customer.particular
- =render :partial => "admin/p_customers/apercu", :locals => {:particular => f.object.p_customer.particular}
+ .qi_row
+ .qi_pannel.qi_plain.padding.row
.col-6
- .addresses.row
- .columns.span_6
- %h4 Adresse de facturation
+ Adresse de livraison :
+ =f.semantic_fields_for :particular_send do |form_particular_send|
+ =render :partial => "admin/particulars/form", :locals => {:form => form_particular_send}
+ =form_particular_send.text_field :owner_id
+ =form_particular_send.text_field :owner_type
- -if f.object.p_customer
- =f.inputs do
- = f.input :particular_bill_id, :collection => f.object.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de facturation"
- -else
- =f.inputs do
- = f.input :particular_bill_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
.col-6
- .addresses.row
- .columns.span_6
- %h4 Adresse de livraison
+ Adresse de facturation :
+ =f.semantic_fields_for :particular_bill do |form_particular_bill|
+ =render :partial => "admin/particulars/form", :locals => {:form => form_particular_bill}
+ =form_particular_bill.text_field :owner_id
+ =form_particular_bill.text_field :owner_type
+
+
+
- -if f.object.p_customer
- =f.inputs do
- = f.input :particular_send_id, :collection => f.object.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de livraison"
- -else
- =f.inputs do
- = f.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
.clear
- =content_for :shipping_date do
- = f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date
- = f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date
- = f.input :validation_date, :label => "Date de validation :", :as => :date
+ = f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date
+ = f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date
+ = f.input :validation_date, :label => "Date de validation :", :as => :date
- = f.input :customer_ref, :label => "Référence commande client :"
+ = f.input :customer_ref, :label => "Référence commande clientttt :"
-if current_admin.has_permission?("customer-sheets-bl")
=# f.input :bl_comment, :label => "Commentaire à mettre sur le BL :", :input_html => {:style => "min-height:50px;height:50px;"}
@@ -55,33 +50,30 @@
%br
+ %div{:style=>"padding:0 30px;"}
+ .row.qi_field_wrapper
+ %table{:style => "width:100%;border-collapse:separate;"}
+ %thead
+ %tr
+ %th
+ %th Produit
+ %th{:style => "width:200px;"} Prix
+ %th
+ %th{:style => "width:100px;"} Qté
+ %th TVA
+ %th
+ %tbody.price_lines_form
+ =f.semantic_fields_for :price_lines do |f|
+ =render :partial => "admin/price_lines/form", :locals => {:form => f}
- =content_for :price_lines do
- %div{:style=>"padding:0 30px;"}
- .row.qi_field_wrapper
- %table{:style => "width:100%;border-collapse:separate;"}
- %thead
- %tr
- %th
- %th Produit
- %th{:style => "width:200px;"} Prix
- %th
- %th{:style => "width:100px;"} Qté
- %th TVA
- %th
- %tbody.price_lines_form
- =f.semantic_fields_for :price_lines do |f|
- =render :partial => "admin/price_lines/form", :locals => {:form => f}
-
- %p{:style=>"padding-top:10px;"}= link_to_add_fields ic("plus-circle") + " ligne", f, :price_lines, {:class => "btn btn-primary p-2", tabindex: 10, style: "position: sticky; top: 100px"}
+ %p{:style=>"padding-top:10px;"}= link_to_add_fields ic("plus-circle") + " ligne", f, :price_lines, {:class => "btn btn-primary p-2", tabindex: 10, style: "position: sticky; top: 100px"}
-if current_admin.has_permission?("payments")
- =content_for :discount do
- -if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
- -if !@avoir
- = f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :"#, :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
- = f.input :ct_tot_fdp_ht, :label => "Frais de port personnalisés :"
+ -if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
+ -if !@avoir
+ = f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :"#, :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
+ = f.input :ct_tot_fdp_ht, :label => "Frais de port personnalisés :"
-if current_admin.has_permission?("payments")
@@ -103,7 +95,3 @@
-if false
= f.input :ct_payment_month_end, :label => "Fin de mois ?"
-
-
-
-
diff --git a/app/views/admin/price_line_blocks/_price_line_block.html.haml b/app/views/admin/price_line_blocks/_price_line_block.html.haml
index 390aec3..961c8ae 100644
--- a/app/views/admin/price_line_blocks/_price_line_block.html.haml
+++ b/app/views/admin/price_line_blocks/_price_line_block.html.haml
@@ -96,6 +96,9 @@
%td.numeraire
=price_line.qte
+ %td
+ = price_line.p_articles.count
+ = link_to i(:"mobile-alt"), add_price_line_p_article_admin_price_lines_path(p_product_ref_id: price_line.p_product_ref.id, price_line_id: price_line.id), :remote => true
-if @price_document and @price_document.label != "Demande prix" and @price_document.label != "Réponse fournisseur"
%td.numeraire
diff --git a/app/views/admin/price_line_p_articles/_form.html.haml b/app/views/admin/price_line_p_articles/_form.html.haml
new file mode 100644
index 0000000..b7c9644
--- /dev/null
+++ b/app/views/admin/price_line_p_articles/_form.html.haml
@@ -0,0 +1 @@
+=form.input :p_article_id, as: :select, collection: PArticle.all, member_label: :id
\ No newline at end of file
diff --git a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
new file mode 100644
index 0000000..8575343
--- /dev/null
+++ b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
@@ -0,0 +1,9 @@
+.mx-2.my-2
+ =semantic_form_for [:admin, @price_line], :remote => true do |f|
+ .content
+ =f.inputs do
+ .price_line_p_articles_form
+ = f.semantic_fields_for :price_line_p_articles do |form|
+ =render :partial => "admin/price_line_p_articles/form", :locals => {:form => form}
+ %p= link_to_add_fields "Ajouter un article", f, :price_line_p_articles, {:class => "btn btn-primary"}
+ .actions=f.submit "Sauvegarder", :class => "btn btn-primary"
\ No newline at end of file
diff --git a/app/views/admin/price_lines/add_price_line_p_article.js.erb b/app/views/admin/price_lines/add_price_line_p_article.js.erb
new file mode 100644
index 0000000..d64a968
--- /dev/null
+++ b/app/views/admin/price_lines/add_price_line_p_article.js.erb
@@ -0,0 +1 @@
+show_pane_hover("<%= escape_javascript(render(:partial => "add_price_line_p_article_form"))%>",700,900);
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 6c3c724..e0a0032 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -447,6 +447,7 @@ Rails.application.routes.draw do
collection do
get "stock_resume"
get "empty_stock"
+ get :show_p_article
end
end
end
@@ -698,6 +699,7 @@ Rails.application.routes.draw do
end
collection do
get :add_p_article
+ get :add_price_line_p_article
end
end
diff --git a/db/migrate/20211103085623_create_line_stock_p_articles.rb b/db/migrate/20211103085623_create_line_stock_p_articles.rb
new file mode 100644
index 0000000..0ec4e0e
--- /dev/null
+++ b/db/migrate/20211103085623_create_line_stock_p_articles.rb
@@ -0,0 +1,10 @@
+class CreateLineStockPArticles < ActiveRecord::Migration[6.0]
+ def change
+ create_table :line_stock_p_articles do |t|
+ t.belongs_to :p_article
+ t.belongs_to :line_stock
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 3fe7b90..c6cfc94 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2021_11_02_105934) do
+ActiveRecord::Schema.define(version: 2021_11_03_085623) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -549,6 +549,15 @@ ActiveRecord::Schema.define(version: 2021_11_02_105934) do
t.datetime "updated_at", precision: 6, null: false
end
+ create_table "line_stock_p_articles", force: :cascade do |t|
+ t.bigint "p_article_id"
+ t.bigint "line_stock_id"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["line_stock_id"], name: "index_line_stock_p_articles_on_line_stock_id"
+ t.index ["p_article_id"], name: "index_line_stock_p_articles_on_p_article_id"
+ end
+
create_table "line_stock_usages", force: :cascade do |t|
t.bigint "line_stock_id"
t.decimal "qte", precision: 14, scale: 2
diff --git a/test/fixtures/line_stock_p_articles.yml b/test/fixtures/line_stock_p_articles.yml
new file mode 100644
index 0000000..5181636
--- /dev/null
+++ b/test/fixtures/line_stock_p_articles.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
diff --git a/test/models/line_stock_p_article_test.rb b/test/models/line_stock_p_article_test.rb
new file mode 100644
index 0000000..c5688f1
--- /dev/null
+++ b/test/models/line_stock_p_article_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class LineStockPArticleTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
From 721c98e20d8b714273c81a9d4f02b25417c829e5 Mon Sep 17 00:00:00 2001
From: Philippe
Date: Fri, 5 Nov 2021 11:24:58 +0100
Subject: [PATCH 06/12] add p_fournisseur_id in price_document achat form,
autocomplete for p_article_ids in price_line_block form
---
.../(__TEMPLATE__)c | Bin 1374 -> 5965 bytes
app/models/p_article.rb | 4 +
app/models/p_customer_sheet.rb | 3 +-
app/models/price_document.rb | 1 -
app/models/price_line.rb | 3 -
.../admin/p_customer_sheets/_form.html.haml | 18 ++--
.../admin/p_customer_sheets/show.html.haml | 37 ++++----
.../admin/p_fournisseurs/_form.html.haml | 4 +-
app/views/admin/p_products/_form.html.haml | 2 +-
.../admin/price_documents/_form.html.haml | 5 +-
.../admin/price_documents/show.html.haml | 13 ++-
.../admin/price_line_blocks/_form.html.haml | 85 ++++++++++--------
.../_form_facture_achat.html.haml | 1 -
.../_price_line_block.html.haml | 37 ++++----
.../price_line_p_articles/_form.html.haml | 6 +-
.../_add_price_line_p_article_form.html.haml | 15 ++--
app/views/admin/price_lines/_form.html.haml | 1 -
17 files changed, 124 insertions(+), 111 deletions(-)
diff --git a/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c b/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c
index e1c3ae14c64ffb6b86d264611307231a215c18c3..f14f6942a4eff9a4b9af0c9026e5b8e2e708b671 100644
GIT binary patch
literal 5965
zcmbVQUvt~W5f?Qbii9jtbo9@ZEVHzu*orOEk{sE0Gwmg=JYgnrG#1krJz$RHi9!S7
zPym#pdi>UWh4f?eOSNC2eQb9Re~w2&ij*hfh}*s2?(P0|7yG-1y9d_c!NDQ#?RC4a
z&iLMo?w)8J?Dt;r=l$Nx7hJsT9f~iyqPyR+epiy@-U$ywLOOvEguIh7dMo?l4q0Tq
zbI0um!aFTbZW_4)H&uwm0(d?xwi{~?yRv_2hY^pQFmnDn5@C@Pk2>To^LY@8zKuIW
zNgDBSC&CrINCt$wmct=G5g_69M2Rf0p%`{W5S|t#xj(r%-8V;QNPD@13FViged}
zylZW8SG!*V=pG-6c4KuKH!XMIwd;7oDS{u)99Q7p7GMiU-M;{C^(aR{4=pO4h^Pnx
z=R7?BIP(T94%I6=;NCz;vYs5T{sb4}zhzQk;Hx0AeF-Wy%q_<Nw?l5_F
z7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1(J$^w38A6pX>PYmMm7xYc
z(Uk#Lx`9uJ(5ySUdV(`rg==TAv{%?jothMg4LG`%c^6ktvzy2bhCBs27)%9eFwAZh
zj3czIX0wohVY3ekDTwKexTaOSkq0&>Jg^BiuV(OY^*B8|pAqsDXb+eQG7q%02XMz#
z`H+BNv(GaR=!B@H$k}W~t22XVKb;k!7QiPXWOMi+H~VgO`di`$t6tY1YH(GrH=Fuv
z!Og}65Yi&o3=E+Dqh)=xa=W;jOr!{~*}TOdV;FNivRLcnph4lp@eZA6!c8V33I^p{
zbbGWhhB~%Kj}?-qb!Y^hj14~5;2A3b3ez+fBA}aIRAO|3C};XZv#q3w%DzY>jDiia
NrnY#MHog0u{{w}+6Mp~z
delta 389
zcmX@BcaKZYSkGL~gv-Ft$jCf3HQB=4I4#v6HPtxPBq=#1&D_W+H6It+*WW5_3~Mm3W{MlU*3sGxAOT!WauA
zgP5*QUc@3R#*>m+T#%Dk$!5(NV#V!HmY7qT8qGFYo>zSGdlp?8&b<7*RInVcLw-R?
zW`16AH3QJ(lFEYA$(F48%IwzS`PLGg){^!FD8Pv&LQl7O1)pl>bfAZ0D*AZ;yVV6Ew(F}aIP8t9#DHaRm5D?W#k
v)Lfu%N`SsrfrUpkmx2P+lU5+#SaWgJa&d8iJOy+U+vJbjiacy^Qw>7^kL+bZ
diff --git a/app/models/p_article.rb b/app/models/p_article.rb
index 6f695d4..4d69fd9 100644
--- a/app/models/p_article.rb
+++ b/app/models/p_article.rb
@@ -56,4 +56,8 @@ class PArticle < ApplicationRecord
def member_label
"#{p_product_ref.cc_name}"
end
+
+ def serialized_name
+ "#{self.p_product_ref.cc_name} #{self.p_article_serial_nums.map{|x| x.value}.join(' / ')}"
+ end
end
diff --git a/app/models/p_customer_sheet.rb b/app/models/p_customer_sheet.rb
index a16ac3a..c477f8c 100644
--- a/app/models/p_customer_sheet.rb
+++ b/app/models/p_customer_sheet.rb
@@ -18,7 +18,6 @@ class PCustomerSheet < ApplicationRecord
accepts_nested_attributes_for :particular_send
has_one :price_line_block, :as => :price_lineable
-
accepts_nested_attributes_for :price_line_block
has_many :price_lines, :through => :price_line_block
@@ -32,7 +31,7 @@ class PCustomerSheet < ApplicationRecord
#:cc_com_counter => {:name => "ID", :reorder => true},
- :past_id => {:name => "N° ancien système", :reorder => true},
+ :id => {:name => "ID", :reorder => true},
:d_number => {:name => "N° BC", :reorder => false},
:created_at => {:name => "Date", :reorder => true, :sort_name => "p_customer_sheets.created_at"},
:admin_id => {:name => "Déposée par", :reorder => true},
diff --git a/app/models/price_document.rb b/app/models/price_document.rb
index ae3a1f6..9629fe2 100644
--- a/app/models/price_document.rb
+++ b/app/models/price_document.rb
@@ -13,7 +13,6 @@ class PriceDocument < ApplicationRecord
belongs_to :p_fournisseur
has_one :price_line_block, :as => :price_lineable
-
accepts_nested_attributes_for :price_line_block
belongs_to :ref_element, :polymorphic => true
diff --git a/app/models/price_line.rb b/app/models/price_line.rb
index faa5f6d..534aaf5 100644
--- a/app/models/price_line.rb
+++ b/app/models/price_line.rb
@@ -32,9 +32,7 @@ class PriceLine < ApplicationRecord
:ref => {:name => "Ref", :reorder => true},
:title => {:name => "Désignation", :reorder => true},
:qte => {:name => "Qté", :reorder => true},
-
:qte_available => {:name => "Qté dispo.", :reorder => true},
-
:ct_u_price_ht => {:name => "Prix de vente", :reorder => true},
:ref_fournisseur => {:name => "Réf. fournisseur", :reorder => true},
:p_product_power_id => {:name => "Chargeur", :reorder => true},
@@ -47,7 +45,6 @@ class PriceLine < ApplicationRecord
:lang_start => {:name => "Démarrage écran langue ?", :reorder => true},
:actions => {:name => "Actions"}
-
}
diff --git a/app/views/admin/p_customer_sheets/_form.html.haml b/app/views/admin/p_customer_sheets/_form.html.haml
index 5c93951..9f1576e 100755
--- a/app/views/admin/p_customer_sheets/_form.html.haml
+++ b/app/views/admin/p_customer_sheets/_form.html.haml
@@ -3,15 +3,15 @@
=form.semantic_fields_for :price_line_block do |f|
=render :partial => "admin/price_line_blocks/form", :locals => {:f => f}
- .content
- .qi_row
- .qi_pannel.qi_plain.padding.row
- .col-8
- =@p_customer_sheet.p_customer.particular.organisation
- -if @p_customer_sheet and @p_customer_sheet.state != "commande"
- =#form.input :demande_type, :collection => ["Brouillon", "Demande de bon de commande","Demande de devis"], :as => :select, :include_blank => false, :label => "Type de demande :"
- =#form.input :state, :collection => ["AV BPA", "PAS BPA","BPA", "Traitée"], :as => :select, :include_blank => false, :label => "Statut :"
- =#form.input :past_id, :label => "N° système actuel"
+ -# .content
+ -# .qi_row
+ -# .qi_pannel.qi_plain.padding.row
+ -# .col-8
+ -# =@p_customer_sheet.p_customer.particular.organisation
+ -# -if @p_customer_sheet and @p_customer_sheet.state != "commande"
+ -# =#form.input :demande_type, :collection => ["Brouillon", "Demande de bon de commande","Demande de devis"], :as => :select, :include_blank => false, :label => "Type de demande :"
+ -# =#form.input :state, :collection => ["AV BPA", "PAS BPA","BPA", "Traitée"], :as => :select, :include_blank => false, :label => "Statut :"
+ -# =#form.input :past_id, :label => "N° système actuel"
.large_actions
diff --git a/app/views/admin/p_customer_sheets/show.html.haml b/app/views/admin/p_customer_sheets/show.html.haml
index 1b37292..8bab240 100644
--- a/app/views/admin/p_customer_sheets/show.html.haml
+++ b/app/views/admin/p_customer_sheets/show.html.haml
@@ -88,25 +88,24 @@
.clear
- %h3 Documents liés à l'offre
- #bills
- -params[:search][:per_page] = params[:search][:per_page] || 50
- -per_page = params[:search][:per_page]
- -page = (params[:page] and params[:page] != "") ? params[:page] : 1
-
- -@price_documents = @p_customer_sheet.price_documents.order("date DESC, created_at DESC")
- -if params[:price_document_ids]
- -@price_documents = @price_documents.where(:id => params[:price_document_ids])
-
- -@price_documents = sort_by_sorting(@price_documents, "created_at DESC")
- -@price_documents = @price_documents.page(page).per(per_page)
- %br
-
-
-
- .clear
- =render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @price_documents}
-
+ -params[:search][:per_page] = params[:search][:per_page] || 50
+ -per_page = params[:search][:per_page]
+ -page = (params[:page] and params[:page] != "") ? params[:page] : 1
+ -@price_documents = @p_customer_sheet.price_documents.order("date DESC, created_at DESC")
+ -if params[:price_document_ids]
+ -@price_documents = @price_documents.where(:id => params[:price_document_ids])
+ -@price_documents = sort_by_sorting(@price_documents, "created_at DESC")
+ -@price_documents = @price_documents.page(page).per(per_page)
+
+ - if @price_documents.exists?
+ %h3 Documents liés à l'offre
+ #bills
+ %br
+ .clear
+ =render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @price_documents}
+
+:javascript
+ $('.p_articles_lines').hide();
\ No newline at end of file
diff --git a/app/views/admin/p_fournisseurs/_form.html.haml b/app/views/admin/p_fournisseurs/_form.html.haml
index 082c082..33ff79e 100755
--- a/app/views/admin/p_fournisseurs/_form.html.haml
+++ b/app/views/admin/p_fournisseurs/_form.html.haml
@@ -19,6 +19,6 @@
-
- .actions=f.submit "sauvegarder", :class => "btn btn-primary"
+ =link_to "Annuler", "#", class:"btn btn-default", onclick:"close_pane_hover();return false;"
+ =f.submit "sauvegarder", :class => "btn btn-primary"
\ No newline at end of file
diff --git a/app/views/admin/p_products/_form.html.haml b/app/views/admin/p_products/_form.html.haml
index d8f02c4..6a02656 100755
--- a/app/views/admin/p_products/_form.html.haml
+++ b/app/views/admin/p_products/_form.html.haml
@@ -11,7 +11,7 @@
= f.input :enabled, :label => "Produit actif ?"
.col-sm-2
%br
- = f.input :stockable, :label => "Produit stockable ?", :input_html => {:onclick => "$('#with_serial').toggle('slow');"}
+ = f.input :stockable, :label => "Produit stockable ?"#, :input_html => {:onclick => "$('#with_serial').toggle('slow');"}
.col-sm-2
%br
#with_serial
diff --git a/app/views/admin/price_documents/_form.html.haml b/app/views/admin/price_documents/_form.html.haml
index 0f516cc..9b21234 100644
--- a/app/views/admin/price_documents/_form.html.haml
+++ b/app/views/admin/price_documents/_form.html.haml
@@ -1,4 +1,3 @@
-PRICE_DOCUMENTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
=semantic_form_for [:admin, @price_document], :html => {:class => "qi_price_form"}, :remote => false do |f|
-@p_customer = @price_document.p_customer
=diag do
@@ -11,7 +10,7 @@ PRICE_DOCUMENTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
=f.inputs do
=f.hidden_field :price_document_type_id
- = f.hidden_field :p_customer_id
+ =f.hidden_field :p_customer_id
=f.hidden_field :ref_element_type
=f.hidden_field :ref_element_id
=f.hidden_field :doc_ref_id
@@ -50,6 +49,8 @@ PRICE_DOCUMENTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
= f.input :supplier_document_date, :label => "Date du document fournisseur :", :as => :date
.col-6
= f.input :tva_type_id, :label => "Type de TVA :", as: :select, collection: TvaType.pluck(:name, :id)
+ .col-6
+ = f.input :p_fournisseur, :label => "Fournisseur :", as: :select, collection: PFournisseur.pluck(:name, :id)
.price_line_block_form
=f.semantic_fields_for :price_line_block do |f|
=render :partial => "admin/price_line_blocks/form_#{f.object.block_type_slug}", :locals => {:f => f}
diff --git a/app/views/admin/price_documents/show.html.haml b/app/views/admin/price_documents/show.html.haml
index a66ebcd..9b78bee 100644
--- a/app/views/admin/price_documents/show.html.haml
+++ b/app/views/admin/price_documents/show.html.haml
@@ -18,7 +18,7 @@
.qi_row
- =debug @price_document.price_line_block.price_lines.count
+ =#debug @price_document.price_line_block.price_lines.count
%table.table.table-striped
-if @price_document.label == "Réponse fournisseur"
@@ -201,6 +201,7 @@
%th Marque
%th Désignation
%th Qté
+ %th Qté saisie
%th P.U. HT
%th TVA
%th Montant HT
@@ -209,7 +210,7 @@
-price_line_block.price_lines.each do |price_line|
%tbody
%tr
- %td{style: id_color(price_line)}
+ %td{style: id_color(price_line), id: "price_line_#{price_line.id}", onclick: "$('.p_articles_#{price_line.id}').toggle('800','swing');"}
="##{price_line.id}"
%td
=price_line.ref
@@ -219,6 +220,8 @@
=link_to price_line.p_product_ref.cc_name, edit_admin_p_product_path(price_line.p_product_ref.p_product) if price_line.p_product_ref and price_line.p_product_ref.p_product
%td.numeraire{class: "price_line_qte_#{@price_document.id}"}
=price_line.qte
+ %td.numeraire{class: "price_line_qte_#{@price_document.id}"}
+ =price_line.p_articles.count
%td.numeraire{class: "price_line_price_u_ht_#{@price_document.id}"}
=number_to_currency price_line.price_u_ht
%td.numeraire
@@ -229,9 +232,9 @@
= 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"), add_p_article_admin_price_lines_path(p_product_ref_id: price_line.p_product_ref.id, price_line_id: price_line.id), :remote => true
+ = link_to i(:"mobile-alt"), add_p_article_admin_price_lines_path(p_product_ref_id: price_line.p_product_ref.id, price_line_id: price_line.id), :remote => true if price_line.p_product_ref.p_product.stockable and price_line.p_product_ref.p_product.with_serial_number
-price_line.p_articles.each do |p_article|
- %tr
+ %tr{class: "p_articles_lines p_articles_#{price_line.id}"}
%td
%td="##{p_article.id}"
%td=p_article.p_product_ref.name
@@ -427,6 +430,8 @@
:javascript
+ $('.p_articles_lines').hide();
+
const copyPriceLines = (event) => {
event.preventDefault()
let priceDocumentId = event.target.dataset.document
diff --git a/app/views/admin/price_line_blocks/_form.html.haml b/app/views/admin/price_line_blocks/_form.html.haml
index 9adc306..861d505 100644
--- a/app/views/admin/price_line_blocks/_form.html.haml
+++ b/app/views/admin/price_line_blocks/_form.html.haml
@@ -4,42 +4,43 @@
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
- = f.text_field :p_customer_id, :class => "p_customer_id"
- .row
- .p_customer_sheet_customer.col-12.mb-4
- -if f.object.p_customer and f.object.p_customer.particular
- =render :partial => "admin/p_customers/apercu", :locals => {:particular => f.object.p_customer.particular}
+ .qi_row
+ .qi_pannel.qi_plain.padding.row
+ .col-6
+ = f.input :customer_ref, :label => "Référence commande client :"
+ .col-6
+ = f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date
+ = f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date
+ = f.input :validation_date, :label => "Date de validation :", :as => :date
+ = f.hidden_field :p_customer_id, :class => "p_customer_id"
.qi_row
+ .qi_pannel.qi_plain.padding.row
+ -if f.object.p_customer and f.object.p_customer.particular
+ =render :partial => "admin/p_customers/apercu", :locals => {:particular => f.object.p_customer.particular}
.qi_pannel.qi_plain.padding.row
.col-6
Adresse de livraison :
=f.semantic_fields_for :particular_send do |form_particular_send|
=render :partial => "admin/particulars/form", :locals => {:form => form_particular_send}
- =form_particular_send.text_field :owner_id
- =form_particular_send.text_field :owner_type
-
+ =form_particular_send.hidden_field :owner_id
+ =form_particular_send.hidden_field :owner_type
.col-6
Adresse de facturation :
=f.semantic_fields_for :particular_bill do |form_particular_bill|
=render :partial => "admin/particulars/form", :locals => {:form => form_particular_bill}
- =form_particular_bill.text_field :owner_id
- =form_particular_bill.text_field :owner_type
+ =form_particular_bill.hidden_field :owner_id
+ =form_particular_bill.hidden_field :owner_type
- .clear
-
- = f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date
- = f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date
- = f.input :validation_date, :label => "Date de validation :", :as => :date
+
-
- = f.input :customer_ref, :label => "Référence commande clientttt :"
+
-if current_admin.has_permission?("customer-sheets-bl")
=# f.input :bl_comment, :label => "Commentaire à mettre sur le BL :", :input_html => {:style => "min-height:50px;height:50px;"}
@@ -69,29 +70,41 @@
%p{:style=>"padding-top:10px;"}= link_to_add_fields ic("plus-circle") + " ligne", f, :price_lines, {:class => "btn btn-primary p-2", tabindex: 10, style: "position: sticky; top: 100px"}
+
+
+
+
+
+
+
+
+
+
-if current_admin.has_permission?("payments")
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
- -if !@avoir
- = f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :"#, :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
- = f.input :ct_tot_fdp_ht, :label => "Frais de port personnalisés :"
+ .qi_row
+ .qi_pannel.qi_plain.padding.row
+ -if !@avoir
+ = f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :"#, :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
+ = f.input :ct_tot_fdp_ht, :label => "Frais de port personnalisés :"
-if current_admin.has_permission?("payments")
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
- if f.object.id
- .qi_pannel.qi_plain.padding{:style => "margin:20px 0;"}
- %h4 Paiements
-
- = f.input :p_payment_type_id, :label => "Type de paiement :", :include_blank => false, :collection => PPaymentType.order(:name).all, :as => :select, :input_html => {:id => "payment_type_id_select"}
-
-
- = f.input :ct_payment_comptant, :label => "Paiement comptant nécessaire ?"
-
- -if false
- = f.input :ct_acompte, :label => "Acompte nécessaire ?"
- = f.input :ct_acompte_percent, :label => "Pourcentage d'acompte :"
-
- = f.input :ct_payment_delais, :label => "Délais jour de paiement :"
-
- -if false
- = f.input :ct_payment_month_end, :label => "Fin de mois ?"
+ .qi_row
+ .qi_pannel.qi_plain.padding.row
+ .col-6
+ %h4 Paiements
+ = f.input :p_payment_type_id, :label => "Type de paiement :", :include_blank => false, :collection => PPaymentType.order(:name).all, :as => :select, :input_html => {:id => "payment_type_id_select"}
+ = f.input :ct_payment_comptant, :label => "Paiement comptant nécessaire ?"
+ -if false
+ .col-6
+ = f.input :ct_acompte, :label => "Acompte nécessaire ?"
+ = f.input :ct_acompte_percent, :label => "Pourcentage d'acompte :"
+ .col-6
+ %h4{style: "color: transparent;"} Paiements
+ = f.input :ct_payment_delais, :label => "Délais jour de paiement :"
+ -if false
+ .col-6
+ = f.input :ct_payment_month_end, :label => "Fin de mois ?"
diff --git a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
index db81fc0..001336e 100644
--- a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
+++ b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
@@ -1,4 +1,3 @@
-PRICE LINE BLOCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
=f.inputs do
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
diff --git a/app/views/admin/price_line_blocks/_price_line_block.html.haml b/app/views/admin/price_line_blocks/_price_line_block.html.haml
index 961c8ae..54da1fc 100644
--- a/app/views/admin/price_line_blocks/_price_line_block.html.haml
+++ b/app/views/admin/price_line_blocks/_price_line_block.html.haml
@@ -1,7 +1,3 @@
-
-
-
-
-if price_line_block.p_customer
%h3 Client
-if price_line_block.p_customer and price_line_block.p_customer.particular
@@ -66,60 +62,57 @@
%table.table
%thead
%tr
+ %th IDddd
%th Référence
-
%th Désignation
-
-
-
%th Qté
+ %th Qté saisie
+ %th Actions
-if @price_document and @price_document.label != "Demande prix" and @price_document.label != "Réponse fournisseur"
%th P.U. HT
%th TVA
%th
Montant HT
-
-if price_line_block.purchase?
%th Montant équivalent
%tbody
-price_line_block.price_lines.each do |price_line|
%tr
+ %td{style: id_color(price_line), id: "price_line_#{price_line.id}", onclick: "$('.p_articles_#{price_line.id}').toggle('800','swing');"}
+ ="##{price_line.id}"
%td
=price_line.ref
-
%td
-if price_line.p_product_ref
=price_line.p_product_ref.member_label
-else
=price_line.title
-
-
%td.numeraire
=price_line.qte
- %td
+ %td.numeraire
= price_line.p_articles.count
= link_to i(:"mobile-alt"), add_price_line_p_article_admin_price_lines_path(p_product_ref_id: price_line.p_product_ref.id, price_line_id: price_line.id), :remote => true
-
-if @price_document and @price_document.label != "Demande prix" and @price_document.label != "Réponse fournisseur"
%td.numeraire
=number_to_currency price_line.price_u_ht, :unit => price_line_block.devise_symbol
-
-
%td.numeraire
=price_line.tva_account_value.to_s+"%"
-
-
-
-
%td.numeraire
=number_to_currency price_line.tot_amount_ht, :unit => price_line_block.devise_symbol
-
-
-if price_line_block.purchase?
%td.numeraire
=number_to_currency price_line.local_tot_amount_ht, :unit => price_line_block.devise_symbol
+ -price_line.p_articles.each do |p_article|
+ %tr{class: "p_articles_lines p_articles_#{price_line.id}"}
+ %td
+ %td="##{p_article.id}"
+ %td=p_article.p_product_ref.name
+ %td
+ - p_article.p_article_serial_nums.each do |sn|
+ ="#{sn.p_serial_num_type.name} - #{sn.value} /"
+
-if @price_document and @price_document.label != "Demande prix" and @price_document.label != "Réponse fournisseur"
%table.table{:style => "width:auto;float:right;"}
%tr
diff --git a/app/views/admin/price_line_p_articles/_form.html.haml b/app/views/admin/price_line_p_articles/_form.html.haml
index b7c9644..ce107a0 100644
--- a/app/views/admin/price_line_p_articles/_form.html.haml
+++ b/app/views/admin/price_line_p_articles/_form.html.haml
@@ -1 +1,5 @@
-=form.input :p_article_id, as: :select, collection: PArticle.all, member_label: :id
\ No newline at end of file
+=form.input :p_article_id, as: :select, collection: PArticle.all.map{|p_article| [p_article.serialized_name, p_article.id]}, label: "Article(s) associé(s)", input_html: {class:"p_article_select"}
+
+:javascript
+ $('.p_article_select').select2();
+ $('.p_article_select').removeClass('form-control');
\ No newline at end of file
diff --git a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
index 8575343..7aa687c 100644
--- a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
+++ b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
@@ -1,9 +1,10 @@
.mx-2.my-2
=semantic_form_for [:admin, @price_line], :remote => true do |f|
- .content
- =f.inputs do
- .price_line_p_articles_form
- = f.semantic_fields_for :price_line_p_articles do |form|
- =render :partial => "admin/price_line_p_articles/form", :locals => {:form => form}
- %p= link_to_add_fields "Ajouter un article", f, :price_line_p_articles, {:class => "btn btn-primary"}
- .actions=f.submit "Sauvegarder", :class => "btn btn-primary"
\ No newline at end of file
+ =f.inputs do
+ .price_line_p_articles_form
+ = f.semantic_fields_for :price_line_p_articles do |form|
+ =render :partial => "admin/price_line_p_articles/form", :locals => {:form => form}
+ %p= link_to_add_fields "Ajouter un article", f, :price_line_p_articles, {:class => "btn btn-primary"} if @price_line.p_articles.count < @price_line.qte
+ =link_to "Annuler", "#", class:"btn btn-default", onclick:"close_pane_hover();return false;"
+ =f.submit "sauvegarder", :class => "btn btn-primary"
+
\ No newline at end of file
diff --git a/app/views/admin/price_lines/_form.html.haml b/app/views/admin/price_lines/_form.html.haml
index 013f1d6..839313b 100644
--- a/app/views/admin/price_lines/_form.html.haml
+++ b/app/views/admin/price_lines/_form.html.haml
@@ -4,7 +4,6 @@
%td{:style => "padding-left:10px;", :class => ("error has-error" if form.object.errors[:p_product_ref_id].size > 0 )}
.take.mr-1
=ic :arrows
- = "PRICE_LINEEEEEEEE"
%td{:style => "white-space: nowrap;"}
.input-group
%label Référence
From 877824fba4a850ab71760391412e7e8ddb9bc386 Mon Sep 17 00:00:00 2001
From: Philippe
Date: Fri, 5 Nov 2021 18:46:32 +0100
Subject: [PATCH 07/12] adding select2 on price_line_block in
price_document_new
---
app/assets/javascripts/pane_hover.js | 7 +++
.../_form_facture_achat.html.haml | 11 +++--
.../price_line_p_articles/_form.html.haml | 2 +-
.../_add_price_line_p_article_form.html.haml | 4 +-
app/views/admin/price_lines/_form.html.haml | 44 ++++++++++---------
app/views/qi/_actions.html.haml | 4 ++
6 files changed, 43 insertions(+), 29 deletions(-)
create mode 100644 app/views/qi/_actions.html.haml
diff --git a/app/assets/javascripts/pane_hover.js b/app/assets/javascripts/pane_hover.js
index 3bb1844..8960543 100644
--- a/app/assets/javascripts/pane_hover.js
+++ b/app/assets/javascripts/pane_hover.js
@@ -25,6 +25,13 @@ function show_pane_hover(content, width, height, zindex){
$(".datepicker").attr("autocomplete", "off");
+ $(document).keyup(function(e) {
+ if (e.keyCode == 27) {
+ close_pane_hover();
+ return false;
+ }
+ });
+
}
diff --git a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
index 001336e..ca2fae3 100644
--- a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
+++ b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
@@ -63,7 +63,7 @@
=f.semantic_fields_for :price_lines do |f|
=render :partial => "admin/price_lines/form_bon_de_reception_achat", :locals => {:form => f}
- %p= link_to_add_fields "Ajouter une ligne", f, :price_lines, {:class => "btn btn-primary"}
+ %p= link_to_add_fields "Ajouter une ligneeeeeee", f, :price_lines, {:class => "btn btn-primary add_lines"}
-if current_admin.has_permission?("payments")
@@ -104,6 +104,9 @@
-if false
= f.input :ct_payment_month_end, :label => "Fin de mois ?"
-
-
-
+:javascript
+ $('.add_lines').click(function() {
+ console.log('LENGTH ' + $('.p_product_ref_select').length)
+ $('.p_product_ref_select').last().select2();
+ $('.p_product_ref_select').last().removeClass('form-control');
+ })
diff --git a/app/views/admin/price_line_p_articles/_form.html.haml b/app/views/admin/price_line_p_articles/_form.html.haml
index ce107a0..adf36d2 100644
--- a/app/views/admin/price_line_p_articles/_form.html.haml
+++ b/app/views/admin/price_line_p_articles/_form.html.haml
@@ -2,4 +2,4 @@
:javascript
$('.p_article_select').select2();
- $('.p_article_select').removeClass('form-control');
\ No newline at end of file
+ $('.p_article_select').removeClass('form-control');
diff --git a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
index 7aa687c..b601611 100644
--- a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
+++ b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
@@ -5,6 +5,4 @@
= f.semantic_fields_for :price_line_p_articles do |form|
=render :partial => "admin/price_line_p_articles/form", :locals => {:form => form}
%p= link_to_add_fields "Ajouter un article", f, :price_line_p_articles, {:class => "btn btn-primary"} if @price_line.p_articles.count < @price_line.qte
- =link_to "Annuler", "#", class:"btn btn-default", onclick:"close_pane_hover();return false;"
- =f.submit "sauvegarder", :class => "btn btn-primary"
-
\ No newline at end of file
+ =render :partial => "qi/actions", :locals => {:f => f}
diff --git a/app/views/admin/price_lines/_form.html.haml b/app/views/admin/price_lines/_form.html.haml
index 839313b..5e3ba63 100644
--- a/app/views/admin/price_lines/_form.html.haml
+++ b/app/views/admin/price_lines/_form.html.haml
@@ -1,48 +1,50 @@
-%tr.qi_pannel.qi_plain.padding.price_line_form.col-12.field{:style =>"border-left:4px solid gray;margin-bottom:10px;padding-left:5px;"}
+.row.qi_pannel.qi_plain.padding.price_line_form.col-12.field{:style =>"border-left:4px solid gray;margin-bottom:10px;padding-left:5px;"}
- %td{:style => "padding-left:10px;", :class => ("error has-error" if form.object.errors[:p_product_ref_id].size > 0 )}
- .take.mr-1
- =ic :arrows
- %td{:style => "white-space: nowrap;"}
+
+ .take.mr-1{:style => "padding-left:10px;", :class => ("error has-error" if form.object.errors[:p_product_ref_id].size > 0 )}
+ =ic :arrows
+ .col-3{:style => "white-space: nowrap;"}
+ =form.input :p_product_ref, as: :select, collection: PProductRef.all.map{ |p_product_ref| [p_product_ref.member_label, p_product_ref.id] }, label: "Référence", input_html: {class:"p_product_ref_select"}
.input-group
- %label Référence
- %input.p_product_ref_autocomplete_input.form-control{:type => "text", :style => "", tabindex: 1, autofocus: true, :value => ("#{form.object.p_product_ref.member_label}" if form.object.p_product_ref), :class => "p_product_ref_name"}
- = form.hidden_field :p_product_ref_id, :class => "p_product_ref_id"
- .input-group-append
- =link_to "#", class: "btn btn-dark",:onclick => "key=genRanHex(12);select_product_from_manager(key);$(this).closest('tr').find('.p_product_ref_id').attr('id', 'p_product_ref_id_'+key);$(this).closest('tr').find('.p_product_ref_name').attr('id', 'p_product_ref_name_'+key);$(this).closest('tr').find('.p_product_ref_qte').attr('id', 'p_product_ref_qte_'+key);return false;" do
- =ic(:search)
+ -# %label Référence
+ -# %input.p_product_ref_autocomplete_input.form-control{:type => "text", :style => "", tabindex: 1, autofocus: true, :value => ("#{form.object.p_product_ref.member_label}" if form.object.p_product_ref), :class => "p_product_ref_name"}
+ -# = form.hidden_field :p_product_ref_id, :class => "p_product_ref_id"
+
+ -# .input-group-append
+ -# =link_to "#", class: "btn btn-dark",:onclick => "key=genRanHex(12);select_product_from_manager(key);$(this).closest('tr').find('.p_product_ref_id').attr('id', 'p_product_ref_id_'+key);$(this).closest('tr').find('.p_product_ref_name').attr('id', 'p_product_ref_name_'+key);$(this).closest('tr').find('.p_product_ref_qte').attr('id', 'p_product_ref_qte_'+key);return false;" do
+ -# =ic(:search)
-form.object.forced_price = true if form.object.ct_u_price_ht
-# -if form.object.forced_price and form.object.p_product_ref
- -# %td
+ -# .col-3
-# .mx-2
-# .form-inline
-# =qi_js_field_price_line_form(form, :price_line, :price_u_ht, :label => false, label_class: "mr-1", :value => form.object.th_price_u_ht)
-# -else
- -# %td
+ -# .col-3
-# .mx-2
-# .form-inline
-# =qi_js_field_price_line_form(form, :price_line, :price_u_ht, :label =>false, label_class: "mr-1")
- -# %td
+ -# .col-3
-# .form-inline.mr-2{:style => ("display:none;" if !current_admin or !current_admin.has_permission?("customer-sheets-personalised-price"))}
-# = form.input :forced_price, :label => "Prix personnalisé ?", :as => :boolean, :input_html => {:class => "form-inline input_price_line_forced_price"}
-# .forced_price_wrapper.mx-2{:style => ("display:none;" if !form.object.forced_price)}= form.input :ct_u_price_ht, :label => false, :input_html => {:class => "input_price_line_ct_u_price_ht"}
- %td
+ .col-3
= form.input :qte, :label => "Quantité", :input_html => {:class => "input_price_line_qte form-control p_product_ref_qte", tabindex: 1}
- %td
+ .col-3
= form.input :ct_u_price_ht, :label => "Prix Unitaire HT :", :input_html => { class: "mx-2"}
- -# %td
+ -# .col-3
-# =form.input :ct_tva_account_id, :collection => options_from_collection_for_select(TvaRate.where(:accounting_zone_id => (@p_customer ? @p_customer.accounting_zone_id : nil)).all, "id", "member_label", form.object.tva_account_id), :as => :select ,:label => false, :include_blank => false , :input_html => {:class => "input_price_line_tva_account_id form-control custom-select"}
- %td
- %span.destroy=link_to_remove_fields ic(:"trash-o"), form
- =qi_js_field(form, :price_line, :tva_account_value, :hidden => true)
+ .col-1.text-center.my-auto
+ %span.destroy{style: "font-size: 2rem;"}=link_to_remove_fields ic(:"trash-o"), form
+ = qi_js_field(form, :price_line, :tva_account_value, :hidden => true)
= form.hidden_field :position, :class => "price_line_position_input"
-:javascript
+:javascript
$('.p_product_ref_autocomplete_input').focus()
$( function() {
$('.p_product_ref_autocomplete_input').autocomplete({
diff --git a/app/views/qi/_actions.html.haml b/app/views/qi/_actions.html.haml
new file mode 100644
index 0000000..cf5d322
--- /dev/null
+++ b/app/views/qi/_actions.html.haml
@@ -0,0 +1,4 @@
+%hr
+=link_to "Annuler", "#", class:"btn btn-default", onclick:"close_pane_hover();return false;"
+=f.submit "sauvegarder", :class => "btn btn-primary"
+
\ No newline at end of file
From e2ed7e5f22a3482f0c1f344b11da40a935929a5a Mon Sep 17 00:00:00 2001
From: Philippe
Date: Mon, 8 Nov 2021 18:43:44 +0100
Subject: [PATCH 08/12] addin good select2 instead of autocomplete. adding bon
de commande client to p custommer sheet
---
.../(__TEMPLATE__)c | Bin 5965 -> 1374 bytes
Gemfile | 8 +-
Gemfile.lock | 8 +-
app/assets/javascripts/admin.coffee | 2 +-
app/assets/stylesheets/admin.scss | 3 +
.../admin/price_documents_controller.rb | 5 +-
app/models/p_customer_sheet.rb | 6 +-
app/models/price_line_block.rb | 8 +-
.../admin/price_documents/index.html.haml | 4 +-
.../_form_facture_achat.html.haml | 9 +-
.../price_line_p_articles/_form.html.haml | 8 +-
.../_add_price_line_p_article_form.html.haml | 4 +-
app/views/admin/price_lines/_form.html.haml | 107 ++++++++----------
...mns_to_price_docs_adn_price_line_blocks.rb | 3 +
db/schema.rb | 2 +
15 files changed, 87 insertions(+), 90 deletions(-)
diff --git a/.sass-cache/f6b9a0b1905a68d5dbb2139e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wKexTaOSkq0&>Jg^BiuV(OY^*B8|pAqsDXb+eQG7q%02XMz#
z`H+BNv(GaR=!B@H$k}W~t22XVKb;k!7QiPXWOMi+H~VgO`di`$t6tY1YH(GrH=Fuv
z!Og}65Yi&o3=E+Dqh)=xa=W;jOr!{~*}TOdV;FNivRLcnph4lp@eZA6!c8V33I^p{
zbbGWhhB~%Kj}?-qb!Y^hj14~5;2A3b3ez+fBA}aIRAO|3C};XZv#q3w%DzY>jDiia
NrnY#MHog0u{{w}+6Mp~z
diff --git a/Gemfile b/Gemfile
index bab2ceb..3806597 100644
--- a/Gemfile
+++ b/Gemfile
@@ -54,9 +54,9 @@ group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
- # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
- gem 'spring'
- gem 'spring-watcher-listen', '~> 2.0.0'
+ # # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
+ # gem 'spring'
+ # gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
@@ -118,3 +118,5 @@ gem 'axlsx_rails'
gem 'mimemagic', "0.3.10"
gem "roo"
+gem "select2-rails"
+
diff --git a/Gemfile.lock b/Gemfile.lock
index 93c6cac..d374180 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -301,6 +301,7 @@ GEM
activemodel (>= 5)
elasticsearch (>= 6)
hashie
+ select2-rails (4.0.13)
selenium-webdriver (3.142.3)
childprocess (>= 0.5, < 2.0)
rubyzip (~> 1.2, >= 1.2.2)
@@ -308,10 +309,6 @@ GEM
sixarm_ruby_unaccent (1.2.0)
sort_alphabetical (1.1.0)
unicode_utils (>= 1.2.2)
- spring (2.1.0)
- spring-watcher-listen (2.0.1)
- listen (>= 2.7, < 4.0)
- spring (>= 1.2, < 3.0)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@@ -406,9 +403,8 @@ DEPENDENCIES
roo
sass-rails (~> 5)
searchkick
+ select2-rails
selenium-webdriver
- spring
- spring-watcher-listen (~> 2.0.0)
sprockets
tiny_tds (= 1.3.0)
truncate_html
diff --git a/app/assets/javascripts/admin.coffee b/app/assets/javascripts/admin.coffee
index ea98f59..b0b76cb 100644
--- a/app/assets/javascripts/admin.coffee
+++ b/app/assets/javascripts/admin.coffee
@@ -15,7 +15,7 @@
#= require vendor/jquery.fileupload
#= require vendor/jquery.fileupload-ui
#= require vendor/jquery.fileupload-process
-#= require vendor/select2.min
+#= require select2
#= require vendor/accounting
#= require vendor/jquery.mask
#= require vendor/datatables.min
diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss
index cb1ee54..af45036 100644
--- a/app/assets/stylesheets/admin.scss
+++ b/app/assets/stylesheets/admin.scss
@@ -1,3 +1,6 @@
+/*
+*= require select2
+*/
// Variables
@import "1-variables/app";
diff --git a/app/controllers/admin/price_documents_controller.rb b/app/controllers/admin/price_documents_controller.rb
index a58c531..0446561 100644
--- a/app/controllers/admin/price_documents_controller.rb
+++ b/app/controllers/admin/price_documents_controller.rb
@@ -98,7 +98,7 @@ class Admin::PriceDocumentsController < ApplicationController
if true
- @price_documents = @price_documents.where(:price_document_type_id => params[:price_document_type_ids]) if params[:price_document_type_ids].size > 0
+ @price_documents = @price_documents.where(:price_document_type_id => params[:price_document_type_ids]).order(:id) if params[:price_document_type_ids].size > 0
if current_admin.p_commercial
@@ -234,7 +234,6 @@ class Admin::PriceDocumentsController < ApplicationController
redirect_to admin_p_fournisseurs_path(:create_document => "Commande achat" )
else
-
@price_document = PriceDocument.new(:p_customer_id => params[:p_customer_id], :p_fournisseur_id => params[:p_fournisseur_id])
@price_document.price_document_type = PriceDocumentType.where(:label => params[:document_type]).first
@price_document.price_line_block = PriceLineBlock.new(:p_customer_id => params[:p_customer_id], :p_fournisseur_id => params[:p_fournisseur_id])
@@ -332,7 +331,7 @@ class Admin::PriceDocumentsController < ApplicationController
if @price_document.save
#if @price_document.cc_label == "Demande prix"
if @price_document.cc_label == "Facture achat"
- render action: :show
+ redirect_to admin_price_document_path(@price_document)
else
redirect_to admin_price_documents_path(:price_document_type_id => @price_document.price_document_type_id)
end
diff --git a/app/models/p_customer_sheet.rb b/app/models/p_customer_sheet.rb
index c477f8c..414af69 100644
--- a/app/models/p_customer_sheet.rb
+++ b/app/models/p_customer_sheet.rb
@@ -268,9 +268,11 @@ class PCustomerSheet < ApplicationRecord
self.archive_now if !self.archived
self.block_price if !self.price_blocked
price_document = self.price_documents.new(:price_document_type => PriceDocumentType.find_by_label(label), :date => Date.today)
+ #raise
price_document.p_customer = self.p_customer
price_document.price_line_block = self.price_line_block.dup
+ price_document.tva_type = self.price_line_block.price_document.tva_type
price_document.price_line_block.ac_block_type = nil
@@ -278,7 +280,7 @@ class PCustomerSheet < ApplicationRecord
new_pl = pl.dup
new_pl.ac_block_type = nil
price_document.price_line_block.price_lines << new_pl
- end
+ end
if price_document.save
@@ -306,7 +308,7 @@ class PCustomerSheet < ApplicationRecord
def generate_bc
- generate_doc("Bon de commande", "commande")
+ generate_doc("Bon de commande client", "commande")
end
diff --git a/app/models/price_line_block.rb b/app/models/price_line_block.rb
index 744e069..abee8ee 100644
--- a/app/models/price_line_block.rb
+++ b/app/models/price_line_block.rb
@@ -29,6 +29,8 @@ class PriceLineBlock < ApplicationRecord
belongs_to :p_fournisseur
accepts_nested_attributes_for :p_fournisseur
+
+ belongs_to :price_document
def to_no_archive
if self.imported
@@ -827,10 +829,6 @@ class PriceLineBlock < ApplicationRecord
AVOIR_TO_RESET = %w(weight_tot tot_lines_ht tot_lines_tva tot_lines_ttc tot_fdp_ht tot_fdp_tva tot_fdp_ttc tot_discount_ht tot_discount_tva tot_discount_ttc tot_amount_af_discount_ht tot_amount_af_discount_tva tot_amount_af_discount_ttc gen_discount_percent tot_gen_discount_ht tot_gen_discount_tva tot_gen_discount_ttc tot_amount_ht tot_amount_tva tot_amount_ttc nbr_ship)
-
-
-
-
-
+
end
diff --git a/app/views/admin/price_documents/index.html.haml b/app/views/admin/price_documents/index.html.haml
index 9b37cf8..6ad976f 100644
--- a/app/views/admin/price_documents/index.html.haml
+++ b/app/views/admin/price_documents/index.html.haml
@@ -11,8 +11,6 @@
-if params[:price_document_type_id]
=breadcrumb second_title: PriceDocumentType.find(params[:price_document_type_id]).label
-
-
.qi_search_row
=form_tag "", :method => "get", :onsubmit => "" do
@@ -137,7 +135,7 @@
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @price_documents}
-if true #if params[:price_document_type_id].to_i != 0
- =render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @price_documents, :key => params[:price_document_type_id].to_s}
+ = render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @price_documents, :key => params[:price_document_type_id].to_s}
:scss
diff --git a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
index ca2fae3..d71d68c 100644
--- a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
+++ b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
@@ -63,7 +63,7 @@
=f.semantic_fields_for :price_lines do |f|
=render :partial => "admin/price_lines/form_bon_de_reception_achat", :locals => {:form => f}
- %p= link_to_add_fields "Ajouter une ligneeeeeee", f, :price_lines, {:class => "btn btn-primary add_lines"}
+ %p= link_to_add_fields "Ajouter une ligne", f, :price_lines, {:class => "btn btn-primary add_lines"}
-if current_admin.has_permission?("payments")
@@ -106,7 +106,8 @@
:javascript
$('.add_lines').click(function() {
- console.log('LENGTH ' + $('.p_product_ref_select').length)
- $('.p_product_ref_select').last().select2();
- $('.p_product_ref_select').last().removeClass('form-control');
+ $('.p_product_ref_select').last().select2({
+ //theme: "bootstrap"
+ });
+ //$('.p_product_ref_select').last().removeClass('form-control');
})
diff --git a/app/views/admin/price_line_p_articles/_form.html.haml b/app/views/admin/price_line_p_articles/_form.html.haml
index adf36d2..ea396e6 100644
--- a/app/views/admin/price_line_p_articles/_form.html.haml
+++ b/app/views/admin/price_line_p_articles/_form.html.haml
@@ -1,5 +1,7 @@
-=form.input :p_article_id, as: :select, collection: PArticle.all.map{|p_article| [p_article.serialized_name, p_article.id]}, label: "Article(s) associé(s)", input_html: {class:"p_article_select"}
+= form.input :p_article_id, as: :select, collection: PArticle.joins(:p_product_ref).where(p_product_ref: price_line.p_product_ref).map{|p_article| [p_article.serialized_name, p_article.id]}, label: "Article(s) associé(s)", input_html: {class:"p_article_select"}
:javascript
- $('.p_article_select').select2();
- $('.p_article_select').removeClass('form-control');
+ $('.p_article_select').select2({
+ //theme: "bootstrap"
+ });
+ //$('.p_article_select').removeClass('form-control');
diff --git a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
index b601611..8071164 100644
--- a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
+++ b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
@@ -1,8 +1,8 @@
.mx-2.my-2
=semantic_form_for [:admin, @price_line], :remote => true do |f|
=f.inputs do
- .price_line_p_articles_form
+ .price_line_p_articles_form.col-3
= f.semantic_fields_for :price_line_p_articles do |form|
- =render :partial => "admin/price_line_p_articles/form", :locals => {:form => form}
+ =render :partial => "admin/price_line_p_articles/form", :locals => {:form => form, price_line: @price_line}
%p= link_to_add_fields "Ajouter un article", f, :price_line_p_articles, {:class => "btn btn-primary"} if @price_line.p_articles.count < @price_line.qte
=render :partial => "qi/actions", :locals => {:f => f}
diff --git a/app/views/admin/price_lines/_form.html.haml b/app/views/admin/price_lines/_form.html.haml
index 5e3ba63..ffc3c7a 100644
--- a/app/views/admin/price_lines/_form.html.haml
+++ b/app/views/admin/price_lines/_form.html.haml
@@ -4,8 +4,8 @@
.take.mr-1{:style => "padding-left:10px;", :class => ("error has-error" if form.object.errors[:p_product_ref_id].size > 0 )}
=ic :arrows
- .col-3{:style => "white-space: nowrap;"}
- =form.input :p_product_ref, as: :select, collection: PProductRef.all.map{ |p_product_ref| [p_product_ref.member_label, p_product_ref.id] }, label: "Référence", input_html: {class:"p_product_ref_select"}
+ .col-3
+ = form.input :p_product_ref, as: :select, collection: PProductRef.all.map{ |p_product_ref| [p_product_ref.member_label, p_product_ref.id] }, label: "Référence :", input_html: {class:"p_product_ref_select"}
.input-group
-# %label Référence
-# %input.p_product_ref_autocomplete_input.form-control{:type => "text", :style => "", tabindex: 1, autofocus: true, :value => ("#{form.object.p_product_ref.member_label}" if form.object.p_product_ref), :class => "p_product_ref_name"}
@@ -32,7 +32,7 @@
-# = form.input :forced_price, :label => "Prix personnalisé ?", :as => :boolean, :input_html => {:class => "form-inline input_price_line_forced_price"}
-# .forced_price_wrapper.mx-2{:style => ("display:none;" if !form.object.forced_price)}= form.input :ct_u_price_ht, :label => false, :input_html => {:class => "input_price_line_ct_u_price_ht"}
.col-3
- = form.input :qte, :label => "Quantité", :input_html => {:class => "input_price_line_qte form-control p_product_ref_qte", tabindex: 1}
+ = form.input :qte, :label => "Quantité :", :input_html => {:class => "input_price_line_qte form-control p_product_ref_qte", tabindex: 1}
.col-3
= form.input :ct_u_price_ht, :label => "Prix Unitaire HT :", :input_html => { class: "mx-2"}
@@ -43,59 +43,50 @@
= qi_js_field(form, :price_line, :tva_account_value, :hidden => true)
= form.hidden_field :position, :class => "price_line_position_input"
-
:javascript
- $('.p_product_ref_autocomplete_input').focus()
- $( function() {
- $('.p_product_ref_autocomplete_input').autocomplete({
- source: function( request, response ) {
- $.ajax( {
- url: "/admin/p_product_refs/autocomplete.json",
- dataType: "json",
- data: {
- search: request.term,
- p_customer_id: $(".p_customer_id").val()
- },
- success: function(data){
- arr = jQuery.map( data, function( item ) {
- return {
- label: item.member_label,
- value: item.member_label,
- id: item.id
- }
- });
- response(arr)
- }
- });
- },
- minLength: 2,
- select: function( event, ui ) {
- $(this).next(".p_product_ref_id").val(ui.item.id)
- form = $(this).closest(".price_line_form")
- $.ajax( {
- url: "/admin/p_product_refs/"+ui.item.id+"/get_infos.json",
- dataType: "json",
- data: {
- type: "price",
- qte: form.find(".input_price_line_qte").val(),
- p_customer_id: $(".p_customer_id").val()
- },
- success: function (data) {
- form.find(".input_price_line_price_u_ht").val(data.price);
- form.find(".input_price_line_tva_account_id").val(data.tva_account_id);
- form.find(".input_price_line_tva_account_value").val(data.tva_account_value);
- form.find(".input_price_line_weight_u").val(data.weight);
- }
- });
- //return false
- }
- });
- });
-
-
-:scss
- .price_line_form{
- .form-group{
- margin-bottom:0;}
-
- }
+-# $('.p_product_ref_autocomplete_input').focus()
+-# $( function() {
+-# $('.p_product_ref_autocomplete_input').autocomplete({
+-# source: function( request, response ) {
+-# $.ajax( {
+-# url: "/admin/p_product_refs/autocomplete.json",
+-# dataType: "json",
+-# data: {
+-# search: request.term,
+-# p_customer_id: $(".p_customer_id").val()
+-# },
+-# success: function(data){
+-# arr = jQuery.map( data, function( item ) {
+-# return {
+-# label: item.member_label,
+-# value: item.member_label,
+-# id: item.id
+-# }
+-# });
+-# response(arr)
+-# }
+-# });
+-# },
+-# minLength: 2,
+-# select: function( event, ui ) {
+-# $(this).next(".p_product_ref_id").val(ui.item.id)
+-# form = $(this).closest(".price_line_form")
+-# $.ajax( {
+-# url: "/admin/p_product_refs/"+ui.item.id+"/get_infos.json",
+-# dataType: "json",
+-# data: {
+-# type: "price",
+-# qte: form.find(".input_price_line_qte").val(),
+-# p_customer_id: $(".p_customer_id").val()
+-# },
+-# success: function (data) {
+-# form.find(".input_price_line_price_u_ht").val(data.price);
+-# form.find(".input_price_line_tva_account_id").val(data.tva_account_id);
+-# form.find(".input_price_line_tva_account_value").val(data.tva_account_value);
+-# form.find(".input_price_line_weight_u").val(data.weight);
+-# }
+-# });
+-# //return false
+-# }
+-# });
+-# });
\ No newline at end of file
diff --git a/db/migrate/20211029111104_add_columns_to_price_docs_adn_price_line_blocks.rb b/db/migrate/20211029111104_add_columns_to_price_docs_adn_price_line_blocks.rb
index eafc48e..d94c68b 100644
--- a/db/migrate/20211029111104_add_columns_to_price_docs_adn_price_line_blocks.rb
+++ b/db/migrate/20211029111104_add_columns_to_price_docs_adn_price_line_blocks.rb
@@ -6,5 +6,8 @@ class AddColumnsToPriceDocsAdnPriceLineBlocks < ActiveRecord::Migration[6.0]
add_column :price_documents, :supplier_document_date, :date
add_column :price_line_blocks, :stock_entrance_date, :date
add_column :price_line_blocks, :ct_tot_amount_ht, :decimal, :precision => 14, :scale => 2
+ change_table :price_line_blocks do |t|
+ t.belongs_to :price_document
+ end
end
end
diff --git a/db/schema.rb b/db/schema.rb
index c6cfc94..4128f51 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -2471,7 +2471,9 @@ ActiveRecord::Schema.define(version: 2021_11_03_085623) do
t.string "cc_state"
t.date "stock_entrance_date"
t.decimal "ct_tot_amount_ht", precision: 14, scale: 2
+ t.bigint "price_document_id"
t.index ["p_customer_id"], name: "index_price_line_blocks_on_p_customer_id"
+ t.index ["price_document_id"], name: "index_price_line_blocks_on_price_document_id"
end
create_table "price_line_p_articles", force: :cascade do |t|
From 820bd0364076487cdb4ec57c1621cfe39e741d91 Mon Sep 17 00:00:00 2001
From: Philippe
Date: Tue, 9 Nov 2021 12:13:52 +0100
Subject: [PATCH 09/12] fixing p_article_price_line mannel bug
---
.../(__TEMPLATE__)c | Bin 1374 -> 5965 bytes
app/models/p_customer_sheet.rb | 10 +---
.../admin/p_customer_sheets/_form.html.haml | 1 -
.../admin/price_line_blocks/_form.html.haml | 53 +++++++++---------
.../price_line_p_articles/_form.html.haml | 2 +-
.../_add_price_line_p_article_form.html.haml | 2 +-
app/views/admin/price_lines/_form.html.haml | 51 -----------------
7 files changed, 31 insertions(+), 88 deletions(-)
diff --git a/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c b/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c
index e1c3ae14c64ffb6b86d264611307231a215c18c3..f14f6942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?
zW`16AH3QJ(lFEYA$(F48%IwzS`PLGg){^!FD8Pv&LQl7O1)pl>bfAZ0D*AZ;yVV6Ew(F}aIP8t9#DHaRm5D?W#k
v)Lfu%N`SsrfrUpkmx2P+lU5+#SaWgJa&d8iJOy+U+vJbjiacy^Qw>7^kL+bZ
diff --git a/app/models/p_customer_sheet.rb b/app/models/p_customer_sheet.rb
index 414af69..76b4e3d 100644
--- a/app/models/p_customer_sheet.rb
+++ b/app/models/p_customer_sheet.rb
@@ -267,29 +267,25 @@ class PCustomerSheet < ApplicationRecord
def generate_doc(label, state)
self.archive_now if !self.archived
self.block_price if !self.price_blocked
- price_document = self.price_documents.new(:price_document_type => PriceDocumentType.find_by_label(label), :date => Date.today)
- #raise
- price_document.p_customer = self.p_customer
+ price_document = self.price_documents.new(:price_document_type => PriceDocumentType.find_by_label(label), :date => Date.today)
+ price_document.p_customer = self.p_customer
price_document.price_line_block = self.price_line_block.dup
price_document.tva_type = self.price_line_block.price_document.tva_type
-
price_document.price_line_block.ac_block_type = nil
self.price_line_block.price_lines.each do |pl|
new_pl = pl.dup
new_pl.ac_block_type = nil
+ pl.p_articles.each { |p_article| new_pl.p_articles << p_article }
price_document.price_line_block.price_lines << new_pl
end
if price_document.save
-
price_document.archive_now
self.state = state
self.save
-
end
-
end
def generate_d
diff --git a/app/views/admin/p_customer_sheets/_form.html.haml b/app/views/admin/p_customer_sheets/_form.html.haml
index 9f1576e..5df9e97 100755
--- a/app/views/admin/p_customer_sheets/_form.html.haml
+++ b/app/views/admin/p_customer_sheets/_form.html.haml
@@ -19,4 +19,3 @@
=link_to "Annuler", admin_p_customer_sheets_path(), :class => "btn"
=form.submit "sauvegarder", :class => "btn btn-primary btn-ap-add"
.clear
-
diff --git a/app/views/admin/price_line_blocks/_form.html.haml b/app/views/admin/price_line_blocks/_form.html.haml
index 861d505..d069561 100644
--- a/app/views/admin/price_line_blocks/_form.html.haml
+++ b/app/views/admin/price_line_blocks/_form.html.haml
@@ -51,34 +51,24 @@
%br
- %div{:style=>"padding:0 30px;"}
- .row.qi_field_wrapper
- %table{:style => "width:100%;border-collapse:separate;"}
- %thead
- %tr
- %th
- %th Produit
- %th{:style => "width:200px;"} Prix
- %th
- %th{:style => "width:100px;"} Qté
- %th TVA
- %th
- %tbody.price_lines_form
- =f.semantic_fields_for :price_lines do |f|
- =render :partial => "admin/price_lines/form", :locals => {:form => f}
-
- %p{:style=>"padding-top:10px;"}= link_to_add_fields ic("plus-circle") + " ligne", f, :price_lines, {:class => "btn btn-primary p-2", tabindex: 10, style: "position: sticky; top: 100px"}
-
-
-
-
-
-
-
-
-
-
+ -# %div{:style=>"padding:0 30px;"}
+ -# .row.qi_field_wrapper
+ -# %table{:style => "width:100%;border-collapse:separate;"}
+ -# %thead
+ -# %tr
+ -# %th
+ -# %th Produit
+ -# %th{:style => "width:200px;"} Prix
+ -# %th
+ -# %th{:style => "width:100px;"} Qté
+ -# %th TVA
+ -# %th
+ -# %tbody.price_lines_form
+ .qi_row.price_lines_form
+ =f.semantic_fields_for :price_lines do |f|
+ =render :partial => "admin/price_lines/form", :locals => {:form => f}
+ %p{:style=>"padding-left:10px;"}= link_to_add_fields ic("plus-circle") + " Ajouter une ligne", f, :price_lines, {:class => "btn btn-primary p-2 add_lines", tabindex: 10}
-if current_admin.has_permission?("payments")
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
@@ -108,3 +98,12 @@
-if false
.col-6
= f.input :ct_payment_month_end, :label => "Fin de mois ?"
+
+:javascript
+ $('.p_product_ref_select').select2();
+ $('.add_lines').click(function() {
+ $('.p_product_ref_select').last().select2({
+ //theme: "bootstrap"
+ });
+ //$('.p_product_ref_select').last().removeClass('form-control');
+ })
\ No newline at end of file
diff --git a/app/views/admin/price_line_p_articles/_form.html.haml b/app/views/admin/price_line_p_articles/_form.html.haml
index ea396e6..b58b1ec 100644
--- a/app/views/admin/price_line_p_articles/_form.html.haml
+++ b/app/views/admin/price_line_p_articles/_form.html.haml
@@ -1,4 +1,4 @@
-= form.input :p_article_id, as: :select, collection: PArticle.joins(:p_product_ref).where(p_product_ref: price_line.p_product_ref).map{|p_article| [p_article.serialized_name, p_article.id]}, label: "Article(s) associé(s)", input_html: {class:"p_article_select"}
+= form.input :p_article_id, as: :select, collection: PArticle.joins(:p_product_ref).where(p_product_ref: @price_line.p_product_ref).map{|p_article| [p_article.serialized_name, p_article.id]}, label: "Article(s) associé(s)", input_html: {class:"p_article_select"}
:javascript
$('.p_article_select').select2({
diff --git a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
index 8071164..d410809 100644
--- a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
+++ b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
@@ -3,6 +3,6 @@
=f.inputs do
.price_line_p_articles_form.col-3
= f.semantic_fields_for :price_line_p_articles do |form|
- =render :partial => "admin/price_line_p_articles/form", :locals => {:form => form, price_line: @price_line}
+ = render "admin/price_line_p_articles/form", form: form, price_line: @price_line
%p= link_to_add_fields "Ajouter un article", f, :price_line_p_articles, {:class => "btn btn-primary"} if @price_line.p_articles.count < @price_line.qte
=render :partial => "qi/actions", :locals => {:f => f}
diff --git a/app/views/admin/price_lines/_form.html.haml b/app/views/admin/price_lines/_form.html.haml
index ffc3c7a..e1c9540 100644
--- a/app/views/admin/price_lines/_form.html.haml
+++ b/app/views/admin/price_lines/_form.html.haml
@@ -1,7 +1,4 @@
.row.qi_pannel.qi_plain.padding.price_line_form.col-12.field{:style =>"border-left:4px solid gray;margin-bottom:10px;padding-left:5px;"}
-
-
-
.take.mr-1{:style => "padding-left:10px;", :class => ("error has-error" if form.object.errors[:p_product_ref_id].size > 0 )}
=ic :arrows
.col-3
@@ -42,51 +39,3 @@
%span.destroy{style: "font-size: 2rem;"}=link_to_remove_fields ic(:"trash-o"), form
= qi_js_field(form, :price_line, :tva_account_value, :hidden => true)
= form.hidden_field :position, :class => "price_line_position_input"
-
-:javascript
--# $('.p_product_ref_autocomplete_input').focus()
--# $( function() {
--# $('.p_product_ref_autocomplete_input').autocomplete({
--# source: function( request, response ) {
--# $.ajax( {
--# url: "/admin/p_product_refs/autocomplete.json",
--# dataType: "json",
--# data: {
--# search: request.term,
--# p_customer_id: $(".p_customer_id").val()
--# },
--# success: function(data){
--# arr = jQuery.map( data, function( item ) {
--# return {
--# label: item.member_label,
--# value: item.member_label,
--# id: item.id
--# }
--# });
--# response(arr)
--# }
--# });
--# },
--# minLength: 2,
--# select: function( event, ui ) {
--# $(this).next(".p_product_ref_id").val(ui.item.id)
--# form = $(this).closest(".price_line_form")
--# $.ajax( {
--# url: "/admin/p_product_refs/"+ui.item.id+"/get_infos.json",
--# dataType: "json",
--# data: {
--# type: "price",
--# qte: form.find(".input_price_line_qte").val(),
--# p_customer_id: $(".p_customer_id").val()
--# },
--# success: function (data) {
--# form.find(".input_price_line_price_u_ht").val(data.price);
--# form.find(".input_price_line_tva_account_id").val(data.tva_account_id);
--# form.find(".input_price_line_tva_account_value").val(data.tva_account_value);
--# form.find(".input_price_line_weight_u").val(data.weight);
--# }
--# });
--# //return false
--# }
--# });
--# });
\ No newline at end of file
From 159085c55d24a208824c127999bae67876e50eb6 Mon Sep 17 00:00:00 2001
From: Philippe
Date: Wed, 10 Nov 2021 17:28:49 +0100
Subject: [PATCH 10/12] adding PDF invoice
---
.../(__TEMPLATE__)c | Bin 5965 -> 1374 bytes
.../admin/price_documents_controller.rb | 35 +--
app/models/price_document.rb | 73 +++--
app/views/admin/p_articles/_form.html.haml | 27 +-
.../admin/p_customer_sheets/show.html.haml | 10 +-
.../admin/price_documents/print.html.haml | 270 +++++++++++++-----
.../admin/price_line_blocks/_form.html.haml | 15 +-
.../_form_facture_achat.html.haml | 13 +-
.../price_line_p_articles/_form.html.haml | 6 -
.../price_lines/_add_p_article_form.html.haml | 2 +-
.../_add_price_line_p_article_form.html.haml | 21 +-
pdf.js | 6 +-
pdf3.js | 32 +++
pdf_stamp/cgv.pdf | Bin 0 -> 747033 bytes
pdf_stamp/en-tete.pdf | Bin 400140 -> 0 bytes
pdf_stamp/en-tête.pdf | Bin 0 -> 53244 bytes
16 files changed, 335 insertions(+), 175 deletions(-)
create mode 100644 pdf3.js
create mode 100644 pdf_stamp/cgv.pdf
delete mode 100644 pdf_stamp/en-tete.pdf
create mode 100644 pdf_stamp/en-tête.pdf
diff --git a/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c b/.sass-cache/f6b9a0b1905a68d5dbb2139e95d49cba92f6fa93/(__TEMPLATE__)c
index f14f6942a4eff9a4b9af0c9026e5b8e2e708b671..e1c3ae14c64ffb6b86d264611307231a215c18c3 100644
GIT binary patch
delta 389
zcmX@BcaKZYSkGL~gv-Ft$jCf3HQB=4I4#v6HPtxPBq=#1&D_W+H6It+*WW5_3~Mm3W{MlU*3sGxAOT!WauA
zgP5*QUc@3R#*>m+T#%Dk$!5(NV#V!HmY7qT8qGFYo>zSGdlp?8&b<7*RInVcLw-R?
zW`16AH3QJ(lFEYA$(F48%IwzS`PLGg){^!FD8Pv&LQl7O1)pl>bfAZ0D*AZ;yVV6Ew(F}aIP8t9#DHaRm5D?W#k
v)Lfu%N`SsrfrUpkmx2P+lU5+#SaWgJa&d8iJOy+U+vJbjiacy^Qw>7^kL+bZ
literal 5965
zcmbVQUvt~W5f?Qbii9jtbo9@ZEVHzu*orOEk{sE0Gwmg=JYgnrG#1krJz$RHi9!S7
zPym#pdi>UWh4f?eOSNC2eQb9Re~w2&ij*hfh}*s2?(P0|7yG-1y9d_c!NDQ#?RC4a
z&iLMo?w)8J?Dt;r=l$Nx7hJsT9f~iyqPyR+epiy@-U$ywLOOvEguIh7dMo?l4q0Tq
zbI0um!aFTbZW_4)H&uwm0(d?xwi{~?yRv_2hY^pQFmnDn5@C@Pk2>To^LY@8zKuIW
zNgDBSC&CrINCt$wmct=G5g_69M2Rf0p%`{W5S|t#xj(r%-8V;QNPD@13FViged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d8>*(1*ZZ_Plb0X>m~?%4Qukx3u{_|t7SP#gfhftbnzxM2X)#0CJt*FTEO
z_dqHz|7^wX{2_8&Lf*$X(}eqW>ND=b&|heb5tN9|!Fwl&>N8;dh>ezRO`0gALH^
z5A1k(1(J$^w38A6pX>PYmMm7xYc
z(Uk#Lx`9uJ(5ySUdV(`rg==TAv{%?jothMg4LG`%c^6ktvzy2bhCBs27)%9eFwAZh
zj3czIX0wohVY3ekDTwKexTaOSkq0&>Jg^BiuV(OY^*B8|pAqsDXb+eQG7q%02XMz#
z`H+BNv(GaR=!B@H$k}W~t22XVKb;k!7QiPXWOMi+H~VgO`di`$t6tY1YH(GrH=Fuv
z!Og}65Yi&o3=E+Dqh)=xa=W;jOr!{~*}TOdV;FNivRLcnph4lp@eZA6!c8V33I^p{
zbbGWhhB~%Kj}?-qb!Y^hj14~5;2A3b3ez+fBA}aIRAO|3C};XZv#q3w%DzY>jDiia
NrnY#MHog0u{{w}+6Mp~z
diff --git a/app/controllers/admin/price_documents_controller.rb b/app/controllers/admin/price_documents_controller.rb
index 0446561..4e02801 100644
--- a/app/controllers/admin/price_documents_controller.rb
+++ b/app/controllers/admin/price_documents_controller.rb
@@ -427,38 +427,39 @@ class Admin::PriceDocumentsController < ApplicationController
end
- def print
-
-
-
+ def OLD_print
@price_document = PriceDocument.find_by_token(params[:id])
@element = @price_document.ref_element
doc_number = @price_document.d_number
url = print_admin_price_document_path(:id => @price_document.token, :html => true)
-
-
-
-
params[:inline] = true
if !params[:html] # and !Rails.env.development?
-
@data_to_send = File.open(@price_document.generate_pdf).read
-
-
-
-
-
send_data @data_to_send, :filename =>"#{doc_number}.pdf" , :type => 'application/pdf',:disposition => (params[:inline] ? 'inline' : "attachment")
#render :inline => "y"
-
else
render :layout => false
end
-
end
-
+
+
+ def print
+ @price_document = PriceDocument.find_by_token(params[:id])
+ @element = @price_document.ref_element
+
+ doc_number = @price_document.d_number
+ url = print_admin_price_document_path(:id => @price_document.token, :html => true)
+ params[:inline] = true
+ if !params[:html] # and !Rails.env.development?
+ @data_to_send = File.open(@price_document.generate_pdf).read
+ send_data @data_to_send, :filename =>"#{doc_number}.pdf" , :type => 'application/pdf',:disposition => (params[:inline] ? 'inline' : "attachment")
+ #render :inline => "y"
+ else
+ render :layout => false
+ end
+ end
def create_avoir
diff --git a/app/models/price_document.rb b/app/models/price_document.rb
index 9629fe2..d9568c0 100644
--- a/app/models/price_document.rb
+++ b/app/models/price_document.rb
@@ -585,50 +585,79 @@ class PriceDocument < ApplicationRecord
end
- def generate_pdf
-
-
-
-
+ def OLD_generate_pdf
doc_number = self.d_number
- url = print_admin_price_document_path(:id => self.token, :html => true)
-
+ url = print_admin_price_document_path(:id => self.token, :html => true) #don't forget to copy line "include Rails.application.routes.url_helpers"
@temp_file = "#{Rails.root}/pdf/price_documents/#{doc_number}_temp.pdf"
@final_file = "#{Rails.root}/pdf/price_documents/#{doc_number}_temp2.pdf"
@final_file2 = "#{Rails.root}/pdf/price_documents/#{doc_number}.pdf"
- url = (Rails.env.development? ? "http://localhost:4000" : "http://mdmb.basiclabs.fr").to_s+url
- puts url
- pdf = ("pdf")
-
+ url = (Rails.env.development? ? "http://localhost:3000" : "http://mdmb.basiclabs.fr").to_s+url
+ pdf = ("pdf2")
node_file = @temp_file
+ puts "NODE IFLEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+ puts url
+ puts url
+ puts url
+ puts url
+ puts url
+ puts node_file
+ puts "NODE IFLEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"
+
+
+
+ system("node #{pdf}.js #{Shellwords.escape(url)} #{Shellwords.escape(@temp_file)}")
+ require 'posix/spawn'
+
+ ::POSIX::Spawn::Child.new 'pdftk', @temp_file, 'stamp', "#{Rails.root}/pdf_stamp/en-tete.pdf", 'output', @final_file
+ ::POSIX::Spawn::Child.new 'pdftk', @final_file,"#{Rails.root}/pdf_stamp/cgv.pdf", 'cat', 'output', @final_file2 #AJOUT CGV
+
+ # File.rename(@temp_file, @final_file2) if File.exist?(@temp_file)
+ # File.delete(@temp_file) if File.exist?(@temp_file)
+ # File.delete(@final_file) if File.exist?(@final_file)
+
+ return @final_file
+
+ end
+
+
+ def generate_pdf
+ doc_number = self.d_number
+ url = print_admin_price_document_path(:id => self.token, :html => true) #don't forget to copy line "include Rails.application.routes.url_helpers"
+
+ @temp_file = "#{Rails.root}/pdf/price_documents/#{doc_number}_temp.pdf"
+ @final_file = "#{Rails.root}/pdf/price_documents/#{doc_number}_temp2.pdf"
+ @final_file2 = "#{Rails.root}/pdf/price_documents/#{doc_number}.pdf"
+
+ url = (Rails.env.development? ? "http://localhost:3000" : "http://mdmb.basiclabs.fr").to_s+url
+ pdf = ("pdf")
+ node_file = @temp_file
+
system("node #{pdf}.js #{Shellwords.escape(url)} #{Shellwords.escape(@temp_file)}")
require 'posix/spawn'
-
::POSIX::Spawn::Child.new 'pdftk', @temp_file, 'stamp', "#{Rails.root}/pdf_stamp/en-tete.pdf", 'output', @final_file
-
-
- # ::POSIX::Spawn::Child.new 'pdftk', @final_file,"#{Rails.root}/pdf_stamp/cgv.pdf", 'cat', 'output', @final_file2 #AJOUT CGV
+ # if true
+ if self.label != "Bon de livraison"
+ #::POSIX::Spawn::Child.new 'pdftk', @final_file,"#{Rails.root}/pdf_stamp/cgv.pdf", 'cat', 'output', @final_file2 #AJOUT CGV
+ return @final_file2
+ else
+ return @final_file
+ end
# File.rename(@temp_file, @final_file2)
-
-
#File.delete(@temp_file) if File.exist?(@temp_file)
#File.delete(@final_file) if File.exist?(@final_file)
-
- return @final_file
-
-
-
end
+
+
def create_avoir
past_price_document = self
diff --git a/app/views/admin/p_articles/_form.html.haml b/app/views/admin/p_articles/_form.html.haml
index 6b380c1..36c987f 100644
--- a/app/views/admin/p_articles/_form.html.haml
+++ b/app/views/admin/p_articles/_form.html.haml
@@ -1,20 +1,19 @@
- if params[:controller] == "admin/p_articles"
=semantic_form_for [:admin, @p_article], :remote => true do |f|
- .content
- =f.inputs do
- -if params[:p_product_ref_id]
- = f.input :p_product_ref, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :selected => f.object.p_product_ref , :label => f.object.label_for(:p_product_ref)
- -else
- = 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 :
- .p_article_serial_nums_form
- = f.semantic_fields_for :p_article_serial_nums do |form|
- =render :partial => "admin/p_article_serial_nums/form", :locals => {:form => form}
- %p= link_to_add_fields "Ajouter un numéro de série", f, :p_article_serial_nums, {:class => "btn btn-primary"}
+ =f.inputs do
+ -if params[:p_product_ref_id]
+ = f.input :p_product_ref, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :selected => f.object.p_product_ref , :label => f.object.label_for(:p_product_ref)
+ -else
+ = 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 :
+ .p_article_serial_nums_form
+ = f.semantic_fields_for :p_article_serial_nums do |form|
+ =render :partial => "admin/p_article_serial_nums/form", :locals => {:form => form}
+ %p= link_to_add_fields "Ajouter un numéro de série", f, :p_article_serial_nums, {:class => "btn btn-primary"}
- .actions=f.submit "sauvegarder", :class => "btn btn-primary"
+ .actions=f.submit "sauvegarder", :class => "btn btn-primary"
- elsif params[:controller] == "admin/price_lines"
= form.inputs do
-if params[:p_product_ref_id]
diff --git a/app/views/admin/p_customer_sheets/show.html.haml b/app/views/admin/p_customer_sheets/show.html.haml
index 8bab240..d664b6d 100644
--- a/app/views/admin/p_customer_sheets/show.html.haml
+++ b/app/views/admin/p_customer_sheets/show.html.haml
@@ -16,14 +16,11 @@
.qi_row
- .qi_pannel.qi_plain.padding
-
-
-
+ .qi_pannel.qi_plain.padding
-if @bon_de_commande = @p_customer_sheet.price_documents.where(:cc_label => "Bon de commande").first
-price_line_block = @bon_de_commande.price_line_block
%h3
- Contenu du bon de commande
+ Contenu du bon de commande
=@bon_de_commande.d_number
=":"
-else
@@ -108,4 +105,5 @@
:javascript
- $('.p_articles_lines').hide();
\ No newline at end of file
+ $('.p_articles_lines').hide();
+
\ No newline at end of file
diff --git a/app/views/admin/price_documents/print.html.haml b/app/views/admin/price_documents/print.html.haml
index af7294a..349e5fc 100644
--- a/app/views/admin/price_documents/print.html.haml
+++ b/app/views/admin/price_documents/print.html.haml
@@ -1,99 +1,213 @@
%head
- :scss
- body{
- font-size:10px;
- font-family:arial, sans-serif;
-
- .table{
- border-collapse:collapse;
- font-size:10px;
- font-family:arial, sans-serif;
-
- td,th{
- border:1px solid gray;
- }
- }
-
- .table{
- td{
- padding:2px 5px;
- }
- }
- }
-
-
- .clear{
- clear:both;
- }
-
- .table{
- width:100%;
- }
-
- td.numeraire{
- white-space: nowrap;
- text-align:right;
- }
-
-
+:css
+ html {
+ -webkit-print-color-adjust: exact;
+ }
+
+ body{
+ font-family:arial, sans-serif;
+ }
+
+ .font-13px {
+ font-size: 13px;
+ }
+
+ .bordered {
+ border: 1px solid black;
+ border-collapse: collapse;
+ }
+
+ .line-height-100 {
+ text-align: center;
+ height: 100px;
+ }
+
+ .line-height-20 {
+ text-align: center;
+ height: 20px;
+ }
+
+ .border-left {
+ border-left: 1px solid;
+ }
+
+ .border-top {
+ border-top: 1px solid;
+ }
+
+ .border-right {
+ border-right: 1px solid;
+ }
+
+ .border-bottom {
+ border-bottom: 1px solid;
+ }
+
+ .bg-grey {
+ background-color: rgb(239, 239, 239)
+ }
+
+ table, tbody {
+ font-size: 13px;
+ }
+
+
+
+
+
+
+
-price_line_block = @price_document.price_line_block
%body
+
+ -if @price_document.label == "Bon de livraison"
+ -@bl = true
+ -particular_doc = price_line_block.particular_send
+
+
+ -else
+ -particular_doc = price_line_block.particular_bill
-
- %div{:style => "float:right;margin-top:4cm;font-size:13px;margin-bottom:0.5cm;padding-right:2cm;"}
-
- -if @price_document.label == "Bon de livraison"
- -@bl = true
- -particular_doc = price_line_block.particular_send
-
-
- -else
- -particular_doc = price_line_block.particular_bill
-
-
- -if particular_doc.organisation?
- %strong=particular_doc.organisation
- -if particular_doc.com_name?
- %br
- =particular_doc.com_name
-
+
+ -if particular_doc.organisation?
+ %strong=particular_doc.organisation
+ -if particular_doc.com_name?
%br
- -if particular_doc.firstname? or particular_doc.name?
- =particular_doc.civilite
-
- =particular_doc.firstname
+ =particular_doc.com_name
+
+ %br
+ -if particular_doc.firstname? or particular_doc.name?
+ =particular_doc.civilite
+
+ =particular_doc.firstname
- =particular_doc.name
- %br
-
- =particular_doc.address_2
-
- -if particular_doc.address_3?
- %br
- =particular_doc.address_3
+ =particular_doc.name
%br
- =particular_doc.cp
- =particular_doc.city
+ =particular_doc.address_2
+
+ -if particular_doc.address_3?
%br
- =particular_doc.country
+ =particular_doc.address_3
+ %br
+ =particular_doc.cp
+
+ =particular_doc.city
+ %br
+ =particular_doc.country
- #top_left{:style => "width:230px;text-align:center;"}
- =image_tag "https://mdmb.basiclabs.fr/logo-mdmb.png", :style => "width:100px;display:block;margin:auto;"
- .address
- %strong MAISON DES METIERS DE BOUCHE
- %br
- 20 chemin des Posés
- %br
- 74330 POISY
+
+ %table
+ %thead
+ %tr
+ %th{:style => "width: 25%"}
+ %th{:style => "width: 75%"}
+ %tbody
+ %tr
+ %td
+ =image_tag "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAABIFBMVEUAlecBk+gAlOgAlOYBk+b///8AlOT///3///z///oCkugAjN8AkOb8//8AleQAkeUAitoAjOMAkeoAjdoAitYAiNkAleLc9fsAjujm+PdKq971//9qt+QAktwAh9UAkd+JxeP///Wt3erH6u4AjtLZ9vqQzOYwm9kvndRZrtttvuHH6/aj2+vk9/cvpNSk2ua25fAWm99+wt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px;display:block;margin:auto;"
+ %td{:style => "padding-left: 35px"}
+ %strong{style: "font-size: 20px;"} S.A.S PRESTAPHONE
+ %p{style: "line-height: 3px;"} PONT DE BEAUVOISIN
+ %p{style: "line-height: 3px;"} Avenue Jean Jaures 73330 PONT DE BEAUVOISIN
+ %p{style: "line-height: 3px;"} 74330 POISY
+ %p{style: "line-height: 20px;"} TEL :0981251293
+
+
+ %table
+ %thead
+ %tr
+ %th{:style => "width: 15%"}
+ %th{:style => "width: 50%"}
+ %th{:style => "width: 25%"}
+ %tbody
+ %tr
+ %td
+ %td
+ %td
+ %strong{style: "line-height: 70px;"}
+ FACTURE
+ =@price_document.d_number
+ %tr
+ %td{style: "line-height: 3px;"} Date :
+ %td{style: "line-height: 3px;"}
+ =l @price_document.date, :format => :date
+ %td
+ %p{style: "line-height: 3px;"} Josef Falser
+ %p{style: "line-height: 3px;"} zona produttiva Bodner 2
+ %p{style: "line-height: 3px;"} 39053 Prato Isarco, IT
+
+
+ %table{style: "margin-top: 40px"}
+ %thead
+ %tr
+ %th.border-left.border-top{:style => "width: 5%"}
+ %th.border-left.border-top{:style => "width: 20%"} DESIGNATION
+ %th.border-left.border-top{:style => "width: 45%"} DESCRIPTION
+ %th.border-left.border-top{:style => "width: 15%"} PRIX UNITAIRE
+ %th.border-left.border-top.border-right{:style => "width: 15%"} TOTAL
+ %tbody
+ %tr.line-height-100
+ %td.border-left.border-top 1
+ %td.border-left.border-top SMARTPHONE RECONDITIONNE
+ %td.border-left.border-top Samsung Galaxy Xcover 4 | SIM unique | schwarz
+ %td.border-left.border-top 147,00 €
+ %td.border-left.border-top.border-right 147,00 €
+ %tr.line-height-100
+ %td.border-left.border-top
+ %td.border-left.border-top
+ %td.border-left.border-top IMEI : Non renseigne
+ %td.border-left.border-top
+ %td.border-left.border-top.border-right
+ %tr.line-height-20
+ %td.border-top
+ %td.border-top
+ %td.border-top
+ %td.border-left.border-top Total HT
+ %td.border-top.border-left.border-right.bg-grey
+ %strong 147,00 €
+ %tr.line-height-20
+ %td
+ %td
+ %td
+ %td.border-left Taux T.V.A.
+ %td.border-left.border-right.bg-grey
+ %strong TVA/MARGE
+ %tr.line-height-20
+ %td
+ %td
+ %td
+ %td.border-left.border-bottom
+ %strong Total TTC
+ %td.border-left.border-right.border-bottom.bg-grey
+ %strong 147,00 €
+
.clear
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
+ %br
diff --git a/app/views/admin/price_line_blocks/_form.html.haml b/app/views/admin/price_line_blocks/_form.html.haml
index d069561..62518b3 100644
--- a/app/views/admin/price_line_blocks/_form.html.haml
+++ b/app/views/admin/price_line_blocks/_form.html.haml
@@ -32,14 +32,6 @@
=render :partial => "admin/particulars/form", :locals => {:form => form_particular_bill}
=form_particular_bill.hidden_field :owner_id
=form_particular_bill.hidden_field :owner_type
-
-
-
-
-
-
-
-
-if current_admin.has_permission?("customer-sheets-bl")
=# f.input :bl_comment, :label => "Commentaire à mettre sur le BL :", :input_html => {:style => "min-height:50px;height:50px;"}
@@ -102,8 +94,5 @@
:javascript
$('.p_product_ref_select').select2();
$('.add_lines').click(function() {
- $('.p_product_ref_select').last().select2({
- //theme: "bootstrap"
- });
- //$('.p_product_ref_select').last().removeClass('form-control');
- })
\ No newline at end of file
+ $('.p_product_ref_select').last().select2(});
+ });
\ No newline at end of file
diff --git a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
index d71d68c..71a8487 100644
--- a/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
+++ b/app/views/admin/price_line_blocks/_form_facture_achat.html.haml
@@ -61,8 +61,9 @@
.price_lines_form
=f.semantic_fields_for :price_lines do |f|
- =render :partial => "admin/price_lines/form_bon_de_reception_achat", :locals => {:form => f}
-
+ -# =render :partial => "admin/price_lines/form_bon_de_reception_achat", :locals => {:form => f}
+ =render :partial => "admin/price_lines/form", :locals => {:form => f}
+
%p= link_to_add_fields "Ajouter une ligne", f, :price_lines, {:class => "btn btn-primary add_lines"}
@@ -105,9 +106,7 @@
= f.input :ct_payment_month_end, :label => "Fin de mois ?"
:javascript
+ $('.p_product_ref_select').select2();
$('.add_lines').click(function() {
- $('.p_product_ref_select').last().select2({
- //theme: "bootstrap"
- });
- //$('.p_product_ref_select').last().removeClass('form-control');
- })
+ $('.p_product_ref_select').last().select2();
+ });
diff --git a/app/views/admin/price_line_p_articles/_form.html.haml b/app/views/admin/price_line_p_articles/_form.html.haml
index b58b1ec..2dcf600 100644
--- a/app/views/admin/price_line_p_articles/_form.html.haml
+++ b/app/views/admin/price_line_p_articles/_form.html.haml
@@ -1,7 +1 @@
= form.input :p_article_id, as: :select, collection: PArticle.joins(:p_product_ref).where(p_product_ref: @price_line.p_product_ref).map{|p_article| [p_article.serialized_name, p_article.id]}, label: "Article(s) associé(s)", input_html: {class:"p_article_select"}
-
-:javascript
- $('.p_article_select').select2({
- //theme: "bootstrap"
- });
- //$('.p_article_select').removeClass('form-control');
diff --git a/app/views/admin/price_lines/_add_p_article_form.html.haml b/app/views/admin/price_lines/_add_p_article_form.html.haml
index 6367aa5..aed4cdb 100644
--- a/app/views/admin/price_lines/_add_p_article_form.html.haml
+++ b/app/views/admin/price_lines/_add_p_article_form.html.haml
@@ -6,4 +6,4 @@
= f.semantic_fields_for :p_articles do |form|
=render :partial => "admin/p_articles/form", :locals => {:form => form, @price_line => f.object}
%p= link_to_add_fields "Ajouter un article", f, :p_articles, {:class => "btn btn-primary"} if f.object.p_articles.count < f.object.qte
- .actions=f.submit "Sauvegarder", :class => "btn btn-primary"
+ =render :partial => "qi/actions", :locals => {:f => f}
diff --git a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
index d410809..95fe240 100644
--- a/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
+++ b/app/views/admin/price_lines/_add_price_line_p_article_form.html.haml
@@ -1,8 +1,17 @@
.mx-2.my-2
=semantic_form_for [:admin, @price_line], :remote => true do |f|
- =f.inputs do
- .price_line_p_articles_form.col-3
- = f.semantic_fields_for :price_line_p_articles do |form|
- = render "admin/price_line_p_articles/form", form: form, price_line: @price_line
- %p= link_to_add_fields "Ajouter un article", f, :price_line_p_articles, {:class => "btn btn-primary"} if @price_line.p_articles.count < @price_line.qte
- =render :partial => "qi/actions", :locals => {:f => f}
+ .content
+ =f.inputs do
+ .price_line_p_articles_form
+ = f.semantic_fields_for :price_line_p_articles do |form|
+ = render "admin/price_line_p_articles/form", form: form, price_line: @price_line
+ %p= link_to_add_fields "Ajouter un article", f, :price_line_p_articles, {:class => "btn btn-primary add_price_line_p_article"} if @price_line.p_articles.count < @price_line.qte
+ =render :partial => "qi/actions", :locals => {:f => f}
+
+
+
+:javascript
+ $('.p_article_select').select2();
+ $('.add_price_line_p_article').click(function() {
+ $('.p_article_select').last().select2();
+ });
diff --git a/pdf.js b/pdf.js
index 9ecda95..3e5666b 100644
--- a/pdf.js
+++ b/pdf.js
@@ -8,16 +8,12 @@ const createPdf = async() => {
browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
const page = await browser.newPage();
//await page.setViewport({width: 794, height: 1122, deviceScaleFactor: 1});
- await page._emulationManager._client.send(
- 'Emulation.setDefaultBackgroundColorOverride',
- { color: { r: 0, g: 0, b: 0, a: 0 } }
- );
await page.goto(process.argv[2], {timeout: 3000, waitUntil: 'networkidle2'});
await page.waitFor(250);
await page.pdf({
path: process.argv[3],
format: 'A4',
- margin: { top: "0cm", right: "0cm", bottom: "0cm", left: "0cm" },
+ margin: { top: "0.5cm", right: "1cm", bottom: "4.2cm", left: "1cm" },
printBackground: false
});
} catch (err) {
diff --git a/pdf3.js b/pdf3.js
new file mode 100644
index 0000000..9ecda95
--- /dev/null
+++ b/pdf3.js
@@ -0,0 +1,32 @@
+'use strict';
+
+const puppeteer = require('puppeteer');
+
+const createPdf = async() => {
+ let browser;
+ try {
+ browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
+ const page = await browser.newPage();
+ //await page.setViewport({width: 794, height: 1122, deviceScaleFactor: 1});
+ await page._emulationManager._client.send(
+ 'Emulation.setDefaultBackgroundColorOverride',
+ { color: { r: 0, g: 0, b: 0, a: 0 } }
+ );
+ await page.goto(process.argv[2], {timeout: 3000, waitUntil: 'networkidle2'});
+ await page.waitFor(250);
+ await page.pdf({
+ path: process.argv[3],
+ format: 'A4',
+ margin: { top: "0cm", right: "0cm", bottom: "0cm", left: "0cm" },
+ printBackground: false
+ });
+ } catch (err) {
+ console.log(err.message);
+ } finally {
+ if (browser) {
+ browser.close();
+ }
+ process.exit();
+ }
+};
+createPdf();
\ No newline at end of file
diff --git a/pdf_stamp/cgv.pdf b/pdf_stamp/cgv.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..09b6619a796badbf9e05420463bd5733496cc079
GIT binary patch
literal 747033
zcmV(rK<>XKP((&8F)lL-CB)_ObY*fNFGg%(
zbY(Vma%Ev{3U~qSy=j*$$B~}-J%2?~0D%h<
zRjAynhE$WytqEdjF3>c4`m!}W94^uTnrTw{|9W0qe2d7)%qrXq>YO<^=N7`#-Q0FF
zH}~-P_w}#V|Gxg{$A8_dfB)C@gZ=l{-_!JPzuo(@{^#+2_w;aFA9tJk(K{pRW6bgXS(mbTSqAN{_pW1F@=um5TN-`01>`-g|8-P6;W
zpLVCGEwexD?)Urket*AT|K$(rwfg9nfB4Jq|M36)_y6&4U#|c1UqEJe+T1@LpAJUp
zVSBiLJRJ^D@pQl2KR!LK@Aks-X?qmKAAS7QX8n`@S9GlYeSJLM9}MT?1D#KgN9Z^_
zZtk}m<}Pht*0#+KCY~No>o4orY+HS~b~=E%-N9*o*ccUu&Eft5Do*!@ZIH2^ka2)$
z81G~p4@hhaGYf`g7AImGL`WFh!|C|+_<%V4e@`1&$eg>U9Aia#uHdyrM^&eebZoqIQ
zO-NmyV7Nzlw@7Tg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