mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 06:14:31 -04:00
Client page color matches invoice design primary color
This commit is contained in:
parent
fe2155e139
commit
bf24e8c40f
@ -5,8 +5,8 @@ use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use ninja\mailers\ContactMailer as Mailer;
|
||||
|
||||
class SendRecurringInvoices extends Command {
|
||||
|
||||
class SendRecurringInvoices extends Command
|
||||
{
|
||||
protected $name = 'ninja:send-invoices';
|
||||
protected $description = 'Send recurring invoices';
|
||||
protected $mailer;
|
||||
@ -20,36 +20,32 @@ class SendRecurringInvoices extends Command {
|
||||
|
||||
public function fire()
|
||||
{
|
||||
$this->info(date('Y-m-d') . ' Running SendRecurringInvoices...');
|
||||
$this->info(date('Y-m-d').' Running SendRecurringInvoices...');
|
||||
$today = new DateTime();
|
||||
|
||||
$invoices = Invoice::with('account.timezone', 'invoice_items', 'client', 'user')
|
||||
->whereRaw('is_deleted IS FALSE AND deleted_at IS NULL AND is_recurring IS TRUE AND start_date <= ? AND (end_date IS NULL OR end_date >= ?)', array($today, $today))->get();
|
||||
$this->info(count($invoices) . ' recurring invoice(s) found');
|
||||
$this->info(count($invoices).' recurring invoice(s) found');
|
||||
|
||||
foreach ($invoices as $recurInvoice)
|
||||
{
|
||||
if ($recurInvoice->client->deleted_at)
|
||||
{
|
||||
foreach ($invoices as $recurInvoice) {
|
||||
if ($recurInvoice->client->deleted_at) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$recurInvoice->user->confirmed)
|
||||
{
|
||||
if (!$recurInvoice->user->confirmed) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->info('Processing Invoice ' . $recurInvoice->id . ' - Should send ' . ($recurInvoice->shouldSendToday() ? 'YES' : 'NO'));
|
||||
$this->info('Processing Invoice '.$recurInvoice->id.' - Should send '.($recurInvoice->shouldSendToday() ? 'YES' : 'NO'));
|
||||
|
||||
if (!$recurInvoice->shouldSendToday())
|
||||
{
|
||||
if (!$recurInvoice->shouldSendToday()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$invoice = Invoice::createNew($recurInvoice);
|
||||
$invoice->client_id = $recurInvoice->client_id;
|
||||
$invoice->recurring_invoice_id = $recurInvoice->id;
|
||||
$invoice->invoice_number = 'R' . $recurInvoice->account->getNextInvoiceNumber();
|
||||
$invoice->invoice_number = 'R'.$recurInvoice->account->getNextInvoiceNumber();
|
||||
$invoice->amount = $recurInvoice->amount;
|
||||
$invoice->balance = $recurInvoice->amount;
|
||||
$invoice->invoice_date = date_create()->format('Y-m-d');
|
||||
@ -66,15 +62,13 @@ class SendRecurringInvoices extends Command {
|
||||
$invoice->custom_taxes2 = $recurInvoice->custom_taxes2;
|
||||
$invoice->is_amount_discount = $recurInvoice->is_amount_discount;
|
||||
|
||||
if ($invoice->client->payment_terms)
|
||||
{
|
||||
$invoice->due_date = date_create()->modify($invoice->client->payment_terms . ' day')->format('Y-m-d');
|
||||
if ($invoice->client->payment_terms) {
|
||||
$invoice->due_date = date_create()->modify($invoice->client->payment_terms.' day')->format('Y-m-d');
|
||||
}
|
||||
|
||||
$invoice->save();
|
||||
|
||||
foreach ($recurInvoice->invoice_items as $recurItem)
|
||||
{
|
||||
foreach ($recurInvoice->invoice_items as $recurItem) {
|
||||
$item = InvoiceItem::createNew($recurItem);
|
||||
$item->product_id = $recurItem->product_id;
|
||||
$item->qty = $recurItem->qty;
|
||||
@ -86,8 +80,7 @@ class SendRecurringInvoices extends Command {
|
||||
$invoice->invoice_items()->save($item);
|
||||
}
|
||||
|
||||
foreach ($recurInvoice->invitations as $recurInvitation)
|
||||
{
|
||||
foreach ($recurInvoice->invitations as $recurInvitation) {
|
||||
$invitation = Invitation::createNew($recurInvitation);
|
||||
$invitation->contact_id = $recurInvitation->contact_id;
|
||||
$invitation->invitation_key = str_random(RANDOM_KEY_LENGTH);
|
||||
@ -116,5 +109,4 @@ class SendRecurringInvoices extends Command {
|
||||
//array('example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@ -46,7 +46,16 @@ class InvoiceController extends \BaseController
|
||||
|
||||
public function clientIndex()
|
||||
{
|
||||
$invitationKey = Session::get('invitation_key');
|
||||
if (!$invitationKey) {
|
||||
return Redirect::to('/setup');
|
||||
}
|
||||
|
||||
$invitation = Invitation::with('account')->where('invitation_key', '=', $invitationKey)->first();
|
||||
$color = $invitation->account->primary_color ? $invitation->account->primary_color : '#0b4d78';
|
||||
|
||||
$data = [
|
||||
'color' => $color,
|
||||
'hideLogo' => Session::get('white_label'),
|
||||
'title' => trans('texts.invoices'),
|
||||
'entityType' => ENTITY_INVOICE,
|
||||
|
@ -30,12 +30,23 @@ class PaymentController extends \BaseController
|
||||
|
||||
public function clientIndex()
|
||||
{
|
||||
return View::make('public_list', array(
|
||||
$invitationKey = Session::get('invitation_key');
|
||||
if (!$invitationKey) {
|
||||
return Redirect::to('/setup');
|
||||
}
|
||||
|
||||
$invitation = Invitation::with('account')->where('invitation_key', '=', $invitationKey)->first();
|
||||
$color = $invitation->account->primary_color ? $invitation->account->primary_color : '#0b4d78';
|
||||
|
||||
$data = [
|
||||
'color' => $color,
|
||||
'hideLogo' => Session::get('white_label'),
|
||||
'entityType' => ENTITY_PAYMENT,
|
||||
'title' => trans('texts.payments'),
|
||||
'columns' => Utils::trans(['invoice', 'transaction_reference', 'method', 'payment_amount', 'payment_date']),
|
||||
));
|
||||
'columns' => Utils::trans(['invoice', 'transaction_reference', 'method', 'payment_amount', 'payment_date'])
|
||||
];
|
||||
|
||||
return View::make('public_list', $data);
|
||||
}
|
||||
|
||||
public function getDatatable($clientPublicId = null)
|
||||
|
@ -47,7 +47,16 @@ class QuoteController extends \BaseController
|
||||
|
||||
public function clientIndex()
|
||||
{
|
||||
$invitationKey = Session::get('invitation_key');
|
||||
if (!$invitationKey) {
|
||||
return Redirect::to('/setup');
|
||||
}
|
||||
|
||||
$invitation = Invitation::with('account')->where('invitation_key', '=', $invitationKey)->first();
|
||||
$color = $invitation->account->primary_color ? $invitation->account->primary_color : '#0b4d78';
|
||||
|
||||
$data = [
|
||||
'color' => $color,
|
||||
'hideLogo' => Session::get('white_label'),
|
||||
'title' => trans('texts.quotes'),
|
||||
'entityType' => ENTITY_QUOTE,
|
||||
|
@ -12,7 +12,6 @@ class UserEventHandler
|
||||
|
||||
public function onSignup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function onLogin()
|
||||
|
@ -17,6 +17,11 @@ class Invitation extends EntityModel
|
||||
return $this->belongsTo('User')->withTrashed();
|
||||
}
|
||||
|
||||
public function account()
|
||||
{
|
||||
return $this->belongsTo('Account');
|
||||
}
|
||||
|
||||
public function getLink()
|
||||
{
|
||||
return SITE_URL.'/view/'.$this->invitation_key;
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
<label for="trashed" style="font-weight:normal; margin-left: 10px;">
|
||||
<input id="trashed" type="checkbox" onclick="setTrashVisible()"
|
||||
{{ Session::get("show_trash:{$entityType}") ? 'checked' : ''}}/> {{ trans('texts.show_archived_deleted')}} {{ strtolower(trans('texts.'.$entityType.'s')) }}
|
||||
{{ Session::get("show_trash:{$entityType}") ? 'checked' : ''}}/> {{ trans('texts.show_archived_deleted')}} {{ strtolower(trans('texts.'.$entityType.'s')) }}
|
||||
</label>
|
||||
|
||||
<div id="top_right_buttons" class="pull-right">
|
||||
|
@ -15,6 +15,7 @@ body {
|
||||
|
||||
|
||||
.container input[type=text],
|
||||
.container input[type=email],
|
||||
.container select {
|
||||
font-weight: 300;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
@ -145,13 +146,17 @@ header h3 em {
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-7">
|
||||
<header>
|
||||
@if ($client)
|
||||
<h2>{{ $client->getDisplayName() }}</h2>
|
||||
<h3>{{ trans('texts.invoice') . ' ' . $invoiceNumber }}<span>| {{ trans('texts.amount_due') }}: <em>{{ Utils::formatMoney($amount, $currencyId) }}</em></span></h3>
|
||||
@elseif ($paymentTitle)
|
||||
<h2>{{ $paymentTitle }}<br/><small>{{ $paymentSubtitle }}</small></h2>
|
||||
@endif
|
||||
</header>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-5">
|
||||
@if (Request::secure() || Utils::isNinjaDev())
|
||||
<div class="secure">
|
||||
<h3>{{ trans('texts.secure_payment') }}</h3>
|
||||
@ -254,7 +259,7 @@ header h3 em {
|
||||
|
||||
<div class="row" style="padding-top:18px">
|
||||
<div class="col-md-5">
|
||||
@if ($account->showTokenCheckbox())
|
||||
@if ($client && $account->showTokenCheckbox())
|
||||
<input id="token_billing" type="checkbox" name="token_billing" {{ $account->selectTokenCheckbox() ? 'CHECKED' : '' }} value="1" style="margin-left:0px; vertical-align:top">
|
||||
<label for="token_billing" class="checkbox" style="display: inline;">{{ trans('texts.token_billing') }}</label>
|
||||
<span class="help-block" style="font-size:15px">{{ trans('texts.token_billing_secure', ['stripe_link' => link_to('https://stripe.com/', 'Stripe.com', ['target' => '_blank'])]) }}</span>
|
||||
|
@ -2,32 +2,100 @@
|
||||
|
||||
@section('content')
|
||||
|
||||
<section class="hero background hero-secure center" data-speed="2" data-type="background">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<h1>License Key</h1>
|
||||
<!--<p class="thin"><img src="{{ asset('images/icon-secure-pay.png') }}">256-BiT Encryption</p>-->
|
||||
<!-- <img src="{{ asset('images/providers.png') }}"> -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<style type="text/css">
|
||||
|
||||
body {
|
||||
background-color: #f8f8f8;
|
||||
color: #1b1a1a;
|
||||
}
|
||||
|
||||
.panel-body {
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 700px) {
|
||||
header {
|
||||
margin: 20px 0 75px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.panel-body {
|
||||
padding-left: 150px;
|
||||
padding-right: 150px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
header {
|
||||
margin: 0px !important
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-weight: 300;
|
||||
font-size: 30px;
|
||||
color: #2e2b2b;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-weight: 900;
|
||||
margin-top: 10px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
h3 .help {
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
header h3 {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
header h3 span {
|
||||
display: inline-block;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
header h3 em {
|
||||
font-style: normal;
|
||||
color: #eb8039;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<p> </p>
|
||||
|
||||
<section class="faq">
|
||||
<div class="container">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<header>
|
||||
<h2>License Key<br/><small>{{ $message }}</small></h2>
|
||||
</header>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h3 style="text-align:center">{{ $message }}</h3>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<h2 style="text-align:center">{{ $license }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p> </p>
|
||||
<div style="height:300px"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
@ -11,8 +11,7 @@
|
||||
table.dataTable { border-radius: 3px; border-collapse: collapse;
|
||||
/*border-spacing: 0;*/}
|
||||
table.dataTable thead > tr > th, table.invoice-table thead > tr > th {
|
||||
background-color: #0b4d78 !important;
|
||||
/*background-color: #e37329 !important;*/
|
||||
background-color: {{ $color }} !important;
|
||||
color:#fff;
|
||||
}
|
||||
th:first-child {
|
||||
@ -68,8 +67,8 @@
|
||||
max-width: 250px;
|
||||
}
|
||||
.pagination>.active>a, .pagination>.active>span, .pagination>.active>a:hover, .pagination>.active>span:hover, .pagination>.active>a:focus, .pagination>.active>span:focus {
|
||||
background-color: #0b4d78;
|
||||
border-color: #0b4d78;
|
||||
background-color: {{ $color }};
|
||||
border-color: {{ $color }};
|
||||
}
|
||||
.pagination>li:first-child>a, .pagination>li:first-child>span {
|
||||
border-bottom-left-radius: 3px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user