Merge branch 'master' into discount-per-item
This commit is contained in:
@ -27,12 +27,16 @@ class Module extends FormRequest
|
||||
|
||||
$module = module($this->request->get('module_alias'));
|
||||
|
||||
if ($module->get('settings')) {
|
||||
foreach ($module->get('settings') as $field) {
|
||||
if (isset($field['attributes']['required'])) {
|
||||
$rules[$field['name']] = $field['attributes']['required'];
|
||||
}
|
||||
if (!$fields = $module->get('settings')) {
|
||||
return $rules;
|
||||
}
|
||||
|
||||
foreach ($fields as $field) {
|
||||
if (empty($field['rules'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$rules[$field['name']] = $field['rules'];
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -32,7 +32,7 @@ class Transfer extends Model
|
||||
|
||||
public function expense_account()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Banking\Account', 'expense_transaction.account_id', 'id');
|
||||
return $this->belongsTo('App\Models\Banking\Account', 'expense_transaction.account_id', 'id')->withDefault(['name' => trans('general.na')]);
|
||||
}
|
||||
|
||||
public function income_transaction()
|
||||
@ -42,6 +42,6 @@ class Transfer extends Model
|
||||
|
||||
public function income_account()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Banking\Account', 'income_transaction.account_id', 'id');
|
||||
return $this->belongsTo('App\Models\Banking\Account', 'income_transaction.account_id', 'id')->withDefault(['name' => trans('general.na')]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user