7b345b8795
The prompts used to arrive at this change since the previous commit User reported the Dynamisch kwartaal Roundcube filter is empty and asked for a new file containing a dynamic invoice-quarter filter while keeping the rest of the plan approved. Any special observations that may be relevant for version management for this version. Be brief. invoice_dynamic_quarter.sieve uses Date header year capture plus regex month tests and compiles with sievec. Existing untracked financ.sieve, codex.session, roundcube.txt, plan.md, and verplaats_log.json were left untouched.
41 lines
1.1 KiB
Sieve
41 lines
1.1 KiB
Sieve
# invoice_dynamic_quarter.sieve
|
|
# Single Roundcube/Managesieve rule for dynamic invoice quarter routing.
|
|
# Import this as a standalone filter set or copy the rule into an existing set.
|
|
|
|
require ["fileinto", "date", "variables", "regex"];
|
|
|
|
# rule:[Financieel / Facturen / Dynamisch kwartaal]
|
|
if allof (
|
|
header :contains "Subject" [
|
|
"factuur",
|
|
"invoice",
|
|
"rekening",
|
|
"nota",
|
|
"betaalverzoek",
|
|
"receipt",
|
|
"orderbevestiging",
|
|
"order confirmation",
|
|
"betaling ontvangen",
|
|
"payment received",
|
|
"uw factuur",
|
|
"your invoice",
|
|
"je factuur"
|
|
],
|
|
date :matches "Date" "year" "*"
|
|
) {
|
|
set "jaar" "${1}";
|
|
|
|
if date :regex "Date" "month" "^(0?[123])$" {
|
|
set "kwartaal" "Q1";
|
|
} elsif date :regex "Date" "month" "^(0?[456])$" {
|
|
set "kwartaal" "Q2";
|
|
} elsif date :regex "Date" "month" "^(0?[789])$" {
|
|
set "kwartaal" "Q3";
|
|
} else {
|
|
set "kwartaal" "Q4";
|
|
}
|
|
|
|
fileinto "INBOX.Financieel.Facturen.${jaar}.${kwartaal}";
|
|
stop;
|
|
}
|