Revision bed583a0
Von Philip Reetz vor etwa 19 Jahren hinzugefügt
bin/mozilla/gl.pl | ||
---|---|---|
899 | 899 |
$form->{oldtransdate} = $form->{transdate}; |
900 | 900 |
} |
901 | 901 |
|
902 |
my @a = (); |
|
903 |
my $count = 0; |
|
904 |
my $debittax = 0; |
|
905 |
my $credittax = 0; |
|
906 |
my @flds = |
|
902 |
my @a = (); |
|
903 |
my $count = 0; |
|
904 |
my $debittax = 0; |
|
905 |
my $credittax = 0; |
|
906 |
my $debitcount = 0; |
|
907 |
my $creditcount = 0; |
|
908 |
$debitlock = 0; |
|
909 |
$creditlock = 0; |
|
910 |
|
|
911 |
my @flds = |
|
907 | 912 |
qw(accno debit credit projectnumber fx_transaction source memo tax taxchart); |
908 | 913 |
|
909 | 914 |
for my $i (1 .. $form->{rowcount}) { |
... | ... | |
916 | 921 |
|
917 | 922 |
push @a, {}; |
918 | 923 |
$debitcredit = ($form->{"debit_$i"} == 0) ? "0" : "1"; |
924 |
if ($debitcredit) { |
|
925 |
$debitcount++; |
|
926 |
} else { |
|
927 |
$creditcount++; |
|
928 |
} |
|
929 |
|
|
930 |
if (($debitcount >= 2) && ($creditcount == 2)) { |
|
931 |
$form->{"credit_$i"} = 0; |
|
932 |
$form->{"tax_$i"} = 0; |
|
933 |
$creditcount--; |
|
934 |
$creditlock = 1; |
|
935 |
} |
|
936 |
if (($creditcount >= 2) && ($debitcount == 2)) { |
|
937 |
$form->{"debit_$i"} = 0; |
|
938 |
$form->{"tax_$i"} = 0; |
|
939 |
$debitcount--; |
|
940 |
$debitlock = 1; |
|
941 |
} |
|
942 |
if (($creditcount == 1) && ($debitcount == 2)) { |
|
943 |
$creditlock = 1; |
|
944 |
} |
|
945 |
if (($creditcount == 2) && ($debitcount == 1)) { |
|
946 |
$debitlock = 1; |
|
947 |
} |
|
948 |
if ($debitcredit && $credittax) { |
|
949 |
$form->{"taxchart_$i"} = "0--0.00"; |
|
950 |
} |
|
951 |
if (!$debitcredit && $debittax) { |
|
952 |
$form->{"taxchart_$i"} = "0--0.00"; |
|
953 |
} |
|
919 | 954 |
$amount = |
920 | 955 |
($form->{"debit_$i"} == 0) |
921 | 956 |
? $form->{"credit_$i"} |
... | ... | |
1027 | 1062 |
} |
1028 | 1063 |
|
1029 | 1064 |
} else { |
1030 |
|
|
1031 |
$form->{totaldebit} += $form->{"debit_$i"}; |
|
1032 |
$form->{totalcredit} += $form->{"credit_$i"}; |
|
1065 |
if ($form->{"debit_$i"} != 0) { |
|
1066 |
$form->{totaldebit} += $form->{"debit_$i"}; |
|
1067 |
$form->{totaldebit} += $form->{"tax_$i"}; |
|
1068 |
} else { |
|
1069 |
$form->{totalcredit} += $form->{"credit_$i"}; |
|
1070 |
$form->{totalcredit} += $form->{"tax_$i"}; |
|
1071 |
} |
|
1033 | 1072 |
|
1034 | 1073 |
for (qw(debit credit tax)) { |
1035 | 1074 |
$form->{"${_}_$i"} = |
... | ... | |
1102 | 1141 |
} |
1103 | 1142 |
} |
1104 | 1143 |
} |
1144 |
my $debitreadonly = ""; |
|
1145 |
my $creditreadonly = ""; |
|
1146 |
if ($i == $form->{rowcount}) { |
|
1147 |
if ($debitlock) { |
|
1148 |
$debitreadonly = "readonly"; |
|
1149 |
} elsif ($creditlock) { |
|
1150 |
$creditreadonly = "readonly"; |
|
1151 |
} |
|
1152 |
} |
|
1105 | 1153 |
|
1106 | 1154 |
print qq|<tr valign=top> |
1107 | 1155 |
$accno |
1108 | 1156 |
$fx_transaction |
1109 | 1157 |
<td><input name="debit_$i" size=10 value="$form->{"debit_$i"}" accesskey=$i tabindex=| |
1110 |
. ($i + 6 + (($i - 1) * 8)) . qq|></td> |
|
1158 |
. ($i + 6 + (($i - 1) * 8)) . qq| $debitreadonly></td>
|
|
1111 | 1159 |
<td><input name="credit_$i" size=10 value="$form->{"credit_$i"}" tabindex=| |
1112 |
. ($i + 7 + (($i - 1) * 8)) . qq|></td> |
|
1160 |
. ($i + 7 + (($i - 1) * 8)) . qq| $creditreadonly></td>
|
|
1113 | 1161 |
<td><input name="tax_$i" size=8 value="$form->{"tax_$i"}" tabindex=| |
1114 | 1162 |
. ($i + 8 + (($i - 1) * 8)) . qq|></td> |
1115 | 1163 |
$korrektur |
... | ... | |
1241 | 1289 |
<td> |
1242 | 1290 |
<table width=100%> |
1243 | 1291 |
<tr> |
1244 |
<th align=right>| . $locale->text('Reference') . qq|</th>
|
|
1292 |
<th align=left>| . $locale->text('Reference') . qq|</th>
|
|
1245 | 1293 |
<td><input name=reference size=20 value="$form->{reference}" tabindex="1" $readonly></td> |
1246 | 1294 |
<td align=left> |
1247 |
<table width=100%>
|
|
1295 |
<table> |
|
1248 | 1296 |
<tr> |
1249 | 1297 |
<th align=right nowrap>| . $locale->text('Date') . qq|</th> |
1250 | 1298 |
$button1 |
... | ... | |
1258 | 1306 |
<th align=right>| . $locale->text('Belegnummer') . qq|</th> |
1259 | 1307 |
<td><input name=id size=20 value="$form->{id}" $readonly></td> |
1260 | 1308 |
<td align=left> |
1261 |
<table width=100%>
|
|
1309 |
<table> |
|
1262 | 1310 |
<tr> |
1263 | 1311 |
<th align=right width=50%>| . $locale->text('Buchungsdatum') . qq|</th> |
1264 | 1312 |
<td align=left><input name=gldate size=11 title="$myconfig{dateformat}" value=$form->{gldate} $readonly></td> |
... | ... | |
1272 | 1320 |
if ($form->{id}) { |
1273 | 1321 |
print qq| |
1274 | 1322 |
<tr> |
1275 |
<th align=right>| . $locale->text('Description') . qq|</th>
|
|
1276 |
<td>$description</td> |
|
1323 |
<th align=left width=1%>| . $locale->text('Description') . qq|</th>
|
|
1324 |
<td width=1%>$description</td>
|
|
1277 | 1325 |
<td> |
1278 | 1326 |
<table> |
1279 | 1327 |
<tr> |
... | ... | |
1294 | 1342 |
} else { |
1295 | 1343 |
print qq| |
1296 | 1344 |
<tr> |
1297 |
<th align=right>| . $locale->text('Description') . qq|</th>
|
|
1298 |
<td colspan=2>$description</td>
|
|
1345 |
<th align=left width=1%>| . $locale->text('Description') . qq|</th>
|
|
1346 |
<td width=1%>$description</td>
|
|
1299 | 1347 |
<td> |
1300 | 1348 |
<table> |
1301 | 1349 |
<tr> |
... | ... | |
1308 | 1356 |
} |
1309 | 1357 |
print qq| |
1310 | 1358 |
<tr> |
1359 |
<td colspan=4> |
|
1311 | 1360 |
<table width=100%> |
1312 | 1361 |
<tr class=listheading> |
1313 | 1362 |
<th class=listheading style="width:15%">| |
... | ... | |
1343 | 1392 |
|
1344 | 1393 |
map { |
1345 | 1394 |
$form->{$_} = |
1346 |
$form->format_amount(\%myconfig, $form->{$_}, $decimalplaces, " ")
|
|
1395 |
$form->format_amount(\%myconfig, $form->{$_}, 2, " ")
|
|
1347 | 1396 |
} qw(totaldebit totalcredit); |
1348 | 1397 |
|
1349 | 1398 |
print qq| |
1399 |
<tr class=listtotal> |
|
1400 |
<td></td> |
|
1401 |
<th align=right class=listtotal> $form->{totaldebit}</th> |
|
1402 |
<th align=right class=listtotal> $form->{totalcredit}</th> |
|
1403 |
<td colspan=5></td> |
|
1404 |
</tr> |
|
1350 | 1405 |
</table> |
1406 |
</td> |
|
1407 |
</tr> |
|
1351 | 1408 |
</table> |
1352 | 1409 |
|
1353 | 1410 |
<input type=hidden name=path value=$form->{path}> |
... | ... | |
1463 | 1520 |
# check project |
1464 | 1521 |
&check_project; |
1465 | 1522 |
|
1466 |
my @a = (); |
|
1467 |
my $count = 0; |
|
1468 |
my $debittax = 0; |
|
1469 |
my $credittax = 0; |
|
1470 |
my @flds = |
|
1523 |
my @a = (); |
|
1524 |
my $count = 0; |
|
1525 |
my $debittax = 0; |
|
1526 |
my $credittax = 0; |
|
1527 |
my $debitcount = 0; |
|
1528 |
my $creditcount = 0; |
|
1529 |
$creditlock = 0; |
|
1530 |
$debitlock = 0; |
|
1531 |
|
|
1532 |
my @flds = |
|
1471 | 1533 |
qw(accno debit credit projectnumber fx_transaction source memo tax taxchart); |
1472 | 1534 |
|
1473 | 1535 |
for my $i (1 .. $form->{rowcount}) { |
... | ... | |
1480 | 1542 |
|
1481 | 1543 |
push @a, {}; |
1482 | 1544 |
$debitcredit = ($form->{"debit_$i"} == 0) ? "0" : "1"; |
1545 |
|
|
1546 |
if ($debitcredit) { |
|
1547 |
$debitcount++; |
|
1548 |
} else { |
|
1549 |
$creditcount++; |
|
1550 |
} |
|
1551 |
|
|
1552 |
if (($debitcount >= 2) && ($creditcount == 2)) { |
|
1553 |
$form->{"credit_$i"} = 0; |
|
1554 |
$form->{"tax_$i"} = 0; |
|
1555 |
$creditcount--; |
|
1556 |
$creditlock = 1; |
|
1557 |
} |
|
1558 |
if (($creditcount >= 2) && ($debitcount == 2)) { |
|
1559 |
$form->{"debit_$i"} = 0; |
|
1560 |
$form->{"tax_$i"} = 0; |
|
1561 |
$debitcount--; |
|
1562 |
$debitlock = 1; |
|
1563 |
} |
|
1564 |
if (($creditcount == 1) && ($debitcount == 2)) { |
|
1565 |
$creditlock = 1; |
|
1566 |
} |
|
1567 |
if (($creditcount == 2) && ($debitcount == 1)) { |
|
1568 |
$debitlock = 1; |
|
1569 |
} |
|
1570 |
if ($debitcredit && $credittax) { |
|
1571 |
$form->{"taxchart_$i"} = "0--0.00"; |
|
1572 |
} |
|
1573 |
if (!$debitcredit && $debittax) { |
|
1574 |
$form->{"taxchart_$i"} = "0--0.00"; |
|
1575 |
} |
|
1483 | 1576 |
$amount = |
1484 | 1577 |
($form->{"debit_$i"} == 0) |
1485 | 1578 |
? $form->{"credit_$i"} |
Auch abrufbar als: Unified diff
Aenderungen beim Dialogbuchen: Layout der Maske angepasst. Es kann nur eine Seite gesplittet werden, nur eine Seite kann Steuer haben