mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-15 18:24:36 -04:00
Fix for #661
This commit is contained in:
parent
680b8edefd
commit
89622f86e2
@ -280,9 +280,7 @@ class AppController extends BaseController
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Utils::getResllerType() == RESELLER_LIMITED_USERS) {
|
if (Utils::getResllerType() == RESELLER_REVENUE_SHARE) {
|
||||||
return User::count();
|
|
||||||
} else {
|
|
||||||
$payments = DB::table('accounts')
|
$payments = DB::table('accounts')
|
||||||
->leftJoin('payments', 'payments.account_id', '=', 'accounts.id')
|
->leftJoin('payments', 'payments.account_id', '=', 'accounts.id')
|
||||||
->leftJoin('clients', 'clients.id', '=', 'payments.client_id')
|
->leftJoin('clients', 'clients.id', '=', 'payments.client_id')
|
||||||
@ -294,7 +292,16 @@ class AppController extends BaseController
|
|||||||
'payments.payment_date',
|
'payments.payment_date',
|
||||||
'payments.amount'
|
'payments.amount'
|
||||||
]);
|
]);
|
||||||
return json_encode($payments);
|
} else {
|
||||||
|
$payments = DB::table('accounts')
|
||||||
|
->leftJoin('payments', 'payments.account_id', '=', 'accounts.id')
|
||||||
|
->leftJoin('clients', 'clients.id', '=', 'payments.client_id')
|
||||||
|
->where('accounts.account_key', '=', NINJA_ACCOUNT_KEY)
|
||||||
|
->where('payments.is_deleted', '=', false)
|
||||||
|
->groupBy('clients.id')
|
||||||
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return json_encode($payments);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -60,7 +60,7 @@ class ExpenseController extends BaseController
|
|||||||
|
|
||||||
public function getDatatable($expensePublicId = null)
|
public function getDatatable($expensePublicId = null)
|
||||||
{
|
{
|
||||||
return $this->expenseService->getDatatable($expensePublicId, Input::get('sSearch'));
|
return $this->expenseService->getDatatable(Input::get('sSearch'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDatatableVendor($vendorPublicId = null)
|
public function getDatatableVendor($vendorPublicId = null)
|
||||||
|
@ -24,10 +24,6 @@ class AccountRepository
|
|||||||
{
|
{
|
||||||
public function create($firstName = '', $lastName = '', $email = '', $password = '')
|
public function create($firstName = '', $lastName = '', $email = '', $password = '')
|
||||||
{
|
{
|
||||||
if (Utils::getResllerType() == RESELLER_LIMITED_USERS && User::count() >= 1000) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$account = new Account();
|
$account = new Account();
|
||||||
$account->ip = Request::getClientIp();
|
$account->ip = Request::getClientIp();
|
||||||
$account->account_key = str_random(RANDOM_KEY_LENGTH);
|
$account->account_key = str_random(RANDOM_KEY_LENGTH);
|
||||||
|
@ -61,7 +61,7 @@ class ExpenseRepository extends BaseRepository
|
|||||||
->where('clients.deleted_at', '=', null)
|
->where('clients.deleted_at', '=', null)
|
||||||
->where(function ($query) {
|
->where(function ($query) {
|
||||||
$query->where('contacts.is_primary', '=', true)
|
$query->where('contacts.is_primary', '=', true)
|
||||||
->orWhere('contacts.is_primary', '=', null);
|
->orWhere('contacts.is_primary', '=', null);
|
||||||
})
|
})
|
||||||
->select(
|
->select(
|
||||||
'expenses.account_id',
|
'expenses.account_id',
|
||||||
@ -99,7 +99,9 @@ class ExpenseRepository extends BaseRepository
|
|||||||
|
|
||||||
if ($filter) {
|
if ($filter) {
|
||||||
$query->where(function ($query) use ($filter) {
|
$query->where(function ($query) use ($filter) {
|
||||||
$query->where('expenses.public_notes', 'like', '%'.$filter.'%');
|
$query->where('expenses.public_notes', 'like', '%'.$filter.'%')
|
||||||
|
->orWhere('clients.name', 'like', '%'.$filter.'%')
|
||||||
|
->orWhere('vendors.name', 'like', '%'.$filter.'%');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ class ExpenseService extends BaseService
|
|||||||
[
|
[
|
||||||
'expense_date',
|
'expense_date',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return $model->expense_date;
|
return Utils::dateToString($model->expense_date);
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
5
public/css/built.css
vendored
5
public/css/built.css
vendored
@ -3385,9 +3385,4 @@ ul.user-accounts a:hover div.remove {
|
|||||||
|
|
||||||
div.panel-body div.panel-body {
|
div.panel-body div.panel-body {
|
||||||
padding-bottom: 0px;
|
padding-bottom: 0px;
|
||||||
}
|
|
||||||
|
|
||||||
.vcenter {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
}
|
@ -31238,9 +31238,6 @@ NINJA.invoiceLines = function(invoice) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var lineTotal = roundToTwo(NINJA.parseFloat(item.cost)) * roundToTwo(NINJA.parseFloat(item.qty));
|
var lineTotal = roundToTwo(NINJA.parseFloat(item.cost)) * roundToTwo(NINJA.parseFloat(item.qty));
|
||||||
if (showItemTaxes && tax) {
|
|
||||||
lineTotal += lineTotal * tax / 100;
|
|
||||||
}
|
|
||||||
lineTotal = formatMoneyInvoice(lineTotal, invoice);
|
lineTotal = formatMoneyInvoice(lineTotal, invoice);
|
||||||
|
|
||||||
rowStyle = (i % 2 == 0) ? 'odd' : 'even';
|
rowStyle = (i % 2 == 0) ? 'odd' : 'even';
|
||||||
|
@ -334,9 +334,6 @@ NINJA.invoiceLines = function(invoice) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var lineTotal = roundToTwo(NINJA.parseFloat(item.cost)) * roundToTwo(NINJA.parseFloat(item.qty));
|
var lineTotal = roundToTwo(NINJA.parseFloat(item.cost)) * roundToTwo(NINJA.parseFloat(item.qty));
|
||||||
if (showItemTaxes && tax) {
|
|
||||||
lineTotal += lineTotal * tax / 100;
|
|
||||||
}
|
|
||||||
lineTotal = formatMoneyInvoice(lineTotal, invoice);
|
lineTotal = formatMoneyInvoice(lineTotal, invoice);
|
||||||
|
|
||||||
rowStyle = (i % 2 == 0) ? 'odd' : 'even';
|
rowStyle = (i % 2 == 0) ? 'odd' : 'even';
|
||||||
|
@ -278,12 +278,11 @@
|
|||||||
|
|
||||||
<p> <br/> </p>
|
<p> <br/> </p>
|
||||||
|
|
||||||
<div class="row">
|
<center>
|
||||||
<div class="col-md-4 col-md-offset-4">
|
{!! Button::success(strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, true) ))
|
||||||
{!! Button::success(strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, true) ))->submit()->block()->large() !!}
|
->submit()
|
||||||
</div>
|
->large() !!}
|
||||||
</div>
|
</center>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user