mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Changes for white label license
This commit is contained in:
parent
f9c36fd761
commit
ad68d64dca
@ -62,8 +62,12 @@ class SendRenewalInvoices extends Command
|
||||
$invoice->due_date = date('Y-m-d', strtotime('+ 10 days'));
|
||||
$invoice->save();
|
||||
|
||||
$this->mailer->sendInvoice($invoice);
|
||||
$this->info("Sent invoice to {$client->getDisplayName()}");
|
||||
if ($term == PLAN_TERM_YEARLY) {
|
||||
$this->mailer->sendInvoice($invoice);
|
||||
$this->info("Sent {$term}ly {$plan} invoice to {$client->getDisplayName()}");
|
||||
} else {
|
||||
$this->info("Created {$term}ly {$plan} invoice for {$client->getDisplayName()}");
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Done');
|
||||
|
@ -142,7 +142,9 @@ class StartupCheck
|
||||
} elseif ($productId == PRODUCT_WHITE_LABEL) {
|
||||
if ($data == 'valid') {
|
||||
$company = Auth::user()->account->company;
|
||||
$company->plan_term = PLAN_TERM_YEARLY;
|
||||
$company->plan_paid = date_create()->format('Y-m-d');
|
||||
$company->plan_expires = date_create()->modify('+1 year')->format('Y-m-d');
|
||||
$company->plan = PLAN_WHITE_LABEL;
|
||||
$company->save();
|
||||
|
||||
|
@ -554,6 +554,7 @@ if (!defined('CONTACT_EMAIL')) {
|
||||
define('NINJA_GATEWAY_CONFIG', 'NINJA_GATEWAY_CONFIG');
|
||||
define('NINJA_WEB_URL', 'https://www.invoiceninja.com');
|
||||
define('NINJA_APP_URL', 'https://app.invoiceninja.com');
|
||||
define('NINJA_DATE', '2000-01-01');
|
||||
define('NINJA_VERSION', '2.5.1.3');
|
||||
|
||||
define('SOCIAL_LINK_FACEBOOK', 'https://www.facebook.com/invoiceninja');
|
||||
|
@ -127,13 +127,24 @@ class EnterprisePlan extends Migration
|
||||
$company->plan_started = $primaryAccount->pro_plan_paid;
|
||||
$company->plan_paid = $primaryAccount->pro_plan_paid;
|
||||
|
||||
$expires = DateTime::createFromFormat('Y-m-d', $primaryAccount->pro_plan_paid);
|
||||
$expires->modify('+1 year');
|
||||
$expires = $expires->format('Y-m-d');
|
||||
|
||||
// check for self host white label licenses
|
||||
if (!Utils::isNinjaProd()) {
|
||||
$company->plan = 'white_label';
|
||||
$company->plan_term = null;
|
||||
} elseif ($company->plan_paid != '2000-01-01'/* NINJA_DATE*/) {
|
||||
$expires = DateTime::createFromFormat('Y-m-d', $primaryAccount->pro_plan_paid);
|
||||
$expires->modify('+1 year');
|
||||
$company->plan_expires = $expires->format('Y-m-d');
|
||||
if ($company->plan_paid) {
|
||||
$company->plan = 'white_label';
|
||||
// old ones were unlimited, new ones are yearly
|
||||
if ($company->plan_paid == NINJA_DATE) {
|
||||
$company->plan_term = null;
|
||||
} else {
|
||||
$company->plan_term = PLAN_TERM_YEARLY;
|
||||
$company->plan_expires = $expires;
|
||||
}
|
||||
}
|
||||
} elseif ($company->plan_paid != NINJA_DATE) {
|
||||
$company->plan_expires = $expires;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user