[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5992] branches/1.3/sql



Revision: 5992
          http://sourceforge.net/p/ledger-smb/code/5992
Author:   pongracz
Date:     2013-08-30 08:37:24 +0000 (Fri, 30 Aug 2013)
Log Message:
-----------
Database changes: adding new date field to the tables: ap and ar. This is the crdate, which contains the creation date of the invoice/transaction. See the comment on the fields: ar.crdate and ap.crdate. This does not effect any financial/ledger data. Crdate will be set to transdate for all existing records.

Modified Paths:
--------------
    branches/1.3/sql/Pg-database.sql
    branches/1.3/sql/modules/Fixes.sql

Property Changed:
----------------
    branches/1.3/sql/Pg-database.sql
    branches/1.3/sql/modules/Fixes.sql

Modified: branches/1.3/sql/Pg-database.sql
===================================================================
--- branches/1.3/sql/Pg-database.sql	2013-08-30 04:08:59 UTC (rev 5991)
+++ branches/1.3/sql/Pg-database.sql	2013-08-30 08:37:24 UTC (rev 5992)
@@ -1292,7 +1292,8 @@
   entity_credit_account int references entity_credit_account(id) not null,
   force_closed bool,
   description text,
-  unique(invnumber) -- probably a good idea as per Erik's request --CT
+  unique(invnumber), -- probably a good idea as per Erik's request --CT
+  crdate date
 );
 
 COMMENT ON TABLE ar IS
@@ -1345,6 +1346,14 @@
 $$ Not exposed to the UI, but can be set to prevent an invoice from showing up
 for payment or in outstanding reports.$$;
 
+COMMENT ON COLUMN ar.crdate IS
+$$ This is for recording the AR/AP creation date, which is always that date, when the invoice created. This is different, than transdate or duedate.
+This kind of date does not effect on ledger/financial data, but for administrative purposes in Hungary, probably in other countries, too.
+Use case: 
+if somebody pay in cash, crdate=transdate=duedate
+if somebody will receive goods T+5 days and have 15 days term, the dates are the following:  crdate: now,  transdate=crdate+5,  duedate=transdate+15.
+There are rules in Hungary, how to fill out a correct invoice, where the crdate and transdate should be important.$$;
+
 --
 CREATE TABLE ap (
   id int DEFAULT nextval ( 'id' ) PRIMARY KEY REFERENCES transactions(id),
@@ -1377,7 +1386,8 @@
   terms int2 DEFAULT 0,
   description text,
   force_closed bool,
-  entity_credit_account int references entity_credit_account(id) NOT NULL
+  entity_credit_account int references entity_credit_account(id) NOT NULL,
+  crdate date
 );
 
 COMMENT ON TABLE ap IS
@@ -1430,6 +1440,14 @@
 $$ Not exposed to the UI, but can be set to prevent an invoice from showing up
 for payment or in outstanding reports.$$;
 
+COMMENT ON COLUMN ap.crdate IS
+$$ This is for recording the AR/AP creation date, which is always that date, when the invoice created. This is different, than transdate or duedate.
+This kind of date does not effect on ledger/financial data, but for administrative purposes in Hungary, probably in other countries, too.
+Use case: 
+if somebody pay in cash, crdate=transdate=duedate
+if somebody will receive goods T+5 days and have 15 days term, the dates are the following:  crdate: now,  transdate=crdate+5,  duedate=transdate+15.
+There are rules in Hungary, how to fill out a correct invoice, where the crdate and transdate should be important.$$;
+
 --
 CREATE TABLE taxmodule (
   taxmodule_id serial PRIMARY KEY,


Property changes on: branches/1.3/sql/Pg-database.sql
___________________________________________________________________
Added: svn:text-time
## -0,0 +1 ##
+2013-08-30T07:22:10.000000Z
\ No newline at end of property
Added: svn:unix-mode
## -0,0 +1 ##
+0770
\ No newline at end of property
Added: svn:owner
## -0,0 +1 ##
+33 www-data
\ No newline at end of property
Added: svn:group
## -0,0 +1 ##
+33 www-data
\ No newline at end of property
Modified: branches/1.3/sql/modules/Fixes.sql
===================================================================
--- branches/1.3/sql/modules/Fixes.sql	2013-08-30 04:08:59 UTC (rev 5991)
+++ branches/1.3/sql/modules/Fixes.sql	2013-08-30 08:37:24 UTC (rev 5992)
@@ -529,3 +529,33 @@
 ALTER FUNCTION user__change_password(text) SET datestyle = 'ISO,YMD';
 COMMIT;
 
+BEGIN;
+ALTER TABLE ar DISABLE TRIGGER ALL;
+ALTER TABLE ap DISABLE TRIGGER ALL;
+
+ALTER TABLE ap ADD COLUMN crdate date;
+ALTER TABLE ar ADD COLUMN crdate date;
+
+UPDATE ap SET crdate=transdate;
+UPDATE ar SET crdate=transdate;
+
+COMMENT ON COLUMN ap.crdate IS
+$$ This is for recording the AR/AP creation date, which is always that date, when the invoice created. This is different, than transdate or duedate.
+This kind of date does not effect on ledger/financial data, but for administrative purposes in Hungary, probably in other countries, too.
+Use case:
+if somebody pay in cash, crdate=transdate=duedate
+if somebody will receive goods T+5 days and have 15 days term, the dates are the following:  crdate: now,  transdate=crdate+5,  duedate=transdate+15.
+There are rules in Hungary, how to fill out a correct invoice, where the crdate and transdate should be important.$$;
+
+COMMENT ON COLUMN ar.crdate IS
+$$ This is for recording the AR/AP creation date, which is always that date, when the invoice created. This is different, than transdate or duedate.
+This kind of date does not effect on ledger/financial data, but for administrative purposes in Hungary, probably in other countries, too.
+Use case:
+if somebody pay in cash, crdate=transdate=duedate
+if somebody will receive goods T+5 days and have 15 days term, the dates are the following:  crdate: now,  transdate=crdate+5,  duedate=transdate+15.
+There are rules in Hungary, how to fill out a correct invoice, where the crdate and transdate should be important.$$;
+
+ALTER TABLE ar ENABLE TRIGGER ALL;
+ALTER TABLE ap ENABLE TRIGGER ALL;
+
+COMMIT;


Property changes on: branches/1.3/sql/modules/Fixes.sql
___________________________________________________________________
Added: svn:text-time
## -0,0 +1 ##
+2013-08-30T08:17:55.000000Z
\ No newline at end of property
Added: svn:unix-mode
## -0,0 +1 ##
+0770
\ No newline at end of property
Added: svn:owner
## -0,0 +1 ##
+33 www-data
\ No newline at end of property
Added: svn:group
## -0,0 +1 ##
+33 www-data
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits