| Crates.io | vat_ph |
| lib.rs | vat_ph |
| version | 0.1.0 |
| created_at | 2025-06-20 18:07:42.406029+00 |
| updated_at | 2025-06-20 18:07:42.406029+00 |
| description | A library for calculating VAT in the Philippines. |
| homepage | |
| repository | https://github.com/Sheape/vat_ph |
| max_upload_size | |
| id | 1719966 |
| size | 32,976 |
vat_ph is a library for computing Value Added Tax (VAT) in the Philippines.
The computed VAT follows the guidelines set by the Bureau of Internal Revenue (BIR) under Republic Act 12023.
The computation uses rust_decimal crate to ensure precise
financial calculations.
Using compute_vat(), you can compute the VAT given net, gross, or VAT. The result will be a struct containing all of
the three mentioned.
use rust_decimal::dec;
use vat_ph::compute_vat;
use vat_ph::VatInput;
let result = compute_vat(VatInput::Net(dec!(1000.0)), None);
assert!(result.is_ok());
let vat = result.unwrap();
assert_eq!(vat.net, dec!(1000.0));
assert_eq!(vat.vat, dec!(120.0));
assert_eq!(vat.gross, dec!(1120.0));
In order to contribute to this project, you can follow these steps:
1.86.0.cargo build.cargo test.