adding SN to sell price_line

This commit is contained in:
Philippe 2021-11-03 16:37:41 +01:00
parent f1bad61fd2
commit d0646650c7
31 changed files with 196 additions and 117 deletions

View File

@ -133,4 +133,8 @@ class Admin::LineStocksController < ApplicationController
def empty_stock def empty_stock
@price_document = PriceDocument.where(:price_document_type_id => 4, :cost_ok => false) @price_document = PriceDocument.where(:price_document_type_id => 4, :cost_ok => false)
end end
def show_p_article
@line_stock = LineStock.find(params[:line_stock_id])
end
end end

View File

@ -146,17 +146,20 @@ class Admin::PCustomerSheetsController < ApplicationController
def new def new
@p_customer_sheet = PCustomerSheet.new() @p_customer_sheet = PCustomerSheet.new()
@p_customer = PCustomer.find(params[:p_customer_id]) if params[:p_customer_id] @p_customer = PCustomer.find(params[:p_customer_id]) if params[:p_customer_id]
@p_customer_sheet.p_customer = @p_customer @p_customer_sheet.p_customer = @p_customer
@p_customer_sheet.price_line_block = PriceLineBlock.new(:particular_bill_id => @p_customer.particular_bill_id, :particular_send_id => @p_customer.particular_send_id) @p_customer_sheet.price_line_block = PriceLineBlock.new
@p_customer_sheet.price_line_block.price_lines.build @p_customer_sheet.price_line_block.price_lines.build
@p_customer_sheet.price_line_block.p_customer = @p_customer @p_customer_sheet.price_line_block.p_customer = @p_customer
@p_customer_sheet.price_line_block.build_particular_send(owner: @p_customer)
@p_customer_sheet.price_line_block.build_particular_bill(owner: @p_customer)
end end
@ -171,15 +174,15 @@ class Admin::PCustomerSheetsController < ApplicationController
def create def create
@p_customer_sheet = PCustomerSheet.new(params.require(:p_customer_sheet).permit!) @p_customer_sheet = PCustomerSheet.new(params.require(:p_customer_sheet).permit!)
@p_customer_sheet.admin = current_admin @p_customer_sheet.admin = current_admin
if @p_customer_sheet.save if @p_customer_sheet.save
redirect_to admin_p_customer_sheet_path(@p_customer_sheet) redirect_to admin_p_customer_sheet_path(@p_customer_sheet)
else else
puts "ERRORSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
puts params
puts @p_customer_sheet.errors.messages
puts "ERRORSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
@p_customer = @p_customer_sheet.price_line_block.p_customer @p_customer = @p_customer_sheet.price_line_block.p_customer
render action: "new" render action: "new"

View File

@ -44,19 +44,12 @@ class Admin::PriceLinesController < ApplicationController
def update def update
puts "PAAMSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
puts params
puts "PAAMSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
@price_line = PriceLine.find(params[:id]) @price_line = PriceLine.find(params[:id])
if @price_line.update_attributes(params.require(:price_line).permit!) if @price_line.update_attributes(params.require(:price_line).permit!)
else else
puts "ERRORSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
puts @price_line.errors.messages
puts "ERRORSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"
render action: "edit" render action: "edit"
end end
end end
@ -73,4 +66,8 @@ class Admin::PriceLinesController < ApplicationController
# @p_article = PArticle.new#@price_line.p_articles.build # @p_article = PArticle.new#@price_line.p_articles.build
# @p_article_serial_nums = @p_article.p_article_serial_nums.build # @p_article_serial_nums = @p_article.p_article_serial_nums.build
end end
def add_price_line_p_article
@price_line = PriceLine.find(params[:price_line_id])
end
end end

View File

@ -80,4 +80,14 @@ module ApplicationHelper
link_to raw("#{title} "+ic(icon).html_safe), request.query_parameters.merge({column: column, direction: direction}) link_to raw("#{title} "+ic(icon).html_safe), request.query_parameters.merge({column: column, direction: direction})
end end
def id_color(price_line)
if price_line.p_articles.count == 0
return "background-color: red"
elsif price_line.p_articles.count < price_line.qte
return "background-color: orange"
else
return "background-color: #70ff29"
end
end
end end

View File

@ -7,6 +7,9 @@
belongs_to :stock_movement_line belongs_to :stock_movement_line
belongs_to :partition_lines belongs_to :partition_lines
has_many :line_stock_p_articles
has_many :p_articles, through: :line_stock_p_articles
acts_as_sorting :fields => { acts_as_sorting :fields => {
:id => {:name => "ID", :reorder => false}, :id => {:name => "ID", :reorder => false},

View File

@ -0,0 +1,4 @@
class LineStockPArticle < ApplicationRecord
belongs_to :line_stock
belongs_to :p_article
end

View File

@ -11,6 +11,9 @@ class PArticle < ApplicationRecord
has_many :price_lines, through: :price_line_p_articles has_many :price_lines, through: :price_line_p_articles
accepts_nested_attributes_for :p_article_serial_nums accepts_nested_attributes_for :p_article_serial_nums
has_many :line_stock_p_articles
has_many :line_stocks, through: :line_stock_p_articles
validates_presence_of :p_product_ref validates_presence_of :p_product_ref

View File

@ -13,6 +13,7 @@ class PCustomerSheet < ApplicationRecord
belongs_to :particular_bill, :class_name => "Particular"#, :dependent => :destroy belongs_to :particular_bill, :class_name => "Particular"#, :dependent => :destroy
accepts_nested_attributes_for :particular_bill accepts_nested_attributes_for :particular_bill
belongs_to :particular_send, :class_name => "Particular"#, :dependent => :destroy belongs_to :particular_send, :class_name => "Particular"#, :dependent => :destroy
accepts_nested_attributes_for :particular_send accepts_nested_attributes_for :particular_send

View File

@ -7,6 +7,7 @@ class Particular < ApplicationRecord
has_many :open_ranges, :through => :open_range_elements has_many :open_ranges, :through => :open_range_elements
belongs_to :owner, :polymorphic => true belongs_to :owner, :polymorphic => true
#has_many :p_customer_sheets
#validates :civilite, :presence => true, :if => :force_validation #validates :civilite, :presence => true, :if => :force_validation
#validates :name, :presence => true, :if => :force_validation #validates :name, :presence => true, :if => :force_validation
#validates :firstname, :presence => true, :if => :force_validation #validates :firstname, :presence => true, :if => :force_validation

View File

@ -764,4 +764,9 @@ class PriceDocument < ApplicationRecord
end end
end end
def stock_generable
return self.price_line_block.price_lines.joins(:p_articles).count < self.price_line_block.price_lines.sum(:qte) ? false : true
#exclure les produit non stockable et sans SN
end
end end

View File

@ -13,6 +13,7 @@ class PriceLine < ApplicationRecord
has_many :price_line_p_articles has_many :price_line_p_articles
has_many :p_articles, through: :price_line_p_articles has_many :p_articles, through: :price_line_p_articles
accepts_nested_attributes_for :p_articles accepts_nested_attributes_for :p_articles
accepts_nested_attributes_for :price_line_p_articles
default_scope { order('position ASC') } default_scope { order('position ASC') }

View File

@ -7,8 +7,8 @@ class PriceLineBlock < ApplicationRecord
validates :p_customer_id, :presence => true, :if => :p_customer_needed? validates :p_customer_id, :presence => true, :if => :p_customer_needed?
#validates :p_fournisseur_id, :presence => true, :if => :p_fournisseur_needed? #validates :p_fournisseur_id, :presence => true, :if => :p_fournisseur_needed?
validates :particular_bill_id, :presence => true, :if => :particular_bill_needed? #validates :particular_bill_id, :presence => true, :if => :particular_bill_needed?
validates :particular_send_id, :presence => true, :if => :particular_send_needed? #validates :particular_send_id, :presence => true, :if => :particular_send_needed?
belongs_to :particular_bill, :class_name => "Particular"#, :dependent => :destroy belongs_to :particular_bill, :class_name => "Particular"#, :dependent => :destroy
@ -208,8 +208,18 @@ class PriceLineBlock < ApplicationRecord
def generate_stock def generate_stock
self.price_lines.each do |pl| self.price_lines.each do |pl|
if pl.p_product_ref if pl.p_product_ref
LineStock.create(:dluo => pl.dluo, :date => self.price_lineable.date, :p_product_ref => pl.p_product_ref, :description => "Entrée en stock par facture d'achat", :qte => pl.qte, :price_ht => pl.local_tot_amount_ht, :price_line => pl, :price_line_block => self, :stockable => self.price_lineable) ls = LineStock.new(
:dluo => pl.dluo,
:date => self.price_lineable.date,
:p_product_ref => pl.p_product_ref,
:description => "Entrée en stock par facture d'achat",
:qte => pl.qte,
:price_ht => pl.local_tot_amount_ht,
:price_line => pl,
:price_line_block => self,
:stockable => self.price_lineable)
ls.p_articles = pl.p_articles
ls.save
end end
@ -441,6 +451,9 @@ class PriceLineBlock < ApplicationRecord
end end
if self.particular_bill_needed? and (!self.p_customer or !self.particular_bill or !self.particular_bill.owner or self.particular_bill.owner != self.p_customer) if self.particular_bill_needed? and (!self.p_customer or !self.particular_bill or !self.particular_bill.owner or self.particular_bill.owner != self.p_customer)
puts "PARTICULEARRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
puts self.particular_bill
puts "PARTICULEARRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
errors.add(:particular_bill_id, 'doit être une adresse du client') errors.add(:particular_bill_id, 'doit être une adresse du client')
end end

View File

@ -25,6 +25,7 @@
= link_to i(:"trash-o"), [:admin, line_stock], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true = link_to i(:"trash-o"), [:admin, line_stock], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
= link_to i(:pencil), edit_admin_line_stock_path(line_stock), :remote => true = link_to i(:pencil), edit_admin_line_stock_path(line_stock), :remote => true
= link_to i(:eye), admin_line_stock_path(line_stock), :remote => true = link_to i(:eye), admin_line_stock_path(line_stock), :remote => true
= link_to i(:"mobile-alt"), show_p_article_admin_line_stocks_path(line_stock_id: line_stock.id), :remote => true

View File

@ -0,0 +1,13 @@
.mx-2.my-2
%table.table-bordered
%tbody
-@line_stock.p_articles.each do |p_article|
%tr
%td="##{p_article.id}"
%td=p_article.p_product_ref.name
- p_article.p_article_serial_nums.each do |sn|
%tr
%td
%td
="#{sn.p_serial_num_type.name} - #{sn.value}"
.actions

View File

@ -140,3 +140,4 @@

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "show_p_article_form"))%>",700,900);

View File

@ -15,7 +15,7 @@
%p= link_to_add_fields "Ajouter un numéro de série", f, :p_article_serial_nums, {:class => "btn btn-primary"} %p= link_to_add_fields "Ajouter un numéro de série", f, :p_article_serial_nums, {:class => "btn btn-primary"}
.actions=f.submit "sauvegarder", :class => "btn btn-primary" .actions=f.submit "sauvegarder", :class => "btn btn-primary"
- else - elsif params[:controller] == "admin/price_lines"
= form.inputs do = form.inputs do
-if params[:p_product_ref_id] -if params[:p_product_ref_id]
= form.input :p_product_ref_id, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :label => form.object.label_for(:p_product_ref), input_html: {disabled: true} = form.input :p_product_ref_id, as: :select, collection: PProductRef.all.distinct.pluck(:cc_name, :id), :label => form.object.label_for(:p_product_ref), input_html: {disabled: true}
@ -30,3 +30,4 @@
= form.semantic_fields_for :p_article_serial_nums do |form| = form.semantic_fields_for :p_article_serial_nums do |form|
=render :partial => "admin/p_article_serial_nums/form", :locals => {:form => form} =render :partial => "admin/p_article_serial_nums/form", :locals => {:form => form}
%p= link_to_add_fields "Ajouter un numéro de série", form, :p_article_serial_nums, {:class => "btn btn-primary"} %p= link_to_add_fields "Ajouter un numéro de série", form, :p_article_serial_nums, {:class => "btn btn-primary"}

View File

@ -1,4 +1,5 @@
=semantic_form_for [:admin, @p_customer_sheet], :html => {:class => "qi_price_form"}, :remote => false do |form| =semantic_form_for [:admin, @p_customer_sheet], :html => {:class => "qi_price_form"}, :remote => false do |form|
=#debug form.object.errors.messages if current_admin.id == 1
=form.semantic_fields_for :price_line_block do |f| =form.semantic_fields_for :price_line_block do |f|
=render :partial => "admin/price_line_blocks/form", :locals => {:f => f} =render :partial => "admin/price_line_blocks/form", :locals => {:f => f}
@ -11,23 +12,6 @@
=#form.input :demande_type, :collection => ["Brouillon", "Demande de bon de commande","Demande de devis"], :as => :select, :include_blank => false, :label => "Type de demande :" =#form.input :demande_type, :collection => ["Brouillon", "Demande de bon de commande","Demande de devis"], :as => :select, :include_blank => false, :label => "Type de demande :"
=#form.input :state, :collection => ["AV BPA", "PAS BPA","BPA", "Traitée"], :as => :select, :include_blank => false, :label => "Statut :" =#form.input :state, :collection => ["AV BPA", "PAS BPA","BPA", "Traitée"], :as => :select, :include_blank => false, :label => "Statut :"
=#form.input :past_id, :label => "N° système actuel" =#form.input :past_id, :label => "N° système actuel"
=yield :shipping_date
.qi_row
.qi_pannel.qi_plain.padding.row
nested form for particular send et bill qui crée à chaque fois un particular
ajouter accept nested attributed for particular dans pcustomer sheet
.qi_row
.qi_pannel.qi_plain.padding.row
=yield :price_lines
.qi_row
.qi_pannel.qi_plain.padding.row
=yield :discount
.large_actions .large_actions

View File

@ -1,4 +1,3 @@
=form.hidden_field :particular_type =form.hidden_field :particular_type
=form.hidden_field :skip_validation, :class => "skip_validation" =form.hidden_field :skip_validation, :class => "skip_validation"
=form.hidden_field :pro =form.hidden_field :pro
@ -31,15 +30,14 @@
=#form.input :email, :label => false, :placeholder => qit("don-particular-email","Email") =#form.input :email, :label => false, :placeholder => qit("don-particular-email","Email")
=#form.input :tel, :label => false, :placeholder => qit("don-particular-phone","Téléphone") =#form.input :tel, :label => false, :placeholder => qit("don-particular-phone","Téléphone")
Contacts de l'adresse : -if !params[:controller] == "p_customer_sheets"
Contacts de l'adresse :
.p_contacts_form
.p_contacts_form
=form.semantic_fields_for :p_contacts do |form| =form.semantic_fields_for :p_contacts do |form|
=render :partial => "admin/p_contacts/form", :locals => {:form => form} =render :partial => "admin/p_contacts/form", :locals => {:form => form}
%p= link_to_add_fields ic(:plus)+" Ajouter un contact à l'adresse", form, :p_contacts %p= link_to_add_fields ic(:plus)+" Ajouter un contact à l'adresse", form, :p_contacts
=#form.input :open_ranges, :label => "Horaires d'ouvertures :", :collection => OpenRange.all, :as => :check_boxes =#form.input :open_ranges, :label => "Horaires d'ouvertures :", :collection => OpenRange.all, :as => :check_boxes

View File

@ -209,14 +209,7 @@
-price_line_block.price_lines.each do |price_line| -price_line_block.price_lines.each do |price_line|
%tbody %tbody
%tr %tr
-if price_line.p_articles.count == 0 %td{style: id_color(price_line)}
%td{style: "background-color: red;"}
="##{price_line.id}"
- elsif price_line.p_articles.count < price_line.qte
%td{style: "background-color: orange"}
="##{price_line.id}"
- else
%td{style: "background-color: green"}
="##{price_line.id}" ="##{price_line.id}"
%td %td
=price_line.ref =price_line.ref
@ -250,7 +243,8 @@
-if current_admin.has_permission?("show-costs") -if current_admin.has_permission?("show-costs")
%p %p
-if @price_document.price_document_type_id == 6 -if @price_document.price_document_type_id == 6
=link_to "Générer les stocks", generate_stocks_admin_price_document_path(@price_document), :class => "btn btn-primary" if !@price_document.stock_ok =link_to "Générer les stocks", generate_stocks_admin_price_document_path(@price_document), :class => "btn btn-primary" if !@price_document.stock_ok and @price_document.stock_generable
=link_to "Générer les stocks", generate_stocks_admin_price_document_path(@price_document), :class => "btn btn-primary disabled" if !@price_document.stock_ok and !@price_document.stock_generable
-elsif @price_document.price_document_type_id == 4 or @price_document.price_document_type_id == 5 -elsif @price_document.price_document_type_id == 4 or @price_document.price_document_type_id == 5
%p %p
Coût : Coût :

View File

@ -4,47 +4,42 @@
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande") -if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
= f.hidden_field :p_customer_id, :class => "p_customer_id" = f.text_field :p_customer_id, :class => "p_customer_id"
=content_for :particular do
.row .row
.p_customer_sheet_customer.col-12.mb-4 .p_customer_sheet_customer.col-12.mb-4
-if f.object.p_customer and f.object.p_customer.particular -if f.object.p_customer and f.object.p_customer.particular
=render :partial => "admin/p_customers/apercu", :locals => {:particular => f.object.p_customer.particular} =render :partial => "admin/p_customers/apercu", :locals => {:particular => f.object.p_customer.particular}
.col-6
.addresses.row
.columns.span_6
%h4 Adresse de facturation
-if f.object.p_customer
=f.inputs do
= f.input :particular_bill_id, :collection => f.object.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de facturation"
-else
=f.inputs do
= f.input :particular_bill_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
.col-6
.addresses.row
.columns.span_6
%h4 Adresse de livraison
-if f.object.p_customer .qi_row
=f.inputs do .qi_pannel.qi_plain.padding.row
= f.input :particular_send_id, :collection => f.object.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de livraison" .col-6
-else Adresse de livraison :
=f.inputs do =f.semantic_fields_for :particular_send do |form_particular_send|
= f.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation" =render :partial => "admin/particulars/form", :locals => {:form => form_particular_send}
=form_particular_send.text_field :owner_id
=form_particular_send.text_field :owner_type
.col-6
Adresse de facturation :
=f.semantic_fields_for :particular_bill do |form_particular_bill|
=render :partial => "admin/particulars/form", :locals => {:form => form_particular_bill}
=form_particular_bill.text_field :owner_id
=form_particular_bill.text_field :owner_type
.clear .clear
=content_for :shipping_date do
= f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date = f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date
= f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date = f.input :ct_creation_date, :label => "Date de commande (si différente de la date de création) :", :as => :date
= f.input :validation_date, :label => "Date de validation :", :as => :date = f.input :validation_date, :label => "Date de validation :", :as => :date
= f.input :customer_ref, :label => "Référence commande client :" = f.input :customer_ref, :label => "Référence commande clientttt :"
-if current_admin.has_permission?("customer-sheets-bl") -if current_admin.has_permission?("customer-sheets-bl")
=# f.input :bl_comment, :label => "Commentaire à mettre sur le BL :", :input_html => {:style => "min-height:50px;height:50px;"} =# f.input :bl_comment, :label => "Commentaire à mettre sur le BL :", :input_html => {:style => "min-height:50px;height:50px;"}
@ -55,8 +50,6 @@
%br %br
=content_for :price_lines do
%div{:style=>"padding:0 30px;"} %div{:style=>"padding:0 30px;"}
.row.qi_field_wrapper .row.qi_field_wrapper
%table{:style => "width:100%;border-collapse:separate;"} %table{:style => "width:100%;border-collapse:separate;"}
@ -77,7 +70,6 @@
-if current_admin.has_permission?("payments") -if current_admin.has_permission?("payments")
=content_for :discount do
-if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande") -if !@p_customer_sheet or (@p_customer_sheet and @p_customer_sheet.state != "commande")
-if !@avoir -if !@avoir
= f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :"#, :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"} = f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :"#, :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
@ -103,7 +95,3 @@
-if false -if false
= f.input :ct_payment_month_end, :label => "Fin de mois ?" = f.input :ct_payment_month_end, :label => "Fin de mois ?"

View File

@ -96,6 +96,9 @@
%td.numeraire %td.numeraire
=price_line.qte =price_line.qte
%td
= price_line.p_articles.count
= link_to i(:"mobile-alt"), add_price_line_p_article_admin_price_lines_path(p_product_ref_id: price_line.p_product_ref.id, price_line_id: price_line.id), :remote => true
-if @price_document and @price_document.label != "Demande prix" and @price_document.label != "Réponse fournisseur" -if @price_document and @price_document.label != "Demande prix" and @price_document.label != "Réponse fournisseur"
%td.numeraire %td.numeraire

View File

@ -0,0 +1 @@
=form.input :p_article_id, as: :select, collection: PArticle.all, member_label: :id

View File

@ -0,0 +1,9 @@
.mx-2.my-2
=semantic_form_for [:admin, @price_line], :remote => true do |f|
.content
=f.inputs do
.price_line_p_articles_form
= f.semantic_fields_for :price_line_p_articles do |form|
=render :partial => "admin/price_line_p_articles/form", :locals => {:form => form}
%p= link_to_add_fields "Ajouter un article", f, :price_line_p_articles, {:class => "btn btn-primary"}
.actions=f.submit "Sauvegarder", :class => "btn btn-primary"

View File

@ -0,0 +1 @@
show_pane_hover("<%= escape_javascript(render(:partial => "add_price_line_p_article_form"))%>",700,900);

View File

@ -447,6 +447,7 @@ Rails.application.routes.draw do
collection do collection do
get "stock_resume" get "stock_resume"
get "empty_stock" get "empty_stock"
get :show_p_article
end end
end end
end end
@ -698,6 +699,7 @@ Rails.application.routes.draw do
end end
collection do collection do
get :add_p_article get :add_p_article
get :add_price_line_p_article
end end
end end

View File

@ -0,0 +1,10 @@
class CreateLineStockPArticles < ActiveRecord::Migration[6.0]
def change
create_table :line_stock_p_articles do |t|
t.belongs_to :p_article
t.belongs_to :line_stock
t.timestamps
end
end
end

View File

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_11_02_105934) do ActiveRecord::Schema.define(version: 2021_11_03_085623) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -549,6 +549,15 @@ ActiveRecord::Schema.define(version: 2021_11_02_105934) do
t.datetime "updated_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false
end end
create_table "line_stock_p_articles", force: :cascade do |t|
t.bigint "p_article_id"
t.bigint "line_stock_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["line_stock_id"], name: "index_line_stock_p_articles_on_line_stock_id"
t.index ["p_article_id"], name: "index_line_stock_p_articles_on_p_article_id"
end
create_table "line_stock_usages", force: :cascade do |t| create_table "line_stock_usages", force: :cascade do |t|
t.bigint "line_stock_id" t.bigint "line_stock_id"
t.decimal "qte", precision: 14, scale: 2 t.decimal "qte", precision: 14, scale: 2

11
test/fixtures/line_stock_p_articles.yml vendored Normal file
View File

@ -0,0 +1,11 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value

View File

@ -0,0 +1,7 @@
require 'test_helper'
class LineStockPArticleTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end