1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Working on design

This commit is contained in:
Hillel Coren 2016-09-02 17:53:16 +03:00
parent 8696acf4d3
commit 188486641a
13 changed files with 256 additions and 148 deletions

View File

@ -565,58 +565,7 @@ class AccountController extends BaseController
$data['invoiceDesigns'] = InvoiceDesign::getDesigns();
$data['invoiceFonts'] = Cache::get('fonts');
$data['section'] = $section;
$pageSizes = [
'A0',
'A1',
'A2',
'A3',
'A4',
'A5',
'A6',
'A7',
'A8',
'A9',
'A10',
'B0',
'B1',
'B2',
'B3',
'B4',
'B5',
'B6',
'B7',
'B8',
'B9',
'B10',
'C0',
'C1',
'C2',
'C3',
'C4',
'C5',
'C6',
'C7',
'C8',
'C9',
'C10',
'RA0',
'RA1',
'RA2',
'RA3',
'RA4',
'SRA0',
'SRA1',
'SRA2',
'SRA3',
'SRA4',
'Executive',
'Folio',
'Legal',
'Letter',
'Tabloid',
];
$data['pageSizes'] = array_combine($pageSizes, $pageSizes);
$data['pageSizes'] = array_combine(InvoiceDesign::$pageSizes, InvoiceDesign::$pageSizes);
$design = false;
foreach ($data['invoiceDesigns'] as $item) {

View File

@ -619,6 +619,7 @@ if (!defined('CONTACT_EMAIL')) {
define('NINJA_GATEWAY_CONFIG', 'NINJA_GATEWAY_CONFIG');
define('NINJA_WEB_URL', env('NINJA_WEB_URL', 'https://www.invoiceninja.com'));
define('NINJA_APP_URL', env('NINJA_APP_URL', 'https://app.invoiceninja.com'));
define('NINJA_DOCS_URL', env('NINJA_DOCS_URL', 'http://docs.invoiceninja.com/en/latest'));
define('NINJA_DATE', '2000-01-01');
define('NINJA_VERSION', '2.6.10' . env('NINJA_VERSION_SUFFIX'));
@ -822,6 +823,10 @@ if (!defined('CONTACT_EMAIL')) {
define('SKYPE_BUTTON_SHOW_IMAGE', 'showImage');
define('SKYPE_BUTTON_DOWNLOAD_FILE', 'downloadFile');
define('INVOICE_FIELDS_CLIENT', 'client_fields');
define('INVOICE_FIELDS_INVOICE', 'invoice_fields');
define('INVOICE_FIELDS_ACCOUNT', 'account_fields');
$creditCards = [
1 => ['card' => 'images/credit_cards/Test-Visa-Icon.png', 'text' => 'Visa'],
2 => ['card' => 'images/credit_cards/Test-MasterCard-Icon.png', 'text' => 'Master Card'],

View File

@ -11,6 +11,7 @@ use App\Events\UserSettingsChanged;
use Illuminate\Support\Facades\Storage;
use Illuminate\Database\Eloquent\SoftDeletes;
use Laracasts\Presenter\PresentableTrait;
use App\Models\Traits\PresentsInvoice;
/**
* Class Account
@ -19,6 +20,7 @@ class Account extends Eloquent
{
use PresentableTrait;
use SoftDeletes;
use PresentsInvoice;
/**
* @var string
@ -1029,68 +1031,6 @@ class Account extends Eloquent
Session::put('start_of_week', $this->start_of_week);
}
/**
* @return array
*/
public function getInvoiceLabels()
{
$data = [];
$custom = (array) json_decode($this->invoice_labels);
$fields = [
'invoice',
'invoice_date',
'due_date',
'invoice_number',
'po_number',
'discount',
'taxes',
'tax',
'item',
'description',
'unit_cost',
'quantity',
'line_total',
'subtotal',
'paid_to_date',
'balance_due',
'partial_due',
'terms',
'your_invoice',
'quote',
'your_quote',
'quote_date',
'quote_number',
'total',
'invoice_issued_to',
'quote_issued_to',
//'date',
'rate',
'hours',
'balance',
'from',
'to',
'invoice_to',
'details',
'invoice_no',
'valid_until',
];
foreach ($fields as $field) {
if (isset($custom[$field]) && $custom[$field]) {
$data[$field] = $custom[$field];
} else {
$data[$field] = $this->isEnglish() ? uctrans("texts.$field") : trans("texts.$field");
}
}
foreach (['item', 'quantity', 'unit_cost'] as $field) {
$data["{$field}_orig"] = $data[$field];
}
return $data;
}
/**
* @return bool
*/

View File

@ -14,6 +14,58 @@ class InvoiceDesign extends Eloquent
*/
public $timestamps = false;
public static $pageSizes = [
'A0',
'A1',
'A2',
'A3',
'A4',
'A5',
'A6',
'A7',
'A8',
'A9',
'A10',
'B0',
'B1',
'B2',
'B3',
'B4',
'B5',
'B6',
'B7',
'B8',
'B9',
'B10',
'C0',
'C1',
'C2',
'C3',
'C4',
'C5',
'C6',
'C7',
'C8',
'C9',
'C10',
'RA0',
'RA1',
'RA2',
'RA3',
'RA4',
'SRA0',
'SRA1',
'SRA2',
'SRA3',
'SRA4',
'Executive',
'Folio',
'Legal',
'Letter',
'Tabloid',
];
/**
* @return mixed
*/

View File

@ -0,0 +1,106 @@
<?php namespace App\Models\Traits;
/**
* Class PresentsInvoice
*/
trait PresentsInvoice
{
public function getInvoiceFields()
{
$labels = $this->getInvoiceLabels();
$fields = [
INVOICE_FIELDS_INVOICE => [
'invoice_number',
'po_number',
'invoice_date',
'due_date',
'balance_due',
'partial_due',
],
INVOICE_FIELDS_CLIENT => [
],
INVOICE_FIELDS_ACCOUNT => [
]
];
foreach ($fields as $section => $sectionFields) {
foreach ($sectionFields as $index => $field) {
$fields[$section][$field] = $labels[$field];
unset($fields[$section][$index]);
}
}
if ($this->custom_invoice_text_label1) {
//$fields[INVOICE_FIELDS_INVOICE][] = ''
}
return $fields;
}
/**
* @return array
*/
public function getInvoiceLabels()
{
$data = [];
$custom = (array) json_decode($this->invoice_labels);
$fields = [
'invoice',
'invoice_date',
'due_date',
'invoice_number',
'po_number',
'discount',
'taxes',
'tax',
'item',
'description',
'unit_cost',
'quantity',
'line_total',
'subtotal',
'paid_to_date',
'balance_due',
'partial_due',
'terms',
'your_invoice',
'quote',
'your_quote',
'quote_date',
'quote_number',
'total',
'invoice_issued_to',
'quote_issued_to',
//'date',
'rate',
'hours',
'balance',
'from',
'to',
'invoice_to',
'details',
'invoice_no',
'valid_until',
];
foreach ($fields as $field) {
if (isset($custom[$field]) && $custom[$field]) {
$data[$field] = $custom[$field];
} else {
$data[$field] = $this->isEnglish() ? uctrans("texts.$field") : trans("texts.$field");
}
}
foreach (['item', 'quantity', 'unit_cost'] as $field) {
$data["{$field}_orig"] = $data[$field];
}
return $data;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -176,6 +176,12 @@
width: 250px;
}
#left-sidebar-wrapper a.btn {
margin-top:10px;
margin-right:10px;
text-indent:0px
}
#right-sidebar-wrapper {
width: 250px;
}

View File

@ -7,7 +7,7 @@ html {
/* overflow-y: scroll; */
}
.bold { font-weight: 700; }
a {color:#0b4d78;}
a {color:#34495E;}
/*a:hover { text-decoration: none; color: #0a3857;}*/
.breadcrumb {
padding: 8px 0!important;
@ -143,7 +143,7 @@ line-height: 20px;
.datepicker table {font-size: 12px; border-spacing:2px;}
.datepicker td, .datepicker th { width:30px; }
.datepicker table tr td.active.active, .datepicker table tr td.active:hover.active {
background-color: #0b4d78;
background-color: #2980b9;
background-image:none;
}
.datepicker table tr td.today { color: #333; background-color: #edd71e !important; background-image:none; text-shadow:none;}
@ -158,7 +158,7 @@ padding: 20px;
}
.modal-header {
border-bottom: none;
background-color: #0b4d78;
background-color: #2980b9;
padding: 20px;
color: #fff;
}
@ -205,11 +205,11 @@ padding: 5px 10px;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-primary {
background-color: #0b4d78;
border-color: #0b4d78;
.xbtn-primary {
background-color: #34495E;
border-color: #34495E;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary {
.xbtn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary {
background-color: #0a456c;
border-color: #0a456c;
}
@ -250,8 +250,9 @@ border-radius: 3px;
margin-left: 0px;
}
.btn i.glyphicon { font-size: 16px; margin-left:7px; top: 2px; }
.btn-primary i{
border-color: #0b4d78;
xborder-color: #2980b9;
}
.form-actions .btn,
@ -329,8 +330,8 @@ table td {
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: #34495E;
border-color: #34495E;
}
.pagination>li:first-child>a, .pagination>li:first-child>span {
border-bottom-left-radius: 3px;
@ -388,20 +389,19 @@ background-color: #9b9b9b;
}
.nav-tabs.nav-justified>.active>a, .nav-tabs.nav-justified>.active>a:hover, .nav-tabs.nav-justified>.active>a:focus {
border: none;
background-color: #808080;
background-color: #34495E;
font-weight: bold;
color: #fff;
}
.navbar {
background-color: #0b4d78 !important;
xbackground-color: #343232 !important;
xbackground-color: #2980b9 !important;
background-image: none;
background-repeat: no-repeat;
filter: none;
}
.navbar-collapse {
background-color: #0b4d78;
xbackground-color: #2980b9;
}
.navbar,
@ -448,7 +448,7 @@ canvas {
left: -6px;
}
.navbar .dropdown-menu {
border-top: 1px solid #0b4d78;
border-top: 1px solid #34495E;
}
.navbar-brand {
padding-top:20px;
@ -498,7 +498,7 @@ background-clip: padding-box;
.active-clients {
background-color: #0b4d78;
background-color: #34495E;
background-image:url('../images/activeclients.png');
background-position:center;
background-repeat: no-repeat;
@ -910,7 +910,7 @@ div.checkbox > label {
.panel-heading {
/*background-color: #e37329 !important;*/
background-color: #0b4d78 !important;
background-color: #34495E !important;
}
div.alert {

View File

@ -143,6 +143,7 @@
<ul class="nav nav-tabs" role="tablist" style="border: none">
<li role="presentation" class="active"><a href="#generalSettings" aria-controls="generalSettings" role="tab" data-toggle="tab">{{ trans('texts.general_settings') }}</a></li>
<li role="presentation"><a href="#invoiceLabels" aria-controls="invoiceLabels" role="tab" data-toggle="tab">{{ trans('texts.invoice_labels') }}</a></li>
<li role="presentation"><a href="#invoiceFields" aria-controls="invoiceFields" role="tab" data-toggle="tab">{{ trans('texts.invoice_fields') }}</a></li>
<li role="presentation"><a href="#invoiceOptions" aria-controls="invoiceOptions" role="tab" data-toggle="tab">{{ trans('texts.invoice_options') }}</a></li>
<li role="presentation"><a href="#headerFooter" aria-controls="headerFooter" role="tab" data-toggle="tab">{{ trans('texts.header_footer') }}</a></li>
</ul>
@ -223,6 +224,13 @@
</div>
</div>
<div role="tabpanel" class="tab-pane" id="invoiceFields">
<div class="panel-body">
<div class="row">
@include('accounts.partials.invoice_fields', ['section' => INVOICE_FIELDS_INVOICE])
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="invoiceOptions">
<div class="panel-body">

View File

@ -0,0 +1,7 @@
<div class="col-md-4">
{!! Former::select()
->placeholder(trans("texts.{$section}"))
->options($account->getInvoiceFields()[$section]) !!}
</div>

View File

@ -78,7 +78,7 @@
<div class="row">
<div class="col-md-6">
<div class="panel panel-default dashboard" style="height:320px">
<div class="panel-heading" style="background-color:#0b4d78 !important">
<div class="panel-heading">
<h3 class="panel-title in-bold-white">
<i class="glyphicon glyphicon-exclamation-sign"></i> {{ trans('texts.activity') }}
@if ($invoicesSent)

View File

@ -8,25 +8,36 @@
<style type="text/css">
body {
background: #f8f8f8;
background-color: #fcfcfc;
}
.navbar {
background-color: #2980b9 !important;
}
.navbar-collapse {
background-color: #2980b9 !important;
}
table.dataTable thead > tr > th,
table.invoice-table thead > tr > th {
background-color: #e37329 !important;
background-color: #777 !important;
xbackground-color: #8f8f8f !important;
xbackground-color: #34495E !important;
color:#fff;
}
thead th {
border-left: 1px solid #d26b26;
border-left: 1px solid #999;
}
.sidebar-nav {
background-color: #222;
background-color: #313131;
}
.sidebar-nav li {
border-bottom:solid 1px;
border-bottom:solid 1px #4c4c4c;
}
.sidebar-nav i.fa {
@ -65,6 +76,26 @@ thead th {
text-decoration: none;
}
.icon-footer {
text-align: center;
position:fixed;
bottom:12px;
left:16px;
color:white;
font-size:16px
}
.icon-footer i {
width: 40px;
color: #999999;
}
.icon-footer i:hover {
color: #fff;
}
/*
body {
background: white;
@ -594,7 +625,6 @@ thead th {
{!! Form::nav_link($key, $value ?: $key) !!}
@endforeach
</ul>
</div><!-- /.navbar-collapse -->
</nav>
@ -618,9 +648,14 @@ thead th {
'settings'
] as $option)
<li class="{{ Request::is("{$option}*") ? 'active' : '' }}">
@if ($option != 'dashboard' && $option != 'settings')
@if ($option == 'settings')
<a type="button" class="btn btn-default btn-sm pull-right"
href="{{ url(NINJA_DOCS_URL) }}" target="_blank">
<i class="fa fa-question-circle" style="width:20px" title="{{ trans('texts.help') }}"></i>
</a>
@elseif ($option != 'dashboard')
@if (Auth::user()->can('create', substr($option, 0, -1)))
<a type="button" class="btn btn-primary btn-sm pull-right" style="margin-top:10px;margin-right:10px;text-indent:0px"
<a type="button" class="btn btn-primary btn-sm pull-right"
href="{{ url("/{$option}/create") }}">
<i class="fa fa-plus-circle" style="width:20px" title="{{ trans('texts.create_new') }}"></i>
</a>
@ -638,7 +673,7 @@ thead th {
</div>
<!-- /#left-sidebar-wrapper -->
<div id="right-sidebar-wrapper" class="hide-phone">
<div id="right-sidebar-wrapper" class="hide-phone" style="overflow-y:hidden">
<ul class="sidebar-nav">
{!! \App\Libraries\HistoryUtils::renderHtml(Auth::user()->account_id) !!}
</ul>