[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[2714] trunk
- Subject: SF.net SVN: ledger-smb:[2714] trunk
- From: ..hidden..
- Date: Wed, 08 Jul 2009 04:37:48 +0000
Revision: 2714
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2714&view=rev
Author: einhverfr
Date: 2009-07-08 04:37:48 +0000 (Wed, 08 Jul 2009)
Log Message:
-----------
Reverting bad commit on Company.sql
Modified Paths:
--------------
trunk/LedgerSMB/ScriptLib/Company.pm
trunk/sql/modules/Company.sql
Modified: trunk/LedgerSMB/ScriptLib/Company.pm
===================================================================
--- trunk/LedgerSMB/ScriptLib/Company.pm 2009-07-07 19:18:20 UTC (rev 2713)
+++ trunk/LedgerSMB/ScriptLib/Company.pm 2009-07-08 04:37:48 UTC (rev 2714)
@@ -349,6 +349,7 @@
my ($request) = @_;
my $company = new_company($request);
+ $company->{country_id} ||= $company->{entity_country_id};
$company->save();
_render_main_screen($company);
}
Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql 2009-07-07 19:18:20 UTC (rev 2713)
+++ trunk/sql/modules/Company.sql 2009-07-08 04:37:48 UTC (rev 2714)
@@ -327,7 +327,7 @@
CREATE OR REPLACE FUNCTION company_save (
in_id int, in_control_code text, in_entity_class int,
in_name text, in_tax_id TEXT,
- in_entity_id int, in_sic_code text
+ in_entity_id int, in_sic_code text,in_country_id_t int
) RETURNS INT AS $$
DECLARE t_entity_id INT;
t_company_id INT;
@@ -355,8 +355,8 @@
t_entity_id := in_entity_id;
END IF;
IF t_entity_id IS NULL THEN
- INSERT INTO entity (name, entity_class, control_code)
- VALUES (in_name, in_entity_class, t_control_code);
+ INSERT INTO entity (name, entity_class, control_code,country_id)
+ VALUES (in_name, in_entity_class, t_control_code,in_country_id_t);
t_entity_id := currval('entity_id_seq');
END IF;
END IF;
@@ -364,7 +364,8 @@
UPDATE entity
SET name = in_name,
entity_class = in_entity_class,
- control_code = t_control_code
+ control_code = t_control_code,
+ country_id = in_country_id_t
WHERE id = t_entity_id;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.