webd97 / rewe-ebon-parser Goto Github PK
View Code? Open in Web Editor NEWThis library parses REWE eBons into JS objects
Home Page: https://www.npmjs.com/package/rewe-ebon-parser
This library parses REWE eBons into JS objects
Home Page: https://www.npmjs.com/package/rewe-ebon-parser
I found a new format for the payback section on my latest ebon:
Ihre REWE PAYBACK Vorteile heute
PAYBACK Karten-Nr.: #############
Punktestand vor Einkauf: 6.922
Punktestand entspricht: 69,22 EUR
Sie erhalten 14 PAYBACK Punkte auf
einen PAYBACK Umsatz von 29,79 EUR!
Thank you for building this library. I'm using it to automatically parse incoming mails containing eBons into a database, so that we can easily distribute costs via Splitwise.
This anonymized eBon 2020-03-13T19_17_00.000Z.pdf produces the following error:
Error: Something went wrong when parsing the eBon: The eBon states a total sum of 1964.9999999999998 but the parser only found items worth 1965.
My quick workaround was to round the totals to two after-comma digits before comparing them:
if (realTotalInCents.toFixed(2) != totalInCents.toFixed(2)) {
"taxDetails": {
"A": {
"taxPercent": null,
"net": null,
"tax": null,
"gross": null
},
"B": {
"taxPercent": 7,
"net": 8.26,
"tax": 0.58,
"gross": 8.84
},
"total": {
"net": 8.26,
"tax": 0.58,
"gross": 8.84
}
}
The parser lists total earned Payback points and used coupons but it lacks the base points which is total - sum(coupons)
Hi,
the parser seems to have a problem with an ampersand "&" in the product name. I had the item "BUD & TERENCE" on my ebon
What i received back from the parser was " TERENCE" (notice the leading space).
Edit: Had a short look, it probably just needs an adjustment of the regex in line 38
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.