remove next in custom_import
This commit is contained in:
parent
b57ed75754
commit
2abba273a9
@ -692,13 +692,14 @@ class PCustomer < ApplicationRecord
|
|||||||
particular_bill.fax = value
|
particular_bill.fax = value
|
||||||
|
|
||||||
when "mode_reglement"
|
when "mode_reglement"
|
||||||
next if value.nil?
|
if value.present?
|
||||||
if value == "VIR" || "VIR COM" || "VIR 60 J NET" || "VIR 30 J NET"
|
if value == "VIR" || "VIR COM" || "VIR 60 J NET" || "VIR 30 J NET"
|
||||||
n.p_payment_type_id = PPaymentType.find_or_create_by(name: "Virement").id
|
n.p_payment_type_id = PPaymentType.find_or_create_by(name: "Virement").id
|
||||||
elsif value == "TRAITE"
|
elsif value == "TRAITE"
|
||||||
n.p_payment_type_id = PPaymentType.find_or_create_by(name: "Traite").id
|
n.p_payment_type_id = PPaymentType.find_or_create_by(name: "Traite").id
|
||||||
else
|
else
|
||||||
n.p_payment_type_id = PPaymentType.find_or_create_by(name: value).id
|
n.p_payment_type_id = PPaymentType.find_or_create_by(name: value).id
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
when "libelle_mode_reglement"
|
when "libelle_mode_reglement"
|
||||||
@ -722,8 +723,9 @@ class PCustomer < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
when "nom_banque"
|
when "nom_banque"
|
||||||
next if value.nil?
|
if value.present?
|
||||||
bank = PBank.find_or_create_by(name: value)
|
bank = PBank.find_or_create_by(name: value)
|
||||||
|
end
|
||||||
|
|
||||||
when "adresse_banque_1"
|
when "adresse_banque_1"
|
||||||
bank_particular.address_1 = value
|
bank_particular.address_1 = value
|
||||||
@ -766,18 +768,19 @@ class PCustomer < ApplicationRecord
|
|||||||
particular_bill.civilite = value
|
particular_bill.civilite = value
|
||||||
|
|
||||||
when "fonction_contact"
|
when "fonction_contact"
|
||||||
next if value.nil?
|
if value.present?
|
||||||
contact.p_contact_types << PContactType.find_or_create_by(name: value)
|
contact.p_contact_types << PContactType.find_or_create_by(name: value)
|
||||||
|
end
|
||||||
when "telephone_contact"
|
when "telephone_contact"
|
||||||
contact.tel = value
|
contact.tel = value
|
||||||
|
|
||||||
when "portable_contact"
|
when "portable_contact"
|
||||||
next if value.nil?
|
if value.present?
|
||||||
if contact.tel.nil?
|
if contact.tel.nil?
|
||||||
contact.tel = value
|
contact.tel = value
|
||||||
else
|
else
|
||||||
contact_2 = PContact.new(tel: value)
|
contact_2 = PContact.new(tel: value)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
when "email_contact"
|
when "email_contact"
|
||||||
|
@ -63,32 +63,33 @@ class PFournisseur < ApplicationRecord
|
|||||||
when "tva_intracom"
|
when "tva_intracom"
|
||||||
n.tva_num = value
|
n.tva_num = value
|
||||||
when "delai_paiement"
|
when "delai_paiement"
|
||||||
next if value.nil?
|
if value.present?
|
||||||
case value
|
case value
|
||||||
when "A la commande"
|
when "A la commande"
|
||||||
n.payment_delais = 0
|
n.payment_delais = 0
|
||||||
when "A réception"
|
when "A réception"
|
||||||
n.payment_delais = 0
|
n.payment_delais = 0
|
||||||
when "7 jours net"
|
when "7 jours net"
|
||||||
n.payment_delais = 7
|
n.payment_delais = 7
|
||||||
when "21 jours net"
|
when "21 jours net"
|
||||||
n.payment_delais = 21
|
n.payment_delais = 21
|
||||||
when "30 jours"
|
when "30 jours"
|
||||||
n.payment_delais = 30
|
n.payment_delais = 30
|
||||||
when "30 jours net"
|
when "30 jours net"
|
||||||
n.payment_delais = 30
|
n.payment_delais = 30
|
||||||
when "30 jours fin de mois"
|
when "30 jours fin de mois"
|
||||||
n.payment_delais = 30
|
n.payment_delais = 30
|
||||||
when "35 jours net"
|
when "35 jours net"
|
||||||
n.payment_delais = 35
|
n.payment_delais = 35
|
||||||
when "40 jours net"
|
when "40 jours net"
|
||||||
n.payment_delais = 40
|
n.payment_delais = 40
|
||||||
when "60 jours net"
|
when "60 jours net"
|
||||||
n.payment_delais = 60
|
n.payment_delais = 60
|
||||||
when "60 jours fin de mois"
|
when "60 jours fin de mois"
|
||||||
n.payment_delais = 60
|
n.payment_delais = 60
|
||||||
else
|
else
|
||||||
n.payment_delais = value
|
n.payment_delais = value
|
||||||
|
end
|
||||||
end
|
end
|
||||||
when "interlocuteur"
|
when "interlocuteur"
|
||||||
contact_1.name = value
|
contact_1.name = value
|
||||||
|
Reference in New Issue
Block a user