160 |
160 |
if ($tax && ($ref->{accno} eq $taxaccno)) {
|
161 |
161 |
$form->{"tax_$j"} = abs($ref->{amount});
|
162 |
162 |
$form->{"taxchart_$j"} = $ref->{taxkey} . "--" . $ref->{taxrate};
|
|
163 |
if ($form->{taxincluded}) {
|
|
164 |
if ($ref->{amount} < 0) {
|
|
165 |
$form->{"debit_$j"} += $form->{"tax_$j"};
|
|
166 |
} else {
|
|
167 |
$form->{"credit_$j"} += $form->{"tax_$j"};
|
|
168 |
}
|
|
169 |
}
|
163 |
170 |
} else {
|
164 |
171 |
$form->{"accno_$i"} = "$ref->{accno}--$ref->{accnotaxkey}";
|
165 |
172 |
for (qw(fx_transaction source memo)) { $form->{"${_}_$i"} = $ref->{$_} }
|
... | ... | |
170 |
177 |
$form->{totalcredit} += $ref->{amount};
|
171 |
178 |
$form->{"credit_$i"} = $ref->{amount};
|
172 |
179 |
}
|
|
180 |
$form->{"taxchart_$i"} = "0--";
|
173 |
181 |
$i++;
|
174 |
182 |
}
|
175 |
183 |
if ($ref->{taxaccno} && !$tax) {
|
... | ... | |
1047 |
1055 |
qq|<td><select id="taxchart_$i" name="taxchart_$i" tabindex=|
|
1048 |
1056 |
. ($i + 10 + (($i - 1) * 8))
|
1049 |
1057 |
. qq|>$form->{taxchart}</select></td>|;
|
1050 |
|
if ($form->{selectprojectnumber}) {
|
1051 |
|
$project = qq|
|
1052 |
|
<td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
|
1053 |
|
}
|
|
1058 |
# if ($form->{selectprojectnumber}) {
|
|
1059 |
# $project = qq|
|
|
1060 |
# <td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
|
|
1061 |
# }
|
1054 |
1062 |
$korrektur =
|
1055 |
1063 |
qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=|
|
1056 |
1064 |
. ($i + 9 + (($i - 1) * 8))
|
... | ... | |
1064 |
1072 |
} else {
|
1065 |
1073 |
if ($form->{"debit_$i"} != 0) {
|
1066 |
1074 |
$form->{totaldebit} += $form->{"debit_$i"};
|
1067 |
|
$form->{totaldebit} += $form->{"tax_$i"};
|
|
1075 |
if (!$form->{taxincluded}) {
|
|
1076 |
$form->{totaldebit} += $form->{"tax_$i"};
|
|
1077 |
}
|
1068 |
1078 |
} else {
|
1069 |
1079 |
$form->{totalcredit} += $form->{"credit_$i"};
|
1070 |
|
$form->{totalcredit} += $form->{"tax_$i"};
|
|
1080 |
if (!$form->{taxincluded}) {
|
|
1081 |
$form->{totalcredit} += $form->{"tax_$i"};
|
|
1082 |
}
|
1071 |
1083 |
}
|
1072 |
1084 |
|
1073 |
1085 |
for (qw(debit credit tax)) {
|
... | ... | |
1095 |
1107 |
. ($i + 10 + (($i - 1) * 8))
|
1096 |
1108 |
. qq|>$tax</select></td>|;
|
1097 |
1109 |
|
1098 |
|
if ($form->{selectprojectnumber}) {
|
1099 |
|
$form->{"projectnumber_$i"} = ""
|
1100 |
|
if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/;
|
1101 |
|
|
1102 |
|
$project = $form->{"projectnumber_$i"};
|
1103 |
|
$project =~ s/--.*//;
|
1104 |
|
$project = qq|<td>$project</td>|;
|
1105 |
|
}
|
|
1110 |
# if ($form->{selectprojectnumber}) {
|
|
1111 |
# $form->{"projectnumber_$i"} = ""
|
|
1112 |
# if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/;
|
|
1113 |
#
|
|
1114 |
# $project = $form->{"projectnumber_$i"};
|
|
1115 |
# $project =~ s/--.*//;
|
|
1116 |
# $project = qq|<td>$project</td>|;
|
|
1117 |
# }
|
1106 |
1118 |
|
1107 |
1119 |
if ($form->{transfer}) {
|
1108 |
1120 |
$checked = ($form->{"fx_transaction_$i"}) ? "1" : "";
|
... | ... | |
1116 |
1128 |
qq|<td><input type="checkbox" name="korrektur_$i" value="1" $checked tabindex=|
|
1117 |
1129 |
. ($i + 9 + (($i - 1) * 8))
|
1118 |
1130 |
. qq|></td>|;
|
1119 |
|
$form->hide_form("accno_$i", "projectnumber_$i");
|
|
1131 |
$form->hide_form("accno_$i");
|
1120 |
1132 |
|
1121 |
1133 |
} else {
|
1122 |
1134 |
|
... | ... | |
1126 |
1138 |
$tax = qq|
|
1127 |
1139 |
<td><select id="taxchart_$i" name="taxchart_$i" tabindex=|
|
1128 |
1140 |
. ($i + 10 + (($i - 1) * 8)) . qq|>$taxchart</select></td>|;
|
1129 |
|
if ($form->{selectprojectnumber}) {
|
1130 |
|
$project = qq|
|
1131 |
|
<td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
|
1132 |
|
}
|
|
1141 |
# if ($form->{selectprojectnumber}) {
|
|
1142 |
# $project = qq|
|
|
1143 |
# <td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
|
|
1144 |
# }
|
1133 |
1145 |
$korrektur =
|
1134 |
1146 |
qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=|
|
1135 |
1147 |
. ($i + 9 + (($i - 1) * 8))
|
... | ... | |
1164 |
1176 |
$tax
|
1165 |
1177 |
$source
|
1166 |
1178 |
$memo
|
1167 |
|
$project
|
1168 |
1179 |
</tr>
|
1169 |
1180 |
|
1170 |
1181 |
|;
|
1171 |
1182 |
}
|
1172 |
1183 |
|
1173 |
1184 |
$form->hide_form(qw(rowcount selectaccno));
|
1174 |
|
print qq|
|
1175 |
|
<input type=hidden name=selectprojectnumber value="|
|
1176 |
|
. $form->escape($form->{selectprojectnumber}, 1) . qq|">|;
|
|
1185 |
# print qq|
|
|
1186 |
# <input type=hidden name=selectprojectnumber value="|
|
|
1187 |
# . $form->escape($form->{selectprojectnumber}, 1) . qq|">|;
|
1177 |
1188 |
$lxdebug->leave_sub();
|
1178 |
1189 |
|
1179 |
1190 |
}
|
... | ... | |
1531 |
1542 |
|
1532 |
1543 |
my @flds =
|
1533 |
1544 |
qw(accno debit credit projectnumber fx_transaction source memo tax taxchart);
|
|
1545 |
if ($form->{storno}) {
|
|
1546 |
for my $i (1 .. $form->{rowcount}) {
|
|
1547 |
unless (($form->{"debit_$i"} eq "") && ($form->{"credit_$i"} eq "")) {
|
|
1548 |
if ($form->{"debit_$i"} ne "") {
|
|
1549 |
$form->{"credit_$i"} = $form->{"debit_$i"};
|
|
1550 |
$form->{"debit_$i"} = "";
|
|
1551 |
} elsif ($form->{"credit_$i"} ne "") {
|
|
1552 |
$form->{"debit_$i"} = $form->{"credit_$i"};
|
|
1553 |
$form->{"credit_$i"} = "";
|
|
1554 |
}
|
|
1555 |
}
|
|
1556 |
}
|
|
1557 |
}
|
1534 |
1558 |
|
1535 |
1559 |
for my $i (1 .. $form->{rowcount}) {
|
1536 |
1560 |
|
... | ... | |
1592 |
1616 |
}
|
1593 |
1617 |
if ($form->{taxincluded}) {
|
1594 |
1618 |
$form->{"tax_$i"} = $amount / ($rate + 1) * $rate;
|
|
1619 |
if ($debitcredit) {
|
|
1620 |
$form->{"debit_$i"} = $form->{"debit_$i"} - $form->{"tax_$i"};
|
|
1621 |
} else {
|
|
1622 |
$form->{"credit_$i"} = $form->{"credit_$i"} - $form->{"tax_$i"};
|
|
1623 |
}
|
1595 |
1624 |
} else {
|
1596 |
1625 |
$form->{"tax_$i"} = $amount * $rate;
|
1597 |
1626 |
}
|
1598 |
1627 |
} else {
|
1599 |
1628 |
$form->{"tax_$i"} = 0;
|
1600 |
1629 |
}
|
|
1630 |
} elsif ($form->{taxincluded}) {
|
|
1631 |
if ($debitcredit) {
|
|
1632 |
$form->{"debit_$i"} = $form->{"debit_$i"} - $form->{"tax_$i"};
|
|
1633 |
} else {
|
|
1634 |
$form->{"credit_$i"} = $form->{"credit_$i"} - $form->{"tax_$i"};
|
|
1635 |
}
|
1601 |
1636 |
}
|
1602 |
1637 |
|
1603 |
1638 |
for (@flds) { $a[$j]->{$_} = $form->{"${_}_$i"} }
|
... | ... | |
1625 |
1660 |
));
|
1626 |
1661 |
}
|
1627 |
1662 |
if ($form->{taxincluded}) {
|
1628 |
|
$debit += $dr;
|
1629 |
|
$credit += $cr;
|
|
1663 |
if ($dr) {
|
|
1664 |
$debit += $dr + $tax;
|
|
1665 |
}
|
|
1666 |
if ($cr) {
|
|
1667 |
$credit += $cr + $tax;
|
|
1668 |
}
|
1630 |
1669 |
$taxtotal += $tax;
|
1631 |
1670 |
} else {
|
1632 |
1671 |
if ($dr) {
|
Merge von 611,612,616 aus unstable: Bugfix zu Splitbuchungen
-Bug #205 behoben. Beim Dialogbuchen werden nun auch MwSt. inkl. Buchungen korrekt verarbeitet
-Bug #204 behoben: Storno geht jetzt auch bei Splitbuchungen
-Bug gefixed #206 Fehler beim Dialogbuchen wenn Korrektur und Steuerinklusive