This commit is contained in:
Nicolas Bally 2020-03-10 15:40:02 +01:00
parent feee012088
commit 3b0cd03964
2 changed files with 12 additions and 3 deletions

View File

@ -13,6 +13,16 @@ class MOdrVirement < ApplicationRecord
eval(QI_DYNAMICS_CORE)
before_create { generate_token() }
def generate_token()
begin
self[:token] = SecureRandom.urlsafe_base64
end while MOdrVirement.exists?(:token => self[:token])
end
def self.qi_table_order
{

View File

@ -13,7 +13,6 @@
<PmtInf>
<PmtInfId><%= @prelevement_date.strftime("%d/%m/%Y") %></PmtInfId>
<PmtMtd>TRF</PmtMtd>
<BtchBookg>false</BtchBookg>
<NbOfTxs><%= @m_odr_virements.count %></NbOfTxs>
<CtrlSum><%= '%.2f' % @m_odr_virements.sum(:amount) %></CtrlSum>
<PmtTpInf>
@ -27,12 +26,12 @@
</Dbtr>
<DbtrAcct>
<Id>
<IBAN><%= @iban %></IBAN>
<IBAN><%= @iban.to_s.gsub(" ", "") %></IBAN>
</Id>
</DbtrAcct>
<DbtrAgt>
<FinInstnId>
<BIC><%= @bic %></BIC>
<BIC><%= @bic.to_s.gsub(" ", "") %></BIC>
</FinInstnId>
</DbtrAgt>
<ChrgBr>SLEV</ChrgBr>