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

SF.net SVN: ledger-smb:[2709] trunk



Revision: 2709
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2709&view=rev
Author:   einhverfr
Date:     2009-06-29 02:18:24 +0000 (Mon, 29 Jun 2009)

Log Message:
-----------
Added 'save new location' button

Modified Paths:
--------------
    trunk/LedgerSMB/IR.pm
    trunk/LedgerSMB/ScriptLib/Company.pm
    trunk/UI/Contact/contact.html

Modified: trunk/LedgerSMB/IR.pm
===================================================================
--- trunk/LedgerSMB/IR.pm	2009-06-27 02:48:40 UTC (rev 2708)
+++ trunk/LedgerSMB/IR.pm	2009-06-29 02:18:24 UTC (rev 2709)
@@ -1036,31 +1036,31 @@
 
         # get default accounts and last invoice number
         $query = qq|
-			SELECT (select c.accno FROM chart c 
+			SELECT (select c.accno FROM account c 
 			         WHERE c.id = (SELECT value::int FROM defaults 
 			                        WHERE setting_key = 
 			                              'inventory_accno_id'))
 			       AS inventory_accno,
 
-			       (SELECT c.accno FROM chart c
+			       (SELECT c.accno FROM account c
 				 WHERE c.id = (SELECT value::int FROM defaults
 			                        WHERE setting_key =
 			                              'income_accno_id'))
 			       AS income_accno,
 
-			       (SELECT c.accno FROM chart c
+			       (SELECT c.accno FROM account c
 			         WHERE c.id = (SELECT value::int FROM defaults
 			                        WHERE setting_key =
 			                              'expense_accno_id'))
 			       AS expense_accno,
 
-			       (SELECT c.accno FROM chart c
+			       (SELECT c.accno FROM account c
 			         WHERE c.id = (SELECT value::int FROM defaults
 			                        WHERE setting_key =
 			                              'fxgain_accno_id'))
 			       AS fxgain_accno,
 
-			       (SELECT c.accno FROM chart c
+			       (SELECT c.accno FROM account c
 			         WHERE c.id = (SELECT value::int FROM defaults
 			                        WHERE setting_key =
 			                              'fxloss_accno_id'))
@@ -1070,31 +1070,31 @@
     }
     else {
         $query = qq|
-			SELECT (select c.accno FROM chart c 
+			SELECT (select c.accno FROM account c 
 			         WHERE c.id = (SELECT value::int FROM defaults 
 			                        WHERE setting_key = 
 			                              'inventory_accno_id'))
 			       AS inventory_accno,
 
-			       (SELECT c.accno FROM chart c
+			       (SELECT c.accno FROM account c
 				 WHERE c.id = (SELECT value::int FROM defaults
 			                        WHERE setting_key =
 			                              'income_accno_id'))
 			       AS income_accno,
 
-			       (SELECT c.accno FROM chart c
+			       (SELECT c.accno FROM account c
 			         WHERE c.id = (SELECT value::int FROM defaults
 			                        WHERE setting_key =
 			                              'expense_accno_id'))
 			       AS expense_accno,
 
-			       (SELECT c.accno FROM chart c
+			       (SELECT c.accno FROM account c
 			         WHERE c.id = (SELECT value::int FROM defaults
 			                        WHERE setting_key =
 			                              'fxgain_accno_id'))
 			       AS fxgain_accno,
 
-			       (SELECT c.accno FROM chart c
+			       (SELECT c.accno FROM account c
 			         WHERE c.id = (SELECT value::int FROM defaults
 			                        WHERE setting_key =
 			                              'fxloss_accno_id'))

Modified: trunk/LedgerSMB/ScriptLib/Company.pm
===================================================================
--- trunk/LedgerSMB/ScriptLib/Company.pm	2009-06-27 02:48:40 UTC (rev 2708)
+++ trunk/LedgerSMB/ScriptLib/Company.pm	2009-06-29 02:18:24 UTC (rev 2709)
@@ -123,6 +123,25 @@
 
 =over
 
+=item save_new_location 
+
+Adds a location to the company as defined in the inherited object, not
+overwriting existing locations.
+
+=back
+
+=cut
+
+sub save_new_location {
+    my ($request) = @_;
+    delete $requet->{location_id};
+   add_location($request);
+}
+
+=pod
+
+=over
+
 =item generate_control_code 
 
 Sets $company->{control_code} equal to the next in the series of entity_control 

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2009-06-27 02:48:40 UTC (rev 2708)
+++ trunk/UI/Contact/contact.html	2009-06-29 02:18:24 UTC (rev 2709)
@@ -664,13 +664,21 @@
 			label = text('Country:') 
 		} ?>
 	</div>
-	<div><?lsmb PROCESS button element_data = {
+	<div>
+             <?lsmb PROCESS button element_data = {
 		class = "submit" 
 		name = "action" 
 		value = "add_location" 
 		id = "loc_save_location"
 		text = text('Save Location') 
 	} #' ?>
+             <?lsmb PROCESS button element_data = {
+		class = "submit" 
+		name = "action" 
+		value = "save_new_location" 
+		id = "loc_save_new_location"
+		text = text('Save New Location') 
+	} #' ?>
 	</div>
     </form>
 </div>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.