diff --git a/app/controllers/admin/product_orders_controller.rb b/app/controllers/admin/product_orders_controller.rb index 9128e0a..5f84997 100755 --- a/app/controllers/admin/product_orders_controller.rb +++ b/app/controllers/admin/product_orders_controller.rb @@ -370,7 +370,7 @@ class Admin::ProductOrdersController < ApplicationController require 'posix/spawn' - ::POSIX::Spawn::Child.new 'pdftk', @temp_file, 'background', Rails.root.join('pdf_stamp', 'bl.pdf').to_s, 'output', @final_file + ::POSIX::Spawn::Child.new 'pdftk', @temp_file, 'background', Rails.root.join('pdf_stamp', "bl#{(@product_order.reseaux_id if @product_order.reseaux_id == 19)}.pdf").to_s, 'output', @final_file #pdftk /Users/nico/Desktop/Sanstitre4.pdf background /Users/nico/Dev/negos_app/pdf_stamp/bl.pdf output sortie.pdf diff --git a/app/views/admin/product_orders/bl.html.haml b/app/views/admin/product_orders/bl.html.haml index 30024da..6317cf3 100644 --- a/app/views/admin/product_orders/bl.html.haml +++ b/app/views/admin/product_orders/bl.html.haml @@ -167,7 +167,8 @@ %table.table{:style => "width:100%;margin:1cm 0;"} %tr - %th + -if @product_order.reseaux_id != 19 + %th %th Description %th{:style => "text-align:right;width:100px"} @@ -179,8 +180,9 @@ -@product_order.product_order_products.order(:product_id).each do |product_order_product| %tr - %td{:style => "width:135px;padding:0;vertical-align:middle"} - =image_tag "http://negos.pro"+product_order_product.product.default_image.image_file.file.large.medium.small.thumb.url, :style => "width:130px;" if product_order_product.product.default_image + -if @product_order.reseaux_id != 19 + %td{:style => "width:135px;padding:0;vertical-align:middle"} + =image_tag "http://negos.pro"+product_order_product.product.default_image.image_file.file.large.medium.small.thumb.url, :style => "width:130px;" if product_order_product.product.default_image %td =simple_format product_order_product.archived_product.lang(:fr).bl_title @@ -228,7 +230,7 @@ %tr - %td{:colspan => 3, :rowspan => 3, :style => "border:0;text-align:left;"} + %td{:colspan => (if @product_order.reseaux_id != 19 ? 3 : 2), :rowspan => 3, :style => "border:0;text-align:left;"} -if @product_order.reseaux_id != 19 %p %br diff --git a/pdf_stamp/bl19.pdf b/pdf_stamp/bl19.pdf new file mode 100644 index 0000000..367ae35 Binary files /dev/null and b/pdf_stamp/bl19.pdf differ