summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-07-10 00:56:58 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-07-10 00:56:58 +0000
commit4a07e174e74e2b707ecf9bf308917ad689e9f317 (patch)
treeea33c7361684335cf804581738d22a7c7e5da6d4 /scripts
parent87a7da4dcf11934fafdb8b6393694557182d6a8f (diff)
Correcting the last errors for the draft approval on secondary test instance
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2203 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'scripts')
-rw-r--r--scripts/drafts.pl48
1 files changed, 25 insertions, 23 deletions
diff --git a/scripts/drafts.pl b/scripts/drafts.pl
index 741b5fed..e38b434c 100644
--- a/scripts/drafts.pl
+++ b/scripts/drafts.pl
@@ -1,5 +1,5 @@
-package LedgerSMB::Scripts::vouchers;
+package LedgerSMB::Scripts::drafts;
our $VERSION = '0.1';
use LedgerSMB::DBObject::Draft;
@@ -8,6 +8,11 @@ use strict;
sub search {
my ($request) = @_;
+ $request->{class_types} = [
+ {text => $request->{_locale}->text('AR'), value => 'ar'},
+ {text => $request->{_locale}->text('AP'), value => 'ap'},
+ {text => $request->{_locale}->text('GL'), value => 'GL'},
+ ];
my $template = LedgerSMB::Template->new(
user =>$request->{_user},
locale => $request->{_locale},
@@ -20,12 +25,12 @@ sub search {
sub list_drafts {
my ($request) = @_;
- my $draft= LedgerSMB::Draft->new(base => $request);
+ my $draft= LedgerSMB::DBObject::Draft->new(base => $request);
my @search_results = $draft->search;
$draft->{script} = "drafts.pl";
my @columns =
- qw(select id transdate reference description, amount);
+ qw(select id transdate reference description amount);
my $base_href = "drafts.pl";
my $search_href = "$base_href?action=list_transactions";
@@ -39,25 +44,25 @@ sub list_drafts {
my %column_heading = (
'select' => $draft->{_locale}->text('Select'),
- transaction_total => {
+ amount => {
text => $draft->{_locale}->text('AR/AP/GL Total'),
href => "$search_href&order_by=transaction_total"
},
- payment_total => {
- text => $draft->{_locale}->text('Paid/Received Total'),
- href => "$search_href&order_by=payment_total"
- },
description => {
text => $draft->{_locale}->text('Description'),
href => "$search_href&order_by=description"
},
- control_code => {
- text => $draft->{_locale}->text('Batch Number'),
- href => "$search_href&order_by=control_code"
- },
id => {
text => $draft->{_locale}->text('ID'),
- href => "$search_href&order_by=control_code"
+ href => "$search_href&order_by=id"
+ },
+ reference => {
+ text => $draft->{_locale}->text('Reference'),
+ href => "$search_href&order_by=reference"
+ },
+ transdate => {
+ text => $draft->{_locale}->text('Date'),
+ href => "$search_href&order_by=transdate"
},
);
my $count = 0;
@@ -73,18 +78,15 @@ sub list_drafts {
name => "draft_$result->{id}"
}
},
- transaction_total => $draft->format_amount(
- amount => $result->{transaction_total}
+ amount => $draft->format_amount(
+ amount => $result->{amount}
),
- payment_total => $draft->format_amount (
- amount => $result->{payment_total}
- ),
- description => $result->{description},
- control_code => {
- text => $result->{control_code},
- href => "$draft_href&draft_id=$result->{id}",
-
+ reference => {
+ text => $result->{reference},
+ href => "$request->{type}.pl?action=edit&id=$result->{id}",
},
+ description => $result->{description},
+ transdate => $result->{transdate},
id => $result->{id},
};
}