mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 05:44:37 -04:00
Various fixes (#3136)
This commit is contained in:
parent
d07c11ef62
commit
259a28099f
@ -19,11 +19,14 @@ class CompanyFactory
|
|||||||
{
|
{
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
|
|
||||||
public static function create(int $account_id) :Company
|
/**
|
||||||
|
* @param int $account_id
|
||||||
|
* @return Company
|
||||||
|
*/
|
||||||
|
public function create(int $account_id) :Company
|
||||||
{
|
{
|
||||||
|
|
||||||
$company = new Company;
|
$company = new Company;
|
||||||
// $company->name = '';
|
// $company->name = '';
|
||||||
$company->account_id = $account_id;
|
$company->account_id = $account_id;
|
||||||
$company->company_key = $this->createHash();
|
$company->company_key = $this->createHash();
|
||||||
$company->settings = CompanySettings::defaults();
|
$company->settings = CompanySettings::defaults();
|
||||||
@ -32,6 +35,5 @@ class CompanyFactory
|
|||||||
$company->domain = '';
|
$company->domain = '';
|
||||||
|
|
||||||
return $company;
|
return $company;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -31,7 +31,7 @@ class CreateProductRequest extends Request
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'product_key' => 'required',
|
'product_key' => 'required',
|
||||||
]
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -30,7 +30,8 @@ class StoreClient
|
|||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*
|
*
|
||||||
* @return void
|
* @param array $data
|
||||||
|
* @param Client $client
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function __construct(array $data, Client $client)
|
public function __construct(array $data, Client $client)
|
||||||
@ -43,9 +44,11 @@ class StoreClient
|
|||||||
/**
|
/**
|
||||||
* Execute the job.
|
* Execute the job.
|
||||||
*
|
*
|
||||||
* @return void
|
* @param ClientRepository $client_repo
|
||||||
|
* @param ClientContactRepository $client_contact_repo
|
||||||
|
* @return Client|null
|
||||||
*/
|
*/
|
||||||
public function handle(ClientRepository $client_repo, ClientContactRepository $client_contact_repo) : ?Client
|
public function handle(ClientRepository $client_repo, ClientContactRepository $client_contact_repo) : ?Client {
|
||||||
|
|
||||||
$client = $client_repo->save($this->data, $this->client);
|
$client = $client_repo->save($this->data, $this->client);
|
||||||
|
|
||||||
|
@ -181,23 +181,23 @@ class Invoice extends BaseModel
|
|||||||
return $this->client->getSetting('lock_sent_invoices');
|
return $this->client->getSetting('lock_sent_invoices');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Determines if invoice overdue.
|
// * Determines if invoice overdue.
|
||||||
*
|
// *
|
||||||
* @param float $balance The balance
|
// * @param float $balance The balance
|
||||||
* @param date. $due_date The due date
|
// * @param date. $due_date The due date
|
||||||
*
|
// *
|
||||||
* @return boolean True if overdue, False otherwise.
|
// * @return boolean True if overdue, False otherwise.
|
||||||
*/
|
// */
|
||||||
public static function isOverdue($balance, $due_date)
|
// public static function isOverdue($balance, $due_date)
|
||||||
{
|
// {
|
||||||
if (! $this->formatValue($balance,2) > 0 || ! $due_date) {
|
// if (! $this->formatValue($balance,2) > 0 || ! $due_date) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// it isn't considered overdue until the end of the day
|
// // it isn't considered overdue until the end of the day
|
||||||
return strtotime($this->createClientDate(date(), $this->client->timezone()->name)) > (strtotime($due_date) + (60 * 60 * 24));
|
// return strtotime($this->createClientDate(date(), $this->client->timezone()->name)) > (strtotime($due_date) + (60 * 60 * 24));
|
||||||
}
|
// }
|
||||||
|
|
||||||
public function markViewed() :void
|
public function markViewed() :void
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user