[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[5085] trunk/LedgerSMB
- Subject: SF.net SVN: ledger-smb:[5085] trunk/LedgerSMB
- From: ..hidden..
- Date: Fri, 03 Aug 2012 05:17:10 +0000
Revision: 5085
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5085&view=rev
Author: einhverfr
Date: 2012-08-03 05:17:09 +0000 (Fri, 03 Aug 2012)
Log Message:
-----------
Moving reports in 1.4 over to a cached-code-friendly API.
Modified Paths:
--------------
trunk/LedgerSMB/Report/Aging.pm
trunk/LedgerSMB/Report/Budget/Search.pm
trunk/LedgerSMB/Report/Budget/Variance.pm
trunk/LedgerSMB/Report/COA.pm
trunk/LedgerSMB/Report/Contact/History.pm
trunk/LedgerSMB/Report/Contact/Purchase.pm
trunk/LedgerSMB/Report/Contact/Search.pm
trunk/LedgerSMB/Report/GL.pm
trunk/LedgerSMB/Report/Inventory/Adj_Details.pm
trunk/LedgerSMB/Report/Inventory/Search_Adj.pm
trunk/LedgerSMB/Report/Margin/ECA.pm
trunk/LedgerSMB/Report/Margin/Invoice.pm
trunk/LedgerSMB/Report/PNL/Income_Statement.pm
trunk/LedgerSMB/Report/Trial_Balance.pm
trunk/LedgerSMB/Report/Unapproved/Batch_Detail.pm
trunk/LedgerSMB/Report/Unapproved/Batch_Overview.pm
trunk/LedgerSMB/Report/Unapproved/Drafts.pm
trunk/LedgerSMB/Report/co/Balance_y_Mayor.pm
trunk/LedgerSMB/Report/co/Caja_Diaria.pm
trunk/LedgerSMB/Report.pm
Added Paths:
-----------
trunk/LedgerSMB/I18N.pm
Added: trunk/LedgerSMB/I18N.pm
===================================================================
--- trunk/LedgerSMB/I18N.pm (rev 0)
+++ trunk/LedgerSMB/I18N.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -0,0 +1,34 @@
+=head1 NAME
+
+LedgerSMB::I18N - Translation role for LedgerSMB Moose classes
+
+=head1 SYNPOSIS
+
+ text('text to translate')
+
+=head1 DESCRIPTION
+
+This adds a single method, text() to a role. This maps to the current
+LedgerSMB::App_State::Locale's text method. This is safe for cached code since
+we look only to the current locale.
+
+=cut
+
+package LedgerSMB::I18N;
+use Moose::Role;
+use LedgerSMB::App_State;
+
+sub text {
+ my ($string) = @_;
+ return $LedgerSMB::App_State::Locale->text($string);
+}
+
+=head1 COPYRIGHT
+
+COPYRIGHT (C) 2012 The LedgerSMB Core Team. This file may be re-used under the
+terms of the LedgerSMB General Public License version 2 or at your option any
+later version. Please see enclosed LICENSE file for details.
+
+=cut
+
+1;
Modified: trunk/LedgerSMB/Report/Aging.pm
===================================================================
--- trunk/LedgerSMB/Report/Aging.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Aging.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -26,7 +26,6 @@
use LedgerSMB::DBObject::Business_Unit;
use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
=head1 PROPERTIES
@@ -76,9 +75,9 @@
our @COLUMNS = ();
my $credit_label;
if ($self->entity_class == 1) {
- $credit_label = $LedgerSMB::App_State::Locale->text('Vendor');
+ $credit_label = text('Vendor');
} elsif ($self->entity_class == 2){
- $credit_label = $LedgerSMB::App_State::Locale->text('Customer');
+ $credit_label = text('Customer');
}
push @COLUMNS,
{col_id => 'select',
@@ -90,57 +89,57 @@
pwidth => 1, },
{col_id => 'language',
- name => $locale->text('Language'),
+ name => text('Language'),
type => 'select',
pwidth => '0', };
if ($self->report_type eq 'detail'){
push @COLUMNS,
{col_id => 'invnumber',
- name => $locale->text('Invoice'),
+ name => text('Invoice'),
type => 'href',
href_base => '',
pwidth => '3', },
{col_id => 'ordnumber',
- name => $locale->text('Description'),
+ name => text('Description'),
type => 'text',
pwidth => '6', },
{col_id => 'transdate',
- name => $locale->text('Date'),
+ name => text('Date'),
type => 'text',
pwidth => '1', },
{col_id => 'duedate',
- name => $locale->text('Due Date'),
+ name => text('Due Date'),
type => 'text',
pwidth => '2', };
}
push @COLUMNS,
{col_id => 'c0',
- name => $locale->text('Current'),
+ name => text('Current'),
type => 'text',
pwidth => '2', },
{col_id => 'c30',
- name => $locale->text('30'),
+ name => text('30'),
type => 'text',
pwidth => '3', },
{col_id => 'c60',
- name => $locale->text('60'),
+ name => text('60'),
type => 'text',
pwidth => '3', },
{col_id => 'c90',
- name => $locale->text('90'),
+ name => text('90'),
type => 'text',
pwidth => '3', },
{col_id => 'total',
- name => $locale->text('Total'),
+ name => text('Total'),
type => 'text',
pwidth => '1', };
return ..hidden..;
@@ -165,7 +164,7 @@
=cut
sub name {
- return $locale->text('Aging Report');
+ return text('Aging Report');
}
=item template
Modified: trunk/LedgerSMB/Report/Budget/Search.pm
===================================================================
--- trunk/LedgerSMB/Report/Budget/Search.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Budget/Search.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -18,8 +18,6 @@
use Moose;
extends 'LedgerSMB::Report';
-use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
=head1 PROPERTIES
@@ -67,34 +65,34 @@
return [ {col_id => 'start_date',
type => 'href',
href_base => 'budget_reports.pl?action=variance_report&id=',
- name => $locale->text('Start Date') },
+ name => text('Start Date') },
{col_id => 'end_date',
type => 'href',
href_base => 'budget_reports.pl?action=variance_report&id=',
- name => $locale->text('End Date') },
+ name => text('End Date') },
{col_id => 'reference',
type => 'href',
href_base => 'budgets.pl?action=view_budget&id=',
- name => $locale->text('Reference') },
+ name => text('Reference') },
{col_id => 'description',
type => 'href',
href_base => 'budgets.pl?action=view_budget&id=',
- name => $locale->text('Description') },
+ name => text('Description') },
{col_id => 'entered_by_name',
type => 'text',
- name => $locale->text('Entered By') },
+ name => text('Entered By') },
{col_id => 'approved_by_name',
type => 'text',
- name => $locale->text('Approved By') },
+ name => text('Approved By') },
{col_id => 'obsolete_by_name',
type => 'text',
- name => $locale->text('Obsolete By') },
+ name => text('Obsolete By') },
];
}
@@ -106,7 +104,7 @@
=cut
sub name {
- return $locale->text('Budget Search Results');
+ return text('Budget Search Results');
}
=item header_lines
@@ -117,15 +115,15 @@
sub header_lines {
return [{name => 'date_from',
- text => $locale->text('Start Date')},
+ text => text('Start Date')},
{name => 'date_to',
- text => $locale->text('End Date')},
+ text => text('End Date')},
{name => 'accno',
- text => $locale->text('Account Number')},
+ text => text('Account Number')},
{name => 'reference',
- text => $locale->text('Reference')},
+ text => text('Reference')},
{name => 'source',
- text => $locale->text('Source')}];
+ text => text('Source')}];
}
=back
Modified: trunk/LedgerSMB/Report/Budget/Variance.pm
===================================================================
--- trunk/LedgerSMB/Report/Budget/Variance.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Budget/Variance.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -20,8 +20,6 @@
package LedgerSMB::Report::Budget::Variance;
use Moose;
extends 'LedgerSMB::Report';
-use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
=head1 PROPERTIES
@@ -65,27 +63,27 @@
return [
{col_id => 'budget_description',
type => 'text',
- name => $locale->text('Description')},
+ name => text('Description')},
{col_id => 'accno',
type => 'text',
- name => $locale->text('Account Number')},
+ name => text('Account Number')},
{col_id => 'account_label',
type => 'text',
- name => $locale->text('Account Label')},
+ name => text('Account Label')},
{col_id => 'budget_amount',
type => 'text',
- name => $locale->text('Amount Budgetted')},
+ name => text('Amount Budgetted')},
{col_id => 'used_amount',
type => 'text',
- name => '- ' . $locale->text('Used')},
+ name => '- ' . text('Used')},
{col_id => 'variance',
type => 'text',
- name => '= ' . $locale->text('Variance')},
+ name => '= ' . text('Variance')},
];
}
@@ -96,7 +94,7 @@
=cut
sub name {
- return $locale->text('Budget Variance Report');
+ return text('Budget Variance Report');
}
=item header_lines
@@ -107,13 +105,13 @@
sub header_lines {
return [{name => 'reference',
- text => $locale->text('Budget Number')},
+ text => text('Budget Number')},
{name => 'description',
- text => $locale->text('Description')},
+ text => text('Description')},
{name => 'start_date',
- text => $locale->text('Start Date')},
+ text => text('Start Date')},
{name => 'end_date',
- text => $locale->text('End Date')},];
+ text => text('End Date')},];
}
=back
Modified: trunk/LedgerSMB/Report/COA.pm
===================================================================
--- trunk/LedgerSMB/Report/COA.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/COA.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -30,7 +30,6 @@
use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
=head1 PROPERTIES
@@ -83,45 +82,45 @@
our @COLUMNS = (
{col_id => 'accno',
- name => $locale->text('Account Number'),
+ name => text('Account Number'),
type => 'href',
href_base => '',
pwidth => '2', },
{col_id => 'description',
- name => $locale->text('Description'),
+ name => text('Description'),
type => 'href',
href_base => '',
pwidth => '6', },
{col_id => 'gifi_accno',
- name => $locale->text('GIFI'),
+ name => text('GIFI'),
type => 'text',
pwidth => '1', },
{col_id => 'debit_balance',
- name => $locale->text('Debits'),
+ name => text('Debits'),
type => 'text',
pwidth => '2', },
{col_id => 'credit_balance',
- name => $locale->text('Credits'),
+ name => text('Credits'),
type => 'text',
pwidth => '2', },
{col_id => 'link',
- name => $locale->text('Dropdowns'),
+ name => text('Dropdowns'),
type => 'text',
pwidth => '3', },
{col_id => 'edit',
- name => $locale->text('Edit'),
+ name => text('Edit'),
type => 'href',
href_base => '',
pwidth => '3', },
{col_id => 'delete',
- name => $locale->text('Delete'),
+ name => text('Delete'),
type => 'href',
href_base => '',
pwidth => '3', },
@@ -139,7 +138,7 @@
=cut
sub name {
- return $locale->text('Chart of Accounts');
+ return text('Chart of Accounts');
}
=item header_lines
@@ -188,8 +187,8 @@
} else {
$ct = 'A';
}
- $r->{edit} = '['.$locale->text('Edit').']';
- $r->{delete} = '['.$locale->text('Delete').']'
+ $r->{edit} = '['.text('Edit').']';
+ $r->{delete} = '['.text('Delete').']'
if !$r->{rowcount} and !$r->{is_heading};
$r->{edit_href_suffix} = 'account.pl?action=edit&id='.$r->{id} .
"&charttype=$ct";
Modified: trunk/LedgerSMB/Report/Contact/History.pm
===================================================================
--- trunk/LedgerSMB/Report/Contact/History.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Contact/History.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -27,11 +27,8 @@
package LedgerSMB::Report::Contact::History;
use Moose;
extends 'LedgerSMB::Report';
-use LedgerSMB::App_State;
use LedgerSMB::PGDate;
-my $locale = $LedgerSMB::App_State::Locale;
-
=head1 PROPERTIES
=over
@@ -52,60 +49,60 @@
return [
{col_id => 'name',
type => 'text',
- name => $locale->text('Name') },
+ name => text('Name') },
{col_id => 'meta_number',
type => 'text',
- name => $locale->text('Account Number') },
+ name => text('Account Number') },
{col_id => 'invnumber',
type => 'href',
href_base => 'is.pl?action=edit&id=',
- name => $locale->text('Invoice Number') },
+ name => text('Invoice Number') },
{col_id => 'curr',
type => 'text',
- name => $locale->text('Currency') },
+ name => text('Currency') },
{col_id => 'partnumber',
type => 'text',
- name => $locale->text('Part Number') },
+ name => text('Part Number') },
{col_id => 'description',
type => 'text',
- name => $locale->text('Description') },
+ name => text('Description') },
{col_id => 'qty',
type => 'text',
- name => $locale->text('Qty') },
+ name => text('Qty') },
{col_id => 'unit',
type => 'text',
- name => $locale->text('Unit') },
+ name => text('Unit') },
{col_id => 'sellprice',
type => 'text',
- name => $locale->text('Sell Price') },
+ name => text('Sell Price') },
{col_id => 'discount',
type => 'text',
- name => $locale->text('Disc') },
+ name => text('Disc') },
{col_id => 'delivery_date',
type => 'text',
- name => $locale->text('Delivery Date') },
+ name => text('Delivery Date') },
{col_id => 'serialnumber',
type => 'text',
- name => $locale->text('Serial Number') },
+ name => text('Serial Number') },
{col_id => 'exchangerate',
type => 'text',
- name => $locale->text('Exchange Rate') },
+ name => text('Exchange Rate') },
{col_id => 'salesperson_name',
type => 'text',
- name => $locale->text('Salesperson') },
+ name => text('Salesperson') },
];
}
@@ -114,7 +111,7 @@
=cut
-sub name { return $locale->text('Purchase History') }
+sub name { return text('Purchase History') }
=item header_lines
@@ -123,15 +120,15 @@
sub header_lines {
return [
{name => 'name',
- text => $locale->text('Name')},
+ text => text('Name')},
{name => 'meta_number',
- text => $locale->text('Account Number')},
+ text => text('Account Number')},
{name => 'from_date',
- text => $locale->text('Start Date')},
+ text => text('Start Date')},
{name => 'to_date',
- text => $locale->text('End Date')},
+ text => text('End Date')},
];
Modified: trunk/LedgerSMB/Report/Contact/Purchase.pm
===================================================================
--- trunk/LedgerSMB/Report/Contact/Purchase.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Contact/Purchase.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -29,10 +29,7 @@
package LedgerSMB::Report::Contact::Purchase;
use Moose;
extends 'LedgerSMB::Report';
-use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
-
=head1 PROPERTIES
=over
@@ -55,63 +52,63 @@
{col_id => 'id',
type => 'text',
- name => $locale->text('ID') },
+ name => text('ID') },
{col_id => 'entity_name',
type => 'text',
- name => $locale->text('Name') },
+ name => text('Name') },
{col_id => 'invnumber',
type => 'href',
href_base => '',
- name => $locale->text('Invoice Number') },
+ name => text('Invoice Number') },
{col_id => 'ordnumber',
type => 'text',
- name => $locale->text('Order Number') },
+ name => text('Order Number') },
{col_id => 'ponumber',
type => 'text',
- name => $locale->text('PO Number') },
+ name => text('PO Number') },
{col_id => 'curr',
type => 'text',
- name => $locale->text('Currency') },
+ name => text('Currency') },
{col_id => 'amount',
type => 'text',
- name => $locale->text('Amount') },
+ name => text('Amount') },
{col_id => 'tax',
type => 'text',
- name => $locale->text('Tax') },
+ name => text('Tax') },
{col_id => 'paid',
type => 'text',
- name => $locale->text('Paid') },
+ name => text('Paid') },
{col_id => 'due',
type => 'text',
- name => $locale->text('Due') },
+ name => text('Due') },
{col_id => 'date_paid',
type => 'text',
- name => $locale->text('Date Paid') },
+ name => text('Date Paid') },
{col_id => 'due_date',
type => 'text',
- name => $locale->text('Due Date') },
+ name => text('Due Date') },
{col_id => 'notes',
type => 'text',
- name => $locale->text('Notes') },
+ name => text('Notes') },
{col_id => 'shipping_point',
type => 'text',
- name => $locale->text('Shipping Point') },
+ name => text('Shipping Point') },
{col_id => 'ship_via',
type => 'text',
- name => $locale->text('Ship Via') },
+ name => text('Ship Via') },
];
}
@@ -122,9 +119,9 @@
sub name {
my ($self) = @_;
if ($self->entity_class == 1){
- return $locale->text('AP Transactions');
+ return text('AP Transactions');
} elsif ($self->entity_class == 2){
- return $locale->text('AR Transactions');
+ return text('AR Transactions');
}
}
@@ -135,9 +132,9 @@
sub header_lines {
return [
{name => 'name_part',
- text => $locale->text('Name')},
+ text => text('Name')},
{name => 'meta_number',
- text => $locale->text('Account Number')}
+ text => text('Account Number')}
];
}
Modified: trunk/LedgerSMB/Report/Contact/Search.pm
===================================================================
--- trunk/LedgerSMB/Report/Contact/Search.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Contact/Search.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -28,10 +28,7 @@
package LedgerSMB::Report::Contact::Search;
use Moose;
extends 'LedgerSMB::Report';
-use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
-
=head1 PROPERTIES
=over
@@ -53,33 +50,33 @@
return [
{col_id => 'name',
type => 'text',
- name => $locale->text('Name') },
+ name => text('Name') },
{col_id => 'entity_control_code',
type => 'href',
href_base =>($self->entity_class == 3)
? "employee.pl?action=get"
:"contact.pl?action=get&entity_class=".$self->entity_class,
- name => $locale->text('Control Code') },
+ name => text('Control Code') },
{col_id => 'meta_number',
type => 'href',
href_base => ($self->entity_class == 3)
? "employee.pl?action=get"
: "contact.pl?action=get&entity_class=".$self->entity_class,
- name => $locale->text('Credit Account Number') },
+ name => text('Credit Account Number') },
{col_id => 'credit_description',
type => 'text',
- name => $locale->text('Description') },
+ name => text('Description') },
{col_id => 'business_type',
type => 'text',
- name => $locale->text('Business Type') },
+ name => text('Business Type') },
{col_id => 'curr',
type => 'text',
- name => $locale->text('Currency') },
+ name => text('Currency') },
];
}
@@ -87,7 +84,7 @@
=cut
-sub name { return $locale->text('Contact Search') }
+sub name { return text('Contact Search') }
=item header_lines
@@ -96,9 +93,9 @@
sub header_lines {
return [
{name => 'name_part',
- text => $locale->text('Name')},
+ text => text('Name')},
{name => 'meta_number',
- text => $locale->text('Account Number')}
+ text => text('Account Number')}
];
}
Modified: trunk/LedgerSMB/Report/GL.pm
===================================================================
--- trunk/LedgerSMB/Report/GL.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/GL.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -31,8 +31,6 @@
use LedgerSMB::DBObject::Business_Unit;
use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
-
=head1 PROPERTIES
=over
@@ -77,95 +75,94 @@
=cut
-our @COLUMNS = (
+sub columns {
+
+ my @COLS = (
{col_id => 'id',
- name => $locale->text('ID'),
+ name => text('ID'),
type => 'text',
pwidth => 1, },
{col_id => 'transdate',
- name => $locale->text('Date'),
+ name => text('Date'),
type => 'text',
pwidth => '4', },
{col_id => 'reference',
- name => $locale->text('Reference'),
+ name => text('Reference'),
type => 'href',
href_base => '',
pwidth => '3', },
{col_id => 'description',
- name => $locale->text('Description'),
+ name => text('Description'),
type => 'text',
pwidth => '6', },
{col_id => 'entry_id',
- name => $locale->text('Entry ID'),
+ name => text('Entry ID'),
type => 'text',
pwidth => '1', },
{col_id => 'debits',
- name => $locale->text('Debits'),
+ name => text('Debits'),
type => 'text',
pwidth => '2', },
{col_id => 'credits',
- name => $locale->text('Credits'),
+ name => text('Credits'),
type => 'text',
pwidth => '2', },
{col_id => 'source',
- name => $locale->text('Source'),
+ name => text('Source'),
type => 'text',
pwidth => '3', },
{col_id => 'memo',
- name => $locale->text('Memo'),
+ name => text('Memo'),
type => 'text',
pwidth => '3', },
{col_id => 'cleared',
- name => $locale->text('Cleared'),
+ name => text('Cleared'),
type => 'text',
pwidth => '3', },
{col_id => 'till',
- name => $locale->text('Till'),
+ name => text('Till'),
type => 'text',
pwidth => '1', },
{col_id => 'chart_id',
- name => $locale->text('Chart ID'),
+ name => text('Chart ID'),
type => 'text',
pwidth => '1', },
{col_id => 'accno',
- name => $locale->text('Account No.'),
+ name => text('Account No.'),
type => 'text',
pwidth => '3', },
{col_id => 'accname',
- name => $locale->text('Account Name'),
+ name => text('Account Name'),
type => 'text',
pwidth => '3', },
{col_id => 'gifi_accno',
- name => $locale->text('GIFI'),
+ name => text('GIFI'),
type => 'text',
pwidth => '3', },
{col_id => 'running_balance',
- name => $locale->text('Balance'),
+ name => text('Balance'),
type => 'text',
pwidth => '3', },
-);
-
-sub columns {
+ );
my @bclasses = LedgerSMB::DBObject::Business_Unit_Class->list('1', 'gl');
- my @COLS = @COLUMNS;
for my $class (@bclasses){
push @COLS, {col_id => "bc_" . $class->id,
- name => $locale->text($class->label),
+ name => text($class->label),
type => 'text',
pwidth => '2'};
}
@@ -189,7 +186,7 @@
=cut
sub name {
- return $locale->text('General Ledger Report');
+ return text('General Ledger Report');
}
=item header_lines
@@ -200,15 +197,15 @@
sub header_lines {
return [{name => 'from_date',
- text => $locale->text('Start Date')},
+ text => text('Start Date')},
{name => 'to_date',
- text => $locale->text('End Date')},
+ text => text('End Date')},
{name => 'accno',
- text => $locale->text('Account Number')},
+ text => text('Account Number')},
{name => 'reference',
- text => $locale->text('Reference')},
+ text => text('Reference')},
{name => 'source',
- text => $locale->text('Source')}];
+ text => text('Source')}];
}
=item subtotal_cols
Modified: trunk/LedgerSMB/Report/Inventory/Adj_Details.pm
===================================================================
--- trunk/LedgerSMB/Report/Inventory/Adj_Details.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Inventory/Adj_Details.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -13,12 +13,9 @@
package LedgerSMB::Report::Inventory::Adj_Details;
use Moose;
-use LedgerSMB::App_State;
use LedgerSMB::Report::Inventory::Search_Adj;
extends 'LedgerSMB::Report';
-my $locale = $LedgerSMB::App_State::Locale;
-
=head1 DESCRIPTION
This report shows the details of an inventory adjustment report.
@@ -59,14 +56,14 @@
=cut
-sub name { return $locale->text('Inventory Adjustment Details') }
+sub name { return text('Inventory Adjustment Details') }
=item header_lines
=cut
sub header_lines {
- return [{name => 'source', text => $locale->text('Source') }];
+ return [{name => 'source', text => text('Source') }];
}
=item columns
@@ -78,19 +75,19 @@
{col_id => 'partnumber',
type => 'href',
href_base => 'ic.pl?action=edit&id='.
- name => $locale->text('Part Number') },
+ name => text('Part Number') },
{col_id => 'description',
type => 'text',
- name => $locale->text('Description') },
+ name => text('Description') },
{col_id => 'counted',
type => 'text',
- name => $locale->text('Counted') },
+ name => text('Counted') },
{col_id => 'expected',
type => 'text',
- name => $locale->text('Expected') },
+ name => text('Expected') },
{col_id => 'variance',
type => 'text',
- name => $locale->text('Variance') },
+ name => text('Variance') },
];
}
Modified: trunk/LedgerSMB/Report/Inventory/Search_Adj.pm
===================================================================
--- trunk/LedgerSMB/Report/Inventory/Search_Adj.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Inventory/Search_Adj.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -14,8 +14,6 @@
package LedgerSMB::Report::Inventory::Search_Adj;
use Moose;
extends 'LedgerSMB::Report';
-use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
=head1 DESCRIPTION
@@ -66,7 +64,7 @@
=cut
-sub name { return $locale->text('Inventory Adjustments') };
+sub name { return text('Inventory Adjustments') };
=item header_lines
@@ -74,13 +72,13 @@
sub header_lines {
return [{name => 'from_date',
- text => $locale->text('Start Date') },
+ text => text('Start Date') },
{name => 'to_date',
- text => $locale->text('End Date') },
+ text => text('End Date') },
{name => 'partnumber',
- text => $locale->text('Including partnumber') },
+ text => text('Including partnumber') },
{name => 'source',
- text => $locale->text('Source starting with') },
+ text => text('Source starting with') },
];
}
@@ -92,18 +90,18 @@
return [{col_id => 'transdate',
type => 'href',
href_base => 'inv_reports.pl?action=adj_detail&id=',
- name => $locale->text('Date')},
+ name => text('Date')},
{col_id => 'source',
type => 'href',
href_base => 'inv_reports.pl?action=adj_detail&id=',
- name => $locale->text('Reference')},
+ name => text('Reference')},
{col_id => 'ar_invnumber',
type => 'href',
- name => $locale->text('AR Invoice'),
+ name => text('AR Invoice'),
href_base => 'is.pl?action=edit&id='},
{col_id => 'ap_invnumber',
type => 'href',
- name => $locale->text('AP Invoice'),
+ name => text('AP Invoice'),
href_base => 'ir.pl?action=edit&id='},
];
}
Modified: trunk/LedgerSMB/Report/Margin/ECA.pm
===================================================================
--- trunk/LedgerSMB/Report/Margin/ECA.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Margin/ECA.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -12,11 +12,8 @@
package LedgerSMB::Report::Margin::ECA;
use Moose;
-use LedgerSMB::App_State;
extends 'LedgerSMB::Report';
-my $locale = LedgerSMB::App_State::Locale;
-
=head1 DESCRIPTION
This report provides a comparison of income vs direct expenses (COGS) for a
@@ -67,7 +64,7 @@
=cut
-sub name { return $locale->text('Margin Report for Customer'); }
+sub name { return text('Margin Report for Customer'); }
=item columns
@@ -83,7 +80,7 @@
sub header_lines {
return [{ name => 'meta_number',
- text => $locale->text('Customer Number')}
+ text => text('Customer Number')}
];
}
Modified: trunk/LedgerSMB/Report/Margin/Invoice.pm
===================================================================
--- trunk/LedgerSMB/Report/Margin/Invoice.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Margin/Invoice.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -13,11 +13,8 @@
package LedgerSMB::Report::Margin::Invoice;
use Moose;
-use LedgerSMB::App_State;
extends 'LedgerSMB::Report';
-my $locale = LedgerSMB::App_State::Locale;
-
=head1 DESCRIPTION
This report provides a comparison of income vs direct expenses (COGS) for a
@@ -53,7 +50,7 @@
=cut
-sub name { return $locale->text('Margin Report for Invoice') };
+sub name { return text('Margin Report for Invoice') };
=item columns
@@ -69,7 +66,7 @@
sub header_lines {
return [{ name => 'invnumber',
- text => $locale->text('Invoice Number')}
+ text => text('Invoice Number')}
];
}
Modified: trunk/LedgerSMB/Report/PNL/Income_Statement.pm
===================================================================
--- trunk/LedgerSMB/Report/PNL/Income_Statement.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/PNL/Income_Statement.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -18,9 +18,6 @@
extends 'LedgerSMB::Report';
with 'LedgerSMB::Report::Dates';
-use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
-
=head1 CRITERIA PROPERTIES
Standard dates plus
@@ -54,7 +51,7 @@
=cut
-sub name { return $locale->text('Income Statement') }
+sub name { return text('Income Statement') }
=item header_lines
@@ -62,7 +59,7 @@
sub header_lines {
return [{name => 'basis',
- text => $locale->text('Reporting Basis') }];
+ text => text('Reporting Basis') }];
}
=item columns
@@ -84,7 +81,7 @@
sub report_base {
my ($self, $from_date, $to_date) = @_;
- die $locale->text('Invalid Reporting Basis')
+ die text('Invalid Reporting Basis')
if ($self->basis ne 'accrual') and ($self->basis ne 'cash');
my $procname = 'pnl__income_statement_' . $self->basis;
return $self->call_procedure(
Modified: trunk/LedgerSMB/Report/Trial_Balance.pm
===================================================================
--- trunk/LedgerSMB/Report/Trial_Balance.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Trial_Balance.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -28,8 +28,6 @@
with 'LedgerSMB::Report::Dates';
extends 'LedgerSMB::Report';
-my $locale = $LedgerSMB::App_State::Locale;
-
=head1 DESCRIPTION
The trial balance is a report used to test the books and whether they balance
@@ -114,7 +112,7 @@
=cut
sub name {
- return $locale->text('Trial Balance');
+ return text('Trial Balance');
};
=item columns
@@ -126,33 +124,33 @@
{col_id => 'account_number',
type => 'href',
href_base => 'journal.pl?action=search&col_transdate=Y&col_reference=Y&col_description=Y&col_debits=Y&col_credits=Y&col_source=Y&col_accno=Y',
- name => $locale->text('Account Number') },
+ name => text('Account Number') },
{col_id => 'account_desc',
type => 'href',
href_base => 'journal.pl?action=search&col_transdate=Y&col_reference=Y&col_description=Y&col_debits=Y&col_credits=Y&col_source=Y&col_accno=Y',
- name => $locale->text('Account Description') },
+ name => text('Account Description') },
{col_id => 'gifi_accno',
type => 'href',
href_base => 'journal.pl?action=search&col_transdate=Y&col_reference=Y&col_description=Y&col_debits=Y&col_credits=Y&col_source=Y&col_accno=Y',
- name => $locale->text('GIFI') } ,
+ name => text('GIFI') } ,
{col_id => 'starting_balance',
type => 'text',
- name => $locale->text('Starting Balance') } ,
+ name => text('Starting Balance') } ,
{col_id => 'debits',
type => 'text',
- name => $locale->text('Debits') } ,
+ name => text('Debits') } ,
{col_id => 'credits',
type => 'text',
- name => $locale->text('Credits') } ,
+ name => text('Credits') } ,
{col_id => 'ending_balance',
type => 'text',
- name => $locale->text('Ending Balance') } ,
+ name => text('Ending Balance') } ,
];
}
@@ -163,11 +161,11 @@
sub header_lines {
return [{name => 'date_from',
- text => $locale->text('From date') },
+ text => text('From date') },
{name => 'date_to',
- text => $locale->text('To Date') },
+ text => text('To Date') },
{name => 'yearend',
- text => $locale->text('Ignore Yearends') },
+ text => text('Ignore Yearends') },
];
}
Modified: trunk/LedgerSMB/Report/Unapproved/Batch_Detail.pm
===================================================================
--- trunk/LedgerSMB/Report/Unapproved/Batch_Detail.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Unapproved/Batch_Detail.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -34,9 +34,7 @@
use LedgerSMB::Business_Unit_Class;
use LedgerSMB::Business_Unit;
-use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
=head1 PROPERTIES
@@ -82,50 +80,47 @@
=cut
-our @COLUMNS = (
+sub columns {
+ return [
{col_id => 'select',
name => '',
type => 'checkbox' },
{col_id => 'id',
- name => $locale->text('ID'),
+ name => text('ID'),
type => 'text',
pwidth => 1, },
{col_id => 'batch_class',
- name => $locale->text('Batch Class'),
+ name => text('Batch Class'),
type => 'text',
pwidth => 2, },
{col_id => 'default_date',
- name => $locale->text('Date'),
+ name => text('Date'),
type => 'text',
pwidth => '4', },
{col_id => 'Reference',
- name => $locale->text('Reference'),
+ name => text('Reference'),
type => 'href',
href_base => '',
pwidth => '3', },
{col_id => 'description',
- name => $locale->text('Description'),
+ name => text('Description'),
type => 'text',
pwidth => '6', },
{col_id => 'amount',
- name => $locale->text('Amount'),
+ name => text('Amount'),
type => 'text',
pwidth => '2', },
+ ];
-);
-
-sub columns {
- return ..hidden..;
+ # TODO: business_units int[]
}
- # TODO: business_units int[]
-
=item name
Returns the localized template name
@@ -133,7 +128,7 @@
=cut
sub name {
- return $locale->text('Voucher List');
+ return text('Voucher List');
}
=item header_lines
@@ -144,7 +139,7 @@
sub header_lines {
return [{name => 'batch_id',
- text => $locale->text('Batch ID')}, ]
+ text => text('Batch ID')}, ]
}
=item subtotal_cols
@@ -190,19 +185,19 @@
$self->buttons([{
name => 'action',
type => 'submit',
- text => $locale->text('Post Batch'),
+ text => text('Post Batch'),
value => 'batch_approve',
class => 'submit',
},{
name => 'action',
type => 'submit',
- text => $locale->text('Delete Batch'),
+ text => text('Delete Batch'),
value => 'batch_delete',
class => 'submit',
},{
name => 'action',
type => 'submit',
- text => $locale->text('Delete Vouchers'),
+ text => text('Delete Vouchers'),
value => 'vouchers_delete',
class => 'submit',
}]);
Modified: trunk/LedgerSMB/Report/Unapproved/Batch_Overview.pm
===================================================================
--- trunk/LedgerSMB/Report/Unapproved/Batch_Overview.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Unapproved/Batch_Overview.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -32,10 +32,7 @@
use LedgerSMB::DBObject::Business_Unit_Class;
use LedgerSMB::DBObject::Business_Unit;
-use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
-
=head1 PROPERTIES
=over
@@ -86,33 +83,33 @@
type => 'checkbox' },
{col_id => 'id',
- name => $locale->text('ID'),
+ name => text('ID'),
type => 'text',
pwidth => 1, },
{col_id => 'default_date',
- name => $locale->text('Date'),
+ name => text('Date'),
type => 'text',
pwidth => '4', },
{col_id => 'control_code',
- name => $locale->text('Control Code'),
+ name => text('Control Code'),
type => 'href',
href_base => 'vouchers.pl?action=get_batch&id=',
pwidth => '3', },
{col_id => 'description',
- name => $locale->text('Description'),
+ name => text('Description'),
type => 'text',
pwidth => '6', },
{col_id => 'transaction_total',
- name => $locale->text('AR/AP/GL Amount'),
+ name => text('AR/AP/GL Amount'),
type => 'text',
pwidth => '2', },
{col_id => 'payment_total',
- name => $locale->text('Payment Amount'),
+ name => text('Payment Amount'),
type => 'text',
pwidth => '2', },
@@ -131,7 +128,7 @@
=cut
sub name {
- return $locale->text('Batch Search');
+ return text('Batch Search');
}
=item header_lines
@@ -142,13 +139,13 @@
sub header_lines {
return [{name => 'type',
- text => $locale->text('Batch Type')},
+ text => text('Batch Type')},
{name => 'reference',
- text => $locale->text('Reference')},
+ text => text('Reference')},
{name => 'amount_gt',
- text => $locale->text('Amount Greater Than')},
+ text => text('Amount Greater Than')},
{name => 'amount_lt',
- text => $locale->text('Amount Less Than')}, ]
+ text => text('Amount Less Than')}, ]
}
=item subtotal_cols
@@ -218,13 +215,13 @@
$self->buttons([{
name => 'action',
type => 'submit',
- text => $locale->text('Post'),
+ text => text('Post'),
value => 'batch_approve',
class => 'submit',
},{
name => 'action',
type => 'submit',
- text => $locale->text('Delete'),
+ text => text('Delete'),
value => 'batch_delete',
class => 'submit',
}]);
Modified: trunk/LedgerSMB/Report/Unapproved/Drafts.pm
===================================================================
--- trunk/LedgerSMB/Report/Unapproved/Drafts.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/Unapproved/Drafts.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -30,10 +30,7 @@
use LedgerSMB::DBObject::Business_Unit_Class;
use LedgerSMB::DBObject::Business_Unit;
-use LedgerSMB::App_State;
-my $locale = $LedgerSMB::App_State::Locale;
-
=head1 PROPERTIES
=over
@@ -72,44 +69,41 @@
=cut
-our @COLUMNS = (
+sub columns {
+ return [
{col_id => 'select',
name => '',
type => 'checkbox' },
{col_id => 'id',
- name => $locale->text('ID'),
+ name => text('ID'),
type => 'text',
pwidth => 1, },
{col_id => 'transdate',
- name => $locale->text('Date'),
+ name => text('Date'),
type => 'text',
pwidth => '4', },
{col_id => 'reference',
- name => $locale->text('Reference'),
+ name => text('Reference'),
type => 'href',
href_base => '',
pwidth => '3', },
{col_id => 'description',
- name => $locale->text('Description'),
+ name => text('Description'),
type => 'text',
pwidth => '6', },
{col_id => 'amount',
- name => $locale->text('AR/AP/GL Amount'),
+ name => text('AR/AP/GL Amount'),
type => 'text',
pwidth => '2', },
-
-);
-
-sub columns {
- return ..hidden..;
+ ];
+ # TODO: business_units int[]
}
- # TODO: business_units int[]
=item name
@@ -118,7 +112,7 @@
=cut
sub name {
- return $locale->text('Draft Search');
+ return text('Draft Search');
}
=item header_lines
@@ -129,13 +123,13 @@
sub header_lines {
return [{name => 'type',
- text => $locale->text('Draft Type')},
+ text => text('Draft Type')},
{name => 'reference',
- text => $locale->text('Reference')},
+ text => text('Reference')},
{name => 'amount_gt',
- text => $locale->text('Amount Greater Than')},
+ text => text('Amount Greater Than')},
{name => 'amount_lt',
- text => $locale->text('Amount Less Than')}, ]
+ text => text('Amount Less Than')}, ]
}
=item subtotal_cols
Modified: trunk/LedgerSMB/Report/co/Balance_y_Mayor.pm
===================================================================
--- trunk/LedgerSMB/Report/co/Balance_y_Mayor.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/co/Balance_y_Mayor.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -27,9 +27,6 @@
use Moose;
extends 'LedgerSMB::Report';
-use LedgerSMB::App_State;
-
-my $locale = $LedgerSMB::App_State::Locale;
my $doctypes = {};
=head1 PROPERTIES
@@ -60,41 +57,40 @@
=cut
-our @COLUMNS = (
+sub columns {
+
+ my @COLS = (
{col_id => 'accno',
- name => $locale->text('Account'),
+ name => text('Account'),
type => 'href',
pwidth => 3,
href_base => '', },
{col_id => 'description',
- name => $locale->text('Description'),
+ name => text('Description'),
type => 'text',
pwidth => '12', },
{col_id => 'starting_balance',
- name => $locale->text('Starting Balance'),
+ name => text('Starting Balance'),
type => 'text',
pwidth => '3', },
{col_id => 'debits',
- name => $locale->text('Debit'),
+ name => text('Debit'),
type => 'text',
pwidth => '4', },
{col_id => 'credits',
- name => $locale->text('Credit'),
+ name => text('Credit'),
type => 'text',
pwidth => '4', },
{col_id => 'ending_balance',
- name => $locale->text('Balance'),
+ name => text('Balance'),
type => 'text',
pwidth => '3', },
-);
-
-sub columns {
- return ..hidden..;
+ );
}
@@ -115,7 +111,7 @@
=cut
sub name {
- return $locale->text('Balance y Mayor');
+ return text('Balance y Mayor');
}
=item header_lines
@@ -126,9 +122,9 @@
sub header_lines {
return [{name => 'date_from',
- text => $locale->text('Start Date')},
+ text => text('Start Date')},
{name => 'date_to',
- text => $locale->text('End Date')},]
+ text => text('End Date')},]
}
=back
Modified: trunk/LedgerSMB/Report/co/Caja_Diaria.pm
===================================================================
--- trunk/LedgerSMB/Report/co/Caja_Diaria.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report/co/Caja_Diaria.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -28,9 +28,6 @@
use Moose;
extends 'LedgerSMB::Report';
-use LedgerSMB::App_State;
-
-my $locale = $LedgerSMB::App_State::Locale;
my $doctypes = {};
=head1 PROPERTIES
@@ -61,37 +58,35 @@
=cut
-our @COLUMNS = (
+
+sub columns {
+ return [
{col_id => 'accno',
- name => $locale->text('Account'),
+ name => text('Account'),
type => 'href',
pwidth => 3,
href_base => '', },
{col_id => 'description',
- name => $locale->text('Description'),
+ name => text('Description'),
type => 'text',
pwidth => '12', },
{col_id => 'document_type',
- name => $locale->text('Document'),
+ name => text('Document'),
type => 'text',
pwidth => '3', },
{col_id => 'debits',
- name => $locale->text('Debit'),
+ name => text('Debit'),
type => 'text',
pwidth => '4', },
{col_id => 'credits',
- name => $locale->text('Credit'),
+ name => text('Credit'),
type => 'text',
pwidth => '4', },
-
-);
-
-sub columns {
- return ..hidden..;
+ ];
}
@@ -112,7 +107,7 @@
=cut
sub name {
- return $locale->text('Caja Diaria');
+ return text('Caja Diaria');
}
=item header_lines
@@ -123,13 +118,13 @@
sub header_lines {
return [{name => 'date_from',
- text => $locale->text('Start Date')},
+ text => text('Start Date')},
{name => 'date_to',
- text => $locale->text('End Date')},
+ text => text('End Date')},
{name => 'accno',
- text => $locale->text('Account Number Start')},
+ text => text('Account Number Start')},
{name => 'reference',
- text => $locale->text('Account Number End')},]
+ text => text('Account Number End')},]
}
=back
Modified: trunk/LedgerSMB/Report.pm
===================================================================
--- trunk/LedgerSMB/Report.pm 2012-08-03 02:37:48 UTC (rev 5084)
+++ trunk/LedgerSMB/Report.pm 2012-08-03 05:17:09 UTC (rev 5085)
@@ -39,7 +39,7 @@
package LedgerSMB::Report;
use Moose;
-with 'LedgerSMB::DBObject_Moose';
+with 'LedgerSMB::DBObject_Moose', 'LedgerSMB::I18N';
use LedgerSMB::Template;
use LedgerSMB::App_State;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.