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

SF.net SVN: ledger-smb:[2760] addons/1.3



Revision: 2760
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2760&view=rev
Author:   einhverfr
Date:     2009-08-25 19:31:43 +0000 (Tue, 25 Aug 2009)

Log Message:
-----------
More work on template transactions
A couple fixes to asset entry, including css fixes
:

Modified Paths:
--------------
    addons/1.3/assets/trunk/UI/asset/edit_asset.html
    addons/1.3/templatetrans/trunk/sql/modules/trans-functions.sql
    addons/1.3/templatetrans/trunk/sql/modules/trans-tables.sql

Modified: addons/1.3/assets/trunk/UI/asset/edit_asset.html
===================================================================
--- addons/1.3/assets/trunk/UI/asset/edit_asset.html	2009-08-24 17:40:19 UTC (rev 2759)
+++ addons/1.3/assets/trunk/UI/asset/edit_asset.html	2009-08-25 19:31:43 UTC (rev 2760)
@@ -1,4 +1,4 @@
-<?lsmb INCLUDE 'ui-header.html' ?>
+<?lsmb INCLUDE 'ui-header.html' include_stylesheet = ["UI/asset/asset.css"] ?>
 <?lsmb PROCESS 'elements.html' ?>
 <div class="listtop"><?lsmb title ?></div>
 <form action="<?lsmb script ?>" method="post">
@@ -16,6 +16,7 @@
 	label = text('Tag:')
 	size = 32
 } ?>
+</div>
 <div class="inputrow" id="classrow">
 <?lsmb PROCESS select element_data = {
 	name = "asset_class"
@@ -35,6 +36,7 @@
 	value = description
 	type = "text"
 } ?>
+</div>
 <div class="inputrow" id="purchaserow">
 <span class="inputgroup" id="purchasedategroup">
 <?lsmb PROCESS input element_data = {
@@ -100,6 +102,28 @@
 } ?>
 </span>
 </div>
+<div class="inputrow" id="invoicerow">
+<span class="inputgroup" id="vendorgroup">
+<?lsmb PROCESS input element_data = {
+	label = text('Vendor Number') #'
+	type = "text"
+	class = "identifier"
+	size = 20
+	value = meta_number
+	name = "meta_number"
+} ?>
+</span>
+<span class="inputgroup" id="invgroup">
+<?lsmb PROCESS input element_data = {
+	label = text('Invoice Number') #'
+	type = "text"
+	class = "identifier"
+	size = 20
+	value = invnumber
+	name = "invnumber"
+} ?>
+</span>
+</div>
 <div class="inputrow" id="buttonrow">
 <?lsmb PROCESS button element_data = {
 	text = text("Save")

Modified: addons/1.3/templatetrans/trunk/sql/modules/trans-functions.sql
===================================================================
--- addons/1.3/templatetrans/trunk/sql/modules/trans-functions.sql	2009-08-24 17:40:19 UTC (rev 2759)
+++ addons/1.3/templatetrans/trunk/sql/modules/trans-functions.sql	2009-08-25 19:31:43 UTC (rev 2760)
@@ -42,8 +42,51 @@
 $$ language sql;
 
 CREATE OR REPLACE FUNCTION journal__make_invoice(
-);
+in_order_id int,  in_journal_id int, in_on_hold bool, in_reverse bool,
+in_credit_id int, in_language_id int
+) returns t_invoice AS $$
+DECLARE retval t_invoice;
+BEGIN	
+	INSERT INTO t_invoice (order_id, journal_id, on_hold, reverse
+		credit_id, language_id)
+	VALUES (in_order_id, in_journal_id, coalesce(in_on_hold, false), 
+		in_reverse, in_credit_id, in_language_id);
 
-CREATE OR REPLACE FUNCTION journal__list_templates(
-);
+	SELECT * INTO retval FROM t_invoice WHERE journal_id = in_journal_id;
+
+	RETURN retval;
+END;
+$$ language plpgsql;
+
+CREATE OR REPLACE FUNCTION journal__search(
+in_source text,
+in_description text,
+in_entry_type int,
+in_transaction_date,
+in_approved bool,
+in_department_id int, 
+in_is_template bool,
+in_meta_number text,
+in_entity_class int	
+) RETURNS SETOF journal_search_result AS $$
+$$ 
+DECLARE retval journal;
+BEGIN
+END;
+$$ language plpgsql;
+
+CREATE OR REPLACE FUNCTION journal__get_invoice(in_id) RETURNS t_invoice AS
+$$
+SELECT * FROM t_invoice where journal_id = $1;
+$$ language sql;
+
+CREATE OR REPLACE FUNCTION journal__get_entry(in_id) RETURNS journal AS
+$$
+SELECT * FROM journal where id = $1;
+$$ laguage sql;
+
+CREATE OR REPLACE FUNCTION journal__lines(in_id) RETURNS SETOF journal_line AS
+$$
+select * from journal_line where journal_id = $1;
+$$ language sql;
 -- orders with inventory not supported yet.

Modified: addons/1.3/templatetrans/trunk/sql/modules/trans-tables.sql
===================================================================
--- addons/1.3/templatetrans/trunk/sql/modules/trans-tables.sql	2009-08-24 17:40:19 UTC (rev 2759)
+++ addons/1.3/templatetrans/trunk/sql/modules/trans-tables.sql	2009-08-25 19:31:43 UTC (rev 2760)
@@ -65,13 +65,13 @@
 order_number text not null
 );
 
-create table invoice ( -- journal.source would hold the invoice number
+create table t_invoice ( -- journal.source would hold the invoice number
 order_id int references orders(id),  -- in the case of what we
-currently do as AR/AP transactions, this would be null
+-- currently do as AR/AP transactions, this would be null
 journal_id int references journal(id),
 on_hold bool default false,
 reverse bool default false,
-credit_account int references entity_credit_account(id) not null,
+credit_id int references entity_credit_account(id) not null,
 language_id int references language(id),
 PRIMARY KEY  (journal_id)
 );


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