671 |
671 |
$form->{forex} = $form->{exchangerate};
|
672 |
672 |
$exchangerate = $form->{exchangerate} ? $form->{exchangerate} : 1;
|
673 |
673 |
|
|
674 |
# expected keys: AR, AR_paid, AR_tax, AR_amount
|
674 |
675 |
foreach my $key (keys %{ $form->{AR_links} }) {
|
675 |
676 |
$j = 0;
|
676 |
677 |
$k = 0;
|
... | ... | |
699 |
700 |
$form->{"paid_project_id_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{project_id};
|
700 |
701 |
$form->{paidaccounts}++;
|
701 |
702 |
|
702 |
|
} else {
|
|
703 |
} else { # e.g. AR_amount, AR, AR_tax
|
703 |
704 |
|
704 |
705 |
$akey = $key;
|
705 |
|
$akey =~ s/AR_//;
|
|
706 |
$akey =~ s/AR_//; # e.g. tax, amount, AR, used to store form key tax_$i, amount_$i, ...
|
706 |
707 |
|
707 |
|
if ($key eq "AR_tax" || $key eq "AP_tax") {
|
|
708 |
if ($key eq "AR_tax" || $key eq "AP_tax") { # AR_tax
|
708 |
709 |
$form->{"${key}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
|
|
710 |
# determine the rounded tax amounts for each account, e.g. tax_1776
|
709 |
711 |
$form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} = $form->round_amount($form->{acc_trans}{$key}->[$i - 1]->{amount} / $exchangerate, 2);
|
710 |
712 |
|
|
713 |
# check e.g. $form->{1776_rate}, does this make sense for AR_tax charts? Is this ever valid? If it was, totaltax would be calculated twice
|
711 |
714 |
if ($form->{"$form->{acc_trans}{$key}->[$i-1]->{accno}_rate"} > 0) {
|
712 |
715 |
$totaltax += $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"};
|
713 |
716 |
$taxrate += $form->{"$form->{acc_trans}{$key}->[$i-1]->{accno}_rate"};
|
... | ... | |
718 |
721 |
}
|
719 |
722 |
|
720 |
723 |
$index = $form->{acc_trans}{$key}->[$i - 1]->{index};
|
721 |
|
$form->{"tax_$index"} = $form->{acc_trans}{$key}->[$i - 1]->{amount};
|
|
724 |
$form->{"tax_$index"} = $form->round_amount($form->{acc_trans}{$key}->[$i - 1]->{amount} / $exchangerate, 2); # convert the tax_$i amounts
|
|
725 |
# currently totaltax is the sum of rounded tax amounts, is this correct?
|
722 |
726 |
$totaltax += $form->{"tax_$index"};
|
723 |
727 |
|
724 |
|
} else {
|
|
728 |
} else { # e.g. AR_amount, AR
|
725 |
729 |
$k++;
|
726 |
730 |
$form->{"${akey}_$k"} = $form->round_amount($form->{acc_trans}{$key}->[$i - 1]->{amount} / $exchangerate, 2);
|
727 |
731 |
|
Debitoren- und Kreditorenbuchungen in Fremdwährung öffnen
Bisher wurde zwar der Buchungsbetrag anhand des Wechselkurse
umgerechnet, nicht aber die Steuer (sofern vorhanden), hierfür mußte man
erst erneuern.