[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[4997] trunk
- Subject: SF.net SVN: ledger-smb:[4997] trunk
- From: ..hidden..
- Date: Mon, 16 Jul 2012 01:19:19 +0000
Revision: 4997
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4997&view=rev
Author: einhverfr
Date: 2012-07-16 01:19:19 +0000 (Mon, 16 Jul 2012)
Log Message:
-----------
Workflow scripts for new trial balance logic
Added Paths:
-----------
trunk/LedgerSMB/Scripts/trial_balance.pm
trunk/trial_balance.pl
Added: trunk/LedgerSMB/Scripts/trial_balance.pm
===================================================================
--- trunk/LedgerSMB/Scripts/trial_balance.pm (rev 0)
+++ trunk/LedgerSMB/Scripts/trial_balance.pm 2012-07-16 01:19:19 UTC (rev 4997)
@@ -0,0 +1,110 @@
+=head1 NAME
+
+LedgerSMB::Scripts::trial_balance - Trial Balance logic for LedgerSMB
+
+=head1 SYNOPSIS
+
+To save a criteria set:
+
+ LedgerSMB::Scripts::trial_balance::save($request);
+
+To get a criteria set and run it:
+
+ LedgerSMB::Scripts::trial_balance::get($request);
+
+To list criteria sets:
+
+ LedgerSMB::Scripts::trial_balance::list($request);
+
+To run a trial balance:
+
+ LedgerSMB::Scripts::trial_balance::run($request);
+
+=cut
+
+package LedgerSMB::Scripts::trial_balance;
+use LedgerSMB::DBObject::Report::Trial_Balance;
+
+
+=head1 DESCRIPTION
+
+This module provides workflow scripts for trial balance functionality. The
+filter screen is displayed by LedgerSMB::Scripts::reports.
+
+Please see LedgerSMB::DBObject::Report::Trial_Balance for a list of criteria
+that the methods expect.
+
+=head1 METHODS
+
+=over
+
+=item get
+
+Retrieves and runs a trial balance. Only needs id to be set.
+
+=cut
+
+sub get {
+ my ($request) = @_;
+ $request->merge(LedgerSMB::DBObject::Report::Trial_Balance->get($request->{id});
+ run($request);
+}
+
+=item save
+
+Saves a trial balance. All criteria are applicable.
+
+=cut
+
+sub save {
+ my ($request) = @_;
+ my $tb = LedgerSMB::DBObject::Report::Trial_Balance->new(%$request);
+ $tb->save;
+ list($request);
+}
+
+=item list
+
+Lists trial balances. No criteria are applicable
+
+=cut
+
+sub list {
+ my ($request) = @_;
+ ...
+}
+
+=item run
+
+Runs the trial balance. All criteria are applicable except id and desc.
+
+=cut
+
+sub run {
+ my ($request) = @_;
+ my LedgerSMB::DBObject::Report::Trial_Balance->new(%$request);
+ $tb->run_report;
+ $tb->render($request);
+}
+
+=head1 SEE ALSO
+
+=over
+
+=item LedgerSMB::Scripts::reports
+
+=item LedgerSMB::DBObject::Report
+
+=item LedgerSMB::DBObject::Report::Trial_Balance
+
+=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
+
+1;
Copied: trunk/trial_balance.pl (from rev 4986, trunk/reports.pl)
===================================================================
--- trunk/trial_balance.pl (rev 0)
+++ trunk/trial_balance.pl 2012-07-16 01:19:19 UTC (rev 4997)
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+
+use FindBin;
+BEGIN {
+ lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
+
+require 'lsmb-request.pl';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.