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

SF.net SVN: ledger-smb:[6312] trunk/LedgerSMB



Revision: 6312
          http://sourceforge.net/p/ledger-smb/code/6312
Author:   einhverfr
Date:     2013-12-07 15:12:08 +0000 (Sat, 07 Dec 2013)
Log Message:
-----------
Fixed person not working as customer/vendor.  Also fixed country id clearing when generating new control code on person tab

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject_Moose.pm
    trunk/LedgerSMB/Entity.pm

Modified: trunk/LedgerSMB/DBObject_Moose.pm
===================================================================
--- trunk/LedgerSMB/DBObject_Moose.pm	2013-12-07 15:05:04 UTC (rev 6311)
+++ trunk/LedgerSMB/DBObject_Moose.pm	2013-12-07 15:12:08 UTC (rev 6312)
@@ -127,7 +127,6 @@
                end => LedgerSMB::PGDate->from_db($end, 'date') };   
 }
 
-
 =back
 
 =head1 Copyright (C) 2007, The LedgerSMB core team.

Modified: trunk/LedgerSMB/Entity.pm
===================================================================
--- trunk/LedgerSMB/Entity.pm	2013-12-07 15:05:04 UTC (rev 6311)
+++ trunk/LedgerSMB/Entity.pm	2013-12-07 15:12:08 UTC (rev 6312)
@@ -101,6 +101,22 @@
 
 =cut
 
+around BUILDARGS => sub {
+    my $orig = shift;
+    my $class = shift;
+    my %args;
+    if (ref $_[0]){
+        %args = %{$_[0]};
+    } else {
+        %args = @_;
+    }
+    if (!$args{name}){
+        $args{name} = $args{legal_name} if $args{legal_name};
+        $args{name} = "$args{first_name} $args{last_name}" if $args{first_name};
+    }
+    $class->$orig(%args);
+};
+
 __PACKAGE__->meta->make_immutable;
 
 return 1;

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


------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits