mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #7645 from turbo124/v5-develop
Fixes for purchase orders when applying number
This commit is contained in:
commit
7ceb280bdf
@ -498,8 +498,15 @@ class Account extends BaseModel
|
|||||||
|
|
||||||
$plan_expires = Carbon::parse($this->plan_expires);
|
$plan_expires = Carbon::parse($this->plan_expires);
|
||||||
|
|
||||||
if(!$this->payment_id && $plan_expires->gt(now()))
|
if(!$this->payment_id && $plan_expires->gt(now())){
|
||||||
return $plan_expires->diffInDays();
|
|
||||||
|
$diff = $plan_expires->diffInDays();
|
||||||
|
|
||||||
|
if($diff > 14);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return $diff;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ class ApplyNumber extends AbstractService
|
|||||||
$this->trySaving();
|
$this->trySaving();
|
||||||
break;
|
break;
|
||||||
case 'when_sent':
|
case 'when_sent':
|
||||||
if ($this->invoice->status_id == PurchaseOrder::STATUS_SENT) {
|
if ($this->purchase_order->status_id == PurchaseOrder::STATUS_SENT) {
|
||||||
$this->trySaving();
|
$this->trySaving();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user