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

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



Revision: 4795
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4795&view=rev
Author:   einhverfr
Date:     2012-05-28 10:24:21 +0000 (Mon, 28 May 2012)
Log Message:
-----------
Initial commit of customer/vendor controller script rewritten.  There are likely to be issues at present but these are being worked on.
Also corrected new payment lines for bash on every update

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Entity/Location.pm
    trunk/LedgerSMB/DBObject/Report/COA.pm
    trunk/LedgerSMB/ScriptLib/Company.pm
    trunk/LedgerSMB/Scripts/contact.pm
    trunk/UI/Contact/contact.html
    trunk/UI/Contact/divs/address.html
    trunk/UI/Contact/divs/bank_act.html
    trunk/UI/Contact/divs/contact_info.html
    trunk/UI/Contact/divs/credit.html
    trunk/bin/aa.pl
    trunk/bin/ir.pl
    trunk/bin/is.pl
    trunk/sql/modules/Company.sql

Modified: trunk/LedgerSMB/DBObject/Entity/Location.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Entity/Location.pm	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/LedgerSMB/DBObject/Entity/Location.pm	2012-05-28 10:24:21 UTC (rev 4795)
@@ -193,14 +193,14 @@
 =cut
 
 sub get_active {
-    my ($self, $request, $args) = @_;
+    my ($self, $args) = @_;
     my @results;
     for my $ref ($self->call_procedure(procname => 'entity__list_locations',
                                            args => [$args->{entity_id}]))
     {
        next if ($args->{only_class}) 
                and ($args->{only_class} != $ref->{location_class});
-        LedgerSMB::DBObject_Moose::prepare_dbhash($request, $ref);
+        $self->prepare_dbhash($ref);
         push @results, $self->new(%$ref);
     }
     return @results unless $args->{credit_id};
@@ -211,7 +211,7 @@
        next if ($args->{only_class}) 
                and ($args->{only_class} != $ref->{location_class});
         $ref->{credit_id} = $args->{credit_id};
-        LedgerSMB::DBObject_Moose::prepare_dbhash($request, $ref);
+        $self->prepare_dbhash($ref);
         push @results, $self->new(%$ref);
     }
 

Modified: trunk/LedgerSMB/DBObject/Report/COA.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Report/COA.pm	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/LedgerSMB/DBObject/Report/COA.pm	2012-05-28 10:24:21 UTC (rev 4795)
@@ -180,10 +180,18 @@
     my ($self) = @_;
     my @rows = $self->exec_method({funcname => 'report__coa'});
     for my $r(@rows){
+        my $ct; 
+        if ($r->{is_heading}){
+           $ct = 'H';
+        } else {
+           $ct = 'A';
+        }
         $r->{edit} = '['.$locale->text('Edit').']';
         $r->{delete} = '['.$locale->text('Delete').']' if $r->{rowcount};
-        $r->{edit_href_suffix} = 'account.pl?action=edit&id='.$r->{id};
-        $r->{delete_href_suffix} = 'account.pl?action=delete&id='.$r->{id};
+        $r->{edit_href_suffix} = 'account.pl?action=edit&id='.$r->{id} . 
+           "&charttype=$ct";
+        $r->{delete_href_suffix} = 'account.pl?action=delete&id='.$r->{id} .
+           "&charttype=$ct";
         $r->{accno_href_suffix} = 
                 'reports.pl?action=start_report&module_name=gl&report_name=gl' .
                 "&accno=$r->{accno}--$r->{description}" 

Modified: trunk/LedgerSMB/ScriptLib/Company.pm
===================================================================
--- trunk/LedgerSMB/ScriptLib/Company.pm	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/LedgerSMB/ScriptLib/Company.pm	2012-05-28 10:24:21 UTC (rev 4795)
@@ -71,127 +71,7 @@
     _render_main_screen($request);
 }
 
-=item dispatch_legacy
 
-This is a semi-private method which interfaces with the old code.  Note that
-as long as any other functions use this, the contact interface cannot be said to 
-be safe for code caching.
-
-Not fully documented because this will go away as soon as possible.
-
-=cut
-
-sub dispatch_legacy {
-    our ($request) = shift @_;
-    use LedgerSMB::Form;
-    my $aa;
-    my $inv;
-    my $otype;
-    my $qtype;
-    my $cv;
-    if ($request->{account_class} == 1){
-       $aa = 'ap';
-       $inv = 'ir';
-       $otypr = 'purchase_order';
-       $qtype = 'request_quotation';
-       $cv = 'vendor';
-    } elsif ($request->{account_class} == 2){
-       $aa = 'ar';
-       $inv = 'is';
-       $otypr = 'sales_order';
-       $qtype = 'sales_quotation';
-       $cv = 'customer';
-    } else {
-       $request->error($request->{_locale}->text('Unsupport account type'));
-    }
-    our $dispatch = 
-    {
-        add_transaction  => {script => "bin/$aa.pl", 
-                               data => {"${cv}_id" => $request->{credit_id}},
-                            },
-        add_invoice      => {script => "bin/$inv.pl",
-                               data => {"${cv}_id" => $request->{credit_id}},
-                            },
-        add_order        => {script => 'bin/oe.pl', 
-                               data => {"${cv}_id" => $request->{credit_id},
-                                            type   => $otype,
-                                               vc  => $cv,
-                                       },
-                            },
-        rfq              => {script => 'bin/oe.pl', 
-                               data => {"${cv}_id" => $request->{credit_id},
-                                            type   => $qtype,
-                                               vc  => $cv,
-                                       },
-                            },
- 
-    };
-
-    our $form = new Form;
-    our %myconfig = ();
-    %myconfig = %{$request->{_user}};
-    $form->{stylesheet} = $myconfig{stylesheet};
-    our $locale = $request->{_locale};
-
-    for (keys %{$dispatch->{$request->{action}}->{data}}){
-        $form->{$_} = $dispatch->{$request->{action}}->{data}->{$_};
-    }
-
-    my $script = $dispatch->{$request->{action}}{script};
-    $form->{script} = $script;
-    $form->{action} = 'add';
-    $form->{dbh} = $request->{dbh};
-    $form->{script} =~ s|.*/||;
-    { no strict; no warnings 'redefine'; do $script; }
-
-    $form->{action}();
-}
-
-=item add_transaction
-
-Dispatches to the Add (AR or AP as appropriate) transaction screen.
-
-=cut
-
-sub add_transaction {
-    my $request = shift @_;
-    dispatch_legacy($request);
-}
-
-=item add_invoice
-
-Dispatches to the (sales or vendor, as appropriate) invoice screen.
-
-=cut
-
-sub add_invoice {
-    my $request = shift @_;
-    dispatch_legacy($request);
-}
-
-=item add_order
-
-Dispatches to the sales/purchase order screen.
-
-=cut
-
-sub add_order {
-    my $request = shift @_;
-    dispatch_legacy($request);
-}
-
-=item rfq
-
-Dispatches to the quotation/rfq screen
-
-=cut
-
-sub rfq {
-    my $request = shift @_;
-    dispatch_legacy($request);
-}
-
-
 =item new_company($request) 
 
 returns object inheriting LedgerSMB::DBObject::Company
@@ -312,141 +192,10 @@
 
 =over
 
-=item add
-
-This method creates a blank screen for entering a company's information.
-
-=back
-
-=cut 
-
-sub add {
-    my ($request) = @_;
-    _render_main_screen($request);
-}
-
-
-
 =pod
 
 =over
 
-=item get_results($self, $request, $user)
-
-Requires form var: search_pattern
-
-Directly calls the database function search, and returns a set of all vendors
-found that match the search parameters. Search parameters search over address 
-as well as vendor/Company name.
-
-=back
-
-=cut
-
-sub get_results {
-    my ($request) = @_;
-        
-    my $company = new_company($request);
-    set_entity_class($company);
-    $company->{contact_info} = 
-             qq|{"%$request->{email}%","%$request->{phone}%"}|;
-    my $results = $company->search();
-    if ($company->{order_by}){
-       # TODO:  Set ordering logic
-    };
-
-    # URL Setup
-    my $baseurl = "$request->{script}";
-    my $search_url = "$base_url?action=get_results";
-    my $get_url = "$base_url?action=get&account_class=$request->{account_class}";
-    for (keys %$vendor){
-        next if $_ eq 'order_by';
-        $search_url .= "&$_=$form->{$_}";
-    }
-
-    my $meta_number_name;
-    if($company->{account_class}==1){$meta_number_name='Vendor Number';}
-    elsif($company->{account_class}==2){$meta_number_name='Customer Number';}
-    else{$meta_number_name='Unknown';}
-    # Column definitions for dynatable
-    @columns = qw(legal_name entity_control_code meta_number credit_description business_type curr);
-		
-	my $column_names = {
-	    legal_name => 'Name',
-	    entity_control_code => 'Control Code',
-	    meta_number => $meta_number_name,
-	    credit_description => 'Description',
-	    business_type => 'Business Type',
-	    curr => 'Currency'
-    };
-	my @sort_columns = @columns;
-	my $sort_href = "$search_url&order_by";
-
-    my @rows;
-    for $ref (@{$company->{search_results}}){
-    if(!$ref->{meta_number}){$ref->{meta_number}='';}
-    my $http_href="$get_url&entity_id=$ref->{entity_id}"."&meta_number=$ref->{meta_number}";
-	push @rows, 
-                {legal_name   => {text=>$ref->{legal_name},href=>$http_href},
-		entity_control_code => $ref->{entity_control_code},
-		credit_description => $ref->{credit_description},
-                meta_number   => {text=>$ref->{meta_number}},
-		business_type => $ref->{business_type},
-                curr          => $ref->{curr},
-                };
-    }
-    #my $label = $ec_labels->{"$company->{account_class}"};
-    my $label_text="Add ".$ec_labels->{"$company->{account_class}"};
-# CT:  Labels for i18n:
-# text->{'Add Customer')
-# text->('Add Vendor')
-
-# CT:  The CSV Report is broken.  I get:
-# Not an ARRAY reference at 
-# /usr/lib/perl5/site_perl/5.8.8/CGI/Simple.pm line 423
-# Disabling the button for now.
-    my @buttons = (
-#	{name => 'action',
-#        value => 'csv_company_list',
-#        text => $company->{_locale}->text('CSV Report'),
-#        type => 'submit',
-#        class => 'submit',
-#        },
-	{name => 'action',
-        value => 'add',
-        text => $company->{_locale}->text($label_text),
-        type => 'submit',
-        class => 'submit',
-	}
-    );
-
-    my $template = LedgerSMB::Template->new( 
-		user => $user,
-		path => 'UI' ,
-    		template => 'form-dynatable', 
-		locale => $company->{_locale}, 
-		format => ($request->{FORMAT}) ? $request->{FORMAT}  : 'HTML',
-    );
-            
-    my $column_heading = $template->column_heading($column_names,
-        {href => $sort_href, columns => ..hidden..
-    );
-            
-    $logger->debug("\$company = " . Data::Dumper::Dumper($company));
-    $template->render({
-	form    => $company,
-	columns => ..hidden..,
-#        hiddens => $company,
-	buttons => ..hidden..,
-	heading => $column_heading,
-	rows    => ..hidden..,
-    });
-}
-
-=pod
-
-=over
-
 =item history($request)
 
 Generates the filter screen for the customer/vendor history report.
@@ -767,14 +516,12 @@
     @{$company->{contacts}} = 
           LedgerSMB::DBObject::Entity::Contact->list(
               {entity_id => $company->{entity_id},
-                        credit_id => $company->{credit_act}->{id}},
-              $request
+                        credit_id => $company->{credit_act}->{id}}
           );
     @{$company->{contact_class_list}} = 
           LedgerSMB::DBObject::Entity::Contact->list_classes;
     @{$company->{locations}} = 
           LedgerSMB::DBObject::Entity::Location->get_active(
-                       $request,
                        {entity_id => $company->{entity_id},
                         credit_id => $company->{credit_act}->{id}}
           );
@@ -786,7 +533,7 @@
                                                  $company->{credit_act}->{id});
     $company->{creditlimit} = $request->format_amount({amount => $company->{creditlimit}}) unless !defined $company->{creditlimit}; 
     $company->{discount} = "$company->{discount}" unless !defined $company->{discount}; 
-    $company->{note_class_options} = [
+    $company->{attach_level_options} = [
         {label => 'Entity', value => 1},
         {label => $ec_labels->{"$company->{entity_class}"} . ' Account', 
          value => 3},

Modified: trunk/LedgerSMB/Scripts/contact.pm
===================================================================
--- trunk/LedgerSMB/Scripts/contact.pm	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/LedgerSMB/Scripts/contact.pm	2012-05-28 10:24:21 UTC (rev 4795)
@@ -16,17 +16,19 @@
 
 package LedgerSMB::Scripts::contact;
 
-use LedgerSMB::DBObject::Customer;
-use base qw(LedgerSMB::ScriptLib::Company);
+use LedgerSMB::DBObject::Entity::Company;
+use LedgerSMB::DBObject::Entity::Credit_Account;
+use LedgerSMB::DBObject::Entity::Location;
+use LedgerSMB::DBObject::Entity::Contact;
+use LedgerSMB::DBObject::Entity::Bank;
+use LedgerSMB::DBObject::Entity::Note;
+use LedgerSMB::App_State;
 
+my $locale = $LedgerSMB::App_State::Locale;
 
-=head1 INHERITS
-
-LedgerSMB::ScriptLib::Company
-
 =head1 COPYRIGHT
 
-Copyright (c) 2009, the LedgerSMB Core Team.  This is licensed under the GNU 
+Copyright (c) 2012, the LedgerSMB Core Team.  This is licensed under the GNU 
 General Public License, version 2, or at your option any later version.  Please 
 see the accompanying License.txt for more information.
 
@@ -50,8 +52,7 @@
     $request->{country_id} = 0;
     my $company = LedgerSMB::DBObject::Entity::Company->new(%$request);
     $company = $company->get_by_cc($request->{control_code});
-    $request->{company} = $company;
-    LedgerSMB::ScriptLib::Company::_render_main_screen($request, $company);
+    _main_screen($request, $company);
 }
 
 
@@ -71,9 +72,228 @@
     $request->{legal_name} ||= 'test';
     my $company = LedgerSMB::DBObject::Entity::Company->new(%$request);
     $company = $company->get($request->{entity_id});
-    $request->{company} = $company;
-    LedgerSMB::ScriptLib::Company::_render_main_screen($request, $company);
+    _main_screen($request, $company);
 }
 
 
+# private method _main_screen 
+#
+# this attaches everything other than {company} to $request and displays it.
+
+sub _main_screen {
+    my ($request, $company) = @_;
+    # DIVS logic
+    my @DIVS;
+    if ($company->{entity_id}){
+       @DIVS = qw(company credit address contact_info bank_act notes);
+    } else {
+       @DIVS = qw(company);
+    }
+
+    %DIV_LABEL = (
+             company => $locale->text('Company'),
+              credit => $locale->text('Credit Accounts'),
+             address => $locale->text('Addresses'),
+        contact_info => $locale->text('Contact Info'),
+            bank_act => $locale->text('Bank Accounts'),
+               notes => $locale->text('Notes'),
+    );
+
+    # DIVS contents
+    my @credit_list = 
+       LedgerSMB::DBObject::Entity::Credit_Account->list_for_entity(
+                          $company->{entity_id},
+                          $request->{entity_class}
+        );
+    my $credit_act;
+    for my $ref(@credit_list){
+        $credit_act = $ref 
+            if ($request->{credit_id} eq $ref->{id}) 
+                or ($request->{meta_number} eq $ref->{meta_number});
+    }
+
+    my @locations = LedgerSMB::DBObject::Entity::Location->get_active(
+                       {entity_id => $request->{entity_id},
+                        credit_id => $credit_act->{id}}
+          );
+
+    my @contact_class_list =
+          LedgerSMB::DBObject::Entity::Contact->list_classes;
+
+    my @contacts = LedgerSMB::DBObject::Entity::Contact->list(
+              {entity_id => $request->{entity_id},
+               credit_id => $credit_act->{id}}
+    );
+    my @bank_account = 
+         LedgerSMB::DBObject::Entity::Bank->list($request->{entity_id});
+    my @notes =
+         LedgerSMB::DBObject::Entity::Note->list($request->{entity_id},
+                                                 $credit_act->{id});
+    $attach_level_options = [
+        {label => $locale->text('Entity'), value => 1} ];
+    ..hidden..,
+        {label => $locale->text('Credit Account'),
+         value => 3} if $credit_act->{id};
+    ;
+
+    # Template info and rendering 
+    my $template = LedgerSMB::Template->new(
+        user => $request->{_user},
+        template => 'contact',
+        locale => $request->{_locale},
+        path => 'UI/Contact',
+        format => 'HTML'
+    );
+
+    #use Data::Dumper;
+    #$Data::Dumper::Sortkeys = 1;
+
+    $template->render({
+                     DIVS => ..hidden..,
+                DIV_LABEL => \%DIV_LABEL,
+                  request => $request,
+                  company => $company,
+               credit_act => $credit_act,
+              credit_list => ..hidden..,
+                locations => ..hidden..,
+                 contacts => ..hidden..,
+             bank_account => ..hidden..,
+                    notes => ..hidden..,
+     attach_level_options => $attach_level_options
+    });
+}
+
+=item dispatch_legacy
+
+This is a semi-private method which interfaces with the old code.  Note that
+as long as any other functions use this, the contact interface cannot be said to 
+be safe for code caching.
+
+Not fully documented because this will go away as soon as possible.
+
+=cut
+
+sub dispatch_legacy {
+    our ($request) = shift @_;
+    use LedgerSMB::Form;
+    my $aa;
+    my $inv;
+    my $otype;
+    my $qtype;
+    my $cv;
+    if ($request->{account_class} == 1){
+       $aa = 'ap';
+       $inv = 'ir';
+       $otypr = 'purchase_order';
+       $qtype = 'request_quotation';
+       $cv = 'vendor';
+    } elsif ($request->{account_class} == 2){
+       $aa = 'ar';
+       $inv = 'is';
+       $otypr = 'sales_order';
+       $qtype = 'sales_quotation';
+       $cv = 'customer';
+    } else {
+       $request->error($request->{_locale}->text('Unsupport account type'));
+    }
+    our $dispatch = 
+    {
+        add_transaction  => {script => "bin/$aa.pl", 
+                               data => {"${cv}_id" => $request->{credit_id}},
+                            },
+        add_invoice      => {script => "bin/$inv.pl",
+                               data => {"${cv}_id" => $request->{credit_id}},
+                            },
+        add_order        => {script => 'bin/oe.pl', 
+                               data => {"${cv}_id" => $request->{credit_id},
+                                            type   => $otype,
+                                               vc  => $cv,
+                                       },
+                            },
+        rfq              => {script => 'bin/oe.pl', 
+                               data => {"${cv}_id" => $request->{credit_id},
+                                            type   => $qtype,
+                                               vc  => $cv,
+                                       },
+                            },
+ 
+    };
+
+    our $form = new Form;
+    our %myconfig = ();
+    %myconfig = %{$request->{_user}};
+    $form->{stylesheet} = $myconfig{stylesheet};
+    our $locale = $request->{_locale};
+
+    for (keys %{$dispatch->{$request->{action}}->{data}}){
+        $form->{$_} = $dispatch->{$request->{action}}->{data}->{$_};
+    }
+
+    my $script = $dispatch->{$request->{action}}{script};
+    $form->{script} = $script;
+    $form->{action} = 'add';
+    $form->{dbh} = $request->{dbh};
+    $form->{script} =~ s|.*/||;
+    { no strict; no warnings 'redefine'; do $script; }
+
+    $form->{action}();
+}
+
+=item add_transaction
+
+Dispatches to the Add (AR or AP as appropriate) transaction screen.
+
+=cut
+
+sub add_transaction {
+    my $request = shift @_;
+    dispatch_legacy($request);
+}
+
+=item add_invoice
+
+Dispatches to the (sales or vendor, as appropriate) invoice screen.
+
+=cut
+
+sub add_invoice {
+    my $request = shift @_;
+    dispatch_legacy($request);
+}
+
+=item add_order
+
+Dispatches to the sales/purchase order screen.
+
+=cut
+
+sub add_order {
+    my $request = shift @_;
+    dispatch_legacy($request);
+}
+
+=item rfq
+
+Dispatches to the quotation/rfq screen
+
+=cut
+
+sub rfq {
+    my $request = shift @_;
+    dispatch_legacy($request);
+}
+
+=item add
+
+This method creates a blank screen for entering a company's information.
+
+=back
+
+=cut 
+
+sub add {
+    my ($request) = @_;
+    _main_screen($request);
+}
+
 1;

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/UI/Contact/contact.html	2012-05-28 10:24:21 UTC (rev 4795)
@@ -12,34 +12,9 @@
 PROCESS "dynatable.html"  ?>
 <?lsmb IF !country_id; country_id = default_country; END -?>
 <?lsmb IF !country_id_t; country_id_t = default_country; END -?>
-<?lsmb 
-# Adding the action requirement to the conditional because otherwise it still
-# breaks.  --CT
-IF (!(action == 'edit' and target_div)); ?>
-<?lsmb IF (!entity_id and account_class != 3); 
-	target_div = 'company_div';
-ELSIF ((!entity_id or action == 'save') and entity_class == 3);
-		target_div = 'hr_div';
-ELSIF action == 'save_credit' or action == 'get' or action == 'edit'
-			or action=='save'; 
-		target_div = 'credit_div';
-ELSIF action== 'save_location' or action == 'get_location' 
-			or action == 'delete_location';
-		target_div = 'location_div';
-ELSIF action== 'save_location' or action == 'get_location' 
-			or action == 'delete_location';
-		target_div = 'location_div';
-ELSIF action== 'save_contact' or action == 'get_contact' 
-			or action == 'delete_contact';
-		target_div = 'contact_div';
-ELSIF action== 'save_bank_account' or action == 'get_bank_acct' 
-			or action == 'delete_bank_acct';
-		target_div = 'bank_div';
-ELSIF action== 'save_notes';
-		target_div = 'notes_div';
-END ?>
-<?lsmb END ?>
-<body onload="init('<?lsmb target_div ?>')">
+<?lsmb  # Target_div handling now moved to controller script -- CT -?>
+
+<body onload="init('<?lsmb request.target_div ?>')">
     <?lsmb IF name ?> 
 <div class="pageheading"><?lsmb text('Company') ?>: <?lsmb name ?></div>
     <?lsmb END ?>
@@ -62,57 +37,16 @@
 <?lsmb text("Add Employee") ?>
 <?lsmb text("Edit Employee") ?>
 -->
-<?lsmb # TODO:  Move to controller scripts.
-       nav_list = [];
-       DIVS = [];
-       IF entity_class == 3;
-          DIVS.push({id = 'hr_div', 
-                  label = text('HR'),
-               template = 'employee'}
-         );
-       ELSE;
-          DIVS.push({id = 'company_div', 
-                  label = text('Company'), 
-               template = 'company'},
-                    {id = 'credit_div', 
-                  label = text('Credit Accts'),
-               template = 'credit'}); #'
-          div_list = ['company', 'credit'];
-       END; 
-       IF entity_id;
-           DIVS.push(
-                 {id = 'location_div', 
-               label = text('Addresses'),
-            template = 'address'},
-                 {id = 'contact_div', 
-               label = text('Contact Info')
-            template = 'contact_info'}, #'
-                 {id = 'bank_div', 
-               label = text('Bank Accounts')
-            template = 'bank_act'}, #'
-                 {id = 'notes_div', 
-               label = text('Notes'),
-            template = 'notes'}
-           );
-           IF account_class == 1 or account_class == 2;
-            #DIVS.push({id = 'tasks_div', label = text('Tasks')});
-            #DIVS.push({id = 'prices_div', label = text('Pricelist')});
-            #DIVS.push({id = 'history_div', label = text('History')});
-           ELSIF account_class == 3;
-            #DIVS.push({id = 'user_div', label = text('User')});
-           END;
-      END; ?>
 <ul class="navigation">
         <?lsmb FOREACH nav IN DIVS ?>
-        <li class="nav"><a href="#<?lsmb nav.id ?>"><?lsmb nav.label ?></a></li>
+         <li class="nav"><a href="#<?lsmb nav ?>_div"><?lsmb DIV_LABEL.$nav 
+          ?></a></li>
         <?lsmb  END ?>
 </ul>
 
   <?lsmb FOREACH ITEM IN DIVS; 
-      INCLUDEDIV = "divs/" _ ITEM.template _ ".html";
-      IF ITEM.template;
-          PROCESS $INCLUDEDIV;
-      END;
+      INCLUDEDIV = "divs/" _ ITEM _ ".html";
+      INCLUDE $INCLUDEDIV;
   END 
 ?>
 </body>

Modified: trunk/UI/Contact/divs/address.html
===================================================================
--- trunk/UI/Contact/divs/address.html	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/UI/Contact/divs/address.html	2012-05-28 10:24:21 UTC (rev 4795)
@@ -1,4 +1,4 @@
-<div id="location_div" class="container">
+<div id="address_div" class="container">
     <div class="listtop"><?lsmb text('Locations') ?></div>
 	<!-- This entire form should probably be optionaly automated with AJAX
 	in order to prevent user confusion -CT -->

Modified: trunk/UI/Contact/divs/bank_act.html
===================================================================
--- trunk/UI/Contact/divs/bank_act.html	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/UI/Contact/divs/bank_act.html	2012-05-28 10:24:21 UTC (rev 4795)
@@ -1,4 +1,4 @@
-<div class="container" id="bank_div">
+<div class="container" id="bank_act_div">
 <div class="listtop"><?lsmb text('Bank Accounts') ?></div>
 <?lsmb 
 href_base = script _ '?&entity_id=' _ entity_id _ '&bank_account_id=' _ 

Modified: trunk/UI/Contact/divs/contact_info.html
===================================================================
--- trunk/UI/Contact/divs/contact_info.html	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/UI/Contact/divs/contact_info.html	2012-05-28 10:24:21 UTC (rev 4795)
@@ -1,4 +1,4 @@
-<div class="container" id="contact_div">
+<div class="container" id="contact_info_div">
 <div class="listtop"><?lsmb text('Contact Information') ?></div>
 <?lsmb 
 

Modified: trunk/UI/Contact/divs/credit.html
===================================================================
--- trunk/UI/Contact/divs/credit.html	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/UI/Contact/divs/credit.html	2012-05-28 10:24:21 UTC (rev 4795)
@@ -1,4 +1,3 @@
-<?lsmb IF entity_id ?>
 <div id="credit_div" class="container">
 <div class="listtop"><strong>Accounts</strong></div>
 <?lsmb 
@@ -323,5 +322,4 @@
 	
     </form>
 </div>
-<?lsmb END ?>
 </div>

Modified: trunk/bin/aa.pl
===================================================================
--- trunk/bin/aa.pl	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/bin/aa.pl	2012-05-28 10:24:21 UTC (rev 4795)
@@ -1247,7 +1247,7 @@
 
     $j = 1;
     for $i ( 1 .. $form->{paidaccounts} ) {
-        if ( $form->{"paid_$i"} ) {
+        if ( $form->{"paid_$i"} and $form->{"paid_$i"} != 0 ) {
             for (qw(datepaid source memo cleared)) {
                 $form->{"${_}_$j"} = $form->{"${_}_$i"};
             }

Modified: trunk/bin/ir.pl
===================================================================
--- trunk/bin/ir.pl	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/bin/ir.pl	2012-05-28 10:24:21 UTC (rev 4795)
@@ -1098,7 +1098,7 @@
 
     $j = 1;
     for $i ( 1 .. $form->{paidaccounts} ) {
-        if ( $form->{"paid_$i"} ) {
+        if ( $form->{"paid_$i"} and $form->{"paid_$i"} != 0) {
             for (qw(datepaid source memo cleared)) {
                 $form->{"${_}_$j"} = $form->{"${_}_$i"};
             }

Modified: trunk/bin/is.pl
===================================================================
--- trunk/bin/is.pl	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/bin/is.pl	2012-05-28 10:24:21 UTC (rev 4795)
@@ -1133,7 +1133,7 @@
 
     $j = 1;
     for $i ( 1 .. $form->{paidaccounts} ) {
-        if ( $form->{"paid_$i"} ) {
+        if ( $form->{"paid_$i"} and $form->{"paid_$i"} != 0 ) {
             for (qw(datepaid source memo cleared)) {
                 $form->{"${_}_$j"} = $form->{"${_}_$i"};
             }

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2012-05-28 06:39:00 UTC (rev 4794)
+++ trunk/sql/modules/Company.sql	2012-05-28 10:24:21 UTC (rev 4795)
@@ -1085,7 +1085,7 @@
 	note text
 );
 
-CREATE OR REPLACE FUNCTION company__list_notes(in_entity_id int) 
+CREATE OR REPLACE FUNCTION entity__list_notes(in_entity_id int) 
 RETURNS SETOF entity_note AS 
 $$
 DECLARE out_row record;
@@ -1101,7 +1101,7 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
-COMMENT ON FUNCTION company__list_notes(in_entity_id int) IS
+COMMENT ON FUNCTION entity__list_notes(in_entity_id int) IS
 $$ Returns a set of notes (including content) attached to the entity.$$;
 		
 CREATE OR REPLACE FUNCTION eca__list_notes(in_credit_id int) 

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