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

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



Revision: 4957
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4957&view=rev
Author:   einhverfr
Date:     2012-07-01 11:14:28 +0000 (Sun, 01 Jul 2012)
Log Message:
-----------
Merging from branches/1.3

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/DBObject/Payment.pm
    trunk/LedgerSMB.pm
    trunk/sql/modules/Payment.sql

Property Changed:
----------------
    trunk/Changelog
    trunk/LedgerSMB/DBObject/Payment.pm
    trunk/sql/modules/Payment.sql

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2012-07-01 11:08:54 UTC (rev 4956)
+++ trunk/Changelog	2012-07-01 11:14:28 UTC (rev 4957)
@@ -70,7 +70,14 @@
 * Cleaned up dates lines on employee screen (Chris T)
 * Added access to parts.image for ar invoice, order, quote templates (Chris T)
 * Fixed error on redirect from attaching file to part (Chris T h/t Brian W)
+* Fixed inability to look up vendor by ECA with discounts (Erik H h/t Matt B)
 
+Andres B is Andres Basile
+Brian W is Brian Wolf
+Chris T is Chris Travers
+Erik H is Erik Huelsmann
+Matt B is Matthew Bourque
+
 Changelog for 1.3.19
 * New link for customer/vendor when not a dropdown (Chris T)
 * Removed file debugging code from file.pl (Chris T)


Property changes on: trunk/Changelog
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/1.3/Changelog:3711-4956

Modified: trunk/LedgerSMB/DBObject/Payment.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Payment.pm	2012-07-01 11:08:54 UTC (rev 4956)
+++ trunk/LedgerSMB/DBObject/Payment.pm	2012-07-01 11:14:28 UTC (rev 4957)
@@ -198,7 +198,7 @@
 sub get_entity_credit_account{
   my ($self) = @_;
   @{$self->{entity_accounts}} =
-    $self->exec_method(funcname => 'payment_get_entity_accounts'); 
+    ($self->exec_method(funcname => 'payment_get_entity_account_payment_info'),);
    return  @{$self->{entity_accounts}};
 }
 


Property changes on: trunk/LedgerSMB/DBObject/Payment.pm
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/1.3/LedgerSMB/DBObject/Payment.pm:3711-4956

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2012-07-01 11:08:54 UTC (rev 4956)
+++ trunk/LedgerSMB.pm	2012-07-01 11:14:28 UTC (rev 4957)
@@ -290,7 +290,7 @@
         }
     }
     #HV set _locale already to default here,so routines lower in stack can use it;e.g. login.pl
-    $self->{_locale}=LedgerSMB::Locale->get_handle(${LedgerSMB::Sysconfig::language})
+    $self->{_locale}=LedgerSMB::Locale->get_handle($LedgerSMB::Sysconfig::language)
       or $self->error( __FILE__ . ':' . __LINE__ .": Locale ($LedgerSMB::Sysconfig::language) not loaded: $!\n" );
 
     $self->{action} = "" unless defined $self->{action};

Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql	2012-07-01 11:08:54 UTC (rev 4956)
+++ trunk/sql/modules/Payment.sql	2012-07-01 11:14:28 UTC (rev 4957)
@@ -34,7 +34,9 @@
 $$ Returns all information on a payment type by the id.  This should be renamed
 to account for its behavior in future versions.$$;
 
-
+-- ### To be dropped in 1.4: it's imprecise
+-- to return a set of entity accounts based on their names,
+-- if we're going to use them for discount calculations...
 CREATE OR REPLACE FUNCTION payment_get_entity_accounts
 (in_account_class int,
  in_vc_name text,
@@ -67,6 +69,25 @@
 $$ Returns a minimal set of information about customer or vendor accounts
 as needed for discount calculations and the like.$$;
 
+CREATE OR REPLACE FUNCTION payment_get_entity_account_payment_info
+(in_entity_credit_id int)
+RETURNS payment_vc_info
+AS $$
+ SELECT ec.id, cp.legal_name ||
+        coalesce(':' || ec.description,'') as name,
+        e.entity_class, ec.discount_account_id, ec.meta_number
+ FROM entity_credit_account ec
+ JOIN entity e ON (ec.entity_id = e.id)
+ JOIN company cp ON (cp.entity_id = e.id)
+ WHERE ec.id = $1;
+$$ LANGUAGE SQL;
+
+COMMENT ON FUNCTION payment_get_entity_account_payment_info
+(in_entity_credit_id int)
+IS $$ Returns payment information on the entity credit account as
+  required to for discount calculations and payment processing. $$;
+
+
 -- payment_get_open_accounts and the option to get all accounts need to be
 -- refactored and redesigned.  -- CT
 CREATE OR REPLACE FUNCTION payment_get_open_accounts(in_account_class int)


Property changes on: trunk/sql/modules/Payment.sql
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/1.3/sql/modules/Payment.sql:3711-4956

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