From 17f9a5b0aad5203072355f5b55957d3c12edffdb Mon Sep 17 00:00:00 2001 From: einhverfr Date: Wed, 14 May 2008 16:19:52 +0000 Subject: Renaming fix for 1.2.14 git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@2142 4979c152-3d1c-0410-bac9-87ea11338e46 --- sql/fixes/amount_blank_ap_transactions.sql | 32 ------------------------------ sql/fixes/ar_ap_summary_fix_1.2.14.sql | 32 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 sql/fixes/amount_blank_ap_transactions.sql create mode 100644 sql/fixes/ar_ap_summary_fix_1.2.14.sql diff --git a/sql/fixes/amount_blank_ap_transactions.sql b/sql/fixes/amount_blank_ap_transactions.sql deleted file mode 100644 index f4a86bee..00000000 --- a/sql/fixes/amount_blank_ap_transactions.sql +++ /dev/null @@ -1,32 +0,0 @@ -BEGIN; - -UPDATE ap -SET netamount = - (select sum(amount) from acc_trans - where trans_id = ap.id - AND ((chart_id IN (select id from chart where link = 'AP') - AND amount > 0) - OR (chart_id IN - (select id from chart where link like '%tax%') - ) - ) - ) -WHERE netamount IS NULL; - -update ap set datepaid = NULL where paid = 0; - -UPDATE ar -SET netamount = -1 * - (select sum(amount) from acc_trans - where trans_id = ar.id - AND ((chart_id IN (select id from chart where link = 'AR') - AND amount < 0) - OR (chart_id IN - (select id from chart where link like '%tax%') - ) - ) - ) -WHERE netamount IS NULL; - -update ar set datepaid = NULL where paid = 0; -commit; diff --git a/sql/fixes/ar_ap_summary_fix_1.2.14.sql b/sql/fixes/ar_ap_summary_fix_1.2.14.sql new file mode 100644 index 00000000..f4a86bee --- /dev/null +++ b/sql/fixes/ar_ap_summary_fix_1.2.14.sql @@ -0,0 +1,32 @@ +BEGIN; + +UPDATE ap +SET netamount = + (select sum(amount) from acc_trans + where trans_id = ap.id + AND ((chart_id IN (select id from chart where link = 'AP') + AND amount > 0) + OR (chart_id IN + (select id from chart where link like '%tax%') + ) + ) + ) +WHERE netamount IS NULL; + +update ap set datepaid = NULL where paid = 0; + +UPDATE ar +SET netamount = -1 * + (select sum(amount) from acc_trans + where trans_id = ar.id + AND ((chart_id IN (select id from chart where link = 'AR') + AND amount < 0) + OR (chart_id IN + (select id from chart where link like '%tax%') + ) + ) + ) +WHERE netamount IS NULL; + +update ar set datepaid = NULL where paid = 0; +commit; -- cgit v1.2.3