summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/mycsv2ledger7
-rwxr-xr-xbin/myhledger8
2 files changed, 12 insertions, 3 deletions
diff --git a/bin/mycsv2ledger b/bin/mycsv2ledger
index f59e3e3..56b1ccd 100755
--- a/bin/mycsv2ledger
+++ b/bin/mycsv2ledger
@@ -8,9 +8,14 @@ basename=$(basename "$infile" .csv)
outfile="${2:-$dirname/$basename.ledger}"
rulesfile="$dirname/$basename.rules"
+cat << EOF > "$outfile"
+D 1,000.00 kr
+
+EOF
+
{
find * -wholename "$infile.rules" -execdir cat '{}' +;
find * -wholename "$basename.*.rules" \! -name "$infile.rules" -execdir cat '{}' +;
} > "$rulesfile"
-hledger print --rules-file "$rulesfile" -f "$infile" > "$outfile"
+hledger print --rules-file "$rulesfile" -f "$infile" >> "$outfile"
rm "$rulesfile"
diff --git a/bin/myhledger b/bin/myhledger
index a7d81d6..cf73eef 100755
--- a/bin/myhledger
+++ b/bin/myhledger
@@ -20,12 +20,16 @@ years="${years:-$(find "$basedir" -mindepth 1 -maxdepth 1 -type d -regex '.*/[0-
journal() {
set -e
cd "$basedir"
- cat *.ledger 2> /dev/null || true
for year in $years; do
- cat $year/*.ledger 2> /dev/null || true
+ cat defaults.ledger 2> /dev/null || true
+ cat $year/primo.ledger 2> /dev/null || true
+ cat defaults.ledger 2> /dev/null || true
cat $year/assets/*.ledger 2> /dev/null || true
+ cat defaults.ledger 2> /dev/null || true
cat $year/income/*.ledger 2> /dev/null || true
+ cat defaults.ledger 2> /dev/null || true
cat $year/expenses/*.ledger 2> /dev/null || true
+ cat $year/ultimo.ledger 2> /dev/null || true
done
}