map {
$chart .=
- "<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}</option>"
+ "<option value=\"$_->{accno}--$_->{tax_id}\">$_->{accno}--$_->{description}</option>"
} @{ $form->{chart} };
map {
$tax .=
- qq|<option value="$_->{taxkey}--$_->{rate}">$_->{taxdescription} |
+ qq|<option value="$_->{id}--$_->{rate}">$_->{taxdescription} |
. ($_->{rate} * 100) . qq| %|
} @{ $form->{TAX} };
GL->transaction(\%myconfig, \%$form);
map {
$chart .=
- "<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}</option>"
+ "<option value=\"$_->{accno}--$_->{tax_id}\">$_->{accno}--$_->{description}</option>"
} @{ $form->{chart} };
map {
$tax .=
- qq|<option value="$_->{taxkey}--$_->{rate}">$_->{taxdescription} |
+ qq|<option value="$_->{id}--$_->{rate}">$_->{taxdescription} |
. ($_->{rate} * 100) . qq| %|
} @{ $form->{TAX} };
$j = $i - 1;
if ($tax && ($ref->{accno} eq $taxaccno)) {
$form->{"tax_$j"} = abs($ref->{amount});
- $form->{"taxchart_$j"} = $ref->{taxkey} . "--" . $ref->{taxrate};
+ $form->{"taxchart_$j"} = $ref->{id} . "--" . $ref->{taxrate};
if ($form->{taxincluded}) {
if ($ref->{amount} < 0) {
$form->{"debit_$j"} += $form->{"tax_$j"};
}
}
} else {
- $form->{"accno_$i"} = "$ref->{accno}--$ref->{accnotaxkey}";
+ $form->{"accno_$i"} = "$ref->{accno}--$ref->{tax_id}";
for (qw(fx_transaction source memo)) { $form->{"${_}_$i"} = $ref->{$_} }
if ($ref->{amount} < 0) {
$form->{totaldebit} -= $ref->{amount};
$form->{totalcredit} += $ref->{amount};
$form->{"credit_$i"} = $ref->{amount};
}
- $form->{"taxchart_$i"} = "0--";
+ $form->{"taxchart_$i"} = "0--0.00";
$i++;
}
if ($ref->{taxaccno} && !$tax) {
<tr>
<th align=right>| . $locale->text('From') . qq|</th>
$button1
+ <th align=right>| . $locale->text('To (time)') . qq|</th>
$button2
</tr>
<tr>
}
}
+ $transdate = "";
+ foreach $key (sort keys(%{ $ref->{transdate} })) {
+ if ($key == 0) {
+ $transdate = "$ref->{transdate}{$key}";
+ } else {
+ $transdate .= "<br>$ref->{transdate}{$key}";
+ }
+ }
+
# $ref->{debit} = $form->format_amount(\%myconfig, $ref->{debit}, 2, " ");
# $ref->{credit} = $form->format_amount(\%myconfig, $ref->{credit}, 2, " ");
$column_data{id} = "<td align=right> $ref->{id} </td>";
- $column_data{transdate} =
- "<td align=center> $ref->{transdate} </td>";
+ $column_data{transdate} = "<td align=center>$transdate</td>";
$column_data{reference} =
"<td align=center><a href=$ref->{module}.pl?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{reference}</td>";
- $column_data{description} =
- "<td align=center>$ref->{description} </td>";
+ $column_data{description} = "<td align=center>$ref->{description} </td>";
$column_data{source} = "<td align=center>$ref->{source} </td>";
$column_data{notes} = "<td align=center>$ref->{notes} </td>";
$column_data{debit} = "<td align=right>$debit</td>";
<input class=submit type=submit name=action value="|
. $locale->text('Sales Invoice') . qq|">
<input class=submit type=submit name=action value="|
- . $locale->text('Vendor Invoice') . qq|">|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
+ . $locale->text('Vendor Invoice') . qq|">
</form>
: $form->{"debit_$i"};
$j = $#a;
if (($debitcredit && $credittax) || (!$debitcredit && $debittax)) {
- $form->{"taxchart_$i"} = "0--";
+ $form->{"taxchart_$i"} = "0--0.00";
$form->{"tax_$i"} = 0;
}
if (!$form->{"korrektur_$i"}) {
<!--
function setTaxkey(accno, row) {
var taxkey = accno.options[accno.selectedIndex].value;
- var reg = /--([0-9])*/;
+ var reg = /--([0-9]*)/;
var found = reg.exec(taxkey);
var index = found[1];
index = parseInt(index);
}
}
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
print "
</form>
<form method=post action=$form->{script}>
|;
- map { $form->{$_} =~ s/\"/"/g } qw(reference description chart);
+ map { $form->{$_} =~ s/\"/"/g } qw(reference description chart taxchart);
delete $form->{header};
foreach $key (keys %$form) {
- print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
+ print qq|<input type="hidden" name="$key" value="$form->{$key}">\n|;
}
print qq|
: $form->{"debit_$i"};
$j = $#a;
if (($debitcredit && $credittax) || (!$debitcredit && $debittax)) {
- $form->{"taxchart_$i"} = "0--";
+ $form->{"taxchart_$i"} = "0--0.00";
$form->{"tax_$i"} = 0;
}
if (!$form->{"korrektur_$i"}) {
if ($form->round_amount($debit, 2) != $form->round_amount($credit, 2)) {
$form->error($locale->text('Out of balance transaction!'));
}
+
+ if ($form->round_amount($debit, 2) + $form->round_amount($credit, 2) == 0) {
+ $form->error($locale->text('Empty transaction!'));
+ }
+
if (($errno = GL->post_transaction(\%myconfig, \%$form)) <= -1) {
$errno *= -1;
$err[1] = $locale->text('Cannot have a value in both Debit and Credit!');