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

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



Revision: 4352
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4352&view=rev
Author:   einhverfr
Date:     2012-02-23 13:03:09 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
Listing business units now works.  We have a minimal framework for further testing, though more fine tuning needs to be done and bugs fixed before GA
Also added one's own business license number and sales tax id to defaults

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Business_Unit.pm
    trunk/LedgerSMB/Scripts/business_unit.pm
    trunk/bin/am.pl
    trunk/sql/modules/Business_Unit.sql

Modified: trunk/LedgerSMB/DBObject/Business_Unit.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Business_Unit.pm	2012-02-23 10:53:30 UTC (rev 4351)
+++ trunk/LedgerSMB/DBObject/Business_Unit.pm	2012-02-23 13:03:09 UTC (rev 4352)
@@ -141,11 +141,25 @@
     $self->dbh->commit;
 }   
 
-=item list ($date, $credit_id, $class)
+=item list ($date, $class_id, $credit_id, $strict, $active_on)
 
 Lists all business reporting units active on $date, for $credit_id (or for all
 credit_ids), and of $class.  Undef on date and credit_id match all rows.
 
+=cut
+
+sub list {
+    my ($self, $class_id, $credit_id, $strict, $active_on) = @_;
+    my @rows =  $self->call_procedure(procname => 'business_unit__list_by_class',
+                                      args => [$class_id, $active_on, 
+                                               $credit_id, $strict]);
+    for my $row(@rows){
+        $self->prepare_dbhash($row);
+        $row = $self->new($row);
+    }
+    return @rows;
+}
+
 =item delete
 
 Deletes the buisness reporting unit.  A unit can only be deleted if it has no 

Modified: trunk/LedgerSMB/Scripts/business_unit.pm
===================================================================
--- trunk/LedgerSMB/Scripts/business_unit.pm	2012-02-23 10:53:30 UTC (rev 4351)
+++ trunk/LedgerSMB/Scripts/business_unit.pm	2012-02-23 13:03:09 UTC (rev 4352)
@@ -133,7 +133,7 @@
             end_date => $request->{_locale}->text('End Date'),
     };
     my $rows;
-    @$rows = $b_unit->list; 
+    @$rows = $b_unit->list($request->{id}); 
     my $base_href= "business_unit.pl?action=edit";
     for $row(@$rows){
         $row->{control_code} = {text => $row->{control_code},

Modified: trunk/bin/am.pl
===================================================================
--- trunk/bin/am.pl	2012-02-23 10:53:30 UTC (rev 4351)
+++ trunk/bin/am.pl	2012-02-23 13:03:09 UTC (rev 4352)
@@ -49,7 +49,7 @@
 sub save   { &{"save_$form->{type}"} }
 sub delete { &{"delete_$form->{type}"} }
 
-my @default_textboxes = (
+our @default_textboxes = (
    { name => 'glnumber', label => $locale->text('GL Reference Number') },
    { name => 'sinumber', 
       label => $locale->text('Sales Invoice/AR Transaction Number'), },
@@ -75,6 +75,10 @@
    { name => 'company_address', label => $locale->text('Company Address') },
    { name => 'company_phone', label => $locale->text('Company Phone') },
    { name => 'company_fax', label => $locale->text('Company Fax') },
+   { name => 'company_sales_tax_id', 
+                             label =>  $locale->text('Company Sales Tax ID') },
+   { name => 'company_license_number',
+                           label =>  $locale->text('Company License Number') },
 );
 
 my @default_others = qw(businessnumber weightunit separate_duties default_language

Modified: trunk/sql/modules/Business_Unit.sql
===================================================================
--- trunk/sql/modules/Business_Unit.sql	2012-02-23 10:53:30 UTC (rev 4351)
+++ trunk/sql/modules/Business_Unit.sql	2012-02-23 13:03:09 UTC (rev 4352)
@@ -27,7 +27,7 @@
 BEGIN
 RETURN QUERY SELECT * FROM business_unit 
               WHERE (in_active_on BETWEEN start_date AND end_date OR
-                     in_active_in IS NULL)
+                     in_active_on IS NULL)
                     AND (in_credit_id = credit_id
                         OR (credit_id IS NULL and in_strict_credit IS NOT TRUE)
                         OR (in_credit_id IS NULL))

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