bug fixes

This commit is contained in:
Hillel Coren 2014-02-17 01:09:34 +02:00
parent ed0e1d3521
commit 494286ba78
13 changed files with 57 additions and 33 deletions

View File

@ -108,6 +108,7 @@ class ClientController extends \BaseController {
Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT);
$data = array(
'showBreadcrumbs' => false,
'client' => $client,
'credit' => $client->getTotalCredit(),
'title' => '- ' . $client->getDisplayName(),

View File

@ -5,7 +5,7 @@ class DashboardController extends \BaseController {
public function index()
{
// total_income, billed_clients, invoice_sent and active_clients
$select = DB::raw('SUM(clients.paid_to_date) total_income,
$select = DB::raw('SUM(DISTINCT clients.paid_to_date) total_income,
COUNT(DISTINCT CASE WHEN invoices.id IS NOT NULL THEN clients.id ELSE null END) billed_clients,
SUM(CASE WHEN invoices.invoice_status_id >= '.INVOICE_STATUS_SENT.' THEN 1 ELSE 0 END) invoices_sent,
COUNT(DISTINCT clients.id) active_clients');

View File

@ -141,6 +141,7 @@ class InvoiceController extends \BaseController {
$invoice->due_date = Utils::fromSqlDate($invoice->due_date);
$data = array(
'showBreadcrumbs' => false,
'invoice' => $invoice->hidePrivateFields(),
'invitation' => $invitation
);
@ -166,6 +167,7 @@ class InvoiceController extends \BaseController {
->select('contacts.public_id')->lists('public_id');
$data = array(
'showBreadcrumbs' => false,
'account' => $invoice->account,
'invoice' => $invoice,
'data' => false,

View File

@ -167,6 +167,7 @@ class PaymentController extends \BaseController
$client = $invoice->client;
$data = [
'showBreadcrumbs' => false,
'invitationKey' => $invitationKey,
'invoice' => $invoice,
'client' => $client,

View File

@ -159,6 +159,26 @@ HTML::macro('image_data', function($imagePath) {
});
HTML::macro('breadcrumbs', function() {
$str = '<ol class="breadcrumb">';
$crumbs = explode('/', $_SERVER['REQUEST_URI']);
for ($i=0; $i<count($crumbs); $i++) {
$crumb = trim($crumbs[$i]);
if (!$crumb) continue;
if ($crumb == 'account') return '';
$name = ucwords($crumb);
if ($i==count($crumbs)-1)
{
$str .= "<li class='active'>$name</li>";
}
else
{
$str .= '<li>'.link_to($crumb, $name).'</li>';
}
}
return $str . '</ol>';
});
define('CONTACT_EMAIL', 'contact@invoiceninja.com');
define('ENV_DEVELOPMENT', 'local');

View File

@ -16,12 +16,6 @@
<div class="row">
<div class="col-md-8">
@if ($credit)
{{ Former::legend('Edit Credit') }}
@else
{{ Former::legend('New Credit') }}
@endif
{{ Former::select('client')->addOption('', '')->addGroupClass('client-select') }}
{{ Former::text('amount') }}
{{ Former::text('credit_date')->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT)) }}

View File

@ -58,7 +58,7 @@
<ul class="panel-body list-group">
@foreach ($activities as $activity)
<li class="list-group-item">
<span style="color:#888;font-style:italic">{{ Utils::timestampToDateTimeString(strtotime($activity->created_at)) }}:</span>
<span style="color:#888;font-style:italic">{{ Utils::timestampToDateString(strtotime($activity->created_at)) }}:</span>
{{ Utils::decodeActivity($activity->message) }}
</li>
@endforeach

View File

@ -148,9 +148,14 @@
</nav>
<p>&nbsp;</p>
<br/>
<div class="container">
@if (!isset($showBreadcrumbs) || $showBreadcrumbs)
{{ HTML::breadcrumbs() }}
@endif
@if (Session::has('message'))
<div class="alert alert-info">{{ Session::get('message') }}</div>
@endif

View File

@ -9,6 +9,12 @@
@section('content')
@if ($invoice)
<ol class="breadcrumb">
<li>{{ link_to('invoices', 'Invoices') }}</li>
<li class='active'>{{ $invoice->invoice_number }}</li>
</ol>
@endif
{{ Former::open($url)->method($method)->addClass('main_form')->rules(array(
'client' => 'required',

View File

@ -17,12 +17,6 @@
<div class="row">
<div class="col-md-8">
@if ($payment)
{{ Former::legend('Edit Payment') }}
@else
{{ Former::legend('New Payment') }}
@endif
{{ Former::select('client')->addOption('', '')->addGroupClass('client-select') }}
{{ Former::select('invoice')->addOption('', '')->addGroupClass('invoice-select') }}
{{ Former::text('amount') }}

View File

@ -16,7 +16,6 @@
"webpatser/laravel-countries": "dev-master",
"anahkiasen/rocketeer": "dev-develop",
"codeception/codeception": "dev-master",
"davejamesmiller/laravel-breadcrumbs": "~2"
},
"autoload": {
"classmap": [

View File

@ -11,8 +11,10 @@ label.control-label {
font-weight: normal !important;
}
.breadcrumb {
background-color: inherit;
font-size: 22px;
}
div.panel {
padding-left: 0px !important;
@ -47,11 +49,8 @@ table td {
max-width: 250px;
}
/*
table.dataTable tr.odd { background-color: white; }
table.dataTable tr.even { background-color: #f9f9f9; }
*/
/* hide table sorting indicators */
table.table thead .sorting { background: url('') no-repeat center right; }
table.dataTable tr.odd td.sorting_1 { background-color: white; }
table.dataTable tr.odd td.sorting_2 { background-color: white; }
table.dataTable tr.odd td.sorting_3 { background-color: white; }
@ -61,10 +60,6 @@ table.dataTable tr.even td.sorting_3 { background-color: white; }
/* hide table sorting indicators */
table.table thead .sorting { background: url('') no-repeat center right; }
/* Hover nav */
.sidebar-nav {
padding: 9px 0;
@ -123,9 +118,9 @@ table.table thead .sorting { background: url('') no-repeat center right; }
}
/*******************
/***********************************************
Dashboard
*******************/
************************************************/
.in-bold {
font-size: 26px;
@ -173,6 +168,11 @@ table.table thead .sorting { background: url('') no-repeat center right; }
border-style: none !important;
}
/***********************************************
New/edit invoice page
************************************************/
/*
table.invoice-table tbody tr:hover {
background-color: #FFFFFF !important;
@ -225,7 +225,9 @@ body {
/***********************************************
Add mouse over drop down to header menu
************************************************/
.navbar-default {
background-color: #428bff;