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

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



Revision: 5013
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5013&view=rev
Author:   einhverfr
Date:     2012-07-18 07:41:00 +0000 (Wed, 18 Jul 2012)
Log Message:
-----------
More fixes for dbobject_moose role

Modified Paths:
--------------
    trunk/LedgerSMB/File.pm
    trunk/sql/modules/LOADORDER

Added Paths:
-----------
    trunk/LedgerSMB/DBObject/Report/Inventory/Adj_Details.pm

Added: trunk/LedgerSMB/DBObject/Report/Inventory/Adj_Details.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Report/Inventory/Adj_Details.pm	                        (rev 0)
+++ trunk/LedgerSMB/DBObject/Report/Inventory/Adj_Details.pm	2012-07-18 07:41:00 UTC (rev 5013)
@@ -0,0 +1,137 @@
+=head1 NAME
+
+LedgerSMB::DBObject::Report::Inventory::Adj_Details - Inventory Adjustment
+Details report for LedgerSMB
+
+=head1 SYNPOSIS
+
+ my $rpt = LedgerSMB::DBObject::Report::Inventory::Adj_Details->new(%$request);
+ $rpt->run_report;
+ $rpt->render($request);
+
+=cut
+
+package LedgerSMB::DBObject::Report::Inventory::Adj_Details;
+use Moose;
+use LedgerSMB::App_State;
+use LedgerSMB::DBObject::Report::Inventory::Search_Adj;
+extends 'LedgerSMB::DBObject::Report';
+
+my $locale = $LedgerSMB::App_State::Locale;
+
+=head1 DESCRIPTION
+
+This report shows the details of an inventory adjustment report.
+
+=head1 CRITERIA PROPERTIES
+
+=over
+
+=item id
+
+This is the report id.
+
+=cut
+
+has id => (is => 'ro', isa => 'Int', required => 1);
+
+=back
+
+=head1 PROPERTIES FOR HEADER
+
+=over
+
+=item source 
+
+Matches the beginning of the source string on the report source string
+
+=cut
+
+has source => (is => 'ro', isa => 'Maybe[Str]');
+
+=back
+
+=head1 REPORT CONSTANT FUNCTIONS
+
+=over
+
+=item name
+
+=cut
+
+sub name { return $locale->text('Inventory Adjustment Details') }
+
+=item header_lines
+
+=cut
+
+sub header_lines {
+    return [{name => 'source', text => $locale->text('Source') }];
+}
+
+=item columns
+
+=cut
+
+sub columns {
+    return [
+      {col_id => 'partnumber',
+         type => 'href',
+    href_base => 'ic.pl?action=edit&id='.
+         name => $locale->text('Part Number') },
+      {col_id => 'description',
+         type => 'text',
+         name => $locale->text('Description') },
+      {col_id => 'counted',
+         type => 'text',
+         name => $locale->text('Counted') },
+      {col_id => 'expected',
+         type => 'text',
+         name => $locale->text('Expected') },
+      {col_id => 'variance',
+         type => 'text',
+         name => $locale->text('Variance') },
+    ];
+}
+
+=head1 METHODS
+
+=over
+
+=item run_report
+
+=cut
+
+sub run_report {
+    my ($self) = @_;
+    my ($rpt) = $self->exec_method({funcname => 'inventory_adj__get'});
+    $self->source($rpt->source);
+    my @rows = $self->exec_method({funcname => 'inventory_adj__details'});
+    for my $row (@rows){
+        $row->{row_id} = $row->{parts_id}; 
+    }
+    $self->rows(..hidden..);
+}
+
+=back
+
+=head1 SEE ALSO
+
+=over
+
+=item LedgerSMB::DBObject::Report;
+
+=item LedgerSMB::DBObject::Report::Inventory::Search_Adj;
+
+=back
+
+=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
+
+__PACKAGE__->meta->make_immutable;
+1;

Modified: trunk/LedgerSMB/File.pm
===================================================================
--- trunk/LedgerSMB/File.pm	2012-07-18 07:19:44 UTC (rev 5012)
+++ trunk/LedgerSMB/File.pm	2012-07-18 07:41:00 UTC (rev 5013)
@@ -18,7 +18,7 @@
 
 package LedgerSMB::File;
 use Moose;
-extends 'LedgerSMB::DBObject_Moose';
+with 'LedgerSMB::DBObject_Moose';
 use File::MimeInfo;
 binmode STDIN, ':bytes';
 

Modified: trunk/sql/modules/LOADORDER
===================================================================
--- trunk/sql/modules/LOADORDER	2012-07-18 07:19:44 UTC (rev 5012)
+++ trunk/sql/modules/LOADORDER	2012-07-18 07:41:00 UTC (rev 5013)
@@ -34,3 +34,4 @@
 Budgetting.sql
 Fixes.sql
 Inventory_Report.sql
+Payroll.sql

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