Fixes for renaming company gateway columns

This commit is contained in:
David Bomba 2020-11-12 22:09:31 +11:00
parent f1c1243146
commit d8bb01430f
5 changed files with 34 additions and 2 deletions

View File

@ -553,7 +553,7 @@ class CompanySettings extends BaseSettings
foreach ($company_settings as $key => $value) {
if (! property_exists($settings, $key)) {
$settings->{ $key} = self::castAttribute($key, $company_settings->{ $key});
$settings->{$key} = self::castAttribute($key, $company_settings->{$key});
}
}

View File

@ -729,6 +729,7 @@ class InvoiceController extends BaseController
$invoice->service()->touchReminder($this->reminder_template)->save();
$invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($invoice) {
info("firing email");
EmailEntity::dispatch($invitation, $invoice->company, $this->reminder_template);
});

View File

@ -41,7 +41,7 @@ class CompanyGateway extends BaseModel
'require_billing_address',
'require_shipping_address',
'require_client_name',
'require_zip',
'require_postal_code',
'require_client_phone',
'require_contact_name',
'update_details',

View File

@ -53,6 +53,7 @@ class CompanyGatewayTransformer extends EntityTransformer
'require_shipping_address' => (bool) $company_gateway->require_shipping_address,
'require_client_name' => (bool) $company_gateway->require_client_name,
'require_zip' => (bool) $company_gateway->require_zip,
'require_postal_code' => (bool) $company_gateway->require_postal_code,
'require_client_phone' => (bool) $company_gateway->require_client_phone,
'require_contact_name' => (bool) $company_gateway->require_contact_name,
'require_contact_email' => (bool) $company_gateway->require_contact_email,

View File

@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CompanyGatewayRenameColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('company_gateways', function(Blueprint $table){
$table->renameColumn('require_zip', 'require_postal_code');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}