Revision 2c0706f7
Von Sven Schöling vor 11 Monaten hinzugefügt
bin/mozilla/ir.pl | ||
---|---|---|
198 | 198 |
$form->{acc_trans}{$key}->[$i - 1]->{exchangerate}; |
199 | 199 |
$form->{"source_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{source}; |
200 | 200 |
$form->{"memo_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{memo}; |
201 |
$form->{"defaultcurrency_paid_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{defaultcurrency_paid}; |
|
202 |
$form->{"fx_transaction_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{fx_transaction}; |
|
201 | 203 |
|
202 | 204 |
$form->{paidaccounts} = $i; |
203 | 205 |
# hook for calc of of defaultcurrency_paid and check if banktransaction has a record exchangerate |
204 |
if ($form->{"exchangerate_$i"}) { |
|
206 |
if ($form->{"exchangerate_$i"} && $form->{"acc_trans_id_$i"}) {
|
|
205 | 207 |
my $bt_acc_trans = SL::DB::Manager::BankTransactionAccTrans->find_by(acc_trans_id => $form->{"acc_trans_id_$i"}); |
206 | 208 |
if ($bt_acc_trans) { |
207 | 209 |
if ($bt_acc_trans->bank_transaction->exchangerate > 0) { |
... | ... | |
210 | 212 |
$form->{"record_forex_$i"} = 1; |
211 | 213 |
} |
212 | 214 |
} |
213 |
$form->{"defaultcurrency_paid_$i"} = $form->{"paid_$i"} * $form->{"exchangerate_$i"}; |
|
215 |
if (!$form->{"fx_transaction_$i"}) { |
|
216 |
# this is a banktransaction that was paid in internal currency. revert paid/defaultcurrency_paid |
|
217 |
$form->{"defaultcurrency_paid_$i"} = $form->{"paid_$i"}; |
|
218 |
$form->{"paid_$i"} /= $form->{"exchangerate_$i"}; |
|
219 |
} |
|
220 |
$form->{"defaultcurrency_paid_$i"} //= $form->{"paid_$i"} * $form->{"exchangerate_$i"}; |
|
214 | 221 |
$form->{"defaultcurrency_totalpaid"} += $form->{"defaultcurrency_paid_$i"}; |
215 | 222 |
} # end hook defaultcurrency_paid |
216 | 223 |
} |
templates/webpages/ir/_payments.html | ||
---|---|---|
82 | 82 |
[% SET exchangerate = 'exchangerate_' _ i %] |
83 | 83 |
[% SET defaultcurrency_paid = 'defaultcurrency_paid_' _ i %] |
84 | 84 |
[% SET record_forex = 'record_forex_' _ i %] |
85 |
[% SET fx_transaction = 'fx_transaction_' _ i %] |
|
85 | 86 |
[% IF $forex %] |
86 | 87 |
<input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 5) %]"> |
87 | 88 |
<input type="hidden" name="record_forex_[% i %]" value="[% $record_forex %]"> |
88 | 89 |
<input type="hidden" name="forex_[% i %]" value="[% $forex %]"> |
89 | 90 |
<input type="hidden" name="defaultcurrency_paid_[% i %]" value="[% $defaultcurrency_paid %]"> |
91 |
<input type="hidden" name="fx_transaction_[% i %]" value="1"> |
|
90 | 92 |
[% LxERP.format_amount($forex, 5) %] = [% LxERP.format_amount($defaultcurrency_paid, 5) %] [% defaultcurrency %] </br> |
91 | 93 |
[% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %] |
92 | 94 |
[% ELSE %] |
Auch abrufbar als: Unified diff
IR: fx_transaction payments
Es wird jetzt das fx_transaction flag durchgereicht, wenn die Zahlung im
FGrontend angelegt wurde, oder in Fremdwährung in der Datenbank gefunden
wurde.
Interne Währungszahlungen werden initial ohne fx_transaction geladen,
dann aber wie "normale" Fremdbuchungen durchgereicht
Im Gegensatz zu AP/AR wird hier direkt create_links aufgerufen.