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

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



Revision: 5633
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5633&view=rev
Author:   einhverfr
Date:     2013-01-27 10:32:13 +0000 (Sun, 27 Jan 2013)
Log Message:
-----------
Fixing ECA cash account link not respected on single payments screen

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/payment.pm
    trunk/UI/payments/payment2.html
    trunk/sql/modules/Company.sql

Modified: trunk/LedgerSMB/Scripts/payment.pm
===================================================================
--- trunk/LedgerSMB/Scripts/payment.pm	2013-01-27 10:31:49 UTC (rev 5632)
+++ trunk/LedgerSMB/Scripts/payment.pm	2013-01-27 10:32:13 UTC (rev 5633)
@@ -1046,6 +1046,9 @@
  overpayment_account => ..hidden..,
  format_amount => sub {return $Payment->format_amount(amount=>@_)}
 };
+
+$select->{selected_account} = $vc_options[0]->{cash_account_id} 
+      unless defined $select->{selected_account};
 my $template = LedgerSMB::Template->new(
   user     => $request->{_user},
   locale   => $request->{_locale},

Modified: trunk/UI/payments/payment2.html
===================================================================
--- trunk/UI/payments/payment2.html	2013-01-27 10:31:49 UTC (rev 5632)
+++ trunk/UI/payments/payment2.html	2013-01-27 10:32:13 UTC (rev 5633)
@@ -79,11 +79,14 @@
      <?lsmb  #here goes all the posible accounts were the paid can be done  ?>
       <th align="right" nowrap id="account_label_column"><?lsmb text('Account') ?></th>
       <td colspan="2" id="account_column">
-       <select id="account" name="account">
-        <?lsmb FOREACH item IN account -?>
-         <option value="<?lsmb item.id -?>" <?lsmb IF item.id ==  selected_account -?> selected <?lsmb END ?>><?lsmb item.description -?></option>
-        <?lsmb END -?>
-       </select> 
+       <?lsmb 
+      PROCESS select element_data = {
+                  name = 'account'
+               options = account
+             text_attr = 'description'
+            value_attr = 'id'
+        default_values = [selected_account]
+       } ?>
      </td>
      </tr>
      <tr id="date_row"><?lsmb # here goes an input where the date can be written, we can also use a java calendar :). We can use an ajax script to call the Exchange rate of the input date wich can be called with the onChange Method	  ?>

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2013-01-27 10:31:49 UTC (rev 5632)
+++ trunk/sql/modules/Company.sql	2013-01-27 10:32:13 UTC (rev 5633)
@@ -667,6 +667,7 @@
 name text,
 meta_number text,
 control_code text,
+cash_account_id int,
 tax_id text,
 street1 text,
 street2 text,
@@ -684,7 +685,8 @@
 	t_id INT;
 BEGIN
 	select coalesce(eca.pay_to_name, c.legal_name), eca.meta_number, 
-		e.control_code, c.tax_id, a.line_one, a.line_two, a.line_three, 
+		e.control_code, eca.cash_account_id, c.tax_id, 
+                a.line_one, a.line_two, a.line_three, 
 		a.city, a.state, a.mail_code, cc.name
 	into out_var
 	FROM (select legal_name, tax_id, entity_id 

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