105 |
105 |
} (@{ $form->{all_departments} });
|
106 |
106 |
}
|
107 |
107 |
|
|
108 |
$form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details};
|
|
109 |
|
108 |
110 |
&display_form(1);
|
109 |
111 |
$lxdebug->leave_sub();
|
110 |
112 |
|
... | ... | |
189 |
191 |
|
190 |
192 |
$form->{title} = "Edit";
|
191 |
193 |
|
|
194 |
$form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details};
|
|
195 |
|
192 |
196 |
form_header();
|
193 |
197 |
display_rows();
|
194 |
198 |
form_footer();
|
... | ... | |
1055 |
1059 |
my ($init) = @_;
|
1056 |
1060 |
$lxdebug->enter_sub();
|
1057 |
1061 |
|
|
1062 |
$form->{debit_1} = 0 if !$form->{"debit_1"};
|
1058 |
1063 |
$form->{totaldebit} = 0;
|
1059 |
1064 |
$form->{totalcredit} = 0;
|
1060 |
1065 |
|
... | ... | |
1214 |
1219 |
'-labels' => \%project_labels,
|
1215 |
1220 |
'-default' => $form->{"project_id_$i"} ));
|
1216 |
1221 |
|
|
1222 |
my $copy2credit = 'onkeyup="copy_debit_to_credit()"' if $i == 1;
|
|
1223 |
|
1217 |
1224 |
print qq|<tr valign=top>
|
1218 |
1225 |
$accno
|
1219 |
1226 |
$fx_transaction
|
1220 |
|
<td><input name="debit_$i" size=8 value="$form->{"debit_$i"}" accesskey=$i $debitreadonly></td>
|
|
1227 |
<td><input name="debit_$i" size="8" value="$form->{"debit_$i"}" accesskey=$i $copy2credit $debitreadonly></td>
|
1221 |
1228 |
<td><input name="credit_$i" size=8 value="$form->{"credit_$i"}" $creditreadonly></td>
|
1222 |
1229 |
<td><input name="tax_$i" size=6 value="$form->{"tax_$i"}"></td>
|
1223 |
1230 |
$korrektur
|
1224 |
|
$tax
|
|
1231 |
$tax|;
|
|
1232 |
|
|
1233 |
if ($form->{show_details}) {
|
|
1234 |
print qq|
|
1225 |
1235 |
$source
|
1226 |
1236 |
$memo
|
1227 |
1237 |
<td>$projectnumber</td>
|
|
1238 |
|;
|
|
1239 |
}
|
|
1240 |
print qq|
|
1228 |
1241 |
</tr>
|
1229 |
|
|
1230 |
|
|;
|
|
1242 |
|;
|
1231 |
1243 |
}
|
1232 |
1244 |
|
1233 |
1245 |
$form->hide_form(qw(rowcount selectaccno));
|
... | ... | |
1243 |
1255 |
$form->{title} = $locale->text("$title General Ledger Transaction");
|
1244 |
1256 |
$readonly = ($form->{id}) ? "readonly" : "";
|
1245 |
1257 |
|
|
1258 |
$show_details_checked = "checked" if $form->{show_details};
|
|
1259 |
|
1246 |
1260 |
# $locale->text('Add General Ledger Transaction')
|
1247 |
1261 |
# $locale->text('Edit General Ledger Transaction')
|
1248 |
1262 |
|
1249 |
1263 |
map { $form->{$_} =~ s/\"/"/g }
|
1250 |
1264 |
qw(reference description chart taxchart);
|
|
1265 |
|
1251 |
1266 |
$form->{javascript} = qq|<script type="text/javascript">
|
1252 |
1267 |
<!--
|
1253 |
1268 |
function setTaxkey(accno, row) {
|
... | ... | |
1265 |
1280 |
}
|
1266 |
1281 |
}
|
1267 |
1282 |
};
|
|
1283 |
|
|
1284 |
function copy_debit_to_credit() {
|
|
1285 |
var txt = document.getElementsByName('debit_1')[0].value;
|
|
1286 |
document.getElementsByName('credit_2')[0].value = txt;
|
|
1287 |
};
|
|
1288 |
|
1268 |
1289 |
//-->
|
1269 |
1290 |
</script>|;
|
|
1291 |
$form->{javascript} .= qq|<script type="text/javascript" src="js/show_form_details.js"></script>|;
|
1270 |
1292 |
|
1271 |
1293 |
$form->{selectdepartment} =~ s/ selected//;
|
1272 |
1294 |
$form->{selectdepartment} =~
|
... | ... | |
1300 |
1322 |
}
|
1301 |
1323 |
|
1302 |
1324 |
# use JavaScript Calendar or not
|
1303 |
|
$form->{jsscript} = $jscalendar;
|
|
1325 |
$form->{jsscript} = 1;
|
1304 |
1326 |
$jsscript = "";
|
1305 |
1327 |
if ($form->{jsscript}) {
|
1306 |
1328 |
|
... | ... | |
1409 |
1431 |
</td>
|
1410 |
1432 |
</tr>|;
|
1411 |
1433 |
}
|
|
1434 |
|
|
1435 |
print qq|<tr>
|
|
1436 |
<td width="1%" align="right" nowrap>| . $locale->text('Show details') . qq|</td>
|
|
1437 |
<td width="1%"><input type="checkbox" onclick="show_form_details();" name="show_details" value="1" $show_details_checked></td>
|
|
1438 |
</tr>|;
|
|
1439 |
|
1412 |
1440 |
print qq|
|
1413 |
1441 |
<tr>
|
1414 |
1442 |
<td colspan=4>
|
... | ... | |
1425 |
1453 |
<th class=listheading style="width:5%">|
|
1426 |
1454 |
. $locale->text('Korrektur') . qq|</th>
|
1427 |
1455 |
<th class=listheading style="width:10%">|
|
1428 |
|
. $locale->text('Taxkey') . qq|</th>
|
1429 |
|
<th class=listheading style="width:20%">|
|
1430 |
|
. $locale->text('Source') . qq|</th>
|
|
1456 |
. $locale->text('Taxkey') . qq|</th>|;
|
|
1457 |
|
|
1458 |
if ($form->{show_details}) {
|
|
1459 |
print qq|
|
|
1460 |
<th class=listheading style="width:20%">| . $locale->text('Source') . qq|</th>
|
1431 |
1461 |
<th class=listheading style="width:20%">| . $locale->text('Memo') . qq|</th>
|
1432 |
|
<th class=listheading style="width:20%">|
|
1433 |
|
. $locale->text('Project Number') . qq|</th>
|
|
1462 |
<th class=listheading style="width:20%">| . $locale->text('Project Number') . qq|</th>
|
|
1463 |
|;
|
|
1464 |
}
|
|
1465 |
|
|
1466 |
print qq|
|
1434 |
1467 |
</tr>
|
1435 |
1468 |
|
1436 |
1469 |
$jsscript
|
... | ... | |
1497 |
1530 |
# }
|
1498 |
1531 |
} else {
|
1499 |
1532 |
if ($transdate > $closedto) {
|
1500 |
|
print qq|<input class=submit type=submit name=action value="|
|
|
1533 |
print qq|<input class=submit type=submit name=action id=update_button value="|
|
1501 |
1534 |
. $locale->text('Update') . qq|">
|
1502 |
1535 |
<input class=submit type=submit name=action value="|
|
1503 |
1536 |
. $locale->text('Post') . qq|">|;
|
... | ... | |
1568 |
1601 |
sub post {
|
1569 |
1602 |
$lxdebug->enter_sub();
|
1570 |
1603 |
|
|
1604 |
$form->{title} = $locale->text("$form->{title} General Ledger Transaction");
|
|
1605 |
|
1571 |
1606 |
# check if there is something in reference and date
|
1572 |
1607 |
$form->isblank("reference", $locale->text('Reference missing!'));
|
1573 |
1608 |
$form->isblank("transdate", $locale->text('Transaction Date missing!'));
|
... | ... | |
1740 |
1775 |
$form->save_history($form->dbconnect(\%myconfig));
|
1741 |
1776 |
}
|
1742 |
1777 |
# /saving the history
|
1743 |
|
$form->redirect("Buchung gespeichert. Buchungsnummer = " . $form->{id});
|
|
1778 |
|
|
1779 |
$form->{callback} = build_std_url("action=add", "show_details");
|
|
1780 |
$form->redirect($form->{callback});
|
|
1781 |
|
1744 |
1782 |
$lxdebug->leave_sub();
|
1745 |
1783 |
|
1746 |
1784 |
}
|
Dialogbuchen:
1. Einige Spalten nur dann anzeigen, wenn "Details anzeigen" aktiv ist.
2. Automatisch den eingegebenen Wert aus der ersten Zeile "Soll" in die zweite Zeile "Haben" kopieren, wenn er verändert wird.
Patch von Rainer Guempelein.