This commit is contained in:
Nicolas Bally 2019-03-04 02:34:11 +01:00
parent 75f44b9077
commit 5f5d2b403f
27 changed files with 435 additions and 622 deletions

View File

@ -1061,4 +1061,15 @@ h1{
background-image: none;
}
.table-warning{
background:#fcf8e3 !important;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}

View File

@ -413,4 +413,12 @@ img{
&:hover{
box-shadow:0 0 10px rgba(0,0,0,0.3);
}
}
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}

View File

@ -29,7 +29,7 @@ class Admin::PCustomersController < ApplicationController
def index
@p_customers = PCustomer.order(:name).all
@p_customers = PCustomer.order("created_at DESC").all
@fav_p_customers = PCustomer.where(:fav => true).order(:name).all
@ -114,5 +114,9 @@ class Admin::PCustomersController < ApplicationController
end
def etat
@p_customer = PCustomer.find(params[:id])
end
end

View File

@ -94,7 +94,7 @@ class ApplicationController < ActionController::Base
else
if current_p_customer.particulars.first
redirect_to edit_public_particular_path(current_p_customer.particulars.first)
#redirect_to edit_public_particular_path(current_p_customer.particulars.first)
end
end
end

View File

@ -8,7 +8,9 @@ class Public::PCustomerAuthsController < ApplicationController
@p_customer = PCustomer.new(:valid_public => true)
particular = Particular.new(:pro => true, :skip_validation => true)
particular.p_contacts << PContact.new
@p_customer.particulars << particular

View File

@ -17,7 +17,7 @@ class Public::PCustomersController < ApplicationController
def create
@p_customer = PCustomer.new(params.require(:p_customer).permit!)
@p_customer.particulars << Particular.new(:pro => true, :skip_validation => true)
#@p_customer.particulars << Particular.new(:pro => true, :skip_validation => true)
@p_customer.account_validated = false
if @p_customer.save
@ -27,7 +27,7 @@ class Public::PCustomersController < ApplicationController
cookies[:p_customer_auth_token] = @p_customer.token
redirect_to public_my_account_path
redirect_to public_p_products_path
else
render template: "public/p_customer_auths/new"

View File

@ -81,6 +81,7 @@ class Public::POrdersController < ApplicationController
if @p_customer_sheet.update_attributes(params.require(:p_customer_sheet).permit!) and @p_customer_sheet.particular_bill.save and @p_customer_sheet.particular_send.save
@p_customer_sheet.generate_bc
@p_customer_sheet.generate_fa if @p_customer_sheet.acompte_percent?
cookies[:current_p_customer_sheet_id] = nil

View File

@ -31,7 +31,7 @@ class Public::PSheetLinesController < ApplicationController
end
redirect_to :back
redirect_to cart_public_p_orders_path()
@ -39,7 +39,7 @@ class Public::PSheetLinesController < ApplicationController
else
if @p_sheet_line.save
redirect_to :back
redirect_to cart_public_p_orders_path()
else
render :inline => @p_sheet_line.errors.messages
end

View File

@ -51,9 +51,9 @@ class PCustomerSheet < ActiveRecord::Base
end
def paid
true
end
#def paid
# true
#end
after_initialize do
if self.p_customer and !self.id
@ -215,8 +215,8 @@ class PCustomerSheet < ActiveRecord::Base
'<span class="badge badge-success">Commande</span>'
elsif self.state == "livraison-en-cours"
'<span class="badge badge-success">Livr. en cours</span>'
elsif self.state == "livrée"
'<span class="badge badge-info">livrée</span>'
elsif self.state == "livraison"
'<span class="badge badge-info">livraison</span>'
elsif self.state =="facturée"
'<span class="badge badge-primary">Facturée</span>'
elsif self.state == "annulée"
@ -276,7 +276,7 @@ class PCustomerSheet < ActiveRecord::Base
def generate_bl(sheet_id=nil)
if self.p_documents.create(:sheet_id => sheet_id, :p_document_type => PDocumentType.find_by_label("Bon de livraison"))
#self.state = "livrée"
self.state = "livraison"
self.save
end

View File

@ -5,7 +5,7 @@
# -*- encoding : utf-8 -*-
class Page < ActiveRecord::Base
searchkick # default_fields: [:html1, :title1, :description1]
#searchkick # default_fields: [:html1, :title1, :description1]
#include Elasticsearch::Model
#include Elasticsearch::Model::Callbacks

View File

@ -99,13 +99,15 @@
-elsif @p_customer_sheet.state == "commande" and @p_customer_sheet.p_sheet_lines.joins(:p_product).where("bl = 0 and (p_products.p_product_cat_id != 6 OR (p_products.p_product_cat_id = 6 and externe = 1))").count > 0
%p=link_to "Générer le bon de livraison", generate_bl_admin_p_customer_sheet_path(@p_customer_sheet), :class => "btn btn-primary"
=#-elsif @p_customer_sheet.state == "livrée"
%p=link_to "Générer la facture", generate_f_admin_p_customer_sheet_path(@p_customer_sheet), :class => "btn btn-primary"
-if @p_customer_sheet.acompte_percent?
%p=link_to "Générer la facture d'acompte", generate_fa_admin_p_customer_sheet_path(@p_customer_sheet), :class => "btn btn-primary"
-elsif @p_customer_sheet.state == "livraison"
%p=link_to "Générer la facture", generate_f_admin_p_customer_sheet_path(@p_customer_sheet), :class => "btn btn-primary"
.clear

View File

@ -1,4 +1,4 @@
%tr#p_customer{:id => p_customer.id}
%tr#p_customer{:id => p_customer.id, :class => ("table-warning" if !p_customer.account_validated)}
%td= p_customer.email
%td= p_customer.code
%td= p_customer.show_name

View File

@ -11,10 +11,12 @@
%tr
%td{:style => "width:20%;padding-right:4px;"}
=form.input :civilite, :label => false, :placeholder => qit("don-particular-civilite","Civilité"), :as => :select, :collection => [[qit("don-particular-civilite-mme","Mme."), "Mme"], [qit("don-particular-civilite-m","M."), "M"]], :include_blank => true
%td{:style => "width:40%;padding-right:4px;"}
=form.input :firstname, :label => false, :placeholder => qit("don-particular-firstname","Prénom")
%td{:style => "width:40%"}
=form.input :name, :label => false, :placeholder => qit("don-particular-name","Nom")
%td{:style => "width:40%;padding-right:4px;"}
=form.input :firstname, :label => false, :placeholder => qit("don-particular-firstname","Prénom")
=form.input :address_2, :label => false, :placeholder => qit("don-particular-adresse","Adresse")
=form.input :address_3, :label => false, :placeholder => qit("don-particular-adresse-suite","Adresse suite")

View File

@ -67,7 +67,12 @@
.alert
%span.remove=ic :times
=flash[:alert]
-if !current_p_customer.account_validated
.alert.alert-warning{:style => "margin:0;border-radius:0;"}
Votre compte client n'a pas encore été validé, vous pouvez dès à présent découvrir nos produits. Notre service commercial validera votre compte dans les plus brefs délais.
=yield

View File

@ -14,403 +14,18 @@
-@sidebar = false
-if !@new_site
-content_for :corps do
-if @menu_item.id == 7
=raw"</div>"
.follow_row_container
.main_container
.inner
-@nos_combats = MenuItem.find(7)
-@nos_combats.children.order(:position).each do |mi|
.qi_row
.qi_pannel.qi_plain.padding{:style => "max-width:800px;margin:auto;"}
%h1{:style => "text-align:center;"}=raw @menu_item.menu_content.lang_pages.find_by_lang_site_id(@lang.id).title
=render :partial => "public/blocks/block", :locals => {:block => @menu_item.menu_content.blocks.find_by_lang_site_id(@lang.id)}
- menu_item_lang = mi.menu_item_langs.find_by_lang_site_id(@lang.id)
-if menu_item_lang.enabled == true and menu_item_lang.visible == true
-css_style = ""
-ratio = 1
-url = mi.cible_url(@lang)
-if mi.image_file
-if current_admin
.admin_panel
=link_to i(:pencil), edit_admin_menu_item_path(:id => @menu_item.menu_content.menu_item.id, :lang => @lang.slug), :class => "btn btn-primary"
-img_url = mi.image_file.file.large.medium.url
-if mi.image_file and mi.image_file.photograph
-@page_images_credits << mi.image_file.photograph
=link_to "Télécharger l'image de bandeau", @menu_item.image_file.file.large.url, :class => "btn btn-primary" if @menu_item.image_file
-css_style += "background-image:url('#{img_url}');background-size:100%;background-size:cover;background-position:center center;display:block;"
.element#element
=link_to url.to_s , :style => css_style, :data => {:ratio => ratio}, :class => "with_ratio" do
.overlay
%h4.title
=#image_tag mi.icon_image_file.file.url if mi.icon_image_file
=mi.menu_item_langs.find_by_lang_site_id(@lang.id).name
=raw "<div class='main_container'>"
-elsif [247, 34,42, 251, 248, 249, 250].include?(@menu_item.id)
=raw "</div>"
.special_show
-if @menu_item.id == 34
%div.special_show_special1{:style => "width:50%;display:inline-block"}=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(50)}
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(107)}
-elsif @menu_item.id == 247
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(35)}
.clear
.row
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(110)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(43)}
.columns.span_6
.row
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(191)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(132)}
.clear
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(36)}
-elsif @menu_item.id == 42
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(41)}
.clear
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(241)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(143)}
.clear
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(244)}
-elsif @menu_item.id == 251
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(96)}
.clear
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(224)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(256)}
.clear
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(95)}
-elsif @menu_item.id == 248
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(45)}
.clear
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(47)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(46)}
.clear
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(253)}
-elsif @menu_item.id == 249
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(39)}
.clear
.columns.span_6
.row
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(118)}
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(225)}
.clear
-elsif @menu_item.id == 250
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(48)}
.clear
.columns.span_6
=render :partial => "public/menu_items/small_thumb", :locals => {:menu_item => MenuItem.find(185)}
.clear
=raw "<div class='main_container'>"
-elsif [9].include?(@menu_item.id)
=raw "</div>"
.follow_row_container{:style => "padding:6% 0;padding-bottom:7%;"}
.main_container
-if false
.first_title
%h1{:style => "padding-top:0"}=raw @menu_item.menu_content.lang_pages.find_by_lang_site_id(@lang.id).title
.row
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(14), :skip_desc => true}
.columns.span_6
=render :partial => "public/menu_items/large_thumb", :locals => {:menu_item => MenuItem.find(17), :skip_desc => true}
.clear
:scss
.follow_row_container{
.main_container{
max-width:1200px;
}
.large_thumb{
max-width:500px;
}
}
=raw "<div class='main_container'>"
-else
-if @menu_item.title_image
-if @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file
-img_url = @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file.file.large.url
-@facebook_img = @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file.file.large.medium.url
-elsif @menu_item.image_file
-img_url = @menu_item.image_file.file.large.url
-@facebook_img = @menu_item.image_file.file.large.medium.url
-if img_url
.menu_item_top.principal{:style => "background-image:url('#{img_url}');"}
-else
%div{:style => "height:55px;"}
.menu_content_inner{:class => @menu_item_lang.slug}
.inner
.menu_item_content
-if !@menu_item.title_cached
.first_title
%h1=raw @menu_item.menu_content.lang_pages.find_by_lang_site_id(@lang.id).title
-if @new_site
%hr
.description
=raw @menu_item.menu_content.lang_pages.find_by_lang_site_id(@lang.id).description
=render :partial => "public/blocks/block", :locals => {:block => @menu_item.menu_content.blocks.find_by_lang_site_id(@lang.id)}
-if @menu_item.id != 107
.bottom_subpages
-@menu_item.children.order(:position).each do |menu_item|
-menu_item_lang = menu_item.menu_item_langs.find_by_lang_site_id(@lang.id)
-name = menu_item_lang.name
-if menu_item_lang.enabled == true and menu_item_lang.visible == true
-if menu_item.image_file
-img_url = menu_item.image_file.file.large.medium.url
-if menu_item.image_file and menu_item.image_file.photograph
-@page_images_credits << menu_item.image_file.photograph
-css_style = "background-image:url('#{img_url}');background-size:100%;background-size:cover;background-position:center center;display:block;min-height:50px;"
.subpage_link
=link_to @one_voice_host.to_s+menu_item_path(:url => menu_item_lang.url, :lang => @lang.slug) , :class => "with_ratio" do
.with_ratio{:style => css_style, :data => {:ratio => 0.62}}
.overlay
%h4.title
=menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name
-articles_ids = @menu_item.articles.all.map {|u| u.id}
-categories_ids = @menu_item.categories.map {|u| u.id}
-tags_ids = @menu_item.tags.map {|u| u.id}
- tags_articles_ids = Article.joins(:tags).where(:tags =>{:id => tags_ids }).map {|u| u.id}
- categories_articles_ids = Article.where(:category_id => categories_ids ).map {|u| u.id}
-ids = articles_ids + categories_articles_ids +tags_articles_ids
-ids =ids.sort.uniq
-articles = Article.recents.where("articles.published_at <= ?", Date.today).joins(:lang_articles).where("lang_articles.enabled = 1 and lang_articles.lang_site_id = ?", @lang.id)
-articles = articles.where(:id => ids)
-articles = articles.order("published_at DESC")
-articles = articles.limit(10)
-if articles.count > 0
.center{:style => "padding:0 10px;margin:40px 20px;border-top:1px solid rgba(5, 5, 5, 0.05);border-bottom:1px solid rgba(5, 5, 5, 0.05);"}
%h3
=qit 'Pages - Titre articles associés ', "Pour aller plus loin, sur notre"
=link_to("blog", "/fr/blog.html")+"..."
%ul
-articles.each do |article|
%li
-lang_article = article.lang_articles.find_by_lang_site_id(@lang.id)
=link_to lang_article.title, article_path(:slug => lang_article.slug, :lang => @lang.slug)
-if @menu_item.slug != "index" and @menu_item.ancestors.length >= 1 and !@original_menu_item
.breadcrumb
-if @menu_item.ancestors
=link_to i(:home), "/"
>
-for menu_item in @menu_item.ancestors.reverse
=menu_item_link(menu_item)
>
=@menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name
-if current_admin
.admin_panel
=link_to i(:pencil), edit_admin_menu_item_path(:id => @menu_item.menu_content.menu_item.id, :lang => @lang.slug), :class => "btn btn-primary"
=link_to "Télécharger l'image de bandeau", @menu_item.image_file.file.large.url, :class => "btn btn-primary" if @menu_item.image_file
=yield :corps
-else
-if @menu_item_lang.permalink == "index"
.render_block.home_render_block
=render :partial => "public/blocks/block", :locals => {:block => @menu_item.menu_content.blocks.find_by_lang_site_id(@lang.id)}
-else
-if @menu_item.title_image
-if @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file
-img_url = @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file.file.large.url
-@facebook_img = @menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).image_file.file.large.medium.url
-elsif @menu_item.image_file
-img_url = @menu_item.image_file.file.large.url
-@facebook_img = @menu_item.image_file.file.large.medium.url
-if img_url
.menu_item_top.principal.with_ratio{:style => "background-image:url('#{img_url}');", :data => {:ratio => 0.30}}
-else
%div{:style => "height:55px;"}
.menu_content_inner{:class => @menu_item_lang.slug}
.inner
.menu_item_content
-if !@menu_item.title_cached
.first_title
-if @menu_item.menu_content.page_type_id == 3
%h1=raw @menu_item.parent.menu_content.lang_pages.find_by_lang_site_id(@lang.id).title
-else
%h1=raw @menu_item.menu_content.lang_pages.find_by_lang_site_id(@lang.id).title
-if @new_site
%hr
-if @menu_item.menu_content.page_type_id == 2 or @menu_item.menu_content.page_type_id == 3
.chapitre_menu
-if @menu_item.menu_content.page_type_id == 3
-chapitre_id = @menu_item.parent.id
-else
-chapitre_id = @menu_item.id
-MenuItem.where(:parent_id => chapitre_id).order(:position).each do |menu_item|
-menu_item_lang = menu_item.menu_item_langs.find_by_lang_site_id(@lang.id)
-name = menu_item_lang.name
-if menu_item_lang.enabled == true and menu_item_lang.visible == true and menu_item.menu_content.page_type_id == 3
=link_to @one_voice_host.to_s+menu_item_path(:url => menu_item_lang.url, :lang => @lang.slug) , :class => "chapitre_link "+("active" if menu_item.id == @menu_item.id).to_s do
=menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name
%span.sep
|
.description
=raw @menu_item.menu_content.lang_pages.find_by_lang_site_id(@lang.id).description
.render_block
=render :partial => "public/blocks/block", :locals => {:block => @menu_item.menu_content.blocks.find_by_lang_site_id(@lang.id)}
.bottom_space
=render :partial => "public/menu_items/bottom"
-if current_admin
.admin_panel
=link_to i(:pencil), edit_admin_menu_item_path(:id => @menu_item.menu_content.menu_item.id, :lang => @lang.slug), :class => "btn btn-primary"
=link_to "Télécharger l'image de bandeau", @menu_item.image_file.file.large.url, :class => "btn btn-primary" if @menu_item.image_file
-if @sidebar
:coffeescript
resize_menu_content_inner = ->
$('.menu_content_inner').css
"width" : ($(".widther").outerWidth() - $(".side_menu").outerWidth())+"px"
"float" : "left"
resize_menu_content_inner()
$(window).bind "resize", ->
resize_menu_content_inner()

View File

@ -0,0 +1,20 @@
.p_contact_form.field
%table{:style => "width:100%;"}
%tr
-if false
%td{:style => "width:30px;"}
%p
%strong BL
= form.input :bc, :label => ""
%td
= form.input :name, :label => "Nom du contact :"
%td
= form.input :comment, :label => "Fonction, commentaire :", :as => :string
%td
= form.input :tel, :label => "Tel :"
%td
= form.input :email, :label => "Email :"
%td{:style => "width:30px;"}
=link_to_remove_fields ic(:"trash-o"), form

View File

@ -1,25 +1,39 @@
%tr#p_customer_sheet{:id => p_customer_sheet.id}
%td
=link_to public_p_customer_sheet_path(p_customer_sheet) do
="##{p_customer_sheet.id}"
%td
=link_to public_p_customer_sheet_path(p_customer_sheet) do
=l p_customer_sheet.created_at, :format => :date
-if p_customer_sheet.total_with_labels_table[:total][:value] != 0.0
%tr#p_customer_sheet{:id => p_customer_sheet.id}
%td
=link_to public_p_customer_sheet_path(p_customer_sheet) do
="##{p_customer_sheet.id}"
%td
=link_to public_p_customer_sheet_path(p_customer_sheet) do
=l p_customer_sheet.created_at, :format => :date
%td
=number_to_currency p_customer_sheet.total_with_labels_table[:total][:value]
%td{:style => "text-align:right;width:100px;"}
-a = p_customer_sheet.total_with_labels_table[:total][:value]
-@ht += a
=number_to_currency a
%td{:style => "text-align:right;width:100px;"}
-a = p_customer_sheet.total_with_labels_table[:total_ttc][:value]
-@ttc += a
=number_to_currency a
%td=raw p_customer_sheet.state_html
%td=raw p_customer_sheet.state_html
%td
= "Oui" if p_customer_sheet.paid
%td
-if p_customer_sheet.paid
Paiement reçu
-elsif p_customer_sheet.p_payment_type_id == 2
En attente du paiement par virement
-elsif p_customer_sheet.p_payment_type_id == 3
En attente du paiement par chèque
%td.actions
= link_to i(:pencil), edit_public_p_customer_sheet_path(p_customer_sheet), :remote => false
= link_to i(:eye), public_p_customer_sheet_path(p_customer_sheet), :remote => false
%td.actions
= link_to i(:pencil), edit_public_p_customer_sheet_path(p_customer_sheet), :remote => false
= link_to i(:eye)+raw("&nbsp; détail"), public_p_customer_sheet_path(p_customer_sheet), :remote => false

View File

@ -7,6 +7,8 @@
.qi_row
.qi_pannel.qi_plain.padding
-@ttc = 0.0
-@ht = 0.0
%table.table
%tr
%th ID
@ -15,12 +17,30 @@
%th Total HT
%th Total TTC
%th Statut
%th Payée ?
%th Paiement
%th
%tbody#p_customer_sheets_rows
=render @p_customer_sheets
=render @p_customer_sheets
%tr
%th
Total
%th
%th{:style => "text-align:right;width:100px;"}=number_to_currency @ht
%th{:style => "text-align:right;width:100px;"}=number_to_currency @ttc
%th
%th
%th

View File

@ -10,4 +10,9 @@
=f.input :email, :label => "Email :"
=f.input :password, :label => "Mot de passe :"
%hr
=f.semantic_fields_for :particulars do |form|
=render :partial => "public/particulars/inner_form", :locals => {:form => form}
=f.submit "Créer mon compte", :class => "btn btn-primary"

View File

@ -1,7 +1,7 @@
.p_product_page
.qi_header
%h1
=link_to ic(:user)+" Mon compte", public_my_account_path
=link_to "Les produits Biocoton disponibles", public_p_products_path
%span
=link_to "Mon panier", cart_public_p_orders_path
@ -18,15 +18,6 @@
=form.semantic_fields_for :p_sheet_lines do |form|
#p_sheet_line.product_stock_form.field.p_sheet_line_field{:id => form.object.id}
= form.hidden_field :p_product_id, :class => "p_product_id"
-if form.object.p_product
@ -39,22 +30,23 @@
%th
=form.object.p_product.name
=link_to_remove_fields ic(:"trash-o"), form
%br
=form.input :cust_ref, :placeholder => "Votre référence", :label => false
-p_product.p_sizes.all.each do |p_size|
-p_product.p_sizes.order("position").all.each do |p_size|
%th.size_th
=p_size.name
%th.price_td PU
%th.price_td
Prix tot.
%tr
%th{:colspan => (p_product.p_sizes.count + 3), :style => "border:0;padding:0"}
=form.input :cust_ref, :placeholder => "Votre référence", :label => false, :input_html => {:style => "width:300px;"}
-p_product.p_colors.all.each do |p_color|
%tr.color_line
%td=p_color.name
-p_product.p_sizes.all.each do |p_size|
-p_product.p_sizes.order("position").all.each do |p_size|
%td
-ps = p_product.p_product_stocks.where(:p_size_id => p_size.id, :p_color_id => p_color.id).first
@ -64,6 +56,12 @@
=form.fields_for(:p_sheet_line_lines, p_sheet_line_line) do |builder|
=builder.hidden_field :p_product_stock_id,:label => false, :as => :string
=builder.input :qte,:label => false, :as => :string, :input_html => {:class => "qte"}
.stock_line{:style => "text-align:left;font-size:0.8em;color:rgba(0,0,0,0.5)"}
%span{:style => "font-size:0.75em;"}
&nbsp;&nbsp;
Stock :
=ps.stock_th_ok
%td.price.price_td{:data => {:price => form.object.price}}
=number_to_currency form.object.price
@ -106,9 +104,9 @@
%hr
=#form.submit "sauvegarder", :class => "btn btn-primary"
=link_to "Suivant", particulars_public_p_orders_path, :class => "btn btn-primary"
.right
=link_to "Passer commande >", particulars_public_p_orders_path, :class => "btn btn-primary"
.clear
:scss
.price_emp{

View File

@ -11,7 +11,7 @@
.qi_row
.qi_pannel.qi_plain.padding
=link_to ic(:address_book)+" Gérer mes adresses", public_particulars_path
=semantic_form_for [:public, @p_customer_sheet],:url => particulars_save_public_p_orders_path(), :html => { :method => :post, :onchange =>""}, :remote => false do |form|
@ -21,13 +21,15 @@
.columns.span_6
%h3 Adresse de facturation
%p
Sélectionner votre adresse de facturation ci-dessous
=link_to "(ou modifier)", public_particulars_path
-if @p_customer_sheet.p_customer
=form.inputs do
= form.input :particular_bill_id, :collection => @p_customer_sheet.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de facturation"
= form.input :particular_bill_id, :collection => @p_customer_sheet.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => false
-else
=form.inputs do
= form.input :particular_bill_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
= form.input :particular_bill_id, :collection => [], :as => :select, :include_blank => false, :label => false
-if @p_customer_sheet.particular_bill and @p_customer_sheet.particular_bill.errors.size > 0
.alert.alert-danger
Cette adresse n'est pas valide, veuillez la renseigner ou
@ -37,13 +39,17 @@
=link_to "en créer une nouvelle.", new_public_particular_path(:order => true)
.columns.span_6
%h3 Adresse de livraison
%p
Sélectionner votre adresse de livraison ci-dessous
=link_to "(ou rajouter)", public_particulars_path
-if @p_customer_sheet.p_customer
=form.inputs do
= form.input :particular_send_id, :collection => @p_customer_sheet.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de livraison"
= form.input :particular_send_id, :collection => @p_customer_sheet.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => false
-else
=form.inputs do
= form.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
= form.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => false
-if @p_customer_sheet.particular_send and @p_customer_sheet.particular_send.errors.size > 0
.alert.alert-danger
@ -54,7 +60,12 @@
=link_to "en créer une nouvelle.", new_public_particular_path(:order => true)
.clear
=form.submit "Suivant", :class => "btn btn-primary"
.right
%p
=link_to ic(:address_book)+" Gérer mes diverses adresses", public_particulars_path
=form.submit "Récapitulatif de commande >", :class => "btn btn-primary"
.clear

View File

@ -99,7 +99,7 @@
=sheet_line.product_name
-sheet_line.p_product.p_sizes.all.each do |psize|
-sheet_line.p_product.p_sizes.order("position").all.each do |psize|
%th.p_size_td=psize.name
@ -117,7 +117,7 @@
%td
=pc.name
-sheet_line.p_product.p_sizes.all.each do |psize|
-sheet_line.p_product.p_sizes.order("position").all.each do |psize|
%td.p_size_td
-psl = p_sheet_line_lines.joins(:p_product_stock).where(:p_product_stocks => {:p_size_id => psize.id, :p_color_id => pc.id} ).first
@ -211,7 +211,7 @@
=semantic_form_for [:public, @p_customer_sheet],:url => recap_save_public_p_orders_path(), :html => { :method => :post, :onchange =>""}, :remote => false do |form|
=form.input :cgv, :label => "J'ai lu et j'accepte les conditions générales de vente"
=form.input :cgv, :label => raw("J'ai lu et j'accepte les <a href='/fr/mentions-legales.html' target='_blank'>conditions générales de vente</a>")
=form.input :p_payment_type_id, :label => "Mode de paiement :", :collection => PPaymentType.where(:enabled => true).all, :as => :radio

View File

@ -33,6 +33,11 @@
%br
%strong BIC :
CCBPFRPPGRE
%p
-if bl = @p_customer_sheet.p_documents.where(:label => "Bon de commande").first
=link_to "Télécharger le bon de commande #{bl.d_number} (nos coordonnées bancaires sont en pied de page)", admin_p_document_path(bl.token)
-elsif @p_customer_sheet.acompte
%p
Vous pouvez dès maintenant utiliser notre RIB pour procéder au réglement de l'acompte de
@ -50,9 +55,21 @@
%br
%strong BIC :
CCBPFRPPGRE
%p
-if bl = @p_customer_sheet.p_documents.where(:label => "Bon de commande").first
=link_to "Télécharger le bon de commande #{bl.d_number} (nos coordonnées bancaires sont en pied de page)", admin_p_document_path(bl.token)
%p
-if ac = @p_customer_sheet.p_documents.where(:label => "Facture acompte").first
=link_to "Télécharger la facture d'acompte #{ac.d_number}", admin_p_document_path(ac.token)
-else
%p
Vous recevrez votre facture une fois les articles expédiés.
%p
-if bl = @p_customer_sheet.p_documents.where(:label => "Bon de commande").first
=link_to "Télécharger le bon de commande #{bl.d_number} (nos coordonnées bancaires sont en pied de page)", admin_p_document_path(bl.token)
-else
-if @p_customer_sheet.comptant
@ -61,11 +78,16 @@
=number_to_currency totals[:total_ttc]
à l'ordre de JRH à l'adresse suivante :
%p
%strong JRH - Biocoton
%strong Biocoton
%br
1 avenue Georges Frier
%br
38500 VOIRON
%p
-if bl = @p_customer_sheet.p_documents.where(:label => "Bon de commande").first
=link_to "Télécharger le bon de commande #{bl.d_number} (nos coordonnées bancaires sont en pied de page)", admin_p_document_path(bl.token)
-elsif @p_customer_sheet.acompte
%p
Vous pouvez dès maintenant envoyer votre acompte d'un montant de
@ -77,15 +99,26 @@
à l'ordre de JRH à l'adresse suivante :
%p
%strong JRH - Biocoton
%strong Biocoton
%br
1 avenue Georges Frier
%br
38500 VOIRON
%p
-if bl = @p_customer_sheet.p_documents.where(:label => "Bon de commande").first
=link_to "Télécharger le bon de commande #{bl.d_number} (nos coordonnées bancaires sont en pied de page)", admin_p_document_path(bl.token)
%p
-if ac = @p_customer_sheet.p_documents.where(:label => "Facture acompte").first
=link_to "Télécharger la facture d'acompte #{ac.d_number}", admin_p_document_path(ac.token)
-else
%p
Vous recevrez votre facture une fois les articles expédiés.
%p
-if bl = @p_customer_sheet.p_documents.where(:label => "Bon de commande").first
=link_to "Télécharger le bon de commande #{bl.d_number} (nos coordonnées bancaires sont en pied de page)", admin_p_document_path(bl.token)
%br
%p

View File

@ -21,110 +21,125 @@
-if @p_product.get_prices(current_p_customer).count > 1
%p
Prix de
=number_to_currency @p_product.get_prices(current_p_customer).last.price
à
= number_to_currency @p_product.get_prices(current_p_customer).first.price
%table.table.price_table
%tr
-@p_product.get_prices(current_p_customer).each do |price|
%td
A partir de
=price.nbr.to_i
ex
%tr
-@p_product.get_prices(current_p_customer).each do |price|
%td
=number_to_currency price.price
-elsif @p_product.get_prices(current_p_customer).count == 1
%p
=number_to_currency @p_product.get_prices(current_p_customer).last.price
-if @p_product.get_prices(current_p_customer).count > 0 and @p_product.get_prices(current_p_customer).first.price > 0.0
.sub_header
%h2 Commander
.p_sheet_line_order
-@p_sheet_line = PSheetLine.new(:p_product => @p_product)
-#@p_sheet_line.generate_p_sheet_line_lines
=semantic_form_for [:public, @p_sheet_line], :remote => false do |form|
= form.hidden_field :p_product_id, :class => "p_product_id"
-if form.object.p_product
-p_product = form.object.p_product
-if false
%table.table.order_table
%tr
%th Taille
%th Couleur
%th Qte
-s = "a"
-si = 1
-if true
-p_product.p_product_stocks.order("p_size_id ASC, p_color_id ASC").each do |ps|
-si = p_product.p_product_stocks.where(:p_size_id => ps.p_size_id).count()
%tr
-if ps.p_size_id != s
-s = ps.p_size_id
%td{:rowspan => si}
=ps.p_size.name if ps.p_size
%td
=ps.p_color.name if ps.p_color
%td
-p_sheet_line_line = @p_sheet_line.p_sheet_line_lines.new(:p_product_stock_id => ps.id)
=form.fields_for(:p_sheet_line_lines, p_sheet_line_line) do |builder|
=builder.hidden_field :p_product_stock_id,:label => false, :as => :string
=builder.input :qte,:label => false, :as => :string
%table.table.order_table
.right
-if @p_product.get_prices(current_p_customer).count > 1
%p
Prix de
=number_to_currency @p_product.get_prices(current_p_customer).last.price
à
= number_to_currency @p_product.get_prices(current_p_customer).first.price
%table.table.price_table
%tr
%th
-p_product.p_sizes.all.each do |p_size|
%th.size_th
=p_size.name
-p_product.p_colors.all.each do |p_color|
%tr
%td=p_color.name
-p_product.p_sizes.all.each do |p_size|
%td
-ps = p_product.p_product_stocks.where(:p_size_id => p_size.id, :p_color_id => p_color.id).first
-if ps
-p_sheet_line_line = @p_sheet_line.p_sheet_line_lines.new(:p_product_stock_id => ps.id)
=form.fields_for(:p_sheet_line_lines, p_sheet_line_line) do |builder|
=builder.hidden_field :p_product_stock_id,:label => false, :as => :string
=builder.input :qte,:label => false, :as => :string
-@p_product.get_prices(current_p_customer).each do |price|
%td
A partir de
=price.nbr.to_i
ex
%tr
-@p_product.get_prices(current_p_customer).each do |price|
%td
=number_to_currency price.price
=form.submit "Commander", :class => "btn btn-primary"
-elsif @p_product.get_prices(current_p_customer).count == 1
%p
%strong Votre prix :
=number_to_currency @p_product.get_prices(current_p_customer).last.price
-if !current_p_customer.account_validated
%p
%strong Vous pourrez commander ce produit dès que votre compte sera validé
-else
%h2 Commander
-if current_p_customer.account_validated
.p_sheet_line_order
-@p_sheet_line = PSheetLine.new(:p_product => @p_product)
-#@p_sheet_line.generate_p_sheet_line_lines
.p_sheet_lines_form
=semantic_form_for [:public, @p_sheet_line], :remote => false, :html => { :id => "cart_form"} do |form|
#p_sheet_line.product_stock_form.field.p_sheet_line_field{:id => form.object.id}
= form.hidden_field :p_product_id, :class => "p_product_id"
-if form.object.p_product
-p_product = form.object.p_product
%table.table.order_table
%tr
%th
=#form.input :cust_ref, :placeholder => "Votre référence", :label => false
-p_product.p_sizes.order("position").all.each do |p_size|
%th.size_th
=p_size.name
%th.price_td PU
%th.price_td
Prix tot.
-p_product.p_colors.all.each do |p_color|
%tr.color_line
%td=p_color.name
-p_product.p_sizes.order("position").all.each do |p_size|
%td
-ps = p_product.p_product_stocks.where(:p_size_id => p_size.id, :p_color_id => p_color.id).first
-if ps
-p_sheet_line_line = @p_sheet_line.p_sheet_line_lines.new(:p_product_stock_id => ps.id)
-if p_sheet_line_line
=form.fields_for(:p_sheet_line_lines, p_sheet_line_line) do |builder|
=builder.hidden_field :p_product_stock_id,:label => false, :as => :string
=builder.input :qte,:label => false, :input_html => {:class => "qte"}
.stock_line{:style => "text-align:left;font-size:0.8em;color:rgba(0,0,0,0.5)"}
%span{:style => "font-size:0.75em;"}
&nbsp;&nbsp;
Stock :
=ps.stock_th_ok
%td.price.price_td{:data => {:price => form.object.price}}
=number_to_currency form.object.price
%td.price_color_tot.price_td
%table{:style => "width:100%"}
%tr
%td
&nbsp
%td.qte_tot.price_td{:style => "font-weight:bold;"}
%strong=form.object.qte
%td.price.price_td{:style => "font-weight:bold;", :data => {:price => form.object.price}}
%strong=number_to_currency form.object.price
%td.price_tot.price_td{:style => "font-weight:bold;"}
=number_to_currency form.object.price_tot
%br
%br
.right=form.submit "Ajouter à ma commande", :class => "btn btn-primary"
.clear
:scss
.size_th{
width:80px;
@ -132,3 +147,49 @@
}
:scss
.price_emp{
padding: 6px 12px;
font-size: 14px;
line-height: 1.42857;
color: #555555;
height:34px;
}
.price_td{
width:170px;
text-align:right;
}
:scss
.product_stock_form{
td{
vertical-align:top;
.form-control, .form-group{
margin-bottom:0}
}
}
:scss
.size_th{
width:80px;
}
:coffeescript
udpate_sheet_lines()
$("#cart_form").change ->
udpate_sheet_lines()
#$(this).submit()
$("#cart_form").keyup ->
udpate_sheet_lines()
#$(this).submit()

View File

@ -1,61 +1,8 @@
=semantic_form_for [:public, @particular], :remote => false do |form|
.content
=form.inputs do
=render :partial => "public/particulars/inner_form", :locals => {:form => form}
=hidden_field_tag :order, params[:order]
=form.hidden_field :particular_type
=form.hidden_field :force_validation, :class => "skip_validation"
=form.hidden_field :pro
-if false
=form.input :price_in_bl, :label => "Afficher les prix dans le BL ?"
.organisation_fields
=form.input :organisation, :label => false, :placeholder => qit("don-particular-organisation","Organisation")
%table
%tr
%td{:style => "width:20%;padding-right:4px;"}
=form.input :civilite, :label => false, :placeholder => qit("don-particular-civilite","Civilité"), :as => :select, :collection => [[qit("don-particular-civilite-mme","Mme."), "Mme"], [qit("don-particular-civilite-m","M."), "M"]], :include_blank => true
%td{:style => "width:40%;padding-right:4px;"}
=form.input :firstname, :label => false, :placeholder => qit("don-particular-firstname","Prénom")
%td{:style => "width:40%"}
=form.input :name, :label => false, :placeholder => qit("don-particular-name","Nom")
=form.input :address_2, :label => false, :placeholder => qit("don-particular-adresse","Adresse")
=form.input :address_3, :label => false, :placeholder => qit("don-particular-adresse-suite","Adresse suite")
%table
%tr
%td{:style => "width:30%;padding-right:4px;"}
=form.input :cp, :label => false, :placeholder => qit("don-particular-cp", "Code postal")
%td{:style => "width:70%"}
=form.input :city, :label => false, :placeholder => qit("don-particular-ville","Ville")
=form.input :country, :label => false, :placeholder => qit("don-particular-pays","Pays"), :priority_countries => ["FR", "CH", "BE"], :include_blank => false, :locale => @lang.slug
=#form.input :email, :label => false, :placeholder => qit("don-particular-email","Email")
=#form.input :tel, :label => false, :placeholder => qit("don-particular-phone","Téléphone")
-if false
Contacts de l'adresse :
.p_contacts_form
=form.semantic_fields_for :p_contacts do |form|
=render :partial => "public/p_contacts/form", :locals => {:form => form}
%p= link_to_add_fields "Ajouter un contact à l'adresse", form, :p_contacts
:coffeescript
@organisation_check = (element) ->
if element.is(':checked')
element.closest('form').find('.organisation_fields').show()
element.css('background', 'red')
else
element.closest('form').find('.organisation_fields').hide()
%hr
.actions=form.submit "sauvegarder", :class => "btn btn-primary"

View File

@ -0,0 +1,57 @@
=form.inputs do
=hidden_field_tag :order, params[:order]
=form.hidden_field :particular_type
=form.hidden_field :force_validation, :class => "skip_validation"
=form.hidden_field :pro
-if false
=form.input :price_in_bl, :label => "Afficher les prix dans le BL ?"
.organisation_fields
=form.input :organisation, :label => false, :placeholder => qit("don-particular-organisation","Organisation")
%table
%tr
%td{:style => "width:20%;padding-right:4px;"}
=form.input :civilite, :label => false, :placeholder => qit("don-particular-civilite","Civilité"), :as => :select, :collection => [[qit("don-particular-civilite-mme","Mme."), "Mme"], [qit("don-particular-civilite-m","M."), "M"]], :include_blank => true
%td{:style => "width:40%"}
=form.input :name, :label => false, :placeholder => qit("don-particular-name","Nom")
%td{:style => "width:40%;padding-right:4px;"}
=form.input :firstname, :label => false, :placeholder => qit("don-particular-firstname","Prénom")
=form.input :address_2, :label => false, :placeholder => qit("don-particular-adresse","Adresse")
=form.input :address_3, :label => false, :placeholder => qit("don-particular-adresse-suite","Adresse suite")
%table
%tr
%td{:style => "width:30%;padding-right:4px;"}
=form.input :cp, :label => false, :placeholder => qit("don-particular-cp", "Code postal")
%td{:style => "width:70%"}
=form.input :city, :label => false, :placeholder => qit("don-particular-ville","Ville")
=form.input :country, :label => false, :placeholder => qit("don-particular-pays","Pays"), :priority_countries => ["FR", "CH", "BE"], :include_blank => false, :locale => @lang.slug
=#form.input :email, :label => false, :placeholder => qit("don-particular-email","Email")
=#form.input :tel, :label => false, :placeholder => qit("don-particular-phone","Téléphone")
-if false
Contacts :
.p_contacts_form
=form.semantic_fields_for :p_contacts do |form|
=render :partial => "public/p_contacts/form", :locals => {:form => form}
%p= link_to_add_fields "Ajouter un contact à l'adresse", form, :p_contacts
:coffeescript
@organisation_check = (element) ->
if element.is(':checked')
element.closest('form').find('.organisation_fields').show()
element.css('background', 'red')
else
element.closest('form').find('.organisation_fields').hide()
%hr

View File

@ -9,9 +9,6 @@
.qi_row
.qi_pannel.qi_plain.padding
-if !current_p_customer.account_validated
.alert.alert-warning
Votre compte client n'a pas encore été validé, vous pouvez dès à présent compléter vos coordonnées. Notre service commercial validera votre compte dans les plus brefs délais.
= render 'form'