- &post;
-
- $lxdebug->leave_sub();
-}
-
-sub split_debit {
- $lxdebug->enter_sub();
-
- # change callback
- $form->{old_callback} = $form->escape($form->{callback}, 1);
- $form->{callback} = $form->escape("$form->{script}?action=update", 1);
-
- # delete action
- delete $form->{action};
-
- # save all other form variables in a previousform variable
- foreach $key (keys %$form) {
-
- # escape ampersands
- $form->{$key} =~ s/&/%26/g;
- $previousform .= qq|$key=$form->{$key}&|;
- }
- chop $previousform;
- $previousform = $form->escape($previousform, 1);
- if (!$form->{debitpost}) {
- $form->{debitpost} = $form->{amount};
- }
- $form->{previousform} = $previousform;
- &display_split_debit();
-
- $lxdebug->leave_sub();
-}
-
-sub split_credit {
- $lxdebug->enter_sub();
-
- # change callback
- $form->{old_callback} = $form->escape($form->{callback}, 1);
- $form->{callback} = $form->escape("$form->{script}?action=update", 1);
-
- # delete action
- delete $form->{action};
-
- # save all other form variables in a previousform variable
- foreach $key (keys %$form) {
-
- # escape ampersands
- $form->{$key} =~ s/&/%26/g;
- $previousform .= qq|$key=$form->{$key}&|;
- }
- chop $previousform;
- $previousform = $form->escape($previousform, 1);
- if (!$form->{creditpost}) {
- $form->{creditpost} = $form->{amount};
- }
- $form->{previousform} = $previousform;
- &display_split_credit();
- $lxdebug->leave_sub();
-}
-
-sub display_split_credit {
- $lxdebug->enter_sub();
- $form->{taxchart} = $form->unescape($form->{taxchart});
-
- $form->header;
-
- print qq|
-<body>
-<form method=post name=split_credit action=gl.pl>
-|
- . $locale->text('Credit') . qq|: |
- . $form->format_amount(\%myconfig, $form->{amount}, 2)
- . qq| EUR<br>
-|
- . $locale->text('Still to post')
- . qq|:<input name=creditpost size=10 value="|
- . $form->format_amount(\%myconfig, $form->{creditpost}, 2)
- . qq|"> EUR<br>
-<script type="text/javascript">
- function update_stilltopost (betrag){
- remaining = parseFloat(document.split_credit.creditpost.value) - parseFloat(betrag);
- document.split_credit.creditpost.value= remaining;
- }
-</script>
-
-<table>|;
- for $i (2 .. $form->{creditrowcount}) {
- $form->{"creditchart_$i"} = $form->{chart};
- $form->{"creditchart_$i"} =~
- s/value=\"$form->{"creditchartselected_$i"}\"/value=\"$form->{"creditchartselected_$i"}\" selected/;
-
- $form->{"taxchart_$i"} = $form->{taxchart};
- $form->{"taxchart_$i"} =~
- s/value=\"$form->{"taxchartselected_$i"}\"/value=\"$form->{"taxchartselected_$i"}\" selected/;
- $position = $i - 1;
- print qq|
- <tr><td></td></tr>
- <tr>
- <th>Position $position</th>
- <td><select name=creditchartselected_$i>$form->{"creditchart_$i"}</select></td>
- <th align=right>| . $locale->text('Amount') . qq| $1</th>
- <td><input name=credit_$i size=10 value="|
- . $form->format_amount(\%myconfig, $form->{"credit_$i"}, 2)
- . qq|" onBlur="update_stilltopost(this.value)"> EUR</td>
- </tr>
- <tr>
- <th></th>
- <td><select name=taxchartselected_$i>$form->{"taxchart_$i"}</select></td>
- <th align=right>| . $locale->text('Tax') . qq|</th>
- <td><input name=tax_$i size=10 value="|
- . $form->format_amount(\%myconfig, $form->{"tax_$i"}, 2)
- . qq|"> EUR</td>
- <td><input type=checkbox name=tax_manual_$i value=1> Steuerkorrektur</td>
- </tr>
- <td></td>
- <tr>
- </tr>
- <tr>
- <td colspan=5><hr size=3 noshade></td>
- </tr>
-
-|;
- }
- print qq|
-</table>
-<input type=hidden name=previousform value="$form->{previousform}">
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-<input type=hidden name=callback value=$form->{callback}>
-<input type=hidden name=old_callback value=$form->{old_callback}>
-<input type=hidden name=amount value=$form->{amount}>
-<input type=hidden name=credit_splited value=1>
-<input type=hidden name=creditrowcount value="$form->{creditrowcount}">
-<input type=hidden name=chart value=| . $form->escape($form->{chart}) . qq|>
-<input type=hidden name=taxchart value=|
- . $form->escape($form->{taxchart}) . qq|>
-<p>
-<input class=submit type=submit name=action value="|
- . $locale->text('New Account') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('Close') . qq|">
-</form>
-
-</body>
-</html>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub display_split_debit {
- $lxdebug->enter_sub();
- $form->{taxchart} = $form->unescape($form->{taxchart});
-
- $form->header;
-
- print qq|
-<body>
-<form method=post name=split_debit action=gl.pl>
-|
- . $locale->text('Debit') . qq|: |
- . $form->format_amount(\%myconfig, $form->{amount}, 2)
- . qq| EUR<br>
-|
- . $locale->text('Still to post')
- . qq|:<input name=debitpost size=10 value="|
- . $form->format_amount(\%myconfig, $form->{debitpost}, 2)
- . qq|"> EUR<br>
-<script type="text/javascript">
- function update_stilltopost (betrag){
- remaining = parseFloat(document.split_debit.debitpost.value) - parseFloat(betrag);
- document.split_debit.debitpost.value= remaining;
- }
-</script>
-
-<table>|;
- for $i (2 .. $form->{debitrowcount}) {
- $form->{"debitchart_$i"} = $form->{chart};
- $form->{"debitchart_$i"} =~
- s/value=\"$form->{"debitchartselected_$i"}\"/value=\"$form->{"debitchartselected_$i"}\" selected/;
-
- $form->{"taxchart_$i"} = $form->{taxchart};
- $form->{"taxchart_$i"} =~
- s/value=\"$form->{"taxchartselected_$i"}\"/value=\"$form->{"taxchartselected_$i"}\" selected/;
- $position = $i - 1;
- print qq|
- <tr><td></td></tr>
- <tr>
- <th>Position $position</th>
- <td><select name=debitchartselected_$i>$form->{"debitchart_$i"}</select></td>
- <th align=right>| . $locale->text('Amount') . qq| $1</th>
- <td><input name=debit_$i size=10 value="|
- . $form->format_amount(\%myconfig, $form->{"debit_$i"}, 2)
- . qq|" onBlur="update_stilltopost(this.value)"> EUR</td>
- </tr>
- <tr>
- <th></th>
- <td><select name=taxchartselected_$i>$form->{"taxchart_$i"}</select></td>
- <th align=right>| . $locale->text('Tax') . qq|</th>
- <td><input name=tax_$i size=10 value="|
- . $form->format_amount(\%myconfig, $form->{"tax_$i"}, 2)
- . qq|"> EUR</td>
- <td><input type=checkbox name=tax_manual_$i value=1> Steuerkorrektur</td>
- </tr>
- <td></td>
- <tr>
- </tr>
- <tr>
- <td colspan=5><hr size=3 noshade></td>
- </tr>
-
-|;