Revision a4bbff92
Von Jan Büren vor fast 6 Jahren hinzugefügt
SL/DB/Helper/Payment.pm | ||
---|---|---|
39 | 39 |
|
40 | 40 |
# check for required parameters |
41 | 41 |
Common::check_params(\%params, qw(chart_id transdate)); |
42 |
if ( $params{'payment_type'} eq 'without_skonto' && abs($params{'amount'}) < 0) { |
|
43 |
croak "invalid amount for payment_type 'without_skonto': $params{'amount'}\n"; |
|
44 |
} |
|
45 |
|
|
42 | 46 |
|
43 | 47 |
my $transdate_obj; |
44 | 48 |
if (ref($params{transdate} eq 'DateTime')) { |
... | ... | |
84 | 88 |
$exchangerate = 1; |
85 | 89 |
}; |
86 | 90 |
|
87 |
# input checks: |
|
88 |
if ( $params{'payment_type'} eq 'without_skonto' ) { |
|
89 |
croak "invalid amount for payment_type 'without_skonto': $params{'amount'}\n" unless abs($params{'amount'}) > 0; |
|
90 |
}; |
|
91 |
|
|
92 | 91 |
# options with_skonto_pt and difference_as_skonto don't require the parameter |
93 | 92 |
# amount, but if amount is passed, make sure it matches the expected value |
94 | 93 |
if ( $params{'payment_type'} eq 'difference_as_skonto' ) { |
... | ... | |
756 | 755 |
a configured bank account. |
757 | 756 |
|
758 | 757 |
This function deals with all the acc_trans entries and also updates paid and datepaid. |
758 |
The params C<transdate> and C<chart_id> are mandantory. |
|
759 |
If the default payment ('without_skonto') is used the param amount is also |
|
760 |
mandantory. |
|
761 |
|
|
762 |
Transdate can either be a date object or a date string. |
|
763 |
Chart_id is the id of the payment booking chart. |
|
764 |
Amount is either a postive or negative number, but never 0. |
|
765 |
|
|
759 | 766 |
|
760 | 767 |
Example: |
761 | 768 |
|
Auch abrufbar als: Unified diff
Payment Kosmetik/Konvention
POD aktualisiert. Pflicht-Parameter am Anfang
der Methode prüfen