This commit is contained in:
Hillel Coren 2016-01-28 16:07:03 +02:00
parent 680b8edefd
commit 89622f86e2
9 changed files with 23 additions and 30 deletions

View File

@ -280,9 +280,7 @@ class AppController extends BaseController
return '';
}
if (Utils::getResllerType() == RESELLER_LIMITED_USERS) {
return User::count();
} else {
if (Utils::getResllerType() == RESELLER_REVENUE_SHARE) {
$payments = DB::table('accounts')
->leftJoin('payments', 'payments.account_id', '=', 'accounts.id')
->leftJoin('clients', 'clients.id', '=', 'payments.client_id')
@ -294,7 +292,16 @@ class AppController extends BaseController
'payments.payment_date',
'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);
}
}
}

View File

@ -60,7 +60,7 @@ class ExpenseController extends BaseController
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)

View File

@ -24,10 +24,6 @@ class AccountRepository
{
public function create($firstName = '', $lastName = '', $email = '', $password = '')
{
if (Utils::getResllerType() == RESELLER_LIMITED_USERS && User::count() >= 1000) {
return false;
}
$account = new Account();
$account->ip = Request::getClientIp();
$account->account_key = str_random(RANDOM_KEY_LENGTH);

View File

@ -61,7 +61,7 @@ class ExpenseRepository extends BaseRepository
->where('clients.deleted_at', '=', null)
->where(function ($query) {
$query->where('contacts.is_primary', '=', true)
->orWhere('contacts.is_primary', '=', null);
->orWhere('contacts.is_primary', '=', null);
})
->select(
'expenses.account_id',
@ -99,7 +99,9 @@ class ExpenseRepository extends BaseRepository
if ($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.'%');
});
}

View File

@ -118,7 +118,7 @@ class ExpenseService extends BaseService
[
'expense_date',
function ($model) {
return $model->expense_date;
return Utils::dateToString($model->expense_date);
}
],
[

View File

@ -3385,9 +3385,4 @@ ul.user-accounts a:hover div.remove {
div.panel-body div.panel-body {
padding-bottom: 0px;
}
.vcenter {
display: inline-block;
vertical-align: middle;
}

View File

@ -31238,9 +31238,6 @@ NINJA.invoiceLines = function(invoice) {
}
var lineTotal = roundToTwo(NINJA.parseFloat(item.cost)) * roundToTwo(NINJA.parseFloat(item.qty));
if (showItemTaxes && tax) {
lineTotal += lineTotal * tax / 100;
}
lineTotal = formatMoneyInvoice(lineTotal, invoice);
rowStyle = (i % 2 == 0) ? 'odd' : 'even';

View File

@ -334,9 +334,6 @@ NINJA.invoiceLines = function(invoice) {
}
var lineTotal = roundToTwo(NINJA.parseFloat(item.cost)) * roundToTwo(NINJA.parseFloat(item.qty));
if (showItemTaxes && tax) {
lineTotal += lineTotal * tax / 100;
}
lineTotal = formatMoneyInvoice(lineTotal, invoice);
rowStyle = (i % 2 == 0) ? 'odd' : 'even';

View File

@ -278,12 +278,11 @@
<p>&nbsp;<br/>&nbsp;</p>
<div class="row">
<div class="col-md-4 col-md-offset-4">
{!! Button::success(strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, true) ))->submit()->block()->large() !!}
</div>
</div>
<center>
{!! Button::success(strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, true) ))
->submit()
->large() !!}
</center>
</div>