migrations for companies/accounts table

This commit is contained in:
David Bomba 2023-01-13 00:32:54 +11:00
parent 0497089e27
commit 5389c00c2f
6 changed files with 54 additions and 6 deletions

View File

@ -447,7 +447,13 @@ class CompanySettings extends BaseSettings
public $mailgun_domain = '';
public $auto_bill_standard_invoices = false;
public $email_alignment = 'center'; // center , left, right
public static $casts = [
'email_alignment' => 'string',
'auto_bill_standard_invoices' => 'bool',
'postmark_secret' => 'string',
'mailgun_secret' => 'string',
'mailgun_domain' => 'string',

View File

@ -502,7 +502,6 @@ class PurchaseOrderController extends BaseController
/*
* Download Purchase Order/s
*/
if ($action == 'bulk_download' && $purchase_orders->count() >= 1) {
$purchase_orders->each(function ($purchase_order) {
if (auth()->user()->cannot('view', $purchase_order)) {

View File

@ -66,6 +66,7 @@ class Company extends BaseModel
protected $presenter = CompanyPresenter::class;
protected $fillable = [
'invoice_task_hours',
'markdown_enabled',
'calculate_expense_tax_by_amount',
'invoice_expense_documents',

View File

@ -194,6 +194,7 @@ class CompanyTransformer extends EntityTransformer
'convert_payment_currency' => (bool) $company->convert_payment_currency,
'convert_expense_currency' => (bool) $company->convert_expense_currency,
'notify_vendor_when_paid' => (bool) $company->notify_vendor_when_paid,
'invoice_task_hours' => (bool) $company->invoice_task_hours,
];
}

View File

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

View File

@ -1,5 +1,6 @@
@php
$primary_color = isset($settings) ? $settings->primary_color : '#4caf50';
$email_alignment = isset($settings) ? $settings->email_alignment : 'center';
@endphp
@ -60,7 +61,8 @@
font-size: 13px;
padding: 15px 50px;
font-weight: 600;
margin-bottom: 30px;
margin-bottom: 5px;
margin-top: 10px;
}
#content h1 {
font-family: 'canada-type-gibson', 'roboto', Arial, Helvetica, sans-serif;
@ -146,8 +148,8 @@
</td>
</tr>
<tr>
<td cellpadding="20">
<div style="border: 1px solid #c2c2c2; border-top: none; border-bottom: none; padding: 20px; text-align: center" id="content">
<td cellpadding="5">
<div style="border: 1px solid #c2c2c2; border-top: none; border-bottom: none; padding: 20px; text-align: {{ $email_alignment }}" id="content">
<div style="padding-top: 10px;"></div>
{{ $slot ?? '' }}
@ -163,8 +165,8 @@
</tr>
<tr>
<td height="20">
<div style="border: 1px solid #c2c2c2; border-top: none; border-bottom: none; padding: 20px; text-align: center" id="content"> </div>
<td height="0">
<div style="border: 1px solid #c2c2c2; border-top: none; border-bottom: none; padding: 5px; text-align: center" id="content"> </div>
</td>
</tr>