Invoices: alanyi adómentes (AAM) by default
INVOICE_VAT picks the VAT of the invoices: AAM (no VAT, net = gross, the invoice says so) or a rate like 27% once the exemption limit is passed. The packages page tells which. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -48,6 +48,8 @@ pub struct Config {
|
||||
/// Stripe Checkout, when `STRIPE_SECRET_KEY` is set (it wins over
|
||||
/// `MOCK_PAYMENTS`).
|
||||
pub stripe: Option<StripeConfig>,
|
||||
/// `INVOICE_VAT` (default `AAM`, alanyi adómentes; or e.g. `27%`).
|
||||
pub invoice_vat: crate::invoices::Vat,
|
||||
/// `BILLINGO_API_KEY`: downloading invoices (the worker issues them).
|
||||
pub billingo_api_key: Option<String>,
|
||||
/// `BILLINGO_API_URL` (default `https://api.billingo.hu/v3`).
|
||||
@@ -174,6 +176,11 @@ impl Config {
|
||||
.trim_end_matches('/')
|
||||
.to_string(),
|
||||
}),
|
||||
invoice_vat: match var("INVOICE_VAT") {
|
||||
None => crate::invoices::Vat::Exempt,
|
||||
Some(raw) => crate::invoices::Vat::parse(&raw)
|
||||
.with_context(|| format!("invalid INVOICE_VAT '{raw}': use AAM or a rate like 27%"))?,
|
||||
},
|
||||
billingo_api_key: var("BILLINGO_API_KEY"),
|
||||
billingo_api_url: var("BILLINGO_API_URL")
|
||||
.unwrap_or_else(|| "https://api.billingo.hu/v3".into())
|
||||
@@ -220,6 +227,7 @@ impl Config {
|
||||
password_login: true,
|
||||
mock_payments: true,
|
||||
stripe: None,
|
||||
invoice_vat: crate::invoices::Vat::Exempt,
|
||||
billingo_api_key: Some("billingo-fake".into()),
|
||||
billingo_api_url: format!("{horoscope_api_url}/billingo"),
|
||||
purchases_open: true,
|
||||
|
||||
Reference in New Issue
Block a user