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) 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 def self.qi_table_order
{ {

View File

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