1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #4514 from turbo124/v5-develop

add enable_product_discount to company table.
This commit is contained in:
David Bomba 2020-12-17 21:57:10 +11:00 committed by GitHub
commit c75bd84cbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 0 deletions

View File

@ -80,6 +80,7 @@ class Company extends BaseModel
'auto_start_tasks',
'is_disabled',
'default_task_is_date_based',
'enable_product_discount',
];
protected $hidden = [

View File

@ -19,6 +19,8 @@ class Country extends StaticModel
'eea' => 'boolean',
'swap_postal_code' => 'boolean',
'swap_currency_symbol' => 'boolean',
'thousand_separator' => 'string',
'decimal_separator' => 'string',
'updated_at' => 'timestamp',
'created_at' => 'timestamp',
'deleted_at' => 'timestamp',

View File

@ -147,6 +147,7 @@ class CompanyTransformer extends EntityTransformer
'show_tasks_table' => (bool) $company->show_tasks_table,
'use_credits_payment' => 'always', //todo remove
'default_task_is_date_based' => (bool)$company->default_task_is_date_based,
'enable_product_discount' => (bool)$company->enable_product_discount,
];
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddEnableProductDiscountFieldToCompaniesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('companies', function (Blueprint $table) {
$table->boolean('enable_product_discount')->default(false);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('companies', function (Blueprint $table) {
//
});
}
}