mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Set recurring due date using account payment terms
This commit is contained in:
parent
e6588ac3b2
commit
1737af10c4
@ -1030,14 +1030,20 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
if($dueDate) {
|
if($dueDate) {
|
||||||
return date('Y-m-d', $dueDate);// SQL format
|
return date('Y-m-d', $dueDate);// SQL format
|
||||||
}
|
}
|
||||||
}
|
} elseif ($this->client->payment_terms != 0) {
|
||||||
else if ($this->client->payment_terms != 0) {
|
|
||||||
// No custom due date set for this invoice; use the client's payment terms
|
// No custom due date set for this invoice; use the client's payment terms
|
||||||
$days = $this->client->payment_terms;
|
$days = $this->client->payment_terms;
|
||||||
if ($days == -1) {
|
if ($days == -1) {
|
||||||
$days = 0;
|
$days = 0;
|
||||||
}
|
}
|
||||||
return date('Y-m-d', strtotime('+'.$days.' day', $now));
|
return date('Y-m-d', strtotime('+'.$days.' day', $now));
|
||||||
|
} elseif ($this->account->payment_terms != 0) {
|
||||||
|
// No custom due date set for this invoice; use the client's payment terms
|
||||||
|
$days = $this->account->payment_terms;
|
||||||
|
if ($days == -1) {
|
||||||
|
$days = 0;
|
||||||
|
}
|
||||||
|
return date('Y-m-d', strtotime('+'.$days.' day', $now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user