mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Fix promotion
This commit is contained in:
parent
84c42624f2
commit
bfab8728af
@ -145,7 +145,7 @@ class Company extends Eloquent
|
|||||||
foreach ($discounts as $weeks => $promo) {
|
foreach ($discounts as $weeks => $promo) {
|
||||||
list($discount, $validFor) = $promo;
|
list($discount, $validFor) = $promo;
|
||||||
$difference = $this->created_at->diffInWeeks();
|
$difference = $this->created_at->diffInWeeks();
|
||||||
if ($difference >= $weeks) {
|
if ($difference >= $weeks && $discount > $this->discount) {
|
||||||
$this->discount = $discount;
|
$this->discount = $discount;
|
||||||
$this->promo_expires = date_create()->modify($validFor . ' days')->format('Y-m-d');
|
$this->promo_expires = date_create()->modify($validFor . ' days')->format('Y-m-d');
|
||||||
$this->save();
|
$this->save();
|
||||||
|
Loading…
Reference in New Issue
Block a user