$main::lxdebug->leave_sub();
}
-# write Trigger JavaScript-Code ($qty = 1 - only one Trigger)
+# write Trigger JavaScript-Code ($qty = quantity of Triggers)
+# changed it to accept an arbitrary number of triggers - sschoeling
sub write_trigger {
$main::lxdebug->enter_sub();
- my ($self, $myconfig, $qty,
- $inputField_1, $align_1, $button_1,
- $inputField_2, $align_2, $button_2)
- = @_;
+ my $self = shift;
+ my $myconfig = shift;
+ my $qty = shift;
# set dateform for jsscript
# default
}
}
- $trigger_1 = qq|
+ while ($#_ >= 2) {
+ push @triggers, qq|
Calendar.setup(
{
- inputField : "$inputField_1",
+ inputField : "|.(shift).qq|",
ifFormat :"$ifFormat",
- align : "$align_1",
- button : "$button_1"
+ align : "|.(shift).qq|",
+ button : "|.(shift).qq|"
}
);
|;
-
- if ($qty == 2) {
- $trigger_2 = qq|
- Calendar.setup(
- {
- inputField : "$inputField_2",
- ifFormat :"$ifFormat",
- align : "$align_2",
- button : "$button_2"
- }
- );
- |;
}
$jsscript = qq|
<script type="text/javascript">
- <!--
- $trigger_1
- $trigger_2
- //-->
+ <!--|.join("", @triggers).qq|//-->
</script>
|;
}
s/<%(.+?)%>/$self->{$1}/g;
+ s/<nobr><\/nobr>/ /g;
print OUT;
}
# now get the account numbers
$query =
- qq|SELECT c.accno, SUBSTRING(c.description,1,50) as description, c.link, c.taxkey_id
+ qq|SELECT c.accno, c.description, c.link, c.taxkey_id
FROM chart c
WHERE c.link LIKE '%$module%'
ORDER BY c.accno|;
LEFT Join tax t ON (a.taxkey = t.taxkey)
WHERE a.trans_id = $self->{id}
AND a.fx_transaction = '0'
- ORDER BY a.transdate|;
+ ORDER BY a.oid,a.transdate|;
$sth = $dbh->prepare($query);
$sth->execute || $self->dberror($query);
$self->{exchangerate} =
$self->get_exchangerate($dbh, $self->{currency}, $self->{transdate},
$fld);
+ my $index=0;
# store amounts in {acc_trans}{$key} for multiple accounts
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
$ref->{exchangerate} =
$self->get_exchangerate($dbh, $self->{currency}, $ref->{transdate},
$fld);
+ if ( !($xkeyref{ $ref->{accno} } =~ /tax/)) {
+ $index++;
+ }
+ $ref->{index} = $index;
push @{ $self->{acc_trans}{ $xkeyref{ $ref->{accno} } } }, $ref;
}