X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FPaymentTerm.pm;h=db443e947657964fdca1adb4200b3ad59e665a61;hb=5a618706a76c255d27288805c6fdd1f113f73183;hp=5d84d6881339659b5f443ee7a889987632415c00;hpb=5bc87ade7044239fa9e893b9d7cbd476dc627eea;p=kivitendo-erp.git diff --git a/SL/DB/PaymentTerm.pm b/SL/DB/PaymentTerm.pm index 5d84d6881..db443e947 100644 --- a/SL/DB/PaymentTerm.pm +++ b/SL/DB/PaymentTerm.pm @@ -57,8 +57,15 @@ SL::DB::PaymentTerm - Rose model for the payment_terms table =head1 SYNOPSIS my $terms = SL::DB::PaymentTerm->new(id => $::form->{payment_id})->load; - my $due_date_net = $erms->calc_date(terms => 'net'); # uses terms_netto - my $due_date_discount = $erms->calc_date(terms => 'discount'); # uses terms_skonto + my $due_date_net = $terms->calc_date(terms => 'net'); # uses terms_netto + my $due_date_discount = $terms->calc_date(terms => 'discount'); # uses terms_skonto + + # Calculate due date taking the existing invoice date and the due + # date entered by the user into account: + my $due_date = $terms->calc_date( + reference_date => $::form->{invdate}, + due_date => $::form->{duedate}, + ); =head1 FUNCTIONS @@ -71,7 +78,7 @@ adding one of C<$self>'s terms fields if automatic calculation is on; otherwise returns the currently-set due date (which must be provided) or the reference date, whichever is later. -Note that for automatich calculation the resulting date will be the +Note that for automatic calculation the resulting date will be the following Monday if the result falls on a weekend. C<%params> can contain the following parameters: