mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Add a setting for the depreciation method
This commit is contained in:
parent
49ecc08398
commit
8d3b201a49
|
@ -351,6 +351,8 @@ class SettingsController extends Controller
|
|||
$setting->thumbnail_max_h = $request->input('thumbnail_max_h');
|
||||
$setting->privacy_policy_link = $request->input('privacy_policy_link');
|
||||
|
||||
$setting->depreciation_method = $request->input('depreciation_method');
|
||||
|
||||
if (Input::get('per_page')!='') {
|
||||
$setting->per_page = $request->input('per_page');
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddDepreciationOptionToSettings extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->char('depreciation_method', 10)->nullable()->default('default');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->dropColumn('depreciation_method');
|
||||
});
|
||||
}
|
||||
}
|
|
@ -281,6 +281,20 @@
|
|||
{{ Form::checkbox('show_in_model_list[]', 'model_number', Input::old('show_in_model_list', $snipeSettings->modellistCheckedValue('model_number')),array('class' => 'minimal')) }} {{ trans('general.model_no') }}<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Depreciation method -->
|
||||
<div class="form-group {{ $errors->has('depreciation_method') ? 'error' : '' }}">
|
||||
<div class="col-md-3">
|
||||
{{ Form::label('depreciation_method', trans('Depreciation method')) }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ Form::select('depreciation_method', array(
|
||||
'default' => 'Linear (default)',
|
||||
'half_1' => 'Half-year convention, always applied',
|
||||
'half_2' => 'Half-year convention, applied with condition',
|
||||
), Input::old('username_format', $setting->depreciation_method)) }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.form-group -->
|
||||
|
||||
<!-- Privacy Policy Footer-->
|
||||
|
|
Loading…
Reference in a new issue