adding 1 invoice per TVA type
This commit is contained in:
parent
7508ae2e65
commit
e470f405a0
@ -236,6 +236,10 @@ class Admin::PCustomerSheetsController < ApplicationController
|
|||||||
|
|
||||||
def generate_bc
|
def generate_bc
|
||||||
@p_customer_sheet = PCustomerSheet.find(params[:id])
|
@p_customer_sheet = PCustomerSheet.find(params[:id])
|
||||||
|
@p_customer_sheet.price_line_block.price_lines.joins(:p_articles).where("p_articles.tva_type_id = ?", 1)
|
||||||
|
@p_customer_sheet.price_line_block.price_lines.joins(:p_articles).where("p_articles.tva_type_id = ?", 2)
|
||||||
|
|
||||||
|
|
||||||
@p_customer_sheet.generate_bc
|
@p_customer_sheet.generate_bc
|
||||||
|
|
||||||
redirect_back(fallback_location: admin_p_customer_sheets_path)
|
redirect_back(fallback_location: admin_p_customer_sheets_path)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
class PArticle < ApplicationRecord
|
class PArticle < ApplicationRecord
|
||||||
belongs_to :p_grade
|
belongs_to :p_grade
|
||||||
belongs_to :p_product_ref
|
belongs_to :p_product_ref
|
||||||
|
belongs_to :tva_type
|
||||||
has_one :p_product, through: :p_product_ref
|
has_one :p_product, through: :p_product_ref
|
||||||
has_one :p_product_color, through: :p_product_ref
|
has_one :p_product_color, through: :p_product_ref
|
||||||
has_one :s_brand, through: :p_product_ref
|
has_one :s_brand, through: :p_product_ref
|
||||||
|
@ -264,28 +264,73 @@ class PCustomerSheet < ApplicationRecord
|
|||||||
self.save
|
self.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def generate_doc(label, state)
|
def generate_doc(label, state)
|
||||||
self.archive_now if !self.archived
|
self.archive_now if !self.archived
|
||||||
self.block_price if !self.price_blocked
|
self.block_price if !self.price_blocked
|
||||||
|
self.price_line_block.price_lines.joins(:p_articles).where("p_articles.tva_type_id = ?", 1)
|
||||||
|
|
||||||
price_document = self.price_documents.new(:price_document_type => PriceDocumentType.find_by_label(label), :date => Date.today)
|
if !self.price_line_block.price_lines.joins(:p_articles).where("p_articles.tva_type_id = ?", 1).empty?
|
||||||
price_document.p_customer = self.p_customer
|
price_document_standard_tva = self.price_documents.new(:price_document_type => PriceDocumentType.find_by_label(label), :date => Date.today, :tva_type_id => 1)
|
||||||
price_document.price_line_block = self.price_line_block.dup
|
price_document_standard_tva.p_customer = self.p_customer
|
||||||
price_document.tva_type = self.price_line_block.price_document.tva_type
|
price_document_standard_tva.price_line_block = self.price_line_block.dup
|
||||||
price_document.price_line_block.ac_block_type = nil
|
price_document_standard_tva.price_line_block.ac_block_type = nil
|
||||||
|
|
||||||
|
self.price_line_block.price_lines.each do |pl|
|
||||||
|
if !pl.p_articles.where(tva_type_id: 1).empty?
|
||||||
|
new_pl = pl.dup
|
||||||
|
new_pl.ac_block_type = nil
|
||||||
|
pl.p_articles.where(tva_type_id: 1).each { |p_article| new_pl.p_articles << p_article }
|
||||||
|
price_document_standard_tva.price_line_block.price_lines << new_pl
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
self.price_line_block.price_lines.each do |pl|
|
if price_document_standard_tva.save
|
||||||
new_pl = pl.dup
|
price_document_standard_tva.archive_now
|
||||||
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.state = state
|
||||||
self.save
|
self.save
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if !self.price_line_block.price_lines.joins(:p_articles).where("p_articles.tva_type_id = ?", 2).empty?
|
||||||
|
price_document_sur_marge_tva = self.price_documents.new(:price_document_type => PriceDocumentType.find_by_label(label), :date => Date.today, :tva_type_id => 2)
|
||||||
|
price_document_sur_marge_tva.p_customer = self.p_customer
|
||||||
|
price_document_sur_marge_tva.price_line_block = self.price_line_block.dup
|
||||||
|
price_document_sur_marge_tva.price_line_block.ac_block_type = nil
|
||||||
|
|
||||||
|
self.price_line_block.price_lines.each do |pl|
|
||||||
|
if !pl.p_articles.where(tva_type_id: 2).empty?
|
||||||
|
new_pl = pl.dup
|
||||||
|
new_pl.ac_block_type = nil
|
||||||
|
pl.p_articles.where(tva_type_id: 2).each { |p_article| new_pl.p_articles << p_article }
|
||||||
|
price_document_sur_marge_tva.price_line_block.price_lines << new_pl
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if price_document_sur_marge_tva.save
|
||||||
|
price_document_sur_marge_tva.archive_now
|
||||||
|
self.state = state
|
||||||
|
self.save
|
||||||
|
end
|
||||||
|
|
||||||
|
# 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.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
|
end
|
||||||
|
|
||||||
def generate_d
|
def generate_d
|
||||||
|
@ -343,7 +343,7 @@ class PriceDocument < ApplicationRecord
|
|||||||
|
|
||||||
include Rails.application.routes.url_helpers
|
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 tva_type_name)
|
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
|
def reset_for_update
|
||||||
@ -644,7 +644,7 @@ class PriceDocument < ApplicationRecord
|
|||||||
if self.label != "Bon de livraison"
|
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
|
#::POSIX::Spawn::Child.new 'pdftk', @final_file,"#{Rails.root}/pdf_stamp/cgv.pdf", 'cat', 'output', @final_file2 #AJOUT CGV
|
||||||
#return @final_file2
|
#return @final_file2
|
||||||
File.rename(@final_file, @final_file2)
|
File.rename(@final_file, @final_file2) if File.exist?(@final_file)
|
||||||
File.delete(@temp_file) if File.exist?(@temp_file)
|
File.delete(@temp_file) if File.exist?(@temp_file)
|
||||||
return @final_file2
|
return @final_file2
|
||||||
else
|
else
|
||||||
|
@ -16,9 +16,13 @@
|
|||||||
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
- elsif params[:controller] == "admin/price_lines"
|
- elsif params[:controller] == "admin/price_lines"
|
||||||
= form.inputs do
|
= form.inputs do
|
||||||
|
|
||||||
|
=@price_line.price_line_block.price_lineable.tva_type_id
|
||||||
-if params[:p_product_ref_id]
|
-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.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
|
= form.hidden_field :p_product_ref_id, value: form.object.p_product_ref_id
|
||||||
|
= form.hidden_field :tva_type_id, value: @price_line.price_line_block.price_lineable.tva_type_id
|
||||||
|
|
||||||
-else
|
-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.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
|
= form.hidden_field :p_product_ref_id, value: form.object.p_product_ref_id
|
||||||
@ -29,4 +33,3 @@
|
|||||||
= form.semantic_fields_for :p_article_serial_nums do |form|
|
= form.semantic_fields_for :p_article_serial_nums do |form|
|
||||||
=render :partial => "admin/p_article_serial_nums/form", :locals => {:form => 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"}
|
%p= link_to_add_fields "Ajouter un numéro de série", form, :p_article_serial_nums, {:class => "btn btn-primary"}
|
||||||
|
|
||||||
|
@ -52,6 +52,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
-price_line_block = @price_document.price_line_block
|
-price_line_block = @price_document.price_line_block
|
||||||
|
-p_custommer_sheet = @price_document.ref_element
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%body
|
%body
|
||||||
%table
|
%table
|
||||||
%thead
|
%thead
|
||||||
@ -89,20 +94,16 @@
|
|||||||
%td{style: "line-height: 3px;"}
|
%td{style: "line-height: 3px;"}
|
||||||
=l @price_document.date, :format => :date
|
=l @price_document.date, :format => :date
|
||||||
%td
|
%td
|
||||||
%p{style: "line-height: 3px;"} Josef Falser
|
%p
|
||||||
%p{style: "line-height: 3px;"} zona produttiva Bodner 2
|
|
||||||
%p{style: "line-height: 3px;"}
|
|
||||||
39053 Prato Isarco, IT
|
|
||||||
-if @price_document.label == "Bon de livraison"
|
-if @price_document.label == "Bon de livraison"
|
||||||
-@bl = true
|
-@bl = true
|
||||||
-particular_doc = price_line_block.particular_send
|
-particular_doc = price_line_block.particular_send
|
||||||
-else
|
-else
|
||||||
-particular_doc = price_line_block.particular_bill
|
-particular_doc = price_line_block.particular_bill
|
||||||
-if particular_doc.organisation?
|
-# -if particular_doc.organisation?
|
||||||
%strong=particular_doc.organisation
|
-# %strong=particular_doc.organisation
|
||||||
-if particular_doc.com_name?
|
-# -if particular_doc.com_name?
|
||||||
%br
|
-# %br=particular_doc.com_name
|
||||||
=particular_doc.com_name
|
|
||||||
%br
|
%br
|
||||||
-if particular_doc.firstname? or particular_doc.name?
|
-if particular_doc.firstname? or particular_doc.name?
|
||||||
=particular_doc.civilite
|
=particular_doc.civilite
|
||||||
@ -115,9 +116,7 @@
|
|||||||
=particular_doc.address_3
|
=particular_doc.address_3
|
||||||
%br
|
%br
|
||||||
=particular_doc.cp
|
=particular_doc.cp
|
||||||
=particular_doc.city
|
="#{particular_doc.city}, #{particular_doc.country}"
|
||||||
%br
|
|
||||||
=particular_doc.country
|
|
||||||
|
|
||||||
|
|
||||||
%table{style: "margin-top: 40px"}
|
%table{style: "margin-top: 40px"}
|
||||||
@ -128,419 +127,467 @@
|
|||||||
%th.border-left.border-top{:style => "width: 45%"} DESCRIPTION
|
%th.border-left.border-top{:style => "width: 45%"} DESCRIPTION
|
||||||
%th.border-left.border-top{:style => "width: 15%"} PRIX UNITAIRE
|
%th.border-left.border-top{:style => "width: 15%"} PRIX UNITAIRE
|
||||||
%th.border-left.border-top.border-right{:style => "width: 15%"} TOTAL
|
%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
|
|
||||||
|
|
||||||
%table.table{:style => "width:auto;"}
|
|
||||||
%tr
|
|
||||||
%td N° Client
|
|
||||||
%td
|
|
||||||
Date de commande
|
|
||||||
%td Représentant
|
|
||||||
-if @price_document.label != "Avoir"
|
|
||||||
%td
|
|
||||||
Semaine de livraison souhaitée
|
|
||||||
%td
|
|
||||||
Nombre de colis
|
|
||||||
-elsif pd = PriceDocument.where(:id => @price_document.facture_id).first
|
|
||||||
%td
|
|
||||||
Réf. facture
|
|
||||||
|
|
||||||
%tr
|
|
||||||
%td=@price_document.p_customer.code if @price_document.p_customer
|
|
||||||
%td
|
|
||||||
=l price_line_block.creation_date if price_line_block.creation_date
|
|
||||||
%td
|
|
||||||
=@price_document.p_commercial.long_name if @price_document.p_commercial
|
|
||||||
-if @price_document.label != "Avoir"
|
|
||||||
%td
|
|
||||||
=l price_line_block.wish_date, :format => "%V"
|
|
||||||
(du
|
|
||||||
=l price_line_block.wish_date.beginning_of_week
|
|
||||||
au
|
|
||||||
=l price_line_block.wish_date.end_of_week
|
|
||||||
)
|
|
||||||
|
|
||||||
%td
|
|
||||||
=price_line_block.nbr_ship
|
|
||||||
-elsif pd
|
|
||||||
%td
|
|
||||||
=pd.d_number
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-if price_line_block.customer_ref?
|
|
||||||
%p
|
|
||||||
Référence commande personnalisée :
|
|
||||||
=price_line_block.customer_ref
|
|
||||||
|
|
||||||
-if particular_doc
|
|
||||||
-range_part = price_line_block.particular_send
|
|
||||||
-range_part = range_part.particular_ref if range_part.particular_ref
|
|
||||||
|
|
||||||
-oras = []
|
|
||||||
-OpenRange.where(:id => (OpenRange.all.ids - range_part.open_ranges.ids)).each do |ora|
|
|
||||||
-oras << ora.name
|
|
||||||
|
|
||||||
-if oras.size > 0
|
|
||||||
|
|
||||||
%p
|
|
||||||
Jour(s) de fermeture :
|
|
||||||
=oras.join(", ")
|
|
||||||
|
|
||||||
|
|
||||||
%br
|
|
||||||
|
|
||||||
%table.table
|
|
||||||
%thead
|
|
||||||
%tr
|
|
||||||
%th Référence
|
|
||||||
%th Désignation
|
|
||||||
%th Qté [U]
|
|
||||||
-if true or @price_document.label != "Avoir"
|
|
||||||
%th Qté [Kg]
|
|
||||||
-if !@bl
|
|
||||||
-if @price_document.label != "Avoir"
|
|
||||||
%th P.U. HT [Kg]
|
|
||||||
%th TVA
|
|
||||||
-if @price_document.label != "Avoir"
|
|
||||||
-if !price_line_block.remise_ecole_ok
|
|
||||||
%th
|
|
||||||
Remise
|
|
||||||
%br
|
|
||||||
Marché
|
|
||||||
%br
|
|
||||||
annuel
|
|
||||||
|
|
||||||
-if price_line_block.ca_remise_qte_ok
|
|
||||||
%th
|
|
||||||
Remise
|
|
||||||
%br
|
|
||||||
Qté livrée
|
|
||||||
%br
|
|
||||||
="/cde"
|
|
||||||
|
|
||||||
-if price_line_block.remise_pre_order_ok
|
|
||||||
%th
|
|
||||||
Remise
|
|
||||||
%br
|
|
||||||
commande
|
|
||||||
%br
|
|
||||||
anticipée
|
|
||||||
-if price_line_block.discount_comptant
|
|
||||||
%th
|
|
||||||
Remise
|
|
||||||
%br
|
|
||||||
comptant
|
|
||||||
|
|
||||||
-if price_line_block.remise_enrobage_ok
|
|
||||||
%th
|
|
||||||
Remise
|
|
||||||
%br
|
|
||||||
enrobage
|
|
||||||
-else
|
|
||||||
%th
|
|
||||||
Remise
|
|
||||||
%br
|
|
||||||
école
|
|
||||||
|
|
||||||
-if @price_document.label != "Avoir"
|
|
||||||
%th
|
|
||||||
P.U. Net
|
|
||||||
-else
|
|
||||||
%th
|
|
||||||
P.U.
|
|
||||||
%th
|
|
||||||
Montant HT
|
|
||||||
%tbody
|
%tbody
|
||||||
-price_line_block.price_lines.each do |price_line|
|
-price_line_block.price_lines.each do |price_line|
|
||||||
%tr
|
%tr.line-height-100
|
||||||
|
%td.border-left.border-top=price_line.id
|
||||||
|
%td.border-left.border-top=price_line.ref
|
||||||
|
%td.border-left.border-top=price_line.title
|
||||||
|
-if @price_document.label != "Avoir"
|
||||||
|
%td.border-left.border-top=number_to_currency price_line.ca_price_u_kg_net_ht
|
||||||
|
-else
|
||||||
|
%td.border-left.border-top=number_to_currency price_line.ca_price_u_ht
|
||||||
|
%td.border-left.border-top.border-right=number_to_currency price_line.tot_amount_ht
|
||||||
|
-sn_array = []
|
||||||
|
-imei_array = []
|
||||||
|
-price_line.p_articles.each do |p_article|
|
||||||
|
-sn_array << p_article.p_article_serial_nums.map{ |sn| sn.value if sn.p_serial_num_type == PSerialNumType.find_by(name: "SN")}.reject(&:nil?)
|
||||||
|
-imei_array << p_article.p_article_serial_nums.map{ |imei| imei.value if imei.p_serial_num_type == PSerialNumType.find_by(name: "IMEI")}.reject(&:nil?)
|
||||||
|
|
||||||
|
%tr.line-height-100
|
||||||
|
%td.border-left.border-top
|
||||||
|
%td.border-left.border-top
|
||||||
|
%td.border-left.border-top
|
||||||
|
%p{style: "line-height: 20px;"}="SN : " + sn_array.join(', ')
|
||||||
|
%p{style: "line-height: 20px;"}="IMEI : " + imei_array.join(', ')
|
||||||
|
%td.border-left.border-top
|
||||||
|
%td.border-left.border-top.border-right
|
||||||
|
|
||||||
|
|
||||||
|
-if price_line_block.price_lineable.tva_type_id == 1
|
||||||
|
-# %tr.line-height-20
|
||||||
|
-# %td
|
||||||
|
-# %td
|
||||||
|
-# %td
|
||||||
|
-# %td.border-left Total HT Net
|
||||||
|
-# %td.border-left.border-right.bg-grey
|
||||||
|
-# %strong=number_to_currency price_line_block.tot_amount_ht
|
||||||
|
%tr.line-height-20
|
||||||
|
%td.border-top
|
||||||
|
%td.border-top
|
||||||
|
%td.border-top
|
||||||
|
%td.border-left.border-top Montant HT
|
||||||
|
%td.border-top.border-left.border-right.bg-grey
|
||||||
|
%strong=number_to_currency price_line_block.tot_lines_ht
|
||||||
|
%tr.line-height-20
|
||||||
%td
|
%td
|
||||||
=price_line.ref
|
|
||||||
-if price_line.p_product_ref and price_line.p_product_ref.assembled and @bl
|
|
||||||
%br
|
|
||||||
Contient les références primaires suivantes :
|
|
||||||
-price_line.p_product_ref.p_product_assembleds.all.each do |ppa|
|
|
||||||
%br
|
|
||||||
|
|
||||||
%strong
|
|
||||||
=ppa.qte
|
|
||||||
X
|
|
||||||
=ppa.p_product_ref.p_product.code
|
|
||||||
|
|
||||||
%td
|
%td
|
||||||
=price_line.title
|
%td
|
||||||
%td.numeraire
|
%td.border-left Montant T.V.A.
|
||||||
=price_line.qte
|
%td.border-left.border-right.bg-grey
|
||||||
-if true or @price_document.label != "Avoir"
|
%strong=number_to_currency price_line_block.tot_amount_tva
|
||||||
%td.numeraire
|
%tr.line-height-20
|
||||||
=price_line.weight_qte.to_f.round(3)
|
%td
|
||||||
|
%td
|
||||||
|
%td
|
||||||
|
%td.border-left Taux T.V.A.
|
||||||
|
%td.border-left.border-right.bg-grey 20%
|
||||||
|
%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=number_to_currency price_line_block.tot_amount_ttc
|
||||||
|
|
||||||
|
|
||||||
|
-if price_line_block.price_lineable.tva_type_id == 2
|
||||||
|
%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=number_to_currency price_line_block.tot_lines_ht
|
||||||
|
-# %tr.line-height-20
|
||||||
|
-# %td
|
||||||
|
-# %td
|
||||||
|
-# %td
|
||||||
|
-# %td.border-left Total HT Net
|
||||||
|
-# %td.border-left.border-right.bg-grey
|
||||||
|
-# %strong=number_to_currency price_line_block.tot_amount_ht
|
||||||
|
%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 Total T.V.A.
|
||||||
|
-# %td.border-left.border-right.bg-grey
|
||||||
|
-# %strong=number_to_currency price_line_block.tot_amount_tva
|
||||||
|
%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=number_to_currency price_line_block.tot_amount_ttc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-# %table.table{:style => "width:auto;"}
|
||||||
|
-# %tr
|
||||||
|
-# %td N° Client
|
||||||
|
-# %td
|
||||||
|
-# Date de commande
|
||||||
|
-# %td Représentant
|
||||||
|
-# -if @price_document.label != "Avoir"
|
||||||
|
-# %td
|
||||||
|
-# Semaine de livraison souhaitée
|
||||||
|
-# %td
|
||||||
|
-# Nombre de colis
|
||||||
|
-# -elsif pd = PriceDocument.where(:id => @price_document.facture_id).first
|
||||||
|
-# %td
|
||||||
|
-# Réf. facture
|
||||||
|
|
||||||
|
-# %tr
|
||||||
|
-# %td=@price_document.p_customer.code if @price_document.p_customer
|
||||||
|
-# %td
|
||||||
|
-# =l price_line_block.creation_date if price_line_block.creation_date
|
||||||
|
-# %td
|
||||||
|
-# =@price_document.p_commercial.long_name if @price_document.p_commercial
|
||||||
|
-# -if @price_document.label != "Avoir"
|
||||||
|
-# %td
|
||||||
|
-# =l price_line_block.wish_date, :format => "%V"
|
||||||
|
-# (du
|
||||||
|
-# =l price_line_block.wish_date.beginning_of_week
|
||||||
|
-# au
|
||||||
|
-# =l price_line_block.wish_date.end_of_week
|
||||||
|
-# )
|
||||||
|
|
||||||
|
-# %td
|
||||||
|
-# =price_line_block.nbr_ship
|
||||||
|
-# -elsif pd
|
||||||
|
-# %td
|
||||||
|
-# =pd.d_number
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-# -if price_line_block.customer_ref?
|
||||||
|
-# %p
|
||||||
|
-# Référence commande personnalisée :
|
||||||
|
-# =price_line_block.customer_ref
|
||||||
|
|
||||||
|
-# -if particular_doc
|
||||||
|
-# -range_part = price_line_block.particular_send
|
||||||
|
-# -range_part = range_part.particular_ref if range_part.particular_ref
|
||||||
|
|
||||||
|
-# -oras = []
|
||||||
|
-# -OpenRange.where(:id => (OpenRange.all.ids - range_part.open_ranges.ids)).each do |ora|
|
||||||
|
-# -oras << ora.name
|
||||||
|
|
||||||
|
-# -if oras.size > 0
|
||||||
|
|
||||||
|
-# %p
|
||||||
|
-# Jour(s) de fermeture :
|
||||||
|
-# =oras.join(", ")
|
||||||
|
|
||||||
-if !@bl
|
|
||||||
-if @price_document.label != "Avoir"
|
|
||||||
%td.numeraire
|
|
||||||
=number_to_currency price_line.ca_price_u_kg_ht
|
|
||||||
%td.numeraire
|
|
||||||
=price_line.tva_account_value.to_s+"%"
|
|
||||||
|
|
||||||
-if @price_document.label != "Avoir"
|
-# %br
|
||||||
-if !price_line_block.remise_ecole_ok
|
|
||||||
%td.numeraire
|
-# %table.table
|
||||||
=price_line.discount_market_percent.to_s+"%"
|
-# %thead
|
||||||
%br
|
-# %tr
|
||||||
=number_to_currency price_line.ca_discount_market_ht
|
-# %th Référence
|
||||||
|
-# %th Désignation
|
||||||
|
-# %th Qté [U]
|
||||||
|
-# -if true or @price_document.label != "Avoir"
|
||||||
|
-# %th Qté [Kg]
|
||||||
|
-# -if !@bl
|
||||||
|
-# -if @price_document.label != "Avoir"
|
||||||
|
-# %th P.U. HT [Kg]
|
||||||
|
-# %th TVA
|
||||||
|
-# -if @price_document.label != "Avoir"
|
||||||
|
-# -if !price_line_block.remise_ecole_ok
|
||||||
|
-# %th
|
||||||
|
-# Remise
|
||||||
|
-# %br
|
||||||
|
-# Marché
|
||||||
|
-# %br
|
||||||
|
-# annuel
|
||||||
|
|
||||||
|
-# -if price_line_block.ca_remise_qte_ok
|
||||||
|
-# %th
|
||||||
|
-# Remise
|
||||||
|
-# %br
|
||||||
|
-# Qté livrée
|
||||||
|
-# %br
|
||||||
|
-# ="/cde"
|
||||||
|
|
||||||
|
-# -if price_line_block.remise_pre_order_ok
|
||||||
|
-# %th
|
||||||
|
-# Remise
|
||||||
|
-# %br
|
||||||
|
-# commande
|
||||||
|
-# %br
|
||||||
|
-# anticipée
|
||||||
|
-# -if price_line_block.discount_comptant
|
||||||
|
-# %th
|
||||||
|
-# Remise
|
||||||
|
-# %br
|
||||||
|
-# comptant
|
||||||
|
|
||||||
|
-# -if price_line_block.remise_enrobage_ok
|
||||||
|
-# %th
|
||||||
|
-# Remise
|
||||||
|
-# %br
|
||||||
|
-# enrobage
|
||||||
|
-# -else
|
||||||
|
-# %th
|
||||||
|
-# Remise
|
||||||
|
-# %br
|
||||||
|
-# école
|
||||||
|
|
||||||
|
-# -if @price_document.label != "Avoir"
|
||||||
|
-# %th
|
||||||
|
-# P.U. Net
|
||||||
|
-# -else
|
||||||
|
-# %th
|
||||||
|
-# P.U.
|
||||||
|
-# %th
|
||||||
|
-# Montant HT
|
||||||
|
-# %tbody
|
||||||
|
-# -price_line_block.price_lines.each do |price_line|
|
||||||
|
-# %tr
|
||||||
|
-# %td
|
||||||
|
-# =price_line.ref
|
||||||
|
-# -if price_line.p_product_ref and price_line.p_product_ref.assembled and @bl
|
||||||
|
-# %br
|
||||||
|
-# Contient les références primaires suivantes :
|
||||||
|
-# -price_line.p_product_ref.p_product_assembleds.all.each do |ppa|
|
||||||
|
-# %br
|
||||||
|
|
||||||
|
-# %strong
|
||||||
|
-# =ppa.qte
|
||||||
|
-# X
|
||||||
|
-# =ppa.p_product_ref.p_product.code
|
||||||
|
|
||||||
|
-# %td
|
||||||
|
-# =price_line.title
|
||||||
|
-# %td.numeraire
|
||||||
|
-# =price_line.qte
|
||||||
|
-# -if true or @price_document.label != "Avoir"
|
||||||
|
-# %td.numeraire
|
||||||
|
-# =price_line.weight_qte.to_f.round(3)
|
||||||
|
|
||||||
|
-# -if !@bl
|
||||||
|
-# -if @price_document.label != "Avoir"
|
||||||
|
-# %td.numeraire
|
||||||
|
-# =number_to_currency price_line.ca_price_u_kg_ht
|
||||||
|
-# %td.numeraire
|
||||||
|
-# =price_line.tva_account_value.to_s+"%"
|
||||||
|
|
||||||
|
-# -if @price_document.label != "Avoir"
|
||||||
|
-# -if !price_line_block.remise_ecole_ok
|
||||||
|
-# %td.numeraire
|
||||||
|
-# =price_line.discount_market_percent.to_s+"%"
|
||||||
|
-# %br
|
||||||
|
-# =number_to_currency price_line.ca_discount_market_ht
|
||||||
|
|
||||||
-if price_line_block.ca_remise_qte_ok
|
-# -if price_line_block.ca_remise_qte_ok
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=price_line.discount_qte_percent.to_s+"%"
|
-# =price_line.discount_qte_percent.to_s+"%"
|
||||||
%br
|
-# %br
|
||||||
=number_to_currency price_line.ca_discount_qte_ht
|
-# =number_to_currency price_line.ca_discount_qte_ht
|
||||||
-if price_line_block.remise_pre_order_ok
|
-# -if price_line_block.remise_pre_order_ok
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
|
|
||||||
=price_line.discount_delay_percent.to_s+"%"
|
-# =price_line.discount_delay_percent.to_s+"%"
|
||||||
%br
|
-# %br
|
||||||
=number_to_currency price_line.ca_discount_delay_ht
|
-# =number_to_currency price_line.ca_discount_delay_ht
|
||||||
|
|
||||||
-if price_line_block.discount_comptant
|
-# -if price_line_block.discount_comptant
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=price_line.discount_comptant_percent.to_s+"%"
|
-# =price_line.discount_comptant_percent.to_s+"%"
|
||||||
%br
|
-# %br
|
||||||
=number_to_currency price_line.ca_discount_comptant_ht
|
-# =number_to_currency price_line.ca_discount_comptant_ht
|
||||||
|
|
||||||
-if price_line_block.remise_enrobage_ok
|
-# -if price_line_block.remise_enrobage_ok
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=price_line.discount_enrobage_percent.to_s+"%"
|
-# =price_line.discount_enrobage_percent.to_s+"%"
|
||||||
%br
|
-# %br
|
||||||
=number_to_currency price_line.ca_discount_enrobage_ht
|
-# =number_to_currency price_line.ca_discount_enrobage_ht
|
||||||
-else
|
-# -else
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=price_line.discount_ecole_percent.to_s+"%"
|
-# =price_line.discount_ecole_percent.to_s+"%"
|
||||||
%br
|
-# %br
|
||||||
=number_to_currency price_line.ca_discount_ecole_ht
|
-# =number_to_currency price_line.ca_discount_ecole_ht
|
||||||
|
|
||||||
-if @price_document.label != "Avoir"
|
-# -if @price_document.label != "Avoir"
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
|
|
||||||
=number_to_currency price_line.ca_price_u_kg_net_ht
|
-# =number_to_currency price_line.ca_price_u_kg_net_ht
|
||||||
-else
|
-# -else
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=number_to_currency price_line.ca_price_u_ht
|
-# =number_to_currency price_line.ca_price_u_ht
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=number_to_currency price_line.tot_amount_ht
|
-# =number_to_currency price_line.tot_amount_ht
|
||||||
|
|
||||||
|
|
||||||
-if !@bl
|
-# -if !@bl
|
||||||
%table.table{:style => "width:auto;float:right;border-top:0;"}
|
-# %table.table{:style => "width:auto;float:right;border-top:0;"}
|
||||||
|
|
||||||
-if @price_document.label != "Avoir"
|
-# -if @price_document.label != "Avoir"
|
||||||
%tr
|
-# %tr
|
||||||
%th{:style => "border-top:0;"}
|
-# %th{:style => "border-top:0;"}
|
||||||
Poids total :
|
-# Poids total :
|
||||||
|
-#
|
||||||
%td.numeraire{:style => "border-top:0;"}
|
-# %td.numeraire{:style => "border-top:0;"}
|
||||||
="#{price_line_block.weight_tot}Kg"
|
-# ="#{price_line_block.weight_tot}Kg"
|
||||||
%tr
|
-# %tr
|
||||||
%th Total remises U. HT :
|
-# %th Total remises U. HT :
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=number_to_currency price_line_block.cumul_discount_ht
|
-# =number_to_currency price_line_block.cumul_discount_ht
|
||||||
|
|
||||||
%tr
|
-# %tr
|
||||||
%th
|
-# %th
|
||||||
Total HT
|
-# Total HT
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=number_to_currency price_line_block.tot_lines_ht
|
-# =number_to_currency price_line_block.tot_lines_ht
|
||||||
|
|
||||||
-if @price_document.label != "Avoir"
|
-# -if @price_document.label != "Avoir"
|
||||||
-if price_line_block.tot_discount_ht != 0.0
|
-# -if price_line_block.tot_discount_ht != 0.0
|
||||||
%tr
|
-# %tr
|
||||||
%th
|
-# %th
|
||||||
Remise commerciale exceptionnelle (HT
|
-# Remise commerciale exceptionnelle (HT
|
||||||
="(#{price_line_block.ct_tot_discount_percent}%)"
|
-# ="(#{price_line_block.ct_tot_discount_percent}%)"
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=number_to_currency price_line_block.tot_discount_ht
|
-# =number_to_currency price_line_block.tot_discount_ht
|
||||||
|
|
||||||
%tr
|
-# %tr
|
||||||
%th
|
-# %th
|
||||||
Frais de port HT
|
-# Frais de port HT
|
||||||
="(TVA #{price_line_block.fdp_tva_rate}%)"
|
-# ="(TVA #{price_line_block.fdp_tva_rate}%)"
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=number_to_currency price_line_block.tot_fdp_ht
|
-# =number_to_currency price_line_block.tot_fdp_ht
|
||||||
|
|
||||||
%tr
|
-# %tr
|
||||||
%th
|
-# %th
|
||||||
Total HT Net
|
-# Total HT Net
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=number_to_currency price_line_block.tot_amount_ht
|
-# =number_to_currency price_line_block.tot_amount_ht
|
||||||
|
|
||||||
%tr
|
-# %tr
|
||||||
%th
|
-# %th
|
||||||
Total TVA
|
-# Total TVA
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=number_to_currency price_line_block.tot_amount_tva
|
-# =number_to_currency price_line_block.tot_amount_tva
|
||||||
|
|
||||||
%tr
|
-# %tr
|
||||||
%th
|
-# %th
|
||||||
Total TTC
|
-# Total TTC
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=number_to_currency price_line_block.tot_amount_ttc
|
-# =number_to_currency price_line_block.tot_amount_ttc
|
||||||
|
|
||||||
%tr
|
-# %tr
|
||||||
%th
|
-# %th
|
||||||
|
-#
|
||||||
%th
|
-# %th
|
||||||
|
|
||||||
%tr
|
-# %tr
|
||||||
%th
|
-# %th
|
||||||
Net à payer
|
-# Net à payer
|
||||||
%td.numeraire
|
-# %td.numeraire
|
||||||
=number_to_currency price_line_block.tot_amount_ttc
|
-# =number_to_currency price_line_block.tot_amount_ttc
|
||||||
-else
|
-# -else
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%table.table{:style => "width:auto;float:right;border-top:0;"}
|
-# %table.table{:style => "width:auto;float:right;border-top:0;"}
|
||||||
|
|
||||||
%tr
|
-# %tr
|
||||||
%th{:style => "border-top:0;"}
|
-# %th{:style => "border-top:0;"}
|
||||||
Poids total :
|
-# Poids total :
|
||||||
|
-#
|
||||||
%td.numeraire{:style => "border-top:0;"}
|
-# %td.numeraire{:style => "border-top:0;"}
|
||||||
="#{price_line_block.weight_tot}Kg"
|
-# ="#{price_line_block.weight_tot}Kg"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-if !@bl
|
-# -if !@bl
|
||||||
%br
|
-# %br
|
||||||
%br
|
-# %br
|
||||||
%table.table{:style => "width:auto;"}
|
-# %table.table{:style => "width:auto;"}
|
||||||
%tr
|
-# %tr
|
||||||
%th
|
-# %th
|
||||||
Taux
|
-# Taux
|
||||||
%br
|
-# %br
|
||||||
TVA
|
-# TVA
|
||||||
%th Montant HT Net
|
-# %th Montant HT Net
|
||||||
%th Montant TVA
|
-# %th Montant TVA
|
||||||
-tva_rates = {}
|
-# -tva_rates = {}
|
||||||
|
|
||||||
-price_line_block.price_lines.each do |pl|
|
-# -price_line_block.price_lines.each do |pl|
|
||||||
|
|
||||||
-tva_rates[pl.tva_account_value.to_s] = tva_rates[pl.tva_account_value.to_s] || {:montant => 0.0, :tva => 0.0}
|
-# -tva_rates[pl.tva_account_value.to_s] = tva_rates[pl.tva_account_value.to_s] || {:montant => 0.0, :tva => 0.0}
|
||||||
|
|
||||||
-tva_rates[pl.tva_account_value.to_s][:montant] += pl.tot_amount_ht.to_f - (pl.tot_amount_ht.to_f * ((price_line_block.ct_tot_discount_percent and price_line_block.ct_tot_discount_percent != 0.0) ? (price_line_block.ct_tot_discount_percent.to_f/100) : 0.0))
|
-# -tva_rates[pl.tva_account_value.to_s][:montant] += pl.tot_amount_ht.to_f - (pl.tot_amount_ht.to_f * ((price_line_block.ct_tot_discount_percent and price_line_block.ct_tot_discount_percent != 0.0) ? (price_line_block.ct_tot_discount_percent.to_f/100) : 0.0))
|
||||||
|
|
||||||
-tva_rates[pl.tva_account_value.to_s][:tva] += pl.tot_amount_tva.to_f - (pl.tot_amount_tva.to_f * ((price_line_block.ct_tot_discount_percent and price_line_block.ct_tot_discount_percent != 0.0) ? (price_line_block.ct_tot_discount_percent.to_f/100) : 0.0.to_f))
|
-# -tva_rates[pl.tva_account_value.to_s][:tva] += pl.tot_amount_tva.to_f - (pl.tot_amount_tva.to_f * ((price_line_block.ct_tot_discount_percent and price_line_block.ct_tot_discount_percent != 0.0) ? (price_line_block.ct_tot_discount_percent.to_f/100) : 0.0.to_f))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-tva_rates[price_line_block.fdp_tva_rate.to_s] = tva_rates[price_line_block.fdp_tva_rate.to_s] || {:montant => 0.0, :tva => 0.0}
|
-# -tva_rates[price_line_block.fdp_tva_rate.to_s] = tva_rates[price_line_block.fdp_tva_rate.to_s] || {:montant => 0.0, :tva => 0.0}
|
||||||
|
|
||||||
-tva_rates[price_line_block.fdp_tva_rate.to_s][:montant] += price_line_block.tot_fdp_ht
|
-# -tva_rates[price_line_block.fdp_tva_rate.to_s][:montant] += price_line_block.tot_fdp_ht
|
||||||
|
|
||||||
-tva_rates[price_line_block.fdp_tva_rate.to_s][:tva] += price_line_block.tot_fdp_tva
|
-# -tva_rates[price_line_block.fdp_tva_rate.to_s][:tva] += price_line_block.tot_fdp_tva
|
||||||
|
|
||||||
-tva_rates.each do |key, value|
|
-# -tva_rates.each do |key, value|
|
||||||
%tr
|
-# %tr
|
||||||
%td
|
-# %td
|
||||||
="#{key}%"
|
-# ="#{key}%"
|
||||||
%td
|
-# %td
|
||||||
=number_to_currency value[:montant]
|
-# =number_to_currency value[:montant]
|
||||||
|
|
||||||
%td
|
-# %td
|
||||||
=number_to_currency value[:tva]
|
-# =number_to_currency value[:tva]
|
||||||
-if @bl
|
-# -if @bl
|
||||||
%div{:style => "width:60%;"}
|
-# %div{:style => "width:60%;"}
|
||||||
=simple_format price_line_block.bl_comment
|
-# =simple_format price_line_block.bl_comment
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-if !@bl and @price_document.label != "Avoir"
|
-# -if !@bl and @price_document.label != "Avoir"
|
||||||
%br
|
-# %br
|
||||||
%br
|
-# %br
|
||||||
|
|
||||||
%table.table{:style => "width:auto;"}
|
-# %table.table{:style => "width:auto;"}
|
||||||
%tr
|
-# %tr
|
||||||
%th
|
-# %th
|
||||||
Échéance
|
-# Échéance
|
||||||
%th Mode de paiement
|
-# %th Mode de paiement
|
||||||
%th
|
-# %th
|
||||||
Montant net
|
-# Montant net
|
||||||
%tr
|
-# %tr
|
||||||
%td
|
-# %td
|
||||||
-if @price_document.label == "Facture"
|
-# -if @price_document.label == "Facture"
|
||||||
=l @price_document.payment_end_at
|
-# =l @price_document.payment_end_at
|
||||||
|
|
||||||
-else
|
-# -else
|
||||||
=price_line_block.payment_delais.to_i
|
-# =price_line_block.payment_delais.to_i
|
||||||
jours
|
-# jours
|
||||||
%td
|
-# %td
|
||||||
=price_line_block.p_payment_type.name if price_line_block.p_payment_type
|
-# =price_line_block.p_payment_type.name if price_line_block.p_payment_type
|
||||||
%td
|
-# %td
|
||||||
=number_to_currency price_line_block.tot_amount_ttc
|
-# =number_to_currency price_line_block.tot_amount_ttc
|
||||||
.clear
|
-# .clear
|
||||||
-if @price_document.label == "Facture"
|
-# -if @price_document.label == "Facture"
|
||||||
%p.legals{:style => "text-align:center;font-size:10px;margin-top:10px;olwen_demo_app"}
|
-# %p.legals{:style => "text-align:center;font-size:10px;margin-top:10px;olwen_demo_app"}
|
||||||
Pas d'escompte pour paiement anticipé, passée la date d'échéance, tout paiement différé entraine l'application d'une pénalité de 3 fois le taux d'intérêt légal.
|
-# Pas d'escompte pour paiement anticipé, passée la date d'échéance, tout paiement différé entraine l'application d'une pénalité de 3 fois le taux d'intérêt légal.
|
||||||
(loi 2008-776 du 04/08/2008) ainsi qu'une indemnité forfaitaire pour frais de recouvrement de 40 euros (Décret 2012-1115 du 02/10/2012).
|
-# (loi 2008-776 du 04/08/2008) ainsi qu'une indemnité forfaitaire pour frais de recouvrement de 40 euros (Décret 2012-1115 du 02/10/2012).
|
||||||
|
|
||||||
.clear
|
-# .clear
|
@ -67,8 +67,10 @@
|
|||||||
.qi_row
|
.qi_row
|
||||||
.qi_pannel.qi_plain.padding.row
|
.qi_pannel.qi_plain.padding.row
|
||||||
-if !@avoir
|
-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"}
|
.col-3
|
||||||
= f.input :ct_tot_fdp_ht, :label => "Frais de port personnalisés :"
|
= f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :"#, :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
|
||||||
|
.col-3
|
||||||
|
= f.input :ct_tot_fdp_ht, :label => "Frais de port personnalisés :"
|
||||||
|
|
||||||
|
|
||||||
-if current_admin.has_permission?("payments")
|
-if current_admin.has_permission?("payments")
|
||||||
@ -94,5 +96,5 @@
|
|||||||
:javascript
|
:javascript
|
||||||
$('.p_product_ref_select').select2();
|
$('.p_product_ref_select').select2();
|
||||||
$('.add_lines').click(function() {
|
$('.add_lines').click(function() {
|
||||||
$('.p_product_ref_select').last().select2(});
|
$('.p_product_ref_select').last().select2();
|
||||||
});
|
});
|
5
db/migrate/20211112130721_add_tva_type_to_p_article.rb
Normal file
5
db/migrate/20211112130721_add_tva_type_to_p_article.rb
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class AddTvaTypeToPArticle < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
add_reference :p_articles, :tva_type, index: true
|
||||||
|
end
|
||||||
|
end
|
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2021_11_03_085623) do
|
ActiveRecord::Schema.define(version: 2021_11_12_130721) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
@ -999,8 +999,10 @@ ActiveRecord::Schema.define(version: 2021_11_03_085623) do
|
|||||||
t.datetime "created_at", precision: 6, null: false
|
t.datetime "created_at", precision: 6, null: false
|
||||||
t.datetime "updated_at", precision: 6, null: false
|
t.datetime "updated_at", precision: 6, null: false
|
||||||
t.bigint "p_grade_id"
|
t.bigint "p_grade_id"
|
||||||
|
t.bigint "tva_type_id"
|
||||||
t.index ["p_grade_id"], name: "index_p_articles_on_p_grade_id"
|
t.index ["p_grade_id"], name: "index_p_articles_on_p_grade_id"
|
||||||
t.index ["p_product_ref_id"], name: "index_p_articles_on_p_product_ref_id"
|
t.index ["p_product_ref_id"], name: "index_p_articles_on_p_product_ref_id"
|
||||||
|
t.index ["tva_type_id"], name: "index_p_articles_on_tva_type_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "p_bank_accounts", force: :cascade do |t|
|
create_table "p_bank_accounts", force: :cascade do |t|
|
||||||
|
Reference in New Issue
Block a user