From ecf56eca694d9606ffe56d3cab13a6614efc6aa4 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Tue, 22 Jul 2008 23:27:50 +0000 Subject: 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 --- sql/Pg-database.sql | 1 + sql/modules/Voucher.sql | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'sql') 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'); -- cgit v1.2.3