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

SF.net SVN: ledger-smb:[5226] trunk/LedgerSMB/Report/PNL



Revision: 5226
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5226&view=rev
Author:   einhverfr
Date:     2012-11-21 09:53:36 +0000 (Wed, 21 Nov 2012)
Log Message:
-----------
Other PNL reporting classes added

Added Paths:
-----------
    trunk/LedgerSMB/Report/PNL/ECA.pm
    trunk/LedgerSMB/Report/PNL/Invoice.pm
    trunk/LedgerSMB/Report/PNL/Product.pm

Added: trunk/LedgerSMB/Report/PNL/ECA.pm
===================================================================
--- trunk/LedgerSMB/Report/PNL/ECA.pm	                        (rev 0)
+++ trunk/LedgerSMB/Report/PNL/ECA.pm	2012-11-21 09:53:36 UTC (rev 5226)
@@ -0,0 +1,143 @@
+=head1 NAME
+
+LedgerSMB::Report::PNL::ECA - Income Statement-like Reports for Customers
+
+=head1 SYNPOSIS
+
+ my $rpt = LedgerSMB::Report::PNL::ECA->new(%$request);
+ $rpt->render($request);
+
+=head1 DESCRIPTION
+
+This provides the income statement-like report for customers on LedgerSMB 1.4 
+and higher.  The format is identical to that of an income statement and allows
+businesses to address the profitability of specific customer accounts.
+
+This can also be run against vendors, but it will only show purchases of 
+services and other non-inventory purchases.  Inventory purchases will not show
+up since they are treated as an expense only on sale.
+
+=cut
+
+package LedgerSMB::Report::PNL::ECA;
+use Moose;
+extends 'LedgerSMB::Report::PNL';
+
+=head1 CRITERIA PROPERTIES
+
+Standard dates plus
+
+=over
+
+=item id 
+
+This is the id of the customer account.
+
+=cut
+
+has id => (is => 'rw', isa =>'Int');
+
+=item name 
+
+Name of the customer
+
+=cut
+
+has 'name' => (is => 'rw', isa =>'Str'); 
+
+=item meta_number
+
+Account number of customer
+
+=cut
+
+has 'meta_number' => (is => 'rw', isa =>'Str');
+
+=item control_code
+
+Control code of customer's entity
+
+=cut
+
+has 'control_code' => (is => 'rw', isa =>'Str');
+
+=back
+
+=head1 CONSTANT REPORT-RELATED FUNCTIONS
+
+=over
+
+=item template
+
+=cut
+
+sub template { return 'Reports/PNL' }
+
+=item name
+
+=cut
+
+sub name { return LedgerSMB::Report::text('ECA Income Statement') }
+
+=item header_lines
+
+=cut
+
+sub header_lines {
+    return [{name => 'name',
+            text => LedgerSMB::Report::text('Name') },
+            {name => 'meta_number',
+            text => LedgerSMB::Report::text('Account Number')},
+            {name => 'control_code',
+            text => LedgerSMB::Report::text('Control Code')}
+          ];
+}
+
+=item columns
+
+=cut
+
+sub columns { return []  }
+
+=back
+
+=head1 METHODS
+
+=cut
+
+# private method
+# report_base($from, $to)
+# returns an array of hashrefs of report results.  Used in adding comparison
+# as well as the main report
+
+sub report_base {
+    my ($self, $from_date, $to_date) = @_;
+    my $procname = 'pnl__customer';
+    return $self->exec_method({funcname => $procname});
+}
+
+=head1 SEE ALSO
+
+=over
+
+=item LedgerSMB::DBObject
+
+=item LedgerSMB::DBObject::Moose
+
+=item LedgerSMB::MooseTypes
+
+=item LedgerSMB::Report
+
+=item LedgerSMB::Report::Dates
+
+=item LedgerSMB::Report::PNL
+
+=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;

Added: trunk/LedgerSMB/Report/PNL/Invoice.pm
===================================================================
--- trunk/LedgerSMB/Report/PNL/Invoice.pm	                        (rev 0)
+++ trunk/LedgerSMB/Report/PNL/Invoice.pm	2012-11-21 09:53:36 UTC (rev 5226)
@@ -0,0 +1,139 @@
+=head1 NAME
+
+LedgerSMB::Report::PNL::Invoice - Provides an Income Statement-like report on
+invoices
+
+=head1 SYNPOSIS
+
+ my $rpt = LedgerSMB::Report::PNL::Invoice->new(%$request);
+ $rpt->render($request);
+
+=head1 DESCRIPTION
+
+This provides the income statement-like report for invoices on LedgerSMB on 
+1.4 and later.  This report is designed to give a business an ability to look
+profit margins of specific invoices.
+
+=cut
+
+package LedgerSMB::Report::PNL::Invoice;
+use Moose;
+extends 'LedgerSMB::Report::PNL';
+
+=head1 CRITERIA PROPERTIES
+
+=over
+
+=item id
+
+This is the id of the invoice
+
+=cut
+
+has id => (is => 'ro', isa =>'Int', required => 1);
+
+=over invnumber
+
+Invoice number
+
+=cut
+
+has invnumber => (is => 'rw', isa =>'Str');
+
+=cut
+
+=over transdate
+
+Transaction Date
+
+=cut
+
+has transdate => (is => 'rw', isa =>'LedgerSMB::Moose::Date', coerce=> 1);
+
+=over name
+
+Customer/vendor name
+
+=cut
+
+has invnumber => (is => 'rw', isa =>'Str');
+
+=back
+
+=head1 CONSTANT REPORT-RELATED FUNCTIONS
+
+=over
+
+=item template
+
+=cut
+
+sub template { return 'Reports/PNL' }
+
+=item name
+
+=cut
+
+sub name { return LedgerSMB::Report::text('Invoice Profit/Loss') }
+
+=item header_lines
+
+=cut
+
+sub header_lines {
+    return [{name => 'name',
+            text => LedgerSMB::Report::text('Name') },
+            {name => 'invnumber',
+            text => LedgerSMB::Report::text('Invoice Number') },
+            {name => 'transdate',
+            text => LedgerSMB::Report::text('Transaction Date') },
+    ];
+}
+
+=item columns
+
+=cut
+
+sub columns { return []  }
+
+=back
+
+=head1 METHODS
+
+=cut
+
+# private method
+# report_base($from, $to)
+# returns an array of hashrefs of report results.  Used in adding comparison
+# as well as the main report
+
+sub report_base {
+    my ($self) = @_;
+    return $self->exec_method({funcname => 'pnl__invoice'});
+}
+
+=head1 SEE ALSO
+
+=over
+
+=item LedgerSMB::DBObject
+
+=item LedgerSMB::DBObject::Moose
+
+=item LedgerSMB::MooseTypes
+
+=item LedgerSMB::Report
+
+=item LedgerSMB::Report::Dates
+
+=item LedgerSMB::Report::PNL
+
+=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;

Added: trunk/LedgerSMB/Report/PNL/Product.pm
===================================================================
--- trunk/LedgerSMB/Report/PNL/Product.pm	                        (rev 0)
+++ trunk/LedgerSMB/Report/PNL/Product.pm	2012-11-21 09:53:36 UTC (rev 5226)
@@ -0,0 +1,129 @@
+=head1 NAME
+
+LedgerSMB::Report::PNL::Product - Profit/Loss reports on Products
+
+=head1 SYNPOSIS
+
+ my $rpt = LedgerSMB::Report::PNL::Product->new(%$request);
+ $rpt->render($request);
+
+=head1 DESCRIPTION
+
+This provides the income statement-like report for products on LedgerSMB on 1.4 
+and later.  This report gives decision-makers a general overview of what the 
+actual profit and loss of a business is regarding historical performance of 
+specific products.
+
+This is only supported on products with inventory because otherwise there is no 
+real way to track revenue vs loss, for example with the case of resold services.
+
+=cut
+
+package LedgerSMB::Report::PNL::Product;
+use Moose;
+extends 'LedgerSMB::Report::PNL';
+
+=head1 CRITERIA PROPERTIES
+
+Standard dates plus
+
+=over
+
+=item id
+
+This is the id of the good or service
+
+=cut
+
+has id => (is => 'ro', isa =>'Int', required => 1);
+
+=item partnumber
+
+=cut
+
+has partnumber => (is => 'rw', isa =>'Str');
+
+
+=item description
+
+=cut
+
+has description  => (is => 'rw', isa =>'Str');
+
+=back
+
+=head1 CONSTANT REPORT-RELATED FUNCTIONS
+
+=over
+
+=item template
+
+=cut
+
+sub template { return 'Reports/PNL' }
+
+=item name
+
+=cut
+
+sub name { return LedgerSMB::Report::text('Proft/Loss on Inventory Sales') }
+
+=item header_lines
+
+=cut
+
+sub header_lines {
+    return [{name => 'partnumber',
+            text => LedgerSMB::Report::text('Part Number') },
+            {name => 'description',
+            text => LedgerSMB::Report::text('Description') },
+    ];
+}
+
+=item columns
+
+=cut
+
+sub columns { return []  }
+
+=back
+
+=head1 METHODS
+
+=cut
+
+# private method
+# report_base($from, $to)
+# returns an array of hashrefs of report results.  Used in adding comparison
+# as well as the main report
+
+sub report_base {
+    my ($self, $from_date, $to_date) = @_;
+    return $self->exec_method({funcname => 'pnl__product'});
+}
+
+=head1 SEE ALSO
+
+=over
+
+=item LedgerSMB::DBObject
+
+=item LedgerSMB::DBObject::Moose
+
+=item LedgerSMB::MooseTypes
+
+=item LedgerSMB::Report
+
+=item LedgerSMB::Report::Dates
+
+=item LedgerSMB::Report::PNL
+
+=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;

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