# setup customer/vendor selection for open invoices
if ($form->{all_vc}) {
+ # Dieser Zweig funktioniert derzeit NIE. Ggf. ganz raus oder
+ # alle offenen Zahlungen wieder korrekt anzeigen. jb 12.10.2010
$form->all_vc(\%myconfig, $form->{vc}, $form->{ARAP});
} else {
CP->get_openvc(\%myconfig, \%$form);
$form->{"select$form->{vc}"} = "";
if ($form->{"all_$form->{vc}"}) {
+ # s.o. jb 12.10.2010
$form->{"$form->{vc}_id"} = $form->{"all_$form->{vc}"}->[0]->{id};
map { $form->{"select$form->{vc}"} .= "<option>$_->{name}--$_->{id}\n" }
@{ $form->{"all_$form->{vc}"} };
}
- # departments
- if (@{ $form->{all_departments} || [] }) {
- $form->{selectdepartment} = "<option>\n";
- $form->{department} = "$form->{department}--$form->{department_id}";
-
- map {
- $form->{selectdepartment} .=
- "<option>$_->{description}--$_->{id}\n"
- } (@{ $form->{all_departments} || [] });
- }
-
CP->paymentaccounts(\%myconfig, \%$form);
$form->{selectaccount} = "";
} @{ $form->{PR}{ $form->{ARAP} } };
# currencies
+ # oldcurrency ist zwar noch hier als fragment enthalten, wird aber bei
+ # der aktualisierung der form auch nicht mitübernommen. das konzept
+ # old_$FOO habe ich auch noch nicht verstanden ...
+ # Ok. Wenn currency übernommen werden, dann in callback-string über-
+ # geben und hier reinparsen, oder besser multibox oder html auslagern?
+ # Antwort: form->currency wird mit oldcurrency oder curr[0] überschrieben
+ # Wofür macht das Sinn?
@curr = split(/:/, $form->{currencies});
chomp $curr[0];
$form->{defaultcurrency} = $form->{currency} = $form->{oldcurrency} =
$auth->assert('cash');
- my ($vc, $vclabel, $allvc, $arap, $department, $exchangerate);
+ my ($vc, $vclabel, $allvc, $arap, $exchangerate);
my ($jsscript, $button1, $button2, $onload);
$vclabel = ucfirst $form->{vc};
|;
}
}
-
- foreach my $item ($form->{vc}, "account", "currency", $form->{ARAP}, "department") {
+ foreach my $item ($form->{vc}, "account", "currency", $form->{ARAP}) {
$form->{"select$item"} =~ s/ selected//;
$form->{"select$item"} =~
s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
</td>
<td align=right>
<table>
- $department
<tr>
<th align=right nowrap>| . $locale->text('Account') . qq|</th>
<td colspan=3><select name=account>$form->{selectaccount}</select>
}
# if we switched to all_vc
+ # funktioniert derzeit nicht 12.10.2010 jb
if ($form->{all_vc} ne $form->{oldall_vc}) {
$form->{openinvoices} = ($form->{all_vc}) ? 0 : 1;
"<option>$_->{name}--$_->{id}\n"
} @{ $form->{"all_$form->{vc}"} };
}
- } else {
+ } else { # ab hier wieder ausgeführter code (s.o.):
CP->get_openvc(\%myconfig, \%$form);
if ($form->{"all_$form->{vc}"}) {
unless $form->{exchangerate};
}
- $form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&muh=kuh&account=$form->{account}";
+ # Beim Aktualisieren wird das Konto übernommen
+ $form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&type=$form->{type}&account=$form->{account}&$form->{currency}";
my $msg1 = "$form->{origtitle} posted!";
my $msg2 = "Cannot post $form->{origtitle}!";
# $locale->text('Receipt posted!')
# $locale->text('Cannot post Payment!')
# $locale->text('Cannot post Receipt!')
-
+ # Die Nachrichten (Receipt posted!) werden nicht angezeigt.
+ # Entweder wieder aktivieren oder komplett rausnehmen
$form->redirect($locale->text($msg1))
if (CP->process_payment(\%myconfig, \%$form));
$form->error($locale->text($msg2));
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));
+ $form->error($locale->text('Amount has to be greater then zero! Wrong row number: ') . $i);
}
undef($selected_check);
# last; # ich muss doch über alle buchungen laufen, da ich noch