Compare commits

..

2 Commits

Author SHA1 Message Date
Nicolas Bally
6760fbaf47 suite 2018-04-17 10:04:58 +02:00
Nicolas Bally
e0ee08bb7b suite 2018-04-17 10:04:52 +02:00
6 changed files with 23 additions and 4 deletions

View File

@ -1,9 +1,9 @@
# -*- encoding : utf-8 -*-
class Admin::ProductOrderDocumentsController < ApplicationController
before_filter :auth_admin
#before_filter :auth_admin
layout "admin"
#layout "admin"

View File

@ -37,6 +37,7 @@ class ProductOrderDocument < ActiveRecord::Base
self.data_file_id = self.product_order_document_type.data_file_id
self.reseaux_id = self.product_order_document_type.reseaux_id
self.fournisseur_id = self.product_order_document_type.fournisseur_id
self.name = self.product_order_document_type.name
last_number = 0
last_dt = ProductOrderDocument.where("d_number is not null").where(:d_year => self.d_year,:product_order_document_type_id => self.product_order_document_type_id).order("d_index DESC").first

View File

@ -2,6 +2,7 @@
.content
= form.input :label, :label => "Label :"
= form.input :name, :label => "Nom :"
= form.input :prefix, :label => "Prefix :"
= form.input :reseaux_id, :label => "Réseau :", :collection => Reseaux.where(:parent_id => nil).all, :as => :select, :include_blank => true
=form.input :fournisseur_id, :label => "Fournisseur :", :collection => Fournisseur.all, :as => :select, :include_blank => true

View File

@ -5,7 +5,17 @@
%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)
Téléchargez dès maintenant vos documents :
%table.table
-@product_order_ar.product_order_documents.each do |product_order_document|
%tr
%td{:style => "width:300px;"}
=product_order_document.name
%td
=link_to product_order_document.d_number, admin_product_order_document_path(product_order_document.token)
=#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.

View File

@ -0,0 +1,5 @@
class AddNameToProductOrderDocuments < ActiveRecord::Migration
def change
add_column :product_order_documents, :name, :string
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180416162335) do
ActiveRecord::Schema.define(version: 20180417075800) do
create_table "abonnements", force: :cascade do |t|
t.integer "abonnement_type_id", limit: 4
@ -833,6 +833,7 @@ ActiveRecord::Schema.define(version: 20180416162335) do
t.integer "data_file_id", limit: 4
t.integer "reseaux_id", limit: 4
t.integer "fournisseur_id", limit: 4
t.string "name", limit: 255
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
@ -854,6 +855,7 @@ ActiveRecord::Schema.define(version: 20180416162335) do
t.string "token", limit: 255
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "name", limit: 255
end
add_index "product_order_documents", ["product_order_id"], name: "index_product_order_documents_on_product_order_id", using: :btree