suite
This commit is contained in:
parent
5238a52533
commit
f9d656b0cb
@ -338,7 +338,7 @@ class Admin::ProductOrdersController < ApplicationController
|
||||
end
|
||||
if @product_order.bl_number?
|
||||
|
||||
|
||||
if false
|
||||
|
||||
@temp_file = "#{Rails.root}/pdf/bl/BL_#{@product_order.id}_temp.pdf"
|
||||
@final_file = "#{Rails.root}/pdf/bl/BL_#{@product_order.id}.pdf"
|
||||
@ -383,7 +383,9 @@ class Admin::ProductOrdersController < ApplicationController
|
||||
send_data @data_to_send, :filename =>"#{@product_order.bl_number}.pdf" , :type => 'application/pdf',:disposition => (params[:inline] ? 'inline' : "attachment")
|
||||
|
||||
|
||||
|
||||
else
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
@ -200,7 +200,7 @@ class ProductOrder < ActiveRecord::Base
|
||||
|
||||
|
||||
last_number = 0
|
||||
last_number = ProductOrder.where("paid_at is not null").where(:bill_year => self.bill_year ).order("bill_index DESC").first.bill_index if ProductOrder.where("paid_at is not null").where(:bill_year => self.bill_year ).first
|
||||
last_number = ProductOrder.where("paid_at is not null").where(:bill_year => self.bill_year, :reseaux_id => self.reseaux_id ).order("bill_index DESC").first.bill_index if ProductOrder.where("paid_at is not null").where(:bill_year => self.bill_year, :reseaux_id => self.reseaux_id ).first
|
||||
self.bill_index = last_number+1
|
||||
self.bill_number = "NG"+self.bill_year.to_s+('%04d' % self.bill_index)
|
||||
self.save(:validate => false)
|
||||
@ -252,7 +252,7 @@ class ProductOrder < ActiveRecord::Base
|
||||
|
||||
|
||||
last_number = 0
|
||||
last_number = ProductOrder.where("bl_number is not null").where(:bl_year => self.bl_year ).order("bl_index DESC").first.bl_index if ProductOrder.where("bl_number is not null").where(:bl_year => self.bl_year ).first
|
||||
last_number = ProductOrder.where("bl_number is not null").where(:bl_year => self.bl_year, :reseaux_id => self.reseaux_id ).order("bl_index DESC").first.bl_index if ProductOrder.where("bl_number is not null").where(:bl_year => self.bl_year, :reseaux_id => self.reseaux_id ).first
|
||||
self.bl_index = last_number+1
|
||||
self.bl_number = self.bl_ap+self.bl_year.to_s+('%05d' % self.bl_index)
|
||||
self.save(:validate => false)
|
||||
|
@ -98,16 +98,22 @@
|
||||
#main
|
||||
|
||||
%div{:style => "position:absolute;top:4.4cm;right:1cm;text-align:right;"}
|
||||
-if @product_order.reseaux_id == 19
|
||||
Commande achats n°
|
||||
-else
|
||||
Bon de commande n°
|
||||
=@product_order.bl_number
|
||||
%br
|
||||
=l @product_order.created_at, :format => :date
|
||||
|
||||
|
||||
-if @product_order.reseaux_id != 19
|
||||
%div{:style => "height:350px;"}
|
||||
-else
|
||||
%div{:style => "height:140px;"}
|
||||
|
||||
|
||||
|
||||
-if @product_order.reseaux_id != 19
|
||||
%table.table{:style => "position:absolute;right:1cm;top:220px"}
|
||||
%tr
|
||||
%td{:style => "width:5.5cm;border:0"}
|
||||
@ -178,6 +184,30 @@
|
||||
%td
|
||||
=simple_format product_order_product.archived_product.lang(:fr).bl_title
|
||||
|
||||
-if @product_order.reseaux_id == 19
|
||||
%table.sub_products{:style => "width:100%;margin-bottom:20px;margin-top:5px;"}
|
||||
%tr
|
||||
%th Référence
|
||||
%th Nom
|
||||
|
||||
|
||||
%th Nbr
|
||||
%th Prix HT
|
||||
|
||||
-product_order_product.sub_products.each do |sub_product|
|
||||
%tr
|
||||
%td
|
||||
=sub_product.reference
|
||||
%td
|
||||
=sub_product.name
|
||||
|
||||
|
||||
%td
|
||||
=sub_product.qte_tot
|
||||
%td
|
||||
=number_to_currency sub_product.price_tot_with_qte
|
||||
|
||||
|
||||
|
||||
=# product_order_product.archived_product_size.name if product_order_product.archived_product_size
|
||||
|
||||
@ -186,6 +216,7 @@
|
||||
|
||||
%td{:style => "text-align:right;"}
|
||||
= number_to_currency(product_order_product.archived_product.final_price_ht.to_f, locale: :fr) if product_order_product.archived_product
|
||||
|
||||
%td{:style => "text-align:right;"}
|
||||
=product_order_product.qty
|
||||
%td{:style => "text-align:right;"}
|
||||
@ -198,6 +229,7 @@
|
||||
|
||||
%tr
|
||||
%td{:colspan => 3, :rowspan => 3, :style => "border:0;text-align:left;"}
|
||||
-if @product_order.reseaux_id != 19
|
||||
%p
|
||||
%br
|
||||
Mode de paiment :
|
||||
@ -214,7 +246,7 @@
|
||||
Franco de port pour le Pays Voironnais
|
||||
%td Total HT :
|
||||
%td{:style => "text-align:right;"}= number_to_currency(@product_order.archived_total_ht, locale: :fr)
|
||||
|
||||
-if @product_order.reseaux_id != 19
|
||||
%tr
|
||||
|
||||
%td TVA :
|
||||
|
Loading…
x
Reference in New Issue
Block a user