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

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



Revision: 5347
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5347&view=rev
Author:   einhverfr
Date:     2012-12-15 03:12:42 +0000 (Sat, 15 Dec 2012)
Log Message:
-----------
Initial workflow scripts for transaction search/outstanding reports.

Added Paths:
-----------
    trunk/LedgerSMB/Scripts/invoice.pm
    trunk/invoice.pl

Added: trunk/LedgerSMB/Scripts/invoice.pm
===================================================================
--- trunk/LedgerSMB/Scripts/invoice.pm	                        (rev 0)
+++ trunk/LedgerSMB/Scripts/invoice.pm	2012-12-15 03:12:42 UTC (rev 5347)
@@ -0,0 +1,88 @@
+=head1 NAME
+
+LedgerSMB::Scripts::invoice - Invoice Report Routines for LedgerSMB
+
+=head1 SYNPOSIS
+
+ LedgerSMB::Scripts::invoice:invoices_outstanding($request)
+
+or
+
+ LedgerSMB::Scripts::invoice:invoice_search($request)
+
+=cut
+
+package LedgerSMB::Scripts::invoice;
+use LedgerSMB::Template;
+use LedgerSMB::Report::Invoices::Transactions;
+use LedgerSMB::Report::Invoices::Outstanding;
+use LedgerSMB::Scripts::Report;
+
+=head1 DESCRIPTION
+
+This module contains the invoice search routines.  In future versions this
+module will probably also include various invoice creation routines.
+
+=head1 FUNCTIONS
+
+=over
+
+=item begin_report
+
+This is a specialized preprocessor for LedgerSMB::Scripts::Report::begin_report
+which sets up various data structures for the report screens.
+
+=cut
+
+sub begin_report {
+    my ($request) = @_;
+    my $link;
+    if ($request->{entity_class} == 1){
+        $link = 'AP';
+    } elsif ($request->{entity_class} == 2){
+        $link = 'AR';
+    } else {
+        die 'Invalid Entity Class';
+    }
+    @{$request->{accounts}} = $request->call_procedure(
+        procname => 'account__get_by_link_desc', args => [$link]);
+    @{$request->{tax_accounts}} = $request->call_procedure(
+        procname => 'account__get_by_link_desc', args => ["${link}_tax"]);
+    LedgerSMB::Scripts::reports::begin_report($request);
+}
+
+=item invoices_outstanding
+
+This produces the invoice outstanding report.  See
+LedgerSMB::Report::Invoices::Outstanding for expected properties.
+
+=cut
+
+sub invoices_outstanding {
+    my ($request) = @_;
+    my $report = LedgerSMB::Reports::Invoices::Outstanding->new(%$request);
+    $report->render($request);
+}
+
+=item search_transactions
+
+This produces the transactions earch report.  See
+LedgerSMB::Report::Invoices::Transactions for expected properties.
+
+=cut
+
+sub search_transactions {
+    my ($request) = @_;
+    my $report = LedgerSMB::Reports::Invoices::Transactions->new(%$request);
+    $report->render($request);
+}
+
+=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/invoice.pl (from rev 5346, trunk/timecard.pl)
===================================================================
--- trunk/invoice.pl	                        (rev 0)
+++ trunk/invoice.pl	2012-12-15 03:12:42 UTC (rev 5347)
@@ -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.