mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Bug fixes
This commit is contained in:
parent
35bb36fd34
commit
debc22d7d2
@ -54,7 +54,7 @@ class PublicClientController extends BaseController
|
|||||||
|
|
||||||
return Datatable::query($query)
|
return Datatable::query($query)
|
||||||
->addColumn('activities.id', function ($model) { return Utils::timestampToDateTimeString(strtotime($model->created_at)); })
|
->addColumn('activities.id', function ($model) { return Utils::timestampToDateTimeString(strtotime($model->created_at)); })
|
||||||
->addColumn('message', function ($model) {
|
->addColumn('activity_type_id', function ($model) {
|
||||||
$data = [
|
$data = [
|
||||||
'client' => Utils::getClientDisplayName($model),
|
'client' => Utils::getClientDisplayName($model),
|
||||||
'user' => $model->is_system ? ('<i>' . trans('texts.system') . '</i>') : ($model->user_first_name . ' ' . $model->user_last_name),
|
'user' => $model->is_system ? ('<i>' . trans('texts.system') . '</i>') : ($model->user_first_name . ' ' . $model->user_last_name),
|
||||||
|
@ -24,21 +24,18 @@ class CreatePaymentRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
$input = $this->input();
|
$input = $this->input();
|
||||||
|
$invoice = Invoice::scope($input['invoice'])->firstOrFail();
|
||||||
|
|
||||||
$rules = array(
|
$rules = array(
|
||||||
'client' => 'required',
|
'client' => 'required',
|
||||||
'invoice' => 'required',
|
'invoice' => 'required',
|
||||||
'amount' => 'required',
|
'amount' => 'required|less_than:{$invoice->balance}|positive',
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($input['payment_type_id'] == PAYMENT_TYPE_CREDIT) {
|
if ($input['payment_type_id'] == PAYMENT_TYPE_CREDIT) {
|
||||||
$rules['payment_type_id'] = 'has_credit:'.$input['client'].','.$input['amount'];
|
$rules['payment_type_id'] = 'has_credit:'.$input['client'].','.$input['amount'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($input['invoice']) && $input['invoice']) {
|
|
||||||
$invoice = Invoice::scope($input['invoice'])->firstOrFail();
|
|
||||||
$rules['amount'] .= "|less_than:{$invoice->balance}";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,6 +214,7 @@ class Utils
|
|||||||
'user_id' => Auth::check() ? Auth::user()->id : 0,
|
'user_id' => Auth::check() ? Auth::user()->id : 0,
|
||||||
'account_id' => Auth::check() ? Auth::user()->account_id : 0,
|
'account_id' => Auth::check() ? Auth::user()->account_id : 0,
|
||||||
'user_name' => Auth::check() ? Auth::user()->getDisplayName() : '',
|
'user_name' => Auth::check() ? Auth::user()->getDisplayName() : '',
|
||||||
|
'method' => Request::method(),
|
||||||
'url' => Input::get('url', Request::url()),
|
'url' => Input::get('url', Request::url()),
|
||||||
'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '',
|
'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '',
|
||||||
'ip' => Request::getClientIp(),
|
'ip' => Request::getClientIp(),
|
||||||
|
@ -380,6 +380,7 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
|
|
||||||
$this->account->setVisible([
|
$this->account->setVisible([
|
||||||
'name',
|
'name',
|
||||||
|
'website',
|
||||||
'id_number',
|
'id_number',
|
||||||
'vat_number',
|
'vat_number',
|
||||||
'address1',
|
'address1',
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<div class="container" style="min-height:400px">
|
<div class="container" style="min-height:400px">
|
||||||
<h3>Something went wrong...</h3>
|
<h3>Something went wrong...</h3>
|
||||||
<h4>{{ $error }}</h4>
|
<h4>{{ $error }}</h4>
|
||||||
<h4>If you'd like help please email us at contact@invoiceninja.com.</h4>
|
<h4>If you'd like help please email us at {{ env('MAIL_USERNAME') }}.</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user