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

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



Revision: 6515
          http://sourceforge.net/p/ledger-smb/code/6515
Author:   einhverfr
Date:     2014-01-17 14:16:43 +0000 (Fri, 17 Jan 2014)
Log Message:
-----------
More obsolete, unused code removed

Modified Paths:
--------------
    trunk/LedgerSMB/AM.pm
    trunk/bin/am.pl

Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm	2014-01-17 14:04:38 UTC (rev 6514)
+++ trunk/LedgerSMB/AM.pm	2014-01-17 14:16:43 UTC (rev 6515)
@@ -393,50 +393,6 @@
 
 }
 
-=item AM->sic($myconfig, $form);
-
-Populate the list referred to as $form->{ALL} with hashes containing SIC (some
-well known systems of which are NAICS and ISIC) data from the sic table.  code
-is the actual SIC code, description is a textual description of the code, and
-sictype is an indicator of whether or not the entry refers to a header.  The
-hashes will be sorted by either the code or description.
-
-$myconfig is unused.
-
-=cut
-
-sub sic {
-
-    my ( $self, $myconfig, $form ) = @_;
-
-    # connect to database
-    my $dbh = $form->{dbh};
-
-    $form->{sort} = "code" unless $form->{sort};
-    my @a = qw(code description);
-
-    my %ordinal = (
-        code        => 1,
-        description => 3
-    );
-
-    my $sortorder = $form->sort_order( \@a, \%ordinal );
-
-    my $query = qq|SELECT code, sictype, description
-					 FROM sic
-				 ORDER BY $sortorder|;
-
-    $sth = $dbh->prepare($query);
-    $sth->execute || $form->dberror($query);
-
-    while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) {
-        push @{ $form->{ALL} }, $ref;
-    }
-
-    $sth->finish;
-
-}
-
 =item AM->get_sic($myconfig, $form);
 
 Retrieves the sictype and description for the SIC indicated by

Modified: trunk/bin/am.pl
===================================================================
--- trunk/bin/am.pl	2014-01-17 14:04:38 UTC (rev 6514)
+++ trunk/bin/am.pl	2014-01-17 14:16:43 UTC (rev 6515)
@@ -97,57 +97,11 @@
 
 }
 
-sub save_account {
-
-    $form->isblank( "accno",    $locale->text('Account Number missing!') );
-    $form->isblank( "category", $locale->text('Account Type missing!') );
-
-    # check for conflicting accounts
-    if ( $form->{AR} || $form->{AP} || $form->{IC} ) {
-        $a = "";
-        for (qw(AR AP IC)) { $a .= $form->{$_} }
-        $form->error(
-            $locale->text(
-                'Cannot set account for more than one of AR, AP or IC')
-        ) if length $a > 2;
-
-        for (
-            qw(AR_amount AR_tax AR_paid AR_overpayment AR_discount AP_amount AP_tax AP_paid AP_overpayment AP_discount IC_taxpart IC_taxservice IC_sale IC_cogs IC_income IC_expense)
-          )
-        {
-            $form->error(
-                "$form->{AR}$form->{AP}$form->{IC} "
-                  . $locale->text(
-                    'account cannot be set to any other type of account')
-            ) if $form->{$_};
-        }
-    }
-
-    foreach $item ( "AR", "AP" ) {
-        $i = 0;
-        for ( "${item}_amount", "${item}_paid", "${item}_tax", "${item}_overpayment", "${item}_discount" ) {
-            $i++ if $form->{$_};
-        }
-        $form->error(
-            $locale->text( 'Cannot set multiple options for [_1]', $item ) )
-          if $i > 1;
-    }
-
-    if ( AM->save_account( \%myconfig, \%$form ) ) {
-        $form->redirect( $locale->text('Account saved!') );
-    }
-    else {
-        $form->error( $locale->text('Cannot save account!') );
-    }
-
-}
-
 sub add_gifi {
     $form->{title} = "Add";
 
     # construct callback
-    $form->{callback} =
-"$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}";
+    $form->{callback} = "reports.pl?action=list_gifi";
 
     $form->{coa} = 1;
 
@@ -260,36 +214,6 @@
 
 }
 
-sub copy_to_coa {
-
-    $form->isblank( "accno", $locale->text('GIFI missing!') );
-
-    AM->save_gifi( \%myconfig, \%$form );
-
-    delete $form->{id};
-    $form->{gifi_accno} = $form->{accno};
-
-    $form->{title}     = "Add";
-    $form->{charttype} = "A";
-
-    my %hiddens;
-    my @buttons;
-    my $checked = &account_header(\%hiddens);
-    &form_footer_buttons(\%hiddens, \@buttons);
-
-    my $template = LedgerSMB::Template->new_UI(
-        user => \%myconfig, 
-        locale => $locale,
-        template => 'am-account-form');
-    $template->render({
-        form => $form,
-        checked => $checked,
-        buttons => \@buttons,
-        hiddens => \%hiddens,
-    });
-
-}
-
 sub delete_gifi {
 
     AM->delete_gifi( \%myconfig, \%$form );
@@ -432,87 +356,6 @@
 
 }
 
-sub list_sic {
-
-    AM->sic( \%myconfig, \%$form );
-
-    my $href =
-"$form->{script}?action=list_sic&direction=$form->{direction}&oldsort=$form->{oldsort}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}";
-
-    $form->sort_order();
-
-    $form->{callback} =
-"$form->{script}?action=list_sic&direction=$form->{direction}&oldsort=$form->{oldsort}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}";
-
-    my $callback = $form->escape( $form->{callback} );
-
-    $form->{title} = $locale->text('Standard Industrial Codes');
-
-    my @column_index = $form->sort_columns(qw(code description));
-
-    my %column_header;
-    $column_header{code} = {
-        href => "$href&sort=code",
-        text => $locale->text('Code'),
-        };
-    $column_header{description} = {
-        href => "$href&sort=description",
-        text => $locale->text('Description'),
-        };
-
-    my @rows;
-    my $i = 0;
-    foreach $ref ( @{ $form->{ALL} } ) {
-
-        my %column_data;
-        $i++;
-        $i %= 2;
-
-        if ( $ref->{sictype} eq 'H' ) {
-            $column_data{class} = 'heading';
-        }
-        $column_data{i} = $i;
-        $column_data{code} = {
-            text => $ref->{code},
-            href => "$form->{script}?action=edit_sic&code=$ref->{code}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}&callback=$callback",
-            };
-        $column_data{description} = $ref->{description};
-
-        push @rows, \%column_data;
-    }
-
-    $form->{type} = "sic";
-    my @hiddens = qw(type callback path login sessionid);
-
-##SC: Temporary removal
-##    if ( $form->{lynx} ) {
-##        require "bin/menu.pl";
-##        &menubar;
-##    }
-
-    my @buttons;
-    push @buttons, {
-        name => 'action',
-        value => 'add_sic',
-        text => $locale->text('Add SIC'),
-        type => 'submit',
-        class => 'submit',
-    };
-
-    my $template = LedgerSMB::Template->new_UI(
-        user => \%myconfig, 
-        locale => $locale,
-        template => 'am-list-departments');
-    $template->render({
-        form => $form,
-        buttons => \@buttons,
-        columns => \@column_index,
-        heading => \%column_header,
-        rows => \@rows,
-        hiddens => \@hiddens,
-    });
-}
-
 sub sic_header {
     my $hiddens = shift;
 

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


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits