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

SF.net SVN: ledger-smb:[3036] addons/1.3/assets/trunk



Revision: 3036
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3036&view=rev
Author:   einhverfr
Date:     2010-07-30 17:41:51 +0000 (Fri, 30 Jul 2010)

Log Message:
-----------
Correcting parse error due to reserved words in Asset.pm

Modified Paths:
--------------
    addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset.pm
    addons/1.3/assets/trunk/UI/asset/import_asset.html
    addons/1.3/assets/trunk/scripts/asset.pl

Modified: addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset.pm
===================================================================
--- addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset.pm	2010-07-30 03:53:23 UTC (rev 3035)
+++ addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset.pm	2010-07-30 17:41:51 UTC (rev 3036)
@@ -93,7 +93,7 @@
     $self->{dbh}->commit;
 }
 
-sub import {
+sub import_asset {
     my ($self) =  @_;
     my ($ref) = $self->exec_method(funcname => 'asset_report__import');
     return $ref;

Modified: addons/1.3/assets/trunk/UI/asset/import_asset.html
===================================================================
--- addons/1.3/assets/trunk/UI/asset/import_asset.html	2010-07-30 03:53:23 UTC (rev 3035)
+++ addons/1.3/assets/trunk/UI/asset/import_asset.html	2010-07-30 17:41:51 UTC (rev 3036)
@@ -50,7 +50,7 @@
 	type = "submit"
 	class = "submit"
 	name = "action"
-	value = "asset_save"
+	value = "run_import"
 } ?>
 </div>
 </form>

Modified: addons/1.3/assets/trunk/scripts/asset.pl
===================================================================
--- addons/1.3/assets/trunk/scripts/asset.pl	2010-07-30 03:53:23 UTC (rev 3035)
+++ addons/1.3/assets/trunk/scripts/asset.pl	2010-07-30 17:41:51 UTC (rev 3036)
@@ -11,7 +11,9 @@
 use LedgerSMB::DBObject::Asset_Report;
 use strict;
 
-my @file_columns = qw(tag purchase_date description asset_class location vendor invoice department GL asset_account purchase_value accum_depreciation nbv);
+my @file_columns = qw(tag purchase_date description asset_class location vendor 
+                      invoice department GL asset_account purchase_value 
+                      accum_depreciation nbv);
 
 
 sub begin_depreciation_all {
@@ -837,30 +839,33 @@
     $template->render($request);
 }
 
-sub import {
+sub run_import {
+
     my ($request) = @_;
     my $asset = LedgerSMB::DBObject::Asset->new({base => $request});
     $asset->get_metadata;
-    my ($report_results) = $asset->call_procedure(
+
+    my @rresults = $asset->call_procedure(
                                procname => 'asset_report__begin_import', 
-                                   args => [$self->{asset_classes}->[0]->{id},
+                                   args => [$asset->{asset_classes}->[0]->{id},
                                             'today']
     );
+    my $report_results = shift @rresults;
     
     my $department = {};
     my $location = {};
-    my $class = {}
+    my $class = {};
     my $asset_account = {};
-    for my $c (@{$self->{asset_classes}}){
+    for my $c (@{$asset->{asset_classes}}){
         $class->{"$c->{label}"} = $c; 
     }
-    for my $l (@{$self->{locations}}){
+    for my $l (@{$asset->{locations}}){
         $location->{"$l->{description}"} = $l->{id};
     }
-    for my $d (@{$self->{departments}}){
+    for my $d (@{$asset->{departments}}){
         $department->{"$d->{description}"} = $d->{id};
     }
-    for my $a (@{$self->{asset_accounts}}){
+    for my $a (@{$asset->{asset_accounts}}){
        $asset_account->{"$a->{accno}"} = $a;
     }
     for my $ai ($asset->import_file($request->{import_file})){
@@ -869,7 +874,7 @@
         $ai->{department} = $department->{"$ai->{department}"};
         $ai->{asset_class} = $class->{"$ai->{asset_class}"}->{id};
         $ai->{dep_account_id} = $class->{"$ai->{asset_class}"}->{dep_account_id};
-        $ai->{asset_account_id = $asset_account->{"$ai->{asset_account}"}->{id};
+        $ai->{asset_account_id} = $asset_account->{"$ai->{asset_account}"}->{id};
         
         for my $l (@{$asset->{locations}}){
             if ($ai->{location} eq $l->{description}){
@@ -890,7 +895,7 @@
             my $attr = $ai->{$attr_name};
             $ai->{$attr} = $asset->{"${attr}_name"};
         }
-        $ai->import;
+        $ai->import_asset;
     }
     $request->{info} = $request->{_locale}->text('File Imported');
     begin_import($request);


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