diff --git a/app/Constants.php b/app/Constants.php index fb1baf316b57..f38351c97cf3 100644 --- a/app/Constants.php +++ b/app/Constants.php @@ -158,7 +158,7 @@ if (! defined('APP_NAME')) { define('MAX_DOCUMENT_SIZE', env('MAX_DOCUMENT_SIZE', 10000)); // KB define('MAX_EMAIL_DOCUMENTS_SIZE', env('MAX_EMAIL_DOCUMENTS_SIZE', 10000)); // Total KB define('MAX_ZIP_DOCUMENTS_SIZE', env('MAX_EMAIL_DOCUMENTS_SIZE', 30000)); // Total KB (uncompressed) - define('MAX_EMAILS_SENT_PER_DAY', 200); + define('MAX_EMAILS_SENT_PER_DAY', 300); define('DOCUMENT_PREVIEW_SIZE', env('DOCUMENT_PREVIEW_SIZE', 300)); // pixels define('DEFAULT_FONT_SIZE', 9); define('DEFAULT_HEADER_FONT', 1); // Roboto diff --git a/app/Models/Account.php b/app/Models/Account.php index 98daf5a88fe5..742e00ee55be 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -72,22 +72,12 @@ class Account extends Eloquent 'work_phone', 'work_email', 'language_id', - 'custom_label1', - 'custom_value1', - 'custom_label2', - 'custom_value2', - 'custom_client_label1', - 'custom_client_label2', 'fill_products', 'update_products', 'primary_color', 'secondary_color', 'hide_quantity', 'hide_paid_to_date', - 'custom_invoice_label1', - 'custom_invoice_label2', - 'custom_invoice_taxes1', - 'custom_invoice_taxes2', 'vat_number', 'invoice_number_prefix', 'invoice_number_counter', @@ -112,8 +102,6 @@ class Account extends Eloquent 'num_days_reminder1', 'num_days_reminder2', 'num_days_reminder3', - 'custom_invoice_text_label1', - 'custom_invoice_text_label2', 'tax_name1', 'tax_rate1', 'tax_name2', @@ -142,8 +130,6 @@ class Account extends Eloquent 'show_currency_code', 'enable_portal_password', 'send_portal_password', - 'custom_invoice_item_label1', - 'custom_invoice_item_label2', 'recurring_invoice_number_prefix', 'enable_client_portal', 'invoice_fields', diff --git a/app/Models/AccountCustomSettings.php b/app/Models/AccountCustomSettings.php new file mode 100644 index 000000000000..cd1e534b21d2 --- /dev/null +++ b/app/Models/AccountCustomSettings.php @@ -0,0 +1,32 @@ +increments('id'); + $table->unsignedInteger('account_id')->index(); + $table->timestamps(); + + $table->string('custom_account_label1')->nullable(); + $table->string('custom_account_value1')->nullable(); + $table->string('custom_account_label2')->nullable(); + $table->string('custom_account_value2')->nullable(); + $table->string('custom_client_label1')->nullable(); + $table->string('custom_client_label2')->nullable(); + $table->string('custom_invoice_label1')->nullable(); + $table->string('custom_invoice_label2')->nullable(); + $table->string('custom_invoice_taxes1')->nullable(); + $table->string('custom_invoice_taxes2')->nullable(); + $table->string('custom_invoice_text_label1')->nullable(); + $table->string('custom_invoice_text_label2')->nullable(); + $table->string('custom_product_label1')->nullable(); + $table->string('custom_product_label2')->nullable(); + + $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); + }); + + DB::statement('insert into account_custom_settings (account_id, + custom_account_label1, + custom_account_value1, + custom_account_label2, + custom_account_value2, + custom_client_label1, + custom_client_label2, + custom_invoice_label1, + custom_invoice_label2, + custom_invoice_taxes1, + custom_invoice_taxes2, + custom_invoice_text_label1, + custom_invoice_text_label2, + custom_product_label1, + custom_product_label2 + ) + select id, + custom_label1, + custom_value1, + custom_label2, + custom_value2, + custom_client_label1, + custom_client_label2, + custom_invoice_label1, + custom_invoice_label2, + custom_invoice_taxes1, + custom_invoice_taxes2, + custom_invoice_text_label1, + custom_invoice_text_label2, + custom_invoice_item_label1, + custom_invoice_item_label2 + from accounts;'); + + Schema::table('accounts', function ($table) { + $table->dropColumn('custom_label1'); + $table->dropColumn('custom_value1'); + $table->dropColumn('custom_label2'); + $table->dropColumn('custom_value2'); + $table->dropColumn('custom_client_label1'); + $table->dropColumn('custom_client_label2'); + $table->dropColumn('custom_invoice_label1'); + $table->dropColumn('custom_invoice_label2'); + $table->dropColumn('custom_invoice_taxes1'); + $table->dropColumn('custom_invoice_taxes2'); + $table->dropColumn('custom_invoice_text_label1'); + $table->dropColumn('custom_invoice_text_label2'); + $table->dropColumn('custom_invoice_item_label1'); + $table->dropColumn('custom_invoice_item_label2'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}