This commit is contained in:
Nicolas Bally 2017-10-15 22:09:41 +02:00
parent 3b4ca4d0b0
commit 136920cdf3
15 changed files with 81 additions and 26 deletions

View File

@ -238,6 +238,13 @@ $("document").ready ->
resize = ->
$(".with_ratio").each ->
ratio = parseFloat($(this).data("ratio"))
height = $(this).width()*ratio
$(this).css("height",height+"px")
$(".customer_message_list .height_frame").css
"height" : $(".customer_message_show").height()+"px"
min_height = 0

View File

@ -136,7 +136,7 @@ class Public::ProductOrdersController < ApplicationController
@product_order = ProductOrder.find(session[:product_order_id])
@product_order.archive_now
if !@product_order.product_order_payment_type_ok_id?
@product_order.product_order_payment_type_ok_id = 10
@product_order.product_order_payment_type_ok_id = 2
end
@product_order.force_payment = true
@ -174,15 +174,18 @@ class Public::ProductOrdersController < ApplicationController
if @product_order.product_order_payment_type_ok_id == 3
redirect_to paid_by_ogone_public_product_orders_path()
else
if @product_order.product_order_payment_type_ok_id == 10
if [10, 1, 2, 4].include?(@product_order.product_order_payment_type_ok_id)
@product_order_payment = ProductOrderPayment.create(:product_order_payment_type_id => @product_order.product_order_payment_type_ok_id)
@product_order.product_order_payments << @product_order_payment
@product_order.product_order_payment_ok = @product_order_payment
end
@product_order.completed_finish = true
@product_order.save

View File

@ -124,7 +124,7 @@ class Product < ActiveRecord::Base
def tva
0.0
0.20
end
def price_ttc

View File

@ -198,7 +198,7 @@ class ProductOrder < ActiveRecord::Base
def generate_bl_number
if !self.bl_number and self.product_order_payment_type_ok_id == 10
if !self.bl_number and ([1,2,4,10].include?(self.product_order_payment_type_ok_id))
self.bl_year = self.updated_at.year

View File

@ -1,6 +1,7 @@
%table.table#product_orders
%tr
%th ID
%th Date
%th
Nom
%th Pays d'exp.

View File

@ -1,6 +1,8 @@
%tr#product_order_row.product_order_row{:id => product_order.id, :class => ("success" if product_order)}
%td
=product_order.id
%td
=l product_order.created_at
%td
-if product_order.particular_bill
=product_order.particular_bill.name

View File

@ -9,7 +9,7 @@
=f.inputs do
=f.input :name, :label => "Nom du réseau : "
=f.input :description, :label => "A propos : ", :input_html => {:class => "redactor_textarea"}
-if !@reseaux.parent
=f.input :chef_reseau, :label => "Chef réseau : ", :collection => Customer.where(:chef_reseau => true).pluck(Arel.sql("CONCAT(`firstname`, ' ', `name`)"), :id)
@ -18,3 +18,16 @@
.actions= f.submit "Sauvegarder", :class => "btn btn-primary"
:javascript
$(".redactor_textarea").redactor({
});
:css
.redactor-editor{
padding: 24px 32px;
border: 1px solid rgba(0, 0, 0, 0.07);
}

View File

@ -43,7 +43,7 @@
-if @reseaux_layout
=link_to image_tag("/logo-mb.png", :id => "logo-mb"), "/"
-if @reseaux_layout
.reseaux_top{:style => "background-image:url('"+(@reseaux.background_image_file.file.large.url if @reseaux.background_image_file).to_s+"');"}
.reseaux_top.with_ratio{:data => {:ratio => "0.2"},:style => "background-image:url('"+(@reseaux.background_image_file.file.large.url if @reseaux.background_image_file).to_s+"');"}
=link_to "" do
=image_tag @reseaux.logo_image_file.file.large.url, :class => "logo_reseaux" if @reseaux.logo_image_file

View File

@ -64,18 +64,20 @@
.columns{
width:50%;
float:left;
box-sizing:border-box;
padding:0 10px;
.inner{
background:rgba(255,255,255,0.8);
max-width:480px;
margin:auto;
padding:20px;
}
}
html {
margin: 0px;
height: 100%;
min-height: 100%;
width: 100%;
}
@ -98,3 +100,14 @@
}
@media screen and (max-width: 800px) {
.columns{
margin-bottom:50px;
width:auto;
padding:0 40px;
float:none;
}
}

View File

@ -30,8 +30,14 @@
=number_to_currency @product_order.vourcher_reduction
.clear
%div.boutique-right{:style => "width:auto;"}
= "Total : "
= "Total HT : "
%strong=number_to_currency((@product_order.total_articles-@product_order.vourcher_reduction) , locale: :fr)
.clear
%div.boutique-right{:style => "width:auto;"}
= "Total TTC : "
%strong=number_to_currency((@product_order.total_ttc) , locale: :fr)
.clear
%br
%br

View File

@ -1,4 +1,4 @@
#my_cart
.padding.center#my_cart
%h1 Coordonnées
= semantic_form_for [:public,@product_order], :url => particulars_save_public_product_orders_path(), :html => { :method => :post, :onchange =>"cb_infos();"}do |f|

View File

@ -1,4 +1,5 @@
.center
.padding.center
%h1="Merci pour votre commande !"
%p

View File

@ -1,4 +1,4 @@
#my_cart
.padding.center#my_cart
.order_recap
%h1= "Validation de votre commande"
%br
@ -55,14 +55,14 @@
=f.input :product_order_payment_type_ok_id, :label => false, :collection => [["Pré-commande",10]], :as => :radio, :include_blank => false
=f.input :product_order_payment_type_ok_id, :label => false, :collection => [["Chèque",1], ["Virement",2],["Mandat administratif",4]], :as => :radio, :include_blank => false #["Pré-commande",10]
.cb_infos
= "Vous serez redirigé vers la page de paiement sécurisé."
%br
=f.input :cgv, :label => "J'accepte les conditions générales de vente."
=f.input :cgv, :label => raw("J'accepte <a href='/mentions-legales.html' target='_blank'>les conditions générales de vente</a>.")
.actions
%center
=f.submit "Valider ma commande", :class => "btn btn-primary order_button"

View File

@ -1,5 +1,7 @@
.center.row
.intro=raw @reseaux.description
%h1 Produits exclusifs réservés à ce réseau
.boutique_body.products

View File

@ -20,9 +20,16 @@
.price
-if !@product.price_reduced_ht?
= number_to_currency(@product.price_ttc, locale: :fr)
= number_to_currency(@product.price_ht, locale: :fr)
-else
= number_to_currency(@product.price_reduced_ttc, locale: :fr)
= number_to_currency(@product.price_reduced_ht, locale: :fr)
HT
%div
%span{:style => "font-weight:normal;"}
= number_to_currency(@product.price_ttc, locale: :fr)
TTC
-if @product.price_reduced_ht?
.price_reduced