Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ce19982e

Von Jan Büren vor mehr als 14 Jahren hinzugefügt

  • ID ce19982eebaca18b471aa5ee990c0b8a1602dce2
  • Vorgänger aef4bc0c
  • Nachfolger ab37875e

Currencies nochmal besser kommentiert und fehlerhaften Array wieder rausgenommen. Die callback-Funktion um currency erweitert (@sven donath: muh=kuh hatte ich mal extra dringelassen ...). Ferner ist die Antwort zu department klar: Abteilungen werden bei Rechnungen oder FiBu-Buchungen angegeben und sollten nicht per Zahlungsein- oder -ausgang geändert werden. Entsprechend aus cp.pl und CP.pm entfernt.

Unterschiede anzeigen:

SL/CP.pm
$form->{"all_$form->{vc}"} = selectall_hashref_query($form, $dbh, $query);
}
if ($form->{ARAP} eq 'AR') {
$query =
qq|SELECT d.id, d.description | .
qq|FROM department d | .
qq|WHERE d.role = 'P' | .
qq|ORDER BY 2|;
} else {
$query =
qq|SELECT d.id, d.description | .
qq|FROM department d | .
qq|ORDER BY 2|;
}
$form->{all_departments} = selectall_hashref_query($form, $dbh, $query);
# aufruf für all_deparments rausgenommen, da die abteilungen nur
# beim buchen der belege (rechnung, fibu) geändert werden und danach
# NICHT mehr überschrieben werden
$dbh->disconnect;
$main::lxdebug->leave_sub();
......
}
my $null;
($null, $form->{department_id}) = split(/--/, $form->{department});
$form->{department_id} *= 1;
# query to retrieve paid amount
$query =
qq|SELECT a.paid FROM ar a | .
bin/mozilla/cp.pl
@{ $form->{"all_$form->{vc}"} };
}
# departments
# auf departments kann man auch nicht mehr buchen. Raus oder wieder
# aktivieren? Im Backend dann auch anpassen. jb 12.10.2010
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} = "";
......
# 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?
@curr_unsorted = split(/:/, $form->{currencies});
chomp $curr_unsorted[0];
@curr = sort {} @curr_unsorted;
# 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} =
$curr[0];
......
$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>
......
}
# Beim Aktualisieren wird das Konto übernommen
$form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&type=$form->{type}&account=$form->{account}";
$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}!";

Auch abrufbar als: Unified diff