Revision 61e1b31e
Von Jan Büren vor etwa 2 Jahren hinzugefügt
SL/AP.pm | ||
---|---|---|
76 | 76 |
$form->{exchangerate} = 1; |
77 | 77 |
} else { |
78 | 78 |
$exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'sell'); |
79 |
$form->{exchangerate} = $exchangerate || $form->parse_amount($myconfig, $form->{exchangerate}); |
|
79 |
$form->{exchangerate} = $form->parse_amount($myconfig, $form->{exchangerate}, 5); |
|
80 |
|
|
81 |
# if default exchangerate is not defined, define one |
|
82 |
unless ($exchangerate) { |
|
83 |
$form->update_exchangerate($dbh, $form->{currency}, $form->{transdate}, 0, $form->{exchangerate}); |
|
84 |
# delete records exchangerate -> if user sets new invdate for record |
|
85 |
$query = qq|UPDATE ap set exchangerate = NULL where id = ?|; |
|
86 |
do_query($form, $dbh, $query, $form->{"id"}); |
|
87 |
} |
|
88 |
# update record exchangerate, if the default is set and differs from current |
|
89 |
if ($exchangerate && ($form->{exchangerate} != $exchangerate)) { |
|
90 |
$form->update_exchangerate($dbh, $form->{currency}, $form->{transdate}, |
|
91 |
0, $form->{exchangerate}, $form->{id}, 'ap'); |
|
92 |
} |
|
80 | 93 |
} |
81 | 94 |
|
82 | 95 |
# get the charts selected |
... | ... | |
110 | 123 |
# amount for total AP |
111 | 124 |
$form->{payables} = $form->{invtotal}; |
112 | 125 |
|
113 |
# update exchangerate |
|
114 |
if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) { |
|
115 |
$form->update_exchangerate($dbh, $form->{currency}, $form->{transdate}, 0, |
|
116 |
$form->{exchangerate}); |
|
117 |
} |
|
118 |
|
|
119 |
my ($query, $sth, @values); |
|
120 |
|
|
121 | 126 |
if (!$payments_only) { |
122 | 127 |
# if we have an id delete old records |
123 | 128 |
if ($form->{id}) { |
Auch abrufbar als: Unified diff
Beleg-Wechselkurs speichern, falls gesetzt und abweichend vom Tageskurs
Für alle 4 Buchungsmaske - Etwas zuviel in dem Commit, da die
form->id schon vorhanden sein muss und ich die Aufteilung an 2
Stellen von _post_invoice|post für das Holen und Setzen auf eine
reduzieren wollte.