mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge branch 'master' of github.com:ArthurMaroulier/invoice-ninja
This commit is contained in:
commit
d7be01add1
@ -709,12 +709,21 @@ class AccountController extends \BaseController
|
||||
$path = Input::file('logo')->getRealPath();
|
||||
File::delete('logo/'.$account->account_key.'.jpg');
|
||||
|
||||
$image = Image::make($path)->resize(200, 120, true, false);
|
||||
$image = Image::make($path);
|
||||
$mimeType = $file->getMimeType();
|
||||
|
||||
if ($image->width == 200 && $mimeType == 'image/jpeg') {
|
||||
$file->move('logo/', $account->account_key . '.jpg');
|
||||
} else {
|
||||
$image->resize(200, 120, true, false);
|
||||
Image::canvas($image->width, $image->height, '#FFFFFF')->insert($image)->save($account->getLogoPath());
|
||||
}
|
||||
|
||||
Event::fire('user.refresh');
|
||||
//$image = Image::make($path)->resize(200, 120, true, false);
|
||||
//Image::canvas($image->width, $image->height, '#FFFFFF')->insert($image)->save($account->getLogoPath());
|
||||
}
|
||||
|
||||
Event::fire('user.refresh');
|
||||
Session::flash('message', trans('texts.updated_settings'));
|
||||
|
||||
return Redirect::to('company/details');
|
||||
|
@ -11,7 +11,6 @@ class ActivityController extends \BaseController
|
||||
->select('activities.id', 'activities.message', 'activities.created_at', 'clients.currency_id', 'activities.balance', 'activities.adjustment');
|
||||
|
||||
return Datatable::query($query)
|
||||
//->addColumn('blank', function($model) { return ''; })
|
||||
->addColumn('id', function ($model) { return Utils::timestampToDateTimeString(strtotime($model->created_at)); })
|
||||
->addColumn('message', function ($model) { return Utils::decodeActivity($model->message); })
|
||||
->addColumn('balance', function ($model) { return Utils::formatMoney($model->balance, $model->currency_id); })
|
||||
|
@ -494,4 +494,49 @@ class InvoiceController extends \BaseController
|
||||
|
||||
return self::edit($publicId, true);
|
||||
}
|
||||
|
||||
public function invoiceHistory($publicId)
|
||||
{
|
||||
$invoice = Invoice::withTrashed()->scope($publicId)->firstOrFail();
|
||||
$invoice->load('user', 'invoice_items', 'account.country', 'client.contacts', 'client.country');
|
||||
$invoice->invoice_date = Utils::fromSqlDate($invoice->invoice_date);
|
||||
$invoice->due_date = Utils::fromSqlDate($invoice->due_date);
|
||||
$invoice->is_pro = Auth::user()->isPro();
|
||||
$invoice->is_quote = intval($invoice->is_quote);
|
||||
|
||||
$activityTypeId = $invoice->is_quote ? ACTIVITY_TYPE_UPDATE_QUOTE : ACTIVITY_TYPE_UPDATE_INVOICE;
|
||||
$activities = Activity::scope(false, $invoice->account_id)->with(['user' => function($query) {
|
||||
$query->select(['id', 'first_name', 'last_name']);
|
||||
}])->where('activity_type_id', '=', $activityTypeId)->orderBy('id', 'desc')->get(['id', 'created_at', 'user_id', 'json_backup']);
|
||||
|
||||
$versionsJson = [];
|
||||
$versionsSelect = [];
|
||||
$lastId = false;
|
||||
|
||||
foreach ($activities as $activity) {
|
||||
$backup = json_decode($activity->json_backup);
|
||||
$backup->invoice_date = Utils::fromSqlDate($backup->invoice_date);
|
||||
$backup->due_date = Utils::fromSqlDate($backup->due_date);
|
||||
$backup->is_pro = Auth::user()->isPro();
|
||||
$backup->is_quote = isset($backup->is_quote) && intval($backup->is_quote);
|
||||
$backup->account = $invoice->account->toArray();
|
||||
|
||||
$versionsJson[$activity->id] = $backup;
|
||||
|
||||
$key = Utils::timestampToDateTimeString(strtotime($activity->created_at)) . ' - ' . $activity->user->getDisplayName();
|
||||
$versionsSelect[$lastId ? $lastId : 0] = $key;
|
||||
$lastId = $activity->id;
|
||||
}
|
||||
|
||||
$versionsSelect[$lastId] = Utils::timestampToDateTimeString(strtotime($invoice->created_at)) . ' - ' . $invoice->user->getDisplayName();
|
||||
|
||||
$data = [
|
||||
'invoice' => $invoice,
|
||||
'versionsJson' => json_encode($versionsJson),
|
||||
'versionsSelect' => $versionsSelect,
|
||||
'invoiceDesigns' => InvoiceDesign::remember(DEFAULT_QUERY_CACHE, 'invoice_designs_cache_'.Auth::user()->maxInvoiceDesignId())->where('id', '<=', Auth::user()->maxInvoiceDesignId())->orderBy('id')->get(),
|
||||
];
|
||||
|
||||
return View::make('invoices.history', $data);
|
||||
}
|
||||
}
|
||||
|
@ -493,5 +493,11 @@ return array(
|
||||
'discount_percent' => 'Percent',
|
||||
'discount_amount' => 'Amount',
|
||||
|
||||
'invoice_history' => 'Invoice History',
|
||||
'quote_history' => 'Quote History',
|
||||
'current_version' => 'Current version',
|
||||
'select_versiony' => 'Select version',
|
||||
'view_history' => 'View History',
|
||||
|
||||
|
||||
);
|
||||
|
@ -483,6 +483,11 @@ return array(
|
||||
'discount_percent' => 'Percent',
|
||||
'discount_amount' => 'Amount',
|
||||
|
||||
'invoice_history' => 'Invoice History',
|
||||
'quote_history' => 'Quote History',
|
||||
'current_version' => 'Current version',
|
||||
'select_versiony' => 'Select version',
|
||||
'view_history' => 'View History',
|
||||
|
||||
|
||||
);
|
||||
|
@ -491,4 +491,10 @@ return array(
|
||||
'discount_percent' => 'Percent',
|
||||
'discount_amount' => 'Amount',
|
||||
|
||||
'invoice_history' => 'Invoice History',
|
||||
'quote_history' => 'Quote History',
|
||||
'current_version' => 'Current version',
|
||||
'select_versiony' => 'Select version',
|
||||
'view_history' => 'View History',
|
||||
|
||||
);
|
||||
|
@ -463,5 +463,11 @@ return array(
|
||||
'discount_percent' => 'Percent',
|
||||
'discount_amount' => 'Amount',
|
||||
|
||||
'invoice_history' => 'Invoice History',
|
||||
'quote_history' => 'Quote History',
|
||||
'current_version' => 'Current version',
|
||||
'select_versiony' => 'Select version',
|
||||
'view_history' => 'View History',
|
||||
|
||||
|
||||
);
|
@ -484,5 +484,11 @@ return array(
|
||||
'discount_percent' => 'Pourcent',
|
||||
'discount_amount' => 'Montant',
|
||||
|
||||
'invoice_history' => 'Invoice History',
|
||||
'quote_history' => 'Quote History',
|
||||
'current_version' => 'Current version',
|
||||
'select_versiony' => 'Select version',
|
||||
'view_history' => 'View History',
|
||||
|
||||
|
||||
);
|
@ -486,6 +486,11 @@ return array(
|
||||
'discount_percent' => 'Percent',
|
||||
'discount_amount' => 'Amount',
|
||||
|
||||
'invoice_history' => 'Invoice History',
|
||||
'quote_history' => 'Quote History',
|
||||
'current_version' => 'Current version',
|
||||
'select_versiony' => 'Select version',
|
||||
'view_history' => 'View History',
|
||||
|
||||
|
||||
);
|
||||
|
@ -494,6 +494,11 @@ return array(
|
||||
'discount_percent' => 'Percent',
|
||||
'discount_amount' => 'Amount',
|
||||
|
||||
'invoice_history' => 'Invoice History',
|
||||
'quote_history' => 'Quote History',
|
||||
'current_version' => 'Current version',
|
||||
'select_versiony' => 'Select version',
|
||||
'view_history' => 'View History',
|
||||
|
||||
);
|
||||
|
||||
|
@ -492,6 +492,12 @@ return array(
|
||||
'discount_percent' => 'Percent',
|
||||
'discount_amount' => 'Amount',
|
||||
|
||||
'invoice_history' => 'Invoice History',
|
||||
'quote_history' => 'Quote History',
|
||||
'current_version' => 'Current version',
|
||||
'select_versiony' => 'Select version',
|
||||
'view_history' => 'View History',
|
||||
|
||||
|
||||
|
||||
);
|
@ -487,6 +487,12 @@ return array(
|
||||
'discount_percent' => 'Percent',
|
||||
'discount_amount' => 'Amount',
|
||||
|
||||
'invoice_history' => 'Invoice History',
|
||||
'quote_history' => 'Quote History',
|
||||
'current_version' => 'Current version',
|
||||
'select_versiony' => 'Select version',
|
||||
'view_history' => 'View History',
|
||||
|
||||
|
||||
|
||||
);
|
@ -474,6 +474,11 @@ return array(
|
||||
'discount_percent' => 'Percent',
|
||||
'discount_amount' => 'Amount',
|
||||
|
||||
'invoice_history' => 'Invoice History',
|
||||
'quote_history' => 'Quote History',
|
||||
'current_version' => 'Current version',
|
||||
'select_versiony' => 'Select version',
|
||||
'view_history' => 'View History',
|
||||
|
||||
|
||||
|
||||
|
@ -1,40 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
define("ACTIVITY_TYPE_CREATE_CLIENT", 1);
|
||||
define("ACTIVITY_TYPE_ARCHIVE_CLIENT", 2);
|
||||
define("ACTIVITY_TYPE_DELETE_CLIENT", 3);
|
||||
|
||||
define("ACTIVITY_TYPE_CREATE_INVOICE", 4);
|
||||
define("ACTIVITY_TYPE_UPDATE_INVOICE", 5);
|
||||
define("ACTIVITY_TYPE_EMAIL_INVOICE", 6);
|
||||
define("ACTIVITY_TYPE_VIEW_INVOICE", 7);
|
||||
define("ACTIVITY_TYPE_ARCHIVE_INVOICE", 8);
|
||||
define("ACTIVITY_TYPE_DELETE_INVOICE", 9);
|
||||
|
||||
define("ACTIVITY_TYPE_CREATE_PAYMENT", 10);
|
||||
define("ACTIVITY_TYPE_UPDATE_PAYMENT", 11);
|
||||
define("ACTIVITY_TYPE_ARCHIVE_PAYMENT", 12);
|
||||
define("ACTIVITY_TYPE_DELETE_PAYMENT", 13);
|
||||
|
||||
define("ACTIVITY_TYPE_CREATE_CREDIT", 14);
|
||||
define("ACTIVITY_TYPE_UPDATE_CREDIT", 15);
|
||||
define("ACTIVITY_TYPE_ARCHIVE_CREDIT", 16);
|
||||
define("ACTIVITY_TYPE_DELETE_CREDIT", 17);
|
||||
|
||||
define("ACTIVITY_TYPE_CREATE_QUOTE", 18);
|
||||
define("ACTIVITY_TYPE_UPDATE_QUOTE", 19);
|
||||
define("ACTIVITY_TYPE_EMAIL_QUOTE", 20);
|
||||
define("ACTIVITY_TYPE_VIEW_QUOTE", 21);
|
||||
define("ACTIVITY_TYPE_ARCHIVE_QUOTE", 22);
|
||||
define("ACTIVITY_TYPE_DELETE_QUOTE", 23);
|
||||
|
||||
define("ACTIVITY_TYPE_RESTORE_QUOTE", 24);
|
||||
define("ACTIVITY_TYPE_RESTORE_INVOICE", 25);
|
||||
define("ACTIVITY_TYPE_RESTORE_CLIENT", 26);
|
||||
define("ACTIVITY_TYPE_RESTORE_PAYMENT", 27);
|
||||
define("ACTIVITY_TYPE_RESTORE_CREDIT", 28);
|
||||
|
||||
class Activity extends Eloquent
|
||||
{
|
||||
public $timestamps = true;
|
||||
@ -50,6 +15,11 @@ class Activity extends Eloquent
|
||||
return $this->belongsTo('Account');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('User');
|
||||
}
|
||||
|
||||
private static function getBlank($entity = false)
|
||||
{
|
||||
$activity = new Activity();
|
||||
|
@ -144,6 +144,7 @@ class InvoiceRepository
|
||||
if (!$model->deleted_at || $model->deleted_at == '0000-00-00') {
|
||||
$str .= '<li><a href="'.\URL::to("{$entityType}s/".$model->public_id.'/edit').'">'.trans("texts.edit_{$entityType}").'</a></li>
|
||||
<li><a href="'.\URL::to("{$entityType}s/".$model->public_id.'/clone').'">'.trans("texts.clone_{$entityType}").'</a></li>
|
||||
<li><a href="' . \URL::to("{$entityType}s/{$entityType}_history/{$model->public_id}") . '">' . trans("texts.view_history") . '</a></li>
|
||||
<li class="divider"></li>';
|
||||
|
||||
if ($model->invoice_status_id < INVOICE_STATUS_SENT) {
|
||||
@ -244,7 +245,7 @@ class InvoiceRepository
|
||||
$invoice->po_number = trim($data['po_number']);
|
||||
$invoice->invoice_design_id = $data['invoice_design_id'];
|
||||
|
||||
if (isset($data['tax_name']) && isset($data['tax_rate']) && Utils::parseFloat($data['tax_rate']) > 0) {
|
||||
if (isset($data['tax_name']) && isset($data['tax_rate']) && $data['tax_name']) {
|
||||
$invoice->tax_rate = Utils::parseFloat($data['tax_rate']);
|
||||
$invoice->tax_name = trim($data['tax_name']);
|
||||
} else {
|
||||
@ -345,7 +346,7 @@ class InvoiceRepository
|
||||
$invoiceItem->qty = Utils::parseFloat($item->qty);
|
||||
$invoiceItem->tax_rate = 0;
|
||||
|
||||
if (isset($item->tax_rate) && Utils::parseFloat($item->tax_rate) > 0) {
|
||||
if (isset($item->tax_rate) && isset($item->tax_name) && $item->tax_name) {
|
||||
$invoiceItem->tax_rate = Utils::parseFloat($item->tax_rate);
|
||||
$invoiceItem->tax_name = trim($item->tax_name);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ class TaxRateRepository
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($record->name) || !Utils::parseFloat($record->rate) || !trim($record->name)) {
|
||||
if (!isset($record->name) || !trim($record->name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -113,6 +113,9 @@ Route::group(array('before' => 'auth'), function() {
|
||||
Route::get('recurring_invoices', 'InvoiceController@recurringIndex');
|
||||
Route::get('api/recurring_invoices/{client_id?}', array('as'=>'api.recurring_invoices', 'uses'=>'InvoiceController@getRecurringDatatable'));
|
||||
|
||||
Route::get('invoices/invoice_history/{invoice_id}', 'InvoiceController@invoiceHistory');
|
||||
Route::get('quotes/quote_history/{invoice_id}', 'InvoiceController@invoiceHistory');
|
||||
|
||||
Route::resource('invoices', 'InvoiceController');
|
||||
Route::get('api/invoices/{client_id?}', array('as'=>'api.invoices', 'uses'=>'InvoiceController@getDatatable'));
|
||||
Route::get('invoices/create/{client_id?}', 'InvoiceController@create');
|
||||
@ -192,6 +195,40 @@ define('ACCOUNT_CHART_BUILDER', 'chart_builder');
|
||||
define('ACCOUNT_USER_MANAGEMENT', 'user_management');
|
||||
define('ACCOUNT_DATA_VISUALIZATIONS', 'data_visualizations');
|
||||
|
||||
define("ACTIVITY_TYPE_CREATE_CLIENT", 1);
|
||||
define("ACTIVITY_TYPE_ARCHIVE_CLIENT", 2);
|
||||
define("ACTIVITY_TYPE_DELETE_CLIENT", 3);
|
||||
|
||||
define("ACTIVITY_TYPE_CREATE_INVOICE", 4);
|
||||
define("ACTIVITY_TYPE_UPDATE_INVOICE", 5);
|
||||
define("ACTIVITY_TYPE_EMAIL_INVOICE", 6);
|
||||
define("ACTIVITY_TYPE_VIEW_INVOICE", 7);
|
||||
define("ACTIVITY_TYPE_ARCHIVE_INVOICE", 8);
|
||||
define("ACTIVITY_TYPE_DELETE_INVOICE", 9);
|
||||
|
||||
define("ACTIVITY_TYPE_CREATE_PAYMENT", 10);
|
||||
define("ACTIVITY_TYPE_UPDATE_PAYMENT", 11);
|
||||
define("ACTIVITY_TYPE_ARCHIVE_PAYMENT", 12);
|
||||
define("ACTIVITY_TYPE_DELETE_PAYMENT", 13);
|
||||
|
||||
define("ACTIVITY_TYPE_CREATE_CREDIT", 14);
|
||||
define("ACTIVITY_TYPE_UPDATE_CREDIT", 15);
|
||||
define("ACTIVITY_TYPE_ARCHIVE_CREDIT", 16);
|
||||
define("ACTIVITY_TYPE_DELETE_CREDIT", 17);
|
||||
|
||||
define("ACTIVITY_TYPE_CREATE_QUOTE", 18);
|
||||
define("ACTIVITY_TYPE_UPDATE_QUOTE", 19);
|
||||
define("ACTIVITY_TYPE_EMAIL_QUOTE", 20);
|
||||
define("ACTIVITY_TYPE_VIEW_QUOTE", 21);
|
||||
define("ACTIVITY_TYPE_ARCHIVE_QUOTE", 22);
|
||||
define("ACTIVITY_TYPE_DELETE_QUOTE", 23);
|
||||
|
||||
define("ACTIVITY_TYPE_RESTORE_QUOTE", 24);
|
||||
define("ACTIVITY_TYPE_RESTORE_INVOICE", 25);
|
||||
define("ACTIVITY_TYPE_RESTORE_CLIENT", 26);
|
||||
define("ACTIVITY_TYPE_RESTORE_PAYMENT", 27);
|
||||
define("ACTIVITY_TYPE_RESTORE_CREDIT", 28);
|
||||
|
||||
define('DEFAULT_INVOICE_NUMBER', '0001');
|
||||
define('RECENTLY_VIEWED_LIMIT', 8);
|
||||
define('LOGGED_ERROR_LIMIT', 100);
|
||||
@ -260,7 +297,7 @@ define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET);
|
||||
define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}');
|
||||
define('NINJA_WEB_URL', 'https://www.invoiceninja.com');
|
||||
define('NINJA_APP_URL', 'https://app.invoiceninja.com');
|
||||
define('NINJA_VERSION', '1.6.0');
|
||||
define('NINJA_VERSION', '1.6.1');
|
||||
define('NINJA_DATE', '2000-01-01');
|
||||
define('NINJA_FROM_EMAIL', 'maildelivery@invoiceninja.com');
|
||||
define('RELEASES_URL', 'https://github.com/hillelcoren/invoice-ninja/releases/');
|
||||
|
@ -288,6 +288,7 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="javascript:onSaveClick()" id="saveButton">{{ trans("texts.save_{$entityType}") }}</a></li>
|
||||
<li><a href="javascript:onCloneClick()">{{ trans("texts.clone_{$entityType}") }}</a></li>
|
||||
<li><a href="{{ URL::to("{$entityType}s/{$entityType}_history/{$invoice->public_id}") }}">{{ trans("texts.view_history") }}</a></li>
|
||||
|
||||
@if ($invoice && $entityType == ENTITY_QUOTE)
|
||||
<li class="divider"></li>
|
||||
@ -920,8 +921,10 @@
|
||||
var taxRate = new TaxRateModel();
|
||||
taxRate.name(name);
|
||||
taxRate.rate(parseFloat(rate));
|
||||
if (parseFloat(rate) > 0) taxRate.is_deleted(true);
|
||||
if (name) {
|
||||
taxRate.is_deleted(true);
|
||||
self.tax_rates.push(taxRate);
|
||||
}
|
||||
return taxRate;
|
||||
}
|
||||
|
||||
@ -1345,7 +1348,7 @@
|
||||
|
||||
@if (Utils::isConfirmed())
|
||||
if (self.invitation_link()) {
|
||||
str += '<br/><a href="' + self.invitation_link() + '" target="_blank">{{ trans('texts.view_as_recipient') }}</a>';
|
||||
str += '<br/><a href="' + self.invitation_link() + '" target="_blank" style="padding-left:20px">{{ trans('texts.view_as_recipient') }}</a>';
|
||||
}
|
||||
@endif
|
||||
|
||||
|
61
app/views/invoices/history.blade.php
Normal file
61
app/views/invoices/history.blade.php
Normal file
@ -0,0 +1,61 @@
|
||||
@extends('header')
|
||||
|
||||
@section('head')
|
||||
@parent
|
||||
|
||||
<script src="{{ asset('js/pdf_viewer.js') }}" type="text/javascript"></script>
|
||||
<script src="{{ asset('js/compatibility.js') }}" type="text/javascript"></script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
var invoiceDesigns = {{ $invoiceDesigns }};
|
||||
var currentInvoice = {{ $invoice }};
|
||||
var versionsJson = {{ $versionsJson }};
|
||||
|
||||
function getPDFString() {
|
||||
|
||||
var version = $('#version').val();
|
||||
var invoice;
|
||||
|
||||
if (parseInt(version)) {
|
||||
invoice = versionsJson[version];
|
||||
} else {
|
||||
invoice = currentInvoice;
|
||||
}
|
||||
|
||||
invoice.image = window.accountLogo;
|
||||
|
||||
var invoiceDesignId = parseInt(invoice.invoice_design_id);
|
||||
var invoiceDesign = _.findWhere(invoiceDesigns, {id: invoiceDesignId});
|
||||
if (!invoiceDesign) {
|
||||
invoiceDesign = invoiceDesigns[0];
|
||||
}
|
||||
|
||||
var doc = generatePDF(invoice, invoiceDesign.javascript, true);
|
||||
if (!doc) {
|
||||
return;
|
||||
}
|
||||
return doc.output('datauristring');
|
||||
}
|
||||
|
||||
$(function() {
|
||||
refreshPDF();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Former::open()->addClass('form-inline')->onchange('refreshPDF()') }}
|
||||
{{ Former::select('version')->options($versionsSelect)->label(trans('select_version')) }}
|
||||
{{ Button::success_link(URL::to($invoice->getEntityType() . 's/' . $invoice->public_id . '/edit'), trans('texts.edit_' . $invoice->getEntityType()), array('class' => 'pull-right')) }}
|
||||
{{ Former::close() }}
|
||||
|
||||
<br/> <br/>
|
||||
|
||||
@include('invoices.pdf', ['account' => Auth::user()->account, 'pdfHeight' => 800])
|
||||
|
||||
@stop
|
@ -66,6 +66,8 @@
|
||||
invoice.image = "{{ HTML::image_data($account->getLogoPath()) }}";
|
||||
invoice.imageWidth = {{ $account->getLogoWidth() }};
|
||||
invoice.imageHeight = {{ $account->getLogoHeight() }};
|
||||
} else {
|
||||
window.accountLogo = "{{ HTML::image_data($account->getLogoPath()) }}";
|
||||
}
|
||||
@endif
|
||||
|
||||
|
@ -24,9 +24,9 @@
|
||||
<p> </p>
|
||||
|
||||
@if ($invoice->client->account->isGatewayConfigured() && !$invoice->isPaid() && !$invoice->is_recurring)
|
||||
<div class="pull-right" style="width:270px">
|
||||
{{ Button::normal(trans('texts.download_pdf'), array('onclick' => 'onDownloadClick()', 'class' => 'btn-lg')) }}
|
||||
{{ Button::success_link(URL::to('payment/' . $invitation->invitation_key), trans('texts.pay_now'), array('class' => 'btn-lg pull-right')) }}
|
||||
<div class="pull-right" style="text-align:right">
|
||||
{{ Button::normal(trans('texts.download_pdf'), array('onclick' => 'onDownloadClick()', 'class' => 'btn-lg')) }}
|
||||
{{ Button::success_link(URL::to('payment/' . $invitation->invitation_key), trans('texts.pay_now'), array('class' => 'btn-lg')) }}
|
||||
</div>
|
||||
@else
|
||||
<div class="pull-right">
|
||||
@ -55,7 +55,8 @@
|
||||
|
||||
function onDownloadClick() {
|
||||
var doc = generatePDF(invoice, invoice.invoice_design.javascript, true);
|
||||
doc.save('Invoice-' + invoice.invoice_number + '.pdf');
|
||||
var fileName = invoice.is_quote ? invoiceLabels.quote : invoiceLabels.invoice;
|
||||
doc.save(fileName + '-' + invoice.invoice_number + '.pdf');
|
||||
}
|
||||
|
||||
|
||||
|
@ -2880,6 +2880,7 @@ box-shadow: 0px 0px 15px 0px rgba(0, 5, 5, 0.2);
|
||||
.plans-table .pro {margin-top: 40px;}
|
||||
}
|
||||
|
||||
/* bootstrap 3.2.0 fix */
|
||||
/* https://github.com/twbs/bootstrap/issues/13984 */
|
||||
.radio input[type="radio"],
|
||||
.checkbox input[type="checkbox"] {
|
||||
@ -2887,15 +2888,12 @@ margin-left: 0;
|
||||
margin-right: 5px;
|
||||
height: inherit;
|
||||
width: inherit;
|
||||
/* bootstrap 3.2.0 fix */
|
||||
float: left;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
/*.recommended-gateway {*/
|
||||
/* #recommendedGateway_id2 { */
|
||||
label[for=recommendedGateway_id2].radio{
|
||||
min-height: 60px;
|
||||
}
|
||||
@ -2906,3 +2904,6 @@ table.table thead .sorting_asc:after { content: '' !important }
|
||||
table.table thead .sorting_desc:after { content: '' !important}
|
||||
table.table thead .sorting_asc_disabled:after { content: '' !important }
|
||||
table.table thead .sorting_desc_disabled:after { content: '' !important }
|
||||
|
||||
/* Prevent modal from shifting page a bit - https://github.com/twbs/bootstrap/issues/9886 */
|
||||
body.modal-open { overflow:inherit; padding-right:inherit !important; }
|
@ -32262,7 +32262,7 @@ function displaySubtotals(doc, layout, invoice, y, rightAlignTitleX)
|
||||
data.push({'custom_invoice_label2': formatMoney(invoice.custom_value2, invoice.client.currency_id) })
|
||||
}
|
||||
|
||||
data.push({'tax': invoice.tax_amount > 0 ? formatMoney(invoice.tax_amount, invoice.client.currency_id) : false});
|
||||
data.push({'tax': (invoice.tax && invoice.tax.name) || invoice.tax_name ? formatMoney(invoice.tax_amount, invoice.client.currency_id) : false});
|
||||
|
||||
if (NINJA.parseFloat(invoice.custom_value1) && invoice.custom_taxes1 != '1') {
|
||||
data.push({'custom_invoice_label1': formatMoney(invoice.custom_value1, invoice.client.currency_id) })
|
||||
@ -32343,7 +32343,7 @@ function displayGrid(doc, invoice, data, x, y, layout, options) {
|
||||
doc.text(marginLeft, y, value);
|
||||
|
||||
doc.setFontType('normal');
|
||||
if (invoice.is_quote) {
|
||||
if (parseInt(invoice.is_quote)) {
|
||||
if (key == 'invoice_number') {
|
||||
key = 'quote_number';
|
||||
} else if (key == 'invoice_date') {
|
||||
@ -32355,8 +32355,11 @@ function displayGrid(doc, invoice, data, x, y, layout, options) {
|
||||
|
||||
if (key.substring(0, 6) === 'custom') {
|
||||
key = invoice.account[key];
|
||||
} else if (key === 'tax' && invoice.tax_rate) {
|
||||
key = invoiceLabels[key] + ' ' + (invoice.tax_rate*1).toString() + '%';
|
||||
} else if (key === 'tax' && invoice.tax_name) {
|
||||
key = invoice.tax_name + ' ' + (invoice.tax_rate*1).toString() + '%';
|
||||
if (invoice.tax_name.toLowerCase().indexOf(invoiceLabels['tax'].toLowerCase()) == -1) {
|
||||
key = invoiceLabels['tax'] + ': ' + key;
|
||||
}
|
||||
} else if (key === 'discount' && NINJA.parseFloat(invoice.discount) && !parseInt(invoice.is_amount_discount)) {
|
||||
key = invoiceLabels[key] + ' ' + parseFloat(invoice.discount) + '%';
|
||||
} else {
|
||||
@ -32424,7 +32427,7 @@ function calculateAmounts(invoice) {
|
||||
total += lineTotal;
|
||||
}
|
||||
|
||||
if ((item.tax && item.tax.rate > 0) || (item.tax_rate && parseFloat(item.tax_rate) > 0)) {
|
||||
if ((item.tax && item.tax.name) || item.tax_name) {
|
||||
hasTaxes = true;
|
||||
}
|
||||
}
|
||||
|
@ -1386,6 +1386,12 @@ table.compare-table-paid th {
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide bootstrap sort header icons */
|
||||
table.table thead .sorting:after { content: '' !important }
|
||||
table.table thead .sorting_asc:after { content: '' !important }
|
||||
table.table thead .sorting_desc:after { content: '' !important}
|
||||
table.table thead .sorting_asc_disabled:after { content: '' !important }
|
||||
table.table thead .sorting_desc_disabled:after { content: '' !important }
|
||||
/*
|
||||
* Table styles
|
||||
*/
|
||||
|
@ -1369,3 +1369,10 @@ table.compare-table-paid th {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide bootstrap sort header icons */
|
||||
table.table thead .sorting:after { content: '' !important }
|
||||
table.table thead .sorting_asc:after { content: '' !important }
|
||||
table.table thead .sorting_desc:after { content: '' !important}
|
||||
table.table thead .sorting_asc_disabled:after { content: '' !important }
|
||||
table.table thead .sorting_desc_disabled:after { content: '' !important }
|
@ -772,6 +772,7 @@ box-shadow: 0px 0px 15px 0px rgba(0, 5, 5, 0.2);
|
||||
.plans-table .pro {margin-top: 40px;}
|
||||
}
|
||||
|
||||
/* bootstrap 3.2.0 fix */
|
||||
/* https://github.com/twbs/bootstrap/issues/13984 */
|
||||
.radio input[type="radio"],
|
||||
.checkbox input[type="checkbox"] {
|
||||
@ -779,15 +780,12 @@ margin-left: 0;
|
||||
margin-right: 5px;
|
||||
height: inherit;
|
||||
width: inherit;
|
||||
/* bootstrap 3.2.0 fix */
|
||||
float: left;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
/*.recommended-gateway {*/
|
||||
/* #recommendedGateway_id2 { */
|
||||
label[for=recommendedGateway_id2].radio{
|
||||
min-height: 60px;
|
||||
}
|
||||
@ -798,3 +796,6 @@ table.table thead .sorting_asc:after { content: '' !important }
|
||||
table.table thead .sorting_desc:after { content: '' !important}
|
||||
table.table thead .sorting_asc_disabled:after { content: '' !important }
|
||||
table.table thead .sorting_desc_disabled:after { content: '' !important }
|
||||
|
||||
/* Prevent modal from shifting page a bit - https://github.com/twbs/bootstrap/issues/9886 */
|
||||
body.modal-open { overflow:inherit; padding-right:inherit !important; }
|
@ -739,7 +739,7 @@ function displaySubtotals(doc, layout, invoice, y, rightAlignTitleX)
|
||||
data.push({'custom_invoice_label2': formatMoney(invoice.custom_value2, invoice.client.currency_id) })
|
||||
}
|
||||
|
||||
data.push({'tax': invoice.tax_amount > 0 ? formatMoney(invoice.tax_amount, invoice.client.currency_id) : false});
|
||||
data.push({'tax': (invoice.tax && invoice.tax.name) || invoice.tax_name ? formatMoney(invoice.tax_amount, invoice.client.currency_id) : false});
|
||||
|
||||
if (NINJA.parseFloat(invoice.custom_value1) && invoice.custom_taxes1 != '1') {
|
||||
data.push({'custom_invoice_label1': formatMoney(invoice.custom_value1, invoice.client.currency_id) })
|
||||
@ -820,7 +820,7 @@ function displayGrid(doc, invoice, data, x, y, layout, options) {
|
||||
doc.text(marginLeft, y, value);
|
||||
|
||||
doc.setFontType('normal');
|
||||
if (invoice.is_quote) {
|
||||
if (parseInt(invoice.is_quote)) {
|
||||
if (key == 'invoice_number') {
|
||||
key = 'quote_number';
|
||||
} else if (key == 'invoice_date') {
|
||||
@ -832,8 +832,11 @@ function displayGrid(doc, invoice, data, x, y, layout, options) {
|
||||
|
||||
if (key.substring(0, 6) === 'custom') {
|
||||
key = invoice.account[key];
|
||||
} else if (key === 'tax' && invoice.tax_rate) {
|
||||
key = invoiceLabels[key] + ' ' + (invoice.tax_rate*1).toString() + '%';
|
||||
} else if (key === 'tax' && invoice.tax_name) {
|
||||
key = invoice.tax_name + ' ' + (invoice.tax_rate*1).toString() + '%';
|
||||
if (invoice.tax_name.toLowerCase().indexOf(invoiceLabels['tax'].toLowerCase()) == -1) {
|
||||
key = invoiceLabels['tax'] + ': ' + key;
|
||||
}
|
||||
} else if (key === 'discount' && NINJA.parseFloat(invoice.discount) && !parseInt(invoice.is_amount_discount)) {
|
||||
key = invoiceLabels[key] + ' ' + parseFloat(invoice.discount) + '%';
|
||||
} else {
|
||||
@ -901,7 +904,7 @@ function calculateAmounts(invoice) {
|
||||
total += lineTotal;
|
||||
}
|
||||
|
||||
if ((item.tax && item.tax.rate > 0) || (item.tax_rate && parseFloat(item.tax_rate) > 0)) {
|
||||
if ((item.tax && item.tax.name) || item.tax_name) {
|
||||
hasTaxes = true;
|
||||
}
|
||||
}
|
||||
|
0
public/logo/.gitkeep
Normal file → Executable file
0
public/logo/.gitkeep
Normal file → Executable file
0
public/logo/zg4ylmzDkdkPOT8yoKQw9LTWaoZJx79h.jpg
Normal file → Executable file
0
public/logo/zg4ylmzDkdkPOT8yoKQw9LTWaoZJx79h.jpg
Normal file → Executable file
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Loading…
x
Reference in New Issue
Block a user