https://github.com/hoodie/bill-rs
💸 Tiny little billing library.
https://github.com/hoodie/bill-rs
Last synced: 4 months ago
JSON representation
💸 Tiny little billing library.
- Host: GitHub
- URL: https://github.com/hoodie/bill-rs
- Owner: hoodie
- License: other
- Created: 2016-09-11T11:01:15.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-05-05T10:57:14.000Z (about 1 year ago)
- Last Synced: 2024-12-27T17:39:18.019Z (5 months ago)
- Language: Rust
- Homepage:
- Size: 38.1 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 💸 Bill
[](https://github.com/hoodie/bill-rs/actions?query=workflow%3A"Continuous+Integration")
[](https://crates.io/crates/bill)
[](https://github.com/hoodie/bill-rs/graphs/contributors)
[](https://crates.io/crates/bill/)
[](https://docs.rs/bill/)
[](https://crates.io/crates/bill/)Tiny little billing library.
## Example
```bash
cargo run --example catalogue
``````
offer:
0%
* 2x Service 8,00€ 16,00€
0.19%
* 8x Water 0,61€ 4,88€
* 4x AppleJuice 1,64€ 6,56€
* 4x OrangeJuice 1,86€ 7,44€
* 40x Sandwich 3,40€ 136,00€
---------------------------------------
170,88€
+ 29,43€ (tax)
net 200,31€...
```### With serialization
```bash
cargo run --example catalogue --features serialization
``````json
{"items_by_tax":{
"0": {
"items":[
{"amount":2.0,"product":{"name":"Service","price":8.0,"tax":"0"}}
]
},
"0.19":{
"items": [
{"amount":8.0,"product":{"name":"Water","price":0.61,"tax":"0.19"}},
{"amount":4.0,"product":{"name":"AppleJuice","price":1.64,"tax":"0.19"}},
{"amount":4.0,"product":{"name":"OrangeJuice","price":1.86,"tax":"0.19"}},{"amount":40.0,"product":{"name":"Sandwich","price":3.4,"tax":"0.19"}}
]
}
}}
```