From ee52fca31eb1cd2bba56c995a61d49bef7ef984c Mon Sep 17 00:00:00 2001 From: Philippe Date: Fri, 29 Oct 2021 18:40:30 +0200 Subject: [PATCH] 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%-8VNw?l5_F z7K#WS7ntz+N`%(bOS<8#!_f$_1yI3y8AKvzp&-2*|HO}EgN2FDZ37=&FVlNc>nqaD zvDG@g-)?;J*tR=I-yMJZW#`DYpA^ACbW4(YjJlm13PJP+aDwKJ%Sg~6E^pK)C+zI1b6Mr)MRR}EnL|f^(xS`RQFKjS@6{!GzeTt3dXzB!B##da$vL>+Qg$D>x=Zh~8r@|8sY@TY!Y6Q!}IKdyCapKFPl4E-urP7$dT74kGjsl?nze$M#k2E9|sWk zB3j>Rs`~)1UHXE|hnNKs_-+Qwg+P=(Mrin929TE~3@!msD}#+IlER*#lH)-7NF_^j z2`^(sV|=FIsVmvWR8NBKq!&1Tl+x9=4g@=QOLTi`!=KS|LQbLpqM%H-k)pnM{o<>` zug0uY>YuPz^fOX%`e2`P=7@kaSYP;o=OhIEWMQ_gNoolT>(b;xX;eu+AHx{ie#?w+ zWEqcV!HqBccAROo$Z#HqV$_%OWSOY|1CRA=m9=q*Z9XNlh7>GW0KecT)8ePxB^Lo#7dHWdWS-qw;QL;9hLYup(v|9#%VEMkot6z zr&LBiqmRw3TTBBqNrOeers=i(Oq=( z(!`ldaLQulS6pqSXDW(s(v}H2Pk{z)DtI1O6IS@Ual%4&!k$rX5-hCnbGkvBUG2)C zFM?-*GdPb_9w03n)~_D;Kh;C&I{ow()IPyK z^M5f;Sk6u`%}=nf!auSN84WI^xLKI#GDCTs%WAo7rM&U0{l#@WwS1E-)wzabyOCw7 z60SPS5QOT{%+h7pt0i#-l2>Kv{w=aJX(XnzZzXkUl6@<1roKsB?WYKI7*1p#d6aPW zL|YI>No#Ll=OhJ6`QE2sXD6@-dY9!EN7vJt9z-p=v`Jzflk<)0DU{c5zC_6XQkHe3#{~H zg?XbPG*d8>*(1*ZZ_Plb0X>m~?%4Qukx3u{_|t7SP#gfhftbnzxM2X)#0CJt*FTEO z_dqHz|7^wX{2_8&Lf*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 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