suite
This commit is contained in:
parent
1c6c9ff596
commit
3532ed15f6
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ private_medias/
|
||||
public/public_medias
|
||||
public/assets
|
||||
config/database.yml
|
||||
pdf
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::ProductOrdersController < ApplicationController
|
||||
before_filter :auth_admin
|
||||
before_filter :auth_admin, :except => [:bill, :bl]
|
||||
|
||||
layout "admin"
|
||||
|
||||
@ -168,7 +168,7 @@ class Admin::ProductOrdersController < ApplicationController
|
||||
|
||||
|
||||
def bl
|
||||
@product_order = ProductOrder.find(params[:id])
|
||||
@product_order = ProductOrder.find_by_token(params[:id])
|
||||
if !@product_order.bl_number?
|
||||
@product_order.generate_bl_number
|
||||
end
|
||||
@ -216,7 +216,7 @@ class Admin::ProductOrdersController < ApplicationController
|
||||
|
||||
@data_to_send = File.open( @final_file).read
|
||||
|
||||
send_data @data_to_send, :filename =>"bl.pdf" , :type => 'application/pdf',:disposition => (params[:inline] ? 'inline' : "attachment")
|
||||
send_data @data_to_send, :filename =>"#{@product_order.bl_number}.pdf" , :type => 'application/pdf',:disposition => (params[:inline] ? 'inline' : "attachment")
|
||||
|
||||
|
||||
|
||||
|
@ -53,6 +53,7 @@ class Public::ProductOrdersController < ApplicationController
|
||||
end
|
||||
|
||||
def particulars_save
|
||||
get_reseaux
|
||||
@product_order = ProductOrder.find(session[:product_order_id])
|
||||
@product_order.customer.particular_bill.skip_validation = false
|
||||
@product_order.customer.particular_bill.skip_email = true
|
||||
@ -97,6 +98,7 @@ class Public::ProductOrdersController < ApplicationController
|
||||
|
||||
|
||||
def select_fdp
|
||||
get_reseaux
|
||||
@product_order = ProductOrder.find(session[:product_order_id])
|
||||
@product_order.force_fdp_validation = true
|
||||
redirect_to select_fdp_save_public_product_orders_path
|
||||
@ -105,7 +107,7 @@ class Public::ProductOrdersController < ApplicationController
|
||||
|
||||
|
||||
def select_fdp_save
|
||||
|
||||
get_reseaux
|
||||
@product_order = ProductOrder.find(session[:product_order_id])
|
||||
@product_order.force_fdp_validation = true
|
||||
@product_order.product_fdp_id = 1
|
||||
@ -127,6 +129,7 @@ class Public::ProductOrdersController < ApplicationController
|
||||
end
|
||||
|
||||
def select_payment
|
||||
get_reseaux
|
||||
if params[:orderID]
|
||||
flash.now[:error] = "Votre tentative de paiement par carte bancaire a échouée, ou vous avez annulé votre paiement, merci de bien vouloir essayer de nouveau ou changer de mode de paiement."
|
||||
end
|
||||
@ -143,6 +146,7 @@ class Public::ProductOrdersController < ApplicationController
|
||||
|
||||
|
||||
def cart_not_empty
|
||||
get_reseaux
|
||||
@product_order = ProductOrder.find(session[:product_order_id])
|
||||
|
||||
if @product_order.product_order_products.count == 0
|
||||
@ -153,7 +157,7 @@ class Public::ProductOrdersController < ApplicationController
|
||||
|
||||
def select_payment_save
|
||||
|
||||
|
||||
get_reseaux
|
||||
@product_order = ProductOrder.find(session[:product_order_id])
|
||||
|
||||
|
||||
@ -183,6 +187,12 @@ class Public::ProductOrdersController < ApplicationController
|
||||
|
||||
@product_order.save
|
||||
@product_order.after_paid
|
||||
|
||||
#@product_order.generate_bl_number
|
||||
|
||||
|
||||
puts @product_order.bl_number
|
||||
|
||||
ProductOrdersMails.confirmation_cheque(@product_order).deliver
|
||||
session[:product_order_id] = nil
|
||||
redirect_to payment_instructions_public_product_order_path(@product_order.token)
|
||||
@ -201,6 +211,7 @@ class Public::ProductOrdersController < ApplicationController
|
||||
|
||||
|
||||
def payment_instructions
|
||||
get_reseaux
|
||||
@product_order_ar = ProductOrder.find_by_token(params[:id])
|
||||
end
|
||||
|
||||
|
@ -182,7 +182,7 @@ class ProductOrder < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def after_paid
|
||||
|
||||
puts "TTTTTT"
|
||||
self.product_order_products.each do |p|
|
||||
|
||||
p.update_stock_th
|
||||
|
@ -1,8 +1,9 @@
|
||||
|
||||
%strong
|
||||
=particular.firstname
|
||||
=particular.organisation
|
||||
%br
|
||||
=particular.firstname
|
||||
|
||||
=particular.name
|
||||
=particular.name
|
||||
%br
|
||||
=particular.address_2
|
||||
|
||||
|
@ -89,7 +89,7 @@
|
||||
|
||||
%div{:style => "position:absolute;top:1cm;right:1cm;text-align:right;"}
|
||||
Bon de commande n°
|
||||
=@product_order.bill_number
|
||||
=@product_order.bl_number
|
||||
%br
|
||||
=l @product_order.created_at, :format => :date
|
||||
|
||||
@ -103,7 +103,8 @@
|
||||
%td{:style => "min-width:6cm;"}
|
||||
%h3 Adresse de facturation
|
||||
|
||||
%strong
|
||||
%strong=@product_order.particular_bill.organisation
|
||||
%br
|
||||
=@product_order.particular_bill.firstname
|
||||
|
||||
=@product_order.particular_bill.name
|
||||
@ -124,7 +125,8 @@
|
||||
%td
|
||||
%h3 Adresse de livraison
|
||||
|
||||
%strong
|
||||
%strong=@product_order.particular_bill.organisation
|
||||
%br
|
||||
=@product_order.particular_send.firstname
|
||||
|
||||
=@product_order.particular_send.name
|
||||
@ -177,34 +179,27 @@
|
||||
|
||||
|
||||
|
||||
%tr
|
||||
%td{:colspan => 4, :style => "border:0;"}
|
||||
%td Total :
|
||||
%td= number_to_currency(@product_order.archived_total_articles, locale: :fr)
|
||||
|
||||
-if @product_order.vourcher_code_archived
|
||||
%tr
|
||||
%td{:colspan => 4, :style => "border:0;"}
|
||||
%td
|
||||
=qit "Code réduction tableau", "Code de réduction "
|
||||
="("+@product_order.vourcher_code_archived.slug+") :"
|
||||
%td
|
||||
="-"
|
||||
=number_to_currency @product_order.archived_vourcher_reduction, locale: :fr
|
||||
|
||||
%tr
|
||||
%td{:colspan => 4, :style => "border:0;"}
|
||||
%td Frais de port :
|
||||
%td= number_to_currency(@product_order.archived_total_fdp, locale: :fr)
|
||||
%td Total HT :
|
||||
%td= number_to_currency(@product_order.archived_total_ht, locale: :fr)
|
||||
|
||||
%tr
|
||||
%td{:colspan => 4, :style => "border:0;"}
|
||||
%td
|
||||
%strong Total :
|
||||
%td
|
||||
%strong
|
||||
= number_to_currency(@product_order.archived_total_ttc, locale: :fr)
|
||||
%td TVA :
|
||||
%td= number_to_currency(@product_order.archived_total_tva, locale: :fr)
|
||||
|
||||
%tr
|
||||
%td{:colspan => 4, :style => "border:0;"}
|
||||
%td Total TTC :
|
||||
%td= number_to_currency(@product_order.archived_total_ttc, locale: :fr)
|
||||
|
||||
|
||||
|
||||
|
||||
-if false
|
||||
%p
|
||||
Mode de paiment :
|
||||
-if @product_order.product_order_payment_type_ok_id == 3
|
||||
|
@ -18,7 +18,7 @@
|
||||
="oui" if @product_order.paid
|
||||
=link_to "Facture", bill_admin_product_order_path(@product_order)
|
||||
|
||||
=link_to "BL", bl_admin_product_order_path(@product_order)
|
||||
=link_to "BL", bl_admin_product_order_path(@product_order.token)
|
||||
|
||||
|
||||
-if @product_order.paid
|
||||
|
@ -48,7 +48,7 @@
|
||||
%tr
|
||||
%td{:colspan => 3, :style => "border:0;"}
|
||||
%td
|
||||
%strong Total HT:
|
||||
%strong Total TTC:
|
||||
%td
|
||||
%strong
|
||||
= number_to_currency(@product_order.archived_total_ttc, locale: :fr)
|
||||
|
@ -5,11 +5,10 @@
|
||||
|
||||
%table{:style => "width:100%;"}
|
||||
%tr
|
||||
%td{:style => "width:20%"}
|
||||
=f.input :civilite, :label => "Civilité", :as => :select, :collection => [["Mme.", "Mme"], ["M.", "M"]], :include_blank => false
|
||||
%td{:style => "width:40%"}
|
||||
|
||||
%td{:style => "width:50%"}
|
||||
=f.input :firstname, :label => "Prénom"
|
||||
%td{:style => "width:40%"}
|
||||
%td{:style => "width:50%"}
|
||||
=f.input :name, :label => "Nom"
|
||||
|
||||
=f.input :address_2, :label => "Adresse"
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
%br
|
||||
%br
|
||||
=link_to "Visitez notre boutique !", boutique_path, :class => "btn btn-primary"
|
||||
=link_to "Visitez notre boutique !", public_reseaux_products_path(:reseaux_id => session[:reseaux_id].to_i), :class => "btn btn-primary"
|
||||
|
||||
|
||||
%br
|
||||
|
@ -5,8 +5,6 @@
|
||||
|
||||
=f.semantic_fields_for :customer do |f|
|
||||
|
||||
=debug @product_order.customer.particular_bill_id
|
||||
=debug @product_order.customer.particular_send_id
|
||||
.row
|
||||
.columns.span_6{:style => "padding:10px;"}
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
%p
|
||||
Votre pré-commande a bien été enregistrée
|
||||
%br
|
||||
=link_to "Téléchargez votre bon de commande", bl_admin_product_order_path(@product_order_ar.token)
|
||||
%br
|
||||
%br
|
||||
=#%p Si vous souhaitez finalement payer cette commande par carte banque vous pouvez la retrouver dans votre compte client.
|
||||
|
@ -27,7 +27,7 @@
|
||||
%tr
|
||||
%td{:colspan => 3, :style => "border:0;"}
|
||||
%td
|
||||
%strong Total HT:
|
||||
%strong Total TTC:
|
||||
%td.boutique-right
|
||||
%strong
|
||||
= number_to_currency(@product_order.total_ttc, locale: :fr)
|
||||
|
@ -3,4 +3,4 @@
|
||||
%h1 Produits exclusifs réservés à ce réseau
|
||||
|
||||
.boutique_body.products
|
||||
=render Product.where(:archived => false).all
|
||||
=render Product.where(:archived => false, :reseaux_id => @reseaux.id).all
|
||||
|
@ -826,7 +826,7 @@ ActiveRecord::Schema.define(version: 20170927093622) do
|
||||
t.string "particular_send_id", limit: 255
|
||||
t.string "token", limit: 255
|
||||
t.boolean "completed_finish", limit: 1, default: false
|
||||
t.integer "product_order_payment_ok_id", limit: 4
|
||||
t.integer "product_order_payment_ok", limit: 4
|
||||
t.integer "product_order_payment_type_ok_id", limit: 4
|
||||
t.integer "bill_index", limit: 4
|
||||
t.string "bill_number", limit: 255
|
||||
|
BIN
pdf_stamp/bl.pdf
BIN
pdf_stamp/bl.pdf
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user