[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[5711] branches/1.3
- Subject: SF.net SVN: ledger-smb:[5711] branches/1.3
- From: ..hidden..
- Date: Sun, 07 Apr 2013 16:14:45 +0000
Revision: 5711
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5711&view=rev
Author: ehuelsmann
Date: 2013-04-07 16:14:44 +0000 (Sun, 07 Apr 2013)
Log Message:
-----------
Merge r5710 from trunk: reconciliation heuristics fix.
Revision Links:
--------------
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5710&view=rev
Modified Paths:
--------------
branches/1.3/sql/modules/Reconciliation.sql
Property Changed:
----------------
branches/1.3/
Property changes on: branches/1.3
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk:3711-3712,5424,5446-5448,5451,5457,5459,5461,5466,5473,5475,5482-5483,5485,5487,5489,5495-5496,5515,5519,5524,5526,5528-5529,5533,5544-5546,5548-5549,5554-5555,5563,5565,5569,5576,5579,5589-5590,5597,5602-5603,5608,5610,5615,5617,5620,5622,5633-5634,5649-5650,5655-5657,5668,5670,5675,5677,5680-5682,5684,5687-5688,5690,5694,5696,5698,5700,5702,5704
+ /trunk:3711-3712,5424,5446-5448,5451,5457,5459,5461,5466,5473,5475,5482-5483,5485,5487,5489,5495-5496,5515,5519,5524,5526,5528-5529,5533,5544-5546,5548-5549,5554-5555,5563,5565,5569,5576,5579,5589-5590,5597,5602-5603,5608,5610,5615,5617,5620,5622,5633-5634,5649-5650,5655-5657,5668,5670,5675,5677,5680-5682,5684,5687-5688,5690,5694,5696,5698,5700,5702,5704,5710
Modified: branches/1.3/sql/modules/Reconciliation.sql
===================================================================
--- branches/1.3/sql/modules/Reconciliation.sql 2013-04-07 16:10:43 UTC (rev 5710)
+++ branches/1.3/sql/modules/Reconciliation.sql 2013-04-07 16:14:44 UTC (rev 5711)
@@ -253,7 +253,7 @@
IF t_scn IS NOT NULL THEN
SELECT count(*) INTO in_count FROM cr_report_line
WHERE scn ilike t_scn AND report_id = in_report_id
- AND their_balance = 0;
+ AND their_balance = 0 AND post_date = in_date;
IF in_count = 0 THEN
INSERT INTO cr_report_line
@@ -267,15 +267,18 @@
SET their_balance = t_amount, clear_time = in_date,
cleared = true
WHERE t_scn = scn AND report_id = in_report_id
- AND their_balance = 0;
+ AND their_balance = 0 AND post_date = in_date;
ELSE
SELECT count(*) INTO in_count FROM cr_report_line
WHERE t_scn ilike scn AND report_id = in_report_id
- AND our_value = t_amount and their_balance = 0;
+ AND our_value = t_amount and their_balance = 0
+ AND post_date = in_date;
IF in_count = 0 THEN -- no match among many of values
SELECT id INTO lid FROM cr_report_line
- WHERE t_scn ilike scn AND report_id = in_report_id
+ WHERE t_scn ilike scn
+ AND report_id = in_report_id
+ AND post_date = in_date
ORDER BY our_balance ASC limit 1;
UPDATE cr_report_line
@@ -293,11 +296,13 @@
cleared = true
WHERE t_scn = scn AND report_id = in_report_id
AND our_value = t_amount
- AND their_balance = 0;
+ AND their_balance = 0
+ AND post_date = in_date;
ELSE -- More than one match
SELECT id INTO lid FROM cr_report_line
WHERE t_scn ilike scn AND report_id = in_report_id
AND our_value = t_amount
+ AND post_date = in_date
ORDER BY id ASC limit 1;
UPDATE cr_report_line
@@ -312,7 +317,7 @@
ELSE -- scn IS NULL, check on amount instead
SELECT count(*) INTO in_count FROM cr_report_line
WHERE report_id = in_report_id AND our_balance = t_amount
- AND their_balance = 0 and post_date = in_date
+ AND their_balance = 0 AND post_date = in_date
and scn NOT LIKE t_prefix || '%';
IF in_count = 0 THEN -- no match
@@ -327,13 +332,15 @@
trans_type = in_type,
clear_time = in_date,
cleared = true
- WHERE report_id = in_report_id AND our_balance = t_amount
- AND their_balance = 0 and
+ WHERE report_id = in_report_id
+ AND our_balance = t_amount
+ AND their_balance = 0
+ AND post_date = in_date
in_scn NOT LIKE t_prefix || '%';
ELSE -- more than one match
SELECT min(id) INTO lid FROM cr_report_line
WHERE report_id = in_report_id AND our_balance = t_amount
- AND their_balance = 0 and post_date = in_date
+ AND their_balance = 0 AND post_date = in_date
AND scn NOT LIKE t_prefix || '%'
LIMIT 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.