Revision c65e8fcc
Von Martin Helmling mh@waldpark.octosoft.eu vor mehr als 8 Jahren hinzugefügt
SL/DB/Invoice.pm | ||
---|---|---|
162 | 162 |
} |
163 | 163 |
|
164 | 164 |
my $terms = $source->can('payment_id') ? $source->payment_terms : undef; |
165 |
$terms = $source->customer->payment_terms if !defined $terms && $source->customer; |
|
165 | 166 |
|
166 | 167 |
my %args = ( map({ ( $_ => $source->$_ ) } qw(customer_id taxincluded shippingpoint shipvia notes intnotes salesman_id cusordnumber ordnumber department_id |
167 |
cp_id language_id taxzone_id globalproject_id transaction_description currency_id delivery_term_id payment_id), @columns),
|
|
168 |
cp_id language_id taxzone_id globalproject_id transaction_description currency_id delivery_term_id), @columns), |
|
168 | 169 |
transdate => DateTime->today_local, |
169 | 170 |
gldate => DateTime->today_local, |
170 | 171 |
duedate => $terms ? $terms->calc_date(reference_date => DateTime->today_local) : DateTime->today_local, |
... | ... | |
175 | 176 |
employee_id => (SL::DB::Manager::Employee->current || SL::DB::Employee->new(id => $source->employee_id))->id, |
176 | 177 |
); |
177 | 178 |
|
179 |
$args{payment_id} = ( $terms ? $terms->id : $source->payment_id); |
|
180 |
|
|
178 | 181 |
if ($source->type =~ /_order$/) { |
179 | 182 |
$args{deliverydate} = $source->reqdate; |
180 | 183 |
$args{orddate} = $source->transdate; |
Auch abrufbar als: Unified diff
Verkauf/Rechnungen/Massenerstellung: keine Zahlungsbedingungen
Falls im Lieferschein keine Zahlungsbedingungen gesetzt sind, (normalerweise nicht)
wird die des Kunden für die Rechnung eingesetzt