@@ -229,34 +229,6 @@ create table bank_transactions (date text not null, description text not null, a
229
229
echo $db
230
230
}
231
231
232
- check_bank_csv () {
233
- db=$( bank_sqlite_db " $1 " )
234
- bank_account=" $2 "
235
- problems=$( fresh_file /tmp/ledger.problems)
236
- sqlite3 $db <<< "
237
- create table combined (date text not null, amount real not null);
238
- create table bank_combined (date text not null, amount real not null);
239
- insert into combined select date, sum(cast(amount as real)) from transactions where account = '$bank_account' group by date;
240
- insert into bank_combined select date, sum(cast(amount as real)) from bank_transactions group by date;
241
- .mode csv
242
- .output $problems
243
- .headers on
244
- select Date, Expected, Actual from (
245
- select
246
- b.date as Date,
247
- b.amount as Expected,
248
- case t.amount when null then 0 else t.amount end as Actual
249
- from bank_combined b left outer join combined t on b.date = t.date
250
- where abs(b.amount - t.amount) > .01 or t.date is null
251
- );
252
- "
253
- if [[ -s $problems ]]
254
- then
255
- echo Potential problems with $bank_account
256
- cat $problems | column -t -s,
257
- fi
258
- }
259
-
260
232
import_bank_csv () {
261
233
bank_transactions=$( fresh_file /tmp/bank.csv)
262
234
bank_account=" $2 "
@@ -340,7 +312,6 @@ usage() {
340
312
echo " payees Report list of payees"
341
313
echo " db <accounts> Open SQLite database of transactions"
342
314
echo " import <file> Import bank transactions from csv file"
343
- echo " check <file> Validate bank transactions from csv file are recorded correctly"
344
315
echo " Options"
345
316
echo " --flat Flatten account tree in bal report"
346
317
echo " --depth <num> Limit depth of account tree in bal report"
@@ -415,7 +386,6 @@ case "$report" in
415
386
bankdb) sqlite3 $( bank_sqlite_db " $format " ) ;;
416
387
import) import_bank_csv " $format " " $accounts " $( last_account_date " $accounts " ) ;;
417
388
importall) import_bank_csv " $format " " $accounts " 0 ;;
418
- check) check_bank_csv " $format " " $accounts " ;;
419
389
accounts) accounts_report ;;
420
390
payees) payees_report ;;
421
391
bankcsv) preprocess_" $format " _csv $( last_account_date " $accounts " ) ;;
0 commit comments