Revision 5d5a1646
Von Jan Büren vor mehr als 2 Jahren hinzugefügt
SL/AP.pm | ||
---|---|---|
|
||
# update exchange rate record
|
||
if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
|
||
$form->{script} = 'ap.pl';
|
||
$form->update_exchangerate($dbh, $form->{currency},
|
||
$form->{"datepaid_$i"},
|
||
0, $form->{"exchangerate_$i"});
|
SL/Form.pm | ||
---|---|---|
{ type => SCALAR, callbacks => { is_valid_kivi_date => sub { shift =~ m/\d+\d+\d+/ } } }, # we have three numers
|
||
{ type => SCALAR, callbacks => { is_null_or_ar_int => sub { $_[0] == 0
|
||
|| $_[0] > 0
|
||
&& $_[1]->[0]->{script} =~ m/ar\.pl|is\.pl/ } } }, # value buy fxrate
|
||
&& $_[1]->[0]->{script} =~ m/cp\.pl|ar\.pl|is\.pl/ } } }, # value buy fxrate
|
||
{ type => SCALAR, callbacks => { is_null_or_ap_int => sub { $_[0] == 0
|
||
|| $_[0] > 0
|
||
&& $_[1]->[0]->{script} =~ m/ap\.pl|ir\.pl/ } } }, # value sell fxrate
|
||
&& $_[1]->[0]->{script} =~ m/cp\.pl|ap\.pl|ir\.pl/ } } }, # value sell fxrate
|
||
{ type => SCALAR, callbacks => { is_current_form_id => sub { $_[0] == $_[1]->[0]->{id} } }, optional => 1 },
|
||
{ type => SCALAR, callbacks => { is_valid_fx_table => sub { shift =~ m/(ar|ap|bank_transactions)/ } }, optional => 1 }
|
||
);
|
SL/IR.pm | ||
---|---|---|
$paiddiff = 0;
|
||
|
||
# update exchange rate for PAYMENTS
|
||
$form->{script} = 'ir.pl';
|
||
$form->update_exchangerate($dbh, $form->{currency}, $form->{"datepaid_$i"}, 0, $form->{"exchangerate_$i"})
|
||
if ($form->{currency} ne $defaultcurrency) && !$exchangerate;
|
||
}
|
SL/IS.pm | ||
---|---|---|
# update exchange rate for PAYMENTS
|
||
# exchangerate contains a new exchangerate of the payment date
|
||
if (($form->{currency} ne $defaultcurrency) && !$exchangerate) {
|
||
$form->{script} = 'is.pl';
|
||
$form->update_exchangerate($dbh, $form->{currency},
|
||
$form->{"datepaid_$i"},
|
||
$form->{"exchangerate_$i"}, 0);
|
bin/mozilla/cp.pl | ||
---|---|---|
if (!$form->{forex}) { # read exchangerate from input field (not hidden)
|
||
$form->{exchangerate} = $form->parse_amount(\%myconfig, $form->{exchangerate});
|
||
}
|
||
$form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{datepaid}, $buysell);
|
||
$form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{datepaid}, $buysell)
|
||
if $form->{defaultcurrency} ne $form->{currency} && $form->{datepaid};
|
||
$form->{exchangerate} = $form->{forex} if $form->{forex};
|
||
|
||
$amount = $form->{amount} = $form->parse_amount(\%myconfig, $form->{amount});
|
Auch abrufbar als: Unified diff
update_exchangerate für Zahlungen auch bei manueller Verbuchung