summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-07-22 23:27:50 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-07-22 23:27:50 +0000
commitecf56eca694d9606ffe56d3cab13a6614efc6aa4 (patch)
tree84fc7c9a763a97ef1c633a885b80456fc93559a0 /sql
parent12a0239ccda7e2bd68cae034e916c6a664c3c430 (diff)
Added format option to LedgerSMB::format_amount
Added batch information options for check template Added batch default_date field Corrected issues with payment batches not preserving post dates when adding vouchers to existing batch. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2219 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql')
-rw-r--r--sql/Pg-database.sql1
-rw-r--r--sql/modules/Voucher.sql9
2 files changed, 7 insertions, 3 deletions
diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql
index b0b42f8f..e1d8251e 100644
--- a/sql/Pg-database.sql
+++ b/sql/Pg-database.sql
@@ -391,6 +391,7 @@ CREATE TABLE batch (
batch_class_id integer references batch_class(id) not null,
control_code text,
description text,
+ default_date date not null,
approved_on date default null,
approved_by int references entity_employee(entity_id),
created_by int references entity_employee(entity_id),
diff --git a/sql/modules/Voucher.sql b/sql/modules/Voucher.sql
index f4a30595..6ae6a5e2 100644
--- a/sql/modules/Voucher.sql
+++ b/sql/modules/Voucher.sql
@@ -310,13 +310,16 @@ END;
$$ LANGUAGE PLPGSQL;
CREATE OR REPLACE FUNCTION batch_create(
-in_batch_number text, in_description text, in_batch_class text) RETURNS int AS
+in_batch_number text, in_description text, in_batch_class text,
+in_batch_date date)
+RETURNS int AS
$$
BEGIN
INSERT INTO
- batch (batch_class_id, description, control_code, created_by)
+ batch (batch_class_id, default_date, description, control_code,
+ created_by)
VALUES ((SELECT id FROM batch_class WHERE class = in_batch_class),
- in_description, in_batch_number,
+ in_batch_date, in_description, in_batch_number,
(select entity_id FROM users WHERE username = session_user));
return currval('batch_id_seq');