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

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



Revision: 4557
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4557&view=rev
Author:   einhverfr
Date:     2012-03-24 14:14:17 +0000 (Sat, 24 Mar 2012)
Log Message:
-----------
merging from branches/1.3

Added Paths:
-----------
    trunk/LedgerSMB/ScriptLib/Common_Search/Customer.pm

Property Changed:
----------------
    trunk/
    trunk/LedgerSMB/Scripts/account.pm
    trunk/LedgerSMB/Scripts/admin.pm
    trunk/LedgerSMB/Scripts/customer.pm
    trunk/LedgerSMB/Scripts/employee.pm
    trunk/LedgerSMB/Scripts/file.pm
    trunk/LedgerSMB/Scripts/journal.pm
    trunk/LedgerSMB/Scripts/login.pm
    trunk/LedgerSMB/Scripts/menu.pm
    trunk/LedgerSMB/Scripts/payment.pm
    trunk/LedgerSMB/Scripts/recon.pm
    trunk/LedgerSMB/Scripts/setup.pm
    trunk/LedgerSMB/Scripts/taxform.pm
    trunk/LedgerSMB/Scripts/vendor.pm
    trunk/sql/upgrade/1.2-1.3-manual.sql


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3:3711-4553
   + /branches/1.3:3711-4556

Copied: trunk/LedgerSMB/ScriptLib/Common_Search/Customer.pm (from rev 4556, branches/1.3/LedgerSMB/ScriptLib/Common_Search/Customer.pm)
===================================================================
--- trunk/LedgerSMB/ScriptLib/Common_Search/Customer.pm	                        (rev 0)
+++ trunk/LedgerSMB/ScriptLib/Common_Search/Customer.pm	2012-03-24 14:14:17 UTC (rev 4557)
@@ -0,0 +1,127 @@
+=head1 NAME
+
+LedgerSMB::ScriptLib::Common_Search::Customer - Customer Search Routines
+
+=head1 SYNPOSIS
+
+This provides functionality to search for a customer,
+for new 1.3-framework code.
+
+=cut
+
+package LedgerSMB::ScriptLib::Common_Search::Customer;
+use base qw(LedgerSMB::ScriptLib::Common_Search);
+use strict;
+use warnings;
+use LedgerSMB::DBObject::Customer;
+
+=head1 PROPERTIES/ACCESSORS
+
+=over
+
+=item columns (Global, static, read-only)
+
+Returns a list of columns for the embedded table engine as an arrayref.
+
+=cut
+
+my $COLUMNS = [
+      {col_id => 'entity_control_code',
+         name => 'Control code',
+         type => 'mirrored', },
+
+      {col_id => 'meta_number',
+         name => 'Account number',
+         type => 'mirrored', },
+
+      {col_id => 'legal_name',
+         name => 'Company name',
+         type => 'mirrored', },
+
+      {col_id => 'credit_description',
+         name => 'Description',
+         type => 'mirrored', },
+
+      # Can add more later
+];
+
+sub columns {
+   return $COLUMNS;
+}
+
+
+=item row_id
+
+Returns the name of the column which contains the row unique id.  
+
+=cut
+
+sub row_id {
+    return 'entity_id';
+}
+
+=item results
+
+Returns a list of results as an array of hashrefs.
+
+=cut
+
+sub results {
+    my ($self) = @_;
+    return $self->{_results};
+}
+
+=back
+
+=head1 METHODS
+
+=over 
+
+=item new ($request)
+
+Instantiates a new search object.
+
+=cut
+
+sub new {
+    my ($pkg, $request) = @_;
+    my $self = {};
+    bless $self, __PACKAGE__;
+    $self->{_customer} =
+	LedgerSMB::DBObject::Customer->new({base => $request});
+    $self->{_results} = [];
+    return $self;
+};
+
+
+=item search({contact => $string, contact_info => $string,
+  meta_number => $string, address => $string, city => $string,
+  state => $string, mail_code => $string, country => $string,
+  date_from => $string, date_to => $string, business_id => $int,
+  legal_name => $string, control_code => $string})
+
+Performs a search and caches it.  One object should be used per search unless
+results are no longer needed.
+
+=cut
+
+sub search {
+    my ($self, $args) = @_;
+    $args->{account_class} = 2; # search requires account_class (1=customer)
+    $self->{_customer}->merge($args);
+    my @results = $self->{_customer}->search;
+    $self->{_results} = ..hidden..;
+    return @{$self->{_results}};
+}
+
+=back
+
+=head1 COPYRIGHT
+
+Copyright (C) 2012 The LedgerSMB Core Team.  This file may be used in 
+accordance with the GNU General Public License version 2 or at your option any
+later version.  Please see attached LICENSE file for details.
+
+=cut
+
+return 1;


Property changes on: trunk/LedgerSMB/Scripts/account.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/account.pm:4369-4553
/branches/1.3/scripts/account.pl:3711-4368
   + /branches/1.3/LedgerSMB/Scripts/account.pm:4369-4556
/branches/1.3/scripts/account.pl:3711-4368


Property changes on: trunk/LedgerSMB/Scripts/admin.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4553
/branches/1.3/scripts/admin.pl:3711-3903,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/admin.pm:3901-4556
/branches/1.3/scripts/admin.pl:3711-3903,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/customer.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4553
/branches/1.3/scripts/customer.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/customer.pm:4288-4556
/branches/1.3/scripts/customer.pl:4273-4287


Property changes on: trunk/LedgerSMB/Scripts/employee.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4553
/branches/1.3/scripts/employee.pl:3842-3843,4273-4287,4289-4310
   + /branches/1.3/LedgerSMB/Scripts/employee.pm:3712-4556
/branches/1.3/scripts/employee.pl:3842-3843,4273-4287,4289-4310


Property changes on: trunk/LedgerSMB/Scripts/file.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4553
/branches/1.3/scripts/file.pl:3711-4138
   + /branches/1.3/LedgerSMB/Scripts/file.pm:3711-4556
/branches/1.3/scripts/file.pl:3711-4138


Property changes on: trunk/LedgerSMB/Scripts/journal.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/journal.pm:4288-4553
/branches/1.3/scripts/journal.pl:3711-4328
   + /branches/1.3/LedgerSMB/Scripts/journal.pm:4288-4556
/branches/1.3/scripts/journal.pl:3711-4328


Property changes on: trunk/LedgerSMB/Scripts/login.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/login.pm:4193-4553
/branches/1.3/scripts/login.pl:3711-4192
   + /branches/1.3/LedgerSMB/Scripts/login.pm:4193-4556
/branches/1.3/scripts/login.pl:3711-4192


Property changes on: trunk/LedgerSMB/Scripts/menu.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/menu.pm:4155-4553
/branches/1.3/scripts/menu.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/menu.pm:4155-4556
/branches/1.3/scripts/menu.pl:3711-4192,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/payment.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4553
/branches/1.3/scripts/payment.pl:3711-4310
   + /branches/1.3/LedgerSMB/Scripts/payment.pm:4010-4556
/branches/1.3/scripts/payment.pl:3711-4310


Property changes on: trunk/LedgerSMB/Scripts/recon.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/recon.pm:3711-4553
/branches/1.3/scripts/recon.pl:4194-4271,4273-4287,4393-4438
   + /branches/1.3/LedgerSMB/Scripts/recon.pm:3711-4556
/branches/1.3/scripts/recon.pl:4194-4271,4273-4287,4393-4438


Property changes on: trunk/LedgerSMB/Scripts/setup.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4553
/branches/1.3/scripts/setup.pl:3711-4550
   + /branches/1.3/LedgerSMB/Scripts/setup.pm:3937-4556
/branches/1.3/scripts/setup.pl:3711-4550


Property changes on: trunk/LedgerSMB/Scripts/taxform.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4553
/branches/1.3/scripts/taxform.pl:3711-4192,4273-4287
   + /branches/1.3/LedgerSMB/Scripts/taxform.pm:4193-4556
/branches/1.3/scripts/taxform.pl:3711-4192,4273-4287


Property changes on: trunk/LedgerSMB/Scripts/vendor.pm
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/LedgerSMB/Scripts/vendor.pm:4288-4553
/branches/1.3/scripts/vendor.pl:4273-4287
   + /branches/1.3/LedgerSMB/Scripts/vendor.pm:4288-4556
/branches/1.3/scripts/vendor.pl:4273-4287


Property changes on: trunk/sql/upgrade/1.2-1.3-manual.sql
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4553
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710
   + /branches/1.3/sql/upgrade/1.2-1.3-manual.sql:3712-4556
/branches/1.3/sql/upgrade/1.2-1.3.sql:3711-3851
/trunk/sql/upgrade/1.2-1.3.sql:858-3710

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