This commit is contained in:
Nicolas Bally 2017-10-19 01:24:23 +02:00
parent ad61aee2dc
commit 1aa0f90198
6 changed files with 34 additions and 21 deletions

View File

@ -132,7 +132,7 @@ class ProductOrder < ActiveRecord::Base
def archived_total_articles_tva
total = 0.0
product_order_products.each do |p|
total += p.archived_final_price_ttc_with_qty * (p.tva_archived/100.0)
total += p.archived_final_price_ht_with_qty * (p.tva_archived/100.0)
end
total
end
@ -143,7 +143,7 @@ class ProductOrder < ActiveRecord::Base
def archived_total_articles
archived_total = 0.0
product_order_products.each do |p|
archived_total += p.archived_final_price_ttc_with_qty
archived_total += p.archived_final_price_ht_with_qty
end
archived_total
end
@ -304,7 +304,7 @@ class ProductOrder < ActiveRecord::Base
def total_articles
total = 0.0
product_order_products.each do |p|
total += p.final_price_ttc_with_qty
total += p.final_price_ht_with_qty
end
total
end
@ -317,7 +317,7 @@ class ProductOrder < ActiveRecord::Base
def total_articles_tva
total = 0.0
product_order_products.each do |p|
total += p.final_price_ttc_with_qty * (p.tva/100.0)
total += p.final_price_ht_with_qty * (p.tva/100.0)
end
total
end

View File

@ -27,6 +27,10 @@ class ProductOrderProduct < ActiveRecord::Base
qty.to_f * product.final_price_ttc.to_f
end
def final_price_ht_with_qty
qty.to_f * product.final_price_ht.to_f
end
def archived_price_ttc_with_qty
@ -46,6 +50,14 @@ class ProductOrderProduct < ActiveRecord::Base
end
end
def archived_final_price_ht_with_qty
if archived_product
qty.to_f * archived_product.final_price_ht.to_f
else
0
end
end
def verify_qty

View File

@ -178,11 +178,11 @@
=# product_order_product.archived_product_option.lang(I18n.locale).name if product_order_product.archived_product_option
%td{:style => "text-align:right;"}
= number_to_currency(product_order_product.archived_product.final_price_ttc.to_f, locale: :fr) if product_order_product.archived_product
= number_to_currency(product_order_product.archived_product.final_price_ht.to_f, locale: :fr) if product_order_product.archived_product
%td{:style => "text-align:right;"}
=product_order_product.qty
%td{:style => "text-align:right;"}
= number_to_currency(product_order_product.archived_final_price_ttc_with_qty, locale: :fr) if product_order_product.archived_product
= number_to_currency(product_order_product.archived_final_price_ht_with_qty, locale: :fr) if product_order_product.archived_product

View File

@ -20,7 +20,7 @@
=#render :partial => "public/shared/ga"
<link href='https://fonts.googleapis.com/css?family=Lobster|Open+Sans' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Lobster|Open+Sans:400,800" rel="stylesheet">
=javascript_include_tag "https://maps.googleapis.com/maps/api/js?libraries=places&amp;sensor=false"
@ -44,22 +44,22 @@
%br
.inner
%p
Ou trouver mon Pack ?
%p{:style => "text-align:center;font-weight:800 !important;font-size:1.3em;"}
%strong Ou trouver mon Pack ?
%p
=image_tag( "/declic.png", :style => "display:block;margin:20px auto;max-width:100%;")
.columns
%h2
Entreprises Commerçants
Profession Libérales Collectivités
Professions Libérales Collectivités
Associations
.inner
%center
=link_to "Commander maintenant", "http://negos.pro/public/customers_auths/new?p=KJ6XC9", :target => "_blank", :style => "display:inline-block;margin:20px;padding:12px 20px;border:1px solid #f59c00;color:white;background:#f59c00;font-weight:bold;text-decoration:none;"
=link_to "Commander maintenant", "http://negos.pro/public/customers_auths/new?p=KJ6XC9", :target => "_blank", :style => "display:inline-block;margin:20px;padding:12px 20px;border:1px solid #f59c00;color:white;background:#f59c00;font-weight:bold;text-decoration:none;text-transform:uppercase;"
=link_to image_tag( "/logo2.png", :style => "display:block;margin:20px auto;width:160px;"), "http://negos.pro", :target => "_blank"

View File

@ -15,7 +15,7 @@
%td.boutique-right
= number_to_currency(product_order_product.product.final_price_ttc.to_f, locale: :fr)
= number_to_currency(product_order_product.product.final_price_ht.to_f, locale: :fr)
%td{:style => "width:150px;text-align:center;"}
-if !@recap
.qty_form
@ -29,4 +29,4 @@
-else
=product_order_product.qty
%td.boutique-right
= number_to_currency(product_order_product.final_price_ttc_with_qty, locale: :fr)
= number_to_currency(product_order_product.final_price_ht_with_qty, locale: :fr)

View File

@ -6,15 +6,16 @@
.description
%h3.product-title
=product.lang(I18n.locale).title
%div.product-price
-if !product.price_reduced_ht
= number_to_currency(product.price_ttc, locale: :fr)
-else
= number_to_currency(product.price_reduced_ttc, locale: :fr)
%del.strip
-if false
%div.product-price
-if !product.price_reduced_ht
= number_to_currency(product.price_ttc, locale: :fr)
-if product.in_stock > 0
.stock
-else
= number_to_currency(product.price_reduced_ttc, locale: :fr)
%del.strip
= number_to_currency(product.price_ttc, locale: :fr)
-if product.in_stock > 0
.stock