Revision 043050cb
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/IR.pm | ||
---|---|---|
725 | 725 |
my ($query, $sth, $ref, $q_invdate); |
726 | 726 |
|
727 | 727 |
if (!$form->{id}) { |
728 |
$q_invdate = qq|, COALESCE((SELECT MAX(transdate) FROM ar), current_date) AS invdate|;
|
|
728 |
$q_invdate = qq|, COALESCE((SELECT transdate FROM ar WHERE id = (SELECT MAX(id) FROM ar)), current_date) AS invdate|;
|
|
729 | 729 |
if ($form->{vendor_id}) { |
730 | 730 |
my $vendor_id = $dbh->quote($form->{vendor_id} * 1); |
731 | 731 |
$q_invdate .= |
732 |
qq|, COALESCE((SELECT MAX(transdate) FROM ar), current_date) +
|
|
732 |
qq|, COALESCE((SELECT transdate FROM ar WHERE id = (SELECT MAX(id) FROM ar)), current_date) +
|
|
733 | 733 |
COALESCE((SELECT pt.terms_netto |
734 | 734 |
FROM vendor v |
735 | 735 |
LEFT JOIN payment_terms pt ON (v.payment_id = pt.id) |
Auch abrufbar als: Unified diff
Eingangsrechnungen: Wirklich das Datum der zuletzt erstellten Rechnung benutzen, nicht das maximale Datum.