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

SF.net SVN: ledger-smb:[2797] trunk/bin



Revision: 2797
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2797&view=rev
Author:   einhverfr
Date:     2009-11-12 23:33:01 +0000 (Thu, 12 Nov 2009)

Log Message:
-----------
Undoing accidental patch commit

Modified Paths:
--------------
    trunk/bin/aa.pl
    trunk/bin/gl.pl

Modified: trunk/bin/aa.pl
===================================================================
--- trunk/bin/aa.pl	2009-11-12 23:27:56 UTC (rev 2796)
+++ trunk/bin/aa.pl	2009-11-12 23:33:01 UTC (rev 2797)
@@ -959,8 +959,6 @@
 
             'save_info' => 
               { ndx => 9, key => 'I', value => $locale->text('Save Info') },
-            'save_temp' =>
-              { ndx => 10, key => 'T', value => $locale->text('Save Template')},
         );
         if (!$form->{approved} && !$form->{batch_id}){
            $button{approve} = { 
@@ -1030,41 +1028,6 @@
 |;
 }
 
-sub save_temp {
-    use LedgerSMB;
-    use LedgerSMB::DBObject::TransTemplate;
-    my $lsmb = LedgerSMB->new();
-    $lsmb->merge($form);
-    $lsmb->{is_invoice} = 1;
-    my ($department_name, $department_id) = split/--/, $form->{department};
-     if (!$lsmb->{language_code}){
-        delete $lsmb->{language_code};
-    }
-    $lsmb->{credit_id} = $form->{"$form->{vc}_id"};
-    $lsmb->{department_id} = $department_id;
-    if ($form->{arap} eq 'ar'){
-        $lsmb->{entity_class} = 2;
-    } else {
-        $lsmb->{entity_class} = 1;
-    }
-    $lsmb->{transaction_date} = $form->{transdate}; 
-    for my $iter (0 .. $form->{rowcount}){
-        if ($form->{"AP_amount_$iter"} and 
-                  ($form->{"amount_$iter"} != 0)){
-             my ($acc_id, $acc_name) = split /--/, $form->{"AP_amount_$iter"};
-             my $amount = $form->{"amount_$iter"};
-             push @{$lsmb->{journal_lines}}, 
-                  {accno => $acc_id,
-                   amount => $amount, 
-                   cleared => false,
-                  };
-        }
-    }
-    $template = LedgerSMB::DBObject::TransTemplate->new(base => $lsmb);
-    $template->save;
-    $form->redirect( $locale->text('Template Saved!') );
-}
-
 sub edit_and_approve {
     use LedgerSMB::DBObject::Draft;
     use LedgerSMB;

Modified: trunk/bin/gl.pl
===================================================================
--- trunk/bin/gl.pl	2009-11-12 23:27:56 UTC (rev 2796)
+++ trunk/bin/gl.pl	2009-11-12 23:33:01 UTC (rev 2797)
@@ -246,10 +246,6 @@
 		  'update' =>
 		    { ndx => 1, key => 'U', value => $locale->text('Update') },
 		  'post' => { ndx => 3, key => 'O', value => $locale->text('Post') },
-                  'save_temp' =>
-                    { ndx   => 9, 
-                      key   => 'T', 
-                      value => $locale->text('Save Template') },
 		  'post_as_new' =>
 		    { ndx => 6, key => 'N', value => $locale->text('Post as new') },
 		  'schedule' =>
@@ -263,7 +259,6 @@
 		  $button{post}->{value} = $locale->text('Save'); 
 	      }
 	      %a = ();
-              $a{save_temp} = 1;
 	      if ( $form->{id} ) {
 
 		  for ( 'update', 'post_as_new', 'schedule' ) { $a{$_} = 1 }
@@ -345,37 +340,7 @@
 }
  
 
-sub save_temp {
-    use LedgerSMB;
-    use LedgerSMB::DBObject::TransTemplate;
-    my $lsmb = LedgerSMB->new();
-    my ($department_name, $department_id) = split/--/, $form->{department};
-    $lsmb->{department_id} = $department_id;
-    $lsmb->{source} = $form->{reference};
-    $lsmb->{description} = $form->{description};
-    $lsmb->{department_id} = $department_id;
-    $lsmb->{transaction_date} = $form->{transdate};
-    $lsmb->{type} = 'gl';
-    $lsmb->{journal_lines} = [];
-    for my $iter (0 .. $form->{rowcount}){
-        if ($form->{"accno_$iter"} and 
-                  (($form->{"credit_$iter"} != 0) or ($form->{"debit_$iter"} != 0))){
-             my ($acc_id, $acc_name) = split /--/, $form->{"accno_$iter"};
-             my $amount = $form->{"credit_$iter"} || ( $form->{"debit_$iter"} 
-                                                     * -1 );
-             push @{$lsmb->{journal_lines}}, 
-                  {accno => $acc_id,
-                   amount => $amount, 
-                   cleared => false,
-                  };
-        }
-    }
-    $template = LedgerSMB::DBObject::TransTemplate->new(base => $lsmb);
-    $template->save;
-    $form->redirect( $locale->text('Template Saved!') );
-}
 
-
 sub display_row
 {
  


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