Try replacing the following two lines -
use GT::Date qw/:all/;
my($tags) = shift;
with just one line -
my $tags = GT::Template->tags;
Also remove the "\" and add " ' " in the following -
my $table33 = $DB->table(\'tblClients\');
my $sth33 = $table33->select ([\'ClientID\'], {'AccountID' => $accountid});
Try the above first and let me know if it works. If not, you could also try the following (which is how I would usually write the global) -
sub {
my $tags = GT::Template->tags;
my ($clientid) = $DB->table('tblClients')->select({'AccountID' => $tags->{AccountID} }, ['ClientID'])->fetchrow_array();
return $clientid;
}
"my" is used to declare a variable before it is used. It only needs to be declared once. If you don't declare it you will get an error.
Hope that helps.
Simon.
use GT::Date qw/:all/;
my($tags) = shift;
with just one line -
my $tags = GT::Template->tags;
Also remove the "\" and add " ' " in the following -
my $table33 = $DB->table(\'tblClients\');
my $sth33 = $table33->select ([\'ClientID\'], {'AccountID' => $accountid});
Try the above first and let me know if it works. If not, you could also try the following (which is how I would usually write the global) -
sub {
my $tags = GT::Template->tags;
my ($clientid) = $DB->table('tblClients')->select({'AccountID' => $tags->{AccountID} }, ['ClientID'])->fetchrow_array();
return $clientid;
}
"my" is used to declare a variable before it is used. It only needs to be declared once. If you don't declare it you will get an error.
Hope that helps.
Simon.