}
}
+ $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>
. qq|>$accno</select></td>|;
$tax = $taxchart;
$tax_selected = $form->{"taxchart_$i"};
- print(STDERR "TAX_SELCTED $tax_selected\n");
$tax =~ s/value=\"$tax_selected\"/value=\"$tax_selected\" selected/;
$tax =
qq|<td><select id="taxchart_$i" name="taxchart_$i" tabindex=|
}
}
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
print "
</form>
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!');