2019-10-02 21:20:38 +00:00
|
|
|
#! /usr/bin/env node
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const ebics = require('../index');
|
|
|
|
const path = require('path');
|
|
|
|
const fs = require('fs');
|
|
|
|
const os = require('os');
|
|
|
|
|
2019-12-30 09:10:48 +00:00
|
|
|
const config = require('./loadConfig')();
|
|
|
|
const client = require('./getClient')(config);
|
2021-03-26 13:50:20 +00:00
|
|
|
const bankName = client.bankName;
|
2024-09-25 12:51:40 +00:00
|
|
|
const template = fs.readFileSync("./templates/ini_"+client.languageCode+".hbs", { encoding: 'utf8'});
|
2021-03-26 13:50:20 +00:00
|
|
|
const bankLetterFile = path.join("./", "bankLetter_"+client.bankShortName+"_"+client.languageCode+".html");
|
2019-10-02 21:20:38 +00:00
|
|
|
|
2019-12-30 09:10:48 +00:00
|
|
|
const letter = new ebics.BankLetter({ client, bankName, template });
|
|
|
|
|
2019-10-02 21:20:38 +00:00
|
|
|
letter.serialize(bankLetterFile)
|
|
|
|
.then(() => {
|
|
|
|
console.log('Send your bank the letter (%s)', bankLetterFile);
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
console.error(err);
|
|
|
|
process.exit(1);
|
|
|
|
});
|