[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[2941] addons/1.3/assets/trunk
- Subject: SF.net SVN: ledger-smb:[2941] addons/1.3/assets/trunk
- From: ..hidden..
- Date: Tue, 02 Mar 2010 19:36:49 +0000
Revision: 2941
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2941&view=rev
Author: einhverfr
Date: 2010-03-02 19:36:49 +0000 (Tue, 02 Mar 2010)
Log Message:
-----------
Omitting Javascript setup when editing asset
Modified Paths:
--------------
addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset.pm
addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset_Report.pm
addons/1.3/assets/trunk/UI/asset/asset.js
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-03-02 16:51:51 UTC (rev 2940)
+++ addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset.pm 2010-03-02 19:36:49 UTC (rev 2941)
@@ -53,7 +53,12 @@
@{$self->{departments}} = $self->exec_method(funcname => 'department__list_all');
@{$self->{asset_accounts}} = $self->exec_method(funcname => 'asset_class__get_asset_accounts');
@{$self->{dep_accounts}} = $self->exec_method(funcname => 'asset_class__get_dep_accounts');
- my @dep_methods = $self->exec_method(funcname => 'asset_class__get_dep_methods');
+ @{$self->{exp_accounts}} = $self->exec_method(
+ funcname => 'asset_report__get_expense_accts'
+ );
+ my @dep_methods = $self->exec_method(
+ funcname => 'asset_class__get_dep_methods'
+ );
for my $dep(@dep_methods){
$self->{dep_method}->{$dep->{id}} = $dep;
}
@@ -63,6 +68,10 @@
for my $acc (@{$self->{dep_accounts}}){
$acc->{text} = $acc->{accno} . '--' . $acc->{description};
}
+ for my $acc (@{$self->{exp_accounts}}){
+ $acc->{text} = $acc->{accno} . '--' . $acc->{description};
+ }
+ $self->debug({file => '/tmp/asset2'});
}
sub get_next_tag {
Modified: addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset_Report.pm
===================================================================
--- addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset_Report.pm 2010-03-02 16:51:51 UTC (rev 2940)
+++ addons/1.3/assets/trunk/LedgerSMB/DBObject/Asset_Report.pm 2010-03-02 19:36:49 UTC (rev 2941)
@@ -44,7 +44,6 @@
$self->merge($ref);
$self->{report_lines} = [];
@{$self->{report_lines}} = $self->exec_method(funcname => 'asset_report__get_lines');
- $self->debug({file => '/tmp/areport'});
return;
}
Modified: addons/1.3/assets/trunk/UI/asset/asset.js
===================================================================
--- addons/1.3/assets/trunk/UI/asset/asset.js 2010-03-02 16:51:51 UTC (rev 2940)
+++ addons/1.3/assets/trunk/UI/asset/asset.js 2010-03-02 19:36:49 UTC (rev 2941)
@@ -38,6 +38,9 @@
}
function init(){
+ if (document.GetElementById('id').value > 0){
+ return;
+ }
document.getElementById('asset-class').addEventListener('blur', Function('setDefaultAccount()'), false);
setDefaultAccount();
document.getElementById('update-accounts').setAttribute('class', 'generic');
Modified: addons/1.3/assets/trunk/scripts/asset.pl
===================================================================
--- addons/1.3/assets/trunk/scripts/asset.pl 2010-03-02 16:51:51 UTC (rev 2940)
+++ addons/1.3/assets/trunk/scripts/asset.pl 2010-03-02 19:36:49 UTC (rev 2941)
@@ -156,6 +156,7 @@
my ($request) = @_;
my $asset = LedgerSMB::DBObject::Asset->new(base => $request);
$asset->get();
+ $asset->get_metadata();
for my $label (qw(purchase_value salvage_value usable_life)){
$asset->{$label} = $asset->format_amount({amount => $asset->{$label}});
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.