summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2008-07-31 17:09:02 +0000
committeraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2008-07-31 17:09:02 +0000
commit145038f44f7ee17806bd592a70dff0156bae9834 (patch)
tree7f5f098d5fb036858bc11599e9a0d312c8e9536a
parente5dfe76f59198db0d3b6267d5a09e62de14514e6 (diff)
Reconciliation work, new admin tweaks
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2225 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--scripts/admin.pl12
-rw-r--r--scripts/recon.pl122
2 files changed, 77 insertions, 57 deletions
diff --git a/scripts/admin.pl b/scripts/admin.pl
index 486dda5f..9eeb9454 100644
--- a/scripts/admin.pl
+++ b/scripts/admin.pl
@@ -37,8 +37,10 @@ sub new_user {
);
} else {
- my $template = LedgerSMB::Template->new( user => $user,
- template => 'Admin/edit_user', language => $user->{language},
+ my $template = LedgerSMB::Template->new(
+ user => $user,
+ template => 'Admin/edit_user',
+ language => $user->{language},
format => 'HTML', path=>'UI');
$template->render(
@@ -212,11 +214,7 @@ sub cancel {
sub __default {
- my ($request) = @_;
-
- my $template;
-
-
+ &mainpage(@_);
}
sub mainpage {
diff --git a/scripts/recon.pl b/scripts/recon.pl
index d1337dbb..a6076775 100644
--- a/scripts/recon.pl
+++ b/scripts/recon.pl
@@ -21,7 +21,9 @@ interfacing with the Core Logic and database layers.
package LedgerSMB::Scripts::recon;
use LedgerSMB::Template;
-use LedgerSMB::Reconciliation;
+use LedgerSMB::DBObject::Reconciliation;
+
+use Data::Dumper;
=pod
@@ -38,11 +40,12 @@ report_id.
=cut
sub display_report {
- my ($class, $request) = @_;
+ my ($request) = @_;
my $recon = LedgerSMB::Employee->new(base => $request, copy => 'all');
my $template = LedgerSMB::Template->new( user=>$user,
- template => "reconciliation/report.html", language => $user->{language},
- format=>'html'
+ template => "reconciliation/report", language => $user->{language},
+ format=>'HTML',
+ path=>"UI"
);
my $report = $recon->get_report();
my $total = $recon->get_total();
@@ -69,30 +72,34 @@ status
=cut
sub search {
- my ($class, $request) = @_;
+ my ($request) = @_;
if ($request->type() eq "POST") {
# WE HAS DATUMS
# INTENTIONAL BAD PLURALIZATION OF LATIN
-
- my $template = LedgerSMB::Template->new(
- user => $user,
- template=>'reconciliation/search.html',
- language=>$user->{language},
- format=>'html'
- );
- return $template->render();
-
- } else {
- my $search = LedgerSMB::Reconciliation->new(base => $request, copy => 'all');
+
+ my $search = LedgerSMB::DBObject::Reconciliation->new(base => $request, copy => 'all');
my $results = $search->search();
my $total = $search->total();
my $template = LedgerSMB::Template->new( user => $user,
- template => 'reconciliation/report.html', language => $user->{language},
- format => 'html');
+ template => 'reconciliation/report', language => $user->{language},
+ format => 'HTML',
+ path=>"UI");
return $template->render({report => $results, total => $total});
+
+
+ } else {
+
+ my $template = LedgerSMB::Template->new(
+ user => $user,
+ template=>'reconciliation/search',
+ language=>$user->{language},
+ format=>'HTML',
+ path=>"UI"
+ );
+ return $template->render();
}
}
@@ -113,7 +120,7 @@ This is to prevent arbitrary editing of the database by unscrupulous users.
=cut
sub correct {
- my ($class, $request) = @_;
+ my ($request) = @_;
if ($request->type() eq "POST") {
@@ -125,8 +132,9 @@ sub correct {
if ($recon->{corrected_id}) {
my $template = LedgerSMB::Template->new( user => $user,
- template => 'reconciliation/report.html', language => $user->{language},
- format => 'html');
+ template => 'reconciliation/report', language => $user->{language},
+ format => 'HTML',
+ path=>"UI");
$template->render( {
corrected=> $recon->{corrected_id},
@@ -139,8 +147,9 @@ sub correct {
# indicate we were unable to correct this entry, with the error code
# spat back to us by the DB.
my $template = LedgerSMB::Template->new( user => $user,
- template => 'reconciliation/report.html', language => $user->{language},
- format => 'html');
+ template => 'reconciliation/report', language => $user->{language},
+ format => 'HTML',
+ path=>"UI");
$template->render( {
recon => $recon,
@@ -160,9 +169,10 @@ sub correct {
my $template = LedgerSMB::Template->new(
user=>$user,
- template=>"reconciliation/correct.html",
+ template=>"reconciliation/correct",
language=> $user->{language},
- format=>'html'
+ format=>'HTML',
+ path=>"UI"
);
my $recon = LedgerSMB::DBObject::Reconciliation->new(base=>$request, copy=>'all');
@@ -172,9 +182,10 @@ sub correct {
my $template = LedgerSMB::Template->new(
user=>$user,
- template=>"reconciliation/correct.html",
+ template=>"reconciliation/correct",
language=> $user->{language},
- format=>'html'
+ format=>'HTML',
+ path=>"UI"
);
$class->display_report();
}
@@ -199,7 +210,7 @@ it has been created.
=cut
sub new_report {
- my ($class, $request) = @_;
+ my ($request) = @_;
# how are we going to allow this to be created? Grr.
# probably select a list of statements that are available to build
# reconciliation reports with.
@@ -224,18 +235,20 @@ sub new_report {
$template = LedgerSMB::Template->new(
user=>$user,
- template=> 'reconciliation/upload.html',
+ template=> 'reconciliation/upload',
language=>$user->{language},
- format=>'html'
+ format=>'HTML',
+ path=>"UI"
);
return $template->render({error=>$recon->error()});
}
$template = LedgerSMB::Template->new(
user=> $user,
- template => 'reconciliation/new_report.html',
+ template => 'reconciliation/new_report',
language => $user->{language},
- format=>'html'
+ format=>'HTML',
+ path=>"UI"
);
return $template->render(
{
@@ -249,9 +262,10 @@ sub new_report {
# we can assume we're to generate the "Make a happy new report!" page.
$template = LedgerSMB::Template->new(
user => $user,
- template => 'reconciliation/upload.html',
+ template => 'reconciliation/upload',
language => $user->{language},
- format => 'html'
+ format => 'HTML',
+ path=>"UI"
);
return $template->render();
}
@@ -278,7 +292,7 @@ the uncorrected entries.
=cut
sub approve {
- my ($class, $request) = @_;
+ my ($request) = @_;
# Approve will also display the report in a blurred/opaqued out version,
# with the controls removed/disabled, so that we know that it has in fact
@@ -296,8 +310,10 @@ sub approve {
if ($code == 0) {
$template = LedgerSMB::Template->new( user => $user,
- template => 'reconciliation/approve.html', language => $user->{language},
- format => 'html');
+ template => 'reconciliation/approve', language => $user->{language},
+ format => 'HTML',
+ path=>"UI"
+ );
return $template->render();
}
@@ -307,9 +323,11 @@ sub approve {
$template = LedgerSMB::Template->new(
user => $user,
- template => 'reconciliation/report.html',
+ template => 'reconciliation/report',
language => $user->{language},
- format => 'html');
+ format => 'HTML',
+ path=>"UI"
+ );
return $template->render(
{
entries=>$recon->get_report($request->{report_id}),
@@ -339,7 +357,7 @@ aren't any corrections, it will display "no corrections found".
=cut
sub corrections {
- my ($class, $request) = @_;
+ my ($request) = @_;
# Load the corrections for a given report & entry id.
# possibly should use a "micro" popup window?
@@ -349,8 +367,8 @@ sub corrections {
my $template;
$template = LedgerSMB::Template->new( user => $user,
- template => 'reconciliation/corrected.html', language => $user->{language},
- format => 'html');
+ template => 'reconciliation/corrected', language => $user->{language},
+ format => 'HTML', path=>"UI");
return $template->render(
{
@@ -377,16 +395,17 @@ from the acc_trans table.
sub pending {
- my ($class, $request) = @_;
+ my ($request) = @_;
- my $recon = LedgerSMB::DBObject::Reconciliation->new(base=>request, copy=>'all');
+ my $recon = LedgerSMB::DBObject::Reconciliation->new(base=>$request, copy=>'all');
my $template;
$template= LedgerSMB::Template->new(
user => $user,
- template=>'reconciliation/pending.html',
+ template=>'reconciliation/pending',
language=>$user->{language},
- format=>'html'
+ format=>'HTML',
+ path=>"UI"
);
if ($request->type() eq "POST") {
return $template->render(
@@ -403,16 +422,19 @@ sub pending {
sub __default {
- my ($class, $request) = @_;
+ my ($request) = @_;
+
+ $request->error(Dumper($request));
- my $recon = LedgerSMB::DBObject::Reconciliation->new($request, copy=>'all');
+ my $recon = LedgerSMB::DBObject::Reconciliation->new(base=>$request, copy=>'all');
my $template;
$template = LedgerSMB::Template->new(
user => $user,
- template => 'reconciliation/list.html',
+ template => 'reconciliation/list',
language => $user->{language},
- format=>'html'
+ format=>'HTML',
+ path=>"UI"
);
return $template->render(
{