#======================================================================
use SL::CP;
-use SL::OP;
use SL::IS;
use SL::IR;
-
use strict ("vars", "subs");
#use warnings;
sub payment {
$lxdebug->enter_sub();
-
$auth->assert('cash');
my (@curr);
}
CP->paymentaccounts(\%myconfig, \%$form);
-
$form->{selectaccount} = "";
$form->{"select$form->{ARAP}"} = "";
<tr valign=top>
<td>
<table>
- <tr>
- <td align=right>
- <input name=all_vc type=checkbox style=checkbox value=Y $allvc>
- <input type=hidden name="oldall_vc" value="$form->{all_vc}"></td>
- <th align=left>| . $locale->text('All') . qq|</th>
- </tr>
<tr>
<th align=right>$vclabel</th>
<td>$vc</td>
<th align=right nowrap>| . $locale->text('Currency') . qq|</th>
<td><select name=currency>$form->{selectcurrency}</select></td>
<input type=hidden name=selectcurrency value="$form->{selectcurrency}">
- <input type=hidden name=oldcurrency value=$form->{oldcurrency}>
</tr>
$exchangerate
<tr>
</tr>
<tr>
<th align="right" nowrap>| . $locale->text('Amount') . qq|</th>
- <td colspan="3"><input name="amount" size="10" value="|
- . $form->format_amount(\%myconfig, $form->{amount}, 2) . qq|" onBlur=\"check_right_number_format(this)\"></td>
+ <td colspan="3">| . $form->format_amount(\%myconfig, $form->{amount}, 2) . qq|</td>
</tr>
</table>
</td>
$jsscript
|;
+ if ($form->{openinvoices_other_currencies}) {
+ my $warning = $form->{vc} eq 'customer' ? $::locale->text('There are #1 more open invoices for this customer with other currencies.', $form->{openinvoices_other_currencies})
+ : $::locale->text('There are #1 more open invoices from this vendor with other currencies.', $form->{openinvoices_other_currencies});
+
+ print qq|
+
+ <input type="hidden" name="openinvoices_other_currencies" value="| . H($form->{openinvoices_other_currencies}) . qq|">
+ <tr>
+ <td><b>| . $::locale->text('Note') . qq|: $warning</b></td>
+ </tr>
+|;
+ }
+
$lxdebug->leave_sub();
}
unless $form->{exchangerate};
}
+ $form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&muh=kuh&account=$form->{account}";
+
my $msg1 = "$form->{origtitle} posted!";
my $msg2 = "Cannot post $form->{origtitle}!";
sub print {
$lxdebug->enter_sub();
-
+ exit; # Niemand braucht mich mehr! LöschMich endlich! jb 8.10.2010
$auth->assert('cash');
my ($whole, $check, %queued, $spool, $filename, $userspath);
if ($form->{currency} ne $form->{oldcurrency}) {
&update;
- exit;
+ ::end_of_request();
}
-
- $form->error($locale->text('Zero amount posting!')) if !$form->parse_amount(\%myconfig, $form->{amount});
$form->error($locale->text('Date missing!')) unless $form->{datepaid};
+ my $selected_check = 1;
+ for my $i (1 .. $form->{rowcount}) {
+ if ($form->{"checked_$i"}) {
+ if ($form->parse_amount(\%myconfig, $form->{"paid_$i"}, 2) <= 0) { # negativen Betrag eingegeben
+ $form->error($locale->text('No zero or negative values, please! Correct row number:' . $i));
+ }
+ undef($selected_check);
+ # last; # ich muss doch über alle buchungen laufen, da ich noch
+ # die freitext-eingabe der werte prüfen will
+ }
+ }
+ $form->error($locale->text('No transaction selected!')) if $selected_check;
$closedto = $form->datetonum($form->{closedto}, \%myconfig);
$datepaid = $form->datetonum($form->{datepaid}, \%myconfig);