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

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



Revision: 2577
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2577&view=rev
Author:   einhverfr
Date:     2009-04-28 04:31:29 +0000 (Tue, 28 Apr 2009)

Log Message:
-----------
Payment types in trunk.

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Payment.pm
    trunk/UI/payments/payments_filter.html
    trunk/sql/modules/Payment.sql

Modified: trunk/LedgerSMB/DBObject/Payment.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Payment.pm	2009-04-28 00:36:19 UTC (rev 2576)
+++ trunk/LedgerSMB/DBObject/Payment.pm	2009-04-28 04:31:29 UTC (rev 2577)
@@ -83,6 +83,12 @@
     @{$self->{businesses}} = $self->exec_method(
 		funcname => 'business_type__list'
     );
+
+   @{$self->{payment_types}} = $self->exec_method(
+		funcname => 'payment_type__list'
+    );
+
+
     @{$self->{debt_accounts}} = $self->exec_method(
 		funcname => 'chart_get_ar_ap');
     @{$self->{cash_accounts}} = $self->exec_method(
@@ -457,6 +463,7 @@
    
     @{$self->{contact_invoices}} = $self->exec_method(
 		funcname => 'payment_get_all_contact_invoices');
+
     for my $inv (@{$self->{contact_invoices}}) {
         if (($self->{action} ne 'update_payments') or 
 		(defined $self->{"id_$inv->{contact_id}"})

Modified: trunk/UI/payments/payments_filter.html
===================================================================
--- trunk/UI/payments/payments_filter.html	2009-04-28 00:36:19 UTC (rev 2576)
+++ trunk/UI/payments/payments_filter.html	2009-04-28 04:31:29 UTC (rev 2577)
@@ -120,7 +120,8 @@
 </div>
 </div>
 <div class="listtop"><?lsmb text('Payment Processing') ?></div>
-	<?lsmb INCLUDE select element_data = {
+	
+      <?lsmb INCLUDE select element_data = {
 		name = "cash_accno"
 		default_values = [cash_accno]
 		options = cash_accounts
@@ -128,6 +129,22 @@
 		text_attr = "text"
 		label = text('Pay From:') # '
 	} ?> 
+
+<?lsmb IF payment_types ?>
+<div id = "payments-filter-payment_types" class="inputpayment">
+  <label for="payment_types"><?lsmb text('Payment Type') ?></label>
+  <select name="payment_type_id" id="payment_types">
+  <?lsmb FOREACH p = payment_types ?>
+  <option value="<?lsmb p.id ?>"><?lsmb p.label ?></option>
+  <?lsmb END ?>
+  </select>
+</div>
+<?lsmb END ?>
+
+
+
+
+
 <div class = "input">
 <?lsmb INCLUDE input element_data = {
 	type = "text"

Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql	2009-04-28 00:36:19 UTC (rev 2576)
+++ trunk/sql/modules/Payment.sql	2009-04-28 04:31:29 UTC (rev 2577)
@@ -1,4 +1,14 @@
 
+CREATE OR REPLACE FUNCTION payment_type__list() RETURNS SETOF payment_types AS
+$$
+DECLARE out_row payment_types%ROWTYPE;
+BEGIN
+	FOR out_row IN SELECT * FROM payment_types LOOP
+		RETURN NEXT out_row;
+	END LOOP;
+END;
+$$ LANGUAGE PLPGSQL;
+
 CREATE TYPE payment_vc_info AS (
 	id int,
 	name text,


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