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

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



Revision: 5010
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5010&view=rev
Author:   einhverfr
Date:     2012-07-18 01:00:12 +0000 (Wed, 18 Jul 2012)
Log Message:
-----------
Beginnings of removing Maybe[] from Moose classes

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Report/Contact/Search.pm
    trunk/LedgerSMB/MooseTypes.pm
    trunk/LedgerSMB.pm
    trunk/sql/modules/Inventory_Report.sql

Modified: trunk/LedgerSMB/DBObject/Report/Contact/Search.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Report/Contact/Search.pm	2012-07-17 02:19:14 UTC (rev 5009)
+++ trunk/LedgerSMB/DBObject/Report/Contact/Search.pm	2012-07-18 01:00:12 UTC (rev 5010)
@@ -114,7 +114,7 @@
 
 =cut
 
-has entity_class => (is => 'ro', isa => 'Int');
+has entity_class => (is => 'ro', isa => 'Int', required => 1);
 
 =item name_part
 
@@ -122,7 +122,7 @@
 
 =cut
 
-has name_part => (is => 'ro', isa => 'Maybe[Str]');
+has name_part => (is => 'ro', isa => 'Str', required => 0);
 
 =item control_code
 
@@ -130,7 +130,7 @@
 
 =cut
 
-has control_code => (is => 'ro', isa => 'Maybe[Str]');
+has control_code => (is => 'ro', isa => 'Str', required => 0);
 
 =item contact_info 
 
@@ -138,7 +138,7 @@
 
 =cut
 
-has contact_info => (is => 'ro', isa => 'Maybe[ArrayRef[Str]]');
+has contact_info => (is => 'ro', isa => 'ArrayRef[Str]]', required => 0);
 
 =item email
 
@@ -146,7 +146,7 @@
 
 =cut
 
-has email => (is => 'ro', isa => 'Maybe[Str]');
+has email => (is => 'ro', isa => 'Str', required => 0);
 
 =item phone
 
@@ -154,7 +154,7 @@
 
 =cut
 
-has phone => (is => 'ro', isa => 'Maybe[Str]');
+has phone => (is => 'ro', isa => 'Str', required => 0);
 
 =item meta_number
 
@@ -162,7 +162,7 @@
 
 =cut
 
-has meta_number => (is => 'ro', isa => 'Maybe[Str]');
+has meta_number => (is => 'ro', isa => 'Str', required => 0);
 
 =item notes
 
@@ -170,7 +170,7 @@
 
 =cut
 
-has notes => (is => 'ro', isa => 'Maybe[Str]');
+has notes => (is => 'ro', isa => 'Str', required => 0);
 
 =item address
 
@@ -178,7 +178,7 @@
 
 =cut
 
-has address => (is => 'ro', isa => 'Maybe[Str]');
+has address => (is => 'ro', isa => 'Str', required => 0);
 
 =item city
 
@@ -186,7 +186,7 @@
 
 =cut
 
-has city => (is => 'ro', isa => 'Maybe[Str]');
+has city => (is => 'ro', isa => 'Str', required => 0);
 
 =item state
 
@@ -194,7 +194,7 @@
 
 =cut
 
-has state => (is => 'ro', isa => 'Maybe[Str]');
+has state => (is => 'ro', isa => 'Str', required => 0);
 
 =item mail_code
 
@@ -202,7 +202,7 @@
 
 =cut
 
-has mail_code => (is => 'ro', isa => 'Maybe[Str]');
+has mail_code => (is => 'ro', isa => 'Str', required => 0);
 
 =item country
 
@@ -210,7 +210,7 @@
 
 =cut
 
-has country => (is => 'ro', isa => 'Maybe[Str]'); 
+has country => (is => 'ro', isa => 'Str', required => 0); 
 
 =item active_date_from
 
@@ -224,10 +224,12 @@
 
 has active_date_from => (is => 'ro', 
                         isa => 'LedgerSMB::Moose::Date', 
-                     coerce => 1);
+                     coerce => 1,
+                   required => 0);
 has active_date_to => (is => 'ro', 
                       isa => 'LedgerSMB::Moose::Date', 
-                   coerce => 1);
+                   coerce => 1,
+                 required => 0);
 
 =back
 

Modified: trunk/LedgerSMB/MooseTypes.pm
===================================================================
--- trunk/LedgerSMB/MooseTypes.pm	2012-07-17 02:19:14 UTC (rev 5009)
+++ trunk/LedgerSMB/MooseTypes.pm	2012-07-18 01:00:12 UTC (rev 5010)
@@ -36,7 +36,7 @@
 
 =cut
 
-subtype 'LedgerSMB::Moose::Date', as 'Maybe[LedgerSMB::PGDate]';
+subtype 'LedgerSMB::Moose::Date', as 'LedgerSMB::PGDate';
 
 
 
@@ -59,7 +59,7 @@
 
 =cut
 
-subtype 'LedgerSMB::Moose::Number', as 'Maybe[LedgerSMB::PGNumber]';
+subtype 'LedgerSMB::Moose::Number', as 'LedgerSMB::PGNumber';
 
 
 =head3 Coercions

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2012-07-17 02:19:14 UTC (rev 5009)
+++ trunk/LedgerSMB.pm	2012-07-18 01:00:12 UTC (rev 5010)
@@ -262,6 +262,10 @@
      # are not parameters of the CGI query.
      %params = $query->Vars;
      for my $p(keys %params){
+         if (($params{$p} eq undef) or ($params{$p} eq '')){
+             delete $params{$p};
+             next;
+         }
          utf8::decode($params{$p});
          utf8::upgrade($params{$p});
      }

Modified: trunk/sql/modules/Inventory_Report.sql
===================================================================
--- trunk/sql/modules/Inventory_Report.sql	2012-07-17 02:19:14 UTC (rev 5009)
+++ trunk/sql/modules/Inventory_Report.sql	2012-07-18 01:00:12 UTC (rev 5010)
@@ -6,8 +6,8 @@
     parts_id int,
     partnumber text,
     description text,
-    qty  numeric,
-    unhand numeric,
+    counted  numeric,
+    expected numeric,
     variance numeric
 );
 

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