Merge branch 'master' of github.com:akaunting/akaunting

This commit is contained in:
Cüneyt Şentürk 2021-06-23 15:50:20 +03:00
commit ae0c6dc7d2
19 changed files with 23 additions and 23 deletions

View File

@ -39,7 +39,7 @@ abstract class Controller extends BaseController
*/
public function paginate($items, $perPage = 15, $page = null, $options = [])
{
$perPage = $perPage ?: request('limit', setting('default.list_limit', '25'));
$perPage = $perPage ?: (int) request('limit', setting('default.list_limit', '25'));
$page = $page ?: (Paginator::resolveCurrentPage() ?: 1);

View File

@ -113,7 +113,7 @@ abstract class Model extends Eloquent implements Ownable
return $query->get();
}
$limit = $request->get('limit', setting('default.list_limit', '25'));
$limit = (int) $request->get('limit', setting('default.list_limit', '25'));
return $query->paginate($limit);
}

View File

@ -87,7 +87,7 @@ class Vendors extends Controller
$amounts['paid'] += $item->getAmountConvertedToDefault();
});
$limit = request('limit', setting('default.list_limit', '25'));
$limit = (int) request('limit', setting('default.list_limit', '25'));
$transactions = $this->paginate($transactions->sortByDesc('paid_at'), $limit);
$bills = $this->paginate($bills->sortByDesc('issued_at'), $limit);

View File

@ -85,7 +85,7 @@ class Customers extends Controller
$amounts['paid'] += $item->getAmountConvertedToDefault();
});
$limit = request('limit', setting('default.list_limit', '25'));
$limit = (int) request('limit', setting('default.list_limit', '25'));
$transactions = $this->paginate($transactions->sortByDesc('paid_at'), $limit);
$invoices = $this->paginate($invoices->sortByDesc('issued_at'), $limit);

View File

@ -42,7 +42,7 @@ class Permission extends LaratrustPermission
$request = request();
$search = $request->get('search');
$limit = $request->get('limit', setting('default.list_limit', '25'));
$limit = (int) $request->get('limit', setting('default.list_limit', '25'));
return $query->usingSearchString($search)->sortable($sort)->paginate($limit);
}

View File

@ -35,7 +35,7 @@ class Role extends LaratrustRole
$request = request();
$search = $request->get('search');
$limit = $request->get('limit', setting('default.list_limit', '25'));
$limit = (int) $request->get('limit', setting('default.list_limit', '25'));
return $query->usingSearchString($search)->sortable($sort)->paginate($limit);
}

View File

@ -176,7 +176,7 @@ class User extends Authenticatable implements HasLocalePreference
$request = request();
$search = $request->get('search');
$limit = $request->get('limit', setting('default.list_limit', '25'));
$limit = (int) $request->get('limit', setting('default.list_limit', '25'));
return $query->usingSearchString($search)->sortable($sort)->paginate($limit);
}

View File

@ -342,7 +342,7 @@ class Company extends Eloquent implements Ownable
return $query->get();
}
$limit = $request->get('limit', setting('default.list_limit', '25'));
$limit = (int) $request->get('limit', setting('default.list_limit', '25'));
return $query->paginate($limit);
}

View File

@ -20,9 +20,9 @@ class Account extends TransformerAbstract
'number' => $model->number,
'currency_code' => $model->currency_code,
'opening_balance' => $model->opening_balance,
'opening_balance_format' => money($model->opening_balance, $model->currency_code, true)->format(),
'opening_balance_formatted' => money($model->opening_balance, $model->currency_code, true)->format(),
'current_balance' => $model->balance,
'current_balance_format' => money($model->balance, $model->currency_code, true)->format(),
'current_balance_formatted' => money($model->balance, $model->currency_code, true)->format(),
'bank_name' => $model->bank_name,
'bank_phone' => $model->bank_phone,
'bank_address' => $model->bank_address,

View File

@ -25,7 +25,7 @@ class Reconciliation extends TransformerAbstract
'started_at' => $model->started_at->toIso8601String(),
'ended_at' => $model->ended_at->toIso8601String(),
'closing_balance' => $model->closing_balance,
'closing_balance_format' => money($model->closing_balance, setting('default.currency'), true)->format(),
'closing_balance_formatted' => money($model->closing_balance, setting('default.currency'), true)->format(),
'reconciled' => $model->reconciled,
'created_by' => $model->created_by,
'created_at' => $model->created_at->toIso8601String(),

View File

@ -28,7 +28,7 @@ class Transaction extends TransformerAbstract
'account_id' => $model->account_id,
'paid_at' => $model->paid_at->toIso8601String(),
'amount' => $model->amount,
'amount_format' => money($model->amount, $model->currency_code, true)->format(),
'amount_formatted' => money($model->amount, $model->currency_code, true)->format(),
'currency_code' => $model->currency_code,
'currency_rate' => $model->currency_rate,
'document_id' => $model->document_id,

View File

@ -29,7 +29,7 @@ class Transfer extends TransformerAbstract
'to_account' => $income_transaction->account->name,
'to_account_id' => $income_transaction->account->id,
'amount' => $expense_transaction->amount,
'amount_format' => money($expense_transaction->amount, $expense_transaction->currency_code, true)->format(),
'amount_formatted' => money($expense_transaction->amount, $expense_transaction->currency_code, true)->format(),
'currency_code' => $expense_transaction->currency_code,
'paid_at' => $expense_transaction->paid_at ? $expense_transaction->paid_at->toIso8601String() : '',
'created_by' => $model->created_by,

View File

@ -25,9 +25,9 @@ class Item extends TransformerAbstract
'name' => $model->name,
'description' => $model->description,
'sale_price' => $model->sale_price,
'sale_price_format' => money($model->sale_price, setting('default.currency'), true)->format(),
'sale_price_formatted' => money($model->sale_price, setting('default.currency'), true)->format(),
'purchase_price' => $model->purchase_price,
'purchase_price_format' => money($model->purchase_price, setting('default.currency'), true)->format(),
'purchase_price_formatted' => money($model->purchase_price, setting('default.currency'), true)->format(),
'category_id' => $model->category_id,
'tax_ids' => $model->tax_ids,
'picture' => $model->picture,

View File

@ -31,7 +31,7 @@ class Document extends TransformerAbstract
'issued_at' => $model->issued_at ? $model->issued_at->toIso8601String() : '',
'due_at' => $model->due_at ? $model->due_at->toIso8601String() : '',
'amount' => $model->amount,
'amount_format' => money($model->amount, $model->currency_code, true)->format(),
'amount_formatted' => money($model->amount, $model->currency_code, true)->format(),
'currency_code' => $model->currency_code,
'currency_rate' => $model->currency_rate,
'contact_id' => $model->contact_id,

View File

@ -21,9 +21,9 @@ class DocumentItem extends TransformerAbstract
'item_id' => $model->item_id,
'name' => $model->name,
'price' => $model->price,
'price_format' => money($model->price, $model->document->currency_code, true)->format(),
'price_formatted' => money($model->price, $model->document->currency_code, true)->format(),
'total' => $model->total,
'total_format' => money($model->total, $model->document->currency_code, true)->format(),
'total_formatted' => money($model->total, $model->document->currency_code, true)->format(),
'tax' => $model->tax,
'tax_id' => $model->tax_id,
'created_at' => $model->created_at ? $model->created_at->toIso8601String() : '',

View File

@ -28,7 +28,7 @@ class DocumentItemTax extends TransformerAbstract
'tax_id' => $model->tax_id,
'name' => $model->name,
'amount' => $model->amount,
'amount_format' => money($model->amount, $model->document->currency_code, true)->format(),
'amount_formatted' => money($model->amount, $model->document->currency_code, true)->format(),
'created_at' => $model->created_at ? $model->created_at->toIso8601String() : '',
'updated_at' => $model->updated_at ? $model->updated_at->toIso8601String() : '',
];

View File

@ -22,7 +22,7 @@ class DocumentTotal extends TransformerAbstract
'code' => $model->code,
'name' => $model->name,
'amount' => $model->amount,
'amount_format' => money($model->amount, $model->document->currency_code, true)->format(),
'amount_formatted' => money($model->amount, $model->document->currency_code, true)->format(),
'sort_order' => $model->sort_order,
'created_at' => $model->created_at ? $model->created_at->toIso8601String() : '',
'updated_at' => $model->updated_at ? $model->updated_at->toIso8601String() : '',

View File

@ -6,8 +6,8 @@ return [
'last_login' => 'Last login :time',
'notifications' => [
'counter' => '{0} You have no notification|{1} You have :count notification|[2,*] You have :count notifications',
'new_apps' => '{1} :count published app|[2,*] :count published apps',
'counter' => '{0} You have no new notifications|{1} You have :count new notification|[2,*] You have :count new notifications',
'new_apps' => '{1} :count new app is published|[2,*] :count new apps published',
'overdue_invoices' => '{1} :count overdue invoice|[2,*] :count overdue invoices',
'upcoming_bills' => '{1} :count upcoming bill|[2,*] :count upcoming bills',
'view_all' => 'View All',

View File

@ -70,7 +70,7 @@ return [
'messages' => [
'mark_read' => ':type is read this notification!',
'mark_read_all' => ':type is read all notification!',
'mark_read_all' => ':type is read all notifications!',
'new_app' => ':type app published.',
'export' => 'Your <b>:type</b> export file is ready to <a href=":url" target="_blank"><b>download</b></a>.',
'import' => 'Your <b>:type</b> lined <b>:count</b> data is imported successfully.',