Revision 61e1b31e
Von Jan Büren vor etwa 2 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
796 | 796 |
if ($form->{currency} eq $defaultcurrency) { |
797 | 797 |
$form->{exchangerate} = 1; |
798 | 798 |
} else { |
799 |
$exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{invdate}, 'buy'); |
|
799 |
$exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{invdate}, 'buy'); |
|
800 |
$form->{exchangerate} = $form->parse_amount($myconfig, $form->{exchangerate}, 5); |
|
801 |
|
|
802 |
# if default exchangerate is not defined, define one |
|
803 |
unless ($exchangerate) { |
|
804 |
$form->update_exchangerate($dbh, $form->{currency}, $form->{invdate}, $form->{exchangerate}, 0); |
|
805 |
# delete records exchangerate -> if user sets new invdate for record |
|
806 |
$query = qq|UPDATE ar set exchangerate = NULL where id = ?|; |
|
807 |
do_query($form, $dbh, $query, $form->{"id"}); |
|
808 |
} |
|
809 |
# update record exchangerate, if the default is set and differs from current |
|
810 |
if ($exchangerate && ($form->{exchangerate} != $exchangerate)) { |
|
811 |
$form->update_exchangerate($dbh, $form->{currency}, $form->{invdate}, |
|
812 |
$form->{exchangerate}, 0, $form->{id}, 'ar'); |
|
813 |
} |
|
800 | 814 |
} |
801 | 815 |
|
802 |
$form->{exchangerate} = |
|
803 |
($exchangerate) |
|
804 |
? $exchangerate |
|
805 |
: $form->parse_amount($myconfig, $form->{exchangerate}); |
|
806 |
|
|
807 | 816 |
$form->{expense_inventory} = ""; |
808 | 817 |
|
809 | 818 |
my %baseunits; |
... | ... | |
1080 | 1089 |
# reverse AR |
1081 | 1090 |
$form->{amount}{ $form->{id} }{ $form->{AR} } *= -1; |
1082 | 1091 |
|
1083 |
# update exchangerate |
|
1084 |
if (($form->{currency} ne $defaultcurrency) && !$exchangerate) { |
|
1085 |
$form->update_exchangerate($dbh, $form->{currency}, $form->{invdate}, |
|
1086 |
$form->{exchangerate}, 0); |
|
1087 |
} |
|
1088 |
|
|
1089 | 1092 |
$project_id = conv_i($form->{"globalproject_id"}); |
1090 | 1093 |
# entsprechend auch beim Bestimmen des Steuerschlüssels in Taxkey.pm berücksichtigen |
1091 | 1094 |
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.