Revision 566fcc06
Von Jan Büren vor fast 2 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
813 | 813 |
if ($form->{currency} eq $defaultcurrency) { |
814 | 814 |
$form->{exchangerate} = 1; |
815 | 815 |
} else { |
816 |
$exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{invdate}, 'buy'); |
|
816 |
$exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{invdate}, 'buy'); |
|
817 |
$form->{exchangerate} = $form->parse_amount($myconfig, $form->{exchangerate}, 5); |
|
818 |
|
|
819 |
# if default exchangerate is not defined, define one |
|
820 |
unless ($exchangerate) { |
|
821 |
$form->update_exchangerate($dbh, $form->{currency}, $form->{invdate}, $form->{exchangerate}, 0); |
|
822 |
# delete records exchangerate -> if user sets new invdate for record |
|
823 |
$query = qq|UPDATE ar set exchangerate = NULL where id = ?|; |
|
824 |
do_query($form, $dbh, $query, $form->{"id"}); |
|
825 |
} |
|
826 |
# update record exchangerate, if the default is set and differs from current |
|
827 |
if ($exchangerate && ($form->{exchangerate} != $exchangerate)) { |
|
828 |
$form->update_exchangerate($dbh, $form->{currency}, $form->{invdate}, |
|
829 |
$form->{exchangerate}, 0, $form->{id}, 'ar'); |
|
830 |
} |
|
817 | 831 |
} |
818 | 832 |
|
819 |
$form->{exchangerate} = |
|
820 |
($exchangerate) |
|
821 |
? $exchangerate |
|
822 |
: $form->parse_amount($myconfig, $form->{exchangerate}); |
|
823 |
|
|
824 | 833 |
$form->{expense_inventory} = ""; |
825 | 834 |
|
826 | 835 |
my %baseunits; |
... | ... | |
1101 | 1110 |
# reverse AR |
1102 | 1111 |
$form->{amount}{ $form->{id} }{ $form->{AR} } *= -1; |
1103 | 1112 |
|
1104 |
# update exchangerate |
|
1105 |
if (($form->{currency} ne $defaultcurrency) && !$exchangerate) { |
|
1106 |
$form->update_exchangerate($dbh, $form->{currency}, $form->{invdate}, |
|
1107 |
$form->{exchangerate}, 0); |
|
1108 |
} |
|
1109 |
|
|
1110 | 1113 |
$project_id = conv_i($form->{"globalproject_id"}); |
1111 | 1114 |
# entsprechend auch beim Bestimmen des Steuerschlüssels in Taxkey.pm berücksichtigen |
1112 | 1115 |
my $taxdate = $form->{tax_point} ||$form->{deliverydate} || $form->{invdate}; |
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.