0.0.17 • Published 7 years ago
efonelfo v0.0.17
EfoNelfo
JavaScript library for parsing and writing EfoNelfo v4.0 documents.
- Supported formats:
- CSV
- Supported types:
- BH/BL Varebestilling
- VH/VL Vareformat
- RH/RL Rabatt
- Official documentation: http://www.efo.no/wp-content/uploads/2017/04/EFONELFO40-PDF.zip
Installation
npm install efonelfo
Examples
Parse CSV file
import {parseCSVFile} from 'efonelfo'
const [bh] = await parseCSVFile('B42.123.csv')
console.log(bh.KundeNr)
Parse CSV string
import {parseCSV} from 'efonelfo'
const csv ='BH;EFONELFO;4.0;;NO950349875MVA;2091;28579;;;19271;;19271;;;;;;;2091/19271;;;;20100602;;;;;;;;;;;;;;;;;;;;;;;;;;'
const [bh] = await parseCSV(csv)
Working with objects
import {PostTypes, toCSV} from 'efonelfo'
const {BH, BL} = PostTypes
const bh = BH({
KjøpersId: '11233',
BestNr: '231444',
LevDato: new Date('2012-06-21')
})
bh.EksternRef = 'my reference'
bh.push({PostType: 'BL', LinjeNr: '1', Ant: 3, PrisEnhet: 'EA', DelLev: true})
bh.push(BL({LinjeNr: '2', Ant: 10, VareNr: '12345'}))
// Generate CSV
console.log(toCSV(bh))
/* Result:
BH;EFONELFO;4.0;;11233;231444;;;;;;;;;;;my reference;;;;;;20120621;;;;;;;;;;;;;;;;;;;;;;;;;;
BL;1;;;;;;300;EA;;;;J;J
BL;2;;;12345;;;1000;;;;;J;J
*/
0.0.17
7 years ago
0.0.16
7 years ago
0.0.15
7 years ago
0.0.14
8 years ago
0.0.13
8 years ago
0.0.12
8 years ago
0.0.11
8 years ago
0.0.10
8 years ago
0.0.9
8 years ago
0.0.8-beta.5
8 years ago
0.0.8-beta.4
8 years ago
0.0.8-beta.3
8 years ago
0.0.8-beta.2
8 years ago
0.0.8-beta
8 years ago
0.0.7
8 years ago
0.0.6
8 years ago
0.0.5
8 years ago
0.0.4
8 years ago
0.0.3
8 years ago
0.0.2
8 years ago
0.0.1
8 years ago